Open CASCADE Technology
6.9.1
|
|
This sample demonstrates how to use OCCT and DirectX libraries in .Net application written using CSharp and Windows Presentation Foundation (WPF).
The connection between .Net, OCCT (C++) and DirectX level is provided by proxy libraries, OCCProxy and D3DProxy, written in C++/CLI. The proxy library OCCProxy contains a single ref class encapsulating OCCT viewer and providing the functionality to manipulate this viewer and to import / export OCCT shapes from / to several supported CAD file formats (IGES, STEP, BREP). The proxy library D3DProxy contains helper methods for rendering via DirectX.
The user interface in this sample is based on Windows Presentation Foundation (WPF). It has the same functionality as the standard OCCT Import/Export sample. The project is called IE_WPF_D3D.
Note a few important details:
Run msvc.bat to start MS Visual Studio for building the sample. Note that project files are provided only for VS 2010, you can open them in newer versions of Visual Studio using an automatic converter.
After conversion check option Target framework in the properties of C# projects (tab Application) to make sure that it corresponds to the version set in the properties of C++ projects (e.g. .Net Framework 4.0 for VS 2010).
Run run_wpf-D3D.bat to launch the corresponding sample.
Note that all batch scripts use the configuration defined in OCCT custom.bat file as default; you can provide arguments specifying VS version, bitness, and mode to override these settings, e.g.:
> msvc.bat vc10 win64 Debug