Пример #1
0
 private void FileImport_Popup(object sender, System.EventArgs e)
 {
     IE.Form2 curForm = (IE.Form2) this.ActiveMdiChild;
     if (curForm == null)
     {
         return;
     }
     if (curForm.View.IsObjectSelected())
     {
         this.ExportBRep.Enabled = true;
         this.ExportIges.Enabled = true;
         this.ExportStep.Enabled = true;
         this.ExportVrml.Enabled = true;
         this.ExportStl.Enabled  = true;
     }
 }
Пример #2
0
        private void menuItem4_Click(object sender, System.EventArgs e)
        {
            IE.Form2 curForm = (IE.Form2) this.ActiveMdiChild;
            IE.Form2 newView = new Form2();
            newView.MdiParent = this;
            newView.Show();
            newView.InitView();
            newView.SetContext(curForm.View);
            newView.View.CreateNewView(newView.Handle);
            string title = curForm.Text;

            System.Text.StringBuilder bld = new System.Text.StringBuilder(title);
            char   c        = bld[title.Length - 1];
            string s        = c.ToString();
            int    NbOfView = newView.View.CharToInt(s);

            NbOfView++;
            bld.Remove(title.Length - 1, 1);
            bld.Append(NbOfView);
            newView.Text = bld.ToString();
        }
Пример #3
0
        private void toolBarView_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            IE.Form2 curForm = (IE.Form2) this.ActiveMdiChild;
            if (curForm == null)
            {
                return;
            }
            switch (toolBarView.Buttons.IndexOf(e.Button))
            {
            case 0:
                curForm.View.ZoomAllView();
                break;

            case 1:
                curForm.Mode        = CurrentAction3d.CurAction3d_WindowZooming;
                this.ZoomWin.Pushed = true;
                break;

            case 2:
                curForm.Mode = CurrentAction3d.CurAction3d_DynamicZooming;
                break;

            case 3:
                curForm.Mode = CurrentAction3d.CurAction3d_DynamicPanning;
                break;

            case 4:
                curForm.Zoom = curForm.View.Scale();
                curForm.Mode = CurrentAction3d.CurAction3d_GlobalPanning;
                break;

            case 5:
                curForm.View.FrontView();
                break;

            case 6:
                curForm.View.TopView();
                break;

            case 7:
                curForm.View.LeftView();
                break;

            case 8:
                curForm.View.BackView();
                break;

            case 9:
                curForm.View.RightView();
                break;

            case 10:
                curForm.View.BottomView();
                break;

            case 11:
                curForm.View.AxoView();
                break;

            case 12:
                curForm.Mode = CurrentAction3d.CurAction3d_DynamicRotation;
                break;

            case 13:
                curForm.View.Reset();
                break;

            case 14:
                curForm.View.SetDegenerateModeOn();
                curForm.DegenerateMode = true;
                this.HlrOff.Pushed     = false;
                this.HlrOn.Pushed      = true;
                break;

            case 15:
                curForm.View.SetDegenerateModeOff();
                curForm.DegenerateMode = false;
                this.HlrOn.Pushed      = false;
                this.HlrOff.Pushed     = true;
                break;

            default:
                break;
            }
        }
Пример #4
0
        public void SelectionChanged()
        {
            if (this.MdiChildren.Length == 0)
            {
                return;
            }
            IE.Form2 curForm = (IE.Form2) this.ActiveMdiChild;
            if (curForm == null)
            {
                return;
            }
            switch (curForm.View.DisplayMode())
            {
            case -1:
                this.shading.Enabled   = false;
                this.wireframe.Enabled = false;
                break;

            case 0:
                this.wireframe.Enabled    = false;
                this.shading.Enabled      = true;
                this.transparency.Enabled = false;
                break;

            case 1:
                this.wireframe.Enabled    = true;
                this.shading.Enabled      = false;
                this.transparency.Enabled = true;
                break;

            case 10:
                this.wireframe.Enabled    = true;
                this.shading.Enabled      = true;
                this.transparency.Enabled = true;
                break;

            default:
                break;
            }
            bool IsSelected = curForm.View.IsObjectSelected();

            if (IsSelected)
            {
                this.color.Enabled    = true;
                this.material.Enabled = true;
                this.delete.Enabled   = true;
            }
            else
            {
                this.color.Enabled        = false;
                this.material.Enabled     = false;
                this.transparency.Enabled = false;
                this.delete.Enabled       = false;
            }
            if (curForm.DegenerateMode)
            {
                this.HlrOff.Pushed = false;
                this.HlrOn.Pushed  = true;
            }
            else
            {
                this.HlrOff.Pushed = true;
                this.HlrOn.Pushed  = false;
            }
            if (curForm.Mode == IE.CurrentAction3d.CurAction3d_WindowZooming)
            {
                this.ZoomWin.Pushed = false;
            }
        }