While demanding c++ language standard c++20, the error of OCCTProxy compilation is occured:
warning C4857: C++/CLI mode does not support C++ versions newer than C++17; setting language to /std:c++17
error C7681: two-phase name lookup is not supported for C++/CLI or C++/CX; use /Zc:twoPhase-
Officially, C++/CLI mode does not support C++ version newer than C++17, so we should not demand C++20 to compile csharp samples.
Alternative solution - using /permissive (ConformanceMode = false), rather than default value /permissive- (ConformanceMode = true)
option to compile OCCTProxy. But alternative solution has been denied.
So, here is nothing to do to fix compilation of OCCTProxy project.
Nevertheless, error occures in IE_WPF_WinForms and IE_WinForms - if we trying to compile with VC++ 2022 (not demanding c++20):
warning MSB3274: The primary reference "*\OCCTProxy.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.7.2" framework.
This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
To solve the problem it is proposed to demand by default the highest version of NETFramework - 4.8.
So, demanding NETFramework v4.8 does not crashing compilation of csharp samples with VC++ 2015.
Quantity_Factor, Quantity_Parameter, Quantity_Ratio, Quantity_Coefficient,
Quantity_PlaneAngle, Quantity_Length, V3d_Parameter and V3d_Coordinate
have been replaced by Standard_Real in visualization classes.
Possibility to customize layout of installation of OCCT is introduced by:
- variable INSTALL_DIR_LAYOUT - select one of the two predefined layouts: either Windows (classic OCCT layout) or Unix (Linux standard)
- variables INSTALL_DIR_* (BIN, LIB, INCLUDE, RESOURCE, DOC, TESTS, SCRIPT, SAMPLES, DATA) - specify locations of relevant components
- variable INSTALL_DIR_WITH_VERSION (bool) - specifies whether full version of OCCT should be used in paths in Unix layout
Files LICENSE_LGPL_21.txt and OCCT_LGPL_EXCEPTION.txt are always installed.
Environment is extended to support non-default layouts.
For that, environment variables "CSF_OCCT*Path" are defined, corresponding to CMake variables INSTALL_DIR_* described above.
Visual Studio environment, DRAW, tests, samples are amended to use these variables instead of (or as alternative to) CASROOT.
Settings of Products-specific vars are removed from environment scripts.
File genconf.bat was corrected to avoid error message for the case when path to TCL contains spaces.
Product name in rc files changed to "Open CASCADE Technology".
Output directory for binaries of CSharp samples was corrected.
Common run.bat was created for CSharp samples.
Behaviour of run.bat file from mfc samples was extended.
Recovered separate run_*.bat files for each sample in CSharp sample.
Support of old persistence (CSFDB format) is removed from OCCT samples (C#, MFC and Qt)
Motor model from data/csfdb is converted from CSFDB to BRep format and put to data/occ (Motor-c.brep)
Overall revision of of CSharp sample code:
- Pure C++ project "OCC" deleted as unnecessary
- C++/CLI project "shell" renamed to OCCTProxy and refactored to implement all required interface to OCCT functionality.
- In About dialog, date corrected in Copyright statement
- CSharp files re-layouted with 2 spaces indentation
- ReadMe converted to MarkDown format and revised
- Generation of names of views refactored to avoid calling C++ level
- Project files corrected to run on 64-bit systems
- Batch scripts refactored to use OCCT default configuration
WPF front-end added to demonstrate usage of OCCT in WPF applications.
WPF sample was modified, operation Export has been fixed
Exception "Cannot create this file", which appeared by export to image format, has been corrected.
Option "Export image to .xwd" removed.