0024147: Update of CSharp sample
authorvdn <vdn@opencascade.com>
Fri, 25 Oct 2013 09:44:45 +0000 (13:44 +0400)
committerbugmaster <bugmaster@opencascade.com>
Fri, 25 Oct 2013 09:45:47 +0000 (13:45 +0400)
Overall revision of of CSharp sample code:
- Pure C++ project "OCC" deleted as unnecessary
- C++/CLI project "shell" renamed to OCCTProxy and refactored to implement all required interface to OCCT functionality.
- In About dialog, date corrected in Copyright statement
- CSharp files re-layouted with 2 spaces indentation
- ReadMe converted to MarkDown format and revised
- Generation of names of views refactored to avoid calling C++ level
- Project files corrected to run on 64-bit systems
- Batch scripts refactored to use OCCT default configuration

WPF front-end added to demonstrate usage of OCCT in WPF applications.
WPF sample was modified, operation Export has been fixed
Exception "Cannot create this file", which appeared by export to image format, has been corrected.
Option "Export image to .xwd" removed.

87 files changed:
samples/CSharp/CSharp.sln [new file with mode: 0644]
samples/CSharp/IE/AboutDialog.cs [deleted file]
samples/CSharp/IE/Form1.cs [deleted file]
samples/CSharp/IE/Form2.cs [deleted file]
samples/CSharp/IE/IE.sln [deleted file]
samples/CSharp/IE/MaterialDialog.cs [deleted file]
samples/CSharp/IE/TransparencyDialog.cs [deleted file]
samples/CSharp/IE/app.config [deleted file]
samples/CSharp/IE/res/document.ico [deleted file]
samples/CSharp/OCC/OCC.cpp [deleted file]
samples/CSharp/OCC/OCC.vcproj [deleted file]
samples/CSharp/OCC/OCCViewer.cpp [deleted file]
samples/CSharp/OCC/OCCViewer.h [deleted file]
samples/CSharp/OCC/ReadMe.txt [deleted file]
samples/CSharp/OCC/stdafx.cpp [deleted file]
samples/CSharp/OCC/stdafx.h [deleted file]
samples/CSharp/OCCTProxy/OCCTProxy.cpp [new file with mode: 0644]
samples/CSharp/OCCTProxy/OCCTProxy.vcproj [new file with mode: 0644]
samples/CSharp/ReadMe.md [new file with mode: 0644]
samples/CSharp/WPF/About.xaml [new file with mode: 0644]
samples/CSharp/WPF/About.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF/App.xaml [new file with mode: 0644]
samples/CSharp/WPF/App.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF/IECommands.cs [new file with mode: 0644]
samples/CSharp/WPF/IE_WPF.csproj [new file with mode: 0644]
samples/CSharp/WPF/MainWindow.xaml [new file with mode: 0644]
samples/CSharp/WPF/MainWindow.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF/MaterialDlg.xaml [new file with mode: 0644]
samples/CSharp/WPF/MaterialDlg.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF/OCCViewer.cs [new file with mode: 0644]
samples/CSharp/WPF/Properties/AssemblyInfo.cs [new file with mode: 0644]
samples/CSharp/WPF/Properties/Resources.Designer.cs [new file with mode: 0644]
samples/CSharp/WPF/Properties/Resources.resx [new file with mode: 0644]
samples/CSharp/WPF/Properties/Settings.Designer.cs [new file with mode: 0644]
samples/CSharp/WPF/Properties/Settings.settings [new file with mode: 0644]
samples/CSharp/WPF/Simple Styles.xaml [new file with mode: 0644]
samples/CSharp/WPF/TransparencyDialog.cs [new file with mode: 0644]
samples/CSharp/WPF/TransparencyDialog.resx [copied from samples/CSharp/IE/TransparencyDialog.resx with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/MainFrame.ico [moved from samples/CSharp/IE/res/MainFrame.ico with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/document.png [moved from samples/CSharp/IE/res/document.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/help.png [moved from samples/CSharp/IE/res/help.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/lamp.png [moved from samples/CSharp/IE/res/lamp.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/new.png [moved from samples/CSharp/IE/res/new.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/occ_logo.bmp [moved from samples/CSharp/IE/res/occ_logo.bmp with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/tool_color.png [moved from samples/CSharp/IE/res/tool_color.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/tool_delete.png [moved from samples/CSharp/IE/res/tool_delete.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/tool_material.png [moved from samples/CSharp/IE/res/tool_material.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/tool_shading.png [moved from samples/CSharp/IE/res/tool_shading.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/tool_transparency.png [moved from samples/CSharp/IE/res/tool_transparency.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/tool_wireframe.png [moved from samples/CSharp/IE/res/tool_wireframe.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_axo.png [moved from samples/CSharp/IE/res/view_axo.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_back.png [moved from samples/CSharp/IE/res/view_back.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_bottom.png [moved from samples/CSharp/IE/res/view_bottom.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_comp_off.png [moved from samples/CSharp/IE/res/view_comp_off.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_comp_on.png [moved from samples/CSharp/IE/res/view_comp_on.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_fitall.png [moved from samples/CSharp/IE/res/view_fitall.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_fitarea.png [moved from samples/CSharp/IE/res/view_fitarea.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_front.png [moved from samples/CSharp/IE/res/view_front.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_glpan.png [moved from samples/CSharp/IE/res/view_glpan.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_left.png [moved from samples/CSharp/IE/res/view_left.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_pan.png [moved from samples/CSharp/IE/res/view_pan.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_reset.png [moved from samples/CSharp/IE/res/view_reset.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_right.png [moved from samples/CSharp/IE/res/view_right.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_rotate.png [moved from samples/CSharp/IE/res/view_rotate.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_top.png [moved from samples/CSharp/IE/res/view_top.png with 100% similarity, mode: 0644]
samples/CSharp/WPF/res/view_zoom.png [moved from samples/CSharp/IE/res/view_zoom.png with 100% similarity, mode: 0644]
samples/CSharp/WinForms/AboutDialog.cs [new file with mode: 0644]
samples/CSharp/WinForms/AboutDialog.resx [moved from samples/CSharp/IE/AboutDialog.resx with 94% similarity, mode: 0644]
samples/CSharp/WinForms/App.ico [moved from samples/CSharp/IE/App.ico with 100% similarity, mode: 0644]
samples/CSharp/WinForms/AssemblyInfo.cs [moved from samples/CSharp/IE/AssemblyInfo.cs with 100% similarity, mode: 0644]
samples/CSharp/WinForms/Form1.cs [new file with mode: 0644]
samples/CSharp/WinForms/Form1.resx [moved from samples/CSharp/IE/Form1.resx with 100% similarity, mode: 0644]
samples/CSharp/WinForms/Form2.cs [new file with mode: 0644]
samples/CSharp/WinForms/Form2.resx [moved from samples/CSharp/IE/Form2.resx with 100% similarity, mode: 0644]
samples/CSharp/WinForms/IE_WinForms.csproj [moved from samples/CSharp/IE/IE.csproj with 82% similarity, mode: 0644]
samples/CSharp/WinForms/MaterialDialog.cs [new file with mode: 0644]
samples/CSharp/WinForms/MaterialDialog.resx [moved from samples/CSharp/IE/MaterialDialog.resx with 100% similarity, mode: 0644]
samples/CSharp/WinForms/TransparencyDialog.cs [new file with mode: 0644]
samples/CSharp/WinForms/TransparencyDialog.resx [moved from samples/CSharp/IE/TransparencyDialog.resx with 100% similarity, mode: 0644]
samples/CSharp/WinForms/app.config [new file with mode: 0644]
samples/CSharp/msvc.bat
samples/CSharp/run.bat [deleted file]
samples/CSharp/run_winforms.bat [new file with mode: 0644]
samples/CSharp/run_wpf.bat [new file with mode: 0644]
samples/CSharp/shell/shell.cpp [deleted file]
samples/CSharp/shell/shell.h [deleted file]
samples/CSharp/shell/shell.vcproj [deleted file]

diff --git a/samples/CSharp/CSharp.sln b/samples/CSharp/CSharp.sln
new file mode 100644 (file)
index 0000000..6ec2e62
--- /dev/null
@@ -0,0 +1,45 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF", "WPF\IE_WPF.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WinForms", "WinForms\IE_WinForms.csproj", "{B9914BB3-B886-4B41-B48D-350EBEBEFD1F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy", "OCCTProxy\OCCTProxy.vcproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.ActiveCfg = Debug|x86
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.Build.0 = Debug|x86
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.ActiveCfg = Debug|x64
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.Build.0 = Debug|x64
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.ActiveCfg = Release|x86
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.Build.0 = Release|x86
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.ActiveCfg = Release|x64
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.Build.0 = Release|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/samples/CSharp/IE/AboutDialog.cs b/samples/CSharp/IE/AboutDialog.cs
deleted file mode 100755 (executable)
index 99a4002..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace IE
-{
-       /// <summary>
-       /// Summary description for AboutDialog.
-       /// </summary>
-       public class AboutDialog : System.Windows.Forms.Form
-       {
-               private System.Windows.Forms.PictureBox pictureBox1;
-               private System.Windows.Forms.Button button1;
-               private System.Windows.Forms.Label label1;
-               private System.Windows.Forms.Label label3;
-               private System.Windows.Forms.Label label4;
-               private System.Windows.Forms.Label myVersion;
-               /// <summary>
-               /// Required designer variable.
-               /// </summary>
-               private System.ComponentModel.Container components = null;
-
-               public AboutDialog()
-               {
-                       //
-                       // Required for Windows Form Designer support
-                       //
-                       InitializeComponent();
-                       //
-                       // TODO: Add any constructor code after InitializeComponent call
-                       //
-                       shell t = new shell();
-                       t.InitOCCViewer();
-                       float version = t.GetOCCVersion();
-                       this.myVersion.Text=this.myVersion.Text+version;
-               }
-
-               /// <summary>
-               /// Clean up any resources being used.
-               /// </summary>
-               protected override void Dispose( bool disposing )
-               {
-                       if( disposing )
-                       {
-                               if(components != null)
-                               {
-                                       components.Dispose();
-                               }
-                       }
-                       base.Dispose( disposing );
-               }
-
-               #region Windows Form Designer generated code
-               /// <summary>
-               /// Required method for Designer support - do not modify
-               /// the contents of this method with the code editor.
-               /// </summary>
-               private void InitializeComponent()
-               {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDialog));
-            this.pictureBox1 = new System.Windows.Forms.PictureBox();
-            this.button1 = new System.Windows.Forms.Button();
-            this.label1 = new System.Windows.Forms.Label();
-            this.myVersion = new System.Windows.Forms.Label();
-            this.label3 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // pictureBox1
-            // 
-            this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
-            this.pictureBox1.Location = new System.Drawing.Point(59, 64);
-            this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(196, 102);
-            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
-            this.pictureBox1.TabIndex = 0;
-            this.pictureBox1.TabStop = false;
-            // 
-            // button1
-            // 
-            this.button1.Location = new System.Drawing.Point(96, 248);
-            this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(128, 24);
-            this.button1.TabIndex = 1;
-            this.button1.Text = "OK";
-            this.button1.Click += new System.EventHandler(this.button1_Click);
-            // 
-            // label1
-            // 
-            this.label1.Location = new System.Drawing.Point(16, 9);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(288, 24);
-            this.label1.TabIndex = 2;
-            this.label1.Text = "Import/Export Sample,";
-            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // myVersion
-            // 
-            this.myVersion.Location = new System.Drawing.Point(16, 32);
-            this.myVersion.Name = "myVersion";
-            this.myVersion.Size = new System.Drawing.Size(288, 16);
-            this.myVersion.TabIndex = 3;
-            this.myVersion.Text = "Open CASCADE Technology ";
-            this.myVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // label3
-            // 
-            this.label3.Location = new System.Drawing.Point(24, 168);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(280, 23);
-            this.label3.TabIndex = 4;
-            this.label3.Text = "Copyright (C) 2004-2012, Open CASCADE S.A.S";
-            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // label4
-            // 
-            this.label4.Location = new System.Drawing.Point(8, 200);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(296, 24);
-            this.label4.TabIndex = 5;
-            this.label4.Text = "http://www.opencascade.com";
-            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // AboutDialog
-            // 
-            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-            this.ClientSize = new System.Drawing.Size(312, 285);
-            this.ControlBox = false;
-            this.Controls.Add(this.label4);
-            this.Controls.Add(this.label3);
-            this.Controls.Add(this.myVersion);
-            this.Controls.Add(this.label1);
-            this.Controls.Add(this.button1);
-            this.Controls.Add(this.pictureBox1);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
-            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.MaximizeBox = false;
-            this.MinimizeBox = false;
-            this.Name = "AboutDialog";
-            this.Text = "About Import/Export Sample";
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-               }
-               #endregion
-
-               private void button1_Click(object sender, System.EventArgs e)
-               {
-                       this.Close();
-               }
-       }
-}
diff --git a/samples/CSharp/IE/Form1.cs b/samples/CSharp/IE/Form1.cs
deleted file mode 100755 (executable)
index aaead88..0000000
+++ /dev/null
@@ -1,1103 +0,0 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Data;
-
-namespace IE
-{
-       /// <summary>
-       /// Summary description for Form1.
-       /// </summary>
-       public class Form1 : System.Windows.Forms.Form
-       {
-               private System.Windows.Forms.MainMenu mainMenu1;
-               private System.Windows.Forms.MenuItem FileNew;
-               private System.Windows.Forms.MenuItem FileClose;
-               private System.Windows.Forms.MenuItem FileExport;
-               private System.Windows.Forms.MenuItem FileImport;
-               private System.Windows.Forms.MenuItem ImportBRep;
-               private System.Windows.Forms.MenuItem ExportImage;
-               private System.Windows.Forms.MenuItem File;
-               private System.Windows.Forms.MenuItem Window;
-               private System.Windows.Forms.ToolBarButton New;
-               private System.Windows.Forms.ImageList imageList1;
-               private System.Windows.Forms.ToolBarButton About;
-               private System.Windows.Forms.StatusBar myStatusBar;
-               private System.Windows.Forms.MenuItem ImportIges;
-               private System.Windows.Forms.MenuItem ImportStep;
-               private System.Windows.Forms.MenuItem ExportBRep;
-               private System.Windows.Forms.MenuItem ExportIges;
-               private System.Windows.Forms.MenuItem ExportStep;
-               private System.Windows.Forms.MenuItem ExportStl;
-               private System.Windows.Forms.MenuItem ExportVrml;
-               private System.ComponentModel.IContainer components;
-               private System.Windows.Forms.MenuItem menuItem1;
-               private System.Windows.Forms.MenuItem menuItem2;
-               private System.Windows.Forms.MenuItem menuItem3;
-               private System.Windows.Forms.MenuItem View;
-               private System.Windows.Forms.MenuItem Help;
-               private System.Windows.Forms.MenuItem HelpAbout;
-               private System.Windows.Forms.MenuItem ViewToolbar;
-               private System.Windows.Forms.MenuItem ViewStatusBar;
-               private System.Windows.Forms.MenuItem menuItem4;
-               private System.Windows.Forms.MenuItem WindowCascade;
-               private System.Windows.Forms.MenuItem WindowTile;
-
-               protected IE.ModelFormat myModelFormat;
-               private System.Windows.Forms.ToolBarButton wireframe;
-               private System.Windows.Forms.ToolBarButton shading;
-               private System.Windows.Forms.ToolBarButton toolBarButton1;
-               private System.Windows.Forms.ToolBarButton color;
-               private System.Windows.Forms.ToolBarButton transparency;
-               private System.Windows.Forms.ToolBarButton delete;
-               private System.Windows.Forms.ToolBarButton material;
-               private System.Windows.Forms.ToolBarButton ZoomAll;
-               private System.Windows.Forms.ToolBarButton ZoomWin;
-               private System.Windows.Forms.ToolBarButton ZoomProg;
-               private System.Windows.Forms.ToolBarButton Pan;
-               private System.Windows.Forms.ToolBarButton PanGlo;
-               private System.Windows.Forms.ToolBarButton Front;
-               private System.Windows.Forms.ToolBarButton Back;
-               private System.Windows.Forms.ToolBarButton TOP;
-               private System.Windows.Forms.ToolBarButton BOTTOM;
-               private System.Windows.Forms.ToolBarButton RIGHT;
-               private System.Windows.Forms.ToolBarButton LEFT;
-               private System.Windows.Forms.ToolBarButton Axo;
-               private System.Windows.Forms.ToolBarButton Rot;
-               private System.Windows.Forms.ToolBarButton Reset;
-               private System.Windows.Forms.ToolBarButton HlrOn;
-               private System.Windows.Forms.ToolBarButton HlrOff;
-               private System.Windows.Forms.ToolBar toolBarTool;
-               private System.Windows.Forms.ToolBar toolBarView;
-               protected static int myNbOfChildren;
-
-               public Form1()
-               {
-                       //
-                       // Required for Windows Form Designer support
-                       //
-                       InitializeComponent();
-
-                       //
-                       // TODO: Add any constructor code after InitializeComponent call
-                       //
-                       IE.Form1.myNbOfChildren=0;
-               }
-
-               /// <summary>
-               /// Clean up any resources being used.
-               /// </summary>
-               protected override void Dispose( bool disposing )
-               {
-                       if( disposing )
-                       {
-                               if (components != null) 
-                               {
-                                       components.Dispose();
-                               }
-                       }
-                       base.Dispose( disposing );
-               }
-
-               #region Windows Form Designer generated code
-               /// <summary>
-               /// Required method for Designer support - do not modify
-               /// the contents of this method with the code editor.
-               /// </summary>
-               private void InitializeComponent()
-               {
-                       this.components = new System.ComponentModel.Container();
-                       System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
-                       System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
-                       this.mainMenu1 = new System.Windows.Forms.MainMenu();
-                       this.File = new System.Windows.Forms.MenuItem();
-                       this.FileNew = new System.Windows.Forms.MenuItem();
-                       this.FileExport = new System.Windows.Forms.MenuItem();
-                       this.ImportBRep = new System.Windows.Forms.MenuItem();
-                       this.ImportIges = new System.Windows.Forms.MenuItem();
-                       this.ImportStep = new System.Windows.Forms.MenuItem();
-                       this.FileImport = new System.Windows.Forms.MenuItem();
-                       this.ExportBRep = new System.Windows.Forms.MenuItem();
-                       this.ExportIges = new System.Windows.Forms.MenuItem();
-                       this.ExportStep = new System.Windows.Forms.MenuItem();
-                       this.ExportStl = new System.Windows.Forms.MenuItem();
-                       this.ExportVrml = new System.Windows.Forms.MenuItem();
-                       this.menuItem3 = new System.Windows.Forms.MenuItem();
-                       this.ExportImage = new System.Windows.Forms.MenuItem();
-                       this.FileClose = new System.Windows.Forms.MenuItem();
-                       this.menuItem2 = new System.Windows.Forms.MenuItem();
-                       this.menuItem1 = new System.Windows.Forms.MenuItem();
-                       this.View = new System.Windows.Forms.MenuItem();
-                       this.ViewToolbar = new System.Windows.Forms.MenuItem();
-                       this.ViewStatusBar = new System.Windows.Forms.MenuItem();
-                       this.Window = new System.Windows.Forms.MenuItem();
-                       this.menuItem4 = new System.Windows.Forms.MenuItem();
-                       this.WindowCascade = new System.Windows.Forms.MenuItem();
-                       this.WindowTile = new System.Windows.Forms.MenuItem();
-                       this.Help = new System.Windows.Forms.MenuItem();
-                       this.HelpAbout = new System.Windows.Forms.MenuItem();
-                       this.toolBarTool = new System.Windows.Forms.ToolBar();
-                       this.New = new System.Windows.Forms.ToolBarButton();
-                       this.About = new System.Windows.Forms.ToolBarButton();
-                       this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
-                       this.wireframe = new System.Windows.Forms.ToolBarButton();
-                       this.shading = new System.Windows.Forms.ToolBarButton();
-                       this.color = new System.Windows.Forms.ToolBarButton();
-                       this.material = new System.Windows.Forms.ToolBarButton();
-                       this.transparency = new System.Windows.Forms.ToolBarButton();
-                       this.delete = new System.Windows.Forms.ToolBarButton();
-                       this.imageList1 = new System.Windows.Forms.ImageList(this.components);
-                       this.myStatusBar = new System.Windows.Forms.StatusBar();
-                       this.toolBarView = new System.Windows.Forms.ToolBar();
-                       this.ZoomAll = new System.Windows.Forms.ToolBarButton();
-                       this.ZoomWin = new System.Windows.Forms.ToolBarButton();
-                       this.ZoomProg = new System.Windows.Forms.ToolBarButton();
-                       this.Pan = new System.Windows.Forms.ToolBarButton();
-                       this.PanGlo = new System.Windows.Forms.ToolBarButton();
-                       this.Front = new System.Windows.Forms.ToolBarButton();
-                       this.Back = new System.Windows.Forms.ToolBarButton();
-                       this.TOP = new System.Windows.Forms.ToolBarButton();
-                       this.BOTTOM = new System.Windows.Forms.ToolBarButton();
-                       this.LEFT = new System.Windows.Forms.ToolBarButton();
-                       this.RIGHT = new System.Windows.Forms.ToolBarButton();
-                       this.Axo = new System.Windows.Forms.ToolBarButton();
-                       this.Rot = new System.Windows.Forms.ToolBarButton();
-                       this.Reset = new System.Windows.Forms.ToolBarButton();
-                       this.HlrOn = new System.Windows.Forms.ToolBarButton();
-                       this.HlrOff = new System.Windows.Forms.ToolBarButton();
-                       this.SuspendLayout();
-                       // 
-                       // mainMenu1
-                       // 
-                       this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                         this.File,
-                                                                                                                                                                         this.View,
-                                                                                                                                                                         this.Window,
-                                                                                                                                                                         this.Help});
-                       // 
-                       // File
-                       // 
-                       this.File.Index = 0;
-                       this.File.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                this.FileNew,
-                                                                                                                                                                this.FileExport,
-                                                                                                                                                                this.FileImport,
-                                                                                                                                                                this.FileClose,
-                                                                                                                                                                this.menuItem2,
-                                                                                                                                                                this.menuItem1});
-                       this.File.Text = "&File";
-                       this.File.Popup += new System.EventHandler(this.File_Popup);
-                       // 
-                       // FileNew
-                       // 
-                       this.FileNew.Index = 0;
-                       this.FileNew.Text = "&New";
-                       this.FileNew.Click += new System.EventHandler(this.menuItem2_Click);
-                       // 
-                       // FileExport
-                       // 
-                       this.FileExport.Index = 1;
-                       this.FileExport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                          this.ImportBRep,
-                                                                                                                                                                          this.ImportIges,
-                                                                                                                                                                          this.ImportStep});
-                       this.FileExport.Text = "&Import";
-                       this.FileExport.Visible = false;
-                       // 
-                       // ImportBRep
-                       // 
-                       this.ImportBRep.Index = 0;
-                       this.ImportBRep.Text = "&BRep ...";
-                       this.ImportBRep.Click += new System.EventHandler(this.ImportBRep_Click);
-                       // 
-                       // ImportIges
-                       // 
-                       this.ImportIges.Index = 1;
-                       this.ImportIges.Text = "&Iges ...";
-                       this.ImportIges.Click += new System.EventHandler(this.ImportIges_Click);
-                       // 
-                       // ImportStep
-                       // 
-                       this.ImportStep.Index = 2;
-                       this.ImportStep.Text = "&Step ...";
-                       this.ImportStep.Click += new System.EventHandler(this.ImportStep_Click);
-                       // 
-                       // FileImport
-                       // 
-                       this.FileImport.Index = 2;
-                       this.FileImport.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                          this.ExportBRep,
-                                                                                                                                                                          this.ExportIges,
-                                                                                                                                                                          this.ExportStep,
-                                                                                                                                                                          this.ExportStl,
-                                                                                                                                                                          this.ExportVrml,
-                                                                                                                                                                          this.menuItem3,
-                                                                                                                                                                          this.ExportImage});
-                       this.FileImport.Text = "&Export";
-                       this.FileImport.Visible = false;
-                       this.FileImport.Popup += new System.EventHandler(this.FileImport_Popup);
-                       // 
-                       // ExportBRep
-                       // 
-                       this.ExportBRep.Enabled = false;
-                       this.ExportBRep.Index = 0;
-                       this.ExportBRep.Text = "&BRep ...";
-                       this.ExportBRep.Click += new System.EventHandler(this.ExportBRep_Click);
-                       // 
-                       // ExportIges
-                       // 
-                       this.ExportIges.Enabled = false;
-                       this.ExportIges.Index = 1;
-                       this.ExportIges.Text = "&Iges ...";
-                       this.ExportIges.Click += new System.EventHandler(this.ExportIges_Click);
-                       // 
-                       // ExportStep
-                       // 
-                       this.ExportStep.Enabled = false;
-                       this.ExportStep.Index = 2;
-                       this.ExportStep.Text = "&Step ...";
-                       this.ExportStep.Click += new System.EventHandler(this.ExportStep_Click);
-                       // 
-                       // ExportStl
-                       // 
-                       this.ExportStl.Enabled = false;
-                       this.ExportStl.Index = 3;
-                       this.ExportStl.Text = "&Stl ...";
-                       this.ExportStl.Click += new System.EventHandler(this.ExportStl_Click);
-                       // 
-                       // ExportVrml
-                       // 
-                       this.ExportVrml.Enabled = false;
-                       this.ExportVrml.Index = 4;
-                       this.ExportVrml.Text = "&Vrml ...";
-                       this.ExportVrml.Click += new System.EventHandler(this.ExportVrml_Click);
-                       // 
-                       // menuItem3
-                       // 
-                       this.menuItem3.Index = 5;
-                       this.menuItem3.Text = "-";
-                       // 
-                       // ExportImage
-                       // 
-                       this.ExportImage.Index = 6;
-                       this.ExportImage.Text = "Image ...";
-                       this.ExportImage.Click += new System.EventHandler(this.ExportImage_Click);
-                       // 
-                       // FileClose
-                       // 
-                       this.FileClose.Enabled = false;
-                       this.FileClose.Index = 3;
-                       this.FileClose.Text = "&Close";
-                       this.FileClose.Click += new System.EventHandler(this.menuItem3_Click);
-                       // 
-                       // menuItem2
-                       // 
-                       this.menuItem2.Index = 4;
-                       this.menuItem2.Text = "-";
-                       // 
-                       // menuItem1
-                       // 
-                       this.menuItem1.Index = 5;
-                       this.menuItem1.Text = "&Quit";
-                       this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
-                       // 
-                       // View
-                       // 
-                       this.View.Index = 1;
-                       this.View.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                this.ViewToolbar,
-                                                                                                                                                                this.ViewStatusBar});
-                       this.View.Text = "&View";
-                       // 
-                       // ViewToolbar
-                       // 
-                       this.ViewToolbar.Checked = true;
-                       this.ViewToolbar.Index = 0;
-                       this.ViewToolbar.Text = "&Toolbar";
-                       this.ViewToolbar.Click += new System.EventHandler(this.ViewToolbar_Click);
-                       // 
-                       // ViewStatusBar
-                       // 
-                       this.ViewStatusBar.Checked = true;
-                       this.ViewStatusBar.Index = 1;
-                       this.ViewStatusBar.Text = "&Statusbar";
-                       this.ViewStatusBar.Click += new System.EventHandler(this.ViewStatusBar_Click);
-                       // 
-                       // Window
-                       // 
-                       this.Window.Index = 2;
-                       this.Window.MdiList = true;
-                       this.Window.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                  this.menuItem4,
-                                                                                                                                                                  this.WindowCascade,
-                                                                                                                                                                  this.WindowTile});
-                       this.Window.Text = "&Window";
-                       this.Window.Visible = false;
-                       // 
-                       // menuItem4
-                       // 
-                       this.menuItem4.Index = 0;
-                       this.menuItem4.Text = "&New 3d View";
-                       this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
-                       // 
-                       // WindowCascade
-                       // 
-                       this.WindowCascade.Index = 1;
-                       this.WindowCascade.Text = "&Cascade";
-                       this.WindowCascade.Click += new System.EventHandler(this.WindowCascade_Click);
-                       // 
-                       // WindowTile
-                       // 
-                       this.WindowTile.Index = 2;
-                       this.WindowTile.Text = "&Tile";
-                       this.WindowTile.Click += new System.EventHandler(this.WindowTile_Click);
-                       // 
-                       // Help
-                       // 
-                       this.Help.Index = 3;
-                       this.Help.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                this.HelpAbout});
-                       this.Help.Text = "&Help";
-                       // 
-                       // HelpAbout
-                       // 
-                       this.HelpAbout.Index = 0;
-                       this.HelpAbout.Shortcut = System.Windows.Forms.Shortcut.F1;
-                       this.HelpAbout.Text = "&About";
-                       this.HelpAbout.Click += new System.EventHandler(this.HelpAbout_Click);
-                       // 
-                       // toolBarTool
-                       // 
-                       this.toolBarTool.AccessibleRole = System.Windows.Forms.AccessibleRole.ToolBar;
-                       this.toolBarTool.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
-                                                                                                                                                                                  this.New,
-                                                                                                                                                                                  this.About,
-                                                                                                                                                                                  this.toolBarButton1,
-                                                                                                                                                                                  this.wireframe,
-                                                                                                                                                                                  this.shading,
-                                                                                                                                                                                  this.color,
-                                                                                                                                                                                  this.material,
-                                                                                                                                                                                  this.transparency,
-                                                                                                                                                                                  this.delete});
-                       this.toolBarTool.DropDownArrows = true;
-                       this.toolBarTool.ImageList = this.imageList1;
-                       this.toolBarTool.Location = new System.Drawing.Point(0, 0);
-                       this.toolBarTool.Name = "toolBarTool";
-                       this.toolBarTool.ShowToolTips = true;
-                       this.toolBarTool.Size = new System.Drawing.Size(560, 28);
-                       this.toolBarTool.TabIndex = 1;
-                       this.toolBarTool.Enter += new System.EventHandler(this.menuItem3_Click);
-                       this.toolBarTool.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
-                       this.toolBarTool.MouseHover += new System.EventHandler(this.toolBar1_MouseHover);
-                       this.toolBarTool.MouseLeave += new System.EventHandler(this.toolBar1_MouseLeave);
-                       // 
-                       // New
-                       // 
-                       this.New.ImageIndex = 0;
-                       this.New.ToolTipText = "New";
-                       this.New.Visible = ((bool)(configurationAppSettings.GetValue("New.Visible", typeof(bool))));
-                       // 
-                       // About
-                       // 
-                       this.About.ImageIndex = 1;
-                       this.About.ToolTipText = "About(F1)";
-                       this.About.Visible = ((bool)(configurationAppSettings.GetValue("About.Visible", typeof(bool))));
-                       // 
-                       // toolBarButton1
-                       // 
-                       this.toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
-                       // 
-                       // wireframe
-                       // 
-                       this.wireframe.Enabled = ((bool)(configurationAppSettings.GetValue("wireframe.Enabled", typeof(bool))));
-                       this.wireframe.ImageIndex = 2;
-                       this.wireframe.Pushed = ((bool)(configurationAppSettings.GetValue("wireframe.Pushed", typeof(bool))));
-                       this.wireframe.ToolTipText = "Wireframe";
-                       this.wireframe.Visible = ((bool)(configurationAppSettings.GetValue("wireframe.Visible", typeof(bool))));
-                       // 
-                       // shading
-                       // 
-                       this.shading.Enabled = ((bool)(configurationAppSettings.GetValue("shading.Enabled", typeof(bool))));
-                       this.shading.ImageIndex = 3;
-                       this.shading.Pushed = ((bool)(configurationAppSettings.GetValue("shading.Pushed", typeof(bool))));
-                       this.shading.ToolTipText = "Shading";
-                       this.shading.Visible = ((bool)(configurationAppSettings.GetValue("shading.Visible", typeof(bool))));
-                       // 
-                       // color
-                       // 
-                       this.color.Enabled = ((bool)(configurationAppSettings.GetValue("color.Enabled", typeof(bool))));
-                       this.color.ImageIndex = 4;
-                       this.color.ToolTipText = "Color";
-                       this.color.Visible = ((bool)(configurationAppSettings.GetValue("color.Visible", typeof(bool))));
-                       // 
-                       // material
-                       // 
-                       this.material.Enabled = ((bool)(configurationAppSettings.GetValue("material.Enabled", typeof(bool))));
-                       this.material.ImageIndex = 5;
-                       this.material.ToolTipText = "Material";
-                       this.material.Visible = ((bool)(configurationAppSettings.GetValue("material.Visible", typeof(bool))));
-                       // 
-                       // transparency
-                       // 
-                       this.transparency.Enabled = ((bool)(configurationAppSettings.GetValue("transparency.Enabled", typeof(bool))));
-                       this.transparency.ImageIndex = 6;
-                       this.transparency.ToolTipText = "Transparency";
-                       this.transparency.Visible = ((bool)(configurationAppSettings.GetValue("transparency.Visible", typeof(bool))));
-                       // 
-                       // delete
-                       // 
-                       this.delete.Enabled = ((bool)(configurationAppSettings.GetValue("delete.Enabled", typeof(bool))));
-                       this.delete.ImageIndex = 7;
-                       this.delete.ToolTipText = "Delete";
-                       this.delete.Visible = ((bool)(configurationAppSettings.GetValue("delete.Visible", typeof(bool))));
-                       // 
-                       // imageList1
-                       // 
-                       this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
-                       this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
-                       this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
-                       // 
-                       // myStatusBar
-                       // 
-                       this.myStatusBar.AccessibleRole = System.Windows.Forms.AccessibleRole.StatusBar;
-                       this.myStatusBar.Location = new System.Drawing.Point(0, 363);
-                       this.myStatusBar.Name = "myStatusBar";
-                       this.myStatusBar.Size = new System.Drawing.Size(560, 22);
-                       this.myStatusBar.TabIndex = 3;
-                       // 
-                       // toolBarView
-                       // 
-                       this.toolBarView.AccessibleRole = System.Windows.Forms.AccessibleRole.ToolBar;
-                       this.toolBarView.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
-                                                                                                                                                                                  this.ZoomAll,
-                                                                                                                                                                                  this.ZoomWin,
-                                                                                                                                                                                  this.ZoomProg,
-                                                                                                                                                                                  this.Pan,
-                                                                                                                                                                                  this.PanGlo,
-                                                                                                                                                                                  this.Front,
-                                                                                                                                                                                  this.Back,
-                                                                                                                                                                                  this.TOP,
-                                                                                                                                                                                  this.BOTTOM,
-                                                                                                                                                                                  this.LEFT,
-                                                                                                                                                                                  this.RIGHT,
-                                                                                                                                                                                  this.Axo,
-                                                                                                                                                                                  this.Rot,
-                                                                                                                                                                                  this.Reset,
-                                                                                                                                                                                  this.HlrOn,
-                                                                                                                                                                                  this.HlrOff});
-                       this.toolBarView.DropDownArrows = true;
-                       this.toolBarView.ImageList = this.imageList1;
-                       this.toolBarView.Location = new System.Drawing.Point(0, 28);
-                       this.toolBarView.Name = "toolBarView";
-                       this.toolBarView.ShowToolTips = true;
-                       this.toolBarView.Size = new System.Drawing.Size(560, 28);
-                       this.toolBarView.TabIndex = 5;
-                       this.toolBarView.Visible = false;
-                       this.toolBarView.Wrappable = false;
-                       this.toolBarView.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBarView_ButtonClick);
-                       this.toolBarView.MouseHover += new System.EventHandler(this.toolBarView_MouseHover);
-                       this.toolBarView.MouseLeave += new System.EventHandler(this.toolBarView_MouseLeave);
-                       // 
-                       // ZoomAll
-                       // 
-                       this.ZoomAll.ImageIndex = 8;
-                       this.ZoomAll.ToolTipText = "FitAll";
-                       // 
-                       // ZoomWin
-                       // 
-                       this.ZoomWin.ImageIndex = 9;
-                       this.ZoomWin.ToolTipText = "Zoom Window";
-                       // 
-                       // ZoomProg
-                       // 
-                       this.ZoomProg.ImageIndex = 10;
-                       this.ZoomProg.ToolTipText = "Dynamic Zooming";
-                       // 
-                       // Pan
-                       // 
-                       this.Pan.ImageIndex = 11;
-                       this.Pan.ToolTipText = "Dynamic Panning";
-                       // 
-                       // PanGlo
-                       // 
-                       this.PanGlo.ImageIndex = 12;
-                       this.PanGlo.ToolTipText = "GlobalPanning";
-                       // 
-                       // Front
-                       // 
-                       this.Front.ImageIndex = 13;
-                       this.Front.ToolTipText = "Front";
-                       // 
-                       // Back
-                       // 
-                       this.Back.ImageIndex = 14;
-                       this.Back.ToolTipText = "Back";
-                       // 
-                       // TOP
-                       // 
-                       this.TOP.ImageIndex = 15;
-                       this.TOP.ToolTipText = "Top";
-                       // 
-                       // BOTTOM
-                       // 
-                       this.BOTTOM.ImageIndex = 16;
-                       this.BOTTOM.ToolTipText = "Bottom";
-                       // 
-                       // LEFT
-                       // 
-                       this.LEFT.ImageIndex = 17;
-                       this.LEFT.ToolTipText = "Left";
-                       // 
-                       // RIGHT
-                       // 
-                       this.RIGHT.ImageIndex = 18;
-                       this.RIGHT.ToolTipText = "Right";
-                       // 
-                       // Axo
-                       // 
-                       this.Axo.ImageIndex = 19;
-                       this.Axo.ToolTipText = "Axo";
-                       // 
-                       // Rot
-                       // 
-                       this.Rot.ImageIndex = 20;
-                       this.Rot.ToolTipText = "Dynamic Rotation";
-                       // 
-                       // Reset
-                       // 
-                       this.Reset.ImageIndex = 21;
-                       this.Reset.ToolTipText = "Reset";
-                       // 
-                       // HlrOn
-                       // 
-                       this.HlrOn.ImageIndex = 22;
-                       this.HlrOn.Pushed = true;
-                       this.HlrOn.ToolTipText = "Hidden On";
-                       // 
-                       // HlrOff
-                       // 
-                       this.HlrOff.ImageIndex = 23;
-                       this.HlrOff.ToolTipText = "Hidden Off";
-                       // 
-                       // Form1
-                       // 
-                       this.AccessibleRole = System.Windows.Forms.AccessibleRole.Application;
-                       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-                       this.ClientSize = new System.Drawing.Size(560, 385);
-                       this.Controls.Add(this.toolBarView);
-                       this.Controls.Add(this.myStatusBar);
-                       this.Controls.Add(this.toolBarTool);
-                       this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-                       this.IsMdiContainer = true;
-                       this.Menu = this.mainMenu1;
-                       this.Name = "Form1";
-                       this.Text = "Sample Import / Export";
-                       this.Activated += new System.EventHandler(this.Form1_Activated);
-                       this.ResumeLayout(false);
-
-               }
-               #endregion
-
-               /// <summary>
-               /// The main entry point for the application.
-               /// </summary>
-               [STAThread]
-               static void Main() 
-               {
-                       Application.Run(new Form1());
-               }
-
-               private void menuItem2_Click(object sender, System.EventArgs e)
-               {
-
-                       this.Cursor=System.Windows.Forms.Cursors.WaitCursor;
-                       this.OnNewFile();
-               }
-
-               private void menuItem3_Click(object sender, System.EventArgs e)
-               {
-                       if ( this.MdiChildren.Length > 0 )
-                               this.ActiveMdiChild.Close();
-
-               }
-
-               private void ImportBRep_Click(object sender, System.EventArgs e)
-               {
-               
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=ModelFormat.BREP;
-                       curForm.ImportModel(this.myModelFormat);
-
-               }
-
-               private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
-               {
-
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       switch(toolBarTool.Buttons.IndexOf(e.Button))
-                       {
-                               case 0:
-                                       this.Cursor=System.Windows.Forms.Cursors.WaitCursor;
-                                       this.OnNewFile();
-                                       break;
-                               case 1:
-                                       AboutDialog myDlg = new AboutDialog();
-                                       myDlg.ShowDialog(this);
-                                       break;
-
-                               case 2: //just separator
-                                       break;
-                               case 3:
-                                       if (curForm == null)
-                                               return;
-                                       curForm.SetDisplayMode(0); //wireframe
-                                       this.wireframe.Enabled=false;
-                                       this.shading.Enabled=true;
-                                       this.transparency.Enabled=false;
-                                       break;
-                               case 4:
-                                       if (curForm == null)
-                                               return;
-                                       curForm.SetDisplayMode(1); //shading
-                                       this.shading.Enabled=false;
-                                       this.wireframe.Enabled=true;
-                                       this.transparency.Enabled=true;
-                                       break;
-                               case 5:
-                                       if (curForm == null)
-                                               return;
-                                       curForm.ChangeColor(true);
-                                       break;
-                               case 6:
-                                       if (curForm == null)
-                                               return;
-                                       MaterialDialog m = new MaterialDialog();
-                                       m.View=curForm.View;
-                                       m.ShowDialog(curForm);
-                                       break;
-                               case 7:
-                                       if (curForm == null)
-                                               return;
-                                       IE.TransparencyDialog t = new TransparencyDialog();
-                                       t.View=curForm.View;
-                                       t.ShowDialog(curForm);
-                                       break;
-                               case 8:
-                                       if (curForm == null)
-                                               return;
-                                       curForm.DeleteObjects();
-                                       break;
-                               default:
-                                       break;
-                       }
-               }
-
-               private void toolBar1_MouseHover(object sender, System.EventArgs e)
-               {
-                       this.myStatusBar.Text="Document toolbar";
-               }
-
-               private void toolBar1_MouseLeave(object sender, System.EventArgs e)
-               {
-                       this.myStatusBar.Text="";
-               }
-
-               private void ImportCsfdb_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.ModelFormat.CSFDB;
-                       curForm.ImportModel(this.myModelFormat);
-               }
-
-               private void ImportIges_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.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.ModelFormat.STEP;
-                       curForm.ImportModel(this.myModelFormat);
-               }
-
-               private void ExportBRep_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.ModelFormat.BREP;
-                       curForm.ExportModel(this.myModelFormat);
-               }
-
-               private void ExportCsfdb_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.ModelFormat.CSFDB;
-                       curForm.ExportModel(this.myModelFormat);
-               }
-
-               private void ExportIges_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.ModelFormat.IGES;
-                       curForm.ExportModel(this.myModelFormat);
-               }
-
-               private void ExportStep_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.ModelFormat.STEP;
-                       curForm.ExportModel(this.myModelFormat);
-               }
-
-               private void ExportStl_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.ModelFormat.STL;
-                       curForm.ExportModel(this.myModelFormat);
-               }
-
-               private void ExportVrml_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.ModelFormat.VRML;
-                       curForm.ExportModel(this.myModelFormat);
-               }
-
-               private void ExportImage_Click(object sender, System.EventArgs e)
-               {
-                       Form2 curForm = (Form2) this.ActiveMdiChild;
-                       if (curForm == null)
-                               return;
-                       this.myModelFormat=IE.ModelFormat.IMAGE;
-                       curForm.ExportModel(this.myModelFormat);
-               }
-
-               private void HelpAbout_Click(object sender, System.EventArgs e)
-               {
-                       AboutDialog myDlg = new AboutDialog();
-                       myDlg.ShowDialog(this);
-               }
-
-               private void ViewToolbar_Click(object sender, System.EventArgs e)
-               {
-                       
-                       if (this.ViewToolbar.Checked)
-                       {
-                               if (this.MdiChildren.Length > 0)
-                               {
-                                       this.New.Visible=false;
-                                       this.About.Visible=false;
-                               }
-                               else
-                                       this.toolBarTool.Hide();
-                               this.ViewToolbar.Checked=false;
-                       }
-                       else
-                       {
-                               if (this.MdiChildren.Length > 0)
-                               {
-                                       this.New.Visible=true;
-                                       this.About.Visible=true;
-                               } 
-                               else
-                                       this.toolBarTool.Show();
-                               this.ViewToolbar.Checked=true;
-                       }
-                       
-               }
-
-               private void ViewStatusBar_Click(object sender, System.EventArgs e)
-               {
-                       if (this.ViewStatusBar.Checked)
-                       {
-                               this.myStatusBar.Hide(); 
-                               this.ViewStatusBar.Checked=false;
-                       }
-                       else
-                       {
-                               this.myStatusBar.Show();
-                               this.ViewStatusBar.Checked=true;
-                       }
-               }
-
-               public void OnNewFile()
-               {
-                       Form2 newForm = new Form2();
-                       newForm.MdiParent=this;
-                       IE.Form1.myNbOfChildren=IE.Form1.myNbOfChildren+1;
-                       string str = System.String.Format(newForm.Text+" {0}:{1}", IE.Form1.myNbOfChildren, 1);
-                       newForm.Text=str;;
-                       newForm.Show();
-                       newForm.InitView();
-                       newForm.InitV3D();
-                       this.FileExport.Visible=true;
-                       this.FileImport.Visible=true;
-                       this.Window.Visible=true;
-                       this.wireframe.Visible=true;
-                       this.shading.Visible=true;
-                       this.color.Visible=true;
-                       this.material.Visible=true;
-                       this.transparency.Visible=true;
-                       this.delete.Visible=true;
-                       this.Cursor=System.Windows.Forms.Cursors.Default;
-                       this.toolBarView.Visible=true;
-               }
-
-               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;
-                       }
-
-               }
-
-               private void menuItem1_Click(object sender, System.EventArgs e)
-               {
-                       this.Close();
-               }
-
-               private void File_Popup(object sender, System.EventArgs e)
-               {
-                       if (this.MdiChildren.Length > 0 )
-                               this.FileClose.Enabled=true;
-                       else 
-                       {
-                               this.FileClose.Enabled=false;
-                               this.FileExport.Visible=false;
-                               this.FileImport.Visible=false;
-                       }
-               }
-
-               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();
-               }
-
-               private void WindowCascade_Click(object sender, System.EventArgs e)
-               {
-                       this.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade);
-               }
-
-               private void WindowTile_Click(object sender, System.EventArgs e)
-               {
-                       this.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical);
-               }
-
-               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;
-                               
-               }
-
-               public StatusBar StatusBar
-               {
-                       get
-                       {
-                               return this.myStatusBar;
-                       }
-               }
-
-               public void OnFileClose()
-               {
-                       if ( this.MdiChildren.Length <=  1)
-                       {
-                               this.FileClose.Enabled=false;
-                               this.Window.Visible=false;
-                               this.wireframe.Visible=false;
-                               this.shading.Visible=false;
-                               this.color.Visible=false;
-                               this.material.Visible=false;
-                               this.transparency.Visible=false;
-                               this.delete.Visible=false;
-                               this.toolBarView.Visible=false;
-                       }
-               }
-
-               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;
-                       }
-               }
-
-               private void Form1_Activated(object sender, System.EventArgs e)
-               {
-                       if (this.toolBarView.Visible)
-                               this.SelectionChanged();
-               }
-
-               private void toolBarView_MouseHover(object sender, System.EventArgs e)
-               {
-                       this.myStatusBar.Text="View toolbar";
-               }
-
-               private void toolBarView_MouseLeave(object sender, System.EventArgs e)
-               {
-                       this.myStatusBar.Text="";
-               }
-
-       }
-
-}
\ No newline at end of file
diff --git a/samples/CSharp/IE/Form2.cs b/samples/CSharp/IE/Form2.cs
deleted file mode 100755 (executable)
index 2019e8c..0000000
+++ /dev/null
@@ -1,942 +0,0 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-
-namespace IE
-{
-       public enum CurrentAction3d 
-       { 
-               CurAction3d_Nothing,
-               CurAction3d_DynamicZooming,
-               CurAction3d_WindowZooming,
-               CurAction3d_DynamicPanning,
-               CurAction3d_GlobalPanning,
-               CurAction3d_DynamicRotation
-       }
-       public enum CurrentPressedKey
-       {
-               CurPressedKey_Nothing,
-               CurPressedKey_Ctrl,
-               CurPressedKey_Shift
-       }
-       public enum ModelFormat
-       {
-               BREP,
-               CSFDB,
-               STEP,
-               IGES,
-               VRML,
-               STL,
-               IMAGE
-       }
-       /// <summary>
-       /// Summary description for Form2.
-       /// </summary>
-       public class Form2 : System.Windows.Forms.Form
-       {
-               private System.ComponentModel.IContainer components;
-
-               public Form2()
-               {
-                       //
-                       // Required for Windows Form Designer support
-                       //
-                       InitializeComponent();
-
-                       //
-                       // TODO: Add any constructor code after InitializeComponent call
-                       //
-                       myView = new shell();
-                       myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
-                       myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Nothing;
-                       myDegenerateModeIsOn=true;
-                       IsRectVisible=false;
-               }
-
-               /// <summary>
-               /// Clean up any resources being used.
-               /// </summary>
-               protected override void Dispose( bool disposing )
-               {
-                       if( disposing )
-                       {
-                               if(components != null)
-                               {
-                                       components.Dispose();
-                               }
-                       }
-                       base.Dispose( disposing );
-               }
-
-               #region Windows Form Designer generated code
-               /// <summary>
-               /// Required method for Designer support - do not modify
-               /// the contents of this method with the code editor.
-               /// </summary>
-               private void InitializeComponent()
-               {
-                       this.components = new System.ComponentModel.Container();
-                       System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form2));
-                       this.imageList1 = new System.Windows.Forms.ImageList(this.components);
-                       this.myPopup = new System.Windows.Forms.ContextMenu();
-                       this.menuItem1 = new System.Windows.Forms.MenuItem();
-                       this.myPopupObject = new System.Windows.Forms.ContextMenu();
-                       this.ContextWireframe = new System.Windows.Forms.MenuItem();
-                       this.ContextShading = new System.Windows.Forms.MenuItem();
-                       this.ContextColor = new System.Windows.Forms.MenuItem();
-                       this.ContextMaterial = new System.Windows.Forms.MenuItem();
-                       this.ContMatBrass = new System.Windows.Forms.MenuItem();
-                       this.ContMenBronze = new System.Windows.Forms.MenuItem();
-                       this.ContMenCopper = new System.Windows.Forms.MenuItem();
-                       this.ContMenGold = new System.Windows.Forms.MenuItem();
-                       this.ContMenPewt = new System.Windows.Forms.MenuItem();
-                       this.ContMenPlaster = new System.Windows.Forms.MenuItem();
-                       this.ContMenPlastic = new System.Windows.Forms.MenuItem();
-                       this.ContMenSilver = new System.Windows.Forms.MenuItem();
-                       this.ContMenTranc = new System.Windows.Forms.MenuItem();
-                       this.ContMenDelete = new System.Windows.Forms.MenuItem();
-                       // 
-                       // imageList1
-                       // 
-                       this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
-                       this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
-                       this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
-                       // 
-                       // myPopup
-                       // 
-                       this.myPopup.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                       this.menuItem1});
-                       // 
-                       // menuItem1
-                       // 
-                       this.menuItem1.Index = 0;
-                       this.menuItem1.Text = "Change &Background";
-                       this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
-                       // 
-                       // myPopupObject
-                       // 
-                       this.myPopupObject.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                                 this.ContextWireframe,
-                                                                                                                                                                                 this.ContextShading,
-                                                                                                                                                                                 this.ContextColor,
-                                                                                                                                                                                 this.ContextMaterial,
-                                                                                                                                                                                 this.ContMenTranc,
-                                                                                                                                                                                 this.ContMenDelete});
-                       this.myPopupObject.Popup += new System.EventHandler(this.myPopupObject_Popup);
-                       // 
-                       // ContextWireframe
-                       // 
-                       this.ContextWireframe.Index = 0;
-                       this.ContextWireframe.Text = "Wireframe";
-                       this.ContextWireframe.Click += new System.EventHandler(this.ContextWireframe_Click);
-                       // 
-                       // ContextShading
-                       // 
-                       this.ContextShading.Index = 1;
-                       this.ContextShading.Text = "Shading";
-                       this.ContextShading.Click += new System.EventHandler(this.ContextShading_Click);
-                       // 
-                       // ContextColor
-                       // 
-                       this.ContextColor.Index = 2;
-                       this.ContextColor.Text = "Color";
-                       this.ContextColor.Click += new System.EventHandler(this.ContextColor_Click);
-                       // 
-                       // ContextMaterial
-                       // 
-                       this.ContextMaterial.Index = 3;
-                       this.ContextMaterial.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-                                                                                                                                                                                       this.ContMatBrass,
-                                                                                                                                                                                       this.ContMenBronze,
-                                                                                                                                                                                       this.ContMenCopper,
-                                                                                                                                                                                       this.ContMenGold,
-                                                                                                                                                                                       this.ContMenPewt,
-                                                                                                                                                                                       this.ContMenPlaster,
-                                                                                                                                                                                       this.ContMenPlastic,
-                                                                                                                                                                                       this.ContMenSilver});
-                       this.ContextMaterial.Text = "Material";
-                       // 
-                       // ContMatBrass
-                       // 
-                       this.ContMatBrass.Index = 0;
-                       this.ContMatBrass.Text = "&Brass";
-                       this.ContMatBrass.Click += new System.EventHandler(this.ContMatBrass_Click);
-                       // 
-                       // ContMenBronze
-                       // 
-                       this.ContMenBronze.Index = 1;
-                       this.ContMenBronze.Text = "&Bronze";
-                       this.ContMenBronze.Click += new System.EventHandler(this.ContMenBronze_Click);
-                       // 
-                       // ContMenCopper
-                       // 
-                       this.ContMenCopper.Index = 2;
-                       this.ContMenCopper.Text = "&Copper";
-                       this.ContMenCopper.Click += new System.EventHandler(this.ContMenCopper_Click);
-                       // 
-                       // ContMenGold
-                       // 
-                       this.ContMenGold.Index = 3;
-                       this.ContMenGold.Text = "&Gold";
-                       this.ContMenGold.Click += new System.EventHandler(this.ContMenGold_Click);
-                       // 
-                       // ContMenPewt
-                       // 
-                       this.ContMenPewt.Index = 4;
-                       this.ContMenPewt.Text = "&Pewter";
-                       this.ContMenPewt.Click += new System.EventHandler(this.ContMenPewt_Click);
-                       // 
-                       // ContMenPlaster
-                       // 
-                       this.ContMenPlaster.Index = 5;
-                       this.ContMenPlaster.Text = "&Plaster";
-                       this.ContMenPlaster.Click += new System.EventHandler(this.ContMenPlaster_Click);
-                       // 
-                       // ContMenPlastic
-                       // 
-                       this.ContMenPlastic.Index = 6;
-                       this.ContMenPlastic.Text = "&Plastic";
-                       this.ContMenPlastic.Click += new System.EventHandler(this.ContMenPlastic_Click);
-                       // 
-                       // ContMenSilver
-                       // 
-                       this.ContMenSilver.Index = 7;
-                       this.ContMenSilver.Text = "&Silver";
-                       this.ContMenSilver.Click += new System.EventHandler(this.ContMenSilver_Click);
-                       // 
-                       // ContMenTranc
-                       // 
-                       this.ContMenTranc.Index = 4;
-                       this.ContMenTranc.Text = "&Trancparency";
-                       this.ContMenTranc.Click += new System.EventHandler(this.ContMenTranc_Click);
-                       // 
-                       // ContMenDelete
-                       // 
-                       this.ContMenDelete.Index = 5;
-                       this.ContMenDelete.Text = "&Delete";
-                       this.ContMenDelete.Click += new System.EventHandler(this.ContMenDelete_Click);
-                       // 
-                       // Form2
-                       // 
-                       this.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
-                       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-                       this.ClientSize = new System.Drawing.Size(320, 261);
-                       this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-                       this.ImeMode = System.Windows.Forms.ImeMode.NoControl;
-                       this.Name = "Form2";
-                       this.Text = "Document";
-                       this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
-                       this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form2_KeyDown);
-                       this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseDown);
-                       this.SizeChanged += new System.EventHandler(this.Form2_SizeChanged);
-                       this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseUp);
-                       this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form2_KeyUp);
-                       this.Closed += new System.EventHandler(this.Form2_Closed);
-                       this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form2_Paint);
-                       this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseMove);
-
-               }
-               #endregion
-
-               private System.Windows.Forms.ImageList imageList1;
-               private System.Windows.Forms.ContextMenu myPopup;
-               private System.Windows.Forms.ContextMenu myPopupObject;
-               private System.Windows.Forms.MenuItem ContextWireframe;
-               private System.Windows.Forms.MenuItem ContextShading;
-               private System.Windows.Forms.MenuItem ContextColor;
-               private System.Windows.Forms.MenuItem ContextMaterial;
-               private System.Windows.Forms.MenuItem ContMatBrass;
-               private System.Windows.Forms.MenuItem ContMenBronze;
-               private System.Windows.Forms.MenuItem ContMenCopper;
-               private System.Windows.Forms.MenuItem ContMenGold;
-               private System.Windows.Forms.MenuItem ContMenPewt;
-               private System.Windows.Forms.MenuItem ContMenPlaster;
-               private System.Windows.Forms.MenuItem ContMenPlastic;
-               private System.Windows.Forms.MenuItem ContMenSilver;
-               private System.Windows.Forms.MenuItem ContMenTranc;
-               private System.Windows.Forms.MenuItem ContMenDelete;
-               private System.Windows.Forms.MenuItem menuItem1;
-
-               private shell myView;
-
-               public void InitV3D()
-               {
-
-                       if( !myView.InitViewer(this.Handle) )
-                               MessageBox.Show("Fatal Error during the graphic initialisation", "Error!", 
-                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
-               }
-
-               public bool ImportBRep(System.String filename)
-               {
-                       return myView.ImportBrep(filename);
-               }
-
-               private void Form2_SizeChanged(object sender, System.EventArgs e)
-               {
-                       myView.UpdateView();
-               }
-
-               private void Form2_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
-               {
-                       myView.RedrawView();
-                       myView.UpdateView();
-               }
-
-               protected CurrentAction3d myCurrentMode;
-               protected CurrentPressedKey myCurrentPressedKey;
-               protected float myCurZoom;// ~ Quantity_Factor
-               protected bool myDegenerateModeIsOn;
-               protected int myXmin;
-               protected int myYmin;
-               protected int myXmax;
-               protected int myYmax;
-               protected int theButtonDownX;
-               protected int theButtonDownY;
-               // for erasing of rectangle
-               protected int theRectDownX;
-               protected int theRectDownY;
-               protected bool IsRectVisible;
-
-               private void Form2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
-               {
-                       switch (e.Button) 
-                       {
-                               case MouseButtons.Left:
-                                       myXmin=e.X;     myYmin=e.Y;
-                                       myXmax=e.X;     myYmax=e.Y;
-                                       if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
-                                               // start the dinamic zooming....
-                                               myCurrentMode=CurrentAction3d.CurAction3d_DynamicZooming;
-                                       else
-                                       {
-                                               switch(myCurrentMode)
-                                               {
-                                                       case CurrentAction3d.CurAction3d_Nothing:
-                                                               if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
-                                                                       MultiDragEvent(myXmax, myYmax, -1);
-                                                               else
-                                                                       DragEvent(myXmax, myYmax, -1);
-                                                               break;
-                                                       case CurrentAction3d.CurAction3d_DynamicRotation:
-                                                               if (!myDegenerateModeIsOn)
-                                                                       myView.SetDegenerateModeOn();
-                                                               //start the rotation
-                                                               myView.StartRotation(e.X, e.Y);
-                                                               break;
-                                                       case IE.CurrentAction3d.CurAction3d_WindowZooming:
-                                                               this.Cursor=System.Windows.Forms.Cursors.Hand;
-                                                               break;
-                                                       default:
-                                                               break;
-                                               }
-                                       }
-                                       break;
-                               case MouseButtons.Right:
-                                       //MessageBox.Show("right mouse button is down");
-                                       if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
-                                       {
-                                               if (!myDegenerateModeIsOn)
-                                                       myView.SetDegenerateModeOn();
-                                               myView.StartRotation(e.X, e.Y);
-                                       } 
-                                       else
-                                               Popup(e.X, e.Y);
-                                       break;
-                               default:
-                                       break;
-                       }
-
-               }
-
-               private void Form2_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
-               {
-                       if (e.Shift)
-                               myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Shift;
-                       else if (e.Control)
-                               myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Ctrl;
-               }
-
-               private void Form2_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
-               {
-                       myCurrentPressedKey=CurrentPressedKey.CurPressedKey_Nothing;
-               }
-
-               protected void MultiDragEvent(int x, int y, int theState)
-               {
-                       if ( theState==-1) 
-                       {
-                               theButtonDownX=x;
-                               theButtonDownY=y;
-                       } 
-                       else if (theState==1)
-                               myView.ShiftSelect(Math.Min(theButtonDownX,x), Math.Min(theButtonDownY,y),
-                                       Math.Max(theButtonDownX, x), Math.Max(theButtonDownY, y));
-               }
-
-               protected void DragEvent(int x, int y, int theState)
-               {
-                       if (theState==-1) //mouse is down
-                       {
-                               theButtonDownX=x;
-                               theButtonDownY=y;
-                       } 
-                       else if (theState==1) //mouse is up
-                       {
-                               myView.Select(Math.Min(theButtonDownX, x), Math.Min(theButtonDownY,y),
-                                       Math.Max(theButtonDownX, x), Math.Max(theButtonDownY,y));
-                       }
-               }
-
-               protected void Popup(int x, int y)
-               {
-                       System.Drawing.Point p = new Point(x,y);
-                       if (this.myView.IsObjectSelected())
-                               this.myPopupObject.Show(this, p);
-                       else
-                               this.myPopup.Show(this, p);
-               }
-
-               private void Form2_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
-               {
-                       switch(e.Button)
-                       {
-                               case MouseButtons.Left:
-                                       if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
-                                               return;
-                               switch(myCurrentMode)
-                               {
-                                       case CurrentAction3d.CurAction3d_Nothing:
-                                               if( e.X==myXmin && e.Y==myYmin)
-                                               {
-                                                       myXmax=e.X; myYmax=e.Y;
-                                                       if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
-                                                               MultiInputEvent(myXmax, myYmax);
-                                                       else
-                                                               InputEvent(myXmax, myYmax);
-                                               } 
-                                               else 
-                                               {
-                                                       myXmax=e.X; myYmax=e.Y;
-                                                       DrawRectangle(false);
-                                                       if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
-                                                               MultiDragEvent(myXmax, myYmax, 1);
-                                                       else
-                                                               DragEvent(myXmax, myYmax, 1);
-                                               }
-                                               break;
-                                       case CurrentAction3d.CurAction3d_DynamicZooming:
-                                               myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
-                                               break;
-                                       case CurrentAction3d.CurAction3d_WindowZooming:
-                                               myXmax=e.X; myYmax=e.Y;
-                                               DrawRectangle(false);
-                                               int ValZWMin = 1;
-                                               if (Math.Abs(myXmax-myXmin)>ValZWMin && Math.Abs(myXmax-myYmax)>ValZWMin)
-                                                       myView.WindowFitAll(myXmin, myYmin, myXmax, myYmax);
-                                               this.Cursor=System.Windows.Forms.Cursors.Default;
-                                               IE.Form1 f = (IE.Form1)this.ParentForm;
-                                               f.SelectionChanged();
-                                               myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
-                                               break;
-                                       case CurrentAction3d.CurAction3d_DynamicPanning:
-                                               myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
-                                               break;
-                                       case CurrentAction3d.CurAction3d_GlobalPanning:
-                                               myView.Place(e.X, e.Y, myCurZoom);
-                                               myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
-                                               break;
-                                       case CurrentAction3d.CurAction3d_DynamicRotation:
-                                               myCurrentMode=CurrentAction3d.CurAction3d_Nothing;
-                                               if (!myDegenerateModeIsOn) 
-                                               {
-                                                       myView.SetDegenerateModeOff();
-                                                       myDegenerateModeIsOn=false;
-                                               } 
-                                               else 
-                                               {
-                                                       myView.SetDegenerateModeOn();
-                                                       myDegenerateModeIsOn=true;
-                                               }
-                                               break;
-                                       default:
-                                               break;
-
-                               }
-                                       break;
-                               case MouseButtons.Right:
-                                       if (!myDegenerateModeIsOn) 
-                                       {
-                                               myView.SetDegenerateModeOff();
-                                               myDegenerateModeIsOn=false;
-                                       } 
-                                       else 
-                                       {
-                                               myView.SetDegenerateModeOn();
-                                               myDegenerateModeIsOn=true;
-                                       }
-                                       break;
-                               default:
-                                       break;
-                       }
-                       
-                       IE.Form1 parent = (IE.Form1)this.ParentForm;
-                       parent.SelectionChanged();
-               }
-
-               protected void MultiInputEvent(int x, int y)
-               {
-                       myView.ShiftSelect();
-               }
-
-               protected void InputEvent(int x, int y)
-               {
-                       myView.Select();
-               }
-
-               private void DrawRectangle(bool draw)
-               {
-                       Graphics gr = Graphics.FromHwnd(this.Handle);
-                       System.Drawing.Pen p = null;
-                       if (this.IsRectVisible ||(!draw))//erase the rect
-                       {
-                               int r=myView.GetBGColR();
-                               int g=myView.GetBGColG();
-                               int b=myView.GetBGColB();
-                               p = new Pen(System.Drawing.Color.FromArgb( r,g, b));
-                               this.IsRectVisible=false;
-                               this.myView.UpdateView();
-                       } 
-                       else if (draw) 
-                       {
-                               p = new Pen(System.Drawing.Color.White);
-                               this.IsRectVisible=true;
-                       }
-                       if ( p == null )
-                               return;
-                       int x=Math.Min(this.myXmin, this.myXmax);
-                       int y=Math.Min(this.myYmin, this.myYmax);
-                       gr.DrawRectangle(p, x, y, Math.Abs(myXmax-myXmin), Math.Abs(myYmax - myYmin));
-                       this.theRectDownX=Math.Max(this.myXmin, this.myXmax);
-                       this.theRectDownY=Math.Max(this.myYmin, this.myYmax);
-               }
-
-               private void Form2_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
-               {
-                       if (e.Button == MouseButtons.Left) //left button is pressed
-                       {
-                               if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
-                               {
-                                       myView.Zoom(myXmax, myYmax, e.X, e.Y);
-                                       myXmax=e.X; myYmax=e.Y;
-                               }
-                               else 
-                               {
-                                       switch (myCurrentMode)
-                                       {
-                                               case CurrentAction3d.CurAction3d_Nothing:
-                                                       DrawRectangle(false);
-                                                       myXmax=e.X; myYmax=e.Y;
-                                                       DrawRectangle(true);
-                                                       break;
-                                               case CurrentAction3d.CurAction3d_DynamicZooming:
-                                                       myView.Zoom(myXmax, myYmax, e.X, e.Y);
-                                                       myXmax=e.X; myYmax=e.Y;
-                                                       break;
-                                               case CurrentAction3d.CurAction3d_WindowZooming:
-                                                       DrawRectangle(false);
-                                                       myXmax=e.X; myYmax=e.Y;
-                                                       DrawRectangle(true);//add brush here
-                                                       break;
-                                               case CurrentAction3d.CurAction3d_DynamicPanning:
-                                                       myView.Pan(e.X-myXmax, myYmax - e.Y);
-                                                       myXmax=e.X; myYmax=e.Y;
-                                                       break;
-                                               case CurrentAction3d.CurAction3d_GlobalPanning:
-                                                       break;
-                                               case CurrentAction3d.CurAction3d_DynamicRotation:
-                                                       myView.Rotation(e.X, e.Y);
-                                                       myView.RedrawView();
-                                                       break;
-                                               default:
-                                                       break;
-                                       }
-                               }
-                       } // e.Button == MouseButtons.Left
-                       else if (e.Button==MouseButtons.Middle)
-                       {
-                               if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Ctrl)
-                               {
-                                       myView.Pan(e.X-myXmax, myYmax - e.Y);
-                                       myXmax=e.X; myYmax=e.Y;
-                               }
-                       }//e.Button=MouseButtons.Middle
-                       else if (e.Button==MouseButtons.Right) //right button is pressed
-                       {
-                               if (myCurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl)
-                                       myView.Rotation(e.X, e.Y);
-                       }
-                       else // no buttons are pressed
-                       {
-                               myXmax=e.X; myYmax=e.Y;
-                               if (myCurrentPressedKey==CurrentPressedKey.CurPressedKey_Shift)
-                                       MultiMoveEvent(e.X, e.Y);
-                               else
-                                       MoveEvent(e.X, e.Y);
-                       }
-                       
-                                                                       
-               }
-
-               protected void MultiMoveEvent(int x, int y)
-               {
-                       myView.MoveTo(x, y);
-               }
-
-               protected void MoveEvent(int x, int y)
-               {
-                       myView.MoveTo(x, y);
-               }
-
-               public void SetDisplayMode(int aMode)
-               {
-                       myView.SetDisplayMode(aMode);
-               }
-
-               public void ChangeColor(bool IsObjectColor)
-               {
-                       int r, g, b;
-                       if (IsObjectColor) 
-                       {
-                               r=myView.GetObjColR();
-                               g=myView.GetObjColG();
-                               b=myView.GetObjColB();
-                       }
-                       else 
-                       {
-                               r=myView.GetBGColR();
-                               g=myView.GetBGColG();
-                               b=myView.GetBGColB();
-                       }
-                       System.Windows.Forms.ColorDialog ColDlg = new ColorDialog();
-                       ColDlg.Color=System.Drawing.Color.FromArgb(r, g, b);
-                       if (ColDlg.ShowDialog() == DialogResult.OK)
-                       {
-                               Color c = ColDlg.Color;
-                               r=c.R;
-                               g=c.G;
-                               b=c.B;
-                               if (IsObjectColor)
-                                       myView.SetColor(r, g, b);
-                               else
-                                       myView.SetBackgroundColor(r, g, b);
-                       }
-                       this.myView.UpdateCurrentViewer();
-
-               }
-
-               public void DeleteObjects()
-               {
-                       myView.EraseObjects();
-               }
-               public void ImportModel(IE.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.ModelFormat.STEP:
-                                       openDialog.InitialDirectory = (DataDir + "\\step");
-                                       theformat=2;
-                                       filter="STEP Files (*.stp *.step)|*.stp; *.step";
-                                       break;
-                               case IE.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 (!myView.TranslateModel(filename, theformat, true))
-                               MessageBox.Show("Cann't read this file", "Error!", 
-                                       MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                               this.Cursor=System.Windows.Forms.Cursors.Default;
-                       }
-                       this.myView.ZoomAllView();
-               }
-
-               public void ExportModel(ModelFormat format)
-               {
-                       int theformat=10;
-                       System.Windows.Forms.SaveFileDialog  saveDialog = new SaveFileDialog();
-                       string DataDir=((Environment.GetEnvironmentVariable("CASROOT")) + "\\..\\data");        
-                       string filter="";
-                       switch (format)
-                       {
-                               case IE.ModelFormat.BREP:
-                                       saveDialog.InitialDirectory = (DataDir + "\\occ");
-                                       theformat=0;
-                                       filter= "BREP Files (*.brep *.rle)|*.brep; *.rle";
-                                       break;
-                               case IE.ModelFormat.CSFDB:
-                                       theformat=1;
-                                       filter= "CSFDB Files (*.csfdb)|*.csfdb";
-                                       break;
-                               case IE.ModelFormat.STEP:
-                                       saveDialog.InitialDirectory = (DataDir + "\\step");
-                                       theformat=2;
-                                       filter="STEP Files (*.stp *.step)|*.step; *.stp";
-                                       break;
-                               case IE.ModelFormat.IGES:
-                                       saveDialog.InitialDirectory = (DataDir + "\\iges");
-                                       theformat=3;
-                                       filter="IGES Files (*.igs *.iges)| *.iges; *.igs";
-                                       break;
-                               case IE.ModelFormat.VRML:
-                                       saveDialog.InitialDirectory = (DataDir + "\\vrml");
-                                       theformat=4;
-                                       filter="VRML Files (*.vrml)|*.vrml";
-                                       break;
-                               case IE.ModelFormat.STL:
-                                       saveDialog.InitialDirectory = (DataDir + "\\stl");
-                                       theformat=5;
-                                       filter="STL Files (*.stl)|*.stl";
-                                       break;
-                               case IE.ModelFormat.IMAGE:
-                                       saveDialog.InitialDirectory = (DataDir + "\\images");
-                                       theformat=6;
-                                       filter="Images Files (*.bmp *.gif *.xwd)| *.bmp; *.gif; *.xwd";
-                                       break;
-                               default:
-                                       break;
-                       }
-                       saveDialog.Filter = filter;
-                       if(saveDialog.ShowDialog() == DialogResult.OK)
-                       {
-                               string filename = saveDialog.FileName;
-                               if ( filename=="")
-                                       return;
-                               this.Cursor=System.Windows.Forms.Cursors.WaitCursor;
-                               if (!myView.TranslateModel(filename, theformat, false))
-                                       MessageBox.Show("Cann't write this file", "Error!", 
-                                               MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                               this.Cursor=System.Windows.Forms.Cursors.Default;
-                       }
-               }
-
-               private void ContextColor_Click(object sender, System.EventArgs e)
-               {
-                       this.ChangeColor(true);
-               }
-
-               private void menuItem1_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.ChangeColor(false);
-               }
-
-               private void ContextWireframe_Click(object sender, System.EventArgs e)
-               {
-                       this.SetDisplayMode(0);
-                       this.myView.UpdateCurrentViewer();
-                       IE.Form1 parent=(IE.Form1)this.ParentForm;
-                       parent.SelectionChanged();
-               }
-
-               private void ContextShading_Click(object sender, System.EventArgs e)
-               {
-                       this.SetDisplayMode(1);
-                       this.myView.UpdateCurrentViewer();
-                       IE.Form1 parent=(IE.Form1)this.ParentForm;
-                       parent.SelectionChanged();
-               }
-
-               private void ContMenTranc_Click(object sender, System.EventArgs e)
-               {
-                       IE.TransparencyDialog dlg = new TransparencyDialog();
-                       dlg.View=this.myView;
-                       dlg.ShowDialog(this);
-               }
-
-               private void ContMenDelete_Click(object sender, System.EventArgs e)
-               {
-                       this.DeleteObjects();
-               }
-
-               private void ContMatBrass_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.myView.SetMaterial(0);
-               }
-
-               private void ContMenBronze_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.myView.SetMaterial(1);
-               }
-
-               private void ContMenCopper_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.myView.SetMaterial(2);
-               }
-
-               private void ContMenGold_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.myView.SetMaterial(3);
-               }
-
-               private void ContMenPewt_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.myView.SetMaterial(4);
-               }
-
-               private void ContMenPlaster_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.myView.SetMaterial(5);
-               }
-
-               private void ContMenPlastic_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.myView.SetMaterial(6);
-               }
-
-               private void ContMenSilver_Click(object sender, System.EventArgs e)
-               {
-                       this.myView.UpdateCurrentViewer();
-                       this.myView.SetMaterial(7);
-               }
-
-               private void toolBar1_MouseHover(object sender, System.EventArgs e)
-               {
-                       IE.Form1 parent=(IE.Form1)this.ParentForm;
-                       parent.StatusBar.Text="View toolbar";
-
-               }
-
-               private void toolBar1_MouseLeave(object sender, System.EventArgs e)
-               {
-                       IE.Form1 parent=(IE.Form1)this.ParentForm;
-                       parent.StatusBar.Text="";
-               }
-
-               private void myPopupObject_Popup(object sender, System.EventArgs e)
-               {
-                       int mode=this.myView.DisplayMode();
-                       switch (mode)
-                       {
-                               case -1:
-                                        break;
-                               case 0:
-                                       this.ContextWireframe.Enabled=false;
-                                       this.ContextShading.Enabled=true;
-                                       this.ContMenTranc.Enabled=false;
-                                       break;
-                               case 1:
-                                       this.ContextShading.Enabled=false;
-                                       this.ContextWireframe.Enabled=true;
-                                       this.ContMenTranc.Enabled=true;
-                                       break;
-                               case 10:
-                                       this.ContextShading.Enabled=true;;
-                                       this.ContextWireframe.Enabled=true;
-                                       this.ContMenTranc.Enabled=true;
-                                       break;
-                               default:
-                                       break;
-
-                       }
-               }
-
-               public shell View
-               {
-                       get
-                       {
-                               return this.myView;
-                       }
-                       set
-                       {
-                               this.myView=value;
-                       }
-               }
-
-               public void InitView()
-               {
-                       this.myView.InitOCCViewer();
-               }
-
-               public void SetContext(shell View)
-               {
-                       this.myView.SetAISContext(View);
-               }
-
-               private void Form2_Closed(object sender, System.EventArgs e)
-               {
-                       IE.Form1 parent = (IE.Form1) this.ParentForm;
-                       parent.OnFileClose();
-               }
-
-               public CurrentAction3d Mode
-               {
-                       get
-                       {
-                               return this.myCurrentMode;
-                       }
-                       set
-                       {
-                               this.myCurrentMode=value;
-                       }
-               }
-
-               public float Zoom
-               {
-                       set
-                       {
-                               this.myCurZoom=value;
-                       }
-               }
-
-               public bool DegenerateMode
-               {
-                       get
-                       {
-                               return this.myDegenerateModeIsOn;
-                       }
-                       set
-                       {
-                               this.myDegenerateModeIsOn=value;
-                       }
-               }
-
-       }
-
-}
\ No newline at end of file
diff --git a/samples/CSharp/IE/IE.sln b/samples/CSharp/IE/IE.sln
deleted file mode 100755 (executable)
index 120ac23..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE", "IE.csproj", "{B9914BB3-B886-4B41-B48D-350EBEBEFD1F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCC", "..\OCC\OCC.vcproj", "{DCB139CF-2190-412E-B72F-8B080CC01422}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shell", "..\shell\shell.vcproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
-       ProjectSection(ProjectDependencies) = postProject
-               {DCB139CF-2190-412E-B72F-8B080CC01422} = {DCB139CF-2190-412E-B72F-8B080CC01422}
-       EndProjectSection
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Any CPU = Debug|Any CPU
-               Debug|Mixed Platforms = Debug|Mixed Platforms
-               Debug|Win32 = Debug|Win32
-               Release|Any CPU = Release|Any CPU
-               Release|Mixed Platforms = Release|Mixed Platforms
-               Release|Win32 = Release|Win32
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.ActiveCfg = Debug|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Any CPU.Build.0 = Release|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.ActiveCfg = Release|Any CPU
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Debug|Any CPU.ActiveCfg = Debug|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Debug|Mixed Platforms.Build.0 = Debug|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Debug|Win32.ActiveCfg = Debug|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Debug|Win32.Build.0 = Debug|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Release|Any CPU.ActiveCfg = Release|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Release|Mixed Platforms.ActiveCfg = Release|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Release|Mixed Platforms.Build.0 = Release|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Release|Win32.ActiveCfg = Release|Win32
-               {DCB139CF-2190-412E-B72F-8B080CC01422}.Release|Win32.Build.0 = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Any CPU.ActiveCfg = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Mixed Platforms.Build.0 = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Any CPU.ActiveCfg = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Mixed Platforms.ActiveCfg = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Mixed Platforms.Build.0 = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
diff --git a/samples/CSharp/IE/MaterialDialog.cs b/samples/CSharp/IE/MaterialDialog.cs
deleted file mode 100755 (executable)
index 159eb81..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace IE
-{
-       /// <summary>
-       /// Summary description for MaterialDialog.
-       /// </summary>
-       public class MaterialDialog : System.Windows.Forms.Form
-       {
-               /// <summary>
-               /// Required designer variable.
-               /// </summary>
-               private System.ComponentModel.Container components = null;
-
-               public MaterialDialog()
-               {
-                       //
-                       // Required for Windows Form Designer support
-                       //
-                       InitializeComponent();
-
-                       //
-                       // TODO: Add any constructor code after InitializeComponent call
-                       //
-                       this.myView=null;
-               }
-
-               /// <summary>
-               /// Clean up any resources being used.
-               /// </summary>
-               protected override void Dispose( bool disposing )
-               {
-                       if( disposing )
-                       {
-                               if(components != null)
-                               {
-                                       components.Dispose();
-                               }
-                       }
-                       base.Dispose( disposing );
-               }
-
-               #region Windows Form Designer generated code
-               /// <summary>
-               /// Required method for Designer support - do not modify
-               /// the contents of this method with the code editor.
-               /// </summary>
-               private void InitializeComponent()
-               {
-                       System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MaterialDialog));
-                       this.BTN_PLASTER = new System.Windows.Forms.Button();
-                       this.BTN_BRASS = new System.Windows.Forms.Button();
-                       this.BTN_BRONZE = new System.Windows.Forms.Button();
-                       this.BTN_COPPER = new System.Windows.Forms.Button();
-                       this.BTN_GOLD = new System.Windows.Forms.Button();
-                       this.BTN_PEWTER = new System.Windows.Forms.Button();
-                       this.BTN_PLASTIC = new System.Windows.Forms.Button();
-                       this.BTN_SILVER = new System.Windows.Forms.Button();
-                       this.SuspendLayout();
-                       // 
-                       // BTN_PLASTER
-                       // 
-                       this.BTN_PLASTER.Location = new System.Drawing.Point(16, 8);
-                       this.BTN_PLASTER.Name = "BTN_PLASTER";
-                       this.BTN_PLASTER.Size = new System.Drawing.Size(80, 24);
-                       this.BTN_PLASTER.TabIndex = 0;
-                       this.BTN_PLASTER.Text = "Plaster";
-                       this.BTN_PLASTER.Click += new System.EventHandler(this.button1_Click);
-                       // 
-                       // BTN_BRASS
-                       // 
-                       this.BTN_BRASS.Location = new System.Drawing.Point(16, 40);
-                       this.BTN_BRASS.Name = "BTN_BRASS";
-                       this.BTN_BRASS.Size = new System.Drawing.Size(80, 24);
-                       this.BTN_BRASS.TabIndex = 1;
-                       this.BTN_BRASS.Text = "Brass";
-                       this.BTN_BRASS.Click += new System.EventHandler(this.BTN_BRASS_Click);
-                       // 
-                       // BTN_BRONZE
-                       // 
-                       this.BTN_BRONZE.Location = new System.Drawing.Point(16, 72);
-                       this.BTN_BRONZE.Name = "BTN_BRONZE";
-                       this.BTN_BRONZE.Size = new System.Drawing.Size(80, 24);
-                       this.BTN_BRONZE.TabIndex = 2;
-                       this.BTN_BRONZE.Text = "Bronze";
-                       this.BTN_BRONZE.Click += new System.EventHandler(this.BTN_BRONZE_Click);
-                       // 
-                       // BTN_COPPER
-                       // 
-                       this.BTN_COPPER.Location = new System.Drawing.Point(16, 104);
-                       this.BTN_COPPER.Name = "BTN_COPPER";
-                       this.BTN_COPPER.Size = new System.Drawing.Size(80, 24);
-                       this.BTN_COPPER.TabIndex = 3;
-                       this.BTN_COPPER.Text = "Copper";
-                       this.BTN_COPPER.Click += new System.EventHandler(this.BTN_COPPER_Click);
-                       // 
-                       // BTN_GOLD
-                       // 
-                       this.BTN_GOLD.Location = new System.Drawing.Point(16, 136);
-                       this.BTN_GOLD.Name = "BTN_GOLD";
-                       this.BTN_GOLD.Size = new System.Drawing.Size(80, 24);
-                       this.BTN_GOLD.TabIndex = 4;
-                       this.BTN_GOLD.Text = "Gold";
-                       this.BTN_GOLD.Click += new System.EventHandler(this.BTN_GOLD_Click);
-                       // 
-                       // BTN_PEWTER
-                       // 
-                       this.BTN_PEWTER.Location = new System.Drawing.Point(16, 168);
-                       this.BTN_PEWTER.Name = "BTN_PEWTER";
-                       this.BTN_PEWTER.Size = new System.Drawing.Size(80, 24);
-                       this.BTN_PEWTER.TabIndex = 5;
-                       this.BTN_PEWTER.Text = "Pewter";
-                       this.BTN_PEWTER.Click += new System.EventHandler(this.BTN_PEWTER_Click);
-                       // 
-                       // BTN_PLASTIC
-                       // 
-                       this.BTN_PLASTIC.Location = new System.Drawing.Point(16, 200);
-                       this.BTN_PLASTIC.Name = "BTN_PLASTIC";
-                       this.BTN_PLASTIC.Size = new System.Drawing.Size(80, 24);
-                       this.BTN_PLASTIC.TabIndex = 6;
-                       this.BTN_PLASTIC.Text = "Plastic";
-                       this.BTN_PLASTIC.Click += new System.EventHandler(this.BTN_PLASTIC_Click);
-                       // 
-                       // BTN_SILVER
-                       // 
-                       this.BTN_SILVER.Location = new System.Drawing.Point(16, 232);
-                       this.BTN_SILVER.Name = "BTN_SILVER";
-                       this.BTN_SILVER.Size = new System.Drawing.Size(80, 24);
-                       this.BTN_SILVER.TabIndex = 7;
-                       this.BTN_SILVER.Text = "Silver";
-                       this.BTN_SILVER.Click += new System.EventHandler(this.BTN_SILVER_Click);
-                       // 
-                       // MaterialDialog
-                       // 
-                       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-                       this.ClientSize = new System.Drawing.Size(112, 273);
-                       this.Controls.Add(this.BTN_SILVER);
-                       this.Controls.Add(this.BTN_PLASTIC);
-                       this.Controls.Add(this.BTN_PEWTER);
-                       this.Controls.Add(this.BTN_GOLD);
-                       this.Controls.Add(this.BTN_COPPER);
-                       this.Controls.Add(this.BTN_BRONZE);
-                       this.Controls.Add(this.BTN_BRASS);
-                       this.Controls.Add(this.BTN_PLASTER);
-                       this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-                       this.MaximizeBox = false;
-                       this.MinimizeBox = false;
-                       this.Name = "MaterialDialog";
-                       this.Text = "MaterialDialog";
-                       this.ResumeLayout(false);
-
-               }
-               #endregion
-
-               private System.Windows.Forms.Button BTN_PLASTER;
-               private System.Windows.Forms.Button BTN_BRASS;
-               private System.Windows.Forms.Button BTN_BRONZE;
-               private System.Windows.Forms.Button BTN_COPPER;
-               private System.Windows.Forms.Button BTN_GOLD;
-               private System.Windows.Forms.Button BTN_PEWTER;
-               private System.Windows.Forms.Button BTN_PLASTIC;
-               private System.Windows.Forms.Button BTN_SILVER;
-
-               private int myMaterial;
-               private shell myView;
-
-               private void button1_Click(object sender, System.EventArgs e)
-               {
-                       this.myMaterial=5;
-                       ChangeMaterial();
-               }
-
-               private void BTN_BRASS_Click(object sender, System.EventArgs e)
-               {
-                       this.myMaterial=0;
-                       ChangeMaterial();
-               }
-
-               private void BTN_BRONZE_Click(object sender, System.EventArgs e)
-               {
-                       this.myMaterial=1;
-                       ChangeMaterial();
-               }
-
-               private void BTN_COPPER_Click(object sender, System.EventArgs e)
-               {
-                       this.myMaterial=2;
-                       ChangeMaterial();
-               }
-
-               private void BTN_GOLD_Click(object sender, System.EventArgs e)
-               {
-                       this.myMaterial=3;
-                       ChangeMaterial();
-               }
-
-               private void BTN_PEWTER_Click(object sender, System.EventArgs e)
-               {
-                       this.myMaterial=4;
-                       ChangeMaterial();
-               }
-
-               private void BTN_PLASTIC_Click(object sender, System.EventArgs e)
-               {
-                       this.myMaterial=6;
-                       ChangeMaterial();
-               }
-
-               private void BTN_SILVER_Click(object sender, System.EventArgs e)
-               {
-                       this.myMaterial=7;
-                       ChangeMaterial();
-               }
-
-               public int Material
-               {
-                       get
-                       {
-                               return this.myMaterial;
-                       }
-                       set
-                       {
-                               this.myMaterial=value;
-                       }
-               }
-
-               public void ChangeMaterial()
-               {
-                       if (myView==null)
-                               return;
-                       myView.SetMaterial(this.myMaterial);
-                       
-               }
-
-               public shell View
-               {
-                       set
-                       {
-                               this.myView=value;
-                       }
-               }
-               
-       }
-}
diff --git a/samples/CSharp/IE/TransparencyDialog.cs b/samples/CSharp/IE/TransparencyDialog.cs
deleted file mode 100755 (executable)
index 013cf7a..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace IE
-{
-       /// <summary>
-       /// Summary description for TransparencyDialog.
-       /// </summary>
-       public class TransparencyDialog : System.Windows.Forms.Form
-       {
-               private System.Windows.Forms.NumericUpDown MyTransparency;
-               /// <summary>
-               /// Required designer variable.
-               /// </summary>
-               private System.ComponentModel.Container components = null;
-               private shell myView;
-
-               public TransparencyDialog()
-               {
-                       //
-                       // Required for Windows Form Designer support
-                       //
-                       InitializeComponent();
-
-                       //
-                       // TODO: Add any constructor code after InitializeComponent call
-                       //
-                       myView=null;
-               }
-
-               /// <summary>
-               /// Clean up any resources being used.
-               /// </summary>
-               protected override void Dispose( bool disposing )
-               {
-                       if( disposing )
-                       {
-                               if(components != null)
-                               {
-                                       components.Dispose();
-                               }
-                       }
-                       base.Dispose( disposing );
-               }
-
-               #region Windows Form Designer generated code
-               /// <summary>
-               /// Required method for Designer support - do not modify
-               /// the contents of this method with the code editor.
-               /// </summary>
-               private void InitializeComponent()
-               {
-                       System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog));
-                       this.MyTransparency = new System.Windows.Forms.NumericUpDown();
-                       ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit();
-                       this.SuspendLayout();
-                       // 
-                       // MyTransparency
-                       // 
-                       this.MyTransparency.Location = new System.Drawing.Point(16, 16);
-                       this.MyTransparency.Maximum = new System.Decimal(new int[] {
-                                                                                                                                                  10,
-                                                                                                                                                  0,
-                                                                                                                                                  0,
-                                                                                                                                                  0});
-                       this.MyTransparency.Name = "MyTransparency";
-                       this.MyTransparency.Size = new System.Drawing.Size(96, 20);
-                       this.MyTransparency.TabIndex = 0;
-                       this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged);
-                       // 
-                       // TransparencyDialog
-                       // 
-                       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-                       this.ClientSize = new System.Drawing.Size(128, 53);
-                       this.Controls.Add(this.MyTransparency);
-                       this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
-                       this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-                       this.MaximizeBox = false;
-                       this.MinimizeBox = false;
-                       this.Name = "TransparencyDialog";
-                       this.Text = "TransparencyDialog";
-                       ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit();
-                       this.ResumeLayout(false);
-
-               }
-               #endregion
-
-               private void MyTransparency_ValueChanged(object sender, System.EventArgs e)
-               {
-                       if (this.myView==null)
-                               return;
-                       int transp = (int)this.MyTransparency.Value;
-                       this.myView.SetTransparency(transp);
-               }
-
-               public shell View
-               {
-                       set
-                       {
-                               this.myView=value;
-                       }
-               }
-
-       }
-}
diff --git a/samples/CSharp/IE/app.config b/samples/CSharp/IE/app.config
deleted file mode 100755 (executable)
index 61eb0bc..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-       <appSettings>
-               <!--   User application and configured property settings go here.-->
-               <!--   Example: <add key="settingName" value="settingValue"/> -->
-               <add key="New.Visible" value="True" />
-               <add key="About.Visible" value="True" />
-               <add key="delete.Enabled" value="False" />
-               <add key="delete.Visible" value="False" />
-               <add key="transparency.Enabled" value="False" />
-               <add key="transparency.Visible" value="False" />
-               <add key="marerial.Enabled" value="False" />
-               <add key="marerial.Visible" value="True" />
-               <add key="color.Enabled" value="False" />
-               <add key="color.Visible" value="False" />
-               <add key="shading.Enabled" value="False" />
-               <add key="shading.Pushed" value="False" />
-               <add key="shading.Visible" value="False" />
-               <add key="wireframe.Enabled" value="False" />
-               <add key="wireframe.Pushed" value="False" />
-               <add key="wireframe.Visible" value="False" />
-               <add key="material.Enabled" value="False" />
-               <add key="material.Visible" value="False" />
-       </appSettings>
-</configuration>
\ No newline at end of file
diff --git a/samples/CSharp/IE/res/document.ico b/samples/CSharp/IE/res/document.ico
deleted file mode 100755 (executable)
index 2a1f1ae..0000000
Binary files a/samples/CSharp/IE/res/document.ico and /dev/null differ
diff --git a/samples/CSharp/OCC/OCC.cpp b/samples/CSharp/OCC/OCC.cpp
deleted file mode 100755 (executable)
index 1dd0862..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// OCC.cpp : Defines the entry point for the DLL application.
-//
-//__declspec(dllexport)
-
-#include "stdafx.h"
-#include "OCCViewer.h"
-#pragma unmanaged
-BOOL APIENTRY DllMain( HANDLE hModule, 
-                       DWORD  ul_reason_for_call, 
-                       LPVOID lpReserved
-                                        )
-{
-       return TRUE;
-}
-
diff --git a/samples/CSharp/OCC/OCC.vcproj b/samples/CSharp/OCC/OCC.vcproj
deleted file mode 100755 (executable)
index abc8c2c..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="windows-1251"?>
-<VisualStudioProject
-       ProjectType="Visual C++"
-       Version="9.00"
-       Name="OCC"
-       ProjectGUID="{DCB139CF-2190-412E-B72F-8B080CC01422}"
-       Keyword="Win32Proj"
-       TargetFrameworkVersion="131072"
-       >
-       <Platforms>
-               <Platform
-                       Name="Win32"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Win32"
-                       OutputDirectory="Debug"
-                       IntermediateDirectory="Debug"
-                       ConfigurationType="2"
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
-                       CharacterSet="2"
-                       ManagedExtensions="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="0"
-                               AdditionalIncludeDirectories="$(CSF_OPT_INC)"
-                               PreprocessorDefinitions="WNT"
-                               MinimalRebuild="false"
-                               BasicRuntimeChecks="0"
-                               RuntimeLibrary="3"
-                               UsePrecompiledHeader="2"
-                               WarningLevel="3"
-                               Detect64BitPortabilityProblems="true"
-                               DebugInformationFormat="3"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="TKV3d.lib TKHLR.lib TKService.lib TKBool.lib TKPShape.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKG2d.lib TKG3d.lib PTKernel.lib TKShapeSchema.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib"
-                               OutputFile="$(OutDir)/OCC.dll"
-                               LinkIncremental="2"
-                               AdditionalLibraryDirectories="$(CSF_OPT_LIB32D)"
-                               GenerateDebugInformation="true"
-                               AssemblyDebug="1"
-                               ProgramDatabaseFile="$(OutDir)/OCC.pdb"
-                               SubSystem="2"
-                               ResourceOnlyDLL="false"
-                               RandomizedBaseAddress="1"
-                               DataExecutionPrevention="0"
-                               ImportLibrary="$(OutDir)/OCC.lib"
-                               TargetMachine="1"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Win32"
-                       OutputDirectory="Release"
-                       IntermediateDirectory="Release"
-                       ConfigurationType="2"
-                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
-                       CharacterSet="2"
-                       ManagedExtensions="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               AdditionalIncludeDirectories="$(CSF_OPT_INC)"
-                               PreprocessorDefinitions="WNT"
-                               RuntimeLibrary="2"
-                               UsePrecompiledHeader="2"
-                               WarningLevel="3"
-                               Detect64BitPortabilityProblems="true"
-                               DebugInformationFormat="3"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="TKV3d.lib TKHLR.lib TKService.lib TKBool.lib TKPShape.lib TKMath.lib TKBO.lib TKernel.lib TKPrim.lib TKTopAlgo.lib TKBRep.lib TKGeomAlgo.lib TKG2d.lib TKG3d.lib PTKernel.lib TKShapeSchema.lib TKXSBase.lib TKIGES.lib TKSTEP.lib TKSTEP209.lib TKSTEPAttr.lib TKSTEPBase.lib TKShHealing.lib TKSTL.lib TKVRML.lib"
-                               OutputFile="$(OutDir)/OCC.dll"
-                               LinkIncremental="1"
-                               AdditionalLibraryDirectories="$(CSF_OPT_LIB32)"
-                               GenerateDebugInformation="true"
-                               SubSystem="2"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               RandomizedBaseAddress="1"
-                               DataExecutionPrevention="0"
-                               ImportLibrary="$(OutDir)/OCC.lib"
-                               TargetMachine="1"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="Source Files"
-                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
-                       >
-                       <File
-                               RelativePath=".\OCC.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\OCCViewer.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\stdafx.cpp"
-                               >
-                               <FileConfiguration
-                                       Name="Debug|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               UsePrecompiledHeader="1"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration
-                                       Name="Release|Win32"
-                                       >
-                                       <Tool
-                                               Name="VCCLCompilerTool"
-                                               UsePrecompiledHeader="1"
-                                       />
-                               </FileConfiguration>
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Header Files"
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-                       >
-                       <File
-                               RelativePath=".\OCCViewer.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\stdafx.h"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="Resource Files"
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
-                       >
-               </Filter>
-               <File
-                       RelativePath=".\ReadMe.txt"
-                       >
-               </File>
-       </Files>
-       <Globals>
-       </Globals>
-</VisualStudioProject>
diff --git a/samples/CSharp/OCC/OCCViewer.cpp b/samples/CSharp/OCC/OCCViewer.cpp
deleted file mode 100755 (executable)
index 214695c..0000000
+++ /dev/null
@@ -1,581 +0,0 @@
-#include "StdAfx.h"
-#include ".\occviewer.h"
-
-#pragma warning( disable : 4800 )
-OCCViewer::OCCViewer(void)
-{
-       myGraphicDriver=NULL;
-       myViewer=NULL;
-       myView=NULL;
-       myAISContext=NULL;
-}
-
-OCCViewer::~OCCViewer(void)
-{
-       myView->Remove();
-}
-
-bool OCCViewer::InitViewer(void* wnd)
-{
-  try
-  {
-    Handle(Aspect_DisplayConnection) aDisplayConnection;
-    myGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
-  }
-  catch (Standard_Failure)
-  {
-    return false;
-  }
-
-  TCollection_ExtendedString a3DName("Visu3D");
-  myViewer = new V3d_Viewer (myGraphicDriver, a3DName.ToExtString(),"", 1000.0, 
-                             V3d_XposYnegZpos, Quantity_NOC_GRAY30,
-                             V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT, 
-                             Standard_True, Standard_False);
-
-       myViewer->Init();
-       myViewer->SetDefaultLights();
-       myViewer->SetLightOn();
-       myView = myViewer->CreateView();
-       Handle(WNT_Window) aWNTWindow = new WNT_Window (reinterpret_cast<HWND> (wnd));
-       myView->SetWindow(aWNTWindow);
-       if (!aWNTWindow->IsMapped()) 
-                aWNTWindow->Map();
-       myAISContext = new AIS_InteractiveContext(myViewer);
-       myAISContext->UpdateCurrentViewer();
-       myView->Redraw();
-       myView->MustBeResized();
-       return true;
-
-}
-
-bool OCCViewer::ImportBRep(char* filename)
-{
-       Standard_CString aFileName = (Standard_CString) filename;
-       TopoDS_Shape aShape;
-    BRep_Builder aBuilder;
-    Standard_Boolean result = BRepTools::Read(aShape,aFileName,aBuilder);
-       if (!result)
-               return false;
-       if(myAISContext->HasOpenedContext())
-               myAISContext->CloseLocalContext();
-       myAISContext->Display(new AIS_Shape(aShape));
-       return true;
-}
-
-void OCCViewer::UpdateView(void)
-{
-       if (!myView.IsNull())
-               myView->MustBeResized();
-}
-
-void OCCViewer::RedrawView(void)
-{
-       if (!myView.IsNull())
-               myView->Redraw();
-}
-
-void OCCViewer::SetDegenerateModeOn(void)
-{
-       if (!myView.IsNull())
-               myView->SetComputedMode (Standard_False);
-}
-
-void OCCViewer::SetDegenerateModeOff(void)
-{
-       if (!myView.IsNull())
-               myView->SetComputedMode (Standard_True);
-}
-
-void OCCViewer::WindowFitAll(int Xmin, int Ymin, int Xmax, int Ymax)
-{
-       if (!myView.IsNull())
-               myView->WindowFitAll(Xmin, Ymin, Xmax, Ymax);
-}
-
-void OCCViewer::Place(int x, int y, float zoomFactor)
-{
-       Quantity_Factor aZoomFactor = zoomFactor;
-       if (!myView.IsNull())
-               myView->Place(x, y, aZoomFactor);
-}
-
-void OCCViewer::Zoom(int x1, int y1, int x2, int y2)
-{
-       if (!myView.IsNull())
-               myView->Zoom(x1, y1, x2, y2);
-}
-
-void OCCViewer::Pan(int x, int y)
-{
-       if (!myView.IsNull())
-               myView->Pan(x, y);
-}
-
-void OCCViewer::Rotation(int x, int y)
-{
-       if (!myView.IsNull())
-               myView->Rotation(x, y);
-}
-
-void OCCViewer::StartRotation(int x, int y)
-{
-       if (!myView.IsNull())
-               myView->StartRotation(x, y);
-}
-
-void OCCViewer::Select(int x1, int y1, int x2, int y2)
-{
-       if (!myAISContext.IsNull())
-               myAISContext->Select(x1, y1, x2, y2, myView);
-}
-
-void OCCViewer::Select(void)
-{
-       if (!myAISContext.IsNull())
-               myAISContext->Select();
-}
-
-void OCCViewer::MoveTo(int x, int y)
-{
-       if ((!myAISContext.IsNull()) && (!myView.IsNull()))
-               myAISContext->MoveTo(x, y, myView);
-}
-
-void OCCViewer::ShiftSelect(int x1, int y1, int x2, int y2)
-{
-       if ((!myAISContext.IsNull()) && (!myView.IsNull()))
-               myAISContext->ShiftSelect(x1, y1, x2, y2, myView);
-}
-
-void OCCViewer::ShiftSelect(void)
-{
-       if (!myAISContext.IsNull())
-               myAISContext->ShiftSelect();
-}
-
-void OCCViewer::BackgroundColor(int& r, int& g, int& b)
-{
-       Standard_Real R1;
-       Standard_Real G1;
-       Standard_Real B1;
-       if (!myView.IsNull())
-               myView->BackgroundColor(Quantity_TOC_RGB,R1,G1,B1);
-       r = (int)R1*255;
-       g = (int)G1*255;
-       b = (int)B1*255;
-}
-
-
-
-void OCCViewer::UpdateCurrentViewer(void)
-{
-       if (!myAISContext.IsNull())
-               myAISContext->UpdateCurrentViewer();
-}
-
-void OCCViewer::FrontView(void)
-{
-       if (!myView.IsNull())
-               myView->SetProj(V3d_Xpos); 
-}
-
-void OCCViewer::TopView(void)
-{
-       if (!myView.IsNull())
-               myView->SetProj(V3d_Zpos); 
-}
-
-void OCCViewer::LeftView(void)
-{
-       if (!myView.IsNull())
-               myView->SetProj(V3d_Ypos);
-}
-
-void OCCViewer::BackView(void)
-{
-       if (!myView.IsNull())
-               myView->SetProj(V3d_Xneg);
-}
-
-void OCCViewer::RightView(void)
-{
-       if (!myView.IsNull())
-               myView->SetProj(V3d_Yneg);
-}
-
-void OCCViewer::BottomView(void)
-{
-       if (!myView.IsNull())
-               myView->SetProj(V3d_Zneg); 
-}
-
-void OCCViewer::AxoView(void)
-{
-       if (!myView.IsNull())
-               myView->SetProj(V3d_XposYnegZpos);
-}
-
-void OCCViewer::ZoomAllView(void)
-{
-       if (!myView.IsNull())
-       {
-               myView->FitAll();
-               myView->ZFitAll();
-       }
-}
-
-float OCCViewer::Scale(void)
-{
-       if (myView.IsNull())
-               return -1;
-       else
-               return (float)myView->Scale();
-}
-
-void OCCViewer::ResetView(void)
-{
-       if (!myView.IsNull())
-               myView->Reset();
-}
-
-void OCCViewer::SetDisplayMode(int aMode)
-{
-       if (myAISContext.IsNull())
-               return;
-       AIS_DisplayMode CurrentMode;
-       if (aMode == 0) 
-               CurrentMode=AIS_WireFrame;
-       else
-               CurrentMode=AIS_Shaded;
-    if(myAISContext->NbCurrents()==0 || myAISContext->NbSelected()==0)
-       myAISContext->SetDisplayMode(CurrentMode);
-    else 
-       {
-       for(myAISContext->InitCurrent();myAISContext->MoreCurrent();myAISContext->NextCurrent())
-                  myAISContext->SetDisplayMode(myAISContext->Current(),aMode,Standard_False);
-                
-       }
-        myAISContext->UpdateCurrentViewer();
-}
-
-void OCCViewer::SetColor(int r, int g, int b)
-{
-       if (myAISContext.IsNull())
-               return;
-       Quantity_Color col =  Quantity_Color(r/255.,g/255.,b/255.,Quantity_TOC_RGB);
-       for (;myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
-                 myAISContext->SetColor (myAISContext->Current(),col.Name());
-}
-
-void OCCViewer::ObjectColor(int& r, int& g, int& b)
-{
-       if (myAISContext.IsNull())
-               return;
-       r=255;
-       g=255;
-       b=255;
-       Handle_AIS_InteractiveObject Current ;
-       Quantity_Color ObjCol;
-       myAISContext->InitCurrent();
-       if (!myAISContext->MoreCurrent())
-               return;
-    Current = myAISContext->Current();
-       if ( Current->HasColor () ) {
-      ObjCol = myAISContext->Color(myAISContext->Current());
-         Quantity_Parameter r1, r2, r3;
-         ObjCol.Values(r1, r2, r3, Quantity_TOC_RGB);
-               r=(int)r1*255;
-               g=(int)r2*255;
-               b=(int)r3*255;
-       }
-}
-
-void OCCViewer::SetBackgroundColor(int r, int g, int b)
-{
-       if (!myView.IsNull())
-               myView->SetBackgroundColor(Quantity_TOC_RGB,r/255.,g/255.,b/255.);
-}
-
-void OCCViewer::EraseObjects(void)
-{
-       if (myAISContext.IsNull())
-               return;
-       for(myAISContext->InitCurrent();myAISContext->MoreCurrent();myAISContext->NextCurrent())
-        myAISContext->Erase(myAISContext->Current(),Standard_True);
-       myAISContext->ClearCurrents();
-}
-
-float OCCViewer::GetVersion(void)
-{
-       return (float)OCC_VERSION;
-}
-
-void OCCViewer::SetMaterial(int theMaterial)
-{
-       if (myAISContext.IsNull())
-               return;
-    for ( myAISContext->InitCurrent(); myAISContext->MoreCurrent (); myAISContext->NextCurrent () )
-        myAISContext->SetMaterial( myAISContext->Current(), (Graphic3d_NameOfMaterial)theMaterial );
-       myAISContext->UpdateCurrentViewer();
-}
-
-void OCCViewer::SetTransparency(int theTrans)
-{
-       if (myAISContext.IsNull())
-               return;
-       for( myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextSelected() )
-               myAISContext->SetTransparency( myAISContext->Current(), ((Standard_Real)theTrans) / 10.0 );
-}
-
-bool OCCViewer::ImportCsfdb(char* filename)
-{
-       Standard_CString aFileName = (Standard_CString) filename;
-    if ( FSD_File::IsGoodFileType(aFileName) != Storage_VSOk )
-           return false;
-
-    static FSD_File fileDriver;
-    TCollection_AsciiString aName( aFileName );
-    if ( fileDriver.Open( aName, Storage_VSRead ) != Storage_VSOk )
-        return false;
-
-    Handle(ShapeSchema) schema = new ShapeSchema();
-    Handle(Storage_Data) data  = schema->Read( fileDriver );
-    if ( data->ErrorStatus() != Storage_VSOk )
-        return false;
-    fileDriver.Close();
-
-    Handle(Storage_HSeqOfRoot) roots = data->Roots();
-    for ( int i = 1; i <= roots->Length() ; i++ )
-    {
-        Handle(Storage_Root) r = roots->Value( i );
-        Handle(Standard_Persistent) p = r->Object();
-        Handle(PTopoDS_HShape) aPShape = Handle(PTopoDS_HShape)::DownCast(p);
-        if ( !aPShape.IsNull() )
-        {
-               PTColStd_PersistentTransientMap aMap;
-               TopoDS_Shape aTShape;
-            MgtBRep::Translate( aPShape, aMap, aTShape, MgtBRep_WithTriangle );
-                       myAISContext->Display(new AIS_Shape(aTShape));
-        }
-    }
-
-       return true;
-}
-
-bool OCCViewer::ImportIges(char* filename)
-{
-       Standard_CString aFileName = (Standard_CString) filename;
-    IGESControl_Reader Reader;
-    int status = Reader.ReadFile( aFileName );
-
-    if ( status == IFSelect_RetDone )
-    {
-        Reader.TransferRoots();
-        TopoDS_Shape aShape = Reader.OneShape();
-        myAISContext->Display(new AIS_Shape(aShape));
-    } else
-               return false;
-       myAISContext->UpdateCurrentViewer();
-       return true;
-}
-
-bool OCCViewer::ImportStep(char* filename)
-{
-       Standard_CString aFileName = (Standard_CString) filename;
-       STEPControl_Reader aReader;
-       IFSelect_ReturnStatus status = aReader.ReadFile(aFileName);
-       if ( status == IFSelect_RetDone )
-    {
-           bool failsonly = false;
-           aReader.PrintCheckLoad( failsonly, IFSelect_ItemsByEntity );
-
-           int nbr = aReader.NbRootsForTransfer();
-           aReader.PrintCheckTransfer( failsonly, IFSelect_ItemsByEntity );
-           for ( Standard_Integer n = 1; n <= nbr; n++ )
-           {
-               Standard_Boolean ok = aReader.TransferRoot( n );
-               int nbs = aReader.NbShapes();
-               if ( nbs > 0 )
-            {
-                   for ( int i = 1; i <= nbs; i++ )
-                {
-                           TopoDS_Shape shape = aReader.Shape( i );
-                           myAISContext->Display(new AIS_Shape(shape));
-                   }
-            }
-        }
-       } else
-               return false;
-       return true;
-}
-
-bool OCCViewer::ExportBRep(char* filename)
-{
-       myAISContext->InitCurrent();
-       if (!myAISContext->MoreCurrent())
-               return false;
-       Handle_AIS_InteractiveObject anIO = myAISContext->Current();
-       Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
-       return (bool)BRepTools::Write( anIS->Shape(), (Standard_CString)filename ); ;
-}
-
-
-bool OCCViewer::ExportIges(char* filename)
-{
-       IGESControl_Controller::Init();
-       IGESControl_Writer writer( Interface_Static::CVal( "XSTEP.iges.unit" ),
-                               Interface_Static::IVal( "XSTEP.iges.writebrep.mode" ) );
-       
-       for ( myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent() )
-       {
-               Handle_AIS_InteractiveObject anIO = myAISContext->Current();
-               Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
-               TopoDS_Shape shape = anIS->Shape();
-               writer.AddShape ( shape );
-       }
-       writer.ComputeModel();
-       return (bool)writer.Write( (Standard_CString)filename );
-}
-
-bool OCCViewer::ExpotStep(char* filename)
-{
-    STEPControl_StepModelType type = STEPControl_AsIs;
-    IFSelect_ReturnStatus status;
-    STEPControl_Writer writer;
-       for ( myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent() )
-    {
-               Handle_AIS_InteractiveObject anIO = myAISContext->Current();
-               Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
-               TopoDS_Shape shape = anIS->Shape();
-               status = writer.Transfer( shape , type );
-        if ( status != IFSelect_RetDone )
-            return false;
-    }
-
-    status = writer.Write( (Standard_CString)filename );
-    if ( status != IFSelect_RetDone )
-            return false;
-       return true;
-}
-
-bool OCCViewer::ExportStl(char* filename)
-{
-       TopoDS_Compound comp;
-       BRep_Builder builder;
-       builder.MakeCompound( comp );
-
-       for ( myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent() )
-       {
-               Handle_AIS_InteractiveObject anIO = myAISContext->Current();
-               Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
-               TopoDS_Shape shape = anIS->Shape();
-               if ( shape.IsNull() ) 
-                       return false;    
-               builder.Add( comp, shape );
-       }
-
-       StlAPI_Writer writer;
-       writer.Write( comp, (Standard_CString)filename );
-       return true;
-}
-
-bool OCCViewer::ExportVrml(char* filename)
-{
-       TopoDS_Compound res;
-       BRep_Builder builder;
-       builder.MakeCompound( res );
-
-       for ( myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent() )
-       {
-               Handle_AIS_InteractiveObject anIO = myAISContext->Current();
-               Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
-               TopoDS_Shape shape = anIS->Shape();
-               if ( shape.IsNull() )
-                       return false;
-        
-               builder.Add( res, shape );
-       }
-
-       VrmlAPI_Writer writer;
-       writer.Write( res, (Standard_CString)filename );
-
-       return true;
-}
-
-bool OCCViewer::Dump(char *filename)
-{
-       if (myView.IsNull())
-               return false;
-       myView->Redraw();
-    return (bool)myView->Dump(filename);
-}
-
-bool OCCViewer::IsObjectSelected(void)
-{
-       if (myAISContext.IsNull())
-               return false;
-       myAISContext->InitCurrent();
-       return (bool)myAISContext->MoreCurrent();
-}
-
-int OCCViewer::DisplayMode(void)
-{
-       if (myAISContext.IsNull())
-               return -1;
-       int mode = -1;
-       bool OneOrMoreInShading=false;
-       bool OneOrMoreInWireframe=false;
-       for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
-       {
-               if ( myAISContext->IsDisplayed( myAISContext->Current(), 1 ) )
-             OneOrMoreInShading = true;
-        if ( myAISContext->IsDisplayed( myAISContext->Current(), 0 ) )
-             OneOrMoreInWireframe = true;
-       }
-       if (OneOrMoreInShading&&OneOrMoreInWireframe)
-               mode=10;
-       else if(OneOrMoreInShading)
-               mode=1;
-       else if (OneOrMoreInWireframe)
-               mode=0;
-       return mode;
-}
-
-void OCCViewer::CreateNewView(void* wnd)
-{
-       if (myAISContext.IsNull())
-               return;
-       myView = myAISContext->CurrentViewer()->CreateView();
-       if (myGraphicDriver.IsNull())
-    {
-      Handle(Aspect_DisplayConnection) aDisplayConnection;
-      myGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
-    }
-       Handle(WNT_Window) aWNTWindow = new WNT_Window (reinterpret_cast<HWND> (wnd));
-       myView->SetWindow(aWNTWindow);
-       Standard_Integer w=100, h=100;
-       aWNTWindow->Size(w,h);
-       if (!aWNTWindow->IsMapped()) 
-                aWNTWindow->Map();
-}
-
-bool OCCViewer::SetAISContext(OCCViewer* Viewer)
-{
-       this->myAISContext=Viewer->GetAISContext();
-       if (myAISContext.IsNull())
-               return false;
-       return true;
-}
-
-Handle_AIS_InteractiveContext OCCViewer::GetAISContext(void)
-{
-       return myAISContext;
-}
-
-int OCCViewer::CharToInt(char symbol)
-{
-       TCollection_AsciiString msg = symbol;
-       return msg.IntegerValue();
-}
diff --git a/samples/CSharp/OCC/OCCViewer.h b/samples/CSharp/OCC/OCCViewer.h
deleted file mode 100755 (executable)
index 6f0c118..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#pragma once
-#include "stdafx.h"
-
-
-class OCCViewer
-{
-public:
-       __declspec(dllexport) OCCViewer(void);
-       __declspec(dllexport) ~OCCViewer(void);
-private:
-       Handle_V3d_Viewer myViewer;
-       Handle_V3d_View myView;
-       Handle_AIS_InteractiveContext myAISContext;
-       Handle_Graphic3d_GraphicDriver myGraphicDriver;
-public:
-       __declspec(dllexport) bool InitViewer(void* wnd);
-       __declspec(dllexport) bool ImportBRep(char* filename);
-       __declspec(dllexport) void UpdateView(void);
-       __declspec(dllexport) void RedrawView(void);
-       __declspec(dllexport) void SetDegenerateModeOn(void);
-       __declspec(dllexport) void SetDegenerateModeOff(void);
-       __declspec(dllexport) void WindowFitAll(int Xmin, int Ymin, int Xmax, int Ymax);
-       __declspec(dllexport) void Place(int x, int y, float zoomFactor);
-       __declspec(dllexport) void Zoom(int x1, int y1, int x2, int y2);
-       __declspec(dllexport) void Pan(int x, int y);
-       __declspec(dllexport) void Rotation(int x, int y);
-       __declspec(dllexport) void StartRotation(int x, int y);
-       __declspec(dllexport) void Select(int x1, int y1, int x2, int y2);
-       __declspec(dllexport) void Select(void);
-       __declspec(dllexport) void MoveTo(int x, int y);
-       __declspec(dllexport) void ShiftSelect(int x1, int y1, int x2, int y2);
-       __declspec(dllexport) void ShiftSelect(void);
-       __declspec(dllexport) void BackgroundColor(int& r, int& g, int& b);
-       __declspec(dllexport) void UpdateCurrentViewer(void);
-       __declspec(dllexport) void FrontView(void);
-       __declspec(dllexport) void TopView(void);
-       __declspec(dllexport) void LeftView(void);
-       __declspec(dllexport) void BackView(void);
-       __declspec(dllexport) void RightView(void);
-       __declspec(dllexport) void BottomView(void);
-       __declspec(dllexport) void AxoView(void);
-       __declspec(dllexport) void ZoomAllView(void);
-       __declspec(dllexport) float Scale(void);
-       __declspec(dllexport) void PanGloView(void);
-       __declspec(dllexport) void ResetView(void);
-       __declspec(dllexport) void SetDisplayMode(int aMode);
-       __declspec(dllexport) void SetColor(int r, int g, int b);
-       __declspec(dllexport) void ObjectColor(int& r, int& g, int& b);
-       __declspec(dllexport) void SetBackgroundColor(int r, int g, int b);
-       __declspec(dllexport) void EraseObjects(void);
-       __declspec(dllexport) float GetVersion(void);
-       __declspec(dllexport) void SetMaterial(int theMaterial);
-       __declspec(dllexport) void SetTransparency(int theTrans);
-       __declspec(dllexport) bool ImportCsfdb(char* filename);
-       __declspec(dllexport) bool ImportIges(char* filename);
-       __declspec(dllexport) bool ImportStep(char* filename);
-       __declspec(dllexport) bool ExportBRep(char* filename);
-       __declspec(dllexport) bool ExportIges(char* filename);
-       __declspec(dllexport) bool ExpotStep(char* filename);
-       __declspec(dllexport) bool ExportStl(char* filename);
-       __declspec(dllexport) bool ExportVrml(char* filename);
-       __declspec(dllexport) bool Dump(char* filename);
-       __declspec(dllexport) bool IsObjectSelected(void);
-       __declspec(dllexport) int DisplayMode(void);
-       __declspec(dllexport) void CreateNewView(void* wnd);
-       __declspec(dllexport) bool SetAISContext(OCCViewer* Viewer);
-       Handle_AIS_InteractiveContext GetAISContext(void);
-       __declspec(dllexport) int CharToInt(char symbol);
-};
diff --git a/samples/CSharp/OCC/ReadMe.txt b/samples/CSharp/OCC/ReadMe.txt
deleted file mode 100755 (executable)
index 1542dff..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-========================================================================
-    DYNAMIC LINK LIBRARY : OCC Project Overview
-========================================================================
-
-AppWizard has created this OCC DLL for you.  
-This file contains a summary of what you will find in each of the files that
-make up your OCC application.
-
-
-OCC.vcproj
-    This is the main project file for VC++ projects generated using an Application Wizard. 
-    It contains information about the version of Visual C++ that generated the file, and 
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-OCC.cpp
-    This is the main DLL source file.
-
-       When created, this DLL does not export any symbols. As a result, it  
-       will not produce a .lib file when it is built. If you wish this project 
-       to be a project dependency of some other project, you will either need to 
-       add code to export some symbols from the DLL so that an export library 
-       will be produced, or you can set the Ignore Input Library property to Yes 
-       on the General propert page of the Linker folder in the project's Property 
-       Pages dialog box.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named OCC.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/samples/CSharp/OCC/stdafx.cpp b/samples/CSharp/OCC/stdafx.cpp
deleted file mode 100755 (executable)
index de3c5dc..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// OCC.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
diff --git a/samples/CSharp/OCC/stdafx.h b/samples/CSharp/OCC/stdafx.h
deleted file mode 100755 (executable)
index fbb4173..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN            // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-//standard OCC types
-#pragma warning( disable : 4311 )
-#pragma warning( disable : 4312 )
-#pragma warning( disable : 4267 )
-#include <Standard_Boolean.hxx>
-#include <Standard_CString.hxx>
-#include <Standard_Version.hxx>
-#include <Standard_Persistent.hxx>
-//collections
-#include <TCollection_ExtendedString.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <PTColStd_PersistentTransientMap.hxx>
-#include <TCollection_AsciiString.hxx>
-//for OCC graphic
-#include <Aspect_DisplayConnection.hxx>
-#include <WNT_Window.hxx>
-#include <Quantity_NameOfColor.hxx>
-#include <Graphic3d.hxx>
-#include <Graphic3d_GraphicDriver.hxx>
-#include <Graphic3d_NameOfMaterial.hxx>
-//for object display
-#include <V3d_Viewer.hxx>
-#include <V3d_View.hxx>
-#include <AIS_InteractiveContext.hxx>
-#include <AIS_Shape.hxx>
-#include <AIS_Trihedron.hxx>
-#include <AIS_DisplayMode.hxx>
-#include <V3d_TypeOfOrientation.hxx>
-#include <V3d_TypeOfVisualization.hxx>
-#include <V3d_TypeOfShadingModel.hxx>
-#include <V3d_TypeOfUpdate.hxx>
-//topology
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Compound.hxx>
-//brep tools
-#include <BRep_Builder.hxx>
-#include <BRepTools.hxx>
-#include <MgtBRep.hxx>
-//geometry
-#include <gp_Ax2.hxx>
-#include <Geom_Axis2Placement.hxx>
-//csfdb I/E
-#include <Message_ProgressIndicator.hxx>
-#include <FSD_File.hxx>
-#include <ShapeSchema.hxx>
-#include <Storage_Data.hxx>
-#include <Storage_Error.hxx>
-#include <Storage_HSeqOfRoot.hxx>
-#include <Storage_Root.hxx>
-#include <PTopoDS_HShape.hxx>
-#include <PTColStd_TransientPersistentMap.hxx>
-// iges I/E
-#include <IGESControl_Reader.hxx>
-#include <IGESControl_Controller.hxx>
-#include <IGESControl_Writer.hxx>
-#include <IFSelect_ReturnStatus.hxx>
-#include <Interface_Static.hxx>
-//step I/E
-#include <STEPControl_Reader.hxx>
-#include <STEPControl_Writer.hxx>
-//for stl export
-#include <StlAPI_Writer.hxx>
-//for vrml export
-#include <VrmlAPI_Writer.hxx>
diff --git a/samples/CSharp/OCCTProxy/OCCTProxy.cpp b/samples/CSharp/OCCTProxy/OCCTProxy.cpp
new file mode 100644 (file)
index 0000000..595d91d
--- /dev/null
@@ -0,0 +1,1100 @@
+// include required OCCT headers
+#include <Standard_Version.hxx>
+#include <Message_ProgressIndicator.hxx>
+//for OCC graphic
+#include <Aspect_DisplayConnection.hxx>
+#include <WNT_Window.hxx>
+#include <Graphic3d.hxx>
+#include <Graphic3d_GraphicDRiver.hxx>
+//for object display
+#include <V3d_Viewer.hxx>
+#include <V3d_View.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <AIS_Shape.hxx>
+//topology
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Compound.hxx>
+//brep tools
+#include <BRep_Builder.hxx>
+#include <BRepTools.hxx>
+#include <MgtBRep.hxx>
+#include <PTColStd_PersistentTransientMap.hxx>
+//csfdb I/E
+#include <FSD_File.hxx>
+#include <ShapeSchema.hxx>
+#include <Storage_Data.hxx>
+#include <Storage_HSeqOfRoot.hxx>
+#include <Storage_Root.hxx>
+// iges I/E
+#include <IGESControl_Reader.hxx>
+#include <IGESControl_Controller.hxx>
+#include <IGESControl_Writer.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Interface_Static.hxx>
+//step I/E
+#include <STEPControl_Reader.hxx>
+#include <STEPControl_Writer.hxx>
+//for stl export
+#include <StlAPI_Writer.hxx>
+//for vrml export
+#include <VrmlAPI_Writer.hxx>
+//wrapper of pure C++ classes to ref classes
+#include <NCollection_Haft.h>
+
+// list of required OCCT libraries
+#pragma comment(lib, "TKernel.lib")
+#pragma comment(lib, "TKMath.lib")
+#pragma comment(lib, "TKBRep.lib")
+#pragma comment(lib, "PTKernel.lib")
+#pragma comment(lib, "TKPShape.lib")
+#pragma comment(lib, "TKShapeSchema.lib")
+#pragma comment(lib, "TKXSBase.lib")
+#pragma comment(lib, "TKService.lib")
+#pragma comment(lib, "TKV3d.lib")
+#pragma comment(lib, "TKIGES.lib")
+#pragma comment(lib, "TKSTEP.lib")
+#pragma comment(lib, "TKStl.lib")
+#pragma comment(lib, "TKVrml.lib")
+
+/// <summary>
+/// Proxy class encapsulating calls to OCCT C++ classes within 
+/// C++/CLI class visible from .Net (CSharp)
+/// </summary>
+public ref class OCCTProxy
+{
+public:
+  // ============================================
+  // Viewer functionality
+  // ============================================
+
+  /// <summary>
+  ///Initialize a viewer
+  /// </summary>
+  /// <param name="theWnd">System.IntPtr that contains the window handle (HWND) of the control</param>
+  bool InitViewer(System::IntPtr theWnd)
+  {
+    try
+    {
+      Handle(Aspect_DisplayConnection) aDisplayConnection;
+      myGraphicDriver() = Graphic3d::InitGraphicDriver (aDisplayConnection);
+    }
+    catch (Standard_Failure)
+    {
+      return false;
+    }
+
+    TCollection_ExtendedString a3DName("Visu3D");
+    myViewer() = new V3d_Viewer (myGraphicDriver(), a3DName.ToExtString(),"", 1000.0, 
+                                V3d_XposYnegZpos, Quantity_NOC_GRAY30,
+                                V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT, 
+                                Standard_True, Standard_False);
+
+    myViewer()->Init();
+    myViewer()->SetDefaultLights();
+    myViewer()->SetLightOn();
+    myView() = myViewer()->CreateView();
+    Handle(WNT_Window) aWNTWindow = new WNT_Window (reinterpret_cast<HWND> (theWnd.ToPointer()));
+    myView()->SetWindow(aWNTWindow);
+    if (!aWNTWindow->IsMapped())
+    {
+      aWNTWindow->Map();
+    }
+    myAISContext() = new AIS_InteractiveContext( myViewer() );
+    myAISContext()->UpdateCurrentViewer();
+    myView()->Redraw();
+    myView()->MustBeResized();
+    return true;
+  }
+
+  /// <summary>
+  /// Make dump of current view to file
+  /// </summary>
+  /// <param name="theFileName">Name of dump file</param>
+  bool Dump(char *theFileName)
+  {
+    if (myView().IsNull())
+    {
+      return false;
+    }
+    myView()->Redraw();
+    return myView()->Dump(theFileName) != Standard_False;
+  }
+
+  /// <summary>
+  ///Redraw view
+  /// </summary>
+  void RedrawView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Redraw();
+    }
+  }
+
+  /// <summary>
+  ///Update view
+  /// </summary>
+  void UpdateView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->MustBeResized();
+    }
+  }
+
+  /// <summary>
+  ///Set computed mode in false
+  /// </summary>
+  void SetDegenerateModeOn(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetComputedMode (Standard_False);
+    }
+  }
+
+  /// <summary>
+  ///Set computed mode in true
+  /// </summary>
+  void SetDegenerateModeOff(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetComputedMode (Standard_True);
+    }
+  }
+
+  /// <summary>
+  ///Fit all
+  /// </summary>
+  void WindowFitAll(int theXmin, int theYmin, int theXmax, int theYmax)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->WindowFitAll(theXmin, theYmin, theXmax, theYmax);
+    }
+  }
+
+  /// <summary>
+  ///Current place of window
+  /// </summary>
+  /// <param name="theZoomFactor">Current zoom</param>
+  void Place(int theX, int theY, float theZoomFactor)
+  {    
+    Quantity_Factor aZoomFactor = theZoomFactor;
+    if (!myView().IsNull())
+    {
+      myView()->Place(theX, theY, aZoomFactor);
+    }
+  }
+
+  /// <summary>
+  ///Set Zoom
+  /// </summary>
+  void Zoom(int theX1, int theY1, int theX2, int theY2)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Zoom(theX1, theY1, theX2, theY2);
+    }
+  }
+
+  /// <summary>
+  ///Set Pan
+  /// </summary>
+  void Pan(int theX, int theY)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Pan(theX, theY);
+    }
+  }
+
+  /// <summary>
+  ///Rotation
+  /// </summary>
+  void Rotation(int theX, int theY)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Rotation(theX, theY);
+    }
+  }
+
+  /// <summary>
+  ///Start rotation
+  /// </summary>
+  void StartRotation(int theX, int theY)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->StartRotation(theX, theY);
+    }
+  }
+
+  /// <summary>
+  ///Select by rectangle
+  /// </summary>
+  void Select(int theX1, int theY1, int theX2, int theY2)
+  {
+    if (!myAISContext().IsNull())
+    {
+      myAISContext()->Select(theX1, theY1, theX2, theY2, myView());
+    }
+  }
+
+  /// <summary>
+  ///Select by click
+  /// </summary>
+  void Select(void)
+  {
+    if (!myAISContext().IsNull())
+    {
+      myAISContext()->Select();
+    }
+  }
+
+  /// <summary>
+  ///Move view
+  /// </summary>
+  void MoveTo(int theX, int theY)
+  {
+    if ((!myAISContext().IsNull()) && (!myView().IsNull()))
+    {
+      myAISContext()->MoveTo(theX, theY, myView());
+    }
+  }
+
+  /// <summary>
+  ///Select by rectangle with pressed "Shift" key
+  /// </summary>
+  void ShiftSelect(int theX1, int theY1, int theX2, int theY2)
+  {
+    if ((!myAISContext().IsNull()) && (!myView().IsNull()))
+    {
+      myAISContext()->ShiftSelect(theX1, theY1, theX2, theY2, myView());
+    }
+  }
+
+  /// <summary>
+  ///Select by "Shift" key
+  /// </summary>
+  void ShiftSelect(void)
+  {
+    if (!myAISContext().IsNull())
+    {
+      myAISContext()->ShiftSelect();
+    }
+  }
+
+  /// <summary>
+  ///Set background color
+  /// </summary>
+  void BackgroundColor(int& theRed, int& theGreen, int& theBlue)
+  {
+    Standard_Real R1;
+    Standard_Real G1;
+    Standard_Real B1;
+    if (!myView().IsNull())
+    {
+      myView()->BackgroundColor(Quantity_TOC_RGB,R1,G1,B1);
+    }
+    theRed = (int)R1*255;
+    theGreen = (int)G1*255;
+    theBlue = (int)B1*255;
+  }
+
+  /// <summary>
+  ///Get background color Red
+  /// </summary>
+  int GetBGColR(void)
+  {
+    int aRed, aGreen, aBlue;
+    BackgroundColor(aRed, aGreen, aBlue);
+    return aRed;
+  }
+
+  /// <summary>
+  ///Get background color Green
+  /// </summary>
+  int GetBGColG(void)
+  {
+    int aRed, aGreen, aBlue;
+    BackgroundColor(aRed, aGreen, aBlue);
+    return aGreen;
+  }
+
+  /// <summary>
+  ///Get background color Blue
+  /// </summary>
+  int GetBGColB(void)
+  {
+    int aRed, aGreen, aBlue;
+    BackgroundColor(aRed, aGreen, aBlue);
+    return aBlue;
+  }
+
+  /// <summary>
+  ///Update current viewer
+  /// </summary>
+  void UpdateCurrentViewer(void)
+  {
+    if (!myAISContext().IsNull())
+    {
+      myAISContext()->UpdateCurrentViewer();
+    }
+  }
+
+  /// <summary>
+  ///Front side
+  /// </summary>
+  void FrontView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj(V3d_Xpos);
+    }
+  }
+
+  /// <summary>
+  ///Top side
+  /// </summary>
+  void TopView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj(V3d_Zpos);
+    }
+  }
+
+  /// <summary>
+  ///Left side
+  /// </summary>
+  void LeftView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj(V3d_Ypos);
+    }
+  }
+
+  /// <summary>
+  ///Back side
+  /// </summary>
+  void BackView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj(V3d_Xneg);
+    }
+  }
+
+  /// <summary>
+  ///Right side
+  /// </summary>
+  void RightView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj(V3d_Yneg);
+    }
+  }
+
+  /// <summary>
+  ///Bottom side
+  /// </summary>
+  void BottomView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj(V3d_Zneg);
+    }
+  }
+
+  /// <summary>
+  ///Axo side
+  /// </summary>
+  void AxoView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj(V3d_XposYnegZpos);
+    }
+  }
+
+  /// <summary>
+  ///Scale
+  /// </summary>
+  float Scale(void)
+  {
+    if (myView().IsNull())
+    {
+      return -1;
+    }
+    else
+    {
+      return (float)myView()->Scale();
+    }
+  }
+
+  /// <summary>
+  ///Zoom in all view
+  /// </summary>
+  void ZoomAllView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->FitAll();
+      myView()->ZFitAll();
+    }
+  }
+
+  /// <summary>
+  ///Reset view
+  /// </summary>
+  void Reset(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Reset();
+    }
+  }
+
+  /// <summary>
+  ///Set display mode of objects
+  /// </summary>
+  /// <param name="theMode">Set current mode</param>
+  void SetDisplayMode(int theMode)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    AIS_DisplayMode aCurrentMode;
+    if (theMode == 0)
+    {
+      aCurrentMode=AIS_WireFrame;
+    }
+    else
+    {
+      aCurrentMode=AIS_Shaded;
+    }
+
+    if(myAISContext()->NbCurrents()==0 || myAISContext()->NbSelected()==0)
+    {
+       myAISContext()->SetDisplayMode(aCurrentMode);
+    }
+    else 
+    {
+       for(myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+       {
+         myAISContext()->SetDisplayMode(myAISContext()->Current(), theMode, Standard_False);
+       }
+    }
+    myAISContext()->UpdateCurrentViewer();
+  }
+
+  /// <summary>
+  ///Set color
+  /// </summary>
+  void SetColor(int theR, int theG, int theB)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    Quantity_Color aCol =  Quantity_Color(theR/255.,theG/255.,theB/255.,Quantity_TOC_RGB);
+    for (;myAISContext()->MoreCurrent ();myAISContext()->NextCurrent ())
+    {
+      myAISContext()->SetColor (myAISContext()->Current(),aCol.Name());
+    }
+  }
+
+  /// <summary>
+  ///Get object color red
+  /// </summary>
+  int GetObjColR(void)
+  {
+    int aRed, aGreen, aBlue;
+    ObjectColor(aRed, aGreen, aBlue);
+    return aRed;
+  }
+
+  /// <summary>
+  ///Get object color green
+  /// </summary>
+  int GetObjColG(void)
+  {
+    int aRed, aGreen, aBlue;
+    ObjectColor(aRed, aGreen, aBlue);
+    return aGreen;
+  }
+
+  /// <summary>
+  ///Get object color R/G/B
+  /// </summary>
+  void ObjectColor(int& theRed, int& theGreen, int& theBlue)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    theRed=255;
+    theGreen=255;
+    theBlue=255;
+    Handle_AIS_InteractiveObject aCurrent ;
+    Quantity_Color anObjCol;
+    myAISContext()->InitCurrent();
+    if (!myAISContext()->MoreCurrent())
+    {
+      return;
+    }
+    aCurrent = myAISContext()->Current();
+    if ( aCurrent->HasColor () ) 
+    {
+      anObjCol = myAISContext()->Color(myAISContext()->Current());
+      Quantity_Parameter r1, r2, r3;
+      anObjCol.Values(r1, r2, r3, Quantity_TOC_RGB);
+      theRed=(int)r1*255;
+      theGreen=(int)r2*255;
+      theBlue=(int)r3*255;
+    }
+  }
+
+  /// <summary>
+  ///Get object color blue
+  /// </summary>
+  int GetObjColB(void)
+  {
+    int aRed, aGreen, aBlue;
+    ObjectColor(aRed, aGreen, aBlue);
+    return aBlue;
+  }
+
+  /// <summary>
+  ///Set background color R/G/B
+  /// </summary>
+  void SetBackgroundColor(int theRed, int theGreen, int theBlue)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetBackgroundColor(Quantity_TOC_RGB, theRed/255.,theGreen/255.,theBlue/255.);
+    }
+  }
+
+  /// <summary>
+  ///Erase objects
+  /// </summary>
+  void EraseObjects(void)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    for(myAISContext()->InitCurrent();myAISContext()->MoreCurrent();myAISContext()->NextCurrent())
+    {
+        myAISContext()->Erase(myAISContext()->Current(),Standard_True);
+    }
+    myAISContext()->ClearCurrents();
+  }
+
+  /// <summary>
+  ///Get version
+  /// </summary>
+  float GetOCCVersion(void)
+  {
+    return (float)OCC_VERSION;
+  }
+
+  /// <summary>
+  ///set material
+  /// </summary>
+  void SetMaterial(int theMaterial)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent (); myAISContext()->NextCurrent () )
+    {
+      myAISContext()->SetMaterial( myAISContext()->Current(), (Graphic3d_NameOfMaterial)theMaterial );
+    }
+    myAISContext()->UpdateCurrentViewer();
+  }
+
+  /// <summary>
+  ///set transparency
+  /// </summary>
+  void SetTransparency(int theTrans)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    for( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextSelected() )
+    {
+      myAISContext()->SetTransparency( myAISContext()->Current(), ((Standard_Real)theTrans) / 10.0 );
+    }
+  }
+
+  /// <summary>
+  ///Return true if object is selected
+  /// </summary>
+  bool IsObjectSelected(void)
+  {
+    if (myAISContext().IsNull())
+    {
+      return false;
+    }
+    myAISContext()->InitCurrent();
+    return myAISContext()->MoreCurrent() != Standard_False;
+  }
+
+  /// <summary>
+  ///Return display mode
+  /// </summary>
+  int DisplayMode(void)
+  {
+    if (myAISContext().IsNull())
+    {
+      return -1;
+    }
+    int aMode = -1;
+    bool OneOrMoreInShading = false;
+    bool OneOrMoreInWireframe = false;
+    for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      if ( myAISContext()->IsDisplayed( myAISContext()->Current(), 1 ) )
+      {
+        OneOrMoreInShading = true;
+      }
+      if ( myAISContext()->IsDisplayed( myAISContext()->Current(), 0 ) )
+      {
+        OneOrMoreInWireframe = true;
+      }
+    }
+    if (OneOrMoreInShading && OneOrMoreInWireframe)
+    {
+      aMode=10;
+    }
+    else if(OneOrMoreInShading)
+    {
+      aMode=1;
+    }
+    else if (OneOrMoreInWireframe)
+    {
+      aMode=0;
+    }
+
+    return aMode;
+  }
+
+  /// <summary>
+  ///Create new view
+  /// </summary>
+  /// <param name="theWnd">System.IntPtr that contains the window handle (HWND) of the control</param>
+  void CreateNewView(System::IntPtr theWnd)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    myView() = myAISContext()->CurrentViewer()->CreateView();
+    if (myGraphicDriver().IsNull())
+    {
+      Handle(Aspect_DisplayConnection) aDisplayConnection;
+      myGraphicDriver() = Graphic3d::InitGraphicDriver (aDisplayConnection);
+    }
+    Handle(WNT_Window) aWNTWindow = new WNT_Window (reinterpret_cast<HWND> (theWnd.ToPointer()));
+    myView()->SetWindow(aWNTWindow);
+    Standard_Integer w=100, h=100;
+    aWNTWindow->Size(w,h);
+    if (!aWNTWindow->IsMapped())
+    {
+      aWNTWindow->Map();
+    }
+  }
+
+  /// <summary>
+  ///Set AISContext
+  /// </summary>
+  bool SetAISContext(OCCTProxy^ theViewer)
+  {
+     this->myAISContext() = theViewer->GetContext();
+     if (myAISContext().IsNull())
+     {
+       return false;
+     }
+    return true;
+  }
+
+  /// <summary>
+  ///Get AISContext
+  /// </summary>
+  Handle_AIS_InteractiveContext GetContext(void)
+  {
+    return myAISContext();
+  }
+
+public:
+  // ============================================
+  // Import / export functionality
+  // ============================================
+
+  /// <summary>
+  ///Import BRep file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportBrep(System::String^ theFileName)
+  {
+    bool isResult = false;
+    int aLength = theFileName->Length;
+    char* aFilename = new char[aLength+1];
+    for(int i = 0; i<aLength; i++)
+    {
+      aFilename[i] = (char)theFileName->ToCharArray()[i];
+    }
+    aFilename[aLength] = '\0';
+    isResult = ImportBrep(aFilename);
+    return isResult;
+  }
+
+  /// <summary>
+  ///Import BRep file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportBrep(char* theFileName)
+  {
+    Standard_CString aFileName = (Standard_CString) theFileName;
+    TopoDS_Shape aShape;
+    BRep_Builder aBuilder;
+    Standard_Boolean isResult = BRepTools::Read(aShape,aFileName,aBuilder);
+    if (!isResult)
+    {
+      return false;
+    }
+    if(myAISContext()->HasOpenedContext())
+    {
+      myAISContext()->CloseLocalContext();
+    }
+    myAISContext()->Display(new AIS_Shape(aShape));
+    return true;
+  }
+
+  /// <summary>
+  ///Import Csfdb file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportCsfdb(char* theFileName)
+  {
+    Standard_CString aFileName = (Standard_CString) theFileName;
+    if ( FSD_File::IsGoodFileType(aFileName) != Storage_VSOk )
+    {
+      return false;
+    }
+
+    FSD_File aFileDriver;
+    TCollection_AsciiString aName( aFileName );
+    if ( aFileDriver.Open( aName, Storage_VSRead ) != Storage_VSOk )
+    {
+      return false;
+    }
+
+    Handle(ShapeSchema) aSchema = new ShapeSchema();
+    Handle(Storage_Data) data  = aSchema->Read( aFileDriver );
+    if ( data->ErrorStatus() != Storage_VSOk )
+    {
+      return false;
+    }
+    aFileDriver.Close();
+
+    Handle(Storage_HSeqOfRoot) aRoots = data->Roots();
+    for ( int i = 1; i <= aRoots->Length() ; i++ )
+    {
+      Handle(Storage_Root) aStorRoot = aRoots->Value( i );
+      Handle(Standard_Persistent) aStandPersistent = aStorRoot->Object();
+      Handle(PTopoDS_HShape) aPShape = Handle(PTopoDS_HShape)::DownCast(aStandPersistent);
+      if ( !aPShape.IsNull() )
+      {
+        PTColStd_PersistentTransientMap aMap;
+        TopoDS_Shape aTShape;
+        MgtBRep::Translate( aPShape, aMap, aTShape, MgtBRep_WithTriangle );
+        myAISContext()->Display(new AIS_Shape(aTShape));
+      }
+    }
+
+    return true;
+  }
+
+  /// <summary>
+  ///Import Step file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportStep(char* theFileName)
+  {
+    Standard_CString aFileName = (Standard_CString) theFileName;
+    STEPControl_Reader aReader;
+    IFSelect_ReturnStatus aStatus = aReader.ReadFile(aFileName);
+    if ( aStatus == IFSelect_RetDone )
+    {
+      bool isFailsonly = false;
+      aReader.PrintCheckLoad( isFailsonly, IFSelect_ItemsByEntity );
+
+      int aNbRoot = aReader.NbRootsForTransfer();
+      aReader.PrintCheckTransfer( isFailsonly, IFSelect_ItemsByEntity );
+      for ( Standard_Integer n = 1; n <= aNbRoot; n++ )
+      {
+        Standard_Boolean ok = aReader.TransferRoot( n );
+        int aNbShap = aReader.NbShapes();
+        if ( aNbShap > 0 )
+        {
+          for ( int i = 1; i <= aNbShap; i++ )
+          {
+            TopoDS_Shape aShape = aReader.Shape( i );
+            myAISContext()->Display(new AIS_Shape(aShape));
+          }
+        }
+      }
+    }
+    else
+    {
+      return false;
+    }
+
+    return true;
+  }
+
+  /// <summary>
+  ///Import Iges file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportIges(char* theFileName)
+  {
+    Standard_CString aFileName = (Standard_CString) theFileName;
+    IGESControl_Reader aReader;
+    int aStatus = aReader.ReadFile( aFileName );
+
+    if ( aStatus == IFSelect_RetDone )
+    {
+      aReader.TransferRoots();
+      TopoDS_Shape aShape = aReader.OneShape();
+      myAISContext()->Display(new AIS_Shape(aShape));
+    }
+    else
+    {
+      return false;
+    }
+
+    myAISContext()->UpdateCurrentViewer();
+    return true;
+  }
+
+  /// <summary>
+  ///Export BRep file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportBRep(char* theFileName)
+  {
+    myAISContext()->InitCurrent();
+    if (!myAISContext()->MoreCurrent())
+    {
+      return false;
+    }
+
+    Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
+    Handle_AIS_Shape anIS = Handle_AIS_Shape::DownCast(anIO);
+    return BRepTools::Write (anIS->Shape(), (Standard_CString)theFileName) != Standard_False;
+  }
+
+  /// <summary>
+  ///Export Step file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportStep(char* theFileName)
+  {
+    STEPControl_StepModelType aType = STEPControl_AsIs;
+    IFSelect_ReturnStatus aStatus;
+    STEPControl_Writer aWriter;
+    for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
+    {
+      Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
+      Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
+      TopoDS_Shape aShape = anIS->Shape();
+      aStatus = aWriter.Transfer( aShape , aType );
+      if ( aStatus != IFSelect_RetDone )
+      {
+        return false;
+      }
+    }
+
+    aStatus = aWriter.Write( (Standard_CString)theFileName );
+    if ( aStatus != IFSelect_RetDone )
+    {
+      return false;
+    }
+
+    return true;
+  }
+
+  /// <summary>
+  ///Export Iges file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportIges(char* theFileName)
+  {
+    IGESControl_Controller::Init();
+    IGESControl_Writer aWriter( Interface_Static::CVal( "XSTEP.iges.unit" ),
+      Interface_Static::IVal( "XSTEP.iges.writebrep.mode" ) );
+
+    for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
+    {
+      Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
+      Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
+      TopoDS_Shape aShape = anIS->Shape();
+      aWriter.AddShape ( aShape );
+    }
+
+    aWriter.ComputeModel();
+    return aWriter.Write( (Standard_CString)theFileName) != Standard_False;
+  }
+
+  /// <summary>
+  ///Export Vrml file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportVrml(char* theFileName)
+  {
+    TopoDS_Compound aRes;
+    BRep_Builder aBuilder;
+    aBuilder.MakeCompound( aRes );
+
+    for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
+    {
+      Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
+      Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
+      TopoDS_Shape aShape = anIS->Shape();
+      if ( aShape.IsNull() )
+      {
+        return false;
+      }
+
+      aBuilder.Add( aRes, aShape );
+    }
+
+    VrmlAPI_Writer aWriter;
+    aWriter.Write( aRes, (Standard_CString)theFileName );
+
+    return true;
+  }
+
+  /// <summary>
+  ///Export Stl file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportStl(char* theFileName)
+  {
+    TopoDS_Compound aComp;
+    BRep_Builder aBuilder;
+    aBuilder.MakeCompound( aComp );
+
+    for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
+    {
+      Handle_AIS_InteractiveObject anIO = myAISContext()->Current();
+      Handle_AIS_Shape anIS=Handle_AIS_Shape::DownCast(anIO);
+      TopoDS_Shape aShape = anIS->Shape();
+      if ( aShape.IsNull() ) 
+      {
+        return false;
+      }
+      aBuilder.Add( aComp, aShape );
+    }
+
+    StlAPI_Writer aWriter;
+    aWriter.Write( aComp, (Standard_CString)theFileName );
+    return true;
+  }
+
+  /// <summary>
+  ///Define which Import/Export function must be called
+  /// </summary>
+  /// <param name="theFileName">Name of Import/Export file</param>
+  /// <param name="theFormat">Determines format of Import/Export file</param>
+  /// <param name="theIsImport">Determines is Import or not</param>
+  bool TranslateModel(System::String^ theFileName, int theFormat, bool theIsImport)
+  {
+    bool isResult;
+    int aLength = theFileName->Length;
+    char* aFilename = new char[aLength+1];
+    for(int i = 0; i<aLength; i++)
+    {
+      aFilename[i] = (char)theFileName->ToCharArray()[i];
+    }
+    aFilename[aLength] = '\0';
+
+    if (theIsImport)
+    {
+      switch(theFormat)
+      {
+      case 0:
+        isResult = ImportBrep(aFilename);
+        break;
+      case 1:
+        isResult = ImportCsfdb(aFilename);
+        break;
+      case 2:
+        isResult = ImportStep(aFilename);
+        break;
+      case 3:
+        isResult = ImportIges(aFilename);
+        break;
+      default:
+        isResult = false;
+      }
+    }
+    else 
+    {
+      switch(theFormat)
+      {
+      case 0:
+        isResult = ExportBRep(aFilename);
+        break;
+      case 2:
+        isResult = ExportStep(aFilename);
+        break;
+      case 3:
+        isResult = ExportIges(aFilename);
+        break;
+      case 4:
+        isResult = ExportVrml(aFilename);
+        break;
+      case 5:
+        isResult = ExportStl(aFilename);
+        break;
+      case 6:
+        isResult = Dump(aFilename);
+        break;
+      default:
+        isResult = false;
+      }
+    }
+    return isResult;
+  }
+
+  /// <summary>
+  ///Initialize OCCTProxy
+  /// </summary>
+  void InitOCCTProxy(void)
+  {
+    myGraphicDriver()=NULL;
+    myViewer()=NULL;
+    myView()=NULL;
+    myAISContext()=NULL;
+  }
+
+private:
+  // fields
+  NCollection_Haft<Handle_V3d_Viewer> myViewer;
+  NCollection_Haft<Handle_V3d_View> myView;
+  NCollection_Haft<Handle_AIS_InteractiveContext> myAISContext;
+  NCollection_Haft<Handle_Graphic3d_GraphicDriver> myGraphicDriver;
+};
diff --git a/samples/CSharp/OCCTProxy/OCCTProxy.vcproj b/samples/CSharp/OCCTProxy/OCCTProxy.vcproj
new file mode 100644 (file)
index 0000000..eefb3bb
--- /dev/null
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="9,00"
+       Name="OCCTProxy"
+       ProjectGUID="{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
+       RootNamespace="OCCTProxy"
+       Keyword="Win32Proj"
+       TargetFrameworkVersion="131072"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+               <Platform
+                       Name="x64"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="..\win32\bind"
+                       IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+                       CharacterSet="2"
+                       ManagedExtensions="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\OCC\;$(CSF_OPT_INC)"
+                               PreprocessorDefinitions="WNT"
+                               MinimalRebuild="false"
+                               BasicRuntimeChecks="0"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="$(OutDir)/OCCTProxy.dll"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="$(CSF_OPT_LIB32D)"
+                               GenerateDebugInformation="true"
+                               AssemblyDebug="1"
+                               ProgramDatabaseFile="$(OutDir)/OCCTProxy.pdb"
+                               SubSystem="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
+                               ImportLibrary="$(OutDir)/OCCTProxy.lib"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Debug|x64"
+                       OutputDirectory="..\win64\bind"
+                       IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+                       CharacterSet="2"
+                       ManagedExtensions="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\OCC\;$(CSF_OPT_INC)"
+                               PreprocessorDefinitions="WNT"
+                               MinimalRebuild="false"
+                               BasicRuntimeChecks="0"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="$(OutDir)/OCCTProxy.dll"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="$(CSF_OPT_LIB64D)"
+                               GenerateDebugInformation="true"
+                               AssemblyDebug="1"
+                               ProgramDatabaseFile="$(OutDir)/OCCTProxy.pdb"
+                               SubSystem="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
+                               ImportLibrary="$(OutDir)/OCCTProxy.lib"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="..\win32\bin"
+                       IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+                       CharacterSet="2"
+                       ManagedExtensions="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="..\OCC\;$(CSF_OPT_INC)"
+                               PreprocessorDefinitions="WNT"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="$(OutDir)/OCCTProxy.dll"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="$(CSF_OPT_LIB32)"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
+                               ImportLibrary="$(OutDir)/OCCTProxy.lib"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|x64"
+                       OutputDirectory="..\win64\bin"
+                       IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+                       CharacterSet="2"
+                       ManagedExtensions="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="..\OCC\;$(CSF_OPT_INC)"
+                               PreprocessorDefinitions="WNT"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="$(OutDir)/OCCTProxy.dll"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="$(CSF_OPT_LIB64)"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
+                               ImportLibrary="$(OutDir)/OCCTProxy.lib"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\OCCTProxy.cpp"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Header Files"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/samples/CSharp/ReadMe.md b/samples/CSharp/ReadMe.md
new file mode 100644 (file)
index 0000000..62f2963
--- /dev/null
@@ -0,0 +1,50 @@
+#### OCCT CSharp sample
+       
+This sample demonstrates simple way of using OCCT libraries in .Net application
+whitten using CSharp and Windows Forms or Windows Presentation Foundation (WPF).
+
+The connection between .Net and OCCT (C++) level is provided by proxy library,
+OCCProxy, written in C++/CLI. The proxy library contains single ref class
+encapsulating OCCT viewer and providing functionality to manipulate this viewer
+and to import / export OCCT shapes from / to several supported formats of CAD 
+files (IGES, STEP, BREP). 
+
+The sample implements two approaches for organizing user interface with C#.
+Both applications provide the same functionality as the standard OCCT 
+Import/Export sample.
+First project is called "IE_WinForms" and uses Windows Forms for GUI.
+Second application is called "IE_WPF" and uses Windows Presentation Foundation.
+
+Note a few important details:
+
+- to encapsulate C++ class into a field of ref class, template class 
+  NCollection_Haft provided by OCCT is used
+  
+- in order to work consistently on 64-bit systems with OCCT libraries built in 
+  32-bit mode, C# assemblies need to have platform target explicitly set to "x86"
+  (in project Properties / Build)
+  
+- this sample demonstrates indirect method of wrapping C++ to C# using manually
+  created proxy library. Alternative method is available, wrapping individual
+  OCCT classes to C# equivalents so that their full API is available to C# user
+  and the code can be programmed on C# level similarly to C++ one. See desciption
+  of OCCT C# Wrapper in Advanced Samples and Tools on OCCT web site at 
+  http://www.opencascade.org/support/products/advsamples
+
+- in WPF sample, WinForms control is used to encapsulate OCC viewer since WPF 
+  does not provide necessary interface to embed OpenGl view. Other possible
+  solution could be to render OpenGl scene in off-screen buffer and map it
+  to WPF control as image. That approach would allow using all WPF features in
+  control embedding OCCT viewer.
+
+Run msvc.bat to start MS Visual Studio for building the sample.
+Note that project files are provided only for VS 2008, you can open them in
+newer versions of Visual Studio using automatic converter.
+
+Run run_winforms.bat or run_wpf.bat to launch the corresponding sample.
+
+Note that all batch scripts use configuration defined in OCCT custom.bat file
+as default; you can provide arguments specifying VS version, bitness, and mode
+to override these settings, e.g.:
+
+> msvc.bat vc9 win64 Debug
diff --git a/samples/CSharp/WPF/About.xaml b/samples/CSharp/WPF/About.xaml
new file mode 100644 (file)
index 0000000..59f2a05
--- /dev/null
@@ -0,0 +1,18 @@
+\feff<Window
+       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+       x:Class="IE_WPF.AboutDialog"
+       x:Name="Window"
+       xmlns:local="clr-namespace:IE_WPF"
+       Title="About Import/Export Sample"
+       Width="312" Height="285">
+       
+       <StackPanel Orientation="Vertical">
+               <Label Content="Import/Export Sample," HorizontalAlignment="Center"/>
+               <Label Content="Open CASCADE Technology " HorizontalAlignment="Center"/>
+               <Image Source="occ_logo.bmp" Width="194" Height="100" />
+               <Label Content="Copyright (C) 2004-2013, Open CASCADE S.A.S" HorizontalAlignment="Center"/>
+               <Label Content="http://www.opencascade.com" HorizontalAlignment="Center"/>
+               <Button Content="OK" HorizontalAlignment="Center" Width="75" Command="local:IECommands.AboutOk"/>
+       </StackPanel>   
+</Window>
\ No newline at end of file
diff --git a/samples/CSharp/WPF/About.xaml.cs b/samples/CSharp/WPF/About.xaml.cs
new file mode 100644 (file)
index 0000000..c3b0343
--- /dev/null
@@ -0,0 +1,40 @@
+\feffusing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace IE_WPF
+{
+       /// <summary>
+       /// Interaction logic for About.xaml
+       /// </summary>
+       public partial class AboutDialog : Window
+       {
+               public AboutDialog()
+               {
+                       this.InitializeComponent();
+
+            CommandBinding aBind_Ok = new CommandBinding( IECommands.AboutOk );
+            aBind_Ok.Executed += OkCommand_Executed;
+            aBind_Ok.CanExecute += OkCommand_CanExecute;
+            CommandBindings.Add( aBind_Ok );
+               }
+  
+        private void OkCommand_Executed( object sender, ExecutedRoutedEventArgs e )
+        {
+            this.Close();
+        }
+
+        private void OkCommand_CanExecute( object sender, CanExecuteRoutedEventArgs e )
+        {
+            e.CanExecute = true;
+        }
+    }
+}
\ No newline at end of file
diff --git a/samples/CSharp/WPF/App.xaml b/samples/CSharp/WPF/App.xaml
new file mode 100644 (file)
index 0000000..d3ba244
--- /dev/null
@@ -0,0 +1,14 @@
+\feff<Application x:Class="IE_WPF.App"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    StartupUri="MainWindow.xaml">
+    <Application.Resources>
+         
+       <ResourceDictionary>
+               <ResourceDictionary.MergedDictionaries>
+                       <ResourceDictionary Source="Simple Styles.xaml"/>
+               </ResourceDictionary.MergedDictionaries>
+       </ResourceDictionary>
+         
+    </Application.Resources>
+</Application>
diff --git a/samples/CSharp/WPF/App.xaml.cs b/samples/CSharp/WPF/App.xaml.cs
new file mode 100644 (file)
index 0000000..c2a2e28
--- /dev/null
@@ -0,0 +1,16 @@
+\feffusing System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Windows;
+
+namespace IE_WPF
+{
+    /// <summary>
+    /// Interaction logic for App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}
diff --git a/samples/CSharp/WPF/IECommands.cs b/samples/CSharp/WPF/IECommands.cs
new file mode 100644 (file)
index 0000000..738260e
--- /dev/null
@@ -0,0 +1,44 @@
+\feffusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows.Input;
+
+namespace IE_WPF
+{
+    public class IECommands
+    {
+        public static RoutedUICommand New { get; private set; }
+        public static RoutedUICommand Close { get; private set; }
+        public static RoutedUICommand Quit { get; private set; }
+        public static RoutedUICommand About { get; private set; }
+        public static RoutedUICommand AboutOk { get; private set; }
+
+        static IECommands()
+        {
+            #region menu
+
+            InputGestureCollection inputsNew = new InputGestureCollection();
+            inputsNew.Add( new KeyGesture( Key.N, ModifierKeys.Control, "Ctrl + N" ) );
+            New = new RoutedUICommand( "New", "New", typeof(IECommands), inputsNew );
+            
+            Close = new RoutedUICommand( "Close", "Close", typeof(IECommands) );
+
+            InputGestureCollection inputsQuit = new InputGestureCollection();
+            inputsQuit.Add( new KeyGesture( Key.F4, ModifierKeys.Alt, "Alt + F4" ) );
+            Quit = new RoutedUICommand( "Quit", "Quit", typeof(IECommands), inputsQuit );
+
+            InputGestureCollection inputsAbout = new InputGestureCollection();
+            inputsAbout.Add( new KeyGesture( Key.F1 ) );
+            About = new RoutedUICommand( "About", "About", typeof(IECommands), inputsAbout );
+
+            #endregion
+
+            #region aboutDlg
+            InputGestureCollection inputsAboutOk = new InputGestureCollection();
+            inputsAboutOk.Add( new KeyGesture( Key.Enter ) );
+            AboutOk = new RoutedUICommand( "AboutOk", "AboutOk", typeof(IECommands), inputsAboutOk );
+            #endregion
+        }
+    }
+}
diff --git a/samples/CSharp/WPF/IE_WPF.csproj b/samples/CSharp/WPF/IE_WPF.csproj
new file mode 100644 (file)
index 0000000..48a7f12
--- /dev/null
@@ -0,0 +1,214 @@
+\feff<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>IE_WPF</RootNamespace>
+    <AssemblyName>IE_WPF</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <ExpressionBlendVersion>3.0.1927.0</ExpressionBlendVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\win32\bind\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\win32\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\win64\bind\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\win64\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="UIAutomationProvider">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="PresentationCore">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="PresentationFramework">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsFormsIntegration">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Page Include="About.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="MaterialDlg.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Simple Styles.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="MainWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="About.xaml.cs">
+      <DependentUpon>About.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="IECommands.cs" />
+    <Compile Include="MaterialDlg.xaml.cs">
+      <DependentUpon>MaterialDlg.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <Compile Include="OCCViewer.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="TransparencyDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <EmbeddedResource Include="TransparencyDialog.resx">
+      <DependentUpon>TransparencyDialog.cs</DependentUpon>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <AppDesigner Include="Properties\" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="res\help.png" />
+    <Resource Include="res\lamp.png" />
+    <Resource Include="res\MainFrame.ico" />
+    <Resource Include="res\new.png" />
+    <Resource Include="res\tool_color.png" />
+    <Resource Include="res\tool_delete.png" />
+    <Resource Include="res\tool_material.png" />
+    <Resource Include="res\tool_shading.png" />
+    <Resource Include="res\tool_transparency.png" />
+    <Resource Include="res\tool_wireframe.png" />
+    <Resource Include="res\view_axo.png" />
+    <Resource Include="res\view_back.png" />
+    <Resource Include="res\view_bottom.png" />
+    <Resource Include="res\view_comp_off.png" />
+    <Resource Include="res\view_comp_on.png" />
+    <Resource Include="res\view_fitall.png" />
+    <Resource Include="res\view_fitarea.png" />
+    <Resource Include="res\view_front.png" />
+    <Resource Include="res\view_glpan.png" />
+    <Resource Include="res\view_left.png" />
+    <Resource Include="res\view_pan.png" />
+    <Resource Include="res\view_reset.png" />
+    <Resource Include="res\view_right.png" />
+    <Resource Include="res\view_rotate.png" />
+    <Resource Include="res\view_top.png" />
+    <Resource Include="res\view_zoom.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="res\occ_logo.bmp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\OCCTProxy\OCCTProxy.vcproj">
+      <Project>{969912D9-78E7-4AB8-B4FF-6B52B4F03991}</Project>
+      <Name>OCCTProxy</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file
diff --git a/samples/CSharp/WPF/MainWindow.xaml b/samples/CSharp/WPF/MainWindow.xaml
new file mode 100644 (file)
index 0000000..5d54370
--- /dev/null
@@ -0,0 +1,169 @@
+\feff<Window
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+       x:Class="IE_WPF.MainWindow"
+       xmlns:local="clr-namespace:IE_WPF"
+    Title="Sample Import/Export" Height="600" Width="900" Icon="res/MainFrame.ico">
+       
+       <Window.Background>
+               <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ControlDarkColorKey}}"/>
+       </Window.Background>
+       
+       <Window.Resources>
+        <BooleanToVisibilityConverter x:Key="boolToVisibilityConverter"/>
+    </Window.Resources>
+               
+    <Grid>
+           <Grid.RowDefinitions>
+                       <RowDefinition Height="auto"/>
+                       <RowDefinition Height="auto"/>
+                       <RowDefinition />
+                       <RowDefinition Height="auto"/>
+               </Grid.RowDefinitions>
+        
+       <Menu Height="25" Grid.Row="0">
+               <MenuItem Header="File">
+                       <MenuItem Command="local:IECommands.New"/>
+                       <MenuItem Command="local:IECommands.Close"/>
+                               <MenuItem Header="Import" IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}">
+                                       <MenuItem Name="ImportBrep" Header="BRep..." Click="ImportBRep_Click"/>
+                                       <MenuItem Name="ImportIges" Header="Iges..." Click="ImportIges_Click"/>
+                    <MenuItem Name="ImportStep" Header="Step..." Click="ImportStep_Click"/>
+                               </MenuItem>
+                <MenuItem Header="Export" IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}">
+                                       <MenuItem Name="ExportBrep" Header="BRep..." Click="ExportBRep_Click"/>
+                                       <MenuItem Name="ExportIges" Header="Iges..." Click="ExportIges_Click"/>
+                                       <MenuItem Name="ExportStep" Header="Step..." Click="ExportStep_Click"/>
+                                       <MenuItem Name="ExportStl" Header="Stl..." Click="ExportStl_Click"/>
+                                       <MenuItem Name="ExportVrml" Header="Vrml..." Click="ExportVrml_Click"/>
+                                       <Separator/>
+                                       <MenuItem Name="ExportImage" Header="Image..." Click="ExportImage_Click"/>
+                               </MenuItem>
+                       <Separator/>
+                       <MenuItem Command="local:IECommands.Quit"/>
+               </MenuItem>
+               <MenuItem Header="View">
+                       <MenuItem Name="ActivateToolbar" IsCheckable="True" IsChecked="True" Header="Toolbar"/>
+                       <MenuItem Name="ActivateStatusbar" IsCheckable="True" IsChecked="True" Header="Statusbar"/>
+               </MenuItem>
+               <MenuItem Header="Help">
+                       <MenuItem Header="About" Command="local:IECommands.About"/>
+               </MenuItem>
+       </Menu>
+               
+               <ToolBarTray Background="White" Grid.Row="1">
+            <ToolBar Name="ToolBar" Band="1" BandIndex="1" 
+                                        Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
+                     MouseEnter="ToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
+                <Button ToolTip="New" Command="local:IECommands.New">
+                    <Image Source="res/new.png" Style="{StaticResource toolbarImageStyle}"/>
+                </Button>
+                       <Button ToolTip="About" Command="local:IECommands.About">
+                    <Image Source="res/help.png" Style="{StaticResource toolbarImageStyle}"/>
+                </Button>
+               </ToolBar>
+                       <ToolBar Name="DocumentToolBar" Band="1" BandIndex="2" 
+                     Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
+                                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}"
+                     MouseEnter="DocumentToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
+                <Button ToolTip="Wireframe" Click="Wireframe_Click"
+                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsWireframeEnabled}">
+                                       <Image Source="res/tool_wireframe.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                       <Button ToolTip="Shading" Click="Shading_Click"
+                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsShadingEnabled}">
+                                       <Image Source="res/tool_shading.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                               <Button ToolTip="Color" Click="Color_Click"
+                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsColorEnabled}">
+                                       <Image Source="res/tool_color.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                               <Button ToolTip="Material" Click="Material_Click"
+                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsMaterialEnabled}">
+                                       <Image Source="res/tool_material.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                               <Button ToolTip="Transparency" Click="Transparency_Click"
+                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsTransparencyEnabled}">
+                                       <Image Source="res/tool_transparency.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                               <Button ToolTip="Delete" Click="Delete_Click"
+                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDeleteEnabled}">
+                                       <Image Source="res/tool_delete.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+               </ToolBar>
+            <ToolBar Name="ViewToolBar" Band="1" BandIndex="1"
+                     Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
+                                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}"
+                     MouseEnter="ViewToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
+                <Button ToolTip="FitAll" Name="FitAllBtn" Click="FitAllBtn_Click">
+                                       <Image Source="res/view_fitall.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                       <Button ToolTip="Zoom Window" Name="ZoomWindowBtn" Click="ZoomWindowBtn_Click"
+                                               IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsZoomWinEnabled}">
+                                       <Image Source="res/view_fitarea.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                               <Button ToolTip="Dynamic Zooming" Name="DynamicZoomingBtn" Click="DynamicZoomingBtn_Click">
+                                       <Image Source="res/view_zoom.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                               <Button ToolTip="Dynamic Panning" Name="DynamicPanningBtn" Click="DynamicPanningBtn_Click">
+                                       <Image Source="res/view_pan.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                               <Button ToolTip="Global Panning" Name="GlobalPanningBtn" Click="GlobalPanningBtn_Click">
+                                       <Image Source="res/view_glpan.png" Style="{StaticResource toolbarImageStyle}"/>
+                               </Button>
+                               <Button ToolTip="Front" Name="FrontBtn" Click="FrontBtn_Click">
+                                       <Image Source="res/view_front.png" Style="{StaticResource toolbarImageStyle}"/>
+  &nb