コード例 #1
0
ファイル: STLComposer.cs プロジェクト: tojoshua/Repetier-Host
        public void openAndAddObject(string file)
        {
            PrintModel model = new PrintModel();
            FileInfo   f     = new FileInfo(file);

            InfoProgressPanel ipp = InfoProgressPanel.Create(Trans.T1("IMPORTING_1", f.Name), true);

            ipp.Action = Trans.T("L_LOADING...");
            ipp.Dock   = DockStyle.Top;
            panelControls.Controls.Add(ipp);
            panelControls.Update();
            model.Load(file, ipp);
            model.Center(Main.printerSettings.PrintAreaWidth / 2, Main.printerSettings.PrintAreaDepth / 2);
            model.Land();
            if (model.ActiveModel.triangles.Count > 0)
            {
                AddObject(model);
                cont.models.AddLast(model);

                Autoposition();
                model.addAnimation(new DropAnimation("drop"));
                updateSTLState(model);
            }
            else
            {
                if (!ipp.IsKilled)
                {
                    MessageBox.Show(Trans.T1("L_LOADING_3D_FAILED", file), Trans.T("L_ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            ipp.Finished();
        }
コード例 #2
0
ファイル: PrintModel.cs プロジェクト: rdacomp/Repetier-Host2
 public void reload()
 {
     if (File.Exists(filename))
     {
         InfoProgressPanel ipp = InfoProgressPanel.Create(Trans.T1("IMPORTING_1", name), true);
         ipp.Action = Trans.T("L_LOADING...");
         ipp.Dock   = DockStyle.Top;
         Main.main.objectPlacement.panelControls.Controls.Add(ipp);
         Main.main.objectPlacement.panelControls.Update();
         Load(filename, ipp);
         Land();
         ForceViewRegeneration();
         ipp.Finished();
     }
 }
コード例 #3
0
        private void buttonAnalyse_Click(object sender, EventArgs e)
        {
            if (listObjects.SelectedItems.Count != 1)
            {
                return;
            }
            PrintModel model = (PrintModel)ListObjects(true).First.Value;

            if (model != null)
            {
                InfoProgressPanel ipp = InfoProgressPanel.Create(Trans.T("L_ANAYLSING"), true);
                ipp.Action = ""; // Trans.T("L_LOADING...");
                ipp.Dock   = DockStyle.Top;
                panelControls.Controls.Add(ipp);
                panelControls.Update();
                model.DeepAnalysis(ipp);
                ipp.Finished();
                UpdateAnalyserData();
            }
        }