1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Compare commits

..

1 Commits

Author SHA1 Message Date
kgv
54c7f11b6b 0031129: Visualization - revise background / environment API 2021-09-26 13:20:12 +03:00
936 changed files with 3858 additions and 5691 deletions

View File

@@ -63,45 +63,30 @@ set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
# detect installed Visual Studio 2017+ instances by running vswhere.exe
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
lappend ::SYS_VC_LIST "vc141"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141) UWP"
lappend ::SYS_VC_LIST "vc141-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142)"
lappend ::SYS_VC_LIST "vc142"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142) UWP"
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143)"
lappend ::SYS_VC_LIST "vc143"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143) UWP"
lappend ::SYS_VC_LIST "vc143-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
# detect installed Visual Studio instances from global environment
@@ -190,16 +175,6 @@ proc wokdep:gui:SwitchArch {} {
grid .myFrame.myClose -row $::aRowIter -column 6 -columnspan 2
}
# update label text and visibility
font create wokdep:gui:EmptyFont -size -1
proc wokdep:gui:SetLabelText {theLabel theText} {
set aFont TkDefaultFont
if { $theText == "" } {
set aFont wokdep:gui:EmptyFont
}
$theLabel configure -text $theText -font $aFont
}
proc wokdep:gui:UpdateList {} {
set anIncErrs {}
set anLib32Errs {}
@@ -276,18 +251,16 @@ proc wokdep:gui:UpdateList {} {
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
.myFrame.myIncErrLbl configure -text [join $anIncErrs "\n"]
.myFrame.myLib32_ErrLbl configure -text [join $anLib32Errs "\n"]
.myFrame.myLib64_ErrLbl configure -text [join $anLib64Errs "\n"]
.myFrame.myBin32_ErrLbl configure -text [join $anBin32Errs "\n"]
.myFrame.myBin64_ErrLbl configure -text [join $anBin64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64_ErrLbl [join $anBin64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32D_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64D_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32D_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64D_ErrLbl [join $anBin64Errs "\n"]
.myFrame.myLib32D_ErrLbl configure -text [join $anLib32Errs "\n"]
.myFrame.myLib64D_ErrLbl configure -text [join $anLib64Errs "\n"]
.myFrame.myBin32D_ErrLbl configure -text [join $anBin32Errs "\n"]
.myFrame.myBin64D_ErrLbl configure -text [join $anBin64Errs "\n"]
# merge duplicates
set ::CSF_OPT_LIB32 [lsort -unique $::CSF_OPT_LIB32]

View File

@@ -260,7 +260,7 @@ proc genAllResources { theSrcDir } {
# Wrapper-function to generate VS project files
proc genproj {theFormat args} {
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "vc143" "vclang" "cbp" "xcd" "pro"}
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "vclang" "cbp" "xcd" "pro"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
@@ -324,7 +324,6 @@ proc genproj {theFormat args} {
vc14 - Visual Studio 2015
vc141 - Visual Studio 2017
vc142 - Visual Studio 2019
vc143 - Visual Studio 2022
vclang - Visual Studio with ClangCL toolset
cbp - CodeBlocks
xcd - XCode
@@ -561,7 +560,6 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl theSolution }
"vc14" -
"vc141" -
"vc142" -
"vc143" -
"vclang" { OS:MKVC $anOutDir $aModules $aTools $theSolution $theFormat $isUWP}
"cbp" { OS:MKCBP $anOutDir $aModules $theSolution $thePlatform $theCmpl }
"xcd" {
@@ -1016,8 +1014,8 @@ proc osutils:vcsolution:header { vcversion } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 2013\n"
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" ||
"$vcversion" == "vc142" || "$vcversion" == "vc143" || "$vcversion" == "vclang" } {
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" ||
"$vcversion" == "vc142" || "$vcversion" == "vclang" } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 14\n"
@@ -1292,9 +1290,6 @@ proc osutils:vcproj:readtemplate {theVcVer isUWP isExec} {
} elseif { $theVcVer == "vc142" } {
set aVCRTVer "vc14"
set aToolset "v142"
} elseif { $theVcVer == "vc143" } {
set aVCRTVer "vc14"
set aToolset "v143"
} elseif { $theVcVer == "vclang" } {
set aVCRTVer "vc14"
set aToolset "ClangCL"

View File

@@ -38,7 +38,6 @@ rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_PTHREADS=OFF"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
@@ -60,14 +59,9 @@ for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
set "aBuildTypePrefix=-debug"
)
call :cmakeGenerate
@@ -165,7 +159,6 @@ if ["%toCMake%"] == ["1"] (
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
@@ -263,7 +256,6 @@ if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
-D OpenCASCADE_DIR:PATH="%aDestDir%/lib/cmake/opencascade" ^

View File

@@ -24,6 +24,5 @@ rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "USE_RAPIDJSON=ON"
rem set "USE_RAPIDJSON=OFF"
rem set "USE_DRACO=ON"
rem set "USE_PTHREADS=ON"

View File

@@ -21,8 +21,6 @@ set "toInstall=1"
set "toDebug=0"
set "sourceMapBase="
set "USE_PTHREADS=OFF"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
@@ -32,14 +30,9 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
set "aBuildTypePrefix=-debug"
)
call :cmakeGenerate
@@ -71,7 +64,6 @@ if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
-D OpenCASCADE_DIR:PATH="%aDestDirOcct%/lib/cmake/opencascade" ^

View File

@@ -121,12 +121,8 @@ if not "%DevEnvDir%" == "" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "gcc" (
@@ -141,7 +137,6 @@ if not "%DevEnvDir%" == "" (
echo vc14 = VS 2015
echo vc141 = VS 2017
echo vc142 = VS 2019
echo vc143 = VS 2022
echo vclang = VS 2019 with ClangCL toolset
exit /B
)
@@ -172,15 +167,10 @@ if /I "%VCFMT%" == "vc9" (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v143"
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=ClangCL"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW

View File

@@ -3,25 +3,29 @@ Build OCCT {#build_upgrade__building_occt}
@tableofcontents
Before building OCCT, make sure to have all required third-party libraries installed.
@note Before building OCCT, make sure to have all required third-party libraries installed.
The list of required libraries depends on what OCCT modules will be used, and your preferences.
The typical minimum is **FreeType** (necessary for Visualization) and **Tcl/Tk** (for DRAW).
The typical minimum is **Freetype** (necessary for Visualization) and **Tcl/Tk** (for DRAW).
See @ref intro_req "requirements on 3rdparty libraries" for a full list.
On OS X we recommend to use native libraries.
The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to your target configuration,
from [Development Portal](https://dev.opencascade.org/resources/download/3rd-party-components).
You can also build third-party libraries from their sources, see @ref build_upgrade_building_3rdparty for instructions.
@section build_occt_windows Windows
On Linux and macOS we recommend to use libraries maintained by distributive developers, when possible.
@subsection build_occt_win_cmake Building with CMake tool
@section build_occt_win_cmake Building with CMake tool
This article describes the **CMake**-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources. *OCCT requires CMake version 2.8.12 or later*.
This chapter describes the [CMake](https://cmake.org/download/)-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources.
OCCT requires CMake version 2.8.12 or later.
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
However, CMake is cross-platform and can be used to build OCCT on Linux and OS X in essentially the same way.
@note Before you start, make sure to have installed all 3-rd party products that you are going to use with OCCT; see @ref build_upgrade.
@subsubsection build_cmake_start Start CMake
CMake is a tool that generates the actual project files for the selected target build system (e.g. Unix makefiles) or IDE (e.g. Visual Studio 2010).
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
However, CMake is cross-platform and can be used to build OCCT on Linux and macOS in essentially the same way.
For unexperienced users we recommend to start with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* can also be used.
CMake deals with three directories: source, build or binary and installation.
@@ -32,286 +36,272 @@ CMake deals with three directories: source, build or binary and installation.
The good practice is not to use the source directory as a build one.
Different configurations should be built in different build directories to avoid conflicts.
It is however possible to choose one installation directory for several configurations of OCCT (differentiated by platform, bitness, compiler and build type), for example:
d:/occt/ -- the source directory
d:/tmp/occt-build-vc10-x64 -- the build directory with the generated
solution and other intermediate files created during a CMake tool working
d:/occt-install -- the installation directory that is
able to contain several OCCT configurations
d:/occt/ - the source directory
d:/tmp/occt-build-vc10-x64 - the build directory with the generated
solution and other intermediate files created during a CMake tool working
d:/occt-install - the installation directory that is
able to contain several OCCT configurations
@subsubsection build_cmake_conf Configuration process
@subsection build_cmake_conf Configuration process
For unexperienced users we recommend to start with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* can also be used.
If the command-line tool is used, run the tool from the build directory with a single argument indicating the source (relative or absolute path) directory, and press *c* to configure:
If the command-line tool is used, run the tool from the build directory with a single argument indicating the source (relative or absolute path) directory:
cd d:/tmp/occt-build-vc10-x64
ccmake d:/occt
@figure{/build/build_occt/images/cmake_image000.png}
If the GUI tool is used, run this tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**:
Press *c* to configure.
All actions required in the configuration process with the GUI tool will be described below.
If the GUI tool is used, run this tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**.
@figure{/build/build_occt/images/cmake_image001.png}
@note Each configuration of the project should be built in its own directory.
When building multiple configurations it is suggested to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc10</i>).
**Note**: Each configuration of the project should be built in its own directory. When building multiple configurations it is recommended to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc10</i> ).
Once the source and build directories are selected, "Configure" button should be pressed in order to start manual configuration process.
It begins with selection of a target configurator. It is "Visual Studio 10 2010 Win64" in our example.
Once the source and build directories are selected, "Configure" button should be pressed in order to start manual configuration process. It begins with selection of a target configurator. It is "Visual Studio 10 2010 Win64" in our example.
@figure{/build/build_occt/images/cmake_image002.png}
@note To build OCCT for **Universal Windows Platform (UWP)** specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
Alternatively, if you are using CMake from the command line add options `-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0`.
Universal Windows Platform (UWP) is supported only on "Visual Studio 14 2015".
File `CASROOT/samples/xaml/ReadMe.md` describes the building procedure of XAML (UWP) sample.
To build OCCT for **Universal Windows Platform (UWP)** specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
Once "Finish" button is pressed, the first pass of the configuration process is executed.
At the end of the process, CMake outputs the list of environment variables, which have to be properly specified for successful configuration.
Alternatively, if you are using CMake from the command line add options -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 .
**Note**: Universal Windows Platform (UWP) is supported only on "Visual Studio 14 2015". File <i>d:/occt/samples/xaml/ReadMe.md</i> describes the building procedure of XAML (UWP) sample.
Once "Finish" button is pressed, the first pass of the configuration process is executed. At the end of the process, CMake outputs the list of environment variables, which have to be properly specified for successful configuration.
@figure{/build/build_occt/images/cmake_image003.png}
The error message provides some information about these variables.
This message will appear after each pass of the process until all required variables are specified correctly.
The error message provides some information about these variables. This message will appear after each pass of the process until all required variables are specified correctly.
The change of the state of some variables can lead to the appearance of new variables.
The new variables appeared after the pass of the configuration process are highlighted with red color by CMake GUI tool.
The change of the state of some variables can lead to the appearance of new variables. The new variables appeared after the pass of the configuration process are highlighted with red color by CMake GUI tool.
@note There is "grouped" option, which groups variables with a common prefix.
Note: There is "grouped" option, which groups variables with a common prefix.
The following table gives the full list of environment variables used at the configuration stage:
| Variable | Type | Purpose |
|----------|------|---------|
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREETYPE | Boolean | Indicates whether FreeType product should be used in OCCT for text rendering |
| USE_FREEIMAGE | Boolean | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
| USE_OPENVR | Boolean | Indicates whether OpenVR product should be used in OCCT visualization module for support of Virtual Reality |
| USE_OPENGL | Boolean | Indicates whether TKOpenGl graphic driver using OpenGL library (desktop) should be built within OCCT visualization module |
| USE_GLES2 | Boolean | Indicates whether TKOpenGles graphic driver using OpenGL ES library (embedded OpenGL) should be built within OCCT visualization module |
| USE_RAPIDJSON | Boolean | Indicates whether RapidJSON product should be used in OCCT Data Exchange module for support of glTF mesh file format |
| USE_DRACO | Boolean | Indicates whether Draco product should be used in OCCT Data Exchange module for support of Draco compression in glTF mesh file format |
| USE_TK | Boolean | Indicates whether Tcl/Tk product should be used in OCCT Draw Harness module for user interface (in addition to Tcl, which is mandatory for Draw Harness) |
| USE_TBB | Boolean | Indicates whether TBB (Threading Building Blocks) 3rd party is used or not. Note that OCCT remains parallel even without TBB product |
| USE_VTK | Boolean | Indicates whether VTK 3rd party is used or not. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREEIMAGE | Boolean flag | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
| USE_RAPIDJSON | Boolean flag | Indicates whether RapidJSON product should be used in OCCT Data Exchange module for support of glTF mesh file format |
| USE_TBB | Boolean flag | Indicates whether TBB 3rd party is used or not. TBB stands for Threading Building Blocks, the technology of Intel Corp, which comes with different mechanisms and patterns for injecting parallelism into your application. OCCT remains parallel even without TBB product |
| USE_VTK | Boolean flag | Indicates whether VTK 3rd party is used or not. VTK stands for Visualization ToolKit, the technology of Kitware Inc intended for general-purpose scientific visualization. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
| 3RDPARTY_DIR | Path | Defines the root directory where all required 3rd party products will be searched. Once you define this path it is very convenient to click "Configure" button in order to let CMake automatically detect all necessary products|
| 3RDPARTY_FREETYPE_* | Path | Path to FreeType binaries |
| 3RDPARTY_FREETYPE_* | Path | Path to Freetype binaries |
| 3RDPARTY_TCL_* 3RDPARTY_TK_* | Path | Path to Tcl/Tk binaries |
| 3RDPARTY_FREEIMAGE* | Path | Path to FreeImage binaries |
| 3RDPARTY_TBB* | Path | Path to TBB binaries |
| 3RDPARTY_FREEIMAGE* | Path | Path to Freeimage binaries |
| 3RDPARTY_TBB* | Path | Path to TBB binaries |
| 3RDPARTY_VTK_* | Path | Path to VTK binaries |
| BUILD_MODULE_<MODULE>| Boolean | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in @ref user_guides |
| BUILD_MODULE_<MODULE>| Boolean flag | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in @ref user_guides |
| BUILD_LIBRARY_TYPE | String | Specifies the type of library to be created. "Shared" libraries are linked dynamically and loaded at runtime. "Static" libraries are archives of object files used when linking other targets. Note that Draw Harness plugin system is incompatible with "Static" builds, and therefore it is disabled for these builds.|
| BUILD_ADDITIONAL_TOOLKITS | String | Semicolon-separated individual toolkits to include into build process. If you want to build some particular libraries (toolkits) only, then you may uncheck all modules in the corresponding *BUILD_MODUE_\<MODULE\>* options and provide the list of necessary libraries here. Of course, all dependencies will be resolved automatically |
| BUILD_YACCLEX | Boolean | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this option leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_SAMPLES_MFC | Boolean | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
| BUILD_SAMPLES_QT | Boolean | Indicates whether QT samples should be built together with OCCT. |
| BUILD_Inspector | Boolean | Indicates whether Inspector should be built together with OCCT. |
| BUILD_DOC_Overview | Boolean | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this option leads to automatic search of Doxygen binaries. Its building calls Doxygen command to generate the documentation in HTML format |
| BUILD_YACCLEX | Boolean flag | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this option leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_SAMPLES_MFC | Boolean flag | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
| BUILD_SAMPLES_QT | Boolean flag | Indicates whether QT samples should be built together with OCCT. |
| BUILD_Inspector | Boolean flag | Indicates whether Inspector should be built together with OCCT. |
| BUILD_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this option leads to automatic search of Doxygen binaries. Its building calls Doxygen command to generate the documentation in HTML format |
| BUILD_PATCH | Path | Points to the directory recognized as a "patch" for OCCT. If specified, the files from this directory take precedence over the corresponding native OCCT sources. This way you are able to introduce patches to Open CASCADE Technology not affecting the original source distribution |
| BUILD_WITH_DEBUG | Boolean | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| BUILD_WITH_DEBUG | Boolean flag | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean flag | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |
| INSTALL_DIR_SCRIPT | Path | Relative path to the scripts installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}) |
| INSTALL_DIR_LIB | Path | Relative path to the libraries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_LIB}) |
| INSTALL_DIR_INCLUDE | Path | Relative path to the includes installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}) |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |
| INSTALL_DIR_SCRIPT | Path | Relative path to the scripts installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}) |
| INSTALL_DIR_LIB | Path | Relative path to the libraries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_LIB}) |
| INSTALL_DIR_INCLUDE | Path | Relative path to the includes installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}) |
| INSTALL_DIR_RESOURCE | Path | Relative path to the resources installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}) |
| INSTALL_DIR_LAYOUT | String | Defines the structure of OCCT files (binaries, resources, headers, etc.) for the install directory. Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout). If needed, the layout can be customized with INSTALL_DIR_* variables |
| INSTALL_DIR_DATA | Path | Relative path to the data files installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DATA}) |
| INSTALL_DIR_SAMPLES | Path | Relative path to the samples installation directory. Note that only "samples/tcl" folder will be installed. (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}) |
| INSTALL_DIR_TESTS | Path | Relative path to the tests installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_TESTS}) |
| INSTALL_DIR_DOC | Path | Relative path to the documentation installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DOC}) |
| INSTALL_FREETYPE | Boolean | Indicates whether FreeType binaries should be installed into the installation directory |
| INSTALL_FREEIMAGE | Boolean | Indicates whether FreeImage binaries should be installed into the installation directory |
| INSTALL_TBB | Boolean | Indicates whether TBB binaries should be installed into the installation directory |
| INSTALL_VTK | Boolean | Indicates whether VTK binaries should be installed into the installation directory |
| INSTALL_TCL | Boolean | Indicates whether TCL binaries should be installed into the installation directory |
| INSTALL_TEST_CASES | Boolean | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
| INSTALL_DOC_Overview | Boolean | Indicates whether OCCT overview documentation should be installed into the installation directory |
| INSTALL_DIR_LAYOUT | String | Defines the structure of OCCT files (binaries, resources, headers, etc.) for the install directory. Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout). If needed, the layout can be customized with INSTALL_DIR_* variables |
| INSTALL_DIR_DATA | Path | Relative path to the data files installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DATA}) |
| INSTALL_DIR_SAMPLES | Path | Relative path to the samples installation directory. Note that only "samples/tcl" folder will be installed. (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}) |
| INSTALL_DIR_TESTS | Path | Relative path to the tests installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_TESTS}) |
| INSTALL_DIR_DOC | Path | Relative path to the documentation installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DOC}) |
| INSTALL_FREETYPE | Boolean flag | Indicates whether Freetype binaries should be installed into the installation directory |
| INSTALL_FREEIMAGE* | Boolean flag | Indicates whether Freeimage binaries should be installed into the installation directory |
| INSTALL_TBB | Boolean flag | Indicates whether TBB binaries should be installed into the installation directory |
| INSTALL_VTK | Boolean flag | Indicates whether VTK binaries should be installed into the installation directory |
| INSTALL_TCL | Boolean flag | Indicates whether TCL binaries should be installed into the installation directory |
| INSTALL_TEST_CASES | Boolean flag | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
| INSTALL_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation should be installed into the installation directory |
@note Only the forward slashes ("/") are acceptable in the CMake options defining paths.
**Note:** Only the forward slashes ("/") are acceptable in the CMake options defining paths.
@subsubsection build_cmake_3rdparty 3rd party search mechanism
If `3RDPARTY_DIR` directory is defined, then required 3rd party binaries are sought in it, and default system folders are ignored.
If *3RDPARTY_DIR* directory is defined, then required 3rd party binaries are sought in it, and default system folders are ignored.
The procedure expects to find binary and header files of each 3rd party product in its own sub-directory: *bin*, *lib* and *include*.
The results of the search (achieved on the next pass of the configuration process) are recorded in the corresponding variables:
* `3RDPARTY_<PRODUCT>_DIR` -- path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>);
* `3RDPARTY_<PRODUCT>_LIBRARY_DIR` -- path to the directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>);
* `3RDPARTY_<PRODUCT>_INCLUDE_DIR` -- path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>);
* `3RDPARTY_<PRODUCT>_DLL_DIR` -- path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is only relevant to Windows platforms.
* *3RDPARTY_\<PRODUCT\>_DIR* -- path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>)
* *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR* -- path to the directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>).
* *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* -- path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>)
* *3RDPARTY_\<PRODUCT\>_DLL_DIR* -- path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is only relevant to Windows platforms.
@note Each library and include directory should be children of the product directory if the last one is defined.
Note: each library and include directory should be children of the product directory if the last one is defined.
The search process is as follows:
1. Common path: `3RDPARTY_DIR`
2. Path to a particular 3rd-party library: `3RDPARTY_<PRODUCT>_DIR`
1. Common path: *3RDPARTY_DIR*
2. Path to a particular 3rd-party library: *3RDPARTY_\<PRODUCT\>_DIR*
3. Paths to headers and binaries:
1. `3RDPARTY_<PRODUCT>_INCLUDE_DIR`
2. `3RDPARTY_<PRODUCT>_LIBRARY_DIR`
3. `3RDPARTY_<PRODUCT>_DLL_DIR`
1. *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR*
2. *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR*
3. *3RDPARTY_\<PRODUCT\>_DLL_DIR*
If a variable of any level is not defined (empty or `<variable name>-NOTFOUND`) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step.
If the search process at level 3 does not find the required files, it seeks in default places.
If a variable of any level is not defined (empty or <i> \<variable name\>-NOTFOUND </i>) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step. If the search process at level 3 does not find the required files, it seeks in default places.
If a search result (include path, or library path, or dll path) does not meet your expectations, you can change `3RDPARTY_<PRODUCT>_*_DIR` variable,
clear (if they are not empty) `3RDPARTY_<PRODUCT>_DLL_DIR`, `3RDPARTY_<PRODUCT>_INCLUDE_DIR` and `3RDPARTY_<PRODUCT>_LIBRARY_DIR` variables (or clear one of them) and run the configuration process again.
If a search result (include path, or library path, or dll path) does not meet your expectations, you can change *3RDPARTY_\<PRODUCT\>_*_DIR variable*, clear (if they are not empty) *3RDPARTY_\<PRODUCT\>_DLL_DIR, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* and 3RDPARTY_\<PRODUCT\>_LIBRARY_DIR variables (or clear one of them) and run the configuration process again.
At this time the search will be performed in the newly identified directory and the result will be recorded to corresponding variables (replace old value if it is necessary).
For example, `3RDPARTY_FREETYPE_DIR` variable
At this time the search will be performed in the newly identified directory
and the result will be recorded to corresponding variables (replace old value if it is necessary).
For example, *3RDPARTY_FREETYPE_DIR* variable
d:/3rdparty/freetype-2.4.10
can be changed to
can be changed to
d:/3rdparty/freetype-2.5.3
During the configuration process the related variables (`3RDPARTY_FREETYPE_DLL_DIR`, `3RDPARTY_FREETYPE_INCLUDE_DIR` and `3RDPARTY_FREETYPE_LIBRARY_DIR`) will be filled with new found values.
During the configuration process the related variables (*3RDPARTY_FREETYPE_DLL_DIR*, *3RDPARTY_FREETYPE_INCLUDE_DIR* and *3RDPARTY_FREETYPE_LIBRARY_DIR*) will be filled with new found values.
@note The names of searched libraries and header files are hard-coded.
If there is the need to change their names, change appropriate CMake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration:
`3RDPARTY_<PRODUCT>_INCLUDE` for include, `3RDPARTY_<PRODUCT>_LIB` for library and `3RDPARTY_<PRODUCT>_DLL` for shared library.
**Note**: The names of searched libraries and header files are hard-coded. If there is the need to change their names, change appropriate cmake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration: *3RDPARTY_\<PRODUCT\>_INCLUDE* for include, *3RDPARTY_\<PRODUCT\>_LIB* for library and *3RDPARTY_\<PRODUCT\>_DLL* for shared library.
@subsection build_cmake_gen Projects generation
@subsubsection build_cmake_gen Projects generation
Once the configuration process is done, the "Generate" button is used to prepare project files for the target IDE.
In our exercise the Visual Studio solution will be automatically created in the build directory.
@subsection build_cmake_build Building
@subsubsection build_cmake_build Building
Go to the build folder, start the Visual Studio solution *OCCT.sln* and build it by clicking **Build -> Build Solution**.
@figure{/build/build_occt/images/cmake_image004.png}
By default, the build solution process skips the building of the INSTALL and Overview projects.
By default the build solution process skips the building of the INSTALL and Overview project.
When the building process is finished build:
* *Overview* project to generate OCCT overview documentation (if `BUILD_DOC_Overview` variable is checked)
* the *INSTALL* project to run the **installation process**
* Overview project to generate OCCT overview documentation (if BUILD_DOC_Overview variable is checked)
* the *INSTALL* project to run **the installation process**
For this, right-click on the *Overview/INSTALL* project and select **Project Only -> Build Only** -> *Overview/INSTALL* in the solution explorer.
For this, right-click on the *Overview/INSTALL* project and select **Project Only -> Build Only** -> *Overview/INSTALL* in the solution explorer.
@subsection build_cmake_install Installation
@subsubsection build_cmake_install Installation
Installation is a process of extracting redistributable resources (binaries, include files etc) from the build directory into the installation one.
The installation directory will be free of project files, intermediate object files and any other information related to the build routines.
Installation is a process of extracting redistributable resources (binaries, include files etc) from the build directory into the installation one. The installation directory will be free of project files, intermediate object files and any other information related to the build routines.
Normally you use the installation directory of OCCT to link against your specific application.
Normally you use the installation directory of OCCT to link against your specific application.
The directory structure is as follows:
data -- data files for OCCT (brep, iges, stp)
doc -- OCCT overview documentation in HTML format
inc -- header files
samples -- samples
src -- all required source files for OCCT
tests -- OCCT test suite
win32\vc10\bind -- binary files (installed 3rdparties and occt)
\libd -- libraries (installed 3rdparties and occt)
data - data files for OCCT (brep, iges, stp)
doc - OCCT overview documentation in HTML format
inc - header files
samples - samples
src - all required source files for OCCT
tests - OCCT test suite
win32\vc10\bind - binary files (installed 3rdparties and occt)
\libd - libraries (installed 3rdparties and occt)
@note The above example is given for debug configuration.
However, it is generally safe to use the same installation directory for the release build.
In the latter case the contents of install directory will be enriched with subdirectories and files related to the release configuration.
In particular, the binaries directory win64 will be expanded as follows:
**Note:** The above example is given for debug configuration. However, it is generally safe to use the same installation directory for the release build. In the latter case the contents of install directory will be enriched with subdirectories and files related to the release configuration. In particular, the binaries directory win64 will be expanded as
follows:
\win32\vc10\bind
\libd
\bin
\lib
If CMake installation flags are enabled for the 3rd party products (e.g. `INSTALL_FREETYPE`), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT.
Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories).
If CMake installation flags are enabled for the 3rd party products (e.g. INSTALL_FREETYPE), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT. Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories).
The installation folder contains the scripts to run *DRAWEXE* (*draw.bat* or *draw.sh*), samples (if they were installed) and overview.html (short-cut for installed OCCT overview documentation).
@subsection build_occt_crossplatform_cmake Cross-compiling (Android)
@subsection build_occt_win_codeblocks Building with Code::Blocks
This section describes the steps to build OCCT libraries for Android from a complete source package with GNU make (makefiles).
The steps on Windows 7 and Ubuntu 15.10 are similar. There is the only one difference: makefiles are built with mingw32-make on Windows and native GNU make on Ubuntu.
This file describes steps to build OCCT libraries from sources using **Code::Blocks**, a cross-platform IDE, using project files generated by OCCT legacy tool **genproj**.
It can be used as an alternative to CMake build system (see @ref build_occt_win_cmake) for all supported platforms.
Required tools (download and install if it is required):
- CMake 3.0+
- [Cross-compilation toolchain for CMake](https://github.com/taka-no-me/android-cmake)
- [Android NDK r12+](https://developer.android.com/ndk/downloads)
- GNU Make: MinGW v4.82+ for [Windows](https://www.mingw-w64.org/), GNU Make 4.0 for Ubuntu.
@subsubsection build_codeblocks_3rdparty Third-party libraries
Run GUI tool provided by CMake and:
- Specify the root folder of OCCT (`$CASROOT`, which contains *CMakelists.txt* file) by clicking **Browse Source**.
- Specify the location (build folder) for CMake generated project files by clicking **Browse Build**.
Before building OCCT, make sure to have all the needed third-party libraries installed, see @ref build_upgrade.
@figure{/build/build_occt/images/android_image001.png}
@subsubsection build_codeblocks_conf Configuration
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
Select "MinGW MakeFiles" item from the list
- Choose "Specify toolchain file for cross-compiling", and click "Next".
@figure{/build/build_occt/images/android_image002.png}
Before building it is necessary to set up build environment.
- Specify a toolchain file at the next dialog to `android.toolchain.cmake`, and click "Finish".
@figure{/build/build_occt/images/android_image003.png}
The environment is defined in the file *custom.sh* (on Linux and OS X) or *custom.bat* (on Windows) which can be edited directly:
If `ANDROID_NDK` environment variable is not defined in current OS, add cache entry `ANDROID_NDK` (entry type is `PATH`) -- path to the NDK folder ("Add Entry" button):
@figure{/build/build_occt/images/android_image004.png}
If on Windows the message is appeared:
"CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles" CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.",
specify `CMAKE_MAKE_PROGRAM` to mingw32-make executable.
@figure{/build/build_occt/images/android_image005.png}
How to configure OCCT, see @ref build_cmake_conf "Configure" section taking into account the specific configuration variables for Android:
- `ANDROID_ABI` = `armeabi-v7a`
- `ANDROID_NATIVE_API_LEVEL` = `15`
- `ANDROID_NDK_LAYOUT` is equal to `CMAKE_BUILD_TYPE` variable
- `BUILD_MODULE_Draw` = `OFF`
@figure{/build/build_occt/images/android_image006.png}
Click **Generate** button and wait until the generation process is finished.
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
Open console and go to the build folder. Type "mingw32-make" (Windows) or "make" (Ubuntu) to start build process:
> mingw32-make
or
> make
Parallel building can be started with using `-jN` argument of "mingw32-make/make", where `N` is the number of building threads:
> mingw32-make -j4
or
> make -j4
Type "mingw32-make/make" with argument "install" to place the libraries to the install folder:
> mingw32-make install
or
> make install
@section build_occt_genproj Building with Genproj tool
**genproj** is a legacy tool (originated from command "wgenproj" in WOK) for generation of Visual Studio, Code::Blocks, Qt Creator (qmake), and XCode project files for building Open CASCADE Technology.
These project files are placed inside OCCT directory (in *adm* subfolder) and use relative paths, thus can be moved together with sources.
The project files included in official distribution of OCCT are generated by this tool.
@note If you have official distribution with project files included, you can use them directly without a need to call **genproj**.
**genproj** is a less flexible alternative to use of CMake build system (see @ref build_occt_win_cmake), but still has some small features useful for OCCT development.
@subsection build_genproj Configuration process
The environment is defined in the file *custom.sh* (on Linux and macOS) or *custom.bat* (on Windows) which can be edited directly:
* `ARCH` -- architecture (32 or 64), affects only `PATH` variable for execution
* `HAVE_*` -- flags to enable or disable use of optional third-party products
* `CSF_OPT_*` -- paths to search for includes and binaries of all used third-party products
* `SHORTCUT_HEADERS` -- defines method for population of folder *inc* by header files. Supported methods are:
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC*.
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* *HardLink* - hard links to headers located in *src* will be created.
* `VCVER` -- specification of format of project files, defining also version of Visual Studio to be used, and default name of the sub-folder for binaries:
* Add paths to includes of used third-party libraries in variable `CSF_OPT_INC`.
* Add paths to their binary libraries in variable `CSF_OPT_LIB64`.
* For optional third-party libraries, set corresponding environment variable `HAVE_<LIBRARY_NAME>` to either *false*, e.g. `export HAVE_FREEIMAGE=false`.
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~
export HAVE_FREEIMAGE=false
~~~~
Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure environment interactively:
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
@subsubsection build_codeblocks_gen Projects generation
Launch **genproj** tool with option *cbp* to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files:
~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj cbp
~~~~
The generated Code::Blocks project are placed into subfolder *adm/&lt;OS&gt;/cbp*.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
@subsubsection build_codeblocks_build Building
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~
./draw.sh cbp [d]
~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
@subsection build_occt_genproj Building with Genproj tool
This page describes steps to build OCCT libraries from a complete source archive on Windows with <b>MS Visual C++</b> using projects generated by **genproj** tool.
It is an alternative to use of CMake build system (see @ref build_occt_win_cmake).
**genproj** is a legacy tool (originated from command "wgenproj" in WOK) for generation of Visual Studio, Code.Blocks, and XCode project files used for building Open CASCADE Technology.
These project files are placed inside OCCT directory (in *adm* subfolder) and use relative paths, thus can be moved together with sources.
The project files included in official distribution of OCCT are generated by this tool.
If you have official distribution with project files included, you can use them directly without a need to call **genproj**.
@subsubsection build_msvc_3rdparty Third-party libraries
Before building OCCT, make sure to have all the required third-party libraries installed.
The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to version of Visual Studio you are using, from https://opencascade.com/content/3rd-party-components.
You can also build third-party libraries from their sources, see @ref build_upgrade_building_3rdparty for instructions.
@subsubsection build_msvc_conf Configuration
If you have Visual Studio projects already available (pre-installed or generated), you can edit file *custom.bat* manually to adjust the environment:
* *VCVER* -- specification of format of project files, defining also version of Visual Studio to be used, and default name of the sub-folder for binaries:
| VCVER | Visual Studio version | Windows Platform | Binaries folder name |
|-----------|-----------------------|----------------------------------|----------------------|
@@ -325,85 +315,267 @@ The environment is defined in the file *custom.sh* (on Linux and macOS) or *cust
| vc142 | 2019 (16) | Desktop (Windows API) | vc14 |
| vc142-uwp | 2019 (16) | UWP (Universal Windows Platform) | vc14-uwp |
* *ARCH* -- architecture (32 or 64), affects only *PATH* variable for execution
* <i>HAVE_*</i> -- flags to enable or disable use of optional third-party products
* <i>CSF_OPT_*</i> -- paths to search for includes and binaries of all used third-party products
* *SHORTCUT_HEADERS* -- defines method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
That tool will analyze your environment and propose you to choose available options:
* Type and version of project files to generate (from the list of installed ones, detected by presence of environment variables like `VS100COMNTOOLS` on Windows platform).
* Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like *VS100COMNTOOLS*).
* Method to populate folder *inc* (short-cuts by default).
* Location of third-party libraries (usually downloaded from OCCT web site, see above).
* Path to common directory where third-party libraries are located (optional).
* Paths to headers and binaries of the third-party libraries (found automatically basing on previous options; click button "Reset" to update).
* Generation of PDB files within Release build ("Release with Debug info", false by default).
Below are screenshots of **genconf** tool on various platforms (Windows and Linux):
@figure{/build/build_occt/images/genconf_windows.png}
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.bat* (Windows) or *custom.sh* (other systems) file.
@subsection build_genproj_generate Projects generation
Click "Save" to store the specified configuration in *custom.bat* file.
@subsubsection build_msvc_generate Projects generation
Launch **genproj** to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by `PATH`.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
If Tcl is not found, the tool may prompt you to enter the path to directory where Tcl can be found.
~~~~
$ genproj.bat
~~~~
Note that if *custom.bat* is not present, **genproj** will start **genconf** to configure environment.
@subsection build_genproj_build Building
@subsubsection build_msvc_build Visual Studio
@subsubsection build_msvc_build Building
Launch *msvc.bat* to start Visual Studio with all necessary environment variables defined, and build the whole solution or required toolkits.
The MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
Note: the MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
Binaries are produced in *win32* or *win64* folders.
To start DRAW, launch *draw.bat*.
@subsubsection build_codeblocks_build Code::Blocks
@section build_occt_linux Linux
Code::Blocks is a cross-platform IDE which can be used for building OCCT on Linux, macOS and Windows platforms.
The generated Code::Blocks project could be found within subfolder *adm/&lt;OS&gt;/cbp*.
You may choose one of the following ways to generate, configure and build OCCT sources on Linux just keeping in mind
this platform specific:
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
* @ref build_occt_win_cmake "Configuration, generation and building OCCT on Windows using CMake tool"
* @ref build_occt_code_blocks "Building on Mac OS X with Code::Blocks IDE"
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
@section build_occt_crossplatform_cmake Android (cross-compiling)
This article describes the steps to build OCCT libraries for Android from a complete source package
with GNU make (makefiles). The steps on Windows 7 and Ubuntu 15.10 are similar. There is the only one difference:
makefiles are built with mingw32-make
on Windows and native GNU make on Ubuntu.
Required tools (download and install if it is required):
- CMake v3.0+ http://www.cmake.org/cmake/resources/software.html
- Cross-compilation toolchain for CMake https://github.com/taka-no-me/android-cmake
- Android NDK rev.10+ https://developer.android.com/tools/sdk/ndk/index.html
- GNU Make: MinGW v4.82+ for Windows (http://sourceforge.net/projects/mingw/files/), GNU Make 4.0 for Ubuntu.
Run GUI tool provided by CMake.
@subsection build_occt_crossplatform_cmake_config Configuration
**Configure Tools**
- Specify the root folder of OCCT (<i>$CASROOT</i>, which contains *CMakelists.txt* file) by clicking **Browse Source**.
- Specify the location (build folder) for Cmake generated project files by clicking **Browse Build**.
@figure{/build/build_occt/images/android_image001.png}
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
Select "MinGW MakeFiles" item from the list
- Choose "Specify toolchain file for cross-compiling"
- Click "Next"
@figure{/build/build_occt/images/android_image002.png}
- Specify a toolchain file at the next dialog by android.toolchain.cmake . It is contained by cross-compilation
toolchain for CMake
- Click "Finish"
@figure{/build/build_occt/images/android_image003.png}
If ANDROID_NDK environment variable is not defined in current OS, add cache entry ANDROID_NDK (entry type is PATH) --
path to the NDK folder ("Add Entry" button)
@figure{/build/build_occt/images/android_image004.png}
If on Windows the message is appeared: "CMake Error: CMake was unable to find a build program corresponding
to "MinGW Makefiles"
CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.",
specify **CMAKE_MAKE_PROGRAM** to mingw32-make executable.
@figure{/build/build_occt/images/android_image005.png}
**Configure OCCT**
How to configure OCCT, see "OCCT Configuration" section of @ref build_occt_win_cmake
"Configure, Generate, Build using CMake tool" taking into account the specific configuration variables for android:
- ANDROID_ABI = armeabi-v7a
- ANDROID_NATIVE_API_LEVEL = 15
- ANDROID_NDK_LAYOUT is equal to CMAKE_BUILD_TYPE variable
- **BUILD_MODULE_Draw = OFF**
@figure{/build/build_occt/images/android_image006.png}
@subsection build_occt_crossplatform_cmake_generation Generate Makefiles
Click **Generate** button and wait until the generation process is finished.
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
@subsection build_occt_crossplatform_cmake_building Build Makefiles
Open console and go to the build folder. Type "mingw32-make" (Windows) or "make" (Ubuntu) to start build process.
> mingw32-make
or
> make
Parallel building can be started with using **"-jN"** argument of "mingw32-make/make", where N is the number of
building threads.
> mingw32-make -j4
or
> make -j4
@subsection build_occt_crossplatform_cmake_install Install OCCT Libraries
Type "mingw32-make/make" with argument "install" to place the libraries to the install folder
> mingw32-make install
or
> make install
@section build_occt_macos Mac OS X
@subsection build_occt_macos_xcode Building with Xcode
This file describes steps to build OCCT libraries from sources on Mac OS X with **Xcode** projects, generated by OCCT legacy tool **genproj**.
<h2>Configuration</h2>
Before building it is necessary to set up build environment.
The environment is defined in the file *custom.sh* which can be edited directly:
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC* (use colon ":" as path separator).
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~
./draw.sh cbp [d]
export HAVE_FREEIMAGE=false
~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
@subsubsection build_occt_macos_xcode XCode
Alternatively, or when *custom.sh* does not exist, you can launch *genconf.sh* to configure environment interactively:
XCode is an IDE for development on macOS platform and targeting macOS and iOS platforms.
**genproj** tool comes with a legacy XCode project files generator, but CMake is a preferred way for building OCCT on macOS platform.
@figure{/build/build_occt/images/genconf_osx.png}
To start **XCode**, launch script *xcode.sh*.
To build a certain toolkit, select it in **Scheme** drop-down list in XCode toolbar, press **Product** in the menu and click **Build** button.
Click "Save" to store the specified configuration in *custom.sh* file.
<h2>Projects generation</h2>
Launch **genproj** tool to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
For instance, in Terminal application:
~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj
~~~~
<h2>Building</h2>
To start **Xcode**, launch script *xcode.sh*.
To build a certain toolkit, select it in **Scheme** drop-down list in Xcode toolbar, press **Product** in the menu and click **Build** button.
To build the entire OCCT:
* Create a new empty project (select **File -> New -> Project -> Empty project** in the menu; input the project name, e.g. *OCCT*; then click **Next** and **Create**).
* Drag and drop the *OCCT* folder in the created *OCCT* project in the Project navigator.
* Select **File -> New -> Target -> Aggregate** in the menu.
* Enter the project name (e.g. *OCCT*) and click **Finish**. The **Build Phases** tab will open.
* Click "+" button to add the necessary toolkits to the target project. It is possible to select all toolkits by pressing **Command+A** combination.
* Enter the project name (e.g. *OCCT*) and click **Finish**. The **Build Phases** tab will open.
* Click "+" button to add the necessary toolkits to the target project. It is possible to select all toolkits by pressing **Command+A** combination.
To start *DRAWEXE*, which has been built with XCode on Mac OS X, perform the following steps:
<h2>Launching DRAW</h2>
To start *DRAWEXE*, which has been built with Xcode on Mac OS X, perform the following steps:
1.Open Terminal application
2.Enter `<OCCT_ROOT_DIR>`:
2.Enter <i>\<OCCT_ROOT_DIR\></i>:
~~~~
cd \<OCCT_ROOT_DIR\>
~~~~
3.Run the script
~~~~
./draw.sh xcd [d]
./draw_cbp.sh xcd [d]
~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
@subsection build_occt_code_blocks Building with Code::Blocks
This file describes steps to build OCCT libraries from sources using **Code::Blocks**, a cross-platform IDE, using
project files generated by OCCT legacy tool **genproj**.
<h2>Configure</h2>
Before building it is necessary to set up build environment.
The environment is defined in the file *custom.sh* (on Linux and OS X) or *custom.bat* (on Windows) which can be edited
directly:
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC*.
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~
export HAVE_FREEIMAGE=false
~~~~
Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure
environment interactively:
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
<h2>Generate Projects</h2>
Launch **genproj** tool with option *cbp* to update content of *inc* folder and generate project files after changes in
OCCT code affecting layout or composition of source files:
~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj cbp
~~~~
The generated Code::Blocks project are placed into subfolder *adm/&lt;OS&gt;/cbp*.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
<h2>Build</h2>
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~
./draw_cbp.sh cbp [d]
~~~~
Option *d* is used if OCCT has been built in **Debug** mode.

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -18,7 +18,7 @@ From a programming standpoint, Open CASCADE Technology is designed to enhance yo
To illustrate the use of classes provided in the 3D geometric modeling toolkits, you will create a bottle as shown:
@figure{/tutorial/images/tutorial_image001.png,"",240} height=350px
@figure{/tutorial/images/tutorial_image001.png,"",240}
In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial, including the very function *MakeBottle* in the distribution of Open CASCADE Technology. The function body is provided in the file samples/qt/Tutorial/src/MakeBottle.cxx.
@@ -34,7 +34,7 @@ We first define the bottle specifications as follows:
In addition, we decide that the bottle's profile (base) will be centered on the origin of the global Cartesian coordinate system.
@figure{/tutorial/images/tutorial_image002.png,"",240} height=350px
@figure{/tutorial/images/tutorial_image002.png,"",240}
This modeling requires four steps:
@@ -145,16 +145,16 @@ However, the *TopoDS* package provides only the data structure of the topologica
To create an edge, you use the BRepBuilderAPI_MakeEdge class with the previously computed curves:
~~~~{.cpp}
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);
TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);
TopoDS_Edge aEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
~~~~
In Open CASCADE Technology, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, anEdge1 and anEdge3 could have been computed in a simpler way:
In Open CASCADE Technology, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, aEdge1 and aEdge3 could have been computed in a simpler way:
~~~~{.cpp}
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt3);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt3);
TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
~~~~
To connect the edges, you need to create a wire with the *BRepBuilderAPI_MakeWire* class. There are two ways of building a wire with this class:
@@ -165,7 +165,7 @@ To connect the edges, you need to create a wire with the *BRepBuilderAPI_MakeWir
When building a wire from less than four edges, as in the present case, you can use the constructor directly as follows:
~~~~{.cpp}
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge1, anEdge2, anEdge3);
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(aEdge1, aEdge2, aEdge3);
~~~~
@@ -250,7 +250,7 @@ The bottle's profile is almost finished. You have created two wires: *aWire* and
@subsection OCCT_TUTORIAL_SUB3_1 Prism the Profile
To compute the main body of the bottle, you need to create a solid shape. The simplest way is to use the previously created profile and sweep it along a direction. The *Prism* functionality of Open CASCADE Technology is the most appropriate for that task. It accepts a shape and a direction as input and generates a new shape according to the following rules:
To compute the main body of the bottle, you need to create a solid shape. The simplest way is to use the previously created profile and to sweep it along a direction. The *Prism* functionality of Open CASCADE Technology is the most appropriate for that task. It accepts a shape and a direction as input and generates a new shape according to the following rules:
| Shape | Generates |
| :----- | :----------------- |
@@ -260,7 +260,7 @@ To compute the main body of the bottle, you need to create a solid shape. The si
| Face | Solid |
| Shell | Compound of Solids |
@figure{/tutorial/images/tutorial_image007.png,"",240} height=350px
@figure{/tutorial/images/tutorial_image007.png,"",240}
Your current profile is a wire. Referring to the Shape/Generates table, you need to compute a face out of its wire to generate a solid.
To create a face, use the *BRepBuilderAPI_MakeFace* class. As previously explained, a face is a part of a surface bounded by a closed wire. Generally, *BRepBuilderAPI_MakeFace* computes a face out of a surface and one or more wires.
@@ -297,7 +297,7 @@ For our purposes, we will specify that fillets must be:
* applied on all edges of the shape
* have a radius of *myThickness* / 12
@figure{/tutorial/images/tutorial_image008.png,"",240} height=350px
@figure{/tutorial/images/tutorial_image008.png,"",240}
To apply fillets on the edges of a shape, you use the *BRepFilletAPI_MakeFillet* class. This class is normally used as follows:
@@ -353,7 +353,7 @@ Once this is done, you perform the last step of the procedure by asking for the
To add a neck to the bottle, you will create a cylinder and fuse it to the body. The cylinder is to be positioned on the top face of the body with a radius of *myThickness* / 4. and a height of *myHeight* / 10.
@figure{/tutorial/images/tutorial_image009.png,"",240} height=350px
@figure{/tutorial/images/tutorial_image009.png,"",240}
To position the cylinder, you need to define a coordinate system with the *gp_Ax2* class defining a right-handed coordinate system from a point and two directions - the main (Z) axis direction and the X direction (the Y direction is computed from these two).
To align the neck with the center of the top face, being in the global coordinate system (0, 0, *myHeight*), with its normal on the global Z axis, your local coordinate system can be defined as follows:
@@ -395,7 +395,7 @@ In Open CASCADE Technology, a hollowed solid is called a *Thick* *Solid* and is
* Create a parallel wall W2 from W1 at a distance D. If D is positive, W2 will be outside the initial solid, otherwise it will be inside.
* Compute a solid from the two walls W1 and W2.
@figure{/tutorial/images/tutorial_image010.png,"",240} height=350px
@figure{/tutorial/images/tutorial_image010.png,"",240}
To compute a thick solid, you create an instance of the *BRepOffsetAPI_MakeThickSolid* class by giving the following information:
@@ -438,6 +438,7 @@ To compare a given type with the type you seek, use the *STANDARD_TYPE* macro, w
~~~~{.cpp}
if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
//
}
~~~~
@@ -477,9 +478,9 @@ The collection for shapes can be found in the *TopTools* package. As *BRepOffset
All the necessary data are now available so you can create your hollowed solid by calling the *BRepOffsetAPI_MakeThickSolid* MakeThickSolidByJoin method:
~~~~{.cpp}
BRepOffsetAPI_MakeThickSolid aSolidMaker;
aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = aSolidMaker.Shape();
BRepOffsetAPI_MakeThickSolid BodyMaker;
BodyMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = BodyMaker.Shape();
~~~~
@@ -492,7 +493,7 @@ All the necessary data are now available so you can create your hollowed solid b
Up to now, you have learned how to create edges out of 3D curves.
You will now learn how to create an edge out of a 2D curve and a surface.
To learn this aspect of Open CASCADE Technology, you will build helicoidal profiles out of 2D curves on cylindrical surfaces. The theory is more complex than in previous steps, but applying it is very simple.
As a first step, you compute these cylindrical surfaces. You are already familiar with the curves of the *Geom* package. Now you can create a cylindrical surface (*Geom_CylindricalSurface*) using:
As a first step, you compute these cylindrical surfaces. You are already familiar with curves of the *Geom* package. Now you can create a cylindrical surface (*Geom_CylindricalSurface*) using:
* a coordinate system;
* a radius.
@@ -603,7 +604,7 @@ As the parametric equation of an ellipse is P(U) = O + (MajorRadius * cos(U) * X
~~~~
The last step consists in defining the segment, which is the same for the two profiles: a line limited by the first and the last point of one of the arcs.
To access the point corresponding to the parameter of a curve or a surface, you use the Value or D0 method (meaning 0th derivative), D1 method is for the first derivative, D2 for the second one.
To access the point corresponding to the parameter of a curve or a surface, you use the Value or D0 method (meaning 0th derivative), D1 method is for first derivative, D2 for the second one.
~~~~{.cpp}
gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
@@ -697,7 +698,7 @@ You are almost done building the bottle. Use the *TopoDS_Compound* and *BRep_Bui
Congratulations! Your bottle is complete. Here is the result snapshot of the Tutorial application:
@figure{/tutorial/images/tutorial_image019.png,"",320} height=450px
@figure{/tutorial/images/tutorial_image019.png,"",320}
We hope that this tutorial has provided you with a feel for the industrial strength power of Open CASCADE Technology.
If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at https://www.opencascade.com/content/technology-support. Our professional services can maximize the power of your Open CASCADE Technology applications.
@@ -795,9 +796,9 @@ Complete definition of MakeBottle function (defined in the file src/MakeBottle.c
TopTools_ListOfShape facesToRemove;
facesToRemove.Append(faceToRemove);
BRepOffsetAPI_MakeThickSolid aSolidMaker;
aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = aSolidMaker.Shape();
BRepOffsetAPI_MakeThickSolid BodyMaker;
BodyMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = BodyMaker.Shape();
// Threading : Create Surfaces
Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);

View File

@@ -396,7 +396,7 @@ However, due to redesign of basic mechanisms (CDL generic classes, Handles and R
WOK is not necessary anymore for building OCCT from sources, though it still can be used in a traditional way -- auxiliary files required for that are preserved.
The recommended method for building OCCT 7.x is CMake, see @ref build_occt_win_cmake.
The alternative solution is to use project files generated by OCCT legacy tool **genproj**, see @ref build_occt_genproj.
The alternative solution is to use project files generated by OCCT legacy tool **genproj**, see @ref build_occt_genproj, @ref build_occt_win_codeblocks, and @ref build_occt_macos_xcode.
@subsubsection upgrade_occt700_cdl_auto Automatic upgrade

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

View File

@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.2)
project(glfw-occt-demo)
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/adm/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 11)
set(APP_VERSION_MAJOR 1)
set(APP_VERSION_MINOR 0)
@@ -26,14 +24,15 @@ source_group ("Sources" FILES
find_package(OpenGL REQUIRED)
# Open CASCADE Technology
find_package (OpenCASCADE REQUIRED)
if (NOT OpenCASCADE_FOUND)
message (FATAL_ERROR "coult not find OpenCASCADE, please set OpenCASCADE_DIR variable" )
else()
message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_INSTALL_PREFIX}\"" )
message (STATUS "OpenCASCADE_INCLUDE_DIR=${OpenCASCADE_INCLUDE_DIR}")
message (STATUS "OpenCASCADE_LIBRARY_DIR=${OpenCASCADE_LIBRARY_DIR}")
find_package(OpenCASCADE REQUIRED NO_DEFAULT_PATH)
if (OpenCASCADE_FOUND)
message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_DIR}\"" )
INCLUDE_DIRECTORIES(${OpenCASCADE_INCLUDE_DIR})
LINK_DIRECTORIES(${OpenCASCADE_LIBRARY_DIR})
else()
message (WARNING "Could not find OpenCASCADE, please set OpenCASCADE_DIR variable." )
set (OCCT_LIBRARY_DIR)
set (OCCT_BIN_DIR)
endif()
SET(OpenCASCADE_LIBS

View File

@@ -55,7 +55,7 @@ GlfwOcctWindow::GlfwOcctWindow (int theWidth, int theHeight, const TCollection_A
myYBottom = myYTop + aHeight;
#if !defined(_WIN32) && !defined(__APPLE__)
myDisplay = new Aspect_DisplayConnection ((Aspect_XDisplay* )glfwGetX11Display());
myDisplay = new Aspect_DisplayConnection (glfwGetX11Display());
#endif
}
}

View File

@@ -1,157 +0,0 @@
# This script finds OpenCASCADE Technology libraries.
# The script requires:
# OpenCASCADE_DIR - root OCCT folder or folder with CMake configuration files
#
# Script will define the following variables on success:
# OpenCASCADE_FOUND - package is successfully found
# OpenCASCADE_INCLUDE_DIR - directory with headers
# OpenCASCADE_LIBRARY_DIR - directory with libraries for linker
# OpenCASCADE_BINARY_DIR - directory with DLLs
include(FindPackageHandleStandardArgs)
# MY_PLATFORM variable
math (EXPR MY_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
if (WIN32)
set (MY_PLATFORM "win${MY_BITNESS}")
elseif(APPLE)
set (MY_PLATFORM "mac")
else()
set (MY_PLATFORM "lin")
endif()
# MY_PLATFORM_AND_COMPILER variable
if (MSVC)
if (MSVC90)
set (MY_COMPILER vc9)
elseif (MSVC10)
set (MY_COMPILER vc10)
elseif (MSVC11)
set (MY_COMPILER vc11)
elseif (MSVC12)
set (MY_COMPILER vc12)
elseif (MSVC14)
set (MY_COMPILER vc14)
else()
set (MY_COMPILER vc15)
message (WARNING "Unknown msvc version. $$MY_COMPILER is used")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
set (MY_COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (MY_COMPILER gcc)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (MY_COMPILER clang)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set (MY_COMPILER icc)
else()
set (MY_COMPILER ${CMAKE_GENERATOR})
string (REGEX REPLACE " " "" COMPILER ${MY_COMPILER})
endif()
set (MY_PLATFORM_AND_COMPILER "${MY_PLATFORM}/${MY_COMPILER}")
set (OpenCASCADE_DIR "" CACHE PATH "Path to Open CASCADE libraries.")
# default paths
set (OpenCASCADE_INCLUDE_DIR "${OpenCASCADE_DIR}/inc")
set (OpenCASCADE_LIBRARY_DIR "${OpenCASCADE_DIR}/${MY_PLATFORM_AND_COMPILER}/lib")
set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_DIR}/${MY_PLATFORM_AND_COMPILER}/bin")
# complete list of OCCT Toolkits (copy-paste from adm/UDLIST, since installed OCCT does not include UDLIST)
set (OpenCASCADE_TKLIST "")
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKernel TKMath) # FoundationClasses
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKG2d TKG3d TKGeomBase TKBRep) # ModelingData
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing) # ModelingAlgorithms
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost) # Visualization
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF) # ApplicationFramework
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh) # DataExchange
set (OpenCASCADE_TKLIST ${OpenCASCADE_TKLIST} TKDraw TKViewerTest) # Draw
# validate location of OCCT libraries and headers
set (OpenCASCADE_INCLUDE_DIR_FOUND)
set (OpenCASCADE_LIBRARY_DIR_FOUND)
set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND)
set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND)
set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND)
if (EXISTS "${OpenCASCADE_INCLUDE_DIR}/Standard.hxx")
set (OpenCASCADE_INCLUDE_DIR_FOUND ON)
endif()
if (EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (OpenCASCADE_LIBRARY_DIR_FOUND ON)
elseif (NOT WIN32 AND EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_LIBRARY_DIR_FOUND ON)
set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
if (EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_STATIC_LIBRARY_SUFFIX}")
set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND ON)
elseif (NOT WIN32 AND EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND ON)
set (OpenCASCADE_IMPLIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
elseif (OpenCASCADE_LIBRARY_DIR_FOUND)
message (STATUS "Only release OpenCASCADE libraries have been found")
endif()
if (NOT OpenCASCADE_LIBRARY_DIR_FOUND AND OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND)
set (OpenCASCADE_LIBRARY_DIR_FOUND ON)
message (WARNING "Only debug OpenCASCADE libraries have been found")
endif()
if (WIN32)
if (EXISTS "${OpenCASCADE_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND ON)
endif()
if (EXISTS "${OpenCASCADE_BINARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND ON)
endif()
else()
if (EXISTS "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_SHAREDLIB_RELEASE_FOUND ON)
endif()
if (EXISTS "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}TKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (OpenCASCADE_SHAREDLIB_DEBUG_FOUND ON)
endif()
endif()
if (OpenCASCADE_INCLUDE_DIR_FOUND AND OpenCASCADE_LIBRARY_DIR_FOUND)
set (OpenCASCADE_FOUND ON)
set (OpenCASCADE_INSTALL_PREFIX ${OpenCASCADE_DIR})
# Define OCCT toolkits so that CMake can put absolute paths to linker;
# the library existance is not checked here, since modules can be disabled.
foreach (aLibIter ${OpenCASCADE_TKLIST})
add_library (${aLibIter} SHARED IMPORTED)
set_property (TARGET ${aLibIter} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties (${aLibIter} PROPERTIES IMPORTED_IMPLIB_RELEASE "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${OpenCASCADE_IMPLIB_SUFFIX}")
if (OpenCASCADE_SHAREDLIB_RELEASE_FOUND)
if (WIN32)
set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenCASCADE_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenCASCADE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
endif()
if (OpenCASCADE_LIBRARY_DEBUG_DIR_FOUND)
set_property (TARGET ${aLibIter} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties (${aLibIter} PROPERTIES IMPORTED_IMPLIB_DEBUG "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${OpenCASCADE_IMPLIB_SUFFIX}")
if (OpenCASCADE_SHAREDLIB_DEBUG_FOUND)
if (WIN32)
set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenCASCADE_BINARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
set_target_properties (${aLibIter} PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenCASCADE_LIBRARY_DIR}d/${CMAKE_SHARED_LIBRARY_PREFIX}${aLibIter}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
endif()
endif()
endforeach()
else()
# fallback searching for CMake configs
if (NOT "${OpenCASCADE_DIR}" STREQUAL "")
set (anOcctDirBak "${OpenCASCADE_DIR}")
find_package (OpenCASCADE CONFIG QUIET PATHS "${OpenCASCADE_DIR}" NO_DEFAULT_PATH)
set (OpenCASCADE_DIR "${anOcctDirBak}" CACHE PATH "Path to Open CASCADE libraries." FORCE)
else()
find_package (OpenCASCADE CONFIG QUIET)
endif()
endif()

View File

@@ -95,7 +95,6 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent )
myCurZoom = 0;
setAttribute(Qt::WA_PaintOnScreen);
setAttribute(Qt::WA_NoSystemBackground);
setAttribute(Qt::WA_NativeWindow);
myDefaultGestures = myMouseGestureMap;
myCurrentMode = CurAction3d_Nothing;
@@ -107,6 +106,8 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent )
setBackgroundRole( QPalette::NoRole );//NoBackground );
// set focus policy to threat QContextMenuEvent from keyboard
setFocusPolicy( Qt::StrongFocus );
setAttribute( Qt::WA_PaintOnScreen );
setAttribute( Qt::WA_NoSystemBackground );
init();
}

View File

@@ -8,8 +8,6 @@
#include <TopoDS_Shape.hxx>
#include <AIS_Shape.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
TopoDS_Shape
MakeBottle(const Standard_Real myWidth , const Standard_Real myHeight , const Standard_Real myThickness);
@@ -25,17 +23,6 @@ DocumentTut::~DocumentTut()
void DocumentTut::onMakeBottle()
{
Handle(AIS_InteractiveContext) aCtx = getContext();
for (V3d_ListOfView::Iterator aViewIter (aCtx->CurrentViewer()->ActiveViews()); aViewIter.More(); aViewIter.Next())
{
const Handle(V3d_View)& aView = aViewIter.Value();
Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams();
aParams.RenderResolutionScale = 2.0f;
}
const Handle(Prs3d_Drawer)& aDefDrawer = aCtx->DefaultDrawer();
aDefDrawer->SetIsoOnTriangulation (true);
QApplication::setOverrideCursor( Qt::WaitCursor );
TopoDS_Shape aBottle=MakeBottle(50,70,30);
Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);

View File

@@ -77,8 +77,5 @@ if (NOT "${SOURCE_MAP_BASE}" STREQUAL "")
endif()
endif()
install(FILES occt-webgl-sample.html DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/OCC_logo.png DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/lamp.ico DESTINATION ${CMAKE_INSTALL_PREFIX})
if (CMAKE_CXX_FLAGS MATCHES "-pthread")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.worker.js DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/OCC_logo.png DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/lamp.ico DESTINATION ${CMAKE_INSTALL_PREFIX})

View File

@@ -185,16 +185,12 @@ void WasmOcctView::initWindow()
emscripten_set_resize_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onResizeCallback);
emscripten_set_mousedown_callback (aTargetId, this, toUseCapture, onMouseCallback);
// bind these events to window to track mouse movements outside of canvas
//emscripten_set_mouseup_callback (aTargetId, this, toUseCapture, onMouseCallback);
//emscripten_set_mousemove_callback (aTargetId, this, toUseCapture, onMouseCallback);
//emscripten_set_mouseleave_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseup_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onMouseCallback);
emscripten_set_mousemove_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onMouseCallback);
emscripten_set_mouseup_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mousemove_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_dblclick_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_click_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseenter_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseleave_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_wheel_callback (aTargetId, this, toUseCapture, onWheelCallback);
emscripten_set_touchstart_callback (aTargetId, this, toUseCapture, onTouchCallback);
@@ -202,12 +198,9 @@ void WasmOcctView::initWindow()
emscripten_set_touchmove_callback (aTargetId, this, toUseCapture, onTouchCallback);
emscripten_set_touchcancel_callback(aTargetId, this, toUseCapture, onTouchCallback);
//emscripten_set_keypress_callback (aTargetId, this, toUseCapture, onKeyCallback);
emscripten_set_keydown_callback (aTargetId, this, toUseCapture, onKeyDownCallback);
emscripten_set_keyup_callback (aTargetId, this, toUseCapture, onKeyUpCallback);
//emscripten_set_focus_callback (aTargetId, this, toUseCapture, onFocusCallback);
//emscripten_set_focusin_callback (aTargetId, this, toUseCapture, onFocusCallback);
emscripten_set_focusout_callback (aTargetId, this, toUseCapture, onFocusCallback);
//emscripten_set_keypress_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyCallback);
emscripten_set_keydown_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyDownCallback);
emscripten_set_keyup_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyUpCallback);
}
// ================================================================
@@ -481,21 +474,6 @@ EM_BOOL WasmOcctView::onResizeEvent (int theEventType, const EmscriptenUiEvent*
return EM_TRUE;
}
//! Update canvas bounding rectangle.
EM_JS(void, jsUpdateBoundingClientRect, (), {
Module._myCanvasRect = Module.canvas.getBoundingClientRect();
});
//! Get canvas bounding top.
EM_JS(int, jsGetBoundingClientTop, (), {
return Math.round(Module._myCanvasRect.top);
});
//! Get canvas bounding left.
EM_JS(int, jsGetBoundingClientLeft, (), {
return Math.round(Module._myCanvasRect.left);
});
// ================================================================
// Function : onMouseEvent
// Purpose :
@@ -508,18 +486,6 @@ EM_BOOL WasmOcctView::onMouseEvent (int theEventType, const EmscriptenMouseEvent
}
Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window());
if (theEventType == EMSCRIPTEN_EVENT_MOUSEMOVE
|| theEventType == EMSCRIPTEN_EVENT_MOUSEUP)
{
// these events are bound to EMSCRIPTEN_EVENT_TARGET_WINDOW, and coordinates should be converted
jsUpdateBoundingClientRect();
EmscriptenMouseEvent anEvent = *theEvent;
anEvent.targetX -= jsGetBoundingClientLeft();
anEvent.targetY -= jsGetBoundingClientTop();
aWindow->ProcessMouseEvent (*this, theEventType, &anEvent);
return EM_FALSE;
}
return aWindow->ProcessMouseEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE;
}
@@ -591,24 +557,6 @@ bool WasmOcctView::navigationKeyModifierSwitch (unsigned int theModifOld,
return hasActions;
}
// ================================================================
// Function : onFocusEvent
// Purpose :
// ================================================================
EM_BOOL WasmOcctView::onFocusEvent (int theEventType, const EmscriptenFocusEvent* theEvent)
{
if (myView.IsNull()
|| (theEventType != EMSCRIPTEN_EVENT_FOCUS
&& theEventType != EMSCRIPTEN_EVENT_FOCUSIN // about to receive focus
&& theEventType != EMSCRIPTEN_EVENT_FOCUSOUT))
{
return EM_FALSE;
}
Handle(Wasm_Window) aWindow = Handle(Wasm_Window)::DownCast (myView->Window());
return aWindow->ProcessFocusEvent (*this, theEventType, theEvent) ? EM_TRUE : EM_FALSE;
}
// ================================================================
// Function : onKeyDownEvent
// Purpose :

View File

@@ -181,9 +181,6 @@ private:
//! Key up event.
EM_BOOL onKeyUpEvent (int theEventType, const EmscriptenKeyboardEvent* theEvent);
//! Focus change event.
EM_BOOL onFocusEvent (int theEventType, const EmscriptenFocusEvent* theEvent);
//! @name Emscripten callbacks (static functions)
private:
@@ -208,9 +205,6 @@ private:
static EM_BOOL onKeyUpCallback (int theEventType, const EmscriptenKeyboardEvent* theEvent, void* theView)
{ return ((WasmOcctView* )theView)->onKeyUpEvent (theEventType, theEvent); }
static EM_BOOL onFocusCallback (int theEventType, const EmscriptenFocusEvent* theEvent, void* theView)
{ return ((WasmOcctView* )theView)->onFocusEvent (theEventType, theEvent); }
private:
//! Register hot-keys for specified Action.

View File

@@ -42,11 +42,6 @@ function updateCanvasSize()
window.onresize = updateCanvasSize;
updateCanvasSize();
// capture keyboard input on mouse click
occViewerCanvas.tabIndex = -1;
occViewerCanvas.onclick = (theEvent) => { occViewerCanvas.focus() };
occViewerCanvas.focus();
//! Check browser support.
function isWasmSupported()
{
@@ -83,7 +78,6 @@ fileInput.onchange = function()
OccViewerModule.openFromMemory (aFile.name, aDataBuffer, aDataArray.length, true);
//OccViewerModule._free (aDataBuffer); will be freed by called method
OccViewerModule.displayGround (true);
occViewerCanvas.focus();
};
aReader.readAsArrayBuffer(aFile);
};

View File

@@ -53,6 +53,7 @@ class TCollection_ExtendedString;
class Prs3d_LineAspect;
class Prs3d_BasicAspect;
class TopoDS_Shape;
class SelectMgr_EntityOwner;
class SelectMgr_Filter;
//! The Interactive Context allows you to manage graphic behavior and selection of Interactive Objects in one or more viewers.

View File

@@ -22,7 +22,9 @@
#include <SelectMgr_SelectableObject.hxx>
class AIS_InteractiveContext;
class Graphic3d_MaterialAspect;
class Prs3d_BasicAspect;
class Bnd_Box;
class V3d_View;
//! Defines a class of objects with display and selection services.

View File

@@ -257,29 +257,27 @@ Standard_Boolean AIS_LightSource::ProcessDragging (const Handle(AIS_InteractiveC
{
case AIS_DragAction_Start:
{
myStartTransform = theDragFrom;
myLocTrsfStart = LocalTransformation();
return Standard_True;
}
case AIS_DragAction_Update:
{
mySensSphere->ResetLastDetectedPoint();
SetLocalTransformation (myLocTrsfStart);
theCtx->MainSelector()->Pick (theDragFrom.x(), theDragFrom.y(), theView);
theCtx->MainSelector()->Pick (myStartTransform.x(), myStartTransform.y(), theView);
gp_Pnt aStartPosition = mySensSphere->LastDetectedPoint();
mySensSphere->ResetLastDetectedPoint();
theCtx->MainSelector()->Pick (theDragTo.x(), theDragTo.y(), theView);
gp_Pnt aCurrPosition = mySensSphere->LastDetectedPoint();
if (aCurrPosition.X() != RealLast()
&& aStartPosition.Distance (aCurrPosition) > Precision::Confusion())
if (aCurrPosition.X() != RealLast() && aStartPosition.Distance (aCurrPosition) > Precision::Confusion())
{
gp_Quaternion aQRot;
aQRot.SetRotation (gp_Vec (gp_Pnt (0, 0, 0), aStartPosition), gp_Vec (gp_Pnt (0, 0, 0), aCurrPosition));
gp_Trsf aTrsf;
aTrsf.SetRotation (aQRot);
SetLocalTransformation (myLocTrsfStart * aTrsf);
const Standard_Integer aHiMod = HasHilightMode() ? HilightMode() : 0;
theOwner->UpdateHighlightTrsf (theCtx->CurrentViewer(), theCtx->MainPrsMgr(), aHiMod);
myLocTrsfStart = LocalTransformation();
myStartTransform = theDragTo;
theOwner->Selectable()->ClearDynamicHighlight (theCtx->MainPrsMgr());
theCtx->HilightWithColor (this, Handle(Prs3d_Drawer)(), false);
}
return Standard_True;
}
@@ -477,7 +475,7 @@ void AIS_LightSource::updateLightLocalTransformation()
// =======================================================================
void AIS_LightSource::setLocalTransformation (const Handle(TopLoc_Datum3D)& theTrsf)
{
const gp_Trsf aTrsf = !theTrsf.IsNull() ? theTrsf->Transformation() : gp_Trsf();
const gp_Trsf aTrsf = theTrsf->Transformation();
switch (myLightSource->Type())
{
case Graphic3d_TypeOfLightSource_Ambient:

View File

@@ -20,6 +20,7 @@
#include <Graphic3d_CLight.hxx>
#include <SelectMgr_EntityOwner.hxx>
class Prs3d_ShadingAspect;
class Select3D_SensitiveSphere;
//! Interactive object for a light source.
@@ -259,6 +260,7 @@ protected:
Aspect_TypeOfMarker myCodirMarkerType; //!< icon of arrow co-directional to camera direction (look from)
Aspect_TypeOfMarker myOpposMarkerType; //!< icon of arrow opposite to camera direction (look at)
Graphic3d_Vec2i myStartTransform; //!< position of starting transformation
gp_Trsf myLocTrsfStart; //!< object transformation before transformation
Standard_Real mySize; //!< presentation size
Standard_Integer myNbArrows; //!< number of directional light arrows

View File

@@ -24,6 +24,7 @@
class Geom_Plane;
class Geom_Axis2Placement;
class gp_Pnt;
//! Constructs plane datums to be used in construction of
//! composite shapes.

View File

@@ -41,6 +41,7 @@ class AIS_InteractiveContext;
class AIS_Point;
class AIS_RubberBand;
class AIS_XRTrackedDevice;
class Graphic3d_Camera;
class SelectMgr_EntityOwner;
class V3d_View;
class WNT_HIDSpaceMouse;
@@ -441,13 +442,10 @@ public: //! @name resize events
virtual void ProcessInput() Standard_OVERRIDE {}
//! Handle focus event.
//! Default implementation resets cached input state (pressed keys).
//! Default implementation does nothing.
virtual void ProcessFocus (bool theIsActivated) Standard_OVERRIDE
{
if (!theIsActivated)
{
ResetViewInput();
}
(void )theIsActivated;
}
//! Handle window close event.

View File

@@ -27,13 +27,13 @@
#include <Prs3d_Text.hxx>
#include <Prs3d_ToolDisk.hxx>
#include <Prs3d_ToolSphere.hxx>
#include <Select3D_SensitivePrimitiveArray.hxx>
#include <SelectMgr_SequenceOfOwner.hxx>
#include <V3d.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_ViewCube, AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(AIS_ViewCubeOwner, SelectMgr_EntityOwner)
IMPLEMENT_STANDARD_RTTIEXT(AIS_ViewCubeSensitive, Select3D_SensitivePrimitiveArray)
namespace
{
@@ -56,48 +56,46 @@ namespace
}
}
//=======================================================================
//function : AIS_ViewCubeSensitive
//purpose :
//=======================================================================
AIS_ViewCubeSensitive::AIS_ViewCubeSensitive (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(Graphic3d_ArrayOfTriangles)& theTris)
: Select3D_SensitivePrimitiveArray (theOwner)
//! Simple sensitive element for picking by point only.
class AIS_ViewCubeSensitive : public Select3D_SensitivePrimitiveArray
{
InitTriangulation (theTris->Attributes(), theTris->Indices(), TopLoc_Location());
}
//=======================================================================
//function : Matches
//purpose :
//=======================================================================
Standard_Boolean AIS_ViewCubeSensitive::Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult)
{
return isValidRay (theMgr) && Select3D_SensitivePrimitiveArray::Matches (theMgr, thePickResult);
}
//=======================================================================
//function : isValidRay
//purpose :
//=======================================================================
bool AIS_ViewCubeSensitive::isValidRay (const SelectBasics_SelectingVolumeManager& theMgr) const
{
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
DEFINE_STANDARD_RTTI_INLINE(AIS_ViewCubeSensitive, Select3D_SensitivePrimitiveArray)
public:
//! Constructor.
AIS_ViewCubeSensitive (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(Graphic3d_ArrayOfTriangles)& theTris)
: Select3D_SensitivePrimitiveArray (theOwner)
{
// disallow rectangular selection
return false;
InitTriangulation (theTris->Attributes(), theTris->Indices(), TopLoc_Location());
}
if (AIS_ViewCubeOwner* anOwner = dynamic_cast<AIS_ViewCubeOwner* >(myOwnerId.get()))
//! Checks whether element overlaps current selecting volume.
virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult) Standard_OVERRIDE
{
const Standard_Real anAngleToler = 10.0 * M_PI / 180.0;
const gp_Dir aRay = theMgr.GetViewRayDirection();
const gp_Dir aDir = V3d::GetProjAxis (anOwner->MainOrientation());
return !aRay.IsNormal (aDir, anAngleToler);
return isValidRay (theMgr)
&& Select3D_SensitivePrimitiveArray::Matches (theMgr, thePickResult);
}
return true;
}
//! Checks if picking ray can be used for detection.
bool isValidRay (const SelectBasics_SelectingVolumeManager& theMgr) const
{
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
{
// disallow rectangular selection
return false;
}
if (AIS_ViewCubeOwner* anOwner = dynamic_cast<AIS_ViewCubeOwner* >(myOwnerId.get()))
{
const Standard_Real anAngleToler = 10.0 * M_PI / 180.0;
const gp_Dir aRay = theMgr.GetViewRayDirection();
const gp_Dir aDir = V3d::GetProjAxis (anOwner->MainOrientation());
return !aRay.IsNormal (aDir, anAngleToler);
}
return true;
}
};
//=======================================================================
//function : IsBoxSide

View File

@@ -24,7 +24,6 @@
#include <Prs3d_TextAspect.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <V3d_TypeOfOrientation.hxx>
#include <Select3D_SensitivePrimitiveArray.hxx>
class AIS_AnimationCamera;
class AIS_ViewCubeOwner;
@@ -725,25 +724,4 @@ protected:
};
//! Simple sensitive element for picking by point only.
class AIS_ViewCubeSensitive : public Select3D_SensitivePrimitiveArray
{
DEFINE_STANDARD_RTTIEXT(AIS_ViewCubeSensitive, Select3D_SensitivePrimitiveArray)
public:
//! Constructor.
Standard_EXPORT AIS_ViewCubeSensitive (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(Graphic3d_ArrayOfTriangles)& theTris);
//! Checks whether element overlaps current selecting volume.
Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
protected:
//! Checks if picking ray can be used for detection.
Standard_EXPORT bool isValidRay (const SelectBasics_SelectingVolumeManager& theMgr) const;
};
#endif // _AIS_ViewCube_HeaderFile

View File

@@ -29,6 +29,9 @@
#include <Standard_Handle.hxx>
#include <TColStd_Array1OfReal.hxx>
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class gp_Pnt2d;
class gp_Vec2d;
class Geom2d_BezierCurve;

View File

@@ -29,6 +29,9 @@
#include <TColStd_Array1OfReal.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_CurveType.hxx>
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class gp_Pnt2d;
class gp_Dir2d;
class gp_Lin2d;

View File

@@ -23,6 +23,10 @@
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfReal.hxx>
class Standard_NoSuchObject;
class Standard_DomainError;
class Standard_OutOfRange;
class Standard_TypeMismatch;
class gp_Pnt2d;
class gp_Vec2d;
class gp_Lin2d;

View File

@@ -29,6 +29,9 @@
#include <TColStd_Array1OfReal.hxx>
#include <GeomAbs_CurveType.hxx>
class Standard_OutOfRange;
class Standard_NoSuchObject;
class Standard_DomainError;
class gp_Pnt;
class gp_Vec;
class Geom_BezierCurve;

View File

@@ -21,6 +21,7 @@
#include <gp_Pnt2d.hxx>
#include <TopAbs_Orientation.hxx>
class gp_Pnt2d;
class Adaptor3d_HVertex;
DEFINE_STANDARD_HANDLE(Adaptor3d_HVertex, Standard_Transient)

View File

@@ -34,6 +34,8 @@
#include <TColGeom_HArray1OfSurface.hxx>
#include <AdvApp2Var_EvaluatorFunc2Var.hxx>
#include <Standard_OStream.hxx>
class Standard_OutOfRange;
class Standard_ConstructionError;
class AdvApprox_Cutting;
class AdvApp2Var_Criterion;
class Geom_BSplineSurface;

View File

@@ -28,6 +28,7 @@
#include <GeomAbs_IsoType.hxx>
#include <Standard_Real.hxx>
#include <TColStd_HArray1OfReal.hxx>
class Standard_NoSuchObject;
class AdvApp2Var_Iso;
class AdvApp2Var_Node;

View File

@@ -26,6 +26,7 @@
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
class Standard_NoSuchObject;
class AdvApp2Var_Patch;

View File

@@ -37,6 +37,8 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <Standard_OStream.hxx>
class Standard_OutOfRange;
class Standard_ConstructionError;
class AdvApprox_Cutting;

View File

@@ -25,6 +25,7 @@
#include <Standard_Real.hxx>
#include <AdvApprox_Cutting.hxx>
#include <Standard_Boolean.hxx>
class Standard_DomainError;

View File

@@ -33,6 +33,8 @@
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class PLib_JacobiPolynomial;
class Standard_OutOfRange;
class Standard_ConstructionError;
//! Approximate a function on an intervall [First,Last]

View File

@@ -29,6 +29,9 @@
#include <TColStd_Array1OfInteger.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Real.hxx>
class StdFail_NotDone;
class Standard_DomainError;
class Standard_OutOfRange;
//! Bspline approximation of a surface.

View File

@@ -31,6 +31,9 @@
#include <math_Vector.hxx>
class FEmTool_ElementaryCriterion;
class FEmTool_Curve;
class Standard_NotImplemented;
class Standard_DomainError;
class AppDef_MultiLine;
class math_Matrix;

View File

@@ -28,6 +28,9 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_ConstructionError;
class Standard_DimensionError;
class Standard_OutOfRange;
class AppDef_MultiPointConstraint;

View File

@@ -27,6 +27,9 @@
#include <TColgp_HArray1OfVec.hxx>
#include <TColgp_HArray1OfVec2d.hxx>
class Standard_OutOfRange;
class Standard_ConstructionError;
class Standard_DimensionError;
class gp_Vec;
class gp_Vec2d;

View File

@@ -28,6 +28,8 @@
#include <Standard_Integer.hxx>
#include <math_Vector.hxx>
#include <TColStd_Array1OfReal.hxx>
class Standard_NotImplemented;
class Standard_DomainError;
class FEmTool_Curve;
class math_Matrix;

View File

@@ -35,6 +35,14 @@
#include <math_Vector.hxx>
#include <AppParCurves_Constraint.hxx>
class AppDef_SmoothCriterion;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_DomainError;
class Standard_ConstructionError;
class StdFail_NotDone;
class gp_VectorWithNullMagnitude;
class AppDef_MultiLine;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class FEmTool_Curve;
class FEmTool_Assembly;

View File

@@ -26,6 +26,23 @@
#include <Standard_Real.hxx>
#include <math_IntegerVector.hxx>
class math_Matrix;
class AppParCurves_MultiPoint;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class AppParCurves_ConstraintCouple;
class AppParCurves_LeastSquare;
class AppParCurves_ResolConstraint;
class AppParCurves_Function;
class AppParCurves_BSpFunction;
class AppParCurves_Gradient;
class AppParCurves_Gradient_BFGS;
class AppParCurves_ParLeastSquare;
class AppParCurves_ResConstraint;
class AppParCurves_ParFunction;
class AppParCurves_BSpGradient;
class AppParCurves_BSpGradient_BFGS;
class AppParCurves_BSpParLeastSquare;
class AppParCurves_BSpParFunction;
//! Parallel Approximation in n curves.

View File

@@ -30,6 +30,10 @@
#include <TColStd_Array1OfInteger.hxx>
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_ConstructionError;
class AppParCurves_MultiCurve;
class gp_Pnt;
class gp_Pnt2d;
class gp_Vec;

View File

@@ -28,6 +28,9 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_ConstructionError;
class AppParCurves_MultiPoint;
class gp_Pnt;
class gp_Pnt2d;

View File

@@ -27,6 +27,8 @@
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_Transient;
class Standard_OutOfRange;
class Standard_DimensionError;
class gp_Pnt;
class gp_Pnt2d;

View File

@@ -25,6 +25,7 @@
#include <Standard_Boolean.hxx>
#include <AppParCurves_SequenceOfMultiCurve.hxx>
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;

View File

@@ -44,6 +44,9 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_OStream.hxx>
class Approx_SweepFunction;
class StdFail_NotDone;
class Standard_DomainError;
class Standard_OutOfRange;
class AdvApprox_Cutting;

View File

@@ -31,6 +31,8 @@
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <GeomAbs_Shape.hxx>
class Standard_NotImplemented;
class Standard_OutOfRange;
class gp_Pnt;

View File

@@ -22,6 +22,7 @@
#include <Standard_Handle.hxx>
#include <Quantity_Color.hxx>
class Quantity_Color;
//! This class allows the definition of

View File

@@ -24,6 +24,9 @@
#include <Standard_Real.hxx>
#include <Aspect_Grid.hxx>
class Standard_NegativeValue;
class Standard_NullValue;
class Standard_NumericError;
class Aspect_CircularGrid : public Aspect_Grid
{

View File

@@ -24,6 +24,7 @@
#include <Standard_Integer.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <Standard_Boolean.hxx>
class Aspect_IdentDefinitionError;
//! This class permits the creation and control of integer identifiers.

View File

@@ -23,6 +23,9 @@
#include <Standard_Real.hxx>
#include <Aspect_Grid.hxx>
#include <Standard_Boolean.hxx>
class Standard_NegativeValue;
class Standard_NullValue;
class Standard_NumericError;
class Aspect_RectangularGrid : public Aspect_Grid
{

View File

@@ -27,6 +27,7 @@
#include <BOPAlgo_ListOfCheckResult.hxx>
#include <Standard_Real.hxx>
#include <TopAbs_ShapeEnum.hxx>
class TopoDS_Shape;
//! check the validity of argument(s) for Boolean Operations

View File

@@ -27,6 +27,7 @@
#include <TopAbs_ShapeEnum.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
class TopoDS_Shape;
class BOPAlgo_PaveFiller;
//!

View File

@@ -38,6 +38,8 @@
#include <TopAbs_ShapeEnum.hxx>
class IntTools_Context;
class TopoDS_Shape;
class BOPAlgo_PaveFiller;
class TopoDS_Solid;
//!
//! The class is a General Fuse algorithm - base algorithm for the

View File

@@ -26,6 +26,7 @@
#include <TopAbs_Orientation.hxx>
#include <BOPAlgo_BuilderArea.hxx>
#include <NCollection_BaseAllocator.hxx>
class TopoDS_Face;
//! The algorithm to build new faces from the given faces and

View File

@@ -471,7 +471,6 @@ void BOPAlgo_Builder::BuildSplitFaces(const Message_ProgressRange& theRange)
for (j=1; j<=aNbPBIn; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aMPBIn(j);
nSp=aPB->Edge();
Standard_ASSERT(nSp >= 0, "Face information is not up to date", continue);
aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp)));
//
aSp.Orientation(TopAbs_FORWARD);

View File

@@ -24,6 +24,7 @@
#include <BOPAlgo_CheckStatus.hxx>
#include <TopTools_ListOfShape.hxx>
#include <Standard_Real.hxx>
class TopoDS_Shape;
//! contains information about faulty shapes and faulty types

View File

@@ -26,6 +26,7 @@
#include <TopoDS_Solid.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
class TopoDS_Solid;
class BOPAlgo_PaveFiller;

View File

@@ -53,7 +53,10 @@
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
class IntTools_Context;
class BOPDS_DS;
class BOPAlgo_SectionAttribute;
class BOPDS_PaveBlock;
class BOPDS_CommonBlock;
class gp_Pnt;
class BOPDS_Curve;
class TopoDS_Vertex;

View File

@@ -152,7 +152,6 @@ void BOPAlgo_PaveFiller::CheckSelfInterference()
Standard_Integer iPB, aNbPB = aMPBF.Extent();
for (iPB = 1; iPB <= aNbPB; ++iPB) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBF(iPB);
Standard_ASSERT(aPB->HasEdge(), "Face information is not up to date", continue);
const TopoDS_Shape& aE = myDS->Shape(aPB->Edge());
// add connection
TopTools_IndexedMapOfShape* pMSOr = aMCSI.ChangeSeek(aE);

View File

@@ -237,42 +237,13 @@ typedef NCollection_Vector<BOPAlgo_FaceFace> BOPAlgo_VectorOfFaceFace;
//=======================================================================
void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
{
// Update face info for all Face/Face intersection pairs
// and also for the rest of the faces with FaceInfo already initialized,
// i.e. anyhow touched faces.
myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
Standard_Integer iSize = myIterator->ExpectedLength();
// Collect faces from intersection pairs
TColStd_MapOfInteger aMIFence;
Standard_Integer nF1, nF2;
for (; myIterator->More(); myIterator->Next())
{
myIterator->Value(nF1, nF2);
aMIFence.Add (nF1);
aMIFence.Add (nF2);
}
// Collect the rest of the touched faces
for (Standard_Integer i = 0; i < myDS->NbSourceShapes(); ++i)
{
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo (i);
if (aSI.ShapeType() == TopAbs_FACE && aSI.HasReference())
{
aMIFence.Add (i);
}
}
// Update face info
myDS->UpdateFaceInfoOn (aMIFence);
myDS->UpdateFaceInfoIn (aMIFence);
if (!iSize)
{
// no intersection pairs found
return;
}
Message_ProgressScope aPSOuter(theRange, NULL, 1);
if (!iSize) {
return;
}
//
BOPDS_VectorOfInterfFF& aFFs = myDS->InterfFF();
aFFs.SetIncrement(iSize);
//
@@ -284,8 +255,23 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
// Post-processing options
Standard_Boolean bSplitCurve = Standard_False;
//
// Fence map to store faces with updated FaceInfo structure
TColStd_MapOfInteger aMIFence;
// Prepare the pairs of faces for intersection
BOPAlgo_VectorOfFaceFace aVFaceFace;
Standard_Integer nF1, nF2;
//
for (; myIterator->More(); myIterator->Next()) {
myIterator->Value(nF1, nF2);
aMIFence.Add (nF1);
aMIFence.Add (nF2);
}
// Update face info
myDS->UpdateFaceInfoOn (aMIFence);
myDS->UpdateFaceInfoIn (aMIFence);
// Initialize interferences
myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
for (; myIterator->More(); myIterator->Next()) {
if (UserBreak(aPSOuter))

View File

@@ -634,7 +634,6 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange)
for (j = 1; j <= aNbPBIn; ++j) {
const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(j);
nE=aPB->Edge();
Standard_ASSERT(nE >= 0, "Face information is not up to date", continue);
const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
//
BOPAlgo_MPC& aMPC=aVMPC.Appended();

View File

@@ -23,6 +23,7 @@
#include <NCollection_BaseAllocator.hxx>
#include <TopTools_ListOfShape.hxx>
class BOPAlgo_PaveFiller;
class TopoDS_Shape;

View File

@@ -26,6 +26,7 @@
#include <IntTools_Context.hxx>
#include <NCollection_BaseAllocator.hxx>
#include <TopTools_ListOfShape.hxx>
class BOPAlgo_WireEdgeSet;
class TopoDS_Wire;
class TopoDS_Face;

View File

@@ -31,6 +31,7 @@
#include <Precision.hxx>
#include <Standard_Boolean.hxx>
#include <TopAbs_ShapeEnum.hxx>
class BOPDS_DS;
class IntTools_Context;
//! The class BOPDS_Iterator is

View File

@@ -28,6 +28,8 @@
#include <Standard_Real.hxx>
#include <Standard_Transient.hxx>
#include <TColStd_MapOfInteger.hxx>
class BOPDS_Pave;
class Bnd_Box;
class BOPDS_PaveBlock;

View File

@@ -26,6 +26,7 @@
#include <TColStd_ListOfInteger.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
class BOPDS_DS;
//! The class BOPDS_SubIterator is used to compute intersections between

View File

@@ -22,6 +22,8 @@
#include <BOPAlgo_Operation.hxx>
#include <Draw_Interpretor.hxx>
class BOPTest_Objects;
class BOPTest_DrawableShape;
class Message_Report;
class BOPTest

View File

@@ -26,6 +26,7 @@
#include <Standard_CString.hxx>
class Draw_Text3D;
class TopoDS_Shape;
class Draw_Color;
class gp_Pnt;
class Draw_Display;

View File

@@ -28,6 +28,7 @@ class gp_Vec;
class Geom2d_Curve;
class Geom_Curve;
class BRepAdaptor_Surface;
class ProjLib_ProjectedCurve;
class IntTools_Context;

View File

@@ -25,6 +25,7 @@
#include <TopAbs_ShapeEnum.hxx>
#include <Standard_Boolean.hxx>
#include <TopTools_ListOfShape.hxx>
class TopoDS_Shape;

View File

@@ -30,6 +30,8 @@
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_ListOfTriangulation.hxx>
class Standard_NullObject;
class Standard_DomainError;
class TopoDS_Face;
class Geom_Surface;
class TopLoc_Location;

View File

@@ -26,7 +26,10 @@
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class Geom_Surface;
class Standard_NullObject;
class TopLoc_Location;
class gp_Pnt;
class BRep_CurveRepresentation;
class BRep_CurveOn2Surfaces;

View File

@@ -27,6 +27,7 @@
class Geom2d_Curve;
class Geom_Surface;
class TopLoc_Location;
class gp_Pnt2d;
class BRep_CurveRepresentation;

View File

@@ -27,6 +27,7 @@
class Geom2d_Curve;
class Geom_Surface;
class TopLoc_Location;
class gp_Pnt2d;
class gp_Pnt;
class BRep_CurveRepresentation;

View File

@@ -24,6 +24,8 @@
#include <Standard_Transient.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_Shape.hxx>
class Standard_DomainError;
class TopLoc_Location;
class Geom_Surface;
class Poly_Triangulation;
class Geom_Curve;

View File

@@ -24,6 +24,8 @@
#include <Standard_Real.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Boolean.hxx>
class Standard_DomainError;
class TopLoc_Location;
class Geom_Curve;
class Geom2d_Curve;
class Geom_Surface;

View File

@@ -23,7 +23,9 @@
#include <BRep_CurveRepresentation.hxx>
#include <Standard_Boolean.hxx>
class Poly_Polygon3D;
class Standard_DomainError;
class TopLoc_Location;
class BRep_CurveRepresentation;
class BRep_Polygon3D;

View File

@@ -24,7 +24,9 @@
#include <Standard_Boolean.hxx>
class Poly_Polygon2D;
class Geom_Surface;
class Standard_DomainError;
class TopLoc_Location;
class BRep_CurveRepresentation;
class BRep_PolygonOnSurface;

View File

@@ -25,6 +25,7 @@
class Poly_PolygonOnTriangulation;
class Poly_Triangulation;
class TopLoc_Location;
class BRep_CurveRepresentation;
class BRep_PolygonOnTriangulation;

View File

@@ -26,6 +26,7 @@
#include <Standard_Boolean.hxx>
#include <TopoDS_TFace.hxx>
class Geom_Surface;
class TopLoc_Location;
class TopoDS_TShape;
class BRep_TFace;

View File

@@ -24,6 +24,7 @@
#include <Standard_Real.hxx>
#include <BRep_ListOfPointRepresentation.hxx>
#include <TopoDS_TVertex.hxx>
class gp_Pnt;
class TopoDS_TShape;

View File

@@ -32,6 +32,11 @@
#include <TColStd_Array1OfReal.hxx>
#include <GeomAbs_CurveType.hxx>
class Standard_NullObject;
class Standard_DomainError;
class Standard_OutOfRange;
class Standard_NoSuchObject;
class TopoDS_Wire;
class TopoDS_Edge;
class gp_Pnt;
class gp_Vec;

View File

@@ -29,7 +29,14 @@
#include <TColStd_Array1OfReal.hxx>
#include <GeomAbs_CurveType.hxx>
class Standard_NullObject;
class Standard_DomainError;
class Standard_OutOfRange;
class Standard_NoSuchObject;
class TopoDS_Edge;
class TopoDS_Face;
class gp_Trsf;
class GeomAdaptor_Curve;
class Adaptor3d_CurveOnSurface;
class gp_Pnt;
class gp_Vec;

View File

@@ -24,6 +24,9 @@
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <Geom2dAdaptor_Curve.hxx>
class Standard_NullObject;
class TopoDS_Edge;
class TopoDS_Face;
//! The Curve2d from BRepAdaptor allows to use an Edge

View File

@@ -25,6 +25,10 @@
#include <TColStd_Array1OfReal.hxx>
#include <TopoDS_Face.hxx>
class Standard_OutOfRange;
class Standard_DomainError;
class Standard_NoSuchObject;
class gp_Trsf;
class gp_Pnt;
class gp_Vec;
class gp_Pln;

View File

@@ -24,6 +24,7 @@
#include <Standard_Transient.hxx>
#include <TopTools_ListOfShape.hxx>
#include <Standard_Boolean.hxx>
class Standard_ConstructionError;
class TopoDS_Shape;

View File

@@ -25,6 +25,7 @@
#include <TopoDS_Face.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
class TopoDS_Face;
class TopoDS_Wire;

Some files were not shown because too many files have changed in this diff Show More