public void ImportModel(IE_WinForms.ModelFormat format) { int theformat = 10; System.Windows.Forms.OpenFileDialog openDialog = new OpenFileDialog(); string DataDir = ((Environment.GetEnvironmentVariable("CASROOT")) + "\\..\\data"); string filter = ""; switch (format) { case ModelFormat.BREP: openDialog.InitialDirectory = (DataDir + "\\occ"); theformat = 0; filter = "BREP Files (*.brep *.rle)|*.brep; *.rle"; break; case ModelFormat.CSFDB: theformat = 1; filter = "CSFDB Files (*.csfdb)|*.csfdb"; break; case IE_WinForms.ModelFormat.STEP: openDialog.InitialDirectory = (DataDir + "\\step"); theformat = 2; filter = "STEP Files (*.stp *.step)|*.stp; *.step"; break; case IE_WinForms.ModelFormat.IGES: openDialog.InitialDirectory = (DataDir + "\\iges"); theformat = 3; filter = "IGES Files (*.igs *.iges)|*.igs; *.iges"; break; default: break; } openDialog.Filter = filter + "|All files (*.*)|*.*"; if (openDialog.ShowDialog() == DialogResult.OK) { string filename = openDialog.FileName; if (filename == "") { return; } this.Cursor = System.Windows.Forms.Cursors.WaitCursor; if (!myOCCTProxy.TranslateModel(filename, theformat, true)) { MessageBox.Show("Cann't read this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } this.Cursor = System.Windows.Forms.Cursors.Default; } this.myOCCTProxy.ZoomAllView(); }
private void ExportImage_Click(object sender, System.EventArgs e) { Form2 curForm = (Form2)this.ActiveMdiChild; if (curForm == null) { return; } this.myModelFormat = IE_WinForms.ModelFormat.IMAGE; curForm.ExportModel(this.myModelFormat); }
private void ImportStep_Click(object sender, System.EventArgs e) { Form2 curForm = (Form2)this.ActiveMdiChild; if (curForm == null) { return; } this.myModelFormat = IE_WinForms.ModelFormat.STEP; curForm.ImportModel(this.myModelFormat); }
private void tBarImpt_Click(object sender, EventArgs e) { Form2 curForm = (Form2)this.ActiveMdiChild; if (curForm == null) { return; } this.myModelFormat = IE_WinForms.ModelFormat.IGES; curForm.ImportModel(this.myModelFormat); }
private void ImportStep_Click(object sender, System.EventArgs e) { Form2 curForm = (Form2)this.ActiveMdiChild; if (curForm == null) return; this.myModelFormat = IE_WinForms.ModelFormat.STEP; curForm.ImportModel(this.myModelFormat); }
private void ExportVrml_Click(object sender, System.EventArgs e) { Form2 curForm = (Form2)this.ActiveMdiChild; if (curForm == null) return; this.myModelFormat = IE_WinForms.ModelFormat.VRML; curForm.ExportModel(this.myModelFormat); }