├── WinFormsVB
├── AboutDialog.vb
├── MaterialDialog.Designer.vb
├── TransparencyDialog.Designer.vb
├── Form2.Designer.vb
├── My Project
│ ├── Settings.settings
│ ├── Application.myapp
│ ├── AssemblyInfo.vb
│ ├── Application.Designer.vb
│ ├── app.manifest
│ ├── Resources.Designer.vb
│ ├── Settings.Designer.vb
│ └── Resources.resx
├── Form1.Designer.vb
├── App.config
├── TransparencyDialog.vb
├── AboutDialog.Designer.vb
├── Form2.resx
├── MaterialDialog.resx
├── TransparencyDialog.resx
├── IE_WinFormsVB.vbproj
└── MaterialDialog.vb
├── run_winforms.bat
├── run_wpf.bat
├── run_wpf_D3D.bat
├── run_winformsvb.bat
├── WinForms
├── App.ico
├── app.config
├── AssemblyInfo.cs
├── TransparencyDialog.cs
├── AboutDialog.cs
├── MaterialDialog.cs
└── IE_WinForms.csproj
├── WPF_D3D
├── res
│ ├── help.png
│ ├── lamp.png
│ ├── new.png
│ ├── MainFrame.ico
│ ├── document.png
│ ├── occ_logo.bmp
│ ├── view_axo.png
│ ├── view_back.png
│ ├── view_left.png
│ ├── view_pan.png
│ ├── view_top.png
│ ├── view_zoom.png
│ ├── tool_color.png
│ ├── tool_delete.png
│ ├── tool_shading.png
│ ├── view_bottom.png
│ ├── view_comp_on.png
│ ├── view_fitall.png
│ ├── view_fitarea.png
│ ├── view_front.png
│ ├── view_glpan.png
│ ├── view_reset.png
│ ├── view_right.png
│ ├── view_rotate.png
│ ├── tool_material.png
│ ├── tool_wireframe.png
│ ├── view_comp_off.png
│ └── tool_transparency.png
├── app.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── App.xaml.cs
├── App.xaml
├── About.xaml
├── MaterialDlg.xaml
├── About.xaml.cs
├── MaterialDlg.xaml.cs
├── IECommands.cs
├── TransparencyDialog.cs
└── D3DViewer.cs
├── occt_csharp_sample.png
├── WPF_WinForms
├── res
│ ├── help.png
│ ├── lamp.png
│ ├── new.png
│ ├── MainFrame.ico
│ ├── document.png
│ ├── occ_logo.bmp
│ ├── view_axo.png
│ ├── view_back.png
│ ├── view_left.png
│ ├── view_pan.png
│ ├── view_top.png
│ ├── view_zoom.png
│ ├── tool_color.png
│ ├── tool_delete.png
│ ├── tool_shading.png
│ ├── view_bottom.png
│ ├── view_comp_on.png
│ ├── view_fitall.png
│ ├── view_fitarea.png
│ ├── view_front.png
│ ├── view_glpan.png
│ ├── view_reset.png
│ ├── view_right.png
│ ├── view_rotate.png
│ ├── tool_material.png
│ ├── tool_wireframe.png
│ ├── view_comp_off.png
│ └── tool_transparency.png
├── app.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── App.xaml.cs
├── App.xaml
├── About.xaml
├── MaterialDlg.xaml
├── About.xaml.cs
├── MaterialDlg.xaml.cs
├── IECommands.cs
└── TransparencyDialog.cs
├── custom.bat.template
├── .gitignore
├── env.bat
├── msvc.bat
├── run.bat
├── msvc_D3D.bat
├── LICENSE.md
├── .gitattributes
├── CSharp_D3D.sln
├── CSharp.sln
├── ReadMe.md
├── OCCTProxy
└── OCCTProxy.vcproj
└── OCCTProxy_D3D
└── OCCTProxy_D3D.vcproj
/WinFormsVB/AboutDialog.vb:
--------------------------------------------------------------------------------
1 | Public Class AboutDialog
2 |
3 | End Class
--------------------------------------------------------------------------------
/run_winforms.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | call "%~dp0run.bat" WinForms
4 |
--------------------------------------------------------------------------------
/run_wpf.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | call "%~dp0run.bat" WPF_WinForms
4 |
--------------------------------------------------------------------------------
/run_wpf_D3D.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | call "%~dp0run.bat" WPF_D3D
4 |
--------------------------------------------------------------------------------
/run_winformsvb.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | call "%~dp0run.bat" WinFormsVB
4 |
--------------------------------------------------------------------------------
/WinForms/App.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WinForms/App.ico
--------------------------------------------------------------------------------
/WPF_D3D/res/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/help.png
--------------------------------------------------------------------------------
/WPF_D3D/res/lamp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/lamp.png
--------------------------------------------------------------------------------
/WPF_D3D/res/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/new.png
--------------------------------------------------------------------------------
/occt_csharp_sample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/occt_csharp_sample.png
--------------------------------------------------------------------------------
/WPF_D3D/res/MainFrame.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/MainFrame.ico
--------------------------------------------------------------------------------
/WPF_D3D/res/document.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/document.png
--------------------------------------------------------------------------------
/WPF_D3D/res/occ_logo.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/occ_logo.bmp
--------------------------------------------------------------------------------
/WPF_D3D/res/view_axo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_axo.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_back.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_left.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_pan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_pan.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_top.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_zoom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_zoom.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/help.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/lamp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/lamp.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/new.png
--------------------------------------------------------------------------------
/WPF_D3D/res/tool_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/tool_color.png
--------------------------------------------------------------------------------
/WPF_D3D/res/tool_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/tool_delete.png
--------------------------------------------------------------------------------
/WPF_D3D/res/tool_shading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/tool_shading.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_bottom.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_comp_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_comp_on.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_fitall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_fitall.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_fitarea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_fitarea.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_front.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_front.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_glpan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_glpan.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_reset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_reset.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_right.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_rotate.png
--------------------------------------------------------------------------------
/WPF_D3D/res/tool_material.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/tool_material.png
--------------------------------------------------------------------------------
/WPF_D3D/res/tool_wireframe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/tool_wireframe.png
--------------------------------------------------------------------------------
/WPF_D3D/res/view_comp_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/view_comp_off.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/MainFrame.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/MainFrame.ico
--------------------------------------------------------------------------------
/WPF_WinForms/res/document.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/document.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/occ_logo.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/occ_logo.bmp
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_axo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_axo.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_back.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_left.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_pan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_pan.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_top.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_zoom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_zoom.png
--------------------------------------------------------------------------------
/WPF_D3D/res/tool_transparency.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_D3D/res/tool_transparency.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/tool_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/tool_color.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/tool_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/tool_delete.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/tool_shading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/tool_shading.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_bottom.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_comp_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_comp_on.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_fitall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_fitall.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_fitarea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_fitarea.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_front.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_front.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_glpan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_glpan.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_reset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_reset.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_right.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_rotate.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/tool_material.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/tool_material.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/tool_wireframe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/tool_wireframe.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/view_comp_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/view_comp_off.png
--------------------------------------------------------------------------------
/WPF_WinForms/res/tool_transparency.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Open-Cascade-SAS/OCCT-samples-csharp/HEAD/WPF_WinForms/res/tool_transparency.png
--------------------------------------------------------------------------------
/custom.bat.template:
--------------------------------------------------------------------------------
1 | rem Environment configuration template for msvc.bat (to be renamed as custom.bat)
2 |
3 | set "CASROOT=%~dp0../../occt.git"
4 |
--------------------------------------------------------------------------------
/WPF_D3D/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/WPF_WinForms/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/WinFormsVB/MaterialDialog.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class MaterialDialog
3 | Inherits System.Windows.Forms.Form
4 |
5 | End Class
6 |
--------------------------------------------------------------------------------
/WinFormsVB/TransparencyDialog.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class TransparencyDialog
3 | Inherits System.Windows.Forms.Form
4 |
5 | End Class
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | win32
2 | win64
3 |
4 | obj/
5 | *.vcproj*user
6 | *.vcxproj*user
7 | *.csproj*user
8 | *.ncb
9 | *.suo
10 | *.sdf
11 | *.opensdf
12 | *.VC.db
13 | *.VC.opendb
14 | *.ipch
15 | *.aps
16 |
17 | /custom.bat
18 | /config.*
19 |
--------------------------------------------------------------------------------
/WPF_D3D/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WinFormsVB/Form2.Designer.vb:
--------------------------------------------------------------------------------
1 | 'Namespace IE_WinForms
2 | _
3 | Partial Class Form2
4 | Inherits System.Windows.Forms.Form
5 |
6 | End Class
7 | 'End Namespace
8 |
--------------------------------------------------------------------------------
/WPF_WinForms/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WinFormsVB/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WPF_D3D/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Windows;
7 |
8 | namespace IE_WPF_D3D
9 | {
10 | ///
11 | /// Interaction logic for App.xaml
12 | ///
13 | public partial class App : Application
14 | {
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WPF_WinForms/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Windows;
7 |
8 | namespace IE_WPF_WinForms
9 | {
10 | ///
11 | /// Interaction logic for App.xaml
12 | ///
13 | public partial class App : Application
14 | {
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/env.bat:
--------------------------------------------------------------------------------
1 | set "aSampleSrc=%~dp0"
2 |
3 | rem Configuration file
4 | if exist "%~dp0custom.bat" call "%~dp0custom.bat"
5 |
6 | call "%CASROOT%\env.bat" %1 %2 %3
7 |
8 | set "BIN_DIR=win%ARCH%\%VCVER%\bind"
9 | set "LIB_DIR=win%ARCH%\%VCVER%\libd"
10 |
11 | if ["%CASDEB%"] == [""] (
12 | set "BIN_DIR=win%ARCH%\%VCVER%\bin"
13 | set "LIB_DIR=win%ARCH%\%VCVER%\lib"
14 | )
15 |
16 | set "PATH=%~dp0%LIB_DIR%;%~dp0%BIN_DIR%;%PATH%"
17 |
--------------------------------------------------------------------------------
/WinFormsVB/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | IE_WinForms.Form1
5 | false
6 | 0
7 | true
8 | 0
9 | true
10 |
--------------------------------------------------------------------------------
/WPF_D3D/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WPF_WinForms/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WinFormsVB/Form1.Designer.vb:
--------------------------------------------------------------------------------
1 | 'Namespace IE_WinForms
2 | _
3 | Partial Class Form1
4 | Inherits System.Windows.Forms.Form
5 |
6 | 'Form overrides dispose to clean up the component list.
7 | _
8 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
9 | Try
10 | If disposing AndAlso components IsNot Nothing Then
11 | components.Dispose()
12 | End If
13 | Finally
14 | MyBase.Dispose(disposing)
15 | End Try
16 | End Sub
17 |
18 | End Class
19 | 'End Namespace
20 |
21 |
--------------------------------------------------------------------------------
/msvc.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | Setlocal EnableDelayedExpansion
4 |
5 | rem Setup environment
6 | call "%~dp0env.bat" %1 %2 %3
7 |
8 | rem Define path to project file
9 | set "PRJFILE=%~dp0\CSharp.sln"
10 |
11 | rem Launch Visual Studio - either professional (devenv) or Express, as available
12 | if exist "%DevEnvDir%\devenv.exe" (
13 | start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
14 | ) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
15 | start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
16 | ) else (
17 | echo Error: Could not find MS Visual Studio ^(%VCVER%^)
18 | echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
19 | )
20 |
--------------------------------------------------------------------------------
/WPF_D3D/About.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/WPF_WinForms/About.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/run.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | Setlocal EnableDelayedExpansion
4 |
5 | if "%1" == "-h" (
6 | goto err_bat
7 | )
8 |
9 | if not ["%4"] == [""] (
10 | set "SampleName=%4"
11 | call "%~dp0env.bat" %1 %2 %3
12 | ) else if not ["%1"] == [""] (
13 | set "SampleName=%1"
14 | call "%~dp0env.bat"
15 | ) else (
16 | goto err_bat
17 | )
18 |
19 | if not exist "%~dp0%BIN_DIR%\IE_%SampleName%.exe" goto err_exe
20 |
21 | "%~dp0%BIN_DIR%\IE_%SampleName%.exe"
22 |
23 | goto eof
24 |
25 | :err_bat
26 | echo Possible names of samples: WinForms, WPF_D3D, WPF_WinForms
27 | echo Launch selected sample as follows:
28 | echo %~n0.bat [^vc10^|^vc11^|^vc12^|^vc14^] [^win32^|^win64^] [^Release^|^Debug^] [^SampleName^]
29 | echo or
30 | echo %~n0.bat [^SampleName^]
31 | echo Run %~n0.bat -h to get this help
32 | exit /B
33 |
34 | :err_exe
35 | echo Executable %~dp0%BIN_DIR%\IE_%SampleName%.exe not found.
36 | echo Check that OCCT and sample are built with the selected configuration:
37 | echo compiler=%VCVER% platform=win%ARCH% %3
38 | exit /B
39 |
40 | :eof
41 |
--------------------------------------------------------------------------------
/msvc_D3D.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | Setlocal EnableDelayedExpansion
4 |
5 | rem Setup environment
6 | call "%~dp0env.bat" %1 %2 %3
7 |
8 | if NOT DEFINED DXSDK_DIR (
9 | if /I "%VCVER%" == "vc9" (
10 | echo ERROR: DirectX SDK is required in order to build the sample but it is not found in your system. Please install DirectX SDK and retry.
11 | exit /B
12 | )
13 | if /I "%VCVER%" == "vc10" (
14 | echo ERROR: DirectX SDK is required in order to build the sample but it is not found in your system. Please install DirectX SDK and retry.
15 | exit /B
16 | )
17 | )
18 |
19 | rem Define path to project file
20 | set "PRJFILE=%~dp0\CSharp_D3D.sln"
21 |
22 | rem Launch Visual Studio - either professional (devenv) or Express, as available
23 | if exist "%DevEnvDir%\devenv.exe" (
24 | start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
25 | ) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
26 | start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
27 | ) else (
28 | echo Error: Could not find MS Visual Studio ^(%VCVER%^)
29 | echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
30 | )
31 |
--------------------------------------------------------------------------------
/WPF_D3D/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace IE_WPF_D3D.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WPF_D3D/MaterialDlg.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WPF_WinForms/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace IE_WPF_WinForms.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WPF_D3D/About.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Data;
7 | using System.Windows.Documents;
8 | using System.Windows.Input;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Imaging;
11 | using System.Windows.Shapes;
12 |
13 | namespace IE_WPF_D3D
14 | {
15 | ///
16 | /// Interaction logic for About.xaml
17 | ///
18 | public partial class AboutDialog : Window
19 | {
20 | public AboutDialog()
21 | {
22 | this.InitializeComponent();
23 |
24 | CommandBinding aBind_Ok = new CommandBinding( IECommands.AboutOk );
25 | aBind_Ok.Executed += OkCommand_Executed;
26 | aBind_Ok.CanExecute += OkCommand_CanExecute;
27 | CommandBindings.Add( aBind_Ok );
28 | }
29 |
30 | private void OkCommand_Executed( object sender, ExecutedRoutedEventArgs e )
31 | {
32 | this.Close();
33 | }
34 |
35 | private void OkCommand_CanExecute( object sender, CanExecuteRoutedEventArgs e )
36 | {
37 | e.CanExecute = true;
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/WPF_WinForms/MaterialDlg.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WPF_WinForms/About.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Data;
7 | using System.Windows.Documents;
8 | using System.Windows.Input;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Imaging;
11 | using System.Windows.Shapes;
12 |
13 | namespace IE_WPF_WinForms
14 | {
15 | ///
16 | /// Interaction logic for About.xaml
17 | ///
18 | public partial class AboutDialog : Window
19 | {
20 | public AboutDialog()
21 | {
22 | this.InitializeComponent();
23 |
24 | CommandBinding aBind_Ok = new CommandBinding( IECommands.AboutOk );
25 | aBind_Ok.Executed += OkCommand_Executed;
26 | aBind_Ok.CanExecute += OkCommand_CanExecute;
27 | CommandBindings.Add( aBind_Ok );
28 | }
29 |
30 | private void OkCommand_Executed( object sender, ExecutedRoutedEventArgs e )
31 | {
32 | this.Close();
33 | }
34 |
35 | private void OkCommand_CanExecute( object sender, CanExecuteRoutedEventArgs e )
36 | {
37 | e.CanExecute = true;
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2021 OPEN CASCADE SAS
2 |
3 | This project is part of the examples of the Open CASCADE Technology software library.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | include required OCCT headers
22 |
--------------------------------------------------------------------------------
/WinFormsVB/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' General Information about an assembly is controlled through the following
6 | ' set of attributes. Change these attribute values to modify the information
7 | ' associated with an assembly.
8 |
9 | ' Review the values of the assembly attributes
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
21 |
22 |
23 | ' Version information for an assembly consists of the following four values:
24 | '
25 | ' Major Version
26 | ' Minor Version
27 | ' Build Number
28 | ' Revision
29 | '
30 | ' You can specify all the values or you can default the Build and Revision Numbers
31 | ' by using the '*' as shown below:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/WinFormsVB/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/WinFormsVB/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
18 | ' or if you encounter build errors in this file, go to the Project Designer
19 | ' (go to Project Properties or double-click the My Project node in
20 | ' Solution Explorer), and make changes on the Application tab.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = false
28 | Me.EnableVisualStyles = true
29 | Me.SaveMySettingsOnExit = true
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.IE_WinForms.Form1
36 | End Sub
37 | End Class
38 | End Namespace
39 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | .gitattributes eol=lf
2 | .gitignore eol=lf
3 | *.txt eol=lf
4 | *.h eol=lf
5 | *.c eol=lf
6 | *.inl eol=lf
7 | *.cpp eol=lf
8 | *.cxx eol=lf
9 | *.gxx eol=lf
10 | *.hxx eol=lf
11 | *.ixx eol=lf
12 | *.jxx eol=lf
13 | *.lxx eol=lf
14 | *.pxx eol=lf
15 | *.cl eol=lf
16 | *.cdl eol=lf
17 | *.edl eol=lf
18 | *.yacc eol=lf
19 | *.lex eol=lf
20 | *.mm eol=lf
21 | *.i eol=lf
22 | *.el eol=lf
23 | *.sh eol=lf
24 | *.csh eol=lf
25 | *.tcl eol=lf
26 | *.workspace eol=lf
27 | *.cbp eol=lf
28 | *.svg eol=lf
29 | *.xib eol=lf
30 | *.plist eol=lf
31 | *.java eol=lf
32 | *.igs eol=lf
33 | *.iges eol=lf
34 | *.stp eol=lf
35 | *.step eol=lf
36 | *.brep eol=lf
37 | *.rle eol=lf
38 | *.vrml eol=lf
39 | *.md eol=lf
40 | *.natvis eol=lf
41 | *.fs eol=lf
42 | *.vs eol=lf
43 | *.glsl eol=lf
44 | FILES eol=lf
45 | PACKAGES eol=lf
46 | EXTERNLIB eol=lf
47 | UDLIST eol=lf
48 | tests/* eol=lf
49 | tests/*/* eol=lf
50 | tests/*/*/* eol=lf
51 | adm/upgrade.dat eol=lf
52 | *.bat eol=crlf
53 | *.cmd eol=crlf
54 | *.rc eol=crlf
55 | *.cs eol=crlf
56 | *.def eol=crlf
57 | *.iss eol=crlf
58 | *.ini eol=crlf
59 | *.lng eol=crlf
60 | *.vcproj eol=crlf
61 | *.csproj eol=crlf
62 | *.vcxproj* eol=crlf
63 | *.sln eol=crlf
64 | *.res eol=crlf
65 | *.resx eol=crlf
66 | *.dll binary
67 | *.so binary
68 | *.dylib binary
69 | *.7z binary
70 | *.pdf binary
71 | *.png binary
72 | *.jpg binary
73 | *.bmp binary
74 | *.gif binary
75 | *.xwd binary
76 | *.ico binary
77 | *.icns binary
78 | *.std binary
79 | *.gz binary
80 | *.doc binary
81 | *.rgb binary
82 | *.mft binary
83 | *.stl binary
84 |
--------------------------------------------------------------------------------
/CSharp_D3D.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 11.00
2 | # Visual Studio 2010
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF_D3D", "WPF_D3D\IE_WPF_D3D.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}"
4 | EndProject
5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy_D3D", "OCCTProxy_D3D\OCCTProxy_D3D.vcxproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
6 | EndProject
7 | Global
8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
9 | Debug|Win32 = Debug|Win32
10 | Debug|x64 = Debug|x64
11 | Release|Win32 = Release|Win32
12 | Release|x64 = Release|x64
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86
16 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86
17 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64
18 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64
19 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86
20 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86
21 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64
22 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64
23 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32
24 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32
25 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64
26 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64
27 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32
28 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32
29 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64
30 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64
31 | EndGlobalSection
32 | GlobalSection(SolutionProperties) = preSolution
33 | HideSolutionNode = FALSE
34 | EndGlobalSection
35 | EndGlobal
36 |
--------------------------------------------------------------------------------
/WinForms/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/WinFormsVB/My Project/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/WPF_D3D/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("IE")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("IE")]
15 | [assembly: AssemblyCopyright("Copyright © 2013")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/WPF_WinForms/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("IE")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("IE")]
15 | [assembly: AssemblyCopyright("Copyright © 2013")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/WinFormsVB/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'This class was auto-generated by the StronglyTypedResourceBuilder
19 | 'class via a tool like ResGen or Visual Studio.
20 | 'To add or remove a member, edit your .ResX file then rerun ResGen
21 | 'with the /str option, or rebuild your VS project.
22 | '''
23 | ''' A strongly-typed resource class, for looking up localized strings, etc.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Returns the cached ResourceManager instance used by this class.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("IE_WinForms.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Overrides the current thread's CurrentUICulture property for all
51 | ''' resource lookups using this strongly typed resource class.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/WPF_D3D/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace IE_WPF_D3D.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IE_WPF_D3D.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/WPF_WinForms/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace IE_WPF_WinForms.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IE_WPF_WinForms.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/WPF_D3D/MaterialDlg.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Data;
7 | using System.Windows.Documents;
8 | using System.Windows.Input;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Imaging;
11 | using System.Windows.Shapes;
12 |
13 | namespace IE_WPF_D3D
14 | {
15 | public enum Material
16 | {
17 | Brass,
18 | Bronze,
19 | Copper,
20 | Gold,
21 | Pewter,
22 | Plaster,
23 | Plastic,
24 | Silver
25 | }
26 |
27 | ///
28 | /// Interaction logic for MaterialDlg.xaml
29 | ///
30 | public partial class MaterialDlg : Window
31 | {
32 | public MaterialDlg( OCCTProxyD3D theView )
33 | {
34 | this.InitializeComponent();
35 |
36 | if ( theView == null )
37 | {
38 | MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" );
39 | }
40 |
41 | View = theView;
42 |
43 | SetInitialState();
44 | }
45 |
46 | public OCCTProxyD3D View { get; private set; }
47 |
48 | private void PlasterBtn_Checked( object sender, RoutedEventArgs e )
49 | {
50 | View.SetMaterial( (int)Material.Plaster );
51 | View.UpdateCurrentViewer();
52 | }
53 |
54 | private void BrassBtn_Checked( object sender, RoutedEventArgs e )
55 | {
56 | View.SetMaterial( (int)Material.Brass );
57 | View.UpdateCurrentViewer();
58 | }
59 |
60 | private void BronzeBtn_Checked( object sender, RoutedEventArgs e )
61 | {
62 | View.SetMaterial( (int)Material.Bronze );
63 | View.UpdateCurrentViewer();
64 | }
65 |
66 | private void CopperBtn_Checked( object sender, RoutedEventArgs e )
67 | {
68 | View.SetMaterial( (int)Material.Copper );
69 | View.UpdateCurrentViewer();
70 | }
71 |
72 | private void GoldBtn_Checked( object sender, RoutedEventArgs e )
73 | {
74 | View.SetMaterial( (int)Material.Gold );
75 | View.UpdateCurrentViewer();
76 | }
77 |
78 | private void PewterBtn_Checked( object sender, RoutedEventArgs e )
79 | {
80 | View.SetMaterial( (int)Material.Pewter );
81 | View.UpdateCurrentViewer();
82 | }
83 |
84 | private void PlasticBtn_Checked( object sender, RoutedEventArgs e )
85 | {
86 | View.SetMaterial( (int)Material.Plastic );
87 | View.UpdateCurrentViewer();
88 | }
89 |
90 | private void SilverBtn_Checked( object sender, RoutedEventArgs e )
91 | {
92 | View.SetMaterial( (int)Material.Silver );
93 | View.UpdateCurrentViewer();
94 | }
95 |
96 | private void SetInitialState()
97 | {
98 | // TODO
99 | }
100 | }
101 | }
--------------------------------------------------------------------------------
/WPF_WinForms/MaterialDlg.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Data;
7 | using System.Windows.Documents;
8 | using System.Windows.Input;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Imaging;
11 | using System.Windows.Shapes;
12 |
13 | namespace IE_WPF_WinForms
14 | {
15 | public enum Material
16 | {
17 | Brass,
18 | Bronze,
19 | Copper,
20 | Gold,
21 | Pewter,
22 | Plaster,
23 | Plastic,
24 | Silver
25 | }
26 |
27 | ///
28 | /// Interaction logic for MaterialDlg.xaml
29 | ///
30 | public partial class MaterialDlg : Window
31 | {
32 | public MaterialDlg( OCCTProxy theView )
33 | {
34 | this.InitializeComponent();
35 |
36 | if ( theView == null )
37 | {
38 | MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" );
39 | }
40 |
41 | View = theView;
42 |
43 | SetInitialState();
44 | }
45 |
46 | public OCCTProxy View { get; private set; }
47 |
48 | private void PlasterBtn_Checked( object sender, RoutedEventArgs e )
49 | {
50 | View.SetMaterial( (int)Material.Plaster );
51 | View.UpdateCurrentViewer();
52 | }
53 |
54 | private void BrassBtn_Checked( object sender, RoutedEventArgs e )
55 | {
56 | View.SetMaterial( (int)Material.Brass );
57 | View.UpdateCurrentViewer();
58 | }
59 |
60 | private void BronzeBtn_Checked( object sender, RoutedEventArgs e )
61 | {
62 | View.SetMaterial( (int)Material.Bronze );
63 | View.UpdateCurrentViewer();
64 | }
65 |
66 | private void CopperBtn_Checked( object sender, RoutedEventArgs e )
67 | {
68 | View.SetMaterial( (int)Material.Copper );
69 | View.UpdateCurrentViewer();
70 | }
71 |
72 | private void GoldBtn_Checked( object sender, RoutedEventArgs e )
73 | {
74 | View.SetMaterial( (int)Material.Gold );
75 | View.UpdateCurrentViewer();
76 | }
77 |
78 | private void PewterBtn_Checked( object sender, RoutedEventArgs e )
79 | {
80 | View.SetMaterial( (int)Material.Pewter );
81 | View.UpdateCurrentViewer();
82 | }
83 |
84 | private void PlasticBtn_Checked( object sender, RoutedEventArgs e )
85 | {
86 | View.SetMaterial( (int)Material.Plastic );
87 | View.UpdateCurrentViewer();
88 | }
89 |
90 | private void SilverBtn_Checked( object sender, RoutedEventArgs e )
91 | {
92 | View.SetMaterial( (int)Material.Silver );
93 | View.UpdateCurrentViewer();
94 | }
95 |
96 | private void SetInitialState()
97 | {
98 | // TODO
99 | }
100 | }
101 | }
--------------------------------------------------------------------------------
/WinFormsVB/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "My.Settings Auto-Save Functionality"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.IE_WinForms.My.MySettings
68 | Get
69 | Return Global.IE_WinForms.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/WPF_D3D/IECommands.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System;
24 | using System.Collections.Generic;
25 | using System.Linq;
26 | using System.Text;
27 | using System.Windows.Input;
28 |
29 | namespace IE_WPF_D3D
30 | {
31 | public class IECommands
32 | {
33 | public static RoutedUICommand New { get; private set; }
34 | public static RoutedUICommand Close { get; private set; }
35 | public static RoutedUICommand Quit { get; private set; }
36 | public static RoutedUICommand About { get; private set; }
37 | public static RoutedUICommand AboutOk { get; private set; }
38 |
39 | static IECommands()
40 | {
41 | #region menu
42 |
43 | InputGestureCollection inputsNew = new InputGestureCollection();
44 | inputsNew.Add( new KeyGesture( Key.N, ModifierKeys.Control, "Ctrl + N" ) );
45 | New = new RoutedUICommand( "New", "New", typeof(IECommands), inputsNew );
46 |
47 | Close = new RoutedUICommand( "Close", "Close", typeof(IECommands) );
48 |
49 | InputGestureCollection inputsQuit = new InputGestureCollection();
50 | inputsQuit.Add( new KeyGesture( Key.F4, ModifierKeys.Alt, "Alt + F4" ) );
51 | Quit = new RoutedUICommand( "Quit", "Quit", typeof(IECommands), inputsQuit );
52 |
53 | InputGestureCollection inputsAbout = new InputGestureCollection();
54 | inputsAbout.Add( new KeyGesture( Key.F1 ) );
55 | About = new RoutedUICommand( "About", "About", typeof(IECommands), inputsAbout );
56 |
57 | #endregion
58 |
59 | #region aboutDlg
60 | InputGestureCollection inputsAboutOk = new InputGestureCollection();
61 | inputsAboutOk.Add( new KeyGesture( Key.Enter ) );
62 | AboutOk = new RoutedUICommand( "AboutOk", "AboutOk", typeof(IECommands), inputsAboutOk );
63 | #endregion
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/WPF_WinForms/IECommands.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System;
24 | using System.Collections.Generic;
25 | using System.Linq;
26 | using System.Text;
27 | using System.Windows.Input;
28 |
29 | namespace IE_WPF_WinForms
30 | {
31 | public class IECommands
32 | {
33 | public static RoutedUICommand New { get; private set; }
34 | public static RoutedUICommand Close { get; private set; }
35 | public static RoutedUICommand Quit { get; private set; }
36 | public static RoutedUICommand About { get; private set; }
37 | public static RoutedUICommand AboutOk { get; private set; }
38 |
39 | static IECommands()
40 | {
41 | #region menu
42 |
43 | InputGestureCollection inputsNew = new InputGestureCollection();
44 | inputsNew.Add( new KeyGesture( Key.N, ModifierKeys.Control, "Ctrl + N" ) );
45 | New = new RoutedUICommand( "New", "New", typeof(IECommands), inputsNew );
46 |
47 | Close = new RoutedUICommand( "Close", "Close", typeof(IECommands) );
48 |
49 | InputGestureCollection inputsQuit = new InputGestureCollection();
50 | inputsQuit.Add( new KeyGesture( Key.F4, ModifierKeys.Alt, "Alt + F4" ) );
51 | Quit = new RoutedUICommand( "Quit", "Quit", typeof(IECommands), inputsQuit );
52 |
53 | InputGestureCollection inputsAbout = new InputGestureCollection();
54 | inputsAbout.Add( new KeyGesture( Key.F1 ) );
55 | About = new RoutedUICommand( "About", "About", typeof(IECommands), inputsAbout );
56 |
57 | #endregion
58 |
59 | #region aboutDlg
60 | InputGestureCollection inputsAboutOk = new InputGestureCollection();
61 | inputsAboutOk.Add( new KeyGesture( Key.Enter ) );
62 | AboutOk = new RoutedUICommand( "AboutOk", "AboutOk", typeof(IECommands), inputsAboutOk );
63 | #endregion
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/CSharp.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 11.00
2 | # Visual Studio 2010
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF_WinForms", "WPF_WinForms\IE_WPF_WinForms.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}"
4 | EndProject
5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WinForms", "WinForms\IE_WinForms.csproj", "{B9914BB3-B886-4B41-B48D-350EBEBEFD1F}"
6 | EndProject
7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy", "OCCTProxy\OCCTProxy.vcxproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
8 | EndProject
9 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "IE_WinFormsVB", "WinFormsVB\IE_WinFormsVB.vbproj", "{9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}"
10 | EndProject
11 | Global
12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
13 | Debug|Win32 = Debug|Win32
14 | Debug|x64 = Debug|x64
15 | Release|Win32 = Release|Win32
16 | Release|x64 = Release|x64
17 | EndGlobalSection
18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86
20 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86
21 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64
22 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64
23 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86
24 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86
25 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64
26 | {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64
27 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.ActiveCfg = Debug|x86
28 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.Build.0 = Debug|x86
29 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.ActiveCfg = Debug|x64
30 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.Build.0 = Debug|x64
31 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.ActiveCfg = Release|x86
32 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.Build.0 = Release|x86
33 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.ActiveCfg = Release|x64
34 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.Build.0 = Release|x64
35 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32
36 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32
37 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64
38 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64
39 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32
40 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32
41 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64
42 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64
43 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}.Debug|Win32.ActiveCfg = Debug|x86
44 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}.Debug|Win32.Build.0 = Debug|x86
45 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}.Debug|x64.ActiveCfg = Debug|x64
46 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}.Debug|x64.Build.0 = Debug|x64
47 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}.Release|Win32.ActiveCfg = Release|x86
48 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}.Release|Win32.Build.0 = Release|x86
49 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}.Release|x64.ActiveCfg = Release|x64
50 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}.Release|x64.Build.0 = Release|x64
51 | EndGlobalSection
52 | GlobalSection(SolutionProperties) = preSolution
53 | HideSolutionNode = FALSE
54 | EndGlobalSection
55 | EndGlobal
56 |
--------------------------------------------------------------------------------
/ReadMe.md:
--------------------------------------------------------------------------------
1 | OCCT .NET sample
2 | ==================
3 |
4 | This sample demonstrates how to use OCCT libraries in .NET application written in **CSharp** or **VB.NET** (Visual Basic .NET)
5 | and using **Windows Forms** or **Windows Presentation Foundation** (WPF).
6 |
7 | The connection between .NET and OCCT (C++) level is provided by proxy library **OCCProxy**, written in C++/CLI.
8 | The proxy library contains a single *ref* class encapsulating OCCT viewer and providing the functionality to manipulate this viewer
9 | and to import / export OCCT shapes from / to several supported CAD file formats (IGES, STEP, BREP).
10 |
11 | 
12 |
13 | The sample implements two approaches to the development of a user interface with .NET.
14 | Both applications provide the same functionality as the standard OCCT Import/Export sample.
15 | The first project is called *IE_WinForms* and uses Windows Forms for GUI.
16 | The second application is called *IE_WPF_WinForms* and uses Windows Presentation Foundation.
17 | The third project is called *IE_WinFormsVB* is written in VB.NET and uses Windows Forms for GUI.
18 |
19 | Note a few important details:
20 |
21 | - OCCT template class *NCollection_Haft* is used to encapsulate C++ class into a field of *ref* class.
22 |
23 | - It is necessary to explicitly set the target platform for C# assemblies to *x86*
24 | in project **Properties - Build** to work consistently on 64-bit systems with OCCT libraries built in 32-bit mode.
25 |
26 | - This sample demonstrates indirect method of wrapping C++ to C# using a manually created proxy library.
27 | There is an alternative method of wrapping individual OCCT classes to C# equivalents to make their full API available to a C# user
28 | and to let the code be programmed on C# level similarly to C++ one.
29 | See the description of **OCCT C# Wrapper** in **Advanced Samples and Tools** at
30 | http://www.opencascade.org/support/products/advsamples
31 |
32 | - In WPF sample, **WinForms** control is used to encapsulate OCC viewer since WPF does not provide the necessary interface to embed OpenGL view.
33 | Other possible solution could be to render OpenGL scene in an off-screen buffer and to map it
34 | to WPF control as an image. That approach would allow using all WPF features to control the OCCT viewer.
35 |
36 | Run *msvc.bat* to start MS Visual Studio for building the sample.
37 | Note that project files are provided only for VS 2010, you can open them in
38 | newer versions of Visual Studio the using automatic converter.
39 |
40 | After conversion check option **Target framework** in the properties of C# projects
41 | (tab **Application**) to make sure that it corresponds to the version set in
42 | the properties of C++ projects (e.g. .Net Framework 4.0 for VS 2010).
43 |
44 | Run *run_winforms.bat* or *run_wpf.bat* to launch the corresponding sample.
45 |
46 | Note that all batch scripts use the configuration defined in OCCT *custom.bat* file
47 | as default; you can provide arguments specifying VS version, bitness, and mode to override these settings, e.g.:
48 |
49 | > msvc.bat vc10 win64 Debug
50 |
51 | Direct3D .NET sample
52 | ==================
53 |
54 | This sample demonstrates how to use OCCT and DirectX libraries in .NET application
55 | written using **CSharp** and **Windows Presentation Foundation** (WPF).
56 |
57 | The proxy library **D3DProxy** contains helper methods for rendering via DirectX.
58 |
59 | The user interface in this sample is based on Windows Presentation Foundation (WPF).
60 | It has the same functionality as the standard OCCT Import/Export sample.
61 | The project is called *IE_WPF_D3D*.
62 |
63 | Run *msvc_D3D.bat* to start MS Visual Studio for building the sample.
64 | Run *run_wpf-D3D.bat* to launch the corresponding sample.
65 |
--------------------------------------------------------------------------------
/WinFormsVB/TransparencyDialog.vb:
--------------------------------------------------------------------------------
1 |
2 | Imports System.Drawing
3 | Imports System.Collections
4 | Imports System.ComponentModel
5 | Imports System.Windows.Forms
6 |
7 | 'Namespace IE_WinForms
8 | '''
9 | ''' Summary description for TransparencyDialog.
10 | '''
11 | Public Class TransparencyDialog
12 | Inherits System.Windows.Forms.Form
13 | Private MyTransparency As System.Windows.Forms.NumericUpDown
14 | '''
15 | ''' Required designer variable.
16 | '''
17 | Private components As System.ComponentModel.Container = Nothing
18 | Private myView As OCCTProxy
19 |
20 | Public Sub New()
21 | '
22 | ' Required for Windows Form Designer support
23 | '
24 | InitializeComponent()
25 |
26 | '
27 | ' TODO: Add any constructor code after InitializeComponent call
28 | '
29 | myView = Nothing
30 | End Sub
31 |
32 | '''
33 | ''' Clean up any resources being used.
34 | '''
35 | Protected Overrides Sub Dispose(disposing As Boolean)
36 | If disposing Then
37 | If components IsNot Nothing Then
38 | components.Dispose()
39 | End If
40 | End If
41 | MyBase.Dispose(disposing)
42 | End Sub
43 |
44 | #Region "Windows Form Designer generated code"
45 | '''
46 | ''' Required method for Designer support - do not modify
47 | ''' the contents of this method with the code editor.
48 | '''
49 | Private Sub InitializeComponent()
50 | Dim resources As New System.Resources.ResourceManager(GetType(TransparencyDialog))
51 | Me.MyTransparency = New System.Windows.Forms.NumericUpDown()
52 | DirectCast(Me.MyTransparency, System.ComponentModel.ISupportInitialize).BeginInit()
53 | Me.SuspendLayout()
54 | '
55 | ' MyTransparency
56 | '
57 | Me.MyTransparency.Location = New System.Drawing.Point(16, 16)
58 | Me.MyTransparency.Maximum = New System.Decimal(New Integer() {10, 0, 0, 0})
59 | Me.MyTransparency.Name = "MyTransparency"
60 | Me.MyTransparency.Size = New System.Drawing.Size(96, 20)
61 | Me.MyTransparency.TabIndex = 0
62 | AddHandler Me.MyTransparency.ValueChanged, AddressOf Me.MyTransparency_ValueChanged
63 | '
64 | ' TransparencyDialog
65 | '
66 | Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
67 | Me.ClientSize = New System.Drawing.Size(128, 53)
68 | Me.Controls.Add(Me.MyTransparency)
69 | Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
70 | Me.Icon = DirectCast(resources.GetObject("$this.Icon"), System.Drawing.Icon)
71 | Me.MaximizeBox = False
72 | Me.MinimizeBox = False
73 | Me.Name = "TransparencyDialog"
74 | Me.Text = "TransparencyDialog"
75 | DirectCast(Me.MyTransparency, System.ComponentModel.ISupportInitialize).EndInit()
76 | Me.ResumeLayout(False)
77 |
78 | End Sub
79 | #End Region
80 |
81 | Private Sub MyTransparency_ValueChanged(sender As Object, e As System.EventArgs)
82 | If Me.myView Is Nothing Then
83 | Return
84 | End If
85 | Dim transp As Integer = CInt(Me.MyTransparency.Value)
86 | Me.myView.SetTransparency(transp)
87 | End Sub
88 |
89 | Public WriteOnly Property View() As OCCTProxy
90 | Set(value As OCCTProxy)
91 | Me.myView = value
92 | End Set
93 | End Property
94 |
95 | End Class
96 | 'End Namespace
97 |
98 |
--------------------------------------------------------------------------------
/WinForms/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System.Reflection;
24 | using System.Runtime.CompilerServices;
25 |
26 | //
27 | // General Information about an assembly is controlled through the following
28 | // set of attributes. Change these attribute values to modify the information
29 | // associated with an assembly.
30 | //
31 | [assembly: AssemblyTitle("")]
32 | [assembly: AssemblyDescription("")]
33 | [assembly: AssemblyConfiguration("")]
34 | [assembly: AssemblyCompany("")]
35 | [assembly: AssemblyProduct("")]
36 | [assembly: AssemblyCopyright("")]
37 | [assembly: AssemblyTrademark("")]
38 | [assembly: AssemblyCulture("")]
39 |
40 | //
41 | // Version information for an assembly consists of the following four values:
42 | //
43 | // Major Version
44 | // Minor Version
45 | // Build Number
46 | // Revision
47 | //
48 | // You can specify all the values or you can default the Revision and Build Numbers
49 | // by using the '*' as shown below:
50 |
51 | [assembly: AssemblyVersion("1.0.*")]
52 |
53 | //
54 | // In order to sign your assembly you must specify a key to use. Refer to the
55 | // Microsoft .NET Framework documentation for more information on assembly signing.
56 | //
57 | // Use the attributes below to control which key is used for signing.
58 | //
59 | // Notes:
60 | // (*) If no key is specified, the assembly is not signed.
61 | // (*) KeyName refers to a key that has been installed in the Crypto Service
62 | // Provider (CSP) on your machine. KeyFile refers to a file which contains
63 | // a key.
64 | // (*) If the KeyFile and the KeyName values are both specified, the
65 | // following processing occurs:
66 | // (1) If the KeyName can be found in the CSP, that key is used.
67 | // (2) If the KeyName does not exist and the KeyFile does exist, the key
68 | // in the KeyFile is installed into the CSP and used.
69 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
70 | // When specifying the KeyFile, the location of the KeyFile should be
71 | // relative to the project output directory which is
72 | // %Project Directory%\obj\. For example, if your KeyFile is
73 | // located in the project directory, you would specify the AssemblyKeyFile
74 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
75 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
76 | // documentation for more information on this.
77 | //
78 | [assembly: AssemblyDelaySign(false)]
79 | [assembly: AssemblyKeyFile("")]
80 | [assembly: AssemblyKeyName("")]
81 |
--------------------------------------------------------------------------------
/WinForms/TransparencyDialog.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System;
24 | using System.Drawing;
25 | using System.Collections;
26 | using System.ComponentModel;
27 | using System.Windows.Forms;
28 |
29 | namespace IE_WinForms
30 | {
31 | ///
32 | /// Summary description for TransparencyDialog.
33 | ///
34 | public class TransparencyDialog : System.Windows.Forms.Form
35 | {
36 | private System.Windows.Forms.NumericUpDown MyTransparency;
37 | ///
38 | /// Required designer variable.
39 | ///
40 | private System.ComponentModel.Container components = null;
41 | private OCCTProxy myView;
42 |
43 | public TransparencyDialog()
44 | {
45 | //
46 | // Required for Windows Form Designer support
47 | //
48 | InitializeComponent();
49 |
50 | //
51 | // TODO: Add any constructor code after InitializeComponent call
52 | //
53 | myView = null;
54 | }
55 |
56 | ///
57 | /// Clean up any resources being used.
58 | ///
59 | protected override void Dispose(bool disposing)
60 | {
61 | if (disposing)
62 | {
63 | if (components != null)
64 | {
65 | components.Dispose();
66 | }
67 | }
68 | base.Dispose(disposing);
69 | }
70 |
71 | #region Windows Form Designer generated code
72 | ///
73 | /// Required method for Designer support - do not modify
74 | /// the contents of this method with the code editor.
75 | ///
76 | private void InitializeComponent()
77 | {
78 | System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog));
79 | this.MyTransparency = new System.Windows.Forms.NumericUpDown();
80 | ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit();
81 | this.SuspendLayout();
82 | //
83 | // MyTransparency
84 | //
85 | this.MyTransparency.Location = new System.Drawing.Point(16, 16);
86 | this.MyTransparency.Maximum = new System.Decimal(new int[] {
87 | 10,
88 | 0,
89 | 0,
90 | 0});
91 | this.MyTransparency.Name = "MyTransparency";
92 | this.MyTransparency.Size = new System.Drawing.Size(96, 20);
93 | this.MyTransparency.TabIndex = 0;
94 | this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged);
95 | //
96 | // TransparencyDialog
97 | //
98 | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
99 | this.ClientSize = new System.Drawing.Size(128, 53);
100 | this.Controls.Add(this.MyTransparency);
101 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
102 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
103 | this.MaximizeBox = false;
104 | this.MinimizeBox = false;
105 | this.Name = "TransparencyDialog";
106 | this.Text = "TransparencyDialog";
107 | ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit();
108 | this.ResumeLayout(false);
109 |
110 | }
111 | #endregion
112 |
113 | private void MyTransparency_ValueChanged(object sender, System.EventArgs e)
114 | {
115 | if (this.myView == null)
116 | return;
117 | int transp = (int)this.MyTransparency.Value;
118 | this.myView.SetTransparency(transp);
119 | }
120 |
121 | public OCCTProxy View
122 | {
123 | set
124 | {
125 | this.myView = value;
126 | }
127 | }
128 |
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/WPF_D3D/TransparencyDialog.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System;
24 | using System.Drawing;
25 | using System.Collections;
26 | using System.ComponentModel;
27 | using System.Windows.Forms;
28 |
29 | namespace IE_WPF_D3D
30 | {
31 | ///
32 | /// Summary description for TransparencyDialog.
33 | ///
34 | public class TransparencyDialog : System.Windows.Forms.Form
35 | {
36 | private System.Windows.Forms.NumericUpDown MyTransparency;
37 | ///
38 | /// Required designer variable.
39 | ///
40 | private System.ComponentModel.Container components = null;
41 | private OCCTProxyD3D myView;
42 |
43 | public TransparencyDialog()
44 | {
45 | //
46 | // Required for Windows Form Designer support
47 | //
48 | InitializeComponent();
49 |
50 | //
51 | // TODO: Add any constructor code after InitializeComponent call
52 | //
53 | myView = null;
54 | }
55 |
56 | ///
57 | /// Clean up any resources being used.
58 | ///
59 | protected override void Dispose(bool disposing)
60 | {
61 | if (disposing)
62 | {
63 | if (components != null)
64 | {
65 | components.Dispose();
66 | }
67 | }
68 | base.Dispose(disposing);
69 | }
70 |
71 | #region Windows Form Designer generated code
72 | ///
73 | /// Required method for Designer support - do not modify
74 | /// the contents of this method with the code editor.
75 | ///
76 | private void InitializeComponent()
77 | {
78 | System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog));
79 | this.MyTransparency = new System.Windows.Forms.NumericUpDown();
80 | ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit();
81 | this.SuspendLayout();
82 | //
83 | // MyTransparency
84 | //
85 | this.MyTransparency.Location = new System.Drawing.Point(16, 16);
86 | this.MyTransparency.Maximum = new System.Decimal(new int[] {
87 | 10,
88 | 0,
89 | 0,
90 | 0});
91 | this.MyTransparency.Name = "MyTransparency";
92 | this.MyTransparency.Size = new System.Drawing.Size(96, 20);
93 | this.MyTransparency.TabIndex = 0;
94 | this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged);
95 | //
96 | // TransparencyDialog
97 | //
98 | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
99 | this.ClientSize = new System.Drawing.Size(128, 53);
100 | this.Controls.Add(this.MyTransparency);
101 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
102 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
103 | this.MaximizeBox = false;
104 | this.MinimizeBox = false;
105 | this.Name = "TransparencyDialog";
106 | this.Text = "TransparencyDialog";
107 | ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit();
108 | this.ResumeLayout(false);
109 |
110 | }
111 | #endregion
112 |
113 | private void MyTransparency_ValueChanged(object sender, System.EventArgs e)
114 | {
115 | if (this.myView == null)
116 | return;
117 | int transp = (int)this.MyTransparency.Value;
118 | this.myView.SetTransparency(transp);
119 | }
120 |
121 | public OCCTProxyD3D View
122 | {
123 | set
124 | {
125 | this.myView = value;
126 | }
127 | }
128 |
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/WPF_WinForms/TransparencyDialog.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System;
24 | using System.Drawing;
25 | using System.Collections;
26 | using System.ComponentModel;
27 | using System.Windows.Forms;
28 |
29 | namespace IE_WPF_WinForms
30 | {
31 | ///
32 | /// Summary description for TransparencyDialog.
33 | ///
34 | public class TransparencyDialog : System.Windows.Forms.Form
35 | {
36 | private System.Windows.Forms.NumericUpDown MyTransparency;
37 | ///
38 | /// Required designer variable.
39 | ///
40 | private System.ComponentModel.Container components = null;
41 | private OCCTProxy myView;
42 |
43 | public TransparencyDialog()
44 | {
45 | //
46 | // Required for Windows Form Designer support
47 | //
48 | InitializeComponent();
49 |
50 | //
51 | // TODO: Add any constructor code after InitializeComponent call
52 | //
53 | myView = null;
54 | }
55 |
56 | ///
57 | /// Clean up any resources being used.
58 | ///
59 | protected override void Dispose(bool disposing)
60 | {
61 | if (disposing)
62 | {
63 | if (components != null)
64 | {
65 | components.Dispose();
66 | }
67 | }
68 | base.Dispose(disposing);
69 | }
70 |
71 | #region Windows Form Designer generated code
72 | ///
73 | /// Required method for Designer support - do not modify
74 | /// the contents of this method with the code editor.
75 | ///
76 | private void InitializeComponent()
77 | {
78 | System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TransparencyDialog));
79 | this.MyTransparency = new System.Windows.Forms.NumericUpDown();
80 | ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).BeginInit();
81 | this.SuspendLayout();
82 | //
83 | // MyTransparency
84 | //
85 | this.MyTransparency.Location = new System.Drawing.Point(16, 16);
86 | this.MyTransparency.Maximum = new System.Decimal(new int[] {
87 | 10,
88 | 0,
89 | 0,
90 | 0});
91 | this.MyTransparency.Name = "MyTransparency";
92 | this.MyTransparency.Size = new System.Drawing.Size(96, 20);
93 | this.MyTransparency.TabIndex = 0;
94 | this.MyTransparency.ValueChanged += new System.EventHandler(this.MyTransparency_ValueChanged);
95 | //
96 | // TransparencyDialog
97 | //
98 | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
99 | this.ClientSize = new System.Drawing.Size(128, 53);
100 | this.Controls.Add(this.MyTransparency);
101 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
102 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
103 | this.MaximizeBox = false;
104 | this.MinimizeBox = false;
105 | this.Name = "TransparencyDialog";
106 | this.Text = "TransparencyDialog";
107 | ((System.ComponentModel.ISupportInitialize)(this.MyTransparency)).EndInit();
108 | this.ResumeLayout(false);
109 |
110 | }
111 | #endregion
112 |
113 | private void MyTransparency_ValueChanged(object sender, System.EventArgs e)
114 | {
115 | if (this.myView == null)
116 | return;
117 | int transp = (int)this.MyTransparency.Value;
118 | this.myView.SetTransparency(transp);
119 | }
120 |
121 | public OCCTProxy View
122 | {
123 | set
124 | {
125 | this.myView = value;
126 | }
127 | }
128 |
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/WinFormsVB/AboutDialog.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class AboutDialog
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AboutDialog))
26 | Me.label4 = New System.Windows.Forms.Label()
27 | Me.label3 = New System.Windows.Forms.Label()
28 | Me.myVersion = New System.Windows.Forms.Label()
29 | Me.label1 = New System.Windows.Forms.Label()
30 | Me.button1 = New System.Windows.Forms.Button()
31 | Me.pictureBox1 = New System.Windows.Forms.PictureBox()
32 | CType(Me.pictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
33 | Me.SuspendLayout()
34 | '
35 | 'label4
36 | '
37 | Me.label4.Location = New System.Drawing.Point(-6, 191)
38 | Me.label4.Name = "label4"
39 | Me.label4.Size = New System.Drawing.Size(296, 24)
40 | Me.label4.TabIndex = 11
41 | Me.label4.Text = "http://www.opencascade.com"
42 | Me.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
43 | '
44 | 'label3
45 | '
46 | Me.label3.Location = New System.Drawing.Point(10, 159)
47 | Me.label3.Name = "label3"
48 | Me.label3.Size = New System.Drawing.Size(280, 23)
49 | Me.label3.TabIndex = 10
50 | Me.label3.Text = "Copyright (C) 2004-2013, Open CASCADE S.A.S"
51 | Me.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
52 | '
53 | 'myVersion
54 | '
55 | Me.myVersion.Location = New System.Drawing.Point(2, 23)
56 | Me.myVersion.Name = "myVersion"
57 | Me.myVersion.Size = New System.Drawing.Size(288, 16)
58 | Me.myVersion.TabIndex = 9
59 | Me.myVersion.Text = "Open CASCADE Technology "
60 | Me.myVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
61 | '
62 | 'label1
63 | '
64 | Me.label1.Location = New System.Drawing.Point(2, 0)
65 | Me.label1.Name = "label1"
66 | Me.label1.Size = New System.Drawing.Size(288, 24)
67 | Me.label1.TabIndex = 8
68 | Me.label1.Text = "Import/Export Sample,"
69 | Me.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
70 | '
71 | 'button1
72 | '
73 | Me.button1.Location = New System.Drawing.Point(82, 239)
74 | Me.button1.Name = "button1"
75 | Me.button1.Size = New System.Drawing.Size(128, 24)
76 | Me.button1.TabIndex = 7
77 | Me.button1.Text = "OK"
78 | '
79 | 'pictureBox1
80 | '
81 | Me.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
82 | Me.pictureBox1.Image = CType(resources.GetObject("pictureBox1.Image"), System.Drawing.Image)
83 | Me.pictureBox1.Location = New System.Drawing.Point(45, 55)
84 | Me.pictureBox1.Name = "pictureBox1"
85 | Me.pictureBox1.Size = New System.Drawing.Size(196, 102)
86 | Me.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize
87 | Me.pictureBox1.TabIndex = 6
88 | Me.pictureBox1.TabStop = False
89 | '
90 | 'AboutDialog
91 | '
92 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
93 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
94 | Me.ClientSize = New System.Drawing.Size(284, 262)
95 | Me.Controls.Add(Me.label4)
96 | Me.Controls.Add(Me.label3)
97 | Me.Controls.Add(Me.myVersion)
98 | Me.Controls.Add(Me.label1)
99 | Me.Controls.Add(Me.button1)
100 | Me.Controls.Add(Me.pictureBox1)
101 | Me.Name = "AboutDialog"
102 | Me.Text = "About Import/Export Sample"
103 | CType(Me.pictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
104 | Me.ResumeLayout(False)
105 | Me.PerformLayout()
106 |
107 | End Sub
108 | Private WithEvents label4 As System.Windows.Forms.Label
109 | Private WithEvents label3 As System.Windows.Forms.Label
110 | Private WithEvents myVersion As System.Windows.Forms.Label
111 | Private WithEvents label1 As System.Windows.Forms.Label
112 | Private WithEvents button1 As System.Windows.Forms.Button
113 | Private WithEvents pictureBox1 As System.Windows.Forms.PictureBox
114 | End Class
115 |
--------------------------------------------------------------------------------
/WPF_D3D/D3DViewer.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System;
24 | using System.Windows;
25 | using System.Windows.Media;
26 | using System.Windows.Interop;
27 | using System.Runtime.InteropServices;
28 |
29 | namespace IE_WPF_D3D
30 | {
31 | ///
32 | /// Tool object for output OCCT rendering with Direct3D.
33 | ///
34 | class D3DViewer
35 | {
36 | /// Direct3D output image.
37 | private D3DImage myD3DImage = new D3DImage ();
38 |
39 | /// Direct3D color surface.
40 | private IntPtr myColorSurf;
41 |
42 | public OCCViewer Viewer;
43 |
44 | /// Creates new Direct3D-based OCCT viewer.
45 | public D3DViewer ()
46 | {
47 | myD3DImage.IsFrontBufferAvailableChanged
48 | += new DependencyPropertyChangedEventHandler (OnIsFrontBufferAvailableChanged);
49 |
50 | BeginRenderingScene ();
51 | }
52 |
53 | /// Creates new Direct3D-based OCCT viewer.
54 | private void OnIsFrontBufferAvailableChanged (object sender, DependencyPropertyChangedEventArgs e)
55 | {
56 | // If the front buffer is available, then WPF has just created a new
57 | // Direct3D device, thus we need to start rendering our custom scene
58 | if (myD3DImage.IsFrontBufferAvailable)
59 | {
60 | BeginRenderingScene ();
61 | }
62 | else
63 | {
64 | // If the front buffer is no longer available, then WPF has lost Direct3D
65 | // device, thus we need to stop rendering until the new device is created
66 | StopRenderingScene ();
67 | }
68 | }
69 |
70 | private bool myIsFailed = false;
71 |
72 | /// Initializes Direct3D-OCCT rendering.
73 | private void BeginRenderingScene ()
74 | {
75 | if (myIsFailed)
76 | {
77 | return;
78 | }
79 |
80 | if (myD3DImage.IsFrontBufferAvailable)
81 | {
82 | Viewer = new OCCViewer();
83 |
84 | if (!Viewer.InitViewer())
85 | {
86 | MessageBox.Show ("Failed to initialize OpenGL-Direct3D interoperability!",
87 | "Error", MessageBoxButton.OK, MessageBoxImage.Error);
88 |
89 | myIsFailed = true;
90 | return;
91 | }
92 |
93 | // Leverage the Rendering event of WPF composition
94 | // target to update the our custom Direct3D scene
95 | CompositionTarget.Rendering += OnRendering;
96 | }
97 | }
98 |
99 | /// Releases Direct3D-OCCT rendering.
100 | public void StopRenderingScene ()
101 | {
102 | // This method is called when WPF loses its Direct3D device,
103 | // so we should just release our custom Direct3D scene
104 | CompositionTarget.Rendering -= OnRendering;
105 | myColorSurf = IntPtr.Zero;
106 | }
107 |
108 | /// Performs Direct3D-OCCT rendering.
109 | private void OnRendering (object sender, EventArgs e)
110 | {
111 | UpdateScene ();
112 | }
113 |
114 | /// Performs Direct3D-OCCT rendering.
115 | private void UpdateScene ()
116 | {
117 | if (!myIsFailed
118 | && myD3DImage.IsFrontBufferAvailable
119 | && myColorSurf != IntPtr.Zero
120 | && (myD3DImage.PixelWidth != 0 && myD3DImage.PixelHeight != 0))
121 | {
122 | myD3DImage.Lock ();
123 | {
124 | // Update the scene (via a call into our custom library)
125 | Viewer.View.RedrawView ();
126 |
127 | // Invalidate the updated region of the D3DImage
128 | myD3DImage.AddDirtyRect(new Int32Rect(0, 0, myD3DImage.PixelWidth, myD3DImage.PixelHeight));
129 | }
130 | myD3DImage.Unlock ();
131 | }
132 | }
133 |
134 | /// Resizes Direct3D surfaces and OpenGL FBO.
135 | public void Resize (int theSizeX, int theSizeY)
136 | {
137 | if (!myIsFailed && myD3DImage.IsFrontBufferAvailable)
138 | {
139 | // Set the back buffer for Direct3D WPF image
140 | myD3DImage.Lock ();
141 | {
142 | myD3DImage.SetBackBuffer (D3DResourceType.IDirect3DSurface9, IntPtr.Zero);
143 | myColorSurf = Viewer.View.ResizeBridgeFBO (theSizeX, theSizeY);
144 | myD3DImage.SetBackBuffer (D3DResourceType.IDirect3DSurface9, myColorSurf);
145 | }
146 | myD3DImage.Unlock ();
147 | }
148 | }
149 |
150 | public D3DImage Image
151 | {
152 | get
153 | {
154 | return myD3DImage;
155 | }
156 | }
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/WPF_D3D/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/WinFormsVB/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/WPF_WinForms/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/WinFormsVB/Form2.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WinFormsVB/MaterialDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WinFormsVB/TransparencyDialog.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/WinForms/AboutDialog.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System;
24 | using System.Drawing;
25 | using System.Collections;
26 | using System.ComponentModel;
27 | using System.Windows.Forms;
28 |
29 | namespace IE_WinForms
30 | {
31 | ///
32 | /// Summary description for AboutDialog.
33 | ///
34 | public class AboutDialog : System.Windows.Forms.Form
35 | {
36 | private System.Windows.Forms.PictureBox pictureBox1;
37 | private System.Windows.Forms.Button button1;
38 | private System.Windows.Forms.Label label1;
39 | private System.Windows.Forms.Label label3;
40 | private System.Windows.Forms.Label label4;
41 | private System.Windows.Forms.Label myVersion;
42 | ///
43 | /// Required designer variable.
44 | ///
45 | private System.ComponentModel.Container components = null;
46 |
47 | public AboutDialog()
48 | {
49 | //
50 | // Required for Windows Form Designer support
51 | //
52 | InitializeComponent();
53 | //
54 | // Create OCCT proxy object and get OCCT version
55 | //
56 | OCCTProxy t = new OCCTProxy();
57 | t.InitOCCTProxy();
58 | float version = t.GetOCCVersion();
59 | this.myVersion.Text = this.myVersion.Text + version;
60 | }
61 |
62 | ///
63 | /// Clean up any resources being used.
64 | ///
65 | protected override void Dispose(bool disposing)
66 | {
67 | if (disposing)
68 | {
69 | if (components != null)
70 | {
71 | components.Dispose();
72 | }
73 | }
74 | base.Dispose(disposing);
75 | }
76 |
77 | #region Windows Form Designer generated code
78 | ///
79 | /// Required method for Designer support - do not modify
80 | /// the contents of this method with the code editor.
81 | ///
82 | private void InitializeComponent()
83 | {
84 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDialog));
85 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
86 | this.button1 = new System.Windows.Forms.Button();
87 | this.label1 = new System.Windows.Forms.Label();
88 | this.myVersion = new System.Windows.Forms.Label();
89 | this.label3 = new System.Windows.Forms.Label();
90 | this.label4 = new System.Windows.Forms.Label();
91 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
92 | this.SuspendLayout();
93 | //
94 | // pictureBox1
95 | //
96 | this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
97 | this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
98 | this.pictureBox1.Location = new System.Drawing.Point(59, 64);
99 | this.pictureBox1.Name = "pictureBox1";
100 | this.pictureBox1.Size = new System.Drawing.Size(196, 102);
101 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
102 | this.pictureBox1.TabIndex = 0;
103 | this.pictureBox1.TabStop = false;
104 | //
105 | // button1
106 | //
107 | this.button1.Location = new System.Drawing.Point(96, 248);
108 | this.button1.Name = "button1";
109 | this.button1.Size = new System.Drawing.Size(128, 24);
110 | this.button1.TabIndex = 1;
111 | this.button1.Text = "OK";
112 | this.button1.Click += new System.EventHandler(this.button1_Click);
113 | //
114 | // label1
115 | //
116 | this.label1.Location = new System.Drawing.Point(16, 9);
117 | this.label1.Name = "label1";
118 | this.label1.Size = new System.Drawing.Size(288, 24);
119 | this.label1.TabIndex = 2;
120 | this.label1.Text = "Import/Export Sample,";
121 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
122 | //
123 | // myVersion
124 | //
125 | this.myVersion.Location = new System.Drawing.Point(16, 32);
126 | this.myVersion.Name = "myVersion";
127 | this.myVersion.Size = new System.Drawing.Size(288, 16);
128 | this.myVersion.TabIndex = 3;
129 | this.myVersion.Text = "Open CASCADE Technology ";
130 | this.myVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
131 | //
132 | // label3
133 | //
134 | this.label3.Location = new System.Drawing.Point(24, 168);
135 | this.label3.Name = "label3";
136 | this.label3.Size = new System.Drawing.Size(280, 23);
137 | this.label3.TabIndex = 4;
138 | this.label3.Text = "Copyright (C) 2004-2013, Open CASCADE S.A.S";
139 | this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
140 | //
141 | // label4
142 | //
143 | this.label4.Location = new System.Drawing.Point(8, 200);
144 | this.label4.Name = "label4";
145 | this.label4.Size = new System.Drawing.Size(296, 24);
146 | this.label4.TabIndex = 5;
147 | this.label4.Text = "http://www.opencascade.com";
148 | this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
149 | //
150 | // AboutDialog
151 | //
152 | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
153 | this.ClientSize = new System.Drawing.Size(312, 285);
154 | this.ControlBox = false;
155 | this.Controls.Add(this.label4);
156 | this.Controls.Add(this.label3);
157 | this.Controls.Add(this.myVersion);
158 | this.Controls.Add(this.label1);
159 | this.Controls.Add(this.button1);
160 | this.Controls.Add(this.pictureBox1);
161 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
162 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
163 | this.MaximizeBox = false;
164 | this.MinimizeBox = false;
165 | this.Name = "AboutDialog";
166 | this.Text = "About Import/Export Sample";
167 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
168 | this.ResumeLayout(false);
169 | this.PerformLayout();
170 |
171 | }
172 | #endregion
173 |
174 | private void button1_Click(object sender, System.EventArgs e)
175 | {
176 | this.Close();
177 | }
178 | }
179 | }
180 |
--------------------------------------------------------------------------------
/WinFormsVB/IE_WinFormsVB.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 |
7 |
8 | 2.0
9 | {9E81422F-6CF5-4A47-B5FD-4F50127ABFF2}
10 | WinExe
11 | IE_WinForms.My.MyApplication
12 | IE_WinForms
13 | IE_WinFormsVB
14 | 512
15 | WindowsForms
16 | v4.0
17 |
18 |
19 |
20 |
21 | x86
22 | true
23 | full
24 | true
25 | true
26 | ..\win32\vc10\bind\
27 | IE_WinFormsVB.xml
28 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
29 |
30 |
31 | x86
32 | pdbonly
33 | false
34 | true
35 | true
36 | ..\win32\vc10\bin\
37 | IE_WinFormsVB.xml
38 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
39 |
40 |
41 | On
42 |
43 |
44 | Binary
45 |
46 |
47 | Off
48 |
49 |
50 | On
51 |
52 |
53 | true
54 | true
55 | true
56 | ..\win64\vc10\bind\
57 | IE_WinFormsVB.xml
58 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
59 | full
60 | x64
61 | false
62 | false
63 | false
64 |
65 |
66 | true
67 | ..\win64\vc10\bin\
68 | IE_WinFormsVB.xml
69 | true
70 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
71 | pdbonly
72 | x64
73 |
74 |
75 | My Project\app.manifest
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 | Form1.vb
103 |
104 |
105 | Form
106 |
107 |
108 | Form2.vb
109 |
110 |
111 | Form
112 |
113 |
114 | AboutDialog.vb
115 |
116 |
117 | Form
118 |
119 |
120 | MaterialDialog.vb
121 |
122 |
123 | Form
124 |
125 |
126 |
127 | True
128 | Application.myapp
129 |
130 |
131 | True
132 | True
133 | Resources.resx
134 |
135 |
136 | True
137 | Settings.settings
138 | True
139 |
140 |
141 | TransparencyDialog.vb
142 |
143 |
144 | Form
145 |
146 |
147 |
148 |
149 | AboutDialog.vb
150 |
151 |
152 | Form1.vb
153 |
154 |
155 | Form2.vb
156 |
157 |
158 | MaterialDialog.vb
159 |
160 |
161 | VbMyResourcesResXFileCodeGenerator
162 | Resources.Designer.vb
163 | My.Resources
164 | Designer
165 |
166 |
167 | TransparencyDialog.vb
168 |
169 |
170 |
171 |
172 |
173 |
174 | MyApplicationCodeGenerator
175 | Application.Designer.vb
176 |
177 |
178 | SettingsSingleFileGenerator
179 | My
180 | Settings.Designer.vb
181 |
182 |
183 |
184 |
185 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}
186 | OCCTProxy
187 |
188 |
189 |
190 |
197 |
--------------------------------------------------------------------------------
/WinFormsVB/MaterialDialog.vb:
--------------------------------------------------------------------------------
1 |
2 | Imports System.Drawing
3 | Imports System.Collections
4 | Imports System.ComponentModel
5 | Imports System.Windows.Forms
6 |
7 | 'Namespace IE_WinForms
8 | '''
9 | ''' Summary description for MaterialDialog.
10 | '''
11 | Public Class MaterialDialog
12 | Inherits System.Windows.Forms.Form
13 | '''
14 | ''' Required designer variable.
15 | '''
16 | Private components As System.ComponentModel.Container = Nothing
17 |
18 | Public Sub New()
19 | '
20 | ' Required for Windows Form Designer support
21 | '
22 | InitializeComponent()
23 |
24 | '
25 | ' TODO: Add any constructor code after InitializeComponent call
26 | '
27 | Me.myView = Nothing
28 | End Sub
29 |
30 | '''
31 | ''' Clean up any resources being used.
32 | '''
33 | Protected Overrides Sub Dispose(disposing As Boolean)
34 | If disposing Then
35 | If components IsNot Nothing Then
36 | components.Dispose()
37 | End If
38 | End If
39 | MyBase.Dispose(disposing)
40 | End Sub
41 |
42 | #Region "Windows Form Designer generated code"
43 | '''
44 | ''' Required method for Designer support - do not modify
45 | ''' the contents of this method with the code editor.
46 | '''
47 | Private Sub InitializeComponent()
48 | Dim resources As New System.Resources.ResourceManager(GetType(MaterialDialog))
49 | Me.BTN_PLASTER = New System.Windows.Forms.Button()
50 | Me.BTN_BRASS = New System.Windows.Forms.Button()
51 | Me.BTN_BRONZE = New System.Windows.Forms.Button()
52 | Me.BTN_COPPER = New System.Windows.Forms.Button()
53 | Me.BTN_GOLD = New System.Windows.Forms.Button()
54 | Me.BTN_PEWTER = New System.Windows.Forms.Button()
55 | Me.BTN_PLASTIC = New System.Windows.Forms.Button()
56 | Me.BTN_SILVER = New System.Windows.Forms.Button()
57 | Me.SuspendLayout()
58 | '
59 | ' BTN_PLASTER
60 | '
61 | Me.BTN_PLASTER.Location = New System.Drawing.Point(16, 8)
62 | Me.BTN_PLASTER.Name = "BTN_PLASTER"
63 | Me.BTN_PLASTER.Size = New System.Drawing.Size(80, 24)
64 | Me.BTN_PLASTER.TabIndex = 0
65 | Me.BTN_PLASTER.Text = "Plaster"
66 | AddHandler Me.BTN_PLASTER.Click, AddressOf Me.button1_Click
67 | '
68 | ' BTN_BRASS
69 | '
70 | Me.BTN_BRASS.Location = New System.Drawing.Point(16, 40)
71 | Me.BTN_BRASS.Name = "BTN_BRASS"
72 | Me.BTN_BRASS.Size = New System.Drawing.Size(80, 24)
73 | Me.BTN_BRASS.TabIndex = 1
74 | Me.BTN_BRASS.Text = "Brass"
75 | AddHandler Me.BTN_BRASS.Click, AddressOf Me.BTN_BRASS_Click
76 | '
77 | ' BTN_BRONZE
78 | '
79 | Me.BTN_BRONZE.Location = New System.Drawing.Point(16, 72)
80 | Me.BTN_BRONZE.Name = "BTN_BRONZE"
81 | Me.BTN_BRONZE.Size = New System.Drawing.Size(80, 24)
82 | Me.BTN_BRONZE.TabIndex = 2
83 | Me.BTN_BRONZE.Text = "Bronze"
84 | AddHandler Me.BTN_BRONZE.Click, AddressOf Me.BTN_BRONZE_Click
85 | '
86 | ' BTN_COPPER
87 | '
88 | Me.BTN_COPPER.Location = New System.Drawing.Point(16, 104)
89 | Me.BTN_COPPER.Name = "BTN_COPPER"
90 | Me.BTN_COPPER.Size = New System.Drawing.Size(80, 24)
91 | Me.BTN_COPPER.TabIndex = 3
92 | Me.BTN_COPPER.Text = "Copper"
93 | AddHandler Me.BTN_COPPER.Click, AddressOf Me.BTN_COPPER_Click
94 | '
95 | ' BTN_GOLD
96 | '
97 | Me.BTN_GOLD.Location = New System.Drawing.Point(16, 136)
98 | Me.BTN_GOLD.Name = "BTN_GOLD"
99 | Me.BTN_GOLD.Size = New System.Drawing.Size(80, 24)
100 | Me.BTN_GOLD.TabIndex = 4
101 | Me.BTN_GOLD.Text = "Gold"
102 | AddHandler Me.BTN_GOLD.Click, AddressOf Me.BTN_GOLD_Click
103 | '
104 | ' BTN_PEWTER
105 | '
106 | Me.BTN_PEWTER.Location = New System.Drawing.Point(16, 168)
107 | Me.BTN_PEWTER.Name = "BTN_PEWTER"
108 | Me.BTN_PEWTER.Size = New System.Drawing.Size(80, 24)
109 | Me.BTN_PEWTER.TabIndex = 5
110 | Me.BTN_PEWTER.Text = "Pewter"
111 | AddHandler Me.BTN_PEWTER.Click, AddressOf Me.BTN_PEWTER_Click
112 | '
113 | ' BTN_PLASTIC
114 | '
115 | Me.BTN_PLASTIC.Location = New System.Drawing.Point(16, 200)
116 | Me.BTN_PLASTIC.Name = "BTN_PLASTIC"
117 | Me.BTN_PLASTIC.Size = New System.Drawing.Size(80, 24)
118 | Me.BTN_PLASTIC.TabIndex = 6
119 | Me.BTN_PLASTIC.Text = "Plastic"
120 | AddHandler Me.BTN_PLASTIC.Click, AddressOf Me.BTN_PLASTIC_Click
121 | '
122 | ' BTN_SILVER
123 | '
124 | Me.BTN_SILVER.Location = New System.Drawing.Point(16, 232)
125 | Me.BTN_SILVER.Name = "BTN_SILVER"
126 | Me.BTN_SILVER.Size = New System.Drawing.Size(80, 24)
127 | Me.BTN_SILVER.TabIndex = 7
128 | Me.BTN_SILVER.Text = "Silver"
129 | AddHandler Me.BTN_SILVER.Click, AddressOf Me.BTN_SILVER_Click
130 | '
131 | ' MaterialDialog
132 | '
133 | Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
134 | Me.ClientSize = New System.Drawing.Size(112, 273)
135 | Me.Controls.Add(Me.BTN_SILVER)
136 | Me.Controls.Add(Me.BTN_PLASTIC)
137 | Me.Controls.Add(Me.BTN_PEWTER)
138 | Me.Controls.Add(Me.BTN_GOLD)
139 | Me.Controls.Add(Me.BTN_COPPER)
140 | Me.Controls.Add(Me.BTN_BRONZE)
141 | Me.Controls.Add(Me.BTN_BRASS)
142 | Me.Controls.Add(Me.BTN_PLASTER)
143 | Me.Icon = DirectCast(resources.GetObject("$this.Icon"), System.Drawing.Icon)
144 | Me.MaximizeBox = False
145 | Me.MinimizeBox = False
146 | Me.Name = "MaterialDialog"
147 | Me.Text = "MaterialDialog"
148 | Me.ResumeLayout(False)
149 |
150 | End Sub
151 | #End Region
152 |
153 | Private BTN_PLASTER As System.Windows.Forms.Button
154 | Private BTN_BRASS As System.Windows.Forms.Button
155 | Private BTN_BRONZE As System.Windows.Forms.Button
156 | Private BTN_COPPER As System.Windows.Forms.Button
157 | Private BTN_GOLD As System.Windows.Forms.Button
158 | Private BTN_PEWTER As System.Windows.Forms.Button
159 | Private BTN_PLASTIC As System.Windows.Forms.Button
160 | Private BTN_SILVER As System.Windows.Forms.Button
161 |
162 | Private myMaterial As Integer
163 | Private myView As OCCTProxy
164 |
165 | Private Sub button1_Click(sender As Object, e As System.EventArgs)
166 | Me.myMaterial = 5
167 | ChangeMaterial()
168 | End Sub
169 |
170 | Private Sub BTN_BRASS_Click(sender As Object, e As System.EventArgs)
171 | Me.myMaterial = 0
172 | ChangeMaterial()
173 | End Sub
174 |
175 | Private Sub BTN_BRONZE_Click(sender As Object, e As System.EventArgs)
176 | Me.myMaterial = 1
177 | ChangeMaterial()
178 | End Sub
179 |
180 | Private Sub BTN_COPPER_Click(sender As Object, e As System.EventArgs)
181 | Me.myMaterial = 2
182 | ChangeMaterial()
183 | End Sub
184 |
185 | Private Sub BTN_GOLD_Click(sender As Object, e As System.EventArgs)
186 | Me.myMaterial = 3
187 | ChangeMaterial()
188 | End Sub
189 |
190 | Private Sub BTN_PEWTER_Click(sender As Object, e As System.EventArgs)
191 | Me.myMaterial = 4
192 | ChangeMaterial()
193 | End Sub
194 |
195 | Private Sub BTN_PLASTIC_Click(sender As Object, e As System.EventArgs)
196 | Me.myMaterial = 6
197 | ChangeMaterial()
198 | End Sub
199 |
200 | Private Sub BTN_SILVER_Click(sender As Object, e As System.EventArgs)
201 | Me.myMaterial = 7
202 | ChangeMaterial()
203 | End Sub
204 |
205 | Public Property Material() As Integer
206 | Get
207 | Return Me.myMaterial
208 | End Get
209 | Set(value As Integer)
210 | Me.myMaterial = value
211 | End Set
212 | End Property
213 |
214 | Public Sub ChangeMaterial()
215 | If myView Is Nothing Then
216 | Return
217 | End If
218 | myView.SetMaterial(Me.myMaterial)
219 |
220 | End Sub
221 |
222 | Public WriteOnly Property View() As OCCTProxy
223 | Set(value As OCCTProxy)
224 | Me.myView = value
225 | End Set
226 | End Property
227 |
228 | End Class
229 | 'End Namespace
230 |
--------------------------------------------------------------------------------
/OCCTProxy/OCCTProxy.vcproj:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
15 |
18 |
19 |
20 |
21 |
22 |
31 |
34 |
37 |
40 |
43 |
46 |
57 |
60 |
63 |
66 |
80 |
83 |
86 |
89 |
92 |
95 |
98 |
101 |
102 |
111 |
114 |
117 |
120 |
123 |
127 |
138 |
141 |
144 |
147 |
161 |
164 |
167 |
170 |
173 |
176 |
179 |
182 |
183 |
192 |
195 |
198 |
201 |
204 |
207 |
215 |
218 |
221 |
224 |
238 |
241 |
244 |
247 |
250 |
253 |
256 |
259 |
260 |
269 |
272 |
275 |
278 |
281 |
285 |
293 |
296 |
299 |
302 |
316 |
319 |
322 |
325 |
328 |
331 |
334 |
337 |
338 |
339 |
340 |
341 |
342 |
347 |
350 |
351 |
352 |
357 |
358 |
363 |
364 |
365 |
366 |
367 |
368 |
--------------------------------------------------------------------------------
/WinForms/MaterialDialog.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 OPEN CASCADE SAS
2 | //
3 | // This file is part of the examples of the Open CASCADE Technology software library.
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
21 | // include required OCCT headers
22 |
23 | using System;
24 | using System.Drawing;
25 | using System.Collections;
26 | using System.ComponentModel;
27 | using System.Windows.Forms;
28 |
29 | namespace IE_WinForms
30 | {
31 | ///
32 | /// Summary description for MaterialDialog.
33 | ///
34 | public class MaterialDialog : System.Windows.Forms.Form
35 | {
36 | ///
37 | /// Required designer variable.
38 | ///
39 | private System.ComponentModel.Container components = null;
40 |
41 | public MaterialDialog()
42 | {
43 | //
44 | // Required for Windows Form Designer support
45 | //
46 | InitializeComponent();
47 |
48 | //
49 | // TODO: Add any constructor code after InitializeComponent call
50 | //
51 | this.myView = null;
52 | }
53 |
54 | ///
55 | /// Clean up any resources being used.
56 | ///
57 | protected override void Dispose(bool disposing)
58 | {
59 | if (disposing)
60 | {
61 | if (components != null)
62 | {
63 | components.Dispose();
64 | }
65 | }
66 | base.Dispose(disposing);
67 | }
68 |
69 | #region Windows Form Designer generated code
70 | ///
71 | /// Required method for Designer support - do not modify
72 | /// the contents of this method with the code editor.
73 | ///
74 | private void InitializeComponent()
75 | {
76 | System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MaterialDialog));
77 | this.BTN_PLASTER = new System.Windows.Forms.Button();
78 | this.BTN_BRASS = new System.Windows.Forms.Button();
79 | this.BTN_BRONZE = new System.Windows.Forms.Button();
80 | this.BTN_COPPER = new System.Windows.Forms.Button();
81 | this.BTN_GOLD = new System.Windows.Forms.Button();
82 | this.BTN_PEWTER = new System.Windows.Forms.Button();
83 | this.BTN_PLASTIC = new System.Windows.Forms.Button();
84 | this.BTN_SILVER = new System.Windows.Forms.Button();
85 | this.SuspendLayout();
86 | //
87 | // BTN_PLASTER
88 | //
89 | this.BTN_PLASTER.Location = new System.Drawing.Point(16, 8);
90 | this.BTN_PLASTER.Name = "BTN_PLASTER";
91 | this.BTN_PLASTER.Size = new System.Drawing.Size(80, 24);
92 | this.BTN_PLASTER.TabIndex = 0;
93 | this.BTN_PLASTER.Text = "Plaster";
94 | this.BTN_PLASTER.Click += new System.EventHandler(this.button1_Click);
95 | //
96 | // BTN_BRASS
97 | //
98 | this.BTN_BRASS.Location = new System.Drawing.Point(16, 40);
99 | this.BTN_BRASS.Name = "BTN_BRASS";
100 | this.BTN_BRASS.Size = new System.Drawing.Size(80, 24);
101 | this.BTN_BRASS.TabIndex = 1;
102 | this.BTN_BRASS.Text = "Brass";
103 | this.BTN_BRASS.Click += new System.EventHandler(this.BTN_BRASS_Click);
104 | //
105 | // BTN_BRONZE
106 | //
107 | this.BTN_BRONZE.Location = new System.Drawing.Point(16, 72);
108 | this.BTN_BRONZE.Name = "BTN_BRONZE";
109 | this.BTN_BRONZE.Size = new System.Drawing.Size(80, 24);
110 | this.BTN_BRONZE.TabIndex = 2;
111 | this.BTN_BRONZE.Text = "Bronze";
112 | this.BTN_BRONZE.Click += new System.EventHandler(this.BTN_BRONZE_Click);
113 | //
114 | // BTN_COPPER
115 | //
116 | this.BTN_COPPER.Location = new System.Drawing.Point(16, 104);
117 | this.BTN_COPPER.Name = "BTN_COPPER";
118 | this.BTN_COPPER.Size = new System.Drawing.Size(80, 24);
119 | this.BTN_COPPER.TabIndex = 3;
120 | this.BTN_COPPER.Text = "Copper";
121 | this.BTN_COPPER.Click += new System.EventHandler(this.BTN_COPPER_Click);
122 | //
123 | // BTN_GOLD
124 | //
125 | this.BTN_GOLD.Location = new System.Drawing.Point(16, 136);
126 | this.BTN_GOLD.Name = "BTN_GOLD";
127 | this.BTN_GOLD.Size = new System.Drawing.Size(80, 24);
128 | this.BTN_GOLD.TabIndex = 4;
129 | this.BTN_GOLD.Text = "Gold";
130 | this.BTN_GOLD.Click += new System.EventHandler(this.BTN_GOLD_Click);
131 | //
132 | // BTN_PEWTER
133 | //
134 | this.BTN_PEWTER.Location = new System.Drawing.Point(16, 168);
135 | this.BTN_PEWTER.Name = "BTN_PEWTER";
136 | this.BTN_PEWTER.Size = new System.Drawing.Size(80, 24);
137 | this.BTN_PEWTER.TabIndex = 5;
138 | this.BTN_PEWTER.Text = "Pewter";
139 | this.BTN_PEWTER.Click += new System.EventHandler(this.BTN_PEWTER_Click);
140 | //
141 | // BTN_PLASTIC
142 | //
143 | this.BTN_PLASTIC.Location = new System.Drawing.Point(16, 200);
144 | this.BTN_PLASTIC.Name = "BTN_PLASTIC";
145 | this.BTN_PLASTIC.Size = new System.Drawing.Size(80, 24);
146 | this.BTN_PLASTIC.TabIndex = 6;
147 | this.BTN_PLASTIC.Text = "Plastic";
148 | this.BTN_PLASTIC.Click += new System.EventHandler(this.BTN_PLASTIC_Click);
149 | //
150 | // BTN_SILVER
151 | //
152 | this.BTN_SILVER.Location = new System.Drawing.Point(16, 232);
153 | this.BTN_SILVER.Name = "BTN_SILVER";
154 | this.BTN_SILVER.Size = new System.Drawing.Size(80, 24);
155 | this.BTN_SILVER.TabIndex = 7;
156 | this.BTN_SILVER.Text = "Silver";
157 | this.BTN_SILVER.Click += new System.EventHandler(this.BTN_SILVER_Click);
158 | //
159 | // MaterialDialog
160 | //
161 | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
162 | this.ClientSize = new System.Drawing.Size(112, 273);
163 | this.Controls.Add(this.BTN_SILVER);
164 | this.Controls.Add(this.BTN_PLASTIC);
165 | this.Controls.Add(this.BTN_PEWTER);
166 | this.Controls.Add(this.BTN_GOLD);
167 | this.Controls.Add(this.BTN_COPPER);
168 | this.Controls.Add(this.BTN_BRONZE);
169 | this.Controls.Add(this.BTN_BRASS);
170 | this.Controls.Add(this.BTN_PLASTER);
171 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
172 | this.MaximizeBox = false;
173 | this.MinimizeBox = false;
174 | this.Name = "MaterialDialog";
175 | this.Text = "MaterialDialog";
176 | this.ResumeLayout(false);
177 |
178 | }
179 | #endregion
180 |
181 | private System.Windows.Forms.Button BTN_PLASTER;
182 | private System.Windows.Forms.Button BTN_BRASS;
183 | private System.Windows.Forms.Button BTN_BRONZE;
184 | private System.Windows.Forms.Button BTN_COPPER;
185 | private System.Windows.Forms.Button BTN_GOLD;
186 | private System.Windows.Forms.Button BTN_PEWTER;
187 | private System.Windows.Forms.Button BTN_PLASTIC;
188 | private System.Windows.Forms.Button BTN_SILVER;
189 |
190 | private int myMaterial;
191 | private OCCTProxy myView;
192 |
193 | private void button1_Click(object sender, System.EventArgs e)
194 | {
195 | this.myMaterial = 5;
196 | ChangeMaterial();
197 | }
198 |
199 | private void BTN_BRASS_Click(object sender, System.EventArgs e)
200 | {
201 | this.myMaterial = 0;
202 | ChangeMaterial();
203 | }
204 |
205 | private void BTN_BRONZE_Click(object sender, System.EventArgs e)
206 | {
207 | this.myMaterial = 1;
208 | ChangeMaterial();
209 | }
210 |
211 | private void BTN_COPPER_Click(object sender, System.EventArgs e)
212 | {
213 | this.myMaterial = 2;
214 | ChangeMaterial();
215 | }
216 |
217 | private void BTN_GOLD_Click(object sender, System.EventArgs e)
218 | {
219 | this.myMaterial = 3;
220 | ChangeMaterial();
221 | }
222 |
223 | private void BTN_PEWTER_Click(object sender, System.EventArgs e)
224 | {
225 | this.myMaterial = 4;
226 | ChangeMaterial();
227 | }
228 |
229 | private void BTN_PLASTIC_Click(object sender, System.EventArgs e)
230 | {
231 | this.myMaterial = 6;
232 | ChangeMaterial();
233 | }
234 |
235 | private void BTN_SILVER_Click(object sender, System.EventArgs e)
236 | {
237 | this.myMaterial = 7;
238 | ChangeMaterial();
239 | }
240 |
241 | public int Material
242 | {
243 | get
244 | {
245 | return this.myMaterial;
246 | }
247 | set
248 | {
249 | this.myMaterial = value;
250 | }
251 | }
252 |
253 | public void ChangeMaterial()
254 | {
255 | if (myView == null)
256 | return;
257 | myView.SetMaterial(this.myMaterial);
258 |
259 | }
260 |
261 | public OCCTProxy View
262 | {
263 | set
264 | {
265 | this.myView = value;
266 | }
267 | }
268 |
269 | }
270 | }
271 |
--------------------------------------------------------------------------------
/OCCTProxy_D3D/OCCTProxy_D3D.vcproj:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
15 |
18 |
19 |
20 |
21 |
22 |
31 |
34 |
37 |
40 |
43 |
46 |
58 |
61 |
64 |
67 |
81 |
84 |
87 |
90 |
93 |
96 |
99 |
102 |
103 |
112 |
115 |
118 |
121 |
124 |
128 |
140 |
143 |
146 |
149 |
163 |
166 |
169 |
172 |
175 |
178 |
181 |
184 |
185 |
194 |
197 |
200 |
203 |
206 |
209 |
217 |
220 |
223 |
226 |
240 |
243 |
246 |
249 |
252 |
255 |
258 |
261 |
262 |
271 |
274 |
277 |
280 |
283 |
287 |
295 |
298 |
301 |
304 |
318 |
321 |
324 |
327 |
330 |
333 |
336 |
339 |
340 |
341 |
342 |
343 |
344 |
349 |
352 |
353 |
354 |
359 |
360 |
365 |
366 |
367 |
368 |
369 |
370 |
--------------------------------------------------------------------------------
/WinForms/IE_WinForms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Local
5 | 9.0.30729
6 | 2.0
7 | {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}
8 | Debug
9 | AnyCPU
10 | App.ico
11 |
12 |
13 | IE_WinForms
14 |
15 |
16 | JScript
17 | Grid
18 | IE50
19 | false
20 | WinExe
21 | IE_WinForms
22 | OnBuildSuccess
23 |
24 |
25 |
26 |
27 |
28 |
29 | 3.5
30 | v4.0
31 |
32 | publish\
33 | true
34 | Disk
35 | false
36 | Foreground
37 | 7
38 | Days
39 | false
40 | false
41 | true
42 | 0
43 | 1.0.0.%2a
44 | false
45 | false
46 | true
47 |
48 |
49 | bin\Debug\
50 | false
51 | 285212672
52 | false
53 |
54 |
55 | DEBUG;TRACE
56 |
57 |
58 | true
59 | 4096
60 | false
61 |
62 |
63 | false
64 | false
65 | false
66 | false
67 | 4
68 | full
69 | prompt
70 |
71 |
72 | bin\Release\
73 | false
74 | 285212672
75 | false
76 |
77 |
78 | TRACE
79 |
80 |
81 | false
82 | 4096
83 | false
84 |
85 |
86 | true
87 | false
88 | false
89 | false
90 | 4
91 | none
92 | prompt
93 | Off
94 | x86
95 |
96 |
97 | true
98 | ..\win32\$(VCVER)\bind\
99 | DEBUG;TRACE
100 | 285212672
101 | full
102 | x86
103 | prompt
104 | Off
105 |
106 |
107 | ..\win32\$(VCVER)\bin\
108 | TRACE
109 | 285212672
110 | true
111 |
112 |
113 | x86
114 | Off
115 | prompt
116 |
117 |
118 | true
119 | ..\win64\$(VCVER)\bind\
120 | DEBUG;TRACE
121 | 285212672
122 | 4096
123 | full
124 | x64
125 | prompt
126 |
127 |
128 | ..\win64\$(VCVER)\bin\
129 | TRACE
130 | 285212672
131 | true
132 | 4096
133 | x64
134 | Off
135 | prompt
136 |
137 |
138 |
139 | System
140 |
141 |
142 |
143 | System.Data
144 |
145 |
146 | System.Drawing
147 |
148 |
149 |
150 | System.Windows.Forms
151 |
152 |
153 | System.XML
154 |
155 |
156 |
157 |
158 | Form
159 |
160 |
161 | Code
162 |
163 |
164 | Form
165 |
166 |
167 | Form
168 |
169 |
170 | Form
171 |
172 |
173 | Form
174 |
175 |
176 | AboutDialog.cs
177 | Designer
178 |
179 |
180 | Form1.cs
181 | Designer
182 |
183 |
184 | Form2.cs
185 | Designer
186 |
187 |
188 | MaterialDialog.cs
189 | Designer
190 |
191 |
192 | TransparencyDialog.cs
193 | Designer
194 |
195 |
196 |
197 |
198 |
199 |
200 | {969912D9-78E7-4AB8-B4FF-6B52B4F03991}
201 | OCCTProxy
202 |
203 |
204 |
205 |
206 | False
207 | Microsoft .NET Framework 4 %28x86 and x64%29
208 | true
209 |
210 |
211 | False
212 | .NET Framework 3.5 SP1 Client Profile
213 | false
214 |
215 |
216 | False
217 | .NET Framework 3.5 SP1
218 | false
219 |
220 |
221 | False
222 | Windows Installer 3.1
223 | true
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
--------------------------------------------------------------------------------