3 using System.Collections;
4 using System.ComponentModel;
5 using System.Windows.Forms;
10 public enum CurrentAction3d
13 CurAction3d_DynamicZooming,
14 CurAction3d_WindowZooming,
15 CurAction3d_DynamicPanning,
16 CurAction3d_GlobalPanning,
17 CurAction3d_DynamicRotation
19 public enum CurrentPressedKey
21 CurPressedKey_Nothing,
25 public enum ModelFormat
36 /// Summary description for Form2.
38 public class Form2 : System.Windows.Forms.Form
40 private System.ComponentModel.IContainer components;
45 // Required for Windows Form Designer support
47 InitializeComponent();
50 // TODO: Add any constructor code after InitializeComponent call
53 myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
54 myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Nothing;
55 myDegenerateModeIsOn=true;
60 /// Clean up any resources being used.
62 protected override void Dispose( bool disposing )
66 if(components != null)
71 base.Dispose( disposing );
74 #region Windows Form Designer generated code
76 /// Required method for Designer support - do not modify
77 /// the contents of this method with the code editor.
79 private void InitializeComponent()
81 this.components = new System.ComponentModel.Container();
82 System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form2));
83 this.imageList1 = new System.Windows.Forms.ImageList(this.components);
84 this.myPopup = new System.Windows.Forms.ContextMenu();
85 this.menuItem1 = new System.Windows.Forms.MenuItem();
86 this.myPopupObject = new System.Windows.Forms.ContextMenu();
87 this.ContextWireframe = new System.Windows.Forms.MenuItem();
88 this.ContextShading = new System.Windows.Forms.MenuItem();
89 this.ContextColor = new System.Windows.Forms.MenuItem();
90 this.ContextMaterial = new System.Windows.Forms.MenuItem();
91 this.ContMatBrass = new System.Windows.Forms.MenuItem();
92 this.ContMenBronze = new System.Windows.Forms.MenuItem();
93 this.ContMenCopper = new System.Windows.Forms.MenuItem();
94 this.ContMenGold = new System.Windows.Forms.MenuItem();
95 this.ContMenPewt = new System.Windows.Forms.MenuItem();
96 this.ContMenPlaster = new System.Windows.Forms.MenuItem();
97 this.ContMenPlastic = new System.Windows.Forms.MenuItem();
98 this.ContMenSilver = new System.Windows.Forms.MenuItem();
99 this.ContMenTranc = new System.Windows.Forms.MenuItem();
100 this.ContMenDelete = new System.Windows.Forms.MenuItem();
104 this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
105 this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
106 this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
110 this.myPopup.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
115 this.menuItem1.Index = 0;
116 this.menuItem1.Text = "Change &Background";
117 this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
121 this.myPopupObject.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
122 this.ContextWireframe,
125 this.ContextMaterial,
127 this.ContMenDelete});
128 this.myPopupObject.Popup += new System.EventHandler(this.myPopupObject_Popup);
132 this.ContextWireframe.Index = 0;
133 this.ContextWireframe.Text = "Wireframe";
134 this.ContextWireframe.Click += new System.EventHandler(this.ContextWireframe_Click);
138 this.ContextShading.Index = 1;
139 this.ContextShading.Text = "Shading";
140 this.ContextShading.Click += new System.EventHandler(this.ContextShading_Click);
144 this.ContextColor.Index = 2;
145 this.ContextColor.Text = "Color";
146 this.ContextColor.Click += new System.EventHandler(this.ContextColor_Click);
150 this.ContextMaterial.Index = 3;
151 this.ContextMaterial.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
159 this.ContMenSilver});
160 this.ContextMaterial.Text = "Material";
164 this.ContMatBrass.Index = 0;
165 this.ContMatBrass.Text = "&Brass";
166 this.ContMatBrass.Click += new System.EventHandler(this.ContMatBrass_Click);
170 this.ContMenBronze.Index = 1;
171 this.ContMenBronze.Text = "&Bronze";
172 this.ContMenBronze.Click += new System.EventHandler(this.ContMenBronze_Click);
176 this.ContMenCopper.Index = 2;
177 this.ContMenCopper.Text = "&Copper";
178 this.ContMenCopper.Click += new System.EventHandler(this.ContMenCopper_Click);
182 this.ContMenGold.Index = 3;
183 this.ContMenGold.Text = "&Gold";
184 this.ContMenGold.Click += new System.EventHandler(this.ContMenGold_Click);
188 this.ContMenPewt.Index = 4;
189 this.ContMenPewt.Text = "&Pewter";
190 this.ContMenPewt.Click += new System.EventHandler(this.ContMenPewt_Click);
194 this.ContMenPlaster.Index = 5;
195 this.ContMenPlaster.Text = "&Plaster";
196 this.ContMenPlaster.Click += new System.EventHandler(this.ContMenPlaster_Click);
200 this.ContMenPlastic.Index = 6;
201 this.ContMenPlastic.Text = "&Plastic";
202 this.ContMenPlastic.Click += new System.EventHandler(this.ContMenPlastic_Click);
206 this.ContMenSilver.Index = 7;
207 this.ContMenSilver.Text = "&Silver";
208 this.ContMenSilver.Click += new System.EventHandler(this.ContMenSilver_Click);
212 this.ContMenTranc.Index = 4;
213 this.ContMenTranc.Text = "&Trancparency";
214 this.ContMenTranc.Click += new System.EventHandler(this.ContMenTranc_Click);
218 this.ContMenDelete.Index = 5;
219 this.ContMenDelete.Text = "&Delete";
220 this.ContMenDelete.Click += new System.EventHandler(this.ContMenDelete_Click);
224 this.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
225 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
226 this.ClientSize = new System.Drawing.Size(320, 261);
227 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
228 this.ImeMode = System.Windows.Forms.ImeMode.NoControl;
230 this.Text = "Document";
231 this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
232 this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form2_KeyDown);
233 this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseDown);
234 this.SizeChanged += new System.EventHandler(this.Form2_SizeChanged);
235 this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseUp);
236 this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form2_KeyUp);
237 this.Closed += new System.EventHandler(this.Form2_Closed);
238 this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form2_Paint);
239 this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseMove);
244 private System.Windows.Forms.ImageList imageList1;
245 private System.Windows.Forms.ContextMenu myPopup;
246 private System.Windows.Forms.ContextMenu myPopupObject;
247 private System.Windows.Forms.MenuItem ContextWireframe;
248 private System.Windows.Forms.MenuItem ContextShading;
249 private System.Windows.Forms.MenuItem ContextColor;
250 private System.Windows.Forms.MenuItem ContextMaterial;
251 private System.Windows.Forms.MenuItem ContMatBrass;
252 private System.Windows.Forms.MenuItem ContMenBronze;
253 private System.Windows.Forms.MenuItem ContMenCopper;
254 private System.Windows.Forms.MenuItem ContMenGold;
255 private System.Windows.Forms.MenuItem ContMenPewt;
256 private System.Windows.Forms.MenuItem ContMenPlaster;
257 private System.Windows.Forms.MenuItem ContMenPlastic;
258 private System.Windows.Forms.MenuItem ContMenSilver;
259 private System.Windows.Forms.MenuItem ContMenTranc;
260 private System.Windows.Forms.MenuItem ContMenDelete;
261 private System.Windows.Forms.MenuItem menuItem1;
263 private shell myView;
265 public void InitV3D()
268 if( !myView.InitViewer(this.Handle) )
269 MessageBox.Show("Fatal Error during the graphic initialisation", "Error!",
270 MessageBoxButtons.OK, MessageBoxIcon.Error);
273 public bool ImportBRep(System.String filename)
275 return myView.ImportBrep(filename);
278 private void Form2_SizeChanged(object sender, System.EventArgs e)
283 private void Form2_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
289 protected CurrentAction3d myCurrentMode;
290 protected CurrentPressedKey myCurrentPressedKey;
291 protected float myCurZoom;// ~ Quantity_Factor
292 protected bool myDegenerateModeIsOn;
293 protected int myXmin;
294 protected int myYmin;
295 protected int myXmax;
296 protected int myYmax;
297 protected int theButtonDownX;
298 protected int theButtonDownY;
299 // for erasing of rectangle
300 protected int theRectDownX;
301 protected int theRectDownY;
302 protected bool IsRectVisible;
304 private void Form2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
308 case MouseButtons.Left:
309 myXmin=e.X; myYmin=e.Y;
310 myXmax=e.X; myYmax=e.Y;
311 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
312 // start the dinamic zooming....
313 myCurrentMode=CurrentAction3d.CurAction3d_DynamicZooming;
316 switch(myCurrentMode)
318 case CurrentAction3d.CurAction3d_Nothing:
319 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
320 MultiDragEvent(myXmax, myYmax, -1);
322 DragEvent(myXmax, myYmax, -1);
324 case CurrentAction3d.CurAction3d_DynamicRotation:
325 if (!myDegenerateModeIsOn)
326 myView.SetDegenerateModeOn();
328 myView.StartRotation(e.X, e.Y);
330 case IE.CurrentAction3d.CurAction3d_WindowZooming:
331 this.Cursor=System.Windows.Forms.Cursors.Hand;
338 case MouseButtons.Right:
339 //MessageBox.Show("right mouse button is down");
340 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
342 if (!myDegenerateModeIsOn)
343 myView.SetDegenerateModeOn();
344 myView.StartRotation(e.X, e.Y);
355 private void Form2_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
358 myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Shift;
360 myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Ctrl;
363 private void Form2_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
365 myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Nothing;
368 protected void MultiDragEvent(int x, int y, int theState)
375 else if (theState==1)
376 myView.ShiftSelect(Math.Min(theButtonDownX,x), Math.Min(theButtonDownY,y),
377 Math.Max(theButtonDownX, x), Math.Max(theButtonDownY, y));
380 protected void DragEvent(int x, int y, int theState)
382 if (theState==-1) //mouse is down
387 else if (theState==1) //mouse is up
389 myView.Select(Math.Min(theButtonDownX, x), Math.Min(theButtonDownY,y),
390 Math.Max(theButtonDownX, x), Math.Max(theButtonDownY,y));
394 protected void Popup(int x, int y)
396 System.Drawing.Point p = new Point(x,y);
397 if (this.myView.IsObjectSelected())
398 this.myPopupObject.Show(this, p);
400 this.myPopup.Show(this, p);
403 private void Form2_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
407 case MouseButtons.Left:
408 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
410 switch(myCurrentMode)
412 case CurrentAction3d.CurAction3d_Nothing:
413 if( e.X==myXmin && e.Y==myYmin)
415 myXmax=e.X; myYmax=e.Y;
416 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
417 MultiInputEvent(myXmax, myYmax);
419 InputEvent(myXmax, myYmax);
423 myXmax=e.X; myYmax=e.Y;
424 DrawRectangle(false);
425 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
426 MultiDragEvent(myXmax, myYmax, 1);
428 DragEvent(myXmax, myYmax, 1);
431 case CurrentAction3d.CurAction3d_DynamicZooming:
432 myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
434 case CurrentAction3d.CurAction3d_WindowZooming:
435 myXmax=e.X; myYmax=e.Y;
436 DrawRectangle(false);
438 if (Math.Abs(myXmax-myXmin)>ValZWMin && Math.Abs(myXmax-myYmax)>ValZWMin)
439 myView.WindowFitAll(myXmin, myYmin, myXmax, myYmax);
440 this.Cursor=System.Windows.Forms.Cursors.Default;
441 IE.Form1 f = (IE.Form1)this.ParentForm;
442 f.SelectionChanged();
443 myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
445 case CurrentAction3d.CurAction3d_DynamicPanning:
446 myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
448 case CurrentAction3d.CurAction3d_GlobalPanning:
449 myView.Place(e.X, e.Y, myCurZoom);
450 myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
452 case CurrentAction3d.CurAction3d_DynamicRotation:
453 myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
454 if (!myDegenerateModeIsOn)
456 myView.SetDegenerateModeOff();
457 myDegenerateModeIsOn=false;
461 myView.SetDegenerateModeOn();
462 myDegenerateModeIsOn=true;
470 case MouseButtons.Right:
471 if (!myDegenerateModeIsOn)
473 myView.SetDegenerateModeOff();
474 myDegenerateModeIsOn=false;
478 myView.SetDegenerateModeOn();
479 myDegenerateModeIsOn=true;
486 IE.Form1 parent = (IE.Form1)this.ParentForm;
487 parent.SelectionChanged();
490 protected void MultiInputEvent(int x, int y)
492 myView.ShiftSelect();
495 protected void InputEvent(int x, int y)
500 private void DrawRectangle(bool draw)
502 Graphics gr = Graphics.FromHwnd(this.Handle);
503 System.Drawing.Pen p = null;
504 if (this.IsRectVisible ||(!draw))//erase the rect
506 int r=myView.GetBGColR();
507 int g=myView.GetBGColG();
508 int b=myView.GetBGColB();
509 p = new Pen(System.Drawing.Color.FromArgb( r,g, b));
510 this.IsRectVisible=false;
511 this.myView.UpdateView();
515 p = new Pen(System.Drawing.Color.White);
516 this.IsRectVisible=true;
520 int x=Math.Min(this.myXmin, this.myXmax);
521 int y=Math.Min(this.myYmin, this.myYmax);
522 gr.DrawRectangle(p, x, y, Math.Abs(myXmax-myXmin), Math.Abs(myYmax - myYmin));
523 this.theRectDownX=Math.Max(this.myXmin, this.myXmax);
524 this.theRectDownY=Math.Max(this.myYmin, this.myYmax);
527 private void Form2_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
529 if (e.Button == MouseButtons.Left) //left button is pressed
531 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
533 myView.Zoom(myXmax, myYmax, e.X, e.Y);
534 myXmax=e.X; myYmax=e.Y;
538 switch (myCurrentMode)
540 case CurrentAction3d.CurAction3d_Nothing:
541 DrawRectangle(false);
542 myXmax=e.X; myYmax=e.Y;
545 case CurrentAction3d.CurAction3d_DynamicZooming:
546 myView.Zoom(myXmax, myYmax, e.X, e.Y);
547 myXmax=e.X; myYmax=e.Y;
549 case CurrentAction3d.CurAction3d_WindowZooming:
550 DrawRectangle(false);
551 myXmax=e.X; myYmax=e.Y;
552 DrawRectangle(true);//add brush here
554 case CurrentAction3d.CurAction3d_DynamicPanning:
555 myView.Pan(e.X-myXmax, myYmax - e.Y);
556 myXmax=e.X; myYmax=e.Y;
558 case CurrentAction3d.CurAction3d_GlobalPanning:
560 case CurrentAction3d.CurAction3d_DynamicRotation:
561 myView.Rotation(e.X, e.Y);
568 } // e.Button == MouseButtons.Left
569 else if (e.Button==MouseButtons.Middle)
571 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
573 myView.Pan(e.X-myXmax, myYmax - e.Y);
574 myXmax=e.X; myYmax=e.Y;
576 }//e.Button=MouseButtons.Middle
577 else if (e.Button==MouseButtons.Right) //right button is pressed
579 if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl)
580 myView.Rotation(e.X, e.Y);
582 else // no buttons are pressed
584 myXmax=e.X; myYmax=e.Y;
585 if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
586 MultiMoveEvent(e.X, e.Y);
594 protected void MultiMoveEvent(int x, int y)
599 protected void MoveEvent(int x, int y)
604 public void SetDisplayMode(int aMode)
606 myView.SetDisplayMode(aMode);
609 public void ChangeColor(bool IsObjectColor)
614 r=myView.GetObjColR();
615 g=myView.GetObjColG();
616 b=myView.GetObjColB();
620 r=myView.GetBGColR();
621 g=myView.GetBGColG();
622 b=myView.GetBGColB();
624 System.Windows.Forms.ColorDialog ColDlg = new ColorDialog();
625 ColDlg.Color=System.Drawing.Color.FromArgb(r, g, b);
626 if (ColDlg.ShowDialog() == DialogResult.OK)
628 Color c = ColDlg.Color;
633 myView.SetColor(r, g, b);
635 myView.SetBackgroundColor(r, g, b);
637 this.myView.UpdateCurrentViewer();
641 public void DeleteObjects()
643 myView.EraseObjects();
645 public void ImportModel(IE.ModelFormat format)
648 System.Windows.Forms.OpenFileDialog openDialog = new OpenFileDialog();
650 string DataDir=((Environment.GetEnvironmentVariable("CASROOT")) + "\\..\\data");
656 case ModelFormat.BREP:
657 openDialog.InitialDirectory = (DataDir + "\\occ");
659 filter= "BREP Files (*.brep *.rle)|*.brep; *.rle";
661 case ModelFormat.CSFDB:
663 filter= "CSFDB Files (*.csfdb)|*.csfdb";
665 case IE.ModelFormat.STEP:
666 openDialog.InitialDirectory = (DataDir + "\\step");
668 filter="STEP Files (*.stp *.step)|*.stp; *.step";
670 case IE.ModelFormat.IGES:
671 openDialog.InitialDirectory = (DataDir + "\\iges");
673 filter="IGES Files (*.igs *.iges)|*.igs; *.iges";
678 openDialog.Filter = filter+"|All files (*.*)|*.*" ;
679 if(openDialog.ShowDialog() == DialogResult.OK)
681 string filename = openDialog.FileName;
684 this.Cursor=System.Windows.Forms.Cursors.WaitCursor;
685 if (!myView.TranslateModel(filename, theformat, true))
686 MessageBox.Show("Cann't read this file", "Error!",
687 MessageBoxButtons.OK, MessageBoxIcon.Warning);
688 this.Cursor=System.Windows.Forms.Cursors.Default;
690 this.myView.ZoomAllView();
693 public void ExportModel(ModelFormat format)
696 System.Windows.Forms.SaveFileDialog saveDialog = new SaveFileDialog();
697 string DataDir=((Environment.GetEnvironmentVariable("CASROOT")) + "\\..\\data");
701 case IE.ModelFormat.BREP:
702 saveDialog.InitialDirectory = (DataDir + "\\occ");
704 filter= "BREP Files (*.brep *.rle)|*.brep; *.rle";
706 case IE.ModelFormat.CSFDB:
708 filter= "CSFDB Files (*.csfdb)|*.csfdb";
710 case IE.ModelFormat.STEP:
711 saveDialog.InitialDirectory = (DataDir + "\\step");
713 filter="STEP Files (*.stp *.step)|*.step; *.stp";
715 case IE.ModelFormat.IGES:
716 saveDialog.InitialDirectory = (DataDir + "\\iges");
718 filter="IGES Files (*.igs *.iges)| *.iges; *.igs";
720 case IE.ModelFormat.VRML:
721 saveDialog.InitialDirectory = (DataDir + "\\vrml");
723 filter="VRML Files (*.vrml)|*.vrml";
725 case IE.ModelFormat.STL:
726 saveDialog.InitialDirectory = (DataDir + "\\stl");
728 filter="STL Files (*.stl)|*.stl";
730 case IE.ModelFormat.IMAGE:
731 saveDialog.InitialDirectory = (DataDir + "\\images");
733 filter="Images Files (*.bmp *.gif *.xwd)| *.bmp; *.gif; *.xwd";
738 saveDialog.Filter = filter;
739 if(saveDialog.ShowDialog() == DialogResult.OK)
741 string filename = saveDialog.FileName;
744 this.Cursor=System.Windows.Forms.Cursors.WaitCursor;
745 if (!myView.TranslateModel(filename, theformat, false))
746 MessageBox.Show("Cann't write this file", "Error!",
747 MessageBoxButtons.OK, MessageBoxIcon.Warning);
748 this.Cursor=System.Windows.Forms.Cursors.Default;
752 private void ContextColor_Click(object sender, System.EventArgs e)
754 this.ChangeColor(true);
757 private void menuItem1_Click(object sender, System.EventArgs e)
759 this.myView.UpdateCurrentViewer();
760 this.ChangeColor(false);
763 private void ContextWireframe_Click(object sender, System.EventArgs e)
765 this.SetDisplayMode(0);
766 this.myView.UpdateCurrentViewer();
767 IE.Form1 parent=(IE.Form1)this.ParentForm;
768 parent.SelectionChanged();
771 private void ContextShading_Click(object sender, System.EventArgs e)
773 this.SetDisplayMode(1);
774 this.myView.UpdateCurrentViewer();
775 IE.Form1 parent=(IE.Form1)this.ParentForm;
776 parent.SelectionChanged();
779 private void ContMenTranc_Click(object sender, System.EventArgs e)
781 IE.TransparencyDialog dlg = new TransparencyDialog();
782 dlg.View=this.myView;
783 dlg.ShowDialog(this);
786 private void ContMenDelete_Click(object sender, System.EventArgs e)
788 this.DeleteObjects();
791 private void ContMatBrass_Click(object sender, System.EventArgs e)
793 this.myView.UpdateCurrentViewer();
794 this.myView.SetMaterial(0);
797 private void ContMenBronze_Click(object sender, System.EventArgs e)
799 this.myView.UpdateCurrentViewer();
800 this.myView.SetMaterial(1);
803 private void ContMenCopper_Click(object sender, System.EventArgs e)
805 this.myView.UpdateCurrentViewer();
806 this.myView.SetMaterial(2);
809 private void ContMenGold_Click(object sender, System.EventArgs e)
811 this.myView.UpdateCurrentViewer();
812 this.myView.SetMaterial(3);
815 private void ContMenPewt_Click(object sender, System.EventArgs e)
817 this.myView.UpdateCurrentViewer();
818 this.myView.SetMaterial(4);
821 private void ContMenPlaster_Click(object sender, System.EventArgs e)
823 this.myView.UpdateCurrentViewer();
824 this.myView.SetMaterial(5);
827 private void ContMenPlastic_Click(object sender, System.EventArgs e)
829 this.myView.UpdateCurrentViewer();
830 this.myView.SetMaterial(6);
833 private void ContMenSilver_Click(object sender, System.EventArgs e)
835 this.myView.UpdateCurrentViewer();
836 this.myView.SetMaterial(7);
839 private void toolBar1_MouseHover(object sender, System.EventArgs e)
841 IE.Form1 parent=(IE.Form1)this.ParentForm;
842 parent.StatusBar.Text="View toolbar";
846 private void toolBar1_MouseLeave(object sender, System.EventArgs e)
848 IE.Form1 parent=(IE.Form1)this.ParentForm;
849 parent.StatusBar.Text="";
852 private void myPopupObject_Popup(object sender, System.EventArgs e)
854 int mode=this.myView.DisplayMode();
860 this.ContextWireframe.Enabled=false;
861 this.ContextShading.Enabled=true;
862 this.ContMenTranc.Enabled=false;
865 this.ContextShading.Enabled=false;
866 this.ContextWireframe.Enabled=true;
867 this.ContMenTranc.Enabled=true;
870 this.ContextShading.Enabled=true;;
871 this.ContextWireframe.Enabled=true;
872 this.ContMenTranc.Enabled=true;
892 public void InitView()
894 this.myView.InitOCCViewer();
897 public void SetContext(shell View)
899 this.myView.SetAISContext(View);
902 private void Form2_Closed(object sender, System.EventArgs e)
904 IE.Form1 parent = (IE.Form1) this.ParentForm;
905 parent.OnFileClose();
908 public CurrentAction3d Mode
912 return this.myCurrentMode;
916 this.myCurrentMode=value;
924 this.myCurZoom=value;
928 public bool DegenerateMode
932 return this.myDegenerateModeIsOn;
936 this.myDegenerateModeIsOn=value;