コード例 #1
0
ファイル: Form2.cs プロジェクト: hbadi/opencascade
        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();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: sticwin/OCCT
        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);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: sticwin/OCCT
        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);
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: sticwin/OCCT
        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);
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: i2e-haw-hamburg/opencascade
 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);
 }
コード例 #6
0
ファイル: Form1.cs プロジェクト: i2e-haw-hamburg/opencascade
 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);
 }