Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0eaebd1d5a |
@@ -661,10 +661,8 @@ endif()
|
||||
if (CAN_USE_GLES2)
|
||||
if (USE_GLES2)
|
||||
add_definitions (-DHAVE_GLES2_EXT)
|
||||
if (NOT IOS)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
|
||||
endif()
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
|
||||
@@ -1126,8 +1124,14 @@ if (BUILD_SAMPLES_MFC)
|
||||
add_subdirectory(samples/mfc/standard/mfcsample)
|
||||
add_subdirectory(samples/mfc/standard/01_Geometry)
|
||||
add_subdirectory(samples/mfc/standard/02_Modeling)
|
||||
add_subdirectory(samples/mfc/standard/03_ImportExport)
|
||||
add_subdirectory(samples/mfc/standard/04_HLR)
|
||||
add_subdirectory(samples/mfc/standard/03_Viewer2d)
|
||||
add_subdirectory(samples/mfc/standard/04_Viewer3d)
|
||||
add_subdirectory(samples/mfc/standard/05_ImportExport)
|
||||
add_subdirectory(samples/mfc/standard/06_Ocaf)
|
||||
add_subdirectory(samples/mfc/standard/07_Triangulation)
|
||||
add_subdirectory(samples/mfc/standard/08_HLR)
|
||||
add_subdirectory(samples/mfc/standard/09_Animation)
|
||||
add_subdirectory(samples/mfc/standard/10_Convert)
|
||||
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) MFC Sample projects added")
|
||||
endif()
|
||||
|
@@ -454,7 +454,6 @@ t TKRWMesh
|
||||
n RWGltf
|
||||
n RWMesh
|
||||
n RWObj
|
||||
n RWPly
|
||||
n DFBrowser
|
||||
n DFBrowserPane
|
||||
n DFBrowserPaneXDE
|
||||
|
@@ -115,9 +115,6 @@ if (MSVC)
|
||||
endif()
|
||||
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
|
||||
endif()
|
||||
if (BUILD_SHARED_LIBS)
|
||||
if (APPLE)
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
|
@@ -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]
|
||||
|
@@ -1251,13 +1251,13 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
|
||||
return "$isFound"
|
||||
}
|
||||
|
||||
set aX11LibPath [wokdep:SearchLib "X11" "$::ARCH"]
|
||||
if { "$aX11LibPath" == "" } {
|
||||
set aX11LibPath [wokdep:SearchLib "X11" "$::ARCH" "/usr/X11/lib"]
|
||||
if { "$aX11LibPath" != "" } {
|
||||
set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH"]
|
||||
if { "$aXmuLibPath" == "" } {
|
||||
set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH" "/usr/X11/lib"]
|
||||
if { "$aXmuLibPath" != "" } {
|
||||
#lappend ::CSF_OPT_LIB$::ARCH "/usr/X11/lib"
|
||||
} else {
|
||||
lappend anErrLib$::ARCH "Error: '${::SYS_LIB_PREFIX}X11.${::SYS_LIB_SUFFIX}' not found (X11)"
|
||||
lappend anErrLib$::ARCH "Error: '${::SYS_LIB_PREFIX}Xmu.${::SYS_LIB_SUFFIX}' not found (X11)"
|
||||
set isFound "false"
|
||||
}
|
||||
}
|
||||
|
@@ -236,11 +236,9 @@ proc gendoc {args} {
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "s"} {
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts "Warning: search is not used with PDF and will be ignored."
|
||||
if { [ lsearch $args_names "pdf" ] == -1 } {
|
||||
continue
|
||||
}
|
||||
|
||||
if {$args_values(s) != "NULL"} {
|
||||
set SEARCH_MODE $args_values(s)
|
||||
} else {
|
||||
@@ -249,16 +247,16 @@ proc gendoc {args} {
|
||||
}
|
||||
} elseif {$arg_n == "mathjax"} {
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts "Warning: MathJax is not used with PDF and will be ignored."
|
||||
}
|
||||
|
||||
set possible_mathjax_loc $args_values(mathjax)
|
||||
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
|
||||
set MATHJAX_LOCATION $args_values(mathjax)
|
||||
puts "$MATHJAX_LOCATION"
|
||||
set possible_mathjax_loc $args_values(mathjax)
|
||||
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
|
||||
set MATHJAX_LOCATION $args_values(mathjax)
|
||||
puts "$MATHJAX_LOCATION"
|
||||
} else {
|
||||
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
|
||||
puts " MathJax will be used from $MATHJAX_LOCATION"
|
||||
}
|
||||
} else {
|
||||
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
|
||||
puts " MathJax will be used from $MATHJAX_LOCATION"
|
||||
puts "Warning: MathJax is not used with pdf and will be ignored."
|
||||
}
|
||||
} else {
|
||||
puts "\nWrong argument: $arg_n"
|
||||
@@ -835,7 +833,6 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
|
||||
puts $doxyFile "PROJECT_NUMBER = $occt_version"
|
||||
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
|
||||
puts $doxyFile "PROJECT_LOGO = [OCCDoc_GetDoxDir]/resources/occ_logo.png"
|
||||
puts $doxyFile "EXAMPLE_PATH = [OCCDoc_GetSourceDir $productsPath]"
|
||||
|
||||
set PARAM_INPUT "INPUT ="
|
||||
set PARAM_IMAGEPATH "IMAGE_PATH = [OCCDoc_GetDoxDir]/resources/ "
|
||||
|
@@ -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"
|
||||
|
@@ -39,10 +39,6 @@ win32 {
|
||||
DEFINES += _SCL_SECURE_NO_WARNINGS
|
||||
} else {
|
||||
CONFIG += c++11
|
||||
clang {
|
||||
QMAKE_CFLAGS_WARN_ON += -Wshorten-64-to-32
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wshorten-64-to-32
|
||||
}
|
||||
QMAKE_CFLAGS += -fexceptions
|
||||
QMAKE_CXXFLAGS += -fexceptions
|
||||
QMAKE_CXXFLAGS += -fvisibility=default
|
||||
|
@@ -26,7 +26,6 @@ HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
|
||||
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
|
||||
HAVE_ZLIB { CSF_ZLIB = -lzlib }
|
||||
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
|
||||
HAVE_DRACO { CSF_Draco = -ldraco }
|
||||
win32 {
|
||||
CSF_kernel32 = -lkernel32
|
||||
CSF_advapi32 = -ladvapi32
|
||||
|
@@ -20,13 +20,13 @@ export aRapidJson=
|
||||
export aDraco=
|
||||
|
||||
# build stages to perform
|
||||
export toSimulator=0
|
||||
export isStatic=1
|
||||
export toCMake=1
|
||||
export toClean=1
|
||||
export toMake=1
|
||||
export toInstall=1
|
||||
export toPack=0
|
||||
export toPackFat=0
|
||||
export toDebug=0
|
||||
|
||||
export BUILD_ModelingData=ON
|
||||
@@ -41,25 +41,13 @@ export USE_RAPIDJSON=OFF
|
||||
export USE_DRACO=OFF
|
||||
|
||||
export IPHONEOS_DEPLOYMENT_TARGET=8.0
|
||||
#export anAbiList="iPhoneOS|arm64 iPhoneSimulator|arm64 iPhoneSimulator|x86_64"
|
||||
export anAbiList="iPhoneOS|arm64"
|
||||
export anAbi=arm64
|
||||
#export anAbi=x86_64
|
||||
|
||||
if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
|
||||
source "${aScriptDir}/ios_custom.sh"
|
||||
fi
|
||||
|
||||
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
YEAR=$(date +"%Y")
|
||||
MONTH=$(date +"%m")
|
||||
DAY=$(date +"%d")
|
||||
aRevision=-${YEAR}-${MONTH}-${DAY}
|
||||
#aRevision=-${aGitBranch}
|
||||
|
||||
set -o pipefail
|
||||
|
||||
aBuildType="Release"
|
||||
aBuildTypePrefix=
|
||||
if [[ $toDebug == 1 ]]; then
|
||||
@@ -70,52 +58,59 @@ aLibType="Shared"
|
||||
if [[ $isStatic == 1 ]]; then
|
||||
aLibType="Static"
|
||||
fi
|
||||
aPlatformAndCompiler=ios-${anAbi}${aBuildTypePrefix}-clang
|
||||
aPlatformSdk="iphoneos"
|
||||
aSysRoot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
|
||||
if [[ $toSimulator == 1 ]]; then
|
||||
#anAbi=x86_64
|
||||
aPlatformAndCompiler=ios-simulator64-${anAbi}${aBuildTypePrefix}-clang
|
||||
aPlatformSdk="iphonesimulator"
|
||||
aSysRoot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
|
||||
fi
|
||||
|
||||
function buildArch {
|
||||
anAbi=$1
|
||||
aPlatformSdk=$2
|
||||
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
|
||||
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
|
||||
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
|
||||
|
||||
aPlatformAndCompiler=${aPlatformSdk}-${anAbi}${aBuildTypePrefix}-clang
|
||||
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
|
||||
rm -r -f "$aWorkDir"
|
||||
rm -r -f "$aDestDir"
|
||||
fi
|
||||
mkdir -p "$aWorkDir"
|
||||
mkdir -p "$aDestDir"
|
||||
rm -f "$aLogFile"
|
||||
|
||||
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
|
||||
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
|
||||
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
|
||||
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
|
||||
rm -r -f "$aWorkDir"
|
||||
rm -r -f "$aDestDir"
|
||||
# include some information about OCCT into archive
|
||||
echo \<pre\>> "${aWorkDir}/VERSION.html"
|
||||
git status >> "${aWorkDir}/VERSION.html"
|
||||
git log -n 100 >> "${aWorkDir}/VERSION.html"
|
||||
echo \</pre\>>> "${aWorkDir}/VERSION.html"
|
||||
|
||||
pushd "$aWorkDir"
|
||||
|
||||
aTimeZERO=$SECONDS
|
||||
set -o pipefail
|
||||
|
||||
function logDuration {
|
||||
if [[ $1 == 1 ]]; then
|
||||
aDur=$(($4 - $3))
|
||||
echo $2 time: $aDur sec>> "$aLogFile"
|
||||
fi
|
||||
mkdir -p "$aWorkDir"
|
||||
mkdir -p "$aDestDir"
|
||||
rm -f "$aLogFile"
|
||||
}
|
||||
|
||||
# include some information about OCCT into archive
|
||||
echo \<pre\>> "${aWorkDir}/VERSION.html"
|
||||
git status >> "${aWorkDir}/VERSION.html"
|
||||
git log -n 100 >> "${aWorkDir}/VERSION.html"
|
||||
echo \</pre\>>> "${aWorkDir}/VERSION.html"
|
||||
|
||||
pushd "$aWorkDir"
|
||||
|
||||
aTimeZERO=$SECONDS
|
||||
|
||||
function logDuration {
|
||||
if [[ $1 == 1 ]]; then
|
||||
aDur=$(($4 - $3))
|
||||
echo $2 time: $aDur sec>> "$aLogFile"
|
||||
fi
|
||||
}
|
||||
|
||||
aSysRoot="/Applications/Xcode.app/Contents/Developer/Platforms/${aPlatformSdk}.platform/Developer/SDKs/${aPlatformSdk}.sdk"
|
||||
|
||||
# (re)generate Make files
|
||||
if [[ $toCMake == 1 ]]; then
|
||||
echo Configuring OCCT for iOS...
|
||||
cmake -G "Unix Makefiles" \
|
||||
# (re)generate Make files
|
||||
if [[ $toCMake == 1 ]]; then
|
||||
echo Configuring OCCT for iOS...
|
||||
cmake -G "Unix Makefiles" \
|
||||
-D CMAKE_SYSTEM_NAME="iOS" \
|
||||
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
|
||||
-D CMAKE_OSX_DEPLOYMENT_TARGET:STRING="$IPHONEOS_DEPLOYMENT_TARGET" \
|
||||
-D CMAKE_OSX_SYSROOT:PATH="$aSysRoot" \
|
||||
-D ENABLE_VISIBILITY:BOOL="TRUE" \
|
||||
-D CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
|
||||
-D CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
|
||||
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
|
||||
@@ -150,118 +145,57 @@ function buildArch {
|
||||
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
|
||||
-D BUILD_MODULE_Draw:BOOL="OFF" \
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" \
|
||||
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
|
||||
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
|
||||
fi
|
||||
aTimeGEN=$SECONDS
|
||||
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
|
||||
|
||||
# clean up from previous build
|
||||
if [[ $toClean == 1 ]]; then
|
||||
make clean
|
||||
fi
|
||||
|
||||
# build the project
|
||||
if [[ $toMake == 1 ]]; then
|
||||
echo Building...
|
||||
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
|
||||
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
|
||||
fi
|
||||
aTimeBUILD=$SECONDS
|
||||
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
|
||||
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
|
||||
|
||||
# install the project
|
||||
if [[ $toInstall == 1 ]]; then
|
||||
echo Installing OCCT into $aDestDir...
|
||||
make install 2>&1 | tee -a "$aLogFile"
|
||||
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
|
||||
echo Platform: ${aPlatformSdk} ABI: ${anAbi} Build: ${aBuildType} IPHONEOS_DEPLOYMENT_TARGET: ${IPHONEOS_DEPLOYMENT_TARGET} > "$aDestDir/build_target.txt"
|
||||
fi
|
||||
aTimeINSTALL=$SECONDS
|
||||
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
|
||||
|
||||
# create an archive
|
||||
if [[ $toPack == 1 ]]; then
|
||||
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
|
||||
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
|
||||
rm ${aDestDir}/../${anArchName} &>/dev/null
|
||||
pushd "$aDestDir"
|
||||
tar -jcf ${aDestDir}/../${anArchName} *
|
||||
popd
|
||||
fi
|
||||
aTimePACK=$SECONDS
|
||||
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
|
||||
|
||||
# finished
|
||||
DURATION=$(($aTimePACK - $aTimeZERO))
|
||||
echo Total time: $DURATION sec
|
||||
logDuration 1 "Total" $aTimeZERO $aTimePACK
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
for anArchIter in $anAbiList
|
||||
do
|
||||
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
|
||||
echo Platform: ${aPlatform} ABI: ${anArch} Build: ${aBuildType}
|
||||
buildArch $anArch $aPlatform
|
||||
done
|
||||
|
||||
# create a FAT archive
|
||||
if [[ $toPackFat == 1 ]]; then
|
||||
for aPlatIter in iPhoneOS iPhoneSimulator
|
||||
do
|
||||
aSuffixFat=${aPlatIter}${aBuildTypePrefix}-clang
|
||||
aFatDir="${aCasSrc}/${aBuildRoot}/${aSuffixFat}"
|
||||
|
||||
# merge per-arch builds into fat builds
|
||||
hasPlatform=0
|
||||
for anArchIter in $anAbiList
|
||||
do
|
||||
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
|
||||
if [[ $aPlatIter != ${aPlatform} ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
aSuffixThin=${aPlatform}-${anArch}${aBuildTypePrefix}-clang
|
||||
anArchDir="${aCasSrc}/${aBuildRoot}/${aSuffixThin}"
|
||||
if [[ $hasPlatform == 0 ]]; then
|
||||
hasPlatform=1
|
||||
echo Packing FAT archive for platform: ${aPlatform}
|
||||
rm -r -f "$aFatDir"
|
||||
mkdir -p "$aFatDir"
|
||||
rsync -r --exclude '*.a' "$anArchDir/" "$aFatDir"
|
||||
rm -f "$aFatDir/build_target.txt"
|
||||
for aLibIter in $anArchDir/lib/*.a; do
|
||||
aLibName=`basename $aLibIter`
|
||||
lipo "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
|
||||
done
|
||||
else
|
||||
for aLibIter in $aFatDir/lib/*.a; do
|
||||
aLibName=`basename $aLibIter`
|
||||
lipo "$aFatDir/lib/$aLibName" "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
|
||||
#lipo -info "$aFatDir/lib/$aLibName"
|
||||
done
|
||||
fi
|
||||
cat "$anArchDir/build_target.txt" >> "$aFatDir/build_target.txt"
|
||||
done
|
||||
|
||||
# create an archive
|
||||
for anArchIter in $anAbiList
|
||||
do
|
||||
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
|
||||
if [[ $aPlatIter != ${aPlatform} ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aSuffixFat}.tar.bz2
|
||||
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
|
||||
rm ${aFatDir}/../${anArchName} &>/dev/null
|
||||
pushd "$aFatDir"
|
||||
tar -jcf ${aFatDir}/../${anArchName} *
|
||||
popd
|
||||
break
|
||||
done
|
||||
done
|
||||
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
|
||||
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
|
||||
fi
|
||||
aTimeGEN=$SECONDS
|
||||
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
|
||||
|
||||
# clean up from previous build
|
||||
if [[ $toClean == 1 ]]; then
|
||||
make clean
|
||||
fi
|
||||
|
||||
# build the project
|
||||
if [[ $toMake == 1 ]]; then
|
||||
echo Building...
|
||||
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
|
||||
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
|
||||
fi
|
||||
aTimeBUILD=$SECONDS
|
||||
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
|
||||
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
|
||||
|
||||
# install the project
|
||||
if [[ $toInstall == 1 ]]; then
|
||||
echo Installing OCCT into $aDestDir...
|
||||
make install 2>&1 | tee -a "$aLogFile"
|
||||
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
|
||||
fi
|
||||
aTimeINSTALL=$SECONDS
|
||||
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
|
||||
|
||||
# create an archive
|
||||
if [[ $toPack == 1 ]]; then
|
||||
YEAR=$(date +"%Y")
|
||||
MONTH=$(date +"%m")
|
||||
DAY=$(date +"%d")
|
||||
aRevision=-${YEAR}-${MONTH}-${DAY}
|
||||
#aRevision=-${aGitBranch}
|
||||
|
||||
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
|
||||
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
|
||||
rm ${aDestDir}/../${anArchName} &>/dev/null
|
||||
pushd "$aDestDir"
|
||||
tar -jcf ${aDestDir}/../${anArchName} *
|
||||
popd
|
||||
fi
|
||||
aTimePACK=$SECONDS
|
||||
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
|
||||
|
||||
# finished
|
||||
DURATION=$(($aTimePACK - $aTimeZERO))
|
||||
echo Total time: $DURATION sec
|
||||
logDuration 1 "Total" $aTimeZERO $aTimePACK
|
||||
|
||||
popd
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# environment configuration template for ios_build.sh (to be renamed as ios_custom_env.sh)
|
||||
# environment configuration template for macos_build.sh (to be renamed as macos_custom_env.sh)
|
||||
export PATH=/Applications/CMake.app/Contents/bin:$PATH
|
||||
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-ios"
|
||||
export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-ios"
|
||||
@@ -6,13 +6,13 @@ export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
|
||||
export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
|
||||
|
||||
# Uncomment to customize building steps
|
||||
#export toSimulator=0
|
||||
#export isStatic=0
|
||||
#export toCMake=1
|
||||
#export toClean=1
|
||||
#export toMake=1
|
||||
#export toInstall=1
|
||||
#export toPack=0
|
||||
#export toPackFat=1
|
||||
#export toDebug=0
|
||||
|
||||
#export BUILD_ModelingData=ON
|
||||
@@ -26,5 +26,5 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
|
||||
#export USE_FREEIMAGE=ON
|
||||
|
||||
#export IPHONEOS_DEPLOYMENT_TARGET=8.0
|
||||
#export anAbiList="iPhoneOS|arm64 iPhoneSimulator|arm64 iPhoneSimulator|x86_64"
|
||||
#export anAbiList="iPhoneOS|arm64"
|
||||
#export anAbi=arm64
|
||||
#export anAbi=x86_64
|
||||
|
@@ -20,13 +20,11 @@ export aRapidJson=
|
||||
export aDraco=
|
||||
|
||||
# build stages to perform
|
||||
export isStatic=0
|
||||
export toCMake=1
|
||||
export toClean=1
|
||||
export toMake=1
|
||||
export toInstall=1
|
||||
export toPack=0
|
||||
export toPackFat=0
|
||||
export toDebug=0
|
||||
|
||||
export BUILD_ModelingData=ON
|
||||
@@ -36,92 +34,72 @@ export BUILD_ApplicationFramework=ON
|
||||
export BUILD_DataExchange=ON
|
||||
export BUILD_Draw=ON
|
||||
|
||||
export USE_FREETYPE=ON
|
||||
export USE_FREEIMAGE=ON
|
||||
export USE_RAPIDJSON=OFF
|
||||
export USE_DRACO=OFF
|
||||
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.10
|
||||
#export anAbiList="arm64 x86_64"
|
||||
export anAbiList="x86_64"
|
||||
aPlatform="macos"
|
||||
#export anAbi=arm64
|
||||
export anAbi=x86_64
|
||||
|
||||
if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
|
||||
source "${aScriptDir}/macos_custom.sh"
|
||||
fi
|
||||
|
||||
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
YEAR=$(date +"%Y")
|
||||
MONTH=$(date +"%m")
|
||||
DAY=$(date +"%d")
|
||||
aRevision=-${YEAR}-${MONTH}-${DAY}
|
||||
#aRevision=-${aGitBranch}
|
||||
|
||||
set -o pipefail
|
||||
|
||||
aBuildType="Release"
|
||||
aBuildTypePrefix=
|
||||
if [[ $toDebug == 1 ]]; then
|
||||
aBuildType="Debug"
|
||||
aBuildTypePrefix="-debug"
|
||||
fi
|
||||
aLibType="Shared"
|
||||
aLibExt="dylib"
|
||||
if [[ $isStatic == 1 ]]; then
|
||||
aLibType="Static"
|
||||
aLibExt="a"
|
||||
aPlatformAndCompiler=mac-${anAbi}${aBuildTypePrefix}-clang
|
||||
|
||||
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
|
||||
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
|
||||
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
|
||||
|
||||
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
|
||||
rm -r -f "$aWorkDir"
|
||||
rm -r -f "$aDestDir"
|
||||
fi
|
||||
mkdir -p "$aWorkDir"
|
||||
mkdir -p "$aDestDir"
|
||||
rm -f "$aLogFile"
|
||||
|
||||
function buildArch {
|
||||
anAbi=$1
|
||||
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
aPlatformAndCompiler=${aPlatform}-${anAbi}${aBuildTypePrefix}-clang
|
||||
# include some information about OCCT into archive
|
||||
echo \<pre\>> "${aWorkDir}/VERSION.html"
|
||||
git status >> "${aWorkDir}/VERSION.html"
|
||||
git log -n 100 >> "${aWorkDir}/VERSION.html"
|
||||
echo \</pre\>>> "${aWorkDir}/VERSION.html"
|
||||
|
||||
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
|
||||
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
|
||||
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
|
||||
pushd "$aWorkDir"
|
||||
|
||||
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
|
||||
rm -r -f "$aWorkDir"
|
||||
rm -r -f "$aDestDir"
|
||||
aTimeZERO=$SECONDS
|
||||
set -o pipefail
|
||||
|
||||
function logDuration {
|
||||
if [[ $1 == 1 ]]; then
|
||||
aDur=$(($4 - $3))
|
||||
echo $2 time: $aDur sec>> "$aLogFile"
|
||||
fi
|
||||
mkdir -p "$aWorkDir"
|
||||
mkdir -p "$aDestDir"
|
||||
rm -f "$aLogFile"
|
||||
}
|
||||
|
||||
# include some information about OCCT into archive
|
||||
echo \<pre\>> "${aWorkDir}/VERSION.html"
|
||||
git status >> "${aWorkDir}/VERSION.html"
|
||||
git log -n 100 >> "${aWorkDir}/VERSION.html"
|
||||
echo \</pre\>>> "${aWorkDir}/VERSION.html"
|
||||
|
||||
pushd "$aWorkDir"
|
||||
|
||||
aTimeZERO=$SECONDS
|
||||
|
||||
function logDuration {
|
||||
if [[ $1 == 1 ]]; then
|
||||
aDur=$(($4 - $3))
|
||||
echo $2 time: $aDur sec>> "$aLogFile"
|
||||
fi
|
||||
}
|
||||
|
||||
# (re)generate Make files
|
||||
if [[ $toCMake == 1 ]]; then
|
||||
echo Configuring OCCT for macOS...
|
||||
cmake -G "Unix Makefiles" \
|
||||
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
|
||||
# (re)generate Make files
|
||||
if [[ $toCMake == 1 ]]; then
|
||||
echo Configuring OCCT for macOS...
|
||||
cmake -G "Unix Makefiles" \
|
||||
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
|
||||
-D BUILD_LIBRARY_TYPE:STRING="$aLibType" \
|
||||
-D BUILD_LIBRARY_TYPE:STRING="Shared" \
|
||||
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
|
||||
-D INSTALL_DIR:PATH="$aDestDir" \
|
||||
-D INSTALL_DIR_INCLUDE:STRING="inc" \
|
||||
-D INSTALL_DIR_LIB:STRING="lib" \
|
||||
-D INSTALL_DIR_RESOURCE:STRING="src" \
|
||||
-D INSTALL_NAME_DIR:STRING="@executable_path/../Frameworks" \
|
||||
-D USE_FREETYPE:BOOL="$USE_FREETYPE" \
|
||||
-D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
|
||||
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
|
||||
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
|
||||
@@ -147,122 +125,57 @@ function buildArch {
|
||||
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
|
||||
-D BUILD_MODULE_Draw:BOOL="${BUILD_Draw}" \
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" \
|
||||
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
|
||||
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
|
||||
fi
|
||||
aTimeGEN=$SECONDS
|
||||
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
|
||||
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
|
||||
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
|
||||
fi
|
||||
aTimeGEN=$SECONDS
|
||||
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
|
||||
|
||||
# clean up from previous build
|
||||
if [[ $toClean == 1 ]]; then
|
||||
make clean
|
||||
fi
|
||||
# clean up from previous build
|
||||
if [[ $toClean == 1 ]]; then
|
||||
make clean
|
||||
fi
|
||||
|
||||
# build the project
|
||||
if [[ $toMake == 1 ]]; then
|
||||
echo Building OCCT...
|
||||
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
|
||||
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
|
||||
fi
|
||||
aTimeBUILD=$SECONDS
|
||||
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
|
||||
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
|
||||
# build the project
|
||||
if [[ $toMake == 1 ]]; then
|
||||
echo Building OCCT...
|
||||
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
|
||||
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
|
||||
fi
|
||||
aTimeBUILD=$SECONDS
|
||||
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
|
||||
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
|
||||
|
||||
# install the project
|
||||
if [[ $toInstall == 1 ]]; then
|
||||
echo Installing OCCT into $aDestDir...
|
||||
make install 2>&1 | tee -a "$aLogFile"
|
||||
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
|
||||
echo Platform: macOS ABI: ${anAbi} Build: ${aBuildType} MACOSX_DEPLOYMENT_TARGET: ${MACOSX_DEPLOYMENT_TARGET} > "$aDestDir/build_target.txt"
|
||||
fi
|
||||
aTimeINSTALL=$SECONDS
|
||||
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
|
||||
# install the project
|
||||
if [[ $toInstall == 1 ]]; then
|
||||
echo Installing OCCT into $aDestDir...
|
||||
make install 2>&1 | tee -a "$aLogFile"
|
||||
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
|
||||
fi
|
||||
aTimeINSTALL=$SECONDS
|
||||
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
|
||||
|
||||
# create an archive
|
||||
if [[ $toPack == 1 ]]; then
|
||||
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
|
||||
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
|
||||
rm ${aDestDir}/../${anArchName} &>/dev/null
|
||||
pushd "$aDestDir"
|
||||
tar -jcf ${aDestDir}/../${anArchName} *
|
||||
popd
|
||||
fi
|
||||
aTimePACK=$SECONDS
|
||||
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
|
||||
# create an archive
|
||||
if [[ $toPack == 1 ]]; then
|
||||
YEAR=$(date +"%Y")
|
||||
MONTH=$(date +"%m")
|
||||
DAY=$(date +"%d")
|
||||
aRevision=-${YEAR}-${MONTH}-${DAY}
|
||||
#aRevision=-${aGitBranch}
|
||||
|
||||
# finished
|
||||
DURATION=$(($aTimePACK - $aTimeZERO))
|
||||
echo Total time: $DURATION sec
|
||||
logDuration 1 "Total" $aTimeZERO $aTimePACK
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
for anArchIter in $anAbiList
|
||||
do
|
||||
echo Platform: macOS ABI: ${anArchIter} Build: ${aBuildType}
|
||||
buildArch $anArchIter
|
||||
done
|
||||
|
||||
# create a FAT archive
|
||||
if [[ $toPackFat == 1 ]]; then
|
||||
aSuffixFat=${aPlatform}${aBuildTypePrefix}-clang
|
||||
aFatDir="${aCasSrc}/${aBuildRoot}/${aSuffixFat}"
|
||||
|
||||
# merge per-arch builds into fat builds
|
||||
hasPlatform=0
|
||||
for anArchIter in $anAbiList
|
||||
do
|
||||
aSuffixThin=${aPlatform}-${anArchIter}${aBuildTypePrefix}-clang
|
||||
anArchDir="${aCasSrc}/${aBuildRoot}/${aSuffixThin}"
|
||||
if [[ $hasPlatform == 0 ]]; then
|
||||
hasPlatform=1
|
||||
echo Packing FAT archive
|
||||
rm -r -f "$aFatDir"
|
||||
mkdir -p "$aFatDir"
|
||||
if [[ $isStatic == 1 ]]; then
|
||||
rsync -r -l --exclude '*.a' "$anArchDir/" "$aFatDir"
|
||||
else
|
||||
rsync -r -l --exclude '*.dylib' "$anArchDir/" "$aFatDir"
|
||||
fi
|
||||
rm -f "$aFatDir/build_target.txt"
|
||||
|
||||
if [[ -L "$anArchDir/bin/DRAWEXE" ]]; then
|
||||
aDrawExe=$(readlink "$anArchDir/bin/DRAWEXE")
|
||||
rm $aFatDir/bin/$aDrawExe
|
||||
lipo "$anArchDir/bin/$aDrawExe" -output "$aFatDir/bin/$aDrawExe" -create
|
||||
fi
|
||||
|
||||
for aLibIter in $anArchDir/lib/*.$aLibExt; do
|
||||
aLibName=`basename $aLibIter`
|
||||
if [[ -L "$anArchDir/lib/$aLibName" ]]; then
|
||||
cp -a "$anArchDir/lib/$aLibName" "$aFatDir/lib/"
|
||||
else
|
||||
lipo "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
|
||||
fi
|
||||
done
|
||||
else
|
||||
if [[ -L "$anArchDir/bin/DRAWEXE" ]]; then
|
||||
aDrawExe=$(readlink "$anArchDir/bin/DRAWEXE")
|
||||
lipo "$aFatDir/bin/$aDrawExe" "$anArchDir/bin/$aDrawExe" -output "$aFatDir/bin/$aDrawExe" -create
|
||||
fi
|
||||
|
||||
for aLibIter in $aFatDir/lib/*.$aLibExt; do
|
||||
aLibName=`basename $aLibIter`
|
||||
if [[ ! -L "$anArchDir/lib/$aLibName" ]]; then
|
||||
lipo "$aFatDir/lib/$aLibName" "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
|
||||
#lipo -info "$aFatDir/lib/$aLibName"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
cat "$anArchDir/build_target.txt" >> "$aFatDir/build_target.txt"
|
||||
done
|
||||
|
||||
# create an archive
|
||||
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aSuffixFat}.tar.bz2
|
||||
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
|
||||
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
|
||||
rm ${aFatDir}/../${anArchName} &>/dev/null
|
||||
pushd "$aFatDir"
|
||||
tar -jcf ${aFatDir}/../${anArchName} *
|
||||
rm ${aDestDir}/../${anArchName} &>/dev/null
|
||||
pushd "$aDestDir"
|
||||
tar -jcf ${aDestDir}/../${anArchName} *
|
||||
popd
|
||||
fi
|
||||
aTimePACK=$SECONDS
|
||||
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
|
||||
|
||||
# finished
|
||||
DURATION=$(($aTimePACK - $aTimeZERO))
|
||||
echo Total time: $DURATION sec
|
||||
logDuration 1 "Total" $aTimeZERO $aTimePACK
|
||||
|
||||
popd
|
||||
|
@@ -12,7 +12,6 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
|
||||
#export toMake=1
|
||||
#export toInstall=1
|
||||
#export toPack=1
|
||||
#export toPackFat=1
|
||||
|
||||
#export BUILD_ModelingData=ON
|
||||
#export BUILD_ModelingAlgorithms=ON
|
||||
@@ -26,6 +25,5 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
|
||||
#export USE_FREEIMAGE=ON
|
||||
|
||||
#export MACOSX_DEPLOYMENT_TARGET=10.10
|
||||
#export anAbiList=arm64
|
||||
#export anAbiList=x86_64
|
||||
#export anAbiList="arm64 x86_64"
|
||||
#export anAbi=arm64
|
||||
#export anAbi=x86_64
|
||||
|
@@ -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" ^
|
||||
|
@@ -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"
|
||||
|
@@ -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" ^
|
||||
|
@@ -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
|
||||
|
@@ -131,10 +131,6 @@ if exist "%CASROOT%\custom.bat" (
|
||||
call "%CASROOT%\custom.bat" %VCVER% %ARCH% %CASDEB%
|
||||
)
|
||||
|
||||
if not ["%QTDIR%"] == [""] (
|
||||
set "PATH=%QTDIR%/bin;%PATH%"
|
||||
set "QT_PLUGIN_PATH=%QTDIR%/plugins"
|
||||
)
|
||||
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
||||
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
|
||||
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
||||
@@ -145,6 +141,10 @@ if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
|
||||
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
||||
if not ["%FFMPEG_DIR%"] == [""] set "PATH=%FFMPEG_DIR%;%PATH%"
|
||||
if not ["%OPENVR_DIR%"] == [""] set "PATH=%OPENVR_DIR%;%PATH%"
|
||||
if not ["%QTDIR%"] == [""] (
|
||||
set "PATH=%QTDIR%/bin;%PATH%"
|
||||
set "QT_PLUGIN_PATH=%QTDIR%/plugins"
|
||||
)
|
||||
|
||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||
if not "%CSF_OCCTBinPath%" == "" (
|
||||
|
@@ -43,7 +43,6 @@ configure_file ("${OCCT_OVERVIEW_RESOURCE_DIR}/occt_ug_html.doxyfile" "${OCCT_CO
|
||||
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_NUMBER = ${OCC_VERSION_STRING_EXT}")
|
||||
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nOUTPUT_DIRECTORY = ${OCCT_GENERATED_OVERVIEW_DIR}/.")
|
||||
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_LOGO = ${OCCT_OVERVIEW_DIR}/resources/occ_logo.png")
|
||||
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nEXAMPLE_PATH = ${CMAKE_SOURCE_DIR}/src")
|
||||
|
||||
set (OCCT_ARTICLE_PARAM_INPUT "INPUT =")
|
||||
set (OCCT_ARTICLE_PARAM_IMAGEPATH "IMAGE_PATH = ${OCCT_OVERVIEW_DIR}/resources/ ")
|
||||
|
@@ -12,19 +12,14 @@ samples/samples.md
|
||||
../samples/CSharp/ReadMe.md
|
||||
../samples/CSharp/ReadMe_D3D.md
|
||||
../samples/qt/AndroidQt/ReadMe.md
|
||||
../samples/qt/IESample/ReadMe.md
|
||||
../samples/qt/OCCTOverview/ReadMe.md
|
||||
../samples/qt/Tutorial/ReadMe.md
|
||||
../samples/java/jniviewer/ReadMe.md
|
||||
../samples/ios/UIKitSample/ReadMe.md
|
||||
../samples/webgl/ReadMe.md
|
||||
../samples/glfw/readme.md
|
||||
samples/ocaf.md
|
||||
samples/ocaf_func.md
|
||||
samples/draw_scripts.md
|
||||
samples/ais_object.md
|
||||
|
||||
samples/novice_guide.md
|
||||
tutorial/tutorial.md
|
||||
|
||||
build/build_upgrade.md
|
||||
|
@@ -6,8 +6,6 @@
|
||||
|
||||
tutorial/tutorial.md
|
||||
|
||||
samples/novice_guide.md
|
||||
|
||||
upgrade/upgrade.md
|
||||
|
||||
user_guides/foundation_classes/foundation_classes.md
|
||||
|
656
dox/build/build_3rdparty/building_3rdparty.md
vendored
@@ -2,48 +2,60 @@
|
||||
==============================================
|
||||
@tableofcontents
|
||||
|
||||
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://dev.opencascade.org/resources/download/3rd-party-components.
|
||||
On Linux and macOS, it is recommended to use the version installed in the system natively.
|
||||
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://opencascade.com/content/3rd-party-components.
|
||||
On Linux and OS X, it is recommended to use the version installed in the system natively.
|
||||
|
||||
@section dev_guides__building_3rdparty_win_1 Windows
|
||||
|
||||
This section presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform.
|
||||
It is assumed that you are already familiar with MS Visual Studio / Visual C++.
|
||||
This document presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform. It is assumed that you are already familiar with MS Visual Studio / Visual C++.
|
||||
|
||||
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of runtime binaries.
|
||||
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of run-time binaries.
|
||||
|
||||
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, `c:/occ3rdparty`).
|
||||
Further in this document, this folder is referred to as `3rdparty`.
|
||||
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
|
||||
|
||||
There are two types of third-party products used by OCCT:
|
||||
|
||||
* Mandatory products:
|
||||
* Tcl/Tk 8.5 -- 8.6;
|
||||
* FreeType 2.4.10 -- 2.5.3.
|
||||
* Optional products:
|
||||
* TBB 3.x -- 4.x;
|
||||
* FreeImage 3.14.1 -- 3.16.0;
|
||||
* VTK 6.1.0.
|
||||
|
||||
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, *c:\\occ3rdparty*).
|
||||
|
||||
Further in this document, this folder is referred to as *3rdparty*.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_2 Tcl/Tk
|
||||
|
||||
Tcl/Tk is required for DRAW test harness.
|
||||
|
||||
**Installation from sources: Tcl**
|
||||
|
||||
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. In the `win` sub-directory, edit file `buildall.vc.bat`:
|
||||
1. In the *win* sub-directory, edit file *buildall.vc.bat*:
|
||||
|
||||
* Edit the line `"call ... vcvars32.bat"` to have correct path to the version of Visual Studio to be used for building, for instance:
|
||||
* Edit the line "call ... vcvars32.bat" to have correct path to the version of Visual Studio to be used for building, for instance:
|
||||
|
||||
call "%VS80COMNTOOLS%\vsvars32.bat"
|
||||
|
||||
If you are building 64-bit version, set environment accordingly, e.g.:
|
||||
|
||||
call "%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
|
||||
|
||||
* Define variable `INSTALLDIR` pointing to directory where Tcl/Tk will be installed, e.g.:
|
||||
|
||||
* Define variable *INSTALLDIR* pointing to directory where Tcl/Tk will be installed, e.g.:
|
||||
|
||||
set INSTALLDIR=D:\OCCT\3rdparty\tcltk-86-32
|
||||
|
||||
* Add option `install` to the first command line calling `nmake`:
|
||||
* Add option *install* to the first command line calling *nmake*:
|
||||
|
||||
nmake -nologo -f makefile.vc release htmlhelp install %1
|
||||
|
||||
* Remove second call to `nmake` (building statically linked executable)
|
||||
* Remove second call to *nmake* (building statically linked executable)
|
||||
|
||||
2. Edit file `rules.vc` replacing line
|
||||
2. Edit file *rules.vc* replacing line
|
||||
|
||||
SUFX = tsgx
|
||||
|
||||
@@ -53,18 +65,21 @@ Download the necessary archive from https://www.tcl.tk/software/tcltk/download.h
|
||||
|
||||
This is to avoid extra prefix 't' in the library name, which is not recognized by default by OCCT build tools.
|
||||
|
||||
|
||||
3. By default, Tcl uses dynamic version of run-time library (MSVCRT), which must be installed on the system where Tcl will be used.
|
||||
You may wish to link Tcl library with static version of run-time to avoid this dependency.
|
||||
For that:
|
||||
|
||||
* Edit file `makefile.vc` replacing strings `"crt = -MD"` by `"crt = -MT"`
|
||||
* Edit file *makefile.vc* replacing strings "crt = -MD" by "crt = -MT"
|
||||
|
||||
* Edit source file `tclMain.c` (located in folder `generic`) commenting out forward declaration of function `isatty()`.
|
||||
* Edit source file *tclMain.c* (located in folder *generic*) commenting out forward declaration of function *isatty()*.
|
||||
|
||||
4. In the command prompt, run `buildall.vc.bat`<br>
|
||||
You might need to run this script twice to have `tclsh` executable installed; check subfolder `bin` of specified installation path to verify this.
|
||||
|
||||
5. For convenience of use, we recommend making a copy of `tclsh` executable created in subfolder `bin` of `INSTALLDIR` and named with Tcl version number suffix, as `tclsh.exe` (with no suffix)
|
||||
4. In the command prompt, run *buildall.vc.bat*
|
||||
|
||||
You might need to run this script twice to have *tclsh* executable installed; check subfolder *bin* of specified installation path to verify this.
|
||||
|
||||
5. For convenience of use, we recommend making a copy of *tclsh* executable created in subfolder *bin* of *INSTALLDIR* and named with Tcl version number suffix, as *tclsh.exe* (with no suffix)
|
||||
|
||||
> cd D:\OCCT\3rdparty\tcltk-86-32\bin
|
||||
> cp tclsh86.exe tclsh.exe
|
||||
@@ -72,303 +87,339 @@ Download the necessary archive from https://www.tcl.tk/software/tcltk/download.h
|
||||
**Installation from sources: Tk**
|
||||
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
Apply the same steps as described for building Tcl above, with the same `INSTALLDIR`.
|
||||
Note that Tk produces its own executable, called `wish`.
|
||||
|
||||
You might need to edit default value of `TCLDIR` variable defined in `buildall.vc.bat` (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
|
||||
Apply the same steps as described for building Tcl above, with the same INSTALLDIR.
|
||||
Note that Tk produces its own executable, called *wish*.
|
||||
|
||||
You might need to edit default value of *TCLDIR* variable defined in *buildall.vc.bat* (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_2_2 FreeType
|
||||
|
||||
FreeType is required for text display in a 3D viewer.
|
||||
You can download its sources from https://freetype.org/
|
||||
FreeType is required for text display in a 3D viewer. You can download its sources from https://sourceforge.net/projects/freetype/files/
|
||||
|
||||
1. Unpack the downloaded archive of FreeType product into the `3rdparty` folder.
|
||||
As a result, you will get a folder named, for example, `3rdparty/freetype-2.4.10`.
|
||||
Further in this document, this folder is referred to as `freetype`.
|
||||
### The building procedure
|
||||
|
||||
2. Open the solution file `freetype/builds/win32/vc20xx/freetype.sln` in Visual Studio.
|
||||
Here `vc20xx` stands for your version of Visual Studio.
|
||||
1. Unpack the downloaded archive of FreeType product into the *3rdparty* folder. As a result, you will get a folder named, for example, *3rdparty\\freetype-2.4.10*. Further in this document, this folder is referred to as *freetype*.
|
||||
|
||||
2. Open the solution file *freetype\\builds\\win32\\vc20xx\\freetype.sln* in Visual Studio. Here *vc20xx* stands for your version of Visual Studio.
|
||||
|
||||
3. Select the configuration to build: either `Debug` or `Release`.
|
||||
3. Select the configuration to build: either Debug or Release.
|
||||
|
||||
4. Build the `freetype` project.<br>
|
||||
As a result, you will get a `freetype` import library (`.lib`) in the `freetype/obj/win32/vc20xx` folder.
|
||||
4. Build the *freetype* project.
|
||||
|
||||
5. If you build FreeType for a 64 bit platform, select in the main menu `Build - Configuration Manager`
|
||||
and add `x64` platform to the solution configuration by copying the settings from `Win32` platform:
|
||||
As a result, you will get a freetype import library (.lib) in the *freetype\\obj\\win32\\vc20xx* folder.
|
||||
|
||||
|
||||
5. If you build FreeType for a 64 bit platform, select in the main menu **Build - Configuration Manager** and add *x64* platform to the solution configuration by copying the settings from Win32 platform:
|
||||
|
||||
@figure{/build/build_3rdparty/images/3rdparty_image001.png}
|
||||
|
||||
Update the value of the Output File for `x64` configuration:
|
||||
Update the value of the Output File for x64 configuration:
|
||||
|
||||
@figure{/build/build_3rdparty/images/3rdparty_image003.png}
|
||||
|
||||
Build the `freetype` project.<br>
|
||||
As a result, you will obtain a 64 bit import library (`.lib`) file in the `freetype/x64/vc20xx` folder.
|
||||
To build FreeType as a dynamic library (`.dll`) follow steps 6, 7 and 8 of this procedure.
|
||||
Build the *freetype* project.
|
||||
|
||||
6. Open menu Project-> Properties-> Configuration Properties-> General and change option `Configuration Type` to `Dynamic Library (.dll)`.
|
||||
7. Edit file `freetype/include/freetype/config/ftoption.h`:<br>
|
||||
in line 255, uncomment the definition of macro `FT_EXPORT` and change it as follows:
|
||||
As a result, you will obtain a 64 bit import library (.lib) file in the *freetype\\x64\\vc20xx* folder.
|
||||
|
||||
#define FT_EXPORT(x) __declspec(dllexport) x
|
||||
To build FreeType as a dynamic library (.dll) follow steps 6, 7 and 8 of this procedure.
|
||||
|
||||
8. Build the `freetype` project.<br>
|
||||
As a result, you will obtain the files of the import library (`.lib`) and the dynamic library (`.dll`) in folders `freetype/objs/release` or `freetype/objs/debug`.
|
||||
If you build for a 64 bit platform, follow step 5 of the procedure.
|
||||
6. Open menu Project-> Properties-> Configuration Properties-> General and change option **Configuration Type** to *Dynamic Library (.dll)*.
|
||||
7. Edit file *freetype\\include\\freetype\\config\\ftoption.h*:
|
||||
|
||||
in line 255, uncomment the definition of macro *FT_EXPORT* and change it as follows:
|
||||
|
||||
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures,
|
||||
it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern `freetype-compiler-bitness-building mode`, where:
|
||||
* `compiler` is `vc8` or `vc9` or `vc10` or `vc11`;
|
||||
* `bitness` is `32` or `64`;
|
||||
* `building mode` is `opt` (for `Release`) or `deb` (for `Debug`).
|
||||
#define FT_EXPORT(x) __declspec(dllexport) x
|
||||
|
||||
8. Build the *freetype* project.
|
||||
|
||||
As a result, you will obtain the files of the import library (.lib) and the dynamic library (.dll) in folders <i>freetype \\objs\\release</i> or <i>\\objs\\debug </i>.
|
||||
|
||||
If you build for a 64 bit platform, follow step 5 of the procedure.
|
||||
|
||||
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures, it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern: *freetype-compiler-bitness-building mode*, where:
|
||||
* **compiler** is *vc8* or *vc9* or *vc10* or *vc11*;
|
||||
* **bitness** is *32* or *64*;
|
||||
* **building mode** is *opt* (for Release) or *deb* (for Debug).
|
||||
|
||||
The *include* subfolder should be copied as is, while libraries should be renamed to *freetype.lib* and *freetype.dll* (suffixes removed) and placed to subdirectories *lib *and *bin*, respectively. If the Debug configuration is built, the Debug libraries should be put into subdirectories *libd* and *bind*.
|
||||
|
||||
The `include` subfolder should be copied as is, while libraries should be renamed to `freetype.lib` and `freetype.dll` (suffixes removed) and placed to subdirectories `lib` and `bin`, respectively.
|
||||
If the `Debug` configuration is built, the Debug libraries should be put into subdirectories `libd` and `bind`.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_3_1 TBB
|
||||
|
||||
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need (e.g. `tbb30_018oss`) and pick the archive for Windows platform.
|
||||
This third-party product is installed with binaries
|
||||
from the archive that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*) and pick the archive for Windows platform.
|
||||
|
||||
Unpack the downloaded archive of TBB product into the `3rdparty` folder.
|
||||
Unpack the downloaded archive of TBB product into the *3rdparty* folder.
|
||||
|
||||
Further in this document, this folder is referred to as `tbb`.
|
||||
Further in this document, this folder is referred to as *tbb*.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_3_3 FreeImage
|
||||
|
||||
This third-party product should be built as a dynamically loadable library (`.dll` file).
|
||||
You can download its sources from
|
||||
This third-party product should be built as a dynamically loadable library (.dll file).
|
||||
You can download its sources from
|
||||
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
|
||||
1. Unpack the downloaded archive of FreeImage product into `3rdparty` folder.<br>
|
||||
As a result, you should have a folder named `3rdparty/FreeImage`.
|
||||
Rename it according to the rule: `freeimage-platform-compiler-building mode`, where
|
||||
### The building procedure:
|
||||
|
||||
* `platform` is `win32` or `win64`;
|
||||
* `compiler` is `vc8` or `vc9` or `vc10` or `vc11`;
|
||||
* `building mode` is *opt* (for release) or `deb` (for debug)
|
||||
1. Unpack the downloaded archive of FreeImage product into *3rdparty* folder.
|
||||
|
||||
As a result, you should have a folder named *3rdparty\\FreeImage*.
|
||||
|
||||
Rename it according to the rule: *freeimage-platform-compiler-building mode*, where
|
||||
|
||||
* **platform** is *win32* or *win64*;
|
||||
* **compiler** is *vc8* or *vc9* or *vc10* or *vc11*;
|
||||
* **building mode** is *opt* (for release) or *deb* (for debug)
|
||||
|
||||
Further in this document, this folder is referred to as `freeimage`.
|
||||
Further in this document, this folder is referred to as *freeimage*.
|
||||
|
||||
2. Open the solution file `freeimage/FreeImage.*.sln` in your Visual Studio.<br>
|
||||
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace.
|
||||
Such conversion should be suggested automatically by Visual Studio.
|
||||
2. Open the solution file *freeimage\\FreeImage.*.sln* in your Visual Studio.
|
||||
|
||||
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace.
|
||||
Such conversion should be suggested automatically by Visual Studio.
|
||||
|
||||
3. Select a configuration to build.
|
||||
|
||||
3. Select a configuration to build.
|
||||
- Choose `Release` if you are building Release binaries.
|
||||
- Choose `Debug` if you are building Debug binaries.
|
||||
- Choose **Release** if you are building Release binaries.
|
||||
- Choose **Debug** if you are building Debug binaries.
|
||||
|
||||
*Note:*
|
||||
|
||||
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage projects:
|
||||
*Note:*
|
||||
|
||||
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage and FreeimagePlus projects:
|
||||
|
||||
Project -> Properties -> Configuration Properties -> Linker -> General -> Output File
|
||||
|
||||
FreeImage*d*.dll to FreeImage.dll
|
||||
FreeImage*d*.dll to FreeImage.dll
|
||||
FreeImagePlus*d*.dll to FreeImagePlus.dll
|
||||
|
||||
Project -> Properties -> Configuration Properties -> Linker -> Debugging-> Generate Program Database File
|
||||
|
||||
FreeImage*d*.pdb to FreeImage.pdb
|
||||
FreeImage*d*.pdb to FreeImage.pdb
|
||||
FreeImagePlus*d*.pdb to FreeImagePlus.pdb
|
||||
|
||||
Project -> Properties -> Configuration Properties -> Linker -> Advanced-Import Library
|
||||
|
||||
FreeImage*d*.lib to FreeImage.lib
|
||||
FreeImage*d*.lib to FreeImage.lib
|
||||
FreeImagePlus*d*.lib to FreeImagePlus.lib
|
||||
|
||||
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
|
||||
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
|
||||
|
||||
FreeImage*d*.dll to FreeImage.dll
|
||||
FreeImage*d*.lib to FreeImage.lib
|
||||
FreeImage*d*.dll to FreeImage.dll
|
||||
FreeImage*d*.lib to FreeImage.lib
|
||||
FreeImagePlus*d*.dll to FreeImagePlus.dll
|
||||
FreeImagePlus*d*.lib to FreeImagePlus.lib
|
||||
|
||||
Additionally, rename in project FreeImagePlus
|
||||
Additionally, rename in project FreeImagePlus
|
||||
|
||||
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
|
||||
|
||||
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
|
||||
from FreeImage*d*.lib to FreeImage.lib
|
||||
|
||||
from FreeImage*d*.lib to FreeImage.lib
|
||||
4. Select a platform to build.
|
||||
|
||||
4. Select a platform to build.
|
||||
- Choose `Win32` if you are building for a 32 bit platform.
|
||||
- Choose `x64` if you are building for a 64 bit platform.
|
||||
- Choose *Win32* if you are building for a 32 bit platform.
|
||||
- Choose *x64* if you are building for a 64 bit platform.
|
||||
|
||||
5. Start the building process.<br>
|
||||
As a result, you should have the library files of FreeImage product in `freeimage/Dist` folder (`FreeImage.dll` and `FreeImage.lib`).
|
||||
5. Start the building process.
|
||||
|
||||
As a result, you should have the library files of FreeImage product in *freeimage\\Dist* folder (*FreeImage.dll* and *FreeImage.lib*) and in *freeimage\\Wrapper\\FreeImagePlus\\dist* folder (*FreeImagePlus.dll* and *FreeImagePlus.lib*).
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_3_4 VTK
|
||||
|
||||
VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
|
||||
VTK is an open-source, freely available software system for 3D computer graphics, image processing and visualization. VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
|
||||
|
||||
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into `3rdparty` folder.<br>
|
||||
As a result, you will get a folder named, for example, `3rdparty/VTK-6.1.0`.
|
||||
Further in this document, this folder is referred to as `VTK`.
|
||||
### The building procedure:
|
||||
|
||||
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into *3rdparty* folder.
|
||||
|
||||
As a result, you will get a folder named, for example, <i>3rdparty\VTK-6.1.0.</i>
|
||||
|
||||
Further in this document, this folder is referred to as *VTK*.
|
||||
|
||||
2. Use CMake to generate VS projects for building the library:
|
||||
- Start CMake-GUI and select `VTK` folder as source path, and the folder of your choice for VS project and intermediate build data.
|
||||
- Start CMake-GUI and select VTK folder as source path, and the folder of your choice for VS project and intermediate build data.
|
||||
- Click **Configure**.
|
||||
- Select the VS version to be used from the ones you have installed (we recommend using VS 2015) and the architecture (32 or 64-bit).
|
||||
- Generate VS projects with default CMake options. The open solution `VTK.sln` will be generated in the build folder.
|
||||
- Select the VS version to be used from the ones you have installed (we recommend using VS 2010) and the architecture (32 or 64-bit).
|
||||
- Generate VS projects with default CMake options. The open solution *VTK.sln* will be generated in the build folder.
|
||||
|
||||
3. Build project VTK in Release mode.
|
||||
|
||||
|
||||
@section build_3rdparty_linux Linux
|
||||
|
||||
This section presents additional guidelines for building third-party products used by Open CASCADE Technology and samples on Linux platform.
|
||||
This document presents additional guidelines for building third-party
|
||||
products used by Open CASCADE Technology and samples on Linux platform.
|
||||
|
||||
The links for downloading the third-party products are available on the web site at
|
||||
https://opencascade.com/content/3rd-party-components.
|
||||
|
||||
There are two types of third-party products, which are necessary to build OCCT:
|
||||
|
||||
* Mandatory products:
|
||||
* Tcl/Tk 8.5 - 8.6;
|
||||
* FreeType 2.4.10 - 2.5.3;
|
||||
* Optional products:
|
||||
* TBB 3.x - 4.x;
|
||||
* FreeImage 3.14.1 - 3.16.0;
|
||||
* VTK 6.1.0.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
|
||||
|
||||
**Debian-based distributives**
|
||||
|
||||
All 3rd-party products required for building of OCCT could be installed from official repositories.
|
||||
You may install them from console using apt-get utility:
|
||||
All 3rd-party products required for building of OCCT could be installed
|
||||
from official repositories. You may install them from console using apt-get utility:
|
||||
|
||||
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libx11-dev libgl1-mesa-dev libfreeimage-dev
|
||||
sudo apt-get install rapidjson-dev libdraco-dev
|
||||
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libx11-dev libgl1-mesa-dev libfreeimage-dev rapidjson-dev
|
||||
|
||||
Building is possible with C++ compliant compiler:
|
||||
|
||||
sudo apt-get install g++
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
|
||||
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
|
||||
|
||||
Tcl/Tk is required for DRAW test harness.
|
||||
Tcl/Tk is required for DRAW test harness.
|
||||
|
||||
**Installation from sources: Tcl**
|
||||
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the `unix` sub-directory of the directory where the Tcl source files are located (`TCL_SRC_DIR`).
|
||||
|
||||
cd TCL_SRC_DIR/unix
|
||||
|
||||
2. Run the `configure` command:
|
||||
|
||||
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
|
||||
|
||||
For a 64 bit platform also add `--enable-64bit` option to the command line.
|
||||
|
||||
3. If the configure command has finished successfully, start the building process:
|
||||
|
||||
make
|
||||
|
||||
4. If building is finished successfully, start the installation of Tcl.
|
||||
All binary and service files of the product will be copied to the directory defined by `TCL_INSTALL_DIR`
|
||||
|
||||
make install
|
||||
|
||||
**Installation from sources: Tk**
|
||||
|
||||
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the `unix` sub-directory of the directory where the Tk source files are located (`TK_SRC_DIR`)
|
||||
1. Enter the unix sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
|
||||
|
||||
cd TK_SRC_DIR/unix
|
||||
cd TCL_SRC_DIR/unix
|
||||
|
||||
2. Run the `configure` command, where `TCL_LIB_DIR` is `TCL_INSTALL_DIR/lib`.
|
||||
2. Run the *configure* command:
|
||||
|
||||
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
|
||||
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
|
||||
|
||||
For a 64 bit platform also add `--enable-64bit` option to the command line.
|
||||
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
|
||||
|
||||
3. If the configure command has finished successfully, start the building process:
|
||||
|
||||
make
|
||||
|
||||
3. If the configure command has finished successfully, start the building process:
|
||||
4. If building is finished successfully, start the installation of Tcl.
|
||||
All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
4. If the building has finished successfully, start the installation of Tk.
|
||||
All binary and service files of the product will be copied
|
||||
to the directory defined by `TK_INSTALL_DIR` (usually it is `TCL_INSTALL_DIR`)
|
||||
**Installation from sources: Tk**
|
||||
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the unix sub-directory of the directory where the Tk source files are located <i>(TK_SRC_DIR)</i>
|
||||
|
||||
make install
|
||||
cd TK_SRC_DIR/unix
|
||||
|
||||
2. Run the configure command, where <i>TCL_LIB_DIR</i> is *TCL_INSTALL_DIR/lib*.
|
||||
|
||||
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
|
||||
|
||||
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
|
||||
|
||||
3. If the configure command has finished successfully, start the building process:
|
||||
|
||||
make
|
||||
|
||||
4. If the building has finished successfully, start the installation of Tk.
|
||||
All binary and service files of the product will be copied
|
||||
to the directory defined by *TK_INSTALL_DIR* (usually it is *TCL_INSTALL_DIR*)
|
||||
|
||||
make install
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_2_2 FreeType
|
||||
|
||||
FreeType is required for text display in the 3D viewer.
|
||||
Download the necessary archive from https://freetype.org/ and unpack it.
|
||||
|
||||
1. Enter the directory where the source files of FreeType are located (`FREETYPE_SRC_DIR`).
|
||||
FreeType is required for text display in the 3D viewer.
|
||||
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
|
||||
|
||||
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
|
||||
|
||||
cd FREETYPE_SRC_DIR
|
||||
|
||||
2. Run the `configure` command:
|
||||
2. Run the *configure* command:
|
||||
|
||||
configure --prefix=FREETYPE_INSTALL_DIR
|
||||
|
||||
configure --prefix=FREETYPE_INSTALL_DIR
|
||||
For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
|
||||
|
||||
3. If the *configure* command has finished successfully, start the building process:
|
||||
|
||||
For a 64 bit platform also add `CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'` option to the command line.
|
||||
make
|
||||
|
||||
3. If the `configure` command has finished successfully, start the building process:
|
||||
|
||||
make
|
||||
|
||||
4. If the building has finished successfully, start the installation of FreeType.
|
||||
All binary and service files of the product will be copied to the directory defined by `FREETYPE_INSTALL_DIR`
|
||||
|
||||
make install
|
||||
4. If the building has finished successfully, start the installation of FreeType.
|
||||
All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*
|
||||
|
||||
make install
|
||||
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_3_1 TBB
|
||||
|
||||
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
|
||||
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
|
||||
To install, unpack the downloaded archive of TBB product.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_3_3 FreeImage
|
||||
|
||||
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/ and unpack it.
|
||||
The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DIR`.
|
||||
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
|
||||
|
||||
1. Modify *FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h*:
|
||||
In line 60 insert the following:
|
||||
|
||||
1. Modify `FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h`:<br>
|
||||
In line 60 insert the following:
|
||||
#include string.h
|
||||
|
||||
#include string.h
|
||||
2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
|
||||
|
||||
cd FREEIMAGE_SRC_DIR
|
||||
|
||||
2. Enter the directory where the source files of FreeImage are located (`FREEIMAGE_SRC_DIR`).
|
||||
3. Run the building process
|
||||
|
||||
make
|
||||
|
||||
cd FREEIMAGE_SRC_DIR
|
||||
4. Run the installation process
|
||||
|
||||
3. Run the building process
|
||||
|
||||
make
|
||||
|
||||
4. Run the installation process
|
||||
|
||||
a. If you have the permission to write into directories `/usr/include` and `/usr/lib`, run the following command:
|
||||
|
||||
make install
|
||||
|
||||
b. If you do not have this permission, you need to modify file `FREEIMAGE_SRC_DIR/Makefile.gnu`:
|
||||
a. If you have the permission to write into directories <i>/usr/include</i> and <i>/usr/lib</i>, run the following command:
|
||||
|
||||
make install
|
||||
b. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.gnu*:
|
||||
|
||||
Change lines 7-9 from:
|
||||
|
||||
DESTDIR ?= /
|
||||
INCDIR ?= $(DESTDIR)/usr/include
|
||||
INSTALLDIR ?= $(DESTDIR)/usr/lib
|
||||
|
||||
DESTDIR ?= /
|
||||
INCDIR ?= $(DESTDIR)/usr/include
|
||||
INSTALLDIR ?= $(DESTDIR)/usr/lib
|
||||
to:
|
||||
|
||||
DESTDIR ?= $(DESTDIR)
|
||||
INCDIR ?= $(DESTDIR)/include
|
||||
INSTALLDIR ?= $(DESTDIR)/lib
|
||||
|
||||
Change lines 65-67 from:
|
||||
|
||||
install -m 644 -o root -g root $(HEADER) $(INCDIR)
|
||||
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
|
||||
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
|
||||
|
||||
to:
|
||||
|
||||
DESTDIR ?= $(DESTDIR)
|
||||
INCDIR ?= $(DESTDIR)/include
|
||||
INSTALLDIR ?= $(DESTDIR)/lib
|
||||
|
||||
Change lines 65-67 from:
|
||||
|
||||
install -m 644 -o root -g root $(HEADER) $(INCDIR)
|
||||
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
|
||||
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
|
||||
|
||||
to:
|
||||
|
||||
install -m 755 $(HEADER) $(INCDIR)
|
||||
install -m 755 $(STATICLIB) $(INSTALLDIR)
|
||||
install -m 755 $(HEADER) $(INCDIR)
|
||||
install -m 755 $(STATICLIB) $(INSTALLDIR)
|
||||
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
|
||||
|
||||
Change line 70 from:
|
||||
Change line 70 from:
|
||||
|
||||
ldconfig
|
||||
|
||||
to:
|
||||
|
||||
\#ldconfig
|
||||
\#ldconfig
|
||||
|
||||
Then run the installation process by the following command:
|
||||
|
||||
Then run the installation process by the following command:
|
||||
|
||||
make DESTDIR=FREEIMAGE_INSTALL_DIR install
|
||||
make DESTDIR=FREEIMAGE_INSTALL_DIR install
|
||||
|
||||
5. Clean temporary files
|
||||
|
||||
@@ -376,180 +427,201 @@ The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DI
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_3_4 VTK
|
||||
|
||||
You can download VTK sources from https://www.vtk.org/VTK/resources/software.html
|
||||
|
||||
### The building procedure:
|
||||
|
||||
Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it.
|
||||
|
||||
1. Install or build `cmake` product from the source file.
|
||||
2. Start `cmake` in GUI mode with the directory where the source files of *VTK* are located:
|
||||
1. Install or build *cmake* product from the source file.
|
||||
2. Start *cmake* in GUI mode with the directory where the source files of *VTK* are located:
|
||||
|
||||
ccmake VTK_SRC_DIR
|
||||
|
||||
* Press `[c]` to make the initial configuration
|
||||
* Define the necessary options in `VTK_INSTALL_PREFIX`
|
||||
* Press `[c]` to make the final configuration
|
||||
* Press `[g]` to generate `Makefile` and exit
|
||||
* Press <i>[c]</i> to make the initial configuration
|
||||
* Define the necessary options in *VTK_INSTALL_PREFIX*
|
||||
* Press <i>[c]</i> to make the final configuration
|
||||
* Press <i>[g]</i> to generate Makefile and exit
|
||||
|
||||
3. Start the building of VTK:
|
||||
|
||||
make
|
||||
|
||||
4. Start the installation of VTK. Binaries will be installed according to the `VTK_INSTALL_PREFIX` option.
|
||||
4. Start the installation of VTK. Binaries will be installed according to the *VTK_INSTALL_PREFIX* option.
|
||||
|
||||
make install
|
||||
|
||||
@section build_3rdparty_macos Mac OS X
|
||||
|
||||
This section presents additional guidelines for building third-party products
|
||||
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
|
||||
This document presents additional guidelines for building third-party products
|
||||
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
|
||||
|
||||
@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk
|
||||
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
|
||||
|
||||
Tcl/Tk is required for DRAW test harness.
|
||||
There are two types of third-party products, which are necessary to build OCCT:
|
||||
|
||||
* Mandatory products:
|
||||
* Tcl/Tk 8.5 - 8.6;
|
||||
* FreeType 2.4.10 - 2.5.3.
|
||||
* Optional products:
|
||||
* TBB 3.x - 4.x;
|
||||
* FreeImage 3.14.1 - 3.16.0
|
||||
|
||||
|
||||
**Installation from sources: Tcl**
|
||||
@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk 8.5
|
||||
|
||||
Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
|
||||
|
||||
**Installation from sources: Tcl 8.5**
|
||||
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the `macosx` sub-directory of the directory where the Tcl source files are located (`TCL_SRC_DIR`).
|
||||
1. Enter the *macosx* sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
|
||||
|
||||
cd TCL_SRC_DIR/macosx
|
||||
cd TCL_SRC_DIR/macosx
|
||||
|
||||
2. Run the `configure` command
|
||||
2. Run the *configure* command
|
||||
|
||||
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
|
||||
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
|
||||
|
||||
For a 64 bit platform also add `--enable-64bit` option to the command line.
|
||||
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
|
||||
|
||||
3. If the `configure` command has finished successfully, start the building process
|
||||
3. If the *configure* command has finished successfully, start the building process
|
||||
|
||||
make
|
||||
make
|
||||
|
||||
4. If building is finished successfully, start the installation of Tcl.
|
||||
All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*.
|
||||
|
||||
4. If building is finished successfully, start the installation of Tcl.
|
||||
All binary and service files of the product will be copied to the directory defined by `TCL_INSTALL_DIR`.
|
||||
make install
|
||||
|
||||
make install
|
||||
|
||||
**Installation from sources: Tk**
|
||||
**Installation from sources: Tk 8.5**
|
||||
|
||||
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. Enter the `macosx` sub-directory of the directory where the source files of Tk are located (`TK_SRC_DIR`).
|
||||
1. Enter the *macosx* sub-directory of the directory where the source files of Tk are located <i>(TK_SRC_DIR)</i>.
|
||||
|
||||
cd TK_SRC_DIR/macosx
|
||||
cd TK_SRC_DIR/macosx
|
||||
|
||||
2. Run the `configure` command, where `TCL_LIB_DIR` is `TCL_INSTALL_DIR/lib`
|
||||
2. Run the *configure* command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
|
||||
|
||||
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
|
||||
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
|
||||
|
||||
For a 64 bit platform also add `--enable-64bit` option to the command line.
|
||||
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
|
||||
|
||||
3. If the `configure` command has finished successfully, start the building process:
|
||||
3. If the *configure* command has finished successfully, start the building process:
|
||||
|
||||
make
|
||||
make
|
||||
|
||||
4. If the building has finished successfully, start the installation of Tk.
|
||||
All binary and service files of the product will be copied to the directory defined by `TK_INSTALL_DIR` (usually it is `TCL_INSTALL_DIR`).
|
||||
4. If the building has finished successfully, start the installation of Tk. All binary and service files of the product will be copied to the directory defined by *TK_INSTALL_DIR* (usually it is TCL_INSTALL_DIR)
|
||||
|
||||
make install
|
||||
make install
|
||||
|
||||
@subsection dev_guides__building_3rdparty_osx_2_2 FreeType
|
||||
@subsection dev_guides__building_3rdparty_osx_2_2 FreeType 2.4.10
|
||||
|
||||
FreeType is required for text display in the 3D viewer.
|
||||
|
||||
FreeType is required for text display in the 3D viewer.
|
||||
Download the necessary archive from https://freetype.org/ and unpack it.
|
||||
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
|
||||
|
||||
1. Enter the directory where the source files of FreeType are located (`FREETYPE_SRC_DIR`).
|
||||
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
|
||||
|
||||
cd FREETYPE_SRC_DIR
|
||||
cd FREETYPE_SRC_DIR
|
||||
|
||||
2. Run the `configure` command
|
||||
2. Run the *configure* command
|
||||
|
||||
configure --prefix=FREETYPE_INSTALL_DIR
|
||||
|
||||
configure --prefix=FREETYPE_INSTALL_DIR
|
||||
For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
|
||||
|
||||
For a 64 bit platform also add `CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'` option to the command line.
|
||||
3. If the *configure* command has finished successfully, start the building process
|
||||
|
||||
3. If the `configure` command has finished successfully, start the building process
|
||||
make
|
||||
|
||||
make
|
||||
4. If building has finished successfully, start the installation of FreeType.
|
||||
All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*.
|
||||
|
||||
4. If building has finished successfully, start the installation of FreeType.
|
||||
All binary and service files of the product will be copied to the directory defined by `FREETYPE_INSTALL_DIR`.
|
||||
make install
|
||||
|
||||
@subsection dev_guides__building_3rdparty_osx_3_1 TBB 3.x or 4.x
|
||||
|
||||
make install
|
||||
This third-party product is installed with binaries from the archive
|
||||
that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*)
|
||||
and pick the archive for Mac OS X platform.
|
||||
To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_osx.tgz*).
|
||||
|
||||
@subsection dev_guides__building_3rdparty_osx_3_1 TBB
|
||||
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage 3.14.1 or 3.15.x
|
||||
|
||||
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
|
||||
Go to the **Download** page, find the release version you need (e.g. `tbb30_018oss`) and pick the archive for Mac OS X platform.
|
||||
To install, unpack the downloaded archive of TBB product (`tbb30_018oss_osx.tgz`).
|
||||
|
||||
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage
|
||||
|
||||
Download the necessary archive from
|
||||
Download the necessary archive from
|
||||
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
and unpack it. The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DIR`.
|
||||
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
|
||||
|
||||
Note that for building FreeImage on Mac OS X 10.7 you should replace `Makefile.osx`
|
||||
in `FREEIMAGE_SRC_DIR` by the corrected file, which you can find in attachment to issue [`#22811`](https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug) in OCCT Mantis bug tracker.
|
||||
Note that for building FreeImage on Mac OS X 10.7 you should replace *Makefile.osx*
|
||||
in *FREEIMAGE_SRC_DIR* by the corrected file, which you can find in attachment to issue #22811 in OCCT Mantis bug tracker
|
||||
(https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug).
|
||||
|
||||
1. If you build FreeImage 3.15.x you can skip this step.
|
||||
1. If you build FreeImage 3.15.x you can skip this step.
|
||||
Modify <i>FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:</i>
|
||||
|
||||
In line 60 insert the following:
|
||||
|
||||
Modify `FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:`<br>
|
||||
In line 60 insert the following:
|
||||
#include string.h
|
||||
|
||||
#include string.h
|
||||
Modify <i>FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp:</i>
|
||||
|
||||
In line 320 replace:
|
||||
|
||||
Modify `FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp`:<br>
|
||||
In line 320 replace:
|
||||
SwapShort(value);
|
||||
|
||||
SwapShort(value);
|
||||
with:
|
||||
|
||||
with:
|
||||
SwapShort(&value);
|
||||
|
||||
SwapShort(&value);
|
||||
2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
|
||||
|
||||
2. Enter the directory where the source files of FreeImage are located (`FREEIMAGE_SRC_DIR`).
|
||||
|
||||
cd FREEIMAGE_SRC_DIR
|
||||
cd FREEIMAGE_SRC_DIR
|
||||
|
||||
3. Run the building process
|
||||
|
||||
make
|
||||
make
|
||||
|
||||
4. Run the installation process
|
||||
4. Run the installation process
|
||||
|
||||
1. If you have the permission to write into <i>/usr/local/include</i> and <i>/usr/local/lib</i> directories, run the following command:
|
||||
|
||||
1. If you have the permission to write into `/usr/local/include` and `/usr/local/lib` directories, run the following command:
|
||||
make install
|
||||
|
||||
make install
|
||||
2. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.osx*:
|
||||
|
||||
2. If you do not have this permission, you need to modify file `FREEIMAGE_SRC_DIR/Makefile.osx`:<br>
|
||||
Change line 49 from:
|
||||
Change line 49 from:
|
||||
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
to:
|
||||
|
||||
PREFIX ?= $(PREFIX)
|
||||
|
||||
PREFIX ?= $(PREFIX)
|
||||
Change lines 65-69 from:
|
||||
|
||||
Change lines 65-69 from:
|
||||
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
|
||||
install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
|
||||
install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
|
||||
ranlib -sf $(INSTALLDIR)/$(STATICLIB)
|
||||
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
|
||||
|
||||
to:
|
||||
|
||||
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
|
||||
install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
|
||||
install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
|
||||
ranlib -sf $(INSTALLDIR)/$(STATICLIB)
|
||||
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
|
||||
|
||||
to:
|
||||
|
||||
install -d $(INCDIR) $(INSTALLDIR)
|
||||
install -m 755 $(HEADER) $(INCDIR)
|
||||
install -m 755 $(STATICLIB) $(INSTALLDIR)
|
||||
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
|
||||
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
|
||||
install -d $(INCDIR) $(INSTALLDIR)
|
||||
install -m 755 $(HEADER) $(INCDIR)
|
||||
install -m 755 $(STATICLIB) $(INSTALLDIR)
|
||||
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
|
||||
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
|
||||
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
|
||||
|
||||
Then run the installation process by the following command:
|
||||
|
||||
make PREFIX=FREEIMAGE_INSTALL_DIR install
|
||||
|
||||
5. Clean temporary files
|
||||
|
||||
Then run the installation process by the following command:
|
||||
|
||||
make PREFIX=FREEIMAGE_INSTALL_DIR install
|
||||
|
||||
5. Clean temporary files
|
||||
|
||||
make clean
|
||||
|
@@ -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/<OS>/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/<OS>/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/<OS>/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.
|
||||
|
BIN
dox/build/build_occt/images/genconf_osx.png
Normal file
After Width: | Height: | Size: 194 KiB |
@@ -234,7 +234,7 @@ This module handles various problems of interoperability between CAD systems, ca
|
||||
* @ref occt_user_guides__step "STEP" (AP203: Mechanical Design, this covers General 3D CAD; AP214: Automotive Design; AP242).
|
||||
* @ref occt_iges_1 "IGES" (up to 5.3).
|
||||
* **glTF** 2.0 reader and writer.
|
||||
* **OBJ** mesh file reader and writer.
|
||||
* **OBJ** mesh file reader.
|
||||
* **VRML** converter translates Open CASCADE shapes to VRML 1.0 files (Virtual Reality Modeling Language).
|
||||
* **STL** converter translates Open CASCADE shapes to STL files.
|
||||
STL (STtereoLithography) format is widely used for rapid prototyping (3D printing).
|
||||
@@ -341,7 +341,7 @@ The tables below describe the recommended software configurations for which OCCT
|
||||
|
||||
| OS | Compiler |
|
||||
| --------- | ----------- |
|
||||
| Windows | Microsoft Visual Studio: 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019, 2022 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
|
||||
| Windows | Microsoft Visual Studio: 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
|
||||
| Linux | GNU gcc 4.3+ <br> LLVM CLang 3.6+ |
|
||||
| OS X / macOS | XCode 6 or newer |
|
||||
| Android | NDK r12, GNU gcc 4.9 or newer |
|
||||
@@ -352,28 +352,29 @@ The tables below describe the recommended software configurations for which OCCT
|
||||
@subsection intro_req_libs Third-party libraries and tools
|
||||
|
||||
The following third-party libraries and tools are not included in OCCT sources but are either required or can be optionally used for the indicated components of OCCT.
|
||||
They are not needed if relevant component is not needed - it is possible building core OCCT modules without additional dependencies.
|
||||
They are not needed if relevant component is not needed.
|
||||
|
||||
Note that pre-built packages of many of the listed libraries are available at
|
||||
https://dev.opencascade.org/resources/download/3rd-party-components
|
||||
https://www.opencascade.com/content/3rd-party-components
|
||||
|
||||
| Component | Where to find | Used for | Purpose |
|
||||
| Component | Where to find | Used for | Required or optional |
|
||||
| --------- | ------------- | -------- | -------------------- |
|
||||
| CMake 2.8+ | https://cmake.org/ | Configuration | Build from sources |
|
||||
| Intel TBB 4.x or later | https://oneapi-src.github.io/oneTBB/ | All | Parallelization of algorithms (alternative to built-in thread pool) |
|
||||
| OpenGL 3.3+, OpenGL ES 2.0+ | System | Visualization | Required for using 3D Viewer |
|
||||
| OpenVR 1.10+ | https://github.com/ValveSoftware/openvr | Visualization | VR (Virtual Reality) support in 3D Viewer |
|
||||
| FreeType 2.4+ | https://www.freetype.org/download.html | Visualization | Text rendering in 3D Viewer |
|
||||
| FreeImage 3.17+ | https://sourceforge.net/projects/freeimage/files | Visualization | Reading/writing image files |
|
||||
| FFmpeg 3.1+ | https://www.ffmpeg.org/download.html | Visualization | Video recording |
|
||||
| VTK 6.1+ | https://www.vtk.org/download/ | IVtk | VTK integration module |
|
||||
| Flex 2.6.4+ and Bison 3.7.1+ | https://sourceforge.net/projects/winflexbison/ | Data Exchange | Updating STEP and ExprIntrp parsers |
|
||||
| RapidJSON 1.1+ | https://rapidjson.org/ | Data Exchange | Reading glTF files |
|
||||
| Draco 1.4.1+ | https://github.com/google/draco | Data Exchange | Reading compressed glTF files |
|
||||
| Tcl/Tk 8.6.3+ | https://www.tcl.tk/software/tcltk/download.html | DRAW Test Harness | Tcl interpretor in Draw module |
|
||||
| Qt 5.3.2+ | https://www.qt.io/download/ | Inspector and Samples | Inspector Qt samples and |
|
||||
| Doxygen 1.8.5+ | https://www.doxygen.nl/download.html | Documentation | (Re)generating documentation |
|
||||
| Graphviz 2.38+ | https://graphviz.org/ | Documentation | Generating dependency graphs |
|
||||
| CMake 2.8+ | https://cmake.org/ | Build from sources | Optional |
|
||||
| Intel TBB 4.x or later | https://www.threadingbuildingblocks.org/ | All | Optional (advanced parallelization of algorithms) |
|
||||
| OpenGL 3.3+, OpenGL ES 2.0+ | System | Visualization | Required |
|
||||
| OpenVR 1.10+ | https://github.com/ValveSoftware/openvr | Visualization | Optional (VR support) |
|
||||
| Direct3D 9 | Windows | Visualization | Optional (integration with GUI using Direct3D) |
|
||||
| FreeType 2.4+ | https://www.freetype.org/download.html | Visualization | Optional (text rendering) |
|
||||
| FreeImage 3.17+ | https://sourceforge.net/projects/freeimage/files | Visualization | Optional (support of common 2D graphic formats) |
|
||||
| FFmpeg 3.1+ | https://www.ffmpeg.org/download.html | Visualization | Optional (video recording) |
|
||||
| VTK 6.1+ | https://www.vtk.org/download/ | Visualization | Optional (VTK integration) |
|
||||
| Flex 2.6.4+ and Bison 3.7.1+ | https://sourceforge.net/projects/winflexbison/ | Data Exchange | Optional (update of STEP and ExprIntrp parsers) |
|
||||
| RapidJSON 1.1+ | https://rapidjson.org/ | Data Exchange | Optional (reading glTF files) |
|
||||
| Draco 1.4.1+ | https://github.com/google/draco | Data Exchange | Optional (reading compressed glTF files) |
|
||||
| Tcl/Tk 8.6.3+ <br> or ActiveTcl 8.6 | https://www.tcl.tk/software/tcltk/download.html <br> https://www.activestate.com/activetcl/downloads | DRAW Test Harness | Required |
|
||||
| Qt Desktop: Qt 4.8.6+ <br> Android: Qt 5.3.2+ | https://www.qt.io/download/ | Samples and demos | Optional (Qt samples) |
|
||||
| Doxygen 1.8.5+ | https://www.doxygen.nl/download.html | Documentation | Required |
|
||||
| Graphviz 2.38+ | https://graphviz.org/ | Documentation | Optional (dependency graphs) |
|
||||
|
||||
@subsection intro_req_hw Hardware
|
||||
|
||||
@@ -397,7 +398,7 @@ Don't forget to report these bugs to vendors.
|
||||
|
||||
@section intro_install Download and Installation
|
||||
|
||||
OCCT can be downloaded from https://dev.opencascade.org/release
|
||||
OCCT can be downloaded from https://www.opencascade.com/content/latest-release
|
||||
|
||||
In most cases you would want to rebuild OCCT from sources on your platform (OS, compiler) before
|
||||
using it in your project, to ensure binary compatibility and appropriate configuration of the library.
|
||||
@@ -431,7 +432,7 @@ The contents of the OCCT-7.4.0 directory (called further "OCCT root", or $CASROO
|
||||
|
||||
* **adm** This folder contains administration files, which allow rebuilding OCCT;
|
||||
* **adm/cmake** This folder contains files of CMake building procedure;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2013, 2015, 2017, 2019 and 2022 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2010, 2012, 2013, 2015, 2017 and 2019 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **adm/scripts** This folder contains auxiliary scripts for semi-automated building and packaging of OCCT for different platforms;
|
||||
* **data** This folder contains CAD files in different formats, which can be used to test the OCCT functionality;
|
||||
* **doc** This folder contains OCCT documentation in HTML and PDF format;
|
||||
@@ -441,7 +442,7 @@ The contents of the OCCT-7.4.0 directory (called further "OCCT root", or $CASROO
|
||||
* **src** This folder contains OCCT source files. They are organized in folders, one per development unit;
|
||||
* **tests** This folder contains scripts for OCCT testing.
|
||||
* **tools** This folder contains sources of Inspector tool.
|
||||
* **win64/vc14** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2015;
|
||||
* **win64/vc10** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2010;
|
||||
|
||||
@subsection intro_install_linux Linux
|
||||
|
||||
@@ -462,7 +463,7 @@ To run any Open CASCADE Technology application you need to set the environment v
|
||||
|
||||
You can define the environment variables with env.bat script located in the
|
||||
$CASROOT folder. This script accepts two arguments to be used:
|
||||
the version of Visual Studio (vc12 -- vc142) and the architecture (win32 or win64).
|
||||
the version of Visual Studio (vc10 -- vc142) and the architecture (win32 or win64).
|
||||
|
||||
The additional environment settings necessary for compiling OCCT libraries and samples
|
||||
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.
|
||||
@@ -506,7 +507,7 @@ The scripts are located in the OCCT root folder.
|
||||
* **CSF_ShadersDirectory** (optional) defines the directory for GLSL programs for Ray Tracing renderer (embedded resources are used when variable is undefined);
|
||||
* **CSF_SHMessage** (optional) defines the path to the messages file for *ShapeHealing*;
|
||||
* **CSF_XSMessage** (optional) defines the path to the messages file for **STEP** and **IGES** translators;
|
||||
* **CSF_StandardDefaults**, **CSF_StandardLiteDefaults**, **CSF_XCAFDefaults**, and **CSF_PluginDefaults** define paths to directory where configuration files for OCAF persistence are located (required for open/save operations with OCAF documents);
|
||||
* **CSF_StandardDefaults**, **CSF_StandardLiteDefaults*, **CSF_XCAFDefaults**, and **CSF_PluginDefaults** define paths to directory where configuration files for OCAF persistence are located (required for open/save operations with OCAF documents);
|
||||
* **CSF_IGESDefaults** and **CSF_STEPDefaults** (optional) define paths to directory where resource files of **IGES** and **STEP** translators are located;
|
||||
* **CSF_XmlOcafResource** is required in order to set the path to **XSD** resources, which defines XML grammar.
|
||||
* **CSF_MIGRATION_TYPES** is required in order to read documents that contain old data types, such as *TDataStd_Shape*;
|
||||
@@ -531,7 +532,7 @@ At minimum the following should be considered:
|
||||
the application should be provided separately in a modifiable form, with all materials needed for the user to be able to run the application with a modified version of OCCT.
|
||||
|
||||
If you want to use Open CASCADE Technology without being bound by LGPL requirements,
|
||||
please <a href="https://dev.opencascade.org/webform/contact_us">contact Open CASCADE company</a> for a commercial license.
|
||||
please <a href="https://www.opencascade.com/contact">contact Open CASCADE company</a> for a commercial license.
|
||||
|
||||
Note that Open CASCADE Technology is provided on an "AS IS" basis, WITHOUT
|
||||
WARRANTY OF ANY KIND. The entire risk related to any use of the OCCT code and
|
||||
@@ -592,10 +593,10 @@ If you need further information on VTK, refer to VTK Homepage https://www.vtk.or
|
||||
**Doxygen** developed by Dimitri van Heesch is open source documentation system for
|
||||
C++, C, Java, Objective-C, Python, IDL, PHP and C#. This product is used in Open CASCADE Technology
|
||||
for automatic creation of Technical Documentation from C++ header files.
|
||||
If you need further information on Doxygen, refer to https://www.doxygen.nl/index.html.
|
||||
If you need further information on Doxygen, refer to https://www.stack.nl/~dimitri/doxygen/index.html.
|
||||
|
||||
**Graphviz** is open source graph visualization software developed by John Ellson, Emden Gansner, Yifan Hu and Arif Bilgin.
|
||||
Graph visualization is representation of structured information as diagrams of abstract graphs and networks.
|
||||
Graph visualization is representiation of structured information as diagrams of abstract graphs and networks.
|
||||
This product is used together with Doxygen in Open CASCADE Technology for automatic creation of Technical Documentation
|
||||
(generation of dependency graphs). Current versions of Graphviz are licensed on an open source
|
||||
basis under The Eclipse Public License (EPL) (https://www.graphviz.org/license/).
|
||||
|
@@ -1,911 +0,0 @@
|
||||
AIS: Custom Presentation {#tutorials__ais_object}
|
||||
========
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section intro Getting Started
|
||||
|
||||
OCCT provides a strong set of built-in Interactive Objects for rapid application development,
|
||||
but the real power and flexibility of **Application Interactive Services** (@c AIS) could be revealed by subclassing and implementing custom presentations.
|
||||
In this tutorial we will focus on the development of a custom @c AIS_InteractiveObject and show the basics step by step.
|
||||
|
||||
Let's start from the very beginning and try subclassing @c AIS_InteractiveObject object:
|
||||
|
||||
~~~~{.cpp}
|
||||
class MyAisObject : public AIS_InteractiveObject
|
||||
{
|
||||
DEFINE_STANDARD_RTTI_INLINE(MyAisObject, AIS_InteractiveObject)
|
||||
public:
|
||||
MyAisObject() {}
|
||||
public:
|
||||
virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode) override {}
|
||||
|
||||
virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode) override {}
|
||||
|
||||
virtual bool AcceptDisplayMode (const Standard_Integer theMode) const override
|
||||
{ return true; }
|
||||
};
|
||||
~~~~
|
||||
|
||||
@c DEFINE_STANDARD_RTTI_INLINE() macro will register the new class within the OCCT Run-Time Type Information (RTTI) system.
|
||||
This step is optional (you may skip it if you are not going to use methods like @c Standard_Transient::DynamicType() in application code), but it is a common practice while subclassing OCCT classes.
|
||||
|
||||
The @c AIS_InteractiveObject interface defines only a couple of pure virtual methods - @c @::Compute() defining an object presentation and @c @::ComputeSelection() defining a selectable (pickable) volume.
|
||||
Selection and presentation are two independent mechanisms in **AIS**. Presentation rendering is done with help of OpenGL or a similar low-level graphics library, while selection doesn't depend on a graphic driver at all.
|
||||
Providing an empty implementation of these two methods would be enough for adding the object to @c AIS_InteractiveContext (@c @::Display()), but obviously nothing will appear on the screen.
|
||||
|
||||
@section prs_builders Presentation builders
|
||||
|
||||
To go ahead, we need to define some presentation of our object.
|
||||
OCCT provides a set of presentation building tools for common elements like arrows, shapes, boxes, etc.
|
||||
These tools could be found within @c Prs3d, @c StdPrs and @c DsgPrs packages:
|
||||
|
||||
- **Prs3d**
|
||||
provides builders for simple geometric elements.
|
||||
- @c Prs3d_Arrow, @c Prs3d_BndBox, @c Prs3d_Point, @c Prs3d_Text, @c Prs3d_ToolCylinder, @c Prs3d_ToolDisk, @c Prs3d_ToolSector, @c Prs3d_ToolSphere, @c Prs3d_ToolTorus
|
||||
- **StdPrs**
|
||||
provides builders for analytical geometry and B-Rep shapes (@c TopoDS_Shape).
|
||||
- @c StdPrs_WFShape, @c StdPrs_ShadedShape, @c StdPrs_BRepTextBuilder
|
||||
- **DsgPrs**
|
||||
provides builders for datums, dimensions and relations.
|
||||
|
||||
Presentation builders are reusable bricks for constructing @c AIS objects.
|
||||
Standard OCCT interactive objects highly rely on them, so that you may easily replicate @c AIS_Shape presentation for displaying a shape with just a couple of lines calling @c StdPrs_ShadedShape:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
|
||||
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
|
||||
}
|
||||
...
|
||||
Handle(AIS_InteractiveContext) theCtx;
|
||||
Handle(MyAisObject) aPrs = new MyAisObject();
|
||||
theCtx->Display (aPrs, true);
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step1_shaded.png,"@c StdPrs_ShadedShape presentation builder.",409} height=409px
|
||||
|
||||
@c PrsMgr_PresentableObject::Compute() method takes three arguments:
|
||||
- **Presentation Manager** (@c PrsMgr_PresentationManager).
|
||||
Rarely used parameter, but might be necessary for some advanced use cases.
|
||||
- **Presentation** (@c Prs3d_Presentation or @c Graphic3d_Structure).
|
||||
Defines the structure to fill in with presentation elements.
|
||||
- **Display Mode** (integer number).
|
||||
Specifies the display mode to compute.
|
||||
**0** is a default display mode, if not overridden by @c AIS_InteractiveObject::SetDisplayMode() or by @c AIS_InteractiveContext::Display().
|
||||
|
||||
For each supported display mode, the **Presentation Manager** creates a dedicated @c Prs3d_Presentation and stores it within the object itself as a list of presentations @c PrsMgr_PresentableObject::Presentations().
|
||||
It is a good practice to reject unsupported display modes within @c @::Compute() method:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
if (theMode != 0) { return; } // reject non-zero display modes
|
||||
|
||||
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
|
||||
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
|
||||
}
|
||||
~~~~
|
||||
|
||||
This wouldn't, however, prevent application from displaying the object with another display mode like this:
|
||||
|
||||
~~~~{.cpp}
|
||||
Handle(AIS_InteractiveContext) theCtx;
|
||||
Handle(MyAisObject) aPrs = new MyAisObject();
|
||||
theCtx->Display (aPrs, 100, -1, true);
|
||||
~~~~
|
||||
|
||||
The code above will display @c MyAisObject with display mode equal to 100, and after @c @::Compute() modifications nothing will be displayed on the screen.
|
||||
@c AIS will still create a presentation with specified display mode, but it will be empty - method @c @::AcceptDisplayMode() could be overridden to disallow even creation of an empty presentation:
|
||||
|
||||
~~~~{.cpp}
|
||||
bool MyAisObject::AcceptDisplayMode (const Standard_Integer theMode) const
|
||||
{
|
||||
return theMode == 0; // reject non-zero display modes
|
||||
}
|
||||
~~~~
|
||||
|
||||
@c AIS_InteractiveContext::Display() checks if requested display mode is actually supported by the object, and uses default display mode (_**0**_) if it is not.
|
||||
@c StdPrs_ShadedShape prepares a shaded (triangulated) presentation of a shape, while @c StdPrs_WFShape creates a wireframe presentation with B-Rep wire boundaries:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
if (!AcceptDisplayMode (theMode)) { return; }
|
||||
|
||||
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
|
||||
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer); // add shading
|
||||
StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
|
||||
}
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step1_shaded_wf.png,"Result of @c StdPrs_ShadedShape + @c StdPrs_WFShape presentation builders.",409} height=409px
|
||||
|
||||
Presentation builders take the @c Prs3d_Drawer object defining various attributes - material of shaded shape, number of isolines in wireframe mode, tessellation quality, line colors and many others.
|
||||
@c PrsMgr_PresentableObject defines @c myDrawer property with default attributes.
|
||||
@c StdPrs makes it easy to display topological shapes.
|
||||
With the help of @c Prs3d tools we may display elements like arrows, boxes or text labels.
|
||||
Let's extend our presentation with a second **display mode 1** showing a bounding box using @c Prs3d_BndBox builder:
|
||||
|
||||
~~~~{.cpp}
|
||||
bool MyAisObject::AcceptDisplayMode (const Standard_Integer theMode) const
|
||||
{
|
||||
return theMode == 0 || theMode == 1;
|
||||
}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
|
||||
if (theMode == 0)
|
||||
{
|
||||
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
|
||||
StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
|
||||
}
|
||||
else if (theMode == 1)
|
||||
{
|
||||
Bnd_Box aBox;
|
||||
BRepBndLib::Add (aShape, aBox);
|
||||
Prs3d_BndBox::Add (thePrs, aBox, myDrawer);
|
||||
}
|
||||
}
|
||||
~~~~
|
||||
|
||||
Now, displaying an object with **display mode 1** will show a box:
|
||||
|
||||
~~~~{.cpp}
|
||||
Handle(AIS_InteractiveContext) theCtx;
|
||||
Handle(MyAisObject) aPrs = new MyAisObject();
|
||||
theCtx->Display (aPrs, 1, 0, true);
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step1_bndbox.png,"@c Prs3d_BndBox presentation builder.",409} height=409px
|
||||
|
||||
@c AIS disallows activating multiple display modes at the same time, so that these presentation modes should be alternatives to each other.
|
||||
But @c AIS may use non-active display mode for highlighting purposes - like wireframe (@c AIS_Wireframe) presentation displayed on top of shaded (@c AIS_Shaded) presentation for selected @c AIS_Shape objects.
|
||||
|
||||
Let's define a dedicated enumeration for display modes supported by our interactive object and setup the 1st (@c MyDispMode_Highlight) display mode for highlighting with help of @c PrsMgr_PresentableObject::SetHilightMode():
|
||||
|
||||
~~~~{.cpp}
|
||||
class MyAisObject : public AIS_InteractiveObject
|
||||
{
|
||||
public:
|
||||
enum MyDispMode { MyDispMode_Main = 0, MyDispMode_Highlight = 1 };
|
||||
|
||||
...
|
||||
|
||||
MyAisObject::MyAisObject()
|
||||
{
|
||||
SetDisplayMode (MyDispMode_Main); // main (active) display mode
|
||||
SetHilightMode (MyDispMode_Highlight); // auxiliary (highlighting) mode
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
Handle(AIS_InteractiveContext) theCtx;
|
||||
Handle(MyAisObject) aPrs = new MyAisObject();
|
||||
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
|
||||
theCtx->HilightWithColor (aPrs, aPrs->HilightAttributes(), false);
|
||||
theCtx->CurrentViewer()->Redraw();
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step1_highlight.png,"Highlighting by color (left) and highlighting by another display mode (right).",818} height=409px
|
||||
|
||||
In this particular use case we've used the method @c AIS_InteractiveContext::HilightWithColor() instead of @c @::SetSelected() - just because our object is not selectable yet and @c @::SetSelected() wouldn't work.
|
||||
Highlighted presentation appears on the screen with modulated color (see left screenshot above).
|
||||
Using a dedicated display mode for highlighting (right screenshot above) allows customizing presentation in selected / highlighted states.
|
||||
|
||||
@section prim_arrays Primitive arrays
|
||||
|
||||
@c Prs3d_Presentation might be filled in by the following **primitives**:
|
||||
- **Triangles**
|
||||
- @c Graphic3d_ArrayOfTriangles
|
||||
- @c Graphic3d_ArrayOfTriangleFans
|
||||
- @c Graphic3d_ArrayOfTriangleStrips
|
||||
- **Lines**
|
||||
- @c Graphic3d_ArrayOfSegments
|
||||
- @c Graphic3d_ArrayOfPolylines
|
||||
- **Points** or **Markers**
|
||||
- @c Graphic3d_ArrayOfPoints
|
||||
|
||||
This triplet of primitives is what graphics hardware is capable of rendering, so that it could be transferred directly to low-level graphics libraries in the form of *Vertex Buffer Objects* (VBO).
|
||||
Each **primitive array** consists of an array of vertex attributes (_**position**, **normal**, **texture coordinates**, **vertex colors**_, etc.) and optional **array of indices**.
|
||||
The latter one avoids duplicating vertices shared between connected elements (triangles, polylines) in attributes array.
|
||||
|
||||
@c Graphic3d_ArrayOfPrimitives and it's subclasses provide a convenient interface for filling in primitive arrays:
|
||||
- Constructor takes a number of vertices, number of edges (indices) and a bitmask of optional vertex attributes.
|
||||
- @c Graphic3d_ArrayOfPrimitives::AddVertex() appends a vertex with specified attributes to the end of the array (within the range specified at construction time).
|
||||
- @c Graphic3d_ArrayOfPrimitives::AddEdges() appends indices, starting with 1.
|
||||
Each line segment is defined by two consequential edges, each triangle is defined by three consequential edges.
|
||||
|
||||
Let's extend our sample and display a cylinder section contour defined by array of indexed segments (e.g. a polyline of four vertices):
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const double aRadius = 100.0, aHeight = 100.0;
|
||||
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
|
||||
if (theMode == MyDispMode_Main)
|
||||
{
|
||||
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
|
||||
//StdPrs_WFShape::Add (thePrs, aShape, myDrawer);
|
||||
Handle(Graphic3d_ArrayOfSegments) aSegs = new Graphic3d_ArrayOfSegments (4, 4 * 2, Graphic3d_ArrayFlags_None);
|
||||
aSegs->AddVertex (gp_Pnt (0.0, -aRadius, 0.0));
|
||||
aSegs->AddVertex (gp_Pnt (0.0, -aRadius, aHeight));
|
||||
aSegs->AddVertex (gp_Pnt (0.0, aRadius, aHeight));
|
||||
aSegs->AddVertex (gp_Pnt (0.0, aRadius, 0.0));
|
||||
aSegs->AddEdges (1, 2);
|
||||
aSegs->AddEdges (2, 3);
|
||||
aSegs->AddEdges (3, 4);
|
||||
aSegs->AddEdges (4, 1);
|
||||
Handle(Graphic3d_Group) aGroupSegs = thePrs->NewGroup();
|
||||
aGroupSegs->SetGroupPrimitivesAspect (myDrawer->WireAspect()->Aspect());
|
||||
aGroupSegs->AddPrimitiveArray (aSegs);
|
||||
}
|
||||
else if (theMode == MyDispMode_Highlight) { ... }
|
||||
}
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step2_segments.png,"Displaying @c Graphic3d_ArrayOfSegments.",409} height=409px
|
||||
|
||||
The process is quite straightforward:
|
||||
- Create a new @c Graphic3d_Group using @c Prs3d_Presentation::NewGroup();
|
||||
- Specify presentation aspects using @c Graphic3d_Group::SetGroupPrimitivesAspect();
|
||||
- Create and add an array of primitives using @c Graphic3d_Group::AddPrimitiveArray().
|
||||
|
||||
Standard presentation builders like @c StdPrs_ShadedShape / @c StdPrs_WFShape internally do exactly the same thing - a tessellated representation of a shape is added to presentation in form of triangles (shaded),
|
||||
line segments (wireframe and free edges) and markers (free shape vertices).
|
||||
|
||||
A single @c Graphic3d_Group normally defines just a single primitive array, but it is technically possible adding more arrays to the same group @c Graphic3d_Group::AddPrimitiveArray()
|
||||
and with different aspects @c Graphic3d_Group::SetPrimitivesAspect(), which might be considered in advanced scenarios.
|
||||
|
||||
Method @c Graphic3d_Group::AddText() allows adding text labels to a presentation.
|
||||
Internally, text labels are rendered as an array of textured triangles using texture atlas created from a font, but this complex logic is hidden from the user.
|
||||
|
||||
@section prim_aspects Primitive aspects
|
||||
|
||||
@c Graphic3d_Aspects is a class defining **display properties** of a primitive array (@c Graphic3d_Group::SetGroupPrimitivesAspect()) -
|
||||
_**material**, **shading model**, **color**, **texture maps**, **blending mode**, **line width**_ and others.
|
||||
|
||||
There are also subclasses @c Graphic3d_AspectFillArea3d (triangles), @c Graphic3d_AspectLine3d (lines), @c Graphic3d_AspectMarker3d (markers)
|
||||
and @c Graphic3d_AspectText3d (text labels) defined as specializations for a specific primitive array type.
|
||||
These subclasses exist for historical reasons and are treated by renderers in exactly the same way.
|
||||
|
||||
It is technically possible to create transient aspects directly within @c @::Compute() method like this:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
Handle(Graphic3d_Aspects) anAspects = new Graphic3d_Aspects();
|
||||
anAspects->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
|
||||
anAspects->SetColor (Quantity_NOC_RED);
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (anAspects);
|
||||
...
|
||||
}
|
||||
~~~~
|
||||
|
||||
While this code would work as expected, but prevents further dynamic updates of presentation aspects without recomputing entire presentation.
|
||||
Instead, it is preferred taking attributes from @c PrsMgr_PresentableObject::myDrawer / @c @::Attributes() or storing custom attributes as class fields.
|
||||
@c Prs3d_Drawer defines a set of attributes used by @c AIS presentation builders, but the same parameters might be used by a custom builder as well.
|
||||
|
||||
It is also preferred preallocating attributes in the class constructor.
|
||||
This would allow changing attributes without recomputing the entire presentation - just by calling @c PrsMgr_PresentableObject::SynchronizeAspects() after modifications.
|
||||
Our custom object uses @c myDrawer->ShadingAspect() and @c myDrawer->WireAspect() aspects, so let's initialize them explicitly - assign silver material for shading and green color to line segments:
|
||||
|
||||
~~~~{.cpp}
|
||||
MyAisObject::MyAisObject()
|
||||
{
|
||||
SetHilightMode (MyDispMode_Highlight);
|
||||
myDrawer->SetupOwnShadingAspect();
|
||||
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Silver);
|
||||
myDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 2.0));
|
||||
}
|
||||
~~~~
|
||||
|
||||
@section quadric_builders Quadric builders
|
||||
|
||||
Previously, we've used @c StdPrs_ShadedShape for displaying cylinder geometry.
|
||||
The @c Prs3d package provides a simpler way for displaying geometry like cylinders, spheres and toruses - based on the @c Prs3d_ToolQuadric interface.
|
||||
This interface allows bypassing creation of a complex B-Rep (@c TopoDS_Shape) definition of a simple geometry, and to avoid using general-purpose tessellators like @c BRepMesh.
|
||||
|
||||
> This difference could be negligible for a small number of such objects, but might become considerable for larger amounts.
|
||||
> The B-Rep definition of a valid cylinder includes 2 unique @c TopoDS_Vertex, 3 @c TopoDS_Edge, 3 @c TopoDS_Wire, 3 @c TopoDS_Face, 1 @c TopoDS_Shell and 1 @c TopoDS_Solid.
|
||||
> Internally each @c TopoDS_Edge also defines curves (@c Geom_Curve as well as 2D parametric @c Geom2d_Curve) and each @c TopoDS_Face defines analytical surface (@c Geom_Surface).
|
||||
> Meshing such geometry with the help of @c BRepMesh is much more complicated than one may think.
|
||||
> A plenty of data structures (memory!) and computations (time!) for displaying a geometry that could be triangulated by a simple for loop.
|
||||
|
||||
@c Prs3d_ToolQuadric solves this problem by creating a triangulation for such kinds of shapes in a straight-forward way.
|
||||
Let's try using @c Prs3d_ToolCylinder in our sample:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const double aRadius = 100.0, aHeight = 100.0;
|
||||
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
|
||||
if (theMode == MyDispMode_Main)
|
||||
{
|
||||
//StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer); // add shading
|
||||
//StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris =
|
||||
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 10, 10, gp_Trsf());
|
||||
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
|
||||
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroupTris->AddPrimitiveArray (aTris);
|
||||
...
|
||||
}
|
||||
...
|
||||
}
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step3_quadrics_10.png,"@c Prs3d_ToolCylinder (10 slices).",409} height=409px
|
||||
|
||||
Well... that looks a little bit edgy.
|
||||
Quadric builder creates a triangulation taking the following parameters:
|
||||
- Geometry parameters.
|
||||
(in case of a cylinder - base radius, top radius and height).
|
||||
- Number of subdivisions along U (slices) and V (stacks) parameters.
|
||||
In some cases only one parametric scope matters.
|
||||
- Transformation @c gp_Trsf to apply
|
||||
(original geometry is defined within some reference coordinate system).
|
||||
|
||||
Let's increase number of subdivisions from _10_ to _25_:
|
||||
~~~~{.cpp}
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris =
|
||||
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 25, 25, gp_Trsf());
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step3_quadrics_25.png,"@c Prs3d_ToolCylinder (25 slices).",409} height=409px
|
||||
|
||||
It looks much better now! Note that @c Prs3d_ToolCylinder could be used for building both cones and cylinders depending on top/bottom radius definition.
|
||||
|
||||
There is one issue though - our cylinder doesn't have top and bottom anymore!
|
||||
To fix this problem we will use one more quadric builder @c Prs3d_ToolDisk:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const double aRadius = 100.0, aHeight = 100.0;
|
||||
if (theMode == MyDispMode_Main)
|
||||
{
|
||||
Prs3d_ToolCylinder aCyl (aRadius, aRadius, aHeight, 25, 25);
|
||||
Prs3d_ToolDisk aDisk (0.0, aRadius, 25, 1);
|
||||
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris =
|
||||
new Graphic3d_ArrayOfTriangles (aCyl.VerticesNb() + 2 * aDisk.VerticesNb(),
|
||||
3 * (aCyl.TrianglesNb() + 2 * aDisk.TrianglesNb()),
|
||||
Graphic3d_ArrayFlags_VertexNormal);
|
||||
aCyl .FillArray (aTris, gp_Trsf());
|
||||
aDisk.FillArray (aTris, gp_Trsf());
|
||||
|
||||
gp_Trsf aDisk2Trsf;
|
||||
aDisk2Trsf.SetTransformation (gp_Ax3 (gp_Pnt (0.0, 0.0, aHeight), -gp::DZ(), gp::DX()), gp::XOY());
|
||||
aDisk.FillArray (aTris, aDisk2Trsf);
|
||||
|
||||
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
|
||||
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroupTris->AddPrimitiveArray (aTris);
|
||||
aGroupTris->SetClosed (true);
|
||||
...
|
||||
}
|
||||
}
|
||||
~~~~
|
||||
|
||||
Now our cylinder looks solid! The sample above merges two triangulations into a single one instead of appending each primitive array individually.
|
||||
|
||||
This looks like a minor difference, but it might have a _dramatic impact on performance_ in case of a large scene,
|
||||
as each `Graphic3d_ArrayOfPrimitives` is mapped into a dedicated draw call at graphic driver (OpenGL) level.
|
||||
|
||||
@figure{ais_object_step3_quadrics_fin.png,"@c Prs3d_ToolCylinder + @c Prs3d_ToolDisk.",409} height=409px
|
||||
|
||||
As an exercise, let's try computing a triangulation for cylinder disk without help of @c Prs3d_ToolDisk builder:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const double aRadius = 100.0, aHeight = 100.0;
|
||||
if (theMode == MyDispMode_Main)
|
||||
{
|
||||
const int aNbSlices = 25;
|
||||
Prs3d_ToolCylinder aCyl (aRadius, aRadius, aHeight, aNbSlices, aNbSlices);
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris =
|
||||
new Graphic3d_ArrayOfTriangles (aCyl.VerticesNb(),
|
||||
3 * (aCyl.TrianglesNb()),
|
||||
Graphic3d_ArrayFlags_VertexNormal);
|
||||
aCyl.FillArray (aTris, gp_Trsf());
|
||||
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris2 =
|
||||
new Graphic3d_ArrayOfTriangles (aNbSlices + 1, aNbSlices * 3, Graphic3d_ArrayFlags_VertexNormal);
|
||||
aTris2->AddVertex (gp_Pnt (0.0, 0.0, aHeight), -gp::DZ());
|
||||
for (int aSliceIter = 0; aSliceIter < aNbSlices; ++aSliceIter)
|
||||
{
|
||||
double anAngle = M_PI * 2.0 * double(aSliceIter) / double(aNbSlices);
|
||||
aTris2->AddVertex (gp_Pnt (Cos (anAngle) * aRadius, Sin (anAngle) * aRadius, aHeight), -gp::DZ());
|
||||
}
|
||||
for (int aSliceIter = 0; aSliceIter < aNbSlices; ++aSliceIter)
|
||||
{
|
||||
aTris2->AddEdges (1, aSliceIter + 2, aSliceIter + 1 < aNbSlices ? (aSliceIter + 3) : 2);
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
|
||||
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroupTris->AddPrimitiveArray (aTris);
|
||||
aGroupTris->AddPrimitiveArray (aTris2);
|
||||
...
|
||||
}
|
||||
}
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step3_quadrics_disk.png,"Manually triangulated disk.",409} height=409px
|
||||
|
||||
The disk is here, but it has a strange color - like it is not affected by lighting.
|
||||
This happens when vertex normals are defined incorrectly.
|
||||
In our case we defined disk normal as @c -DZ (see the second argument of @c Graphic3d_ArrayOfTriangles::AddVertex()),
|
||||
but normal direction should be also aligned to triangulation winding rule.
|
||||
Graphic driver defines the front side of triangle using clockwise order of triangle nodes, and normal should be defined for a front side of triangle - e.g. it should be @c gp::DZ() in our case.
|
||||
After reversing vertex normal direction, cylinder looks exactly like when @c Prs3d_ToolDisk was used.
|
||||
|
||||
Front / back face orientation might be displayed using different material based on @c Graphic3d_Aspects::SetDistinguish() flag and @c @::FrontMaterial() / @c @::BackMaterial() setup.
|
||||
|
||||
@section ais_selection Computing selection
|
||||
In the first part of the tutorial we have created a custom @c AIS object @c MyAisObject computing presentation by implementing the @c PrsMgr_PresentableObject::Compute() interface.
|
||||
In this part we will extend our object with interactive capabilities and make it selectable through implementing @c SelectMgr_SelectableObject interface.
|
||||
|
||||
Let's do the first step and put into @c @::ComputeSelection() method some logic.
|
||||
This method should fill in the @c SelectMgr_Selection argument with @c SelectMgr_SensitiveEntity entities defining selectable elements - triangulations, polylines, points and their composition.
|
||||
@c Select3D_SensitiveBox is probably the simplest way to define selectable volume - by it's bounding box:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const double aRadius = 100.0, aHeight = 100.0;
|
||||
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
|
||||
Bnd_Box aBox;
|
||||
BRepBndLib::Add (aShape, aBox);
|
||||
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
|
||||
Handle(Select3D_SensitiveBox) aSensBox = new Select3D_SensitiveBox (anOwner, aBox);
|
||||
theSel->Add (aSensBox);
|
||||
}
|
||||
~~~~
|
||||
|
||||
@c SelectMgr_EntityOwner is a key object in selection logic - it serves as an identifier of a pickable object or it's part.
|
||||
You may see this object in methods like @c AIS_InteractiveContext::DetectedOwner(), **Owners** are stored within the list of selection objects @c AIS_Selection
|
||||
and it received by methods like @c AIS_InteractiveContext::SetSelected() and @c AIS_InteractiveContext::AddOrRemoveSelected().
|
||||
From the Selector's point of view, @c AIS_InteractiveObject is just a drawer for @c SelectMgr_EntityOwner.
|
||||
|
||||
The _**0th selection mode**_ normally defines a single Owner of the entire object.
|
||||
To make a composite object selectable as whole, we add to Selection as many SensitiveEntity as necessary referring to the same Owner.
|
||||
It might look confusing from first glance, that @c SelectMgr_SensitiveEntity stores @c SelectMgr_EntityOwner as a class field, and not in the opposite way
|
||||
(@c SelectMgr_EntityOwner doesn't store the list of @c SelectMgr_SensitiveEntity defining it's picking volume).
|
||||
|
||||
For local selection (selection of object parts) we create individual Owners for each part and add SensitiveEntity to Selection in the same way.
|
||||
Owner may store an additional identifier as a class field, like @c StdSelect_BRepOwner stores @c TopoDS_Shape as an identifier of picked sub-shape with @c AIS_Shape object.
|
||||
|
||||
In a similar way as @c StdPrs_ShadedShape is a **presentation builder** for @c TopoDS_Shape, the @c StdSelect_BRepSelectionTool can be seen as a standard **selection builder** for shapes:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const double aRadius = 100.0, aHeight = 100.0;
|
||||
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
|
||||
Standard_Real aDefl = StdPrs_ToolTriangulatedShape::GetDeflection (aShape, myDrawer);
|
||||
StdSelect_BRepSelectionTool::Load (theSel, this, aShape, TopAbs_SHAPE, aDefl,
|
||||
myDrawer->DeviationAngle(),
|
||||
myDrawer->IsAutoTriangulation());
|
||||
}
|
||||
~~~~
|
||||
|
||||
Internally, @c StdSelect_BRepSelectionTool iterates over sub-shapes and appends to the Selection (@c theSel) entities like @c Select3D_SensitiveTriangulation (for faces) and @c Select3D_SensitiveCurve (for edges).
|
||||
|
||||
Previously, we have used @c Prs3d_ToolCylinder to triangulate a cylinder, so let's try to construct @c Select3D_SensitivePrimitiveArray from the same triangulation:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const double aRadius = 100.0, aHeight = 100.0;
|
||||
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris =
|
||||
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 25, 25, gp_Trsf());
|
||||
Handle(Select3D_SensitivePrimitiveArray) aSensTri =
|
||||
new Select3D_SensitivePrimitiveArray (anOwner);
|
||||
aSensTri->InitTriangulation (aTris->Attributes(), aTris->Indices(),
|
||||
TopLoc_Location());
|
||||
theSel->Add (aSensTri);
|
||||
}
|
||||
~~~~
|
||||
|
||||
Selection is computed independently from presentation, so that they don't have to match each other.
|
||||
But inconsistency between presentation and selection might confuse a user, when he will not be able to pick an object clearly displayed under the mouse cursor.
|
||||
These issues might happen, for example, when selection uses tessellated representation of the same geometry computed with different parameters (different number of subdivisions, or different deflection parameters).
|
||||
|
||||
As in case of @c @::Compute(), it makes sense defining some enumeration of **selection modes** supported by specific object and reject unsupported ones to avoid unexpected behavior:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
if (theMode != 0) { return; }
|
||||
...
|
||||
}
|
||||
~~~~
|
||||
|
||||
Unlike display modes, @c AIS_InteractiveContext allows activating an arbitrary combination of selection modes.
|
||||
A user should be careful to activate only the modes that actually make sense and may work together.
|
||||
|
||||
Selection mode to activate could be specified while displaying the object (passing _**-1**_ instead of _**0**_ would display an object with deactivated selection):
|
||||
|
||||
~~~~{.cpp}
|
||||
Handle(AIS_InteractiveContext) theCtx;
|
||||
Handle(MyAisObject) aPrs = new MyAisObject();
|
||||
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
|
||||
~~~~
|
||||
|
||||
Later on @c AIS_InteractiveContext::SetSelectionModeActive(), or it's wrappers @c AIS_InteractiveContext::Activate() and @c AIS_InteractiveContext::Deactivate(),
|
||||
could be used to enable or disable desired selection modes one by one.
|
||||
|
||||
@section sel_owner_highlight Highlighting selection owner
|
||||
|
||||
As has been mentioned in the previous section, @c SelectMgr_EntityOwner is a key object which can be used as an identifier of selectable part(s).
|
||||
Naturally, you might want to subclass it to put some application-specific ids for identification of selected parts.
|
||||
But there are more things you may do with the Owner class like customized highlighting.
|
||||
|
||||
Let's start from the beginning and define a custom Owner class:
|
||||
|
||||
~~~~{.cpp}
|
||||
class MyAisOwner : public SelectMgr_EntityOwner
|
||||
{
|
||||
DEFINE_STANDARD_RTTI_INLINE(MyAisOwner, SelectMgr_EntityOwner)
|
||||
public:
|
||||
MyAisOwner (const Handle(MyAisObject)& theObj, int thePriority = 0)
|
||||
: SelectMgr_EntityOwner (theObj, thePriority) {}
|
||||
|
||||
virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode) override
|
||||
{ base_type::HilightWithColor (thePrsMgr, theStyle, theMode); }
|
||||
|
||||
virtual void Unhilight (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Standard_Integer theMode) override
|
||||
{ base_type::Unhilight (thePrsMgr, theMode); }
|
||||
protected:
|
||||
Handle(Prs3d_Presentation) myPrs;
|
||||
};
|
||||
~~~~
|
||||
|
||||
@c SelectMgr_EntityOwner doesn't define any pure virtual methods, and can be instanced straight ahead, like it was done within @c MyAisObject::ComputeSelection() implementation above.
|
||||
Let's revert usage of a dedicated display mode for highlighting (remove @c SetHilightMode() in @c MyAisObject constructor) and use our new class @c MyAisOwner within @c @::ComputeSelection():
|
||||
|
||||
~~~~{.cpp}
|
||||
MyAisObject::MyAisObject()
|
||||
{
|
||||
//SetHilightMode (MyDispMode_Highlight);
|
||||
myDrawer->SetupOwnShadingAspect();
|
||||
...
|
||||
}
|
||||
|
||||
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const double aRadius = 100.0, aHeight = 100.0;
|
||||
Handle(MyAisOwner) anOwner = new MyAisOwner (this);
|
||||
...
|
||||
}
|
||||
~~~~
|
||||
|
||||
The further logic creating sensitive entities and filling in Selection could be left as is.
|
||||
Substitution of @c SelectMgr_EntityOwner with @c MyAisOwner currently doesn't change behavior and we see highlighting of the entire object through color modulation.
|
||||
This is because default implementation of @c SelectMgr_EntityOwner for highlighting logic looks like this (simplified):
|
||||
|
||||
~~~~{.cpp}
|
||||
void SelectMgr_EntityOwner::HilightWithColor (
|
||||
const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
const Graphic3d_ZLayerId aHiLayer =
|
||||
theStyle->ZLayer() != Graphic3d_ZLayerId_UNKNOWN
|
||||
? theStyle->ZLayer()
|
||||
: mySelectable->ZLayer();
|
||||
thePrsMgr->Color (mySelectable, theStyle, theMode, NULL, aHiLayer);
|
||||
}
|
||||
~~~~
|
||||
|
||||
@figure{ais_object_step4_highlight1.png,"Default behavior of @c SelectMgr_EntityOwner::HilightWithColor().",409} height=409px
|
||||
|
||||
Now, let's override the @c SelectMgr_EntityOwner::HilightWithColor() method and display a bounding box presentation:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
if (myPrs.IsNull())
|
||||
{
|
||||
myPrs = new Prs3d_Presentation (thePrsMgr->StructureManager());
|
||||
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
|
||||
anObj->Compute (thePrsMgr, myPrs, MyAisObject::MyDispMode_Highlight);
|
||||
}
|
||||
if (!thePrsMgr->IsImmediateModeOn())
|
||||
{
|
||||
myPrs->Display();
|
||||
}
|
||||
}
|
||||
~~~~
|
||||
|
||||
@c SelectMgr_EntityOwner::HilightWithColor() doesn't receive a presentation to fill in as an argument; highlight presentation should be manually created and even explicitly displayed on the screen.
|
||||
To avoid code duplication, the code above reuses @c MyAisObject::Compute() already implementing computation of highlight presentation.
|
||||
|
||||
@figure{ais_object_step4_highlight2.png,"Result of custom implementation @c MyAisOwner::HilightWithColor().",409} height=409px
|
||||
|
||||
The visual result of the selected object looks exactly the same as when we've used a dedicated highlight mode.
|
||||
One thing became broken, though - highlighting remains displayed even after clearing selection.
|
||||
To fix this issue, we need implementing @c SelectMgr_EntityOwner::Unhilight() and hide our custom presentation explicitly:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
if (!myPrs.IsNull()) { myPrs->Erase(); }
|
||||
}
|
||||
~~~~
|
||||
|
||||
Another problem is that the object is no longer dynamically highlighted.
|
||||
To fix that we need to handle @c PrsMgr_PresentationManager::IsImmediateModeOn() specifically.
|
||||
Within this mode turned ON, presentation should be displayed on the screen with help of @c PrsMgr_PresentationManager::AddToImmediateList() method
|
||||
(it will be cleared from the screen automatically on the next mouse movement):
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
if (myPrs.IsNull())
|
||||
{
|
||||
myPrs = new Prs3d_Presentation (thePrsMgr->StructureManager());
|
||||
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
|
||||
anObj->Compute (thePrsMgr, myPrs, MyAisObject::MyDispMode_Highlight);
|
||||
}
|
||||
if (thePrsMgr->IsImmediateModeOn())
|
||||
{
|
||||
Handle(Prs3d_PresentationShadow) aShadow =
|
||||
new Prs3d_PresentationShadow (thePrsMgr->StructureManager(), myPrs);
|
||||
aShadow->SetZLayer (Graphic3d_ZLayerId_Top);
|
||||
aShadow->Highlight (theStyle);
|
||||
thePrsMgr->AddToImmediateList (aShadow);
|
||||
}
|
||||
else
|
||||
{
|
||||
myPrs->Display();
|
||||
}
|
||||
}
|
||||
~~~~
|
||||
|
||||
We may create two dedicated presentations for dynamic highlighting or reuse existing one for both cases with help of a transient object @c Prs3d_PresentationShadow.
|
||||
|
||||
Let's go further and make dynamic highlighting a little bit more interesting - by drawing a surface normal at the point where mouse picked the object:
|
||||
|
||||
~~~~{.cpp}
|
||||
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
|
||||
if (thePrsMgr->IsImmediateModeOn())
|
||||
{
|
||||
Handle(StdSelect_ViewerSelector) aSelector =
|
||||
anObj->InteractiveContext()->MainSelector();
|
||||
SelectMgr_SortCriterion aPickPnt;
|
||||
for (int aPickIter = 1; aPickIter <= aSelector->NbPicked(); ++aPickIter)
|
||||
{
|
||||
if (aSelector->Picked (aPickIter) == this)
|
||||
{
|
||||
aPickPnt = aSelector->PickedData (aPickIter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Handle(Prs3d_Presentation) aPrs = mySelectable->GetHilightPresentation (thePrsMgr);
|
||||
aPrs->SetZLayer (Graphic3d_ZLayerId_Top);
|
||||
aPrs->Clear();
|
||||
Handle(Graphic3d_Group) aGroup = aPrs->NewGroup();
|
||||
aGroupPnt->SetGroupPrimitivesAspect (theStyle->ArrowAspect()->Aspect());
|
||||
gp_Trsf aTrsfInv = mySelectable->LocalTransformation().Inverted();
|
||||
gp_Dir aNorm (aPickPnt.Normal.x(), aPickPnt.Normal.y(), aPickPnt.Normal.z());
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris =
|
||||
Prs3d_Arrow::DrawShaded (gp_Ax1(aPickPnt.Point, aNorm).Transformed (aTrsfInv),
|
||||
1.0, 15.0,
|
||||
3.0, 4.0, 10);
|
||||
aGroupPnt->AddPrimitiveArray (aTris);
|
||||
thePrsMgr->AddToImmediateList (aPrs);
|
||||
}
|
||||
}
|
||||
~~~~
|
||||
|
||||
Code above does not store our new highlight presentation as a property of @c MyAisOwner, and instead uses @c SelectMgr_SelectableObject::GetHilightPresentation() method
|
||||
to create a presentation stored directly inside of our interactive object.
|
||||
|
||||
Next trick is passing through the last picking results in @c StdSelect_ViewerSelector.
|
||||
Dynamic highlighting is expected to be called right after picking, so that highlighted Owner should be always found in picking results.
|
||||
@c StdSelect_ViewerSelector::Picked() returns entities in the descending order of their distance from picking ray origin (mouse cursor);
|
||||
normally our Owner should be the very first one in this list when no selection filters are assigned to @c AIS_InteractiveContext.
|
||||
|
||||
@c SelectMgr_SortCriterion provides us useful information like 3D point on detected object lying on the picking ray, and surface normal direction at this point (actually, it would be a normal to a picked triangle),
|
||||
which we display as an arrow with help of @c Prs3d_Arrow presentation builder.
|
||||
|
||||
@figure{ais_object_step4_highlight3.png,"Surface normal on mouse over.",409} height=409px
|
||||
|
||||
Result looks pretty nice on the screenshot, but has interaction problems - once displayed, an arrow is no longer updated with further mouse movements.
|
||||
But this behavior is not a bug - @c AIS calls @c MyAisOwner::HilightWithColor() only when picking Owner changes to avoid unnecessary Viewer updates.
|
||||
To override this behavior, we may override @c SelectMgr_EntityOwner::IsForcedHilight() option:
|
||||
|
||||
~~~~{.cpp}
|
||||
class MyAisOwner : public SelectMgr_EntityOwner
|
||||
{
|
||||
...
|
||||
virtual bool IsForcedHilight() const override { return true; }
|
||||
};
|
||||
~~~~
|
||||
|
||||
This solves the problem within our specific use case.
|
||||
Keep in mind that most objects don't need updating highlight presentation on every mouse move;
|
||||
overriding this flag everywhere would be a waste of resources and may cause performance issues - use it sparingly.
|
||||
|
||||
@section highlight_apporaches Highlighting approaches
|
||||
|
||||
@c AIS provides one more alternative to handle presentation highlighting, which is managed by option @c SelectMgr_SelectableObject::IsAutoHilight().
|
||||
By default, this option is turned ON and redirects highlighting logic to @c SelectMgr_EntityOwner::HilightWithColor() demonstrated in the previous section.
|
||||
Turning this option OFF redirects highlighting logic to the interactive object itself @c SelectMgr_SelectableObject::HilightSelected().
|
||||
|
||||
Apart from moving the logic from Owner to Interactive Object, this approach allows handling highlighting of all selected Owners within the same Object at once and sharing a common presentation
|
||||
instead of per-Owner presentation - improving performance and reducing memory utilization in case of a large number of small selectable elements, like mesh nodes in @c MeshVS_Mesh object.
|
||||
|
||||
The further optimization of such a scenario would be using a single Owner for the entire Object
|
||||
storing the list of selected elements within the Owner itself - as utilized by @c AIS_PointCloud object for highlighting individual points.
|
||||
|
||||
We wouldn't describe these advanced techniques here in detail - let's just summarize main highlighting approaches available in @c AIS:
|
||||
- Highlighting of a main presentation of Interactive Object (active display mode)
|
||||
filled in by @c PrsMgr_PresentableObject::Compute()
|
||||
and displayed with color modulation by @c AIS logic.
|
||||
- Example: @c AIS_TextLabel.
|
||||
- Highlighting of a secondary presentation of Interactive Object
|
||||
filled in by @c PrsMgr_PresentableObject::Compute()
|
||||
and displayed with color modulation by @c AIS logic.
|
||||
- Example: @c AIS_Shape, displayed in @c AIS_Shaded display mode and highlighted using @c AIS_Wireframe display mode (default behavior).
|
||||
See also @c PrsMgr_PresentableObject::SetHilightMode().
|
||||
- Highlight presentation stored within a custom @c SelectMgr_EntityOwner
|
||||
and managed by @c SelectMgr_EntityOwner::HilightWithColor().
|
||||
- Example: @c StdSelect_BRepOwner for selection of sub-shapes.
|
||||
- Custom highlight presentation stored within Interactive Object itself
|
||||
(see @c SelectMgr_SelectableObject::GetHilightPresentation() / @c @::GetSelectPresentation() methods).
|
||||
- Filled in by @c SelectMgr_EntityOwner::HilightWithColor()
|
||||
with @c SelectMgr_SelectableObject::IsAutoHilight() turned ON.<br>
|
||||
Example: @c AIS_PointCloud.
|
||||
- Filled in by @c SelectMgr_SelectableObject::HilightSelected()
|
||||
with @c SelectMgr_SelectableObject::IsAutoHilight() turned OFF.<br>
|
||||
Example: @c MeshVS_Mesh.
|
||||
- Main presentation of Interactive Object (active display mode)
|
||||
filled in by @c PrsMgr_PresentableObject::Compute()
|
||||
and manually updated (recomputed or modified aspects) on highlight events.
|
||||
- Example: @c AIS_Manipulator.
|
||||
|
||||
The number of options looks overwhelming but in general, it is better to stick to the simplest approach working for you and consider alternatives only when you have to.
|
||||
|
||||
@section mouse_click Mouse click
|
||||
|
||||
Dynamic highlighting is only one of scenarios where @c SelectMgr_EntityOwner could be useful.
|
||||
Another feature is an interface for handling a mouse click @c SelectMgr_EntityOwner @c @::HandleMouseClick().
|
||||
|
||||
This interface is useful for defining some user interface elements like buttons, and most likely your application will use a more comprehensive GUI framework for this purpose instead of @c AIS.
|
||||
But let's have some fun and make our object to change a color on each mouse click:
|
||||
|
||||
~~~~{.cpp}
|
||||
class MyAisOwner : public SelectMgr_EntityOwner
|
||||
{
|
||||
...
|
||||
virtual bool HandleMouseClick (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsDoubleClick) override;
|
||||
};
|
||||
|
||||
bool MyAisOwner::HandleMouseClick (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsDoubleClick)
|
||||
{
|
||||
static math_BullardGenerator aRandGen;
|
||||
Quantity_Color aRandColor (float(aRandGen.NextInt() % 256) / 255.0f,
|
||||
float(aRandGen.NextInt() % 256) / 255.0f,
|
||||
float(aRandGen.NextInt() % 256) / 255.0f,
|
||||
Quantity_TOC_sRGB);
|
||||
mySelectable->Attributes()->ShadingAspect()->SetColor(aRandColor);
|
||||
mySelectable->SynchronizeAspects();
|
||||
return true;
|
||||
}
|
||||
~~~~
|
||||
|
||||
Looks pretty simple. Now let's make things more interesting and launch some simple object animation on each click.
|
||||
We use a couple of global (@c static) variables in our sample for simplicity - don't do that in a real production code.
|
||||
|
||||
~~~~{.cpp}
|
||||
class MyAisOwner : public SelectMgr_EntityOwner
|
||||
{
|
||||
...
|
||||
void SetAnimation (const Handle(AIS_Animation)& theAnim)
|
||||
{ myAnim = theAnim; }
|
||||
...
|
||||
Handle(AIS_Animation) myAnim;
|
||||
};
|
||||
|
||||
bool MyAisOwner::HandleMouseClick (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsDoubleClick)
|
||||
{
|
||||
static bool isFirst = true;
|
||||
isFirst = !isFirst;
|
||||
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
|
||||
gp_Trsf aTrsfTo;
|
||||
aTrsfTo.SetRotation (gp_Ax1 (gp::Origin(), gp::DX()),
|
||||
isFirst ? M_PI * 0.5 : -M_PI * 0.5);
|
||||
gp_Trsf aTrsfFrom = anObj->LocalTransformation();
|
||||
Handle(AIS_AnimationObject) anAnim =
|
||||
new AIS_AnimationObject ("MyAnim", anObj->InteractiveContext(),
|
||||
anObj, aTrsfFrom, aTrsfTo);
|
||||
anAnim->SetOwnDuration (2.0);
|
||||
|
||||
myAnim->Clear();
|
||||
myAnim->Add (anAnim);
|
||||
myAnim->StartTimer (0.0, 1.0, true);
|
||||
return true;
|
||||
}
|
||||
~~~~
|
||||
|
||||
Animation is a complex topic that is worth a dedicated article - let's not go too deep in detail here.
|
||||
To perform animation in a non-interrupted way, it should be handled by some class like @c AIS_ViewController, which is responsible for managing user input events and for 3D viewer updates.
|
||||
To utilize it, you need adding a custom object animation to @c AIS_ViewController::ObjectsAnimation() or adding custom view animation to @c AIS_ViewController::ViewAnimation().
|
||||
Somewhere in application this might look like this:
|
||||
|
||||
~~~~{.cpp}
|
||||
Handle(AIS_InteractiveContext) theCtx;
|
||||
Handle(AIS_ViewController) theViewCtrl;
|
||||
Handle(MyAisObject) aPrs = new MyAisObject();
|
||||
aPrs->SetAnimation (theViewCtrl->ObjectsAnimation());
|
||||
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
|
||||
~~~~
|
||||
|
||||
@section final Final result
|
||||
|
||||
The final sample could be seen by calling @c QATutorialAisObject command from Draw Harness plugin @c QAcommands (@c TKQADraw toolkit):
|
||||
|
||||
~~~~
|
||||
pload VISUALIZATION QAcommands
|
||||
vinit View1
|
||||
QATutorialAisObject p
|
||||
vfit
|
||||
~~~~
|
||||
|
||||
You may also take a look onto source code of this command at @c src/QADraw/QADraw_Tutorials.cxx if you have some problems following the tutorial.
|
@@ -1,4 +1,4 @@
|
||||
Draw: Demo Scripts {#samples__draw_scripts}
|
||||
Draw Demo Scripts {#samples__draw_scripts}
|
||||
================
|
||||
|
||||
All demo scripts are provided with OCCT sources and locate in <i>CASROOT/samples/tcl</i>. To play around them please
|
||||
|
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
@@ -1,115 +0,0 @@
|
||||
Novice Guide {#samples__novice_guide}
|
||||
=======
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section diffs Modeling with OCCT: Key differences
|
||||
|
||||
Open CASCADE Technology (OCCT) is an object-oriented C++ framework designed for rapid production of sophisticated CAD/CAM/CAE applications.
|
||||
In other words, it provides endless possibilities for raw 2D and 3D modeling in C++ environment.
|
||||
Unlike end-user software, it is used by the application developers and therefore strongly differs from the most popular CAD/CAM/CAE software packages.
|
||||
OCCT provides building blocks enough for modeling, editing, visualization, and data interoperability of 2D and 3D objects.
|
||||
|
||||
By using OCCT, users can create the objects of their desire (or edit already existing ones) using raw code commands.
|
||||
It is a more complicated process than using GUI-based software, but it provides much more flexibility than even script-based manipulations that are available within existing CAD/CAM/CAE applications.
|
||||
However, to fully grasp the possibilities of OCCT it is best for the user to have previous experience in C++ at least at a basic level.
|
||||
|
||||
@section basics Understanding the principles
|
||||
|
||||
If you don't have any programming skills, grasping the full magnitude of OCCT workflow is still an option.
|
||||
The documentation for OCCT contains several entry points for new users.
|
||||
It will not explain all OCCT classes but will help to comprehend the workflow and help start thinking in terms of Open CASCADE Technology.
|
||||
|
||||
The most basic workflow is described in the @ref occt__tutorial "OCCT Tutorial" - this is an excellent starting point for new users.
|
||||
In this tutorial you will create a solid model step-by-step using different classes and methods.
|
||||
Each step of the tutorial contains code snippets and images.
|
||||
|
||||
The basics involved in the modeling process are explained.
|
||||
When the basics of OCCT are clear, the next logical step is to check out @ref samples "sample applications" and examine those that suit your needs.
|
||||
For these, the best starting point is **OCCTOverview** located in /samples/qt subfolder of OCCT installation.
|
||||
|
||||
This sample provides code examples for several actions as well as visualization of these code snippets output.
|
||||
The Overview interface is dynamically changing based on selected **Category** at the menu.
|
||||
Additional menu buttons will appear, providing users with subcategories and relevant commands to select one of the actions.
|
||||
The result will appear in the viewer window, the code will appear at the top right, and in several cases the output will be produced at the bottom right window.
|
||||
|
||||
@figure{sample_overview_qt_viewers.png,"Comparison of 3D and 2D viewer windows",240} height=420px
|
||||
|
||||
The 3D viewer window has a row of preset interface buttons to customize the visual output.
|
||||
|
||||
Those buttons can be grouped into three types, left to right:
|
||||
|
||||
- View controls: **Fit all** and **Isometric**, will center the view and reset the camera angles respectively;
|
||||
- Display mode customization: **HLR,** e.g. "Hidden line removal" (works only when shading is disabled) can be turned on and off;
|
||||
solid models may be displayed either in **Shading** or **Wireframe** modes. **Transparency** level may be set for models in shading mode;
|
||||
- The last four buttons in a row are beautifiers enabling Ray-tracing engine and configuring it's parameters.
|
||||
|
||||
At the bottom left of the screen the orientation cube (trihedron) is located.
|
||||
The trihedron interactively shows the position of the camera in relation to the XYZ axis of the displayed data.
|
||||
The sides of the trihedron are labeled to help with orientation.
|
||||
Click on a side of the box to orient the camera view along the preferred axis.
|
||||
|
||||
The 2D viewer window lacks most of these elements and only have **Fit all** button.
|
||||
|
||||
The **Geometry** category of the Overview focuses on primitive objects like dots, lines (including vectors) or planes.
|
||||
These objects will appear in the viewer after the subcategory is selected.
|
||||
This section will demonstrate these entities both in 2D and 3D view mode and provide basic examples of parametric creation and data analysis.
|
||||
|
||||
@figure{sample_overview_qt_geometry.png,"",240} height=440px
|
||||
|
||||
The usage of the functions shown in the Overview is described more thoroughly at the @ref occt_user_guides__modeling_data "Modeling data" section of the documentation.
|
||||
Additionally, @ref occt_user_guides__modeling_algos "Modeling Algorithms" are used in more complex cases.
|
||||
|
||||
The **Topology** section of the Overview demonstrates the functions used in 3D operations.
|
||||
Multiple use cases are provided, including different object intersections, modifying and calculations.
|
||||
Some of these use cases are described in the documentation, such as @ref occt_user_guides__inspector "Inspector" usage.
|
||||
|
||||
@figure{sample_overview_qt_topology.png,"",240} height=440px
|
||||
|
||||
The subsections are grouped as shown on the screenshot before.
|
||||
Most shapes and primitive objects are introduced and then followed by a set of operations and interactions.
|
||||
|
||||
The **Triangulation** segment allows computing the number of triangles on a shape.
|
||||
|
||||
This may be inspected via [Poly_Triangulation Class Reference](https://dev.opencascade.org/doc/refman/html/class_poly___triangulation.html) -
|
||||
a part of the [Reference manual](https://dev.opencascade.org/doc/refman/html/index.html),
|
||||
an overall Open CASCADE code guide that may be used to inspect the key points in classes and their connections.
|
||||
|
||||
@figure{sample_overview_qt_triangulation.png,"",240} height=440px
|
||||
|
||||
The triangulation uses some of Mesh-related classes - see full description at @ref occt_user_guides__mesh "Mesh" documentation section.
|
||||
|
||||
The **Data exchange** section provides examples of how to export and import files of several different formats.
|
||||
|
||||
@figure{sample_overview_qt_xde.png,"",240} height=440px
|
||||
|
||||
The **OCAF** section gives an introduction for the @ref intro_overview_ocaf "Open CASCADE Application Framework" functionality.
|
||||
To test these functions, create an object first (box or cylinder).
|
||||
After that, the object may be modified and saved. Actions are recorded and may be undone or redone.
|
||||
|
||||
@figure{sample_overview_qt_ocaf.png,"",240} height=440px
|
||||
|
||||
**Viewers** section demonstrates examples of the 2D and 3D visualization outputs.
|
||||
Check @ref occt_user_guides__visualization "Visualization" section of the documentation for a detailed description.
|
||||
In addition to these two samples, there are much more that might be of use to a new user based on their particular use case.
|
||||
|
||||
Check Readme files in the sample directories to learn more about samples compilation.
|
||||
|
||||
**Note:** source code for OCCTOverview is stored at 'samples/qt/OCCTOverview/src' folder in your OCCT root,
|
||||
and the source code files for examples presented in subsections are stored at 'samples/OCCTOverview/code folder'.
|
||||
Several utility classes that are not presented in the example window may be found in example source code files.
|
||||
|
||||
The overall classes introduction may be found in the @ref occt_user_guides__foundation_classes "Foundation Classes" section of the documentation.
|
||||
The "Introduction" section contains short descriptions of the most massive entries in the documentation.
|
||||
|
||||
@section helps Additional assistance
|
||||
|
||||
There are several places that may be of use for new users.
|
||||
The first one is [Training & E-learning](https://dev.opencascade.org/resources/trainings) page that lists available trainings and describes their specifics.
|
||||
|
||||
The second one is the Overview documentation (this document is a part of it) - here you can find information that suits most of the use cases.
|
||||
This may seem overwhelming at first, but if you have the clear understanding of what do you seek, you will most likely find the required information.
|
||||
|
||||
Aside from the Overview documentation itself, the [Reference manual](https://dev.opencascade.org/doc/refman/html/index.html) is present.
|
||||
Use it to check classes descriptions, dependencies and examples.
|
||||
Additionally, there is a [Forum](https://dev.opencascade.org/forums) where you can contact the OCCT community and developers.
|
@@ -1,76 +1,82 @@
|
||||
OCAF: Usage Tutorial {#samples__ocaf}
|
||||
OCAF Usage {#samples__ocaf}
|
||||
========
|
||||
|
||||
## Getting Started
|
||||
|
||||
At the beginning of your development, you first define an application class by inheriting from the Application abstract class.
|
||||
You only have to create and determine the resources of the application for specifying the format of your documents (you generally use the standard one) and their file extension.
|
||||
|
||||
Then, you design the application data model by organizing attributes you choose among those provided with OCAF.
|
||||
You can specialize these attributes using the User attribute. For example, if you need a reflection coefficient,
|
||||
you aggregate a User attribute identified as a reflection coefficient
|
||||
with a Real attribute containing the value of the coefficient (as such, you don't define a new class).
|
||||
|
||||
If you need application specific data not provided with OCAF, for example, to incorporate a finite element model in the data structure,
|
||||
you define a new attribute class containing the mesh, and you include its persistent homologue in a new file format.
|
||||
|
||||
Once you have implemented the commands which create and modify the data structure according to your specification, OCAF provides you, without any additional programming:
|
||||
|
||||
* Persistent reference to any data, including geometric elements - several documents can be linked with such reference;
|
||||
* Document-View association;
|
||||
* Ready-to-use functions such as:
|
||||
* Undo-redo;
|
||||
* Save and open application data.
|
||||
|
||||
Finally, you develop the application's graphical user interface using the toolkit of your choice, for example:
|
||||
* KDE Qt or GNOME GTK+ on Linux;
|
||||
* Microsoft Foundation Classes (MFC) on Windows Motif on Sun;
|
||||
* Other commercial products such as Ilog Views.
|
||||
|
||||
You can also implement the user interface in the Java language using the Swing-based Java Application Desktop component (JAD) provided with OCAF.
|
||||
## Getting Started
|
||||
|
||||
At the beginning of your development, you first define an application class by inheriting from the Application abstract class.
|
||||
You only have to create and determine the resources of the application
|
||||
for specifying the format of your documents (you generally use the standard one) and their file extension.
|
||||
|
||||
Then, you design the application data model by organizing attributes you choose among those provided with OCAF.
|
||||
You can specialize these attributes using the User attribute. For example, if you need a reflection coefficient,
|
||||
you aggregate a User attribute identified as a reflection coefficient
|
||||
with a Real attribute containing the value of the coefficient (as such, you don't define a new class).
|
||||
|
||||
If you need application specific data not provided with OCAF, for example,
|
||||
to incorporate a finite element model in the data structure,
|
||||
you define a new attribute class containing the mesh,
|
||||
and you include its persistent homologue in a new file format.
|
||||
|
||||
Once you have implemented the commands which create and modify the data structure
|
||||
according to your specification, OCAF provides you, without any additional programming:
|
||||
|
||||
* Persistent reference to any data, including geometric elements â€" several documents can be linked with such reference;
|
||||
* Document-View association;
|
||||
* Ready-to-use functions such as :
|
||||
* Undo-redo;
|
||||
* Save and open application data.
|
||||
|
||||
Finally, you develop the application's graphical user interface using the toolkit of your choice, for example:
|
||||
* KDE Qt or GNOME GTK+ on Linux;
|
||||
* Microsoft Foundation Classes (MFC) on Windows Motif on Sun;
|
||||
* Other commercial products such as Ilog Views.
|
||||
|
||||
You can also implement the user interface in the Java language using
|
||||
the Swing-based Java Application Desktop component (JAD) provided with OCAF.
|
||||
|
||||
## An example of OCAF usage
|
||||
|
||||
To create a useful OCAF-based application, it is necessary to redefine two deferred methods: <i>Formats</i> and <i>ResourcesName</i>
|
||||
To create a useful OCAF-based application, it is necessary to redefine two deferred methods: <i> Formats</i> and <i> ResourcesName</i>
|
||||
|
||||
In the <i>Formats</i> method, add the format of the documents, which need to be read by the application and may have been built in other applications.
|
||||
In the <i> Formats </i> method, add the format of the documents, which need to be read by the application and may have been built in other applications.
|
||||
|
||||
For example:
|
||||
|
||||
~~~~{.cpp}
|
||||
~~~~
|
||||
void myApplication::Formats(TColStd_SequenceOfExtendedString& Formats)
|
||||
{
|
||||
Formats.Append(TCollection_ExtendedString ("OCAF-myApplication"));
|
||||
}
|
||||
~~~~
|
||||
|
||||
In the <i>ResourcesName</i> method, you only define the name of the resource file.
|
||||
This file contains several definitions for the saving and opening mechanisms associated with each format and calling of the plug-in file.
|
||||
In the <i> ResourcesName</i> method, you only define the name of the resource file. This
|
||||
file contains several definitions for the saving and opening mechanisms associated
|
||||
with each format and calling of the plug-in file.
|
||||
|
||||
~~~~{.cpp}
|
||||
~~~~
|
||||
Standard_CString myApplication::ResourcesName()
|
||||
{
|
||||
return Standard_CString ("Resources");
|
||||
}
|
||||
~~~~
|
||||
|
||||
To obtain the saving and opening mechanisms, it is necessary to set two environment variables: <i>CSF_PluginDefaults</i>, which defines the path of the plug-in file,
|
||||
and <i>CSF_ResourcesDefault</i>, which defines the resource file:
|
||||
To obtain the saving and opening mechanisms, it is necessary to set two environment variables: <i> CSF_PluginDefaults</i>, which defines the path of the plug-in file, and <i> CSF_ResourcesDefault</i>, which defines the resource file:
|
||||
|
||||
~~~~{.cpp}
|
||||
SetEnvironmentVariable ("CSF_ResourcesDefaults", myDirectory);
|
||||
SetEnvironmentVariable ("CSF_PluginDefaults", myDirectory);
|
||||
~~~~
|
||||
SetEnvironmentVariable ( "CSF_ResourcesDefaults",myDirectory);
|
||||
SetEnvironmentVariable ( "CSF_PluginDefaults",myDirectory);
|
||||
~~~~
|
||||
|
||||
The plugin and the resource files of the application will be located in <i>myDirector</i>.
|
||||
The plugin and the resource files of the application will be located in <i> myDirector</i>.
|
||||
The name of the plugin file must be <i>Plugin</i>.
|
||||
|
||||
### Resource File
|
||||
|
||||
The resource file describes the documents (type and extension) and the type of data that the application can manipulate
|
||||
The resource file describes the documents (type and extension) and
|
||||
the type of data that the application can manipulate
|
||||
by identifying the storage and retrieval drivers appropriate for this data.
|
||||
|
||||
Each driver is unique and identified by a GUID generated, for example, with the <i>uuidgen</i> tool in Windows.
|
||||
Each driver is unique and identified by a GUID generated, for example, with the <i> uuidgen </i> tool in Windows.
|
||||
|
||||
Five drivers are required to use all standard attributes provided within OCAF:
|
||||
|
||||
@@ -80,7 +86,8 @@ Five drivers are required to use all standard attributes provided within OCAF:
|
||||
* the attribute storage driver (47b0b826-d931-11d1-b5da-00a0c9064368)
|
||||
* the attribute retrieval driver (47b0b827-d931-11d1-b5da-00a0c9064368)
|
||||
|
||||
These drivers are provided as plug-ins and are located in the <i>PappStdPlugin</i> library.
|
||||
These drivers are provided as plug-ins and are located in the <i> PappStdPlugin</i> library.
|
||||
|
||||
|
||||
For example, this is a resource file, which declares a new model document OCAF-MyApplication:
|
||||
|
||||
@@ -97,11 +104,12 @@ OCAF-MyApplication.AttributeRetrievalPlugin: 47b0b827-d931-11d1-b5da-00a0c906436
|
||||
|
||||
### Plugin File
|
||||
|
||||
The plugin file describes the list of required plug-ins to run the application and the libraries in which plug-ins are located.
|
||||
The plugin file describes the list of required plug-ins to run the application and the
|
||||
libraries in which plug-ins are located.
|
||||
|
||||
You need at least the <i>FWOSPlugin</i> and the plug-in drivers to run an OCAF application.
|
||||
You need at least the <i> FWOSPlugin</i> and the plug-in drivers to run an OCAF application.
|
||||
|
||||
The syntax of each item is <i>Identification.Location Library_Name</i>, where:
|
||||
The syntax of each item is <i> Identification.Location Library_Name, </i> where:
|
||||
* Identification is GUID.
|
||||
* Location defines the location of the Identification (where its definition is found).
|
||||
* Library_Name is the name (and path to) the library, where the plug-in is located.
|
||||
@@ -117,414 +125,412 @@ ad696002-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
|
||||
47b0b826-d931-11d1-b5da-00a0c9064368.Location: PAppStdPlugin
|
||||
47b0b827-d931-11d1-b5da-00a0c9064368.Location: PAppStdPlugin
|
||||
~~~~
|
||||
|
||||
|
||||
## Implementation of Attribute Transformation in a HXX file
|
||||
|
||||
~~~~{.cpp}
|
||||
#include <TDF_Attribute.hxx>
|
||||
~~~~
|
||||
\#include <TDF_Attribute.hxx>
|
||||
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
\#include <gp_Ax3.hxx>
|
||||
\#include <gp_Pnt.hxx>
|
||||
\#include <gp_Vec.hxx>
|
||||
\#include <gp_Trsf.hxx>
|
||||
|
||||
//! This attribute implements a transformation data container
|
||||
class MyPackage_Transformation : public TDF_Attribute
|
||||
{
|
||||
public: //!@ name Static methods
|
||||
public:
|
||||
//!@ name Static methods
|
||||
|
||||
//! The method returns a unique GUID of this attribute.
|
||||
//! By means of this GUID this attribute may be identified
|
||||
//! among other attributes attached to the same label.
|
||||
//! The method returns a unique GUID of this attribute.
|
||||
//! By means of this GUID this attribute may be identified
|
||||
//! among other attributes attached to the same label.
|
||||
Standard_EXPORT static const Standard_GUID& GetID ();
|
||||
|
||||
//! Finds or creates the attribute attached to <theLabel>.
|
||||
//! The found or created attribute is returned.
|
||||
//! Finds or creates the attribute attached to <theLabel>.
|
||||
//! The found or created attribute is returned.
|
||||
Standard_EXPORT static Handle(MyPackage_Transformation) Set (const TDF_Label theLabel);
|
||||
|
||||
public: //!@ name Methods for access to the attribute data
|
||||
//!@ name Methods for access to the attribute data
|
||||
|
||||
//! The method returns the transformation.
|
||||
Standard_EXPORT gp_Trsf Get () const;
|
||||
|
||||
//! The method returns the transformation.
|
||||
Standard_EXPORT gp_Trsf Get () const;
|
||||
//!@ name Methods for setting the data of transformation
|
||||
|
||||
public: //!@ name Methods for setting the data of transformation
|
||||
//! The method defines a rotation type of transformation.
|
||||
Standard_EXPORT void SetRotation (const gp_Ax1& theAxis, Standard_Real theAngle);
|
||||
|
||||
//! The method defines a rotation type of transformation.
|
||||
Standard_EXPORT void SetRotation (const gp_Ax1& theAxis, Standard_Real theAngle);
|
||||
//! The method defines a translation type of transformation.
|
||||
Standard_EXPORT void SetTranslation (const gp_Vec& theVector);
|
||||
|
||||
//! The method defines a translation type of transformation.
|
||||
Standard_EXPORT void SetTranslation (const gp_Vec& theVector);
|
||||
//! The method defines a point mirror type of transformation (point symmetry).
|
||||
Standard_EXPORT void SetMirror (const gp_Pnt& thePoint);
|
||||
|
||||
//! The method defines a point mirror type of transformation (point symmetry).
|
||||
Standard_EXPORT void SetMirror (const gp_Pnt& thePoint);
|
||||
//! The method defines an axis mirror type of transformation (axial symmetry).
|
||||
Standard_EXPORT void SetMirror (const gp_Ax1& theAxis);
|
||||
|
||||
//! The method defines an axis mirror type of transformation (axial symmetry).
|
||||
Standard_EXPORT void SetMirror (const gp_Ax1& theAxis);
|
||||
//! The method defines a point mirror type of transformation (planar symmetry).
|
||||
Standard_EXPORT void SetMirror (const gp_Ax2& thePlane);
|
||||
|
||||
//! The method defines a point mirror type of transformation (planar symmetry).
|
||||
Standard_EXPORT void SetMirror (const gp_Ax2& thePlane);
|
||||
|
||||
//! The method defines a scale type of transformation.
|
||||
Standard_EXPORT void SetScale (const gp_Pnt& thePoint, Standard_Real theScale);
|
||||
//! The method defines a scale type of transformation.
|
||||
Standard_EXPORT void SetScale (const gp_Pnt& thePoint, Standard_Real theScale);
|
||||
|
||||
//! The method defines a complex type of transformation from one coordinate system to another.
|
||||
Standard_EXPORT void SetTransformation (const gp_Ax3& theCoordinateSystem1, const gp_Ax3& theCoordinateSystem2);
|
||||
Standard_EXPORT void SetTransformation (const gp_Ax3& theCoordinateSystem1, const gp_Ax3& theCoordinateSystem2);
|
||||
|
||||
public: //!@ name Overridden methods from TDF_Attribute
|
||||
//!@ name Overridden methods from TDF_Attribute
|
||||
|
||||
//! The method returns a unique GUID of the attribute.
|
||||
//! By means of this GUID this attribute may be identified among other attributes attached to the same label.
|
||||
Standard_EXPORT const Standard_GUID& ID () const;
|
||||
|
||||
//! The method returns a unique GUID of the attribute.
|
||||
//! By means of this GUID this attribute may be identified among other attributes attached to the same label.
|
||||
Standard_EXPORT const Standard_GUID& ID () const;
|
||||
//! The method is called on Undo / Redo.
|
||||
//! It copies the content of theAttribute into this attribute (copies the fields).
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& theAttribute);
|
||||
|
||||
//! The method is called on Undo / Redo.
|
||||
//! It copies the content of theAttribute into this attribute (copies the fields).
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& theAttribute);
|
||||
|
||||
//! It creates a new instance of this attribute.
|
||||
//! It is called on Copy / Paste, Undo / Redo.
|
||||
//! It creates a new instance of this attribute.
|
||||
//! It is called on Copy / Paste, Undo / Redo.
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty () const;
|
||||
|
||||
//! The method is called on Copy / Paste.
|
||||
//! It copies the content of this attribute into theAttribute (copies the fields).
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theAttribute, const Handle(TDF_RelocationTable)& theRelocationTable);
|
||||
//! The method is called on Copy / Paste.
|
||||
//! It copies the content of this attribute into theAttribute (copies the fields).
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theAttribute, const Handle(TDF_RelocationTable)& theRelocationTable);
|
||||
|
||||
//! Prints the content of this attribute into the stream.
|
||||
//! Prints the content of this attribute into the stream.
|
||||
Standard_EXPORT Standard_OStream& Dump(Standard_OStream& theOS);
|
||||
|
||||
public: //!@ name Constructor
|
||||
//!@ name Constructor
|
||||
|
||||
//! The C++ constructor of this attribute class.
|
||||
//! Usually it is never called outside this class.
|
||||
//! Usually it is never called outside this class.
|
||||
Standard_EXPORT MyPackage_Transformation();
|
||||
|
||||
private:
|
||||
gp_TrsfForm myType;
|
||||
|
||||
// Axes (Ax1, Ax2, Ax3)
|
||||
// Axes (Ax1, Ax2, Ax3)
|
||||
gp_Ax1 myAx1;
|
||||
gp_Ax2 myAx2;
|
||||
gp_Ax3 myFirstAx3;
|
||||
gp_Ax3 mySecondAx3;
|
||||
|
||||
// Scalar values
|
||||
// Scalar values
|
||||
Standard_Real myAngle;
|
||||
Standard_Real myScale;
|
||||
|
||||
// Points
|
||||
// Points
|
||||
gp_Pnt myFirstPoint;
|
||||
gp_Pnt mySecondPoint;
|
||||
};
|
||||
};
|
||||
~~~~
|
||||
|
||||
## Implementation of Attribute Transformation in a CPP file
|
||||
|
||||
~~~~{.cpp}
|
||||
#include <MyPackage_Transformation.hxx>
|
||||
\#include <MyPackage_Transformation.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose : The method returns a unique GUID of this attribute.
|
||||
// By means of this GUID this attribute may be identified
|
||||
// among other attributes attached to the same label.
|
||||
//=======================================================================
|
||||
const Standard_GUID& MyPackage_Transformation::GetID()
|
||||
{
|
||||
static Standard_GUID ID("4443368E-C808-4468-984D-B26906BA8573");
|
||||
return ID;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose : Finds or creates the attribute attached to <theLabel>.
|
||||
// The found or created attribute is returned.
|
||||
//=======================================================================
|
||||
Handle(MyPackage_Transformation) MyPackage_Transformation::Set(const TDF_Label& theLabel)
|
||||
{
|
||||
Handle(MyPackage_Transformation) T;
|
||||
if (!theLabel.FindAttribute(MyPackage_Transformation::GetID(), T))
|
||||
{
|
||||
T = new MyPackage_Transformation();
|
||||
theLabel.AddAttribute(T);
|
||||
}
|
||||
return T;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Get
|
||||
//purpose : The method returns the transformation.
|
||||
//=======================================================================
|
||||
gp_Trsf MyPackage_Transformation::Get() const
|
||||
{
|
||||
gp_Trsf transformation;
|
||||
switch (myType)
|
||||
{
|
||||
case gp_Identity:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case gp_Rotation:
|
||||
{
|
||||
transformation.SetRotation(myAx1, myAngle);
|
||||
break;
|
||||
}
|
||||
case gp_Translation:
|
||||
{
|
||||
transformation.SetTranslation(myFirstPoint, mySecondPoint);
|
||||
break;
|
||||
}
|
||||
case gp_PntMirror:
|
||||
{
|
||||
transformation.SetMirror(myFirstPoint);
|
||||
break;
|
||||
}
|
||||
case gp_Ax1Mirror:
|
||||
{
|
||||
transformation.SetMirror(myAx1);
|
||||
break;
|
||||
}
|
||||
case gp_Ax2Mirror:
|
||||
{
|
||||
transformation.SetMirror(myAx2);
|
||||
break;
|
||||
}
|
||||
case gp_Scale:
|
||||
{
|
||||
transformation.SetScale(myFirstPoint, myScale);
|
||||
break;
|
||||
}
|
||||
case gp_CompoundTrsf:
|
||||
{
|
||||
transformation.SetTransformation(myFirstAx3, mySecondAx3);
|
||||
break;
|
||||
}
|
||||
case gp_Other:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return transformation;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRotation
|
||||
//purpose : The method defines a rotation type of transformation.
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetRotation(const gp_Ax1& theAxis, const Standard_Real theAngle)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Rotation;
|
||||
myAx1 = theAxis;
|
||||
myAngle = theAngle;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTranslation
|
||||
//purpose : The method defines a translation type of transformation.
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetTranslation(const gp_Vec& theVector)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Translation;
|
||||
myFirstPoint.SetCoord(0, 0, 0);
|
||||
mySecondPoint.SetCoord(theVector.X(), theVector.Y(), theVector.Z());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMirror
|
||||
//purpose : The method defines a point mirror type of transformation
|
||||
// (point symmetry).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetMirror(const gp_Pnt& thePoint)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_PntMirror;
|
||||
myFirstPoint = thePoint;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMirror
|
||||
//purpose : The method defines an axis mirror type of transformation
|
||||
// (axial symmetry).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetMirror(const gp_Ax1& theAxis)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Ax1Mirror;
|
||||
myAx1 = theAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMirror
|
||||
//purpose : The method defines a point mirror type of transformation
|
||||
// (planar symmetry).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetMirror(const gp_Ax2& thePlane)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Ax2Mirror;
|
||||
myAx2 = thePlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetScale
|
||||
//purpose : The method defines a scale type of transformation.
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetScale(const gp_Pnt& thePoint, const Standard_Real theScale)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Scale;
|
||||
myFirstPoint = thePoint;
|
||||
myScale = theScale;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTransformation
|
||||
//purpose : The method defines a complex type of transformation
|
||||
// from one coordinate system to another.
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetTransformation(const gp_Ax3& theCoordinateSystem1,
|
||||
const gp_Ax3& theCoordinateSystem2)
|
||||
{
|
||||
Backup();
|
||||
myFirstAx3 = theCoordinateSystem1;
|
||||
mySecondAx3 = theCoordinateSystem2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ID
|
||||
//purpose : The method returns a unique GUID of the attribute.
|
||||
// By means of this GUID this attribute may be identified
|
||||
// among other attributes attached to the same label.
|
||||
//=======================================================================
|
||||
const Standard_GUID& MyPackage_Transformation::ID() const
|
||||
{
|
||||
return GetID();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose : The method is called on Undo / Redo.
|
||||
// It copies the content of <theAttribute>
|
||||
// into this attribute (copies the fields).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::Restore(const Handle(TDF_Attribute)& theAttribute)
|
||||
{
|
||||
Handle(MyPackage_Transformation) theTransformation = Handle(MyPackage_Transformation)::DownCast(theAttribute);
|
||||
myType = theTransformation->myType;
|
||||
myAx1 = theTransformation->myAx1;
|
||||
myAx2 = theTransformation->myAx2;
|
||||
myFirstAx3 = theTransformation->myFirstAx3;
|
||||
mySecondAx3 = theTransformation->mySecondAx3;
|
||||
myAngle = theTransformation->myAngle;
|
||||
myScale = theTransformation->myScale;
|
||||
myFirstPoint = theTransformation->myFirstPoint;
|
||||
mySecondPoint = theTransformation->mySecondPoint;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose : It creates a new instance of this attribute.
|
||||
// It is called on Copy / Paste, Undo / Redo.
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) MyPackage_Transformation::NewEmpty() const
|
||||
{
|
||||
return new MyPackage_Transformation();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose : The method is called on Copy / Paste.
|
||||
// It copies the content of this attribute into
|
||||
// <theAttribute> (copies the fields).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::Paste(const Handle(TDF_Attribute)& theAttribute,
|
||||
const Handle(TDF_RelocationTable)& ) const
|
||||
{
|
||||
Handle(MyPackage_Transformation) theTransformation = Handle(MyPackage_Transformation)::DownCast(theAttribute);
|
||||
theTransformation->myType = myType;
|
||||
theTransformation->myAx1 = myAx1;
|
||||
theTransformation->myAx2 = myAx2;
|
||||
theTransformation->myFirstAx3 = myFirstAx3;
|
||||
theTransformation->mySecondAx3 = mySecondAx3;
|
||||
theTransformation->myAngle = myAngle;
|
||||
theTransformation->myScale = myScale;
|
||||
theTransformation->myFirstPoint = myFirstPoint;
|
||||
theTransformation->mySecondPoint = mySecondPoint;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose : Prints the content of this attribute into the stream.
|
||||
//=======================================================================
|
||||
Standard_OStream& MyPackage_Transformation::Dump(Standard_OStream& anOS) const
|
||||
{
|
||||
anOS = "Transformation: ";
|
||||
switch (myType)
|
||||
{
|
||||
case gp_Identity:
|
||||
{
|
||||
anOS = "gp_Identity";
|
||||
break;
|
||||
}
|
||||
case gp_Rotation:
|
||||
{
|
||||
anOS = "gp_Rotation";
|
||||
break;
|
||||
}
|
||||
case gp_Translation:
|
||||
{
|
||||
anOS = "gp_Translation";
|
||||
break;
|
||||
}
|
||||
case gp_PntMirror:
|
||||
{
|
||||
anOS = "gp_PntMirror";
|
||||
break;
|
||||
}
|
||||
case gp_Ax1Mirror:
|
||||
{
|
||||
anOS = "gp_Ax1Mirror";
|
||||
break;
|
||||
}
|
||||
case gp_Ax2Mirror:
|
||||
{
|
||||
anOS = "gp_Ax2Mirror";
|
||||
break;
|
||||
}
|
||||
case gp_Scale:
|
||||
{
|
||||
anOS = "gp_Scale";
|
||||
break;
|
||||
}
|
||||
case gp_CompoundTrsf:
|
||||
{
|
||||
anOS = "gp_CompoundTrsf";
|
||||
break;
|
||||
}
|
||||
case gp_Other:
|
||||
{
|
||||
anOS = "gp_Other";
|
||||
break;
|
||||
}
|
||||
}
|
||||
return anOS;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose : The method returns a unique GUID of this attribute.
|
||||
// By means of this GUID this attribute may be identified
|
||||
// among other attributes attached to the same label.
|
||||
//function : MyPackage_Transformation
|
||||
//purpose : A constructor.
|
||||
//=======================================================================
|
||||
const Standard_GUID& MyPackage_Transformation::GetID()
|
||||
{
|
||||
static Standard_GUID ID("4443368E-C808-4468-984D-B26906BA8573");
|
||||
return ID;
|
||||
}
|
||||
MyPackage_Transformation::MyPackage_Transformation():myType(gp_Identity){
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose : Finds or creates the attribute attached to <theLabel>.
|
||||
// The found or created attribute is returned.
|
||||
//=======================================================================
|
||||
Handle(MyPackage_Transformation) MyPackage_Transformation::Set(const TDF_Label& theLabel)
|
||||
{
|
||||
Handle(MyPackage_Transformation) T;
|
||||
if (!theLabel.FindAttribute(MyPackage_Transformation::GetID(), T))
|
||||
{
|
||||
T = new MyPackage_Transformation();
|
||||
theLabel.AddAttribute(T);
|
||||
}
|
||||
return T;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Get
|
||||
//purpose : The method returns the transformation.
|
||||
//=======================================================================
|
||||
gp_Trsf MyPackage_Transformation::Get() const
|
||||
{
|
||||
gp_Trsf transformation;
|
||||
switch (myType)
|
||||
{
|
||||
case gp_Identity:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case gp_Rotation:
|
||||
{
|
||||
transformation.SetRotation(myAx1, myAngle);
|
||||
break;
|
||||
}
|
||||
case gp_Translation:
|
||||
{
|
||||
transformation.SetTranslation(myFirstPoint, mySecondPoint);
|
||||
break;
|
||||
}
|
||||
case gp_PntMirror:
|
||||
{
|
||||
transformation.SetMirror(myFirstPoint);
|
||||
break;
|
||||
}
|
||||
case gp_Ax1Mirror:
|
||||
{
|
||||
transformation.SetMirror(myAx1);
|
||||
break;
|
||||
}
|
||||
case gp_Ax2Mirror:
|
||||
{
|
||||
transformation.SetMirror(myAx2);
|
||||
break;
|
||||
}
|
||||
case gp_Scale:
|
||||
{
|
||||
transformation.SetScale(myFirstPoint, myScale);
|
||||
break;
|
||||
}
|
||||
case gp_CompoundTrsf:
|
||||
{
|
||||
transformation.SetTransformation(myFirstAx3, mySecondAx3);
|
||||
break;
|
||||
}
|
||||
case gp_Other:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return transformation;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetRotation
|
||||
//purpose : The method defines a rotation type of transformation.
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetRotation(const gp_Ax1& theAxis, const Standard_Real theAngle)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Rotation;
|
||||
myAx1 = theAxis;
|
||||
myAngle = theAngle;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTranslation
|
||||
//purpose : The method defines a translation type of transformation.
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetTranslation(const gp_Vec& theVector)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Translation;
|
||||
myFirstPoint.SetCoord(0, 0, 0);
|
||||
mySecondPoint.SetCoord(theVector.X(), theVector.Y(), theVector.Z());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMirror
|
||||
//purpose : The method defines a point mirror type of transformation
|
||||
// (point symmetry).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetMirror(const gp_Pnt& thePoint)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_PntMirror;
|
||||
myFirstPoint = thePoint;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMirror
|
||||
//purpose : The method defines an axis mirror type of transformation
|
||||
// (axial symmetry).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetMirror(const gp_Ax1& theAxis)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Ax1Mirror;
|
||||
myAx1 = theAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMirror
|
||||
//purpose : The method defines a point mirror type of transformation
|
||||
// (planar symmetry).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetMirror(const gp_Ax2& thePlane)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Ax2Mirror;
|
||||
myAx2 = thePlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetScale
|
||||
//purpose : The method defines a scale type of transformation.
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetScale(const gp_Pnt& thePoint, const Standard_Real theScale)
|
||||
{
|
||||
Backup();
|
||||
myType = gp_Scale;
|
||||
myFirstPoint = thePoint;
|
||||
myScale = theScale;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTransformation
|
||||
//purpose : The method defines a complex type of transformation
|
||||
// from one coordinate system to another
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::SetTransformation (const gp_Ax3& theCoordinateSystem1,
|
||||
const gp_Ax3& theCoordinateSystem2)
|
||||
{
|
||||
Backup();
|
||||
myFirstAx3 = theCoordinateSystem1;
|
||||
mySecondAx3 = theCoordinateSystem2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ID
|
||||
//purpose : The method returns a unique GUID of the attribute.
|
||||
// By means of this GUID this attribute may be identified
|
||||
// among other attributes attached to the same label.
|
||||
//=======================================================================
|
||||
const Standard_GUID& MyPackage_Transformation::ID() const
|
||||
{
|
||||
return GetID();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose : The method is called on Undo / Redo.
|
||||
// It copies the content of <theAttribute>
|
||||
// into this attribute (copies the fields).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::Restore(const Handle(TDF_Attribute)& theAttribute)
|
||||
{
|
||||
Handle(MyPackage_Transformation) theTransformation = Handle(MyPackage_Transformation)::DownCast(theAttribute);
|
||||
myType = theTransformation->myType;
|
||||
myAx1 = theTransformation->myAx1;
|
||||
myAx2 = theTransformation->myAx2;
|
||||
myFirstAx3 = theTransformation->myFirstAx3;
|
||||
mySecondAx3 = theTransformation->mySecondAx3;
|
||||
myAngle = theTransformation->myAngle;
|
||||
myScale = theTransformation->myScale;
|
||||
myFirstPoint = theTransformation->myFirstPoint;
|
||||
mySecondPoint = theTransformation->mySecondPoint;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose : It creates a new instance of this attribute.
|
||||
// It is called on Copy / Paste, Undo / Redo.
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) MyPackage_Transformation::NewEmpty() const
|
||||
{
|
||||
return new MyPackage_Transformation();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose : The method is called on Copy / Paste.
|
||||
// It copies the content of this attribute into
|
||||
// <theAttribute> (copies the fields).
|
||||
//=======================================================================
|
||||
void MyPackage_Transformation::Paste (const Handle(TDF_Attribute)& theAttribute,
|
||||
const Handle(TDF_RelocationTable)& ) const
|
||||
{
|
||||
Handle(MyPackage_Transformation) theTransformation = Handle(MyPackage_Transformation)::DownCast(theAttribute);
|
||||
theTransformation->myType = myType;
|
||||
theTransformation->myAx1 = myAx1;
|
||||
theTransformation->myAx2 = myAx2;
|
||||
theTransformation->myFirstAx3 = myFirstAx3;
|
||||
theTransformation->mySecondAx3 = mySecondAx3;
|
||||
theTransformation->myAngle = myAngle;
|
||||
theTransformation->myScale = myScale;
|
||||
theTransformation->myFirstPoint = myFirstPoint;
|
||||
theTransformation->mySecondPoint = mySecondPoint;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose : Prints the content of this attribute into the stream.
|
||||
//=======================================================================
|
||||
Standard_OStream& MyPackage_Transformation::Dump(Standard_OStream& theOS) const
|
||||
{
|
||||
anOS << "Transformation: ";
|
||||
switch (myType)
|
||||
{
|
||||
case gp_Identity:
|
||||
{
|
||||
anOS << "gp_Identity";
|
||||
break;
|
||||
}
|
||||
case gp_Rotation:
|
||||
{
|
||||
anOS << "gp_Rotation";
|
||||
break;
|
||||
}
|
||||
case gp_Translation:
|
||||
{
|
||||
anOS << "gp_Translation";
|
||||
break;
|
||||
}
|
||||
case gp_PntMirror:
|
||||
{
|
||||
anOS << "gp_PntMirror";
|
||||
break;
|
||||
}
|
||||
case gp_Ax1Mirror:
|
||||
{
|
||||
anOS << "gp_Ax1Mirror";
|
||||
break;
|
||||
}
|
||||
case gp_Ax2Mirror:
|
||||
{
|
||||
anOS << "gp_Ax2Mirror";
|
||||
break;
|
||||
}
|
||||
case gp_Scale:
|
||||
{
|
||||
anOS << "gp_Scale";
|
||||
break;
|
||||
}
|
||||
case gp_CompoundTrsf:
|
||||
{
|
||||
anOS << "gp_CompoundTrsf";
|
||||
break;
|
||||
}
|
||||
case gp_Other:
|
||||
{
|
||||
anOS << "gp_Other";
|
||||
break;
|
||||
}
|
||||
}
|
||||
return anOS;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MyPackage_Transformation
|
||||
//purpose : A constructor.
|
||||
//=======================================================================
|
||||
MyPackage_Transformation::MyPackage_Transformation()
|
||||
: myType (gp_Identity)
|
||||
{
|
||||
//
|
||||
}
|
||||
~~~~
|
||||
|
||||
## Implementation of typical actions with standard OCAF attributes.
|
||||
## Implementation of typical actions with standard OCAF attributes.
|
||||
|
||||
There are four sample files provided in the directory 'OpenCasCade/ros/samples/ocafsamples'.
|
||||
They present typical actions with OCAF services (mainly for newcomers).
|
||||
There are four sample files provided in the directory 'OpenCasCade/ros/samples/ocafsamples'. They present typical actions with OCAF services (mainly for newcomers).
|
||||
The method *Sample()* of each file is not dedicated for execution 'as is', it is rather a set of logical actions using some OCAF services.
|
||||
|
||||
### TDataStd_Sample.cxx
|
||||
@@ -543,7 +549,7 @@ This sample contains templates for typical actions with the following standard O
|
||||
- TDataXtd_Constraint attribute management;
|
||||
- TDataStd_Directory attribute management;
|
||||
- TDataStd_TreeNode attribute management.
|
||||
|
||||
|
||||
### TDocStd_Sample.cxx
|
||||
This sample contains template for the following typical actions:
|
||||
- creating application;
|
||||
@@ -554,7 +560,7 @@ This sample contains template for the following typical actions:
|
||||
- closing a document;
|
||||
- opening the document stored in the file;
|
||||
- copying content of a document to another document with possibility to update the copy in the future.
|
||||
|
||||
|
||||
### TPrsStd_Sample.cxx
|
||||
This sample contains template for the following typical actions:
|
||||
- starting with data framework;
|
||||
@@ -571,7 +577,7 @@ This sample contains template for the following typical actions:
|
||||
- updating and displaying presentation of the attribute to be displayed;
|
||||
- setting a color to the displayed attribute;
|
||||
- getting transparency of the displayed attribute;
|
||||
- modify attribute;
|
||||
- modify attribute;
|
||||
- updating presentation of the attribute in viewer.
|
||||
|
||||
### TNaming_Sample.cxx
|
||||
@@ -585,3 +591,4 @@ The following scenario is used:
|
||||
- creating a Fillet (using the selected edges) and pushing the result as a modification of Box1;
|
||||
- creating a Cut (Box1, Box2) as a modification of Box1 and push it in DF;
|
||||
- recovering the result from DF.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
OCAF: Function Mechanism {#samples__ocaf_func}
|
||||
Function Mechanism Usage {#samples__ocaf_func}
|
||||
========================
|
||||
|
||||
Let us describe the usage of the "Function Mechanism" of Open CASCADE Application Framework on a simple example.
|
||||
|
@@ -1,62 +1,176 @@
|
||||
Tutorials and Samples {#samples}
|
||||
=====================
|
||||
|
||||
- @subpage samples__tutorials
|
||||
* @ref samples__novice_guide
|
||||
<br>A document providing an introductory information to newcomers.
|
||||
* @ref samples__draw_scripts
|
||||
<br>A set of demo scripts demonstrating OCCT functionality from DRAW.
|
||||
These scripts can be also considered as a tutorials on **Tcl** usage within @ref occt_user_guides__test_harness "Draw Harness".
|
||||
* @ref occt__tutorial
|
||||
<br>A programming tutorial teaching how to use OCCT services to model a 3D object.
|
||||
See also @ref samples_qt_tutorial
|
||||
* @ref samples__ocaf
|
||||
<br>A set of code snippets performing typical actions with @ref occt_user_guides__ocaf "OCAF" services for newcomers.
|
||||
* @ref samples__ocaf_func
|
||||
<br>A simple example dedicated to the usage of "Function Mechanism" of @ref occt_user_guides__ocaf "OCCT Application Framework".
|
||||
* @ref tutorials__ais_object
|
||||
<br>A programming tutorial teaching how to compute presentation within AIS_InteractiveObject subclass for displaying in @ref occt_user_guides__visualization "OCCT 3D Viewer".
|
||||
- @subpage samples__projects
|
||||
* @ref samples_qt_iesample
|
||||
<br>A cross-platform multi-document 3D Viewer sample with CAD import / export functionality based on **Qt Widgets** framework.
|
||||
* @ref samples_qml_android_occt
|
||||
<br>A cross-platform 3D Viewer sample with CAD import based on **QtQuick** framework.
|
||||
* @ref samples_qt_tutorial
|
||||
<br>A cross-platform sample application based on **Qt Widgets** framework and implementing @ref occt__tutorial.
|
||||
* @ref samples_qt_overview
|
||||
<br>A sample application interactively demonstrating OCCT C++ usage with code snippets for newcomers.
|
||||
* @ref samples_mfc_standard
|
||||
<br>A set of projects for Windows platform demonstrating OCCT usage based on **Microsoft Foundation Class** (**MFC**) library.
|
||||
* @ref samples_csharp_occt
|
||||
<br>A Multi-document 3D Viewer sample with CAD import / export functionality based on .NET and **Windows Forms** or **WPF**.
|
||||
* @ref samples_csharp_direct3d
|
||||
<br>3D Viewer sample wrapped into Direct3D context based on .NET and **Windows Presentation Foundation** (**WPF**).
|
||||
* @ref occt_samples_webgl
|
||||
<br>3D Viewer sample based on **Emscripten SDK** representing a static HTML page to be opened in Web Browser.
|
||||
* @ref samples_java_android_occt
|
||||
<br>3D Viewer sample with CAD import for Android mobile platform based on Android SDK and JNI layer.
|
||||
* @ref occt_samples_ios_uikit
|
||||
<br>3D Viewer sample for iOS platform based on Apple **UIKit** framework.
|
||||
* @ref occt_samples_glfw
|
||||
<br>A cross-platform 3D Viewer sample using **GLFW** library.
|
||||
Tutorial: Modelling a Bottle
|
||||
----------------------------
|
||||
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
|
||||
The purpose of the tutorial is not to explain all OCCT classes but
|
||||
to help start thinking in terms of the Open CASCADE Technology.
|
||||
|
||||
@page samples__tutorials Tutorials and Demos
|
||||
- @subpage samples__novice_guide
|
||||
- @subpage samples__draw_scripts
|
||||
- @subpage occt__tutorial
|
||||
- @subpage samples__ocaf
|
||||
- @subpage samples__ocaf_func
|
||||
- @subpage tutorials__ais_object
|
||||
This tutorial assumes that the user has experience in using and setting up C++.
|
||||
From the viewpoint of programming, Open CASCADE Technology is designed
|
||||
to enhance user's C++ tools with high performance modeling classes, methods and functions.
|
||||
The combination of these resources allows creating substantial applications.
|
||||
|
||||
@page samples__projects Sample Projects
|
||||
- @subpage samples_qt_iesample
|
||||
- @subpage samples_qml_android_occt
|
||||
- @subpage samples_qt_tutorial
|
||||
- @subpage samples_qt_overview
|
||||
- @subpage samples_mfc_standard
|
||||
- @subpage samples_csharp_occt
|
||||
- @subpage samples_csharp_direct3d
|
||||
- @subpage occt_samples_webgl
|
||||
- @subpage samples_java_android_occt
|
||||
- @subpage occt_samples_ios_uikit
|
||||
- @subpage occt_samples_glfw
|
||||
Read more about @subpage occt__tutorial
|
||||
|
||||
MFC
|
||||
---------
|
||||
|
||||
Visual C++ programming samples containing 10 Visual C++ projects
|
||||
illustrating how to use a particular module or functionality.
|
||||
|
||||
The list of MFC samples:
|
||||
|
||||
* Geometry
|
||||
* Modeling
|
||||
* Viewer2d
|
||||
* Viewer3d
|
||||
* ImportExport
|
||||
* Ocaf
|
||||
* Triangulation
|
||||
* HLR
|
||||
* Animation
|
||||
* Convert
|
||||
|
||||
@figure{/samples/images/samples_mvc.png}
|
||||
|
||||
**Remarks:**
|
||||
|
||||
* MFC samples are available only on Windows platform;
|
||||
* To start a sample use Open CASCADE Technology\\Samples\\Mfc\\ item of the Start\\Programs menu;
|
||||
* Read carefully readme.txt to learn about launching and compilation options.
|
||||
|
||||
See @subpage samples_mfc_standard "Readme" for details.
|
||||
|
||||
Qt
|
||||
---
|
||||
|
||||
OCCT includes several samples based on Qt application framework.
|
||||
These samples are available on all supported desktop platforms.
|
||||
|
||||
To start a sample on Windows use Open CASCADE Technology\\Samples\\Qt\\ item of the Start\\Programs menu.
|
||||
|
||||
Import Export
|
||||
-------------
|
||||
|
||||
Import Export programming sample contains 3D Viewer and Import / Export functionality.
|
||||
|
||||
@figure{/samples/images/samples_qt.png}
|
||||
|
||||
Tutorial
|
||||
---------
|
||||
|
||||
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
|
||||
The purpose of the tutorial is not to explain all OCCT classes but
|
||||
to help start thinking in terms of the Open CASCADE Technology.
|
||||
|
||||
This tutorial assumes that the user has experience in using and setting up C++.
|
||||
From the viewpoint of programming, Open CASCADE Technology is designed
|
||||
to enhance user's C++ tools with high performance modeling classes, methods and functions.
|
||||
The combination of these resources allows creating substantial applications.
|
||||
|
||||
**See also:** @ref occt__tutorial "OCCT Tutorial"
|
||||
|
||||
Overview
|
||||
---------
|
||||
|
||||
The Qt application providing samples for basic usage of C++ API of various OCCT functionality.
|
||||
|
||||
The samples are organized in several categories according to relevant module of OCCT:
|
||||
|
||||
* Geometry
|
||||
* Topology,
|
||||
* Triangulation
|
||||
* DataExchange
|
||||
* OCAF
|
||||
* Viewer 2d
|
||||
* Viewer 3d
|
||||
|
||||
Each sample presents geometry view, C++ code fragment and sample output window.
|
||||
|
||||
@figure{/samples/images/sample_overview_qt.png}
|
||||
|
||||
See \subpage samples_qt_overview "Readme" for details.
|
||||
|
||||
C#
|
||||
---
|
||||
|
||||
C# sample demonstrates integration of OCCT 3D Viewer and Import / Export functionality into .NET applications (using Windows Forms and WPF front ends).
|
||||
|
||||
@figure{/samples/images/samples_c__ie.png}
|
||||
|
||||
Import:
|
||||
|
||||
* BRep
|
||||
* Iges
|
||||
* Step
|
||||
|
||||
Export:
|
||||
|
||||
* Brep
|
||||
* Iges
|
||||
* Step
|
||||
* Stl
|
||||
* Vrml
|
||||
|
||||
See @subpage samples_csharp_occt "C# sample Readme" for details.
|
||||
|
||||
There is also another C# example with the same functionality, which demonstrates the integration of Direct3D Viewer into .NET applications using WPF front end.
|
||||
|
||||
See @subpage samples_csharp_direct3d "Direct3D C# sample Readme" for details.
|
||||
|
||||
Android
|
||||
---------
|
||||
|
||||
There are two samples are representing usage OCCT framework on Android mobile platform. They represent an OCCT-based 3D-viewer with CAD import support in formats BREP, STEP and IGES: jniviewer (java) and AndroidQt (qt+qml)
|
||||
|
||||
jniviewer
|
||||
@figure{/samples/images/samples_java_android_occt.jpg}
|
||||
Java -- See @subpage samples_java_android_occt "Android Java sample Readme" for details.
|
||||
|
||||
AndroidQt
|
||||
@figure{/samples/images/samples_qml_android_occt.jpg}
|
||||
Qt -- See \subpage samples_qml_android_occt "Android Qt sample Readme" for details.
|
||||
|
||||
iOS
|
||||
---
|
||||
|
||||
There is a sample demonstrating usage of OCCT on iOS with Apple UIKit framework.
|
||||
|
||||
@figure{/samples/images/sample_ios_uikit.png}
|
||||
|
||||
See @subpage occt_samples_ios_uikit "iOS sample Readme" for details.
|
||||
|
||||
Web
|
||||
---------
|
||||
|
||||
WebGL Viewer sample demonstrating usage of OCCT 3D Viewer in Web browser with Emscripten SDK can be found in `samples/webgl`.
|
||||
|
||||
@figure{/samples/images/sample_webgl.png}
|
||||
|
||||
See @subpage occt_samples_webgl "WebGL sample Readme" for details.
|
||||
|
||||
OCAF Usage Sample
|
||||
------------------
|
||||
|
||||
The provided set of samples dedicates to get initial knowledge about typical actions with OCAF services. It may be
|
||||
useful for newcomers.
|
||||
|
||||
Read more about @subpage samples__ocaf
|
||||
|
||||
OCAF Function Mechanism Usage
|
||||
-----------------------------
|
||||
|
||||
This simple example dedicates to the usage of "Function Mechanism" of OCCT Application Framework. It represents a "nail"
|
||||
composed by a cone and two cylinders of different radius and height.
|
||||
|
||||
Read more about @subpage samples__ocaf_func
|
||||
|
||||
Draw Demo Scripts
|
||||
------------------
|
||||
|
||||
A set of demo scripts demonsrates using OCCT functionality from DRAW. These scripts can be also considered as a
|
||||
tutorials on tcl usage within Draw.
|
||||
|
||||
Read more about @subpage samples__draw_scripts
|
||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 42 KiB |
@@ -1,4 +1,4 @@
|
||||
Modeling: Bottle Tutorial {#occt__tutorial}
|
||||
Tutorial {#occt__tutorial}
|
||||
=======
|
||||
|
||||
@tableofcontents
|
||||
@@ -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);
|
||||
|
@@ -7,8 +7,6 @@ Upgrade from older OCCT versions {#occt__upgrade}
|
||||
|
||||
This document provides technical details on changes made in particular versions of OCCT. It can help to upgrade user applications based on previous versions of OCCT to newer ones.
|
||||
|
||||
@ref upgrade_occt770 "SEEK TO THE LAST CHAPTER (UPGRADE TO 7.7.0)"
|
||||
|
||||
@subsection upgrade_intro_precautions Precautions
|
||||
|
||||
Back-up your code before the upgrade.
|
||||
@@ -26,6 +24,7 @@ The automatic upgrade tool is provided as is, without warranty of any kind, and
|
||||
It is your responsibility to ensure that the changes you made in your code are correct.
|
||||
When you upgrade the code by an automatic script, make sure to carefully review the introduced changes at each step before committing them.
|
||||
|
||||
|
||||
@section upgrade_65 Upgrade to OCCT 6.5.0
|
||||
|
||||
Porting of user applications from an earlier OCCT version to version 6.5 requires taking into account the following major changes:
|
||||
@@ -397,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
|
||||
|
||||
@@ -2294,42 +2293,3 @@ void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
|
||||
- *BRepAlgo_Cut*
|
||||
- *BRepAlgo_Section*
|
||||
The corresponding classes from the *BRepAlgoAPI* package have to be used instead.
|
||||
|
||||
@section upgrade_occt770 Upgrade to OCCT 7.7.0
|
||||
|
||||
Building OCCT now requires C++11-compliant compiler, so that some legacy compilers (Visual Studio 2010 and 2012) are no more supported.
|
||||
It is recommended using Visual Studio 2015 or newer for building OCCT on Windows platform.
|
||||
|
||||
@subsection upgrade_770_removed_features Removed features
|
||||
|
||||
* One of the constructors of the BRepExtrema_DistanceSS class (the one without deflection parameter) has been removed as excessive. The remaining constructor has to be used instead.
|
||||
|
||||
@subsection upgrade_occt770_parallel_flag_removed Removed parameter theIsParallel from Put/Compute/Perform
|
||||
|
||||
theIsParallel parameter has been removed from Put/Compute/Perform from the next classes:
|
||||
- BRepCheck_Analyzer
|
||||
- BRepCheck_Edge
|
||||
- BRepLib_ValidateEdge
|
||||
- GeomLib_CheckCurveOnSurface
|
||||
- BRepLib_CheckCurveOnSurface
|
||||
|
||||
Now, to set this flag, it is necessary to use method SetParallel()
|
||||
For example:
|
||||
~~~~{.cpp}
|
||||
BRepLib_ValidateEdge aValidateEdge(myHCurve, ACS, SameParameter);
|
||||
aValidateEdge.SetParallel(toRunParallel);
|
||||
aValidateEdge.Process();
|
||||
~~~~
|
||||
|
||||
@subsection upgrade_occt770_drawer_aspects Prs3d_Drawer aspects
|
||||
|
||||
`Prs3d_Drawer` getters no more implicitly create "default" aspects.
|
||||
If specific property has not been set before to this drawer instance nor to linked drawer instance, then NULL property will be returned.
|
||||
Make sure to set property beforehand or to call `SetOwn*` / `SetupOwn*` methods to derive from defaults.
|
||||
|
||||
@subsection upgrade_occt770_opengl OpenGL functions
|
||||
|
||||
Applications extending OCCT 3D Viewer and calling OpenGL functions directly (like @c @::glEnable(), e.g. using global namespace) might be affected by changes in `OpenGl_GlFunctions.hxx`.
|
||||
This header, as well as `OpenGl_GlCore20.hxx` and similar, no more include system OpenGL / OpenGL ES headers to define function table.
|
||||
Application code calling OpenGL functions directly should be changed to either use `OpenGl_Context::core11fwd` (as designed)
|
||||
or to include system OpenGL headers in advance (with help of `OpenGl_GlNative.hxx`).
|
||||
|
@@ -1837,7 +1837,7 @@ bool areEqualAngles (double theAngle1, double theAngle2)
|
||||
{
|
||||
return Abs(theAngle1 - theAngle2) < Precision::Angular();
|
||||
}
|
||||
~~~~
|
||||
~~~
|
||||
|
||||
It is also possible to check parallelism of two vectors as follows:
|
||||
~~~~{.cpp}
|
||||
@@ -1845,7 +1845,7 @@ bool areParallelVectors (const gp_Vec& theVec1, const gp_Vec& theVec2)
|
||||
{
|
||||
return theVec1.IsParallel (theVec2, Precision::Angular());
|
||||
}
|
||||
~~~~
|
||||
~~~
|
||||
|
||||
Note that *Precision::Angular()* can be used on both dot and cross products because for small angles the *Sine* and the *Angle* are equivalent.
|
||||
So to test if two directions of type *gp_Dir* are perpendicular, it is legal to use the following code:
|
||||
@@ -1854,7 +1854,7 @@ bool arePerpendicular (const gp_Dir& theDir1, const gp_Dir& theDir2)
|
||||
{
|
||||
return Abs(theDir1 * theDir2) < Precision::Angular();
|
||||
}
|
||||
~~~~
|
||||
~~~
|
||||
|
||||
#### Precision::Confusion
|
||||
|
||||
@@ -1875,7 +1875,7 @@ bool isNullVector (const gp_Vec& theVec)
|
||||
{
|
||||
return theVec.Magnitude() < Precision::Confusion();
|
||||
}
|
||||
~~~~
|
||||
~~~
|
||||
|
||||
#### Precision::Intersection
|
||||
|
||||
|
@@ -165,9 +165,7 @@ if (!Interface_Static::SetIVal ("read.maxprecision.mode",1))
|
||||
Default value is *Preferred (0)*.
|
||||
|
||||
<h4>read.maxprecision.val</h4>
|
||||
defines the maximum allowable tolerance (in internal units, which are specified in xstep.cascade.unit) of the shape.
|
||||
It should be not less than the basis value of tolerance set in processor (either Resolution from the file or *read.precision.val*).
|
||||
Actually, the maximum between *read.maxprecision.val* and basis tolerance is used to define maximum allowed tolerance.
|
||||
defines the maximum allowable tolerance (in mm) of the shape. It should be not less than the basis value of tolerance set in processor (either Resolution from the file or *read.precision.val*). Actually, the maximum between *read.maxprecision.val* and basis tolerance is used to define maximum allowed tolerance.
|
||||
Read this parameter with:
|
||||
~~~~{.cpp}
|
||||
Standard_Real rp = Interface_Static::RVal("read.maxprecision.val");
|
||||
|
After Width: | Height: | Size: 488 KiB |
@@ -2,21 +2,41 @@
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="500"
|
||||
height="240"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="492.48849"
|
||||
height="306.85541"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
sodipodi:docname="shape_healing_image009.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="shape_heal.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<clipPath
|
||||
id="clipEmfPath1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3045"
|
||||
height="188.43307"
|
||||
width="602.36218"
|
||||
y="0"
|
||||
x="0" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3048"
|
||||
height="168.77963"
|
||||
width="461.37103"
|
||||
y="13.50237"
|
||||
x="1.4999058" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath1-1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
@@ -95,9 +115,9 @@
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.8284271"
|
||||
inkscape:cx="260.39207"
|
||||
inkscape:cy="156.2706"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="346.95854"
|
||||
inkscape:cy="41.972723"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
@@ -109,9 +129,7 @@
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
width="500px" />
|
||||
fit-margin-bottom="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
@@ -120,6 +138,7 @@
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
@@ -140,324 +159,240 @@
|
||||
id="g3033" />
|
||||
<g
|
||||
id="g3209" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="77.124359"
|
||||
y="50.336628"
|
||||
style="font-size:19.95194054px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3245"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="384.65424"
|
||||
y="50.336628"
|
||||
style="font-size:19.95194054px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3249"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="384.35422"
|
||||
y="74.039337"
|
||||
style="font-size:12.45121098px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3253"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="43.821121"
|
||||
y="95.941833"
|
||||
style="font-size:12.45121098px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3255"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath1-1)"
|
||||
d="m -0.00937591,136.00926 v 21.24618 H 141.75441 v -21.24618 z"
|
||||
d="m -0.00937591,136.00926 0,21.24618 141.76378591,0 0,-21.24618 -141.76378591,0 z"
|
||||
id="path3257"
|
||||
transform="translate(32.519633,-72.118896)" />
|
||||
<g
|
||||
id="g3196">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 32.510257,63.89036 V 85.13654 H 174.27404 V 63.89036 Z"
|
||||
id="path3259" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="78.230995"
|
||||
y="77.499275"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
id="text3261">ShapeFix</text>
|
||||
</g>
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 28.510257,137.89036 0,21.24618 141.763783,0 0,-21.24618 z"
|
||||
id="path3259" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="128.52896"
|
||||
y="79.248367"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
x="74.574112"
|
||||
y="153.24837"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3261">ShapeFix</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="124.52896"
|
||||
y="153.24837"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3263"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath2-7)"
|
||||
d="m 176.82969,136.00926 v 21.24618 h 141.76378 v -21.24618 z"
|
||||
d="m 176.82969,136.00926 0,21.24618 141.76378,0 0,-21.24618 -141.76378,0 z"
|
||||
id="path3265"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<g
|
||||
id="g3188"
|
||||
transform="translate(-1.45134)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 208.41918,63.89036 V 85.13654 H 350.18296 V 63.89036 Z"
|
||||
id="path3267" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="239.62212"
|
||||
y="77.42511"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
id="text3269">ShapeUpgrade</text>
|
||||
</g>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 205.34932,137.89036 0,21.24618 141.76378,0 0,-21.24618 z"
|
||||
id="path3267" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="319.94757"
|
||||
y="79.248367"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
x="236.58987"
|
||||
y="153.24837"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3269">ShapeUpgrade</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="315.94757"
|
||||
y="153.24837"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3271"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath3)"
|
||||
d="m 349.77776,135.82174 v 21.24617 h 141.76378 v -21.24617 z"
|
||||
d="m 349.77776,135.82174 0,21.24617 141.76378,0 0,-21.24617 -141.76378,0 z"
|
||||
id="path3273"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<g
|
||||
id="g3192">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 382.29739,63.70284 V 84.94901 H 524.06117 V 63.70284 Z"
|
||||
id="path3275" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="415.51996"
|
||||
y="77.311752"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
id="text3277">ShapeCustom</text>
|
||||
</g>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 378.29739,137.70284 0,21.24617 141.76378,0 0,-21.24617 z"
|
||||
id="path3275" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="490.9642"
|
||||
y="78.948334"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
x="411.35684"
|
||||
y="152.94833"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3277">ShapeCustom</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="486.9642"
|
||||
y="152.94833"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3279"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath4)"
|
||||
d="m 174.44821,271.3997 v 21.24618 H 316.21199 V 271.3997 Z"
|
||||
d="m 174.44821,271.3997 0,21.24618 141.76378,0 0,-21.24618 -141.76378,0 z"
|
||||
id="path3281"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<g
|
||||
id="g3180"
|
||||
transform="translate(0,-5.3756104)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 206.96784,199.2808 v 21.24618 H 348.73162 V 199.2808 Z"
|
||||
id="path3283" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="242.36592"
|
||||
y="212.88971"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
id="text3285">ShapeExtend</text>
|
||||
</g>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 202.96784,273.2808 0,21.24618 141.76378,0 0,-21.24618 z"
|
||||
id="path3283" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="313.64694"
|
||||
y="214.56381"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
x="238.39005"
|
||||
y="288.56381"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3285">ShapeExtend</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="309.64694"
|
||||
y="288.56381"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3287"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath5)"
|
||||
d="m 175.3858,208.95508 v 21.24617 h 141.76378 v -21.24617 z"
|
||||
d="m 175.3858,208.95508 0,21.24617 141.76378,0 0,-21.24617 -141.76378,0 z"
|
||||
id="path3289"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<g
|
||||
id="g3184"
|
||||
transform="translate(-0.93759,-7.9384003)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 207.90543,136.83618 v 21.24617 h 141.76378 v -21.24617 z"
|
||||
id="path3291" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="238.83438"
|
||||
y="150.37093"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
id="text3293">ShapeAnalysis</text>
|
||||
</g>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 203.90543,210.83618 0,21.24617 141.76378,0 0,-21.24617 z"
|
||||
id="path3291" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="318.89746"
|
||||
y="152.15668"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
x="234.78969"
|
||||
y="226.15668"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3293">ShapeAnalysis</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="314.89746"
|
||||
y="226.15668"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3295"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.937591px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-dasharray:none"
|
||||
clip-path="url(#clipEmfPath6)"
|
||||
d="M 74.257219,158.83061 V 341.58896"
|
||||
d="m 74.257219,158.83061 0,182.75835"
|
||||
id="path3297"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 206.03025,258.9126 v 21.24618 H 347.79403 V 258.9126 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 103.83926,342.96989 92.18396,0 c 0.35629,0 0.63756,0.28128 0.63756,0.63757 0,0.33754 -0.28127,0.61882 -0.63756,0.61882 l -92.18396,0 c -0.35628,0 -0.63756,-0.28128 -0.63756,-0.61882 0,-0.35629 0.28128,-0.63757 0.63756,-0.63757 z m 90.94634,-3.11286 7.50073,3.75043 -7.50073,3.75043 z"
|
||||
id="path3299" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 103.70507,285.15091 94.06852,0 c 0.3469,0 0.62818,0.28128 0.62818,0.62819 0,0.34692 -0.28128,0.6282 -0.62818,0.6282 l -94.06852,0 c -0.34691,0 -0.62819,-0.28128 -0.62819,-0.6282 0,-0.34691 0.28128,-0.62819 0.62819,-0.62819 z m 92.82152,-3.12223 7.50073,3.75042 -7.50073,3.75043 z"
|
||||
id="path3301" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 104.38951,221.9562 91.26512,0 c 0.34691,0 0.61881,0.28128 0.61881,0.6282 0,0.34691 -0.2719,0.62819 -0.61881,0.62819 l -91.26512,0 c -0.33753,0 -0.61881,-0.28128 -0.61881,-0.62819 0,-0.34692 0.28128,-0.6282 0.61881,-0.6282 z m 90.00875,-3.12223 7.50073,3.75043 -7.50073,3.75042 z"
|
||||
id="path3303" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 276.34372,233.58253 0,33.00376 c 0,0.34691 -0.2719,0.6282 -0.61881,0.6282 -0.3469,0 -0.62818,-0.28129 -0.62818,-0.6282 l 0,-33.00376 c 0,-0.33754 0.28128,-0.61882 0.62818,-0.61882 0.34691,0 0.61881,0.28128 0.61881,0.61882 z m 3.13156,31.75674 -3.75037,7.50086 -3.75036,-7.50086 z"
|
||||
id="path3305" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 453.74242,160.71171 0,59.06924"
|
||||
id="path3307" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 452.98619,220.39977 -100.62228,0 c -0.35629,0 -0.63757,-0.28128 -0.63757,-0.61882 0,-0.35629 0.28128,-0.63757 0.63757,-0.63757 l 100.62228,0 c 0.35628,0 0.63756,0.28128 0.63756,0.63757 0,0.33754 -0.28128,0.61882 -0.63756,0.61882 z m -99.38466,3.13161 -7.50073,-3.75043 7.50073,-3.75043 z"
|
||||
id="path3309" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 275.65928,158.82712 0,47.18976 c 0,0.34692 -0.28127,0.6282 -0.62818,0.6282 -0.33754,0 -0.61881,-0.28128 -0.61881,-0.6282 l 0,-47.18976 c 0,-0.34691 0.28127,-0.62819 0.61881,-0.62819 0.34691,0 0.62818,0.28128 0.62818,0.62819 z m 3.12218,45.94274 -3.75036,7.50086 -3.75037,-7.50086 z"
|
||||
id="path3311" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 202.03025,332.9126 0,21.24618 141.76378,0 0,-21.24618 -141.76378,0 z"
|
||||
id="path3313" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 202.03025,332.9126 0,21.24618 141.76378,0 0,-21.24618 z"
|
||||
id="path3315" />
|
||||
<g
|
||||
id="g3176"
|
||||
transform="translate(0.43759)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 206.03025,258.9126 v 21.24618 H 347.79403 V 258.9126 Z"
|
||||
id="path3313" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="252.97264"
|
||||
y="272.37869"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
id="text3317">Message</text>
|
||||
</g>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="300.7457"
|
||||
y="274.2706"
|
||||
style="font-style:normal;font-weight:bold;font-size:11.2511px;line-height:0%;font-family:Arial;text-align:start;text-anchor:start;fill:#000000"
|
||||
x="249.19109"
|
||||
y="348.2706"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3317">Message</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="296.7457"
|
||||
y="348.2706"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3319"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.150015px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
clip-path="url(#clipEmfPath7)"
|
||||
d="m 174.31695,148.19815 h -25.62437 c -0.34691,0 -0.62818,-0.28128 -0.62818,-0.62819 0,-0.34692 0.28127,-0.6282 0.62818,-0.6282 h 25.62437 c 0.34691,0 0.62818,0.28128 0.62818,0.6282 0,0.34691 -0.28127,0.62819 -0.62818,0.62819 z m -24.37737,3.12223 -7.50073,-3.75042 7.50073,-3.75043 z"
|
||||
d="m 174.31695,148.19815 -25.62437,0 c -0.34691,0 -0.62818,-0.28128 -0.62818,-0.62819 0,-0.34692 0.28127,-0.6282 0.62818,-0.6282 l 25.62437,0 c 0.34691,0 0.62818,0.28128 0.62818,0.6282 0,0.34691 -0.28127,0.62819 -0.62818,0.62819 z m -24.37737,3.12223 -7.50073,-3.75042 7.50073,-3.75043 z"
|
||||
id="path3321"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 277.91888,297.09602 0,33.00376 c 0,0.35629 -0.28128,0.61882 -0.63756,0.61882 -0.33754,0 -0.61881,-0.26253 -0.61881,-0.61882 l 0,-33.00376 c 0,-0.33754 0.28127,-0.61882 0.61881,-0.61882 0.35628,0 0.63756,0.28128 0.63756,0.61882 z m 3.1128,31.74737 -3.75036,7.50086 -3.75037,-7.50086 z"
|
||||
id="path3323" />
|
||||
<g
|
||||
id="path2302">
|
||||
id="g3389"
|
||||
transform="translate(103.61121,159.85132)">
|
||||
<text
|
||||
id="text3391"
|
||||
style="font-size:21.59645653px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
|
||||
y="197.34073"
|
||||
x="-0.70423234"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path1187"
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;-inkscape-stroke:none"
|
||||
d="M 74.851562 35.234375 L 74.851562 219.70703 L 74.894531 219.70703 L 74.894531 219.70898 L 176.75 219.70898 L 176.75 218.70898 L 75.851562 218.70898 L 75.851562 154.70117 L 176.75 154.70117 L 176.75 153.70117 L 75.851562 153.70117 L 75.851562 89.695312 L 176.75 89.695312 L 176.75 88.695312 L 75.851562 88.695312 L 75.851562 35.234375 L 74.851562 35.234375 z "
|
||||
transform="translate(28.041461,50.336628)" />
|
||||
<g
|
||||
id="g1177">
|
||||
<g
|
||||
id="path1179">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-width:0.375;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 199.56031,267.12506 6.55552,2.41063 -6.55552,2.41063 c 1.0473,-1.42323 1.04126,-3.37047 0,-4.82126 z"
|
||||
id="path1183" />
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 199.625,266.94922 a 0.18751875,0.18751875 0 0 0 -0.2168,0.28515 c 0.99512,1.38651 1.00066,3.24437 0.002,4.60157 a 0.18751875,0.18751875 0 0 0 0.21484,0.28711 l 6.55469,-2.41211 a 0.18751875,0.18751875 0 0 0 0,-0.35157 z m 0.22266,0.48047 5.72461,2.10547 -5.72461,2.10546 c 0.76265,-1.31366 0.76042,-2.88007 0,-4.21093 z"
|
||||
id="path1185" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="path2304">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;-inkscape-stroke:none"
|
||||
d="m 278.79102,84.96875 v 43.67969 h 1 V 84.96875 Z"
|
||||
id="path1113" />
|
||||
<g
|
||||
id="g1103">
|
||||
<g
|
||||
id="path1105">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-width:0.375;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 281.7117,123.41665 -2.41063,6.55552 -2.41063,-6.55552 c 1.42323,1.0473 3.37047,1.04126 4.82126,0 z"
|
||||
id="path1109" />
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 281.75391,123.23438 a 0.18751875,0.18751875 0 0 0 -0.15235,0.0293 c -1.3865,0.99512 -3.24241,1.00066 -4.59961,0.002 a 0.18751875,0.18751875 0 0 0 -0.28711,0.21484 l 2.41016,6.55664 a 0.18751875,0.18751875 0 0 0 0.35156,0 l 2.41016,-6.55664 a 0.18751875,0.18751875 0 0 0 -0.13281,-0.24609 z m -0.34766,0.46875 -2.10547,5.72656 -2.10547,-5.72461 c 1.3136,0.76271 2.88007,0.75835 4.21094,-0.002 z"
|
||||
id="path1111" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="path2820">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;-inkscape-stroke:none"
|
||||
d="m 278.79102,149.77148 v 42.79688 h 1 v -42.79688 z"
|
||||
id="path1127" />
|
||||
<g
|
||||
id="g1117">
|
||||
<g
|
||||
id="path1119">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-width:0.375;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 281.7117,187.3376 -2.41063,6.55552 -2.41063,-6.55552 c 1.42323,1.0473 3.37047,1.04126 4.82126,0 z"
|
||||
id="path1123" />
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 281.75391,187.1543 a 0.18751875,0.18751875 0 0 0 -0.15235,0.0312 c -1.3865,0.99512 -3.24241,1.00066 -4.59961,0.002 a 0.18751875,0.18751875 0 0 0 -0.28711,0.21484 l 2.41016,6.55469 a 0.18751875,0.18751875 0 0 0 0.35156,0 l 2.41016,-6.55469 a 0.18751875,0.18751875 0 0 0 -0.13281,-0.24804 z m -4.5586,0.4707 c 1.31362,0.76277 2.88004,0.76032 4.21094,0 l -2.10547,5.72461 z"
|
||||
id="path1125" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="path3035">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;-inkscape-stroke:none"
|
||||
d="m 278.79102,215.0293 v 42.79882 h 1 V 215.0293 Z"
|
||||
id="path1141" />
|
||||
<g
|
||||
id="g1131">
|
||||
<g
|
||||
id="path1133">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-width:0.375;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 281.7117,252.59679 -2.41063,6.55552 -2.41063,-6.55552 c 1.42323,1.0473 3.37047,1.04126 4.82126,0 z"
|
||||
id="path1137" />
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 281.75391,252.41406 a 0.18751875,0.18751875 0 0 0 -0.15235,0.0312 c -1.3865,0.99512 -3.24241,0.99871 -4.59961,0 a 0.18751875,0.18751875 0 0 0 -0.28711,0.2168 l 2.41016,6.55469 a 0.18751875,0.18751875 0 0 0 0.35156,0 l 2.41016,-6.55469 a 0.18751875,0.18751875 0 0 0 -0.13281,-0.24805 z m -4.5586,0.47071 c 1.31358,0.76269 2.88008,0.76025 4.21094,0 l -2.10547,5.7246 z"
|
||||
id="path1139" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="path4154">
|
||||
<g
|
||||
id="g1163">
|
||||
<g
|
||||
id="path1165">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-width:0.375;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 199.56031,202.11765 6.55552,2.41063 -6.55552,2.41063 c 1.0473,-1.42323 1.04126,-3.37047 0,-4.82126 z"
|
||||
id="path1169" />
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 199.625,201.94141 a 0.18751875,0.18751875 0 0 0 -0.2168,0.28515 c 0.99512,1.3865 1.00066,3.24437 0.002,4.60156 a 0.18751875,0.18751875 0 0 0 0.21484,0.28711 l 6.55469,-2.41015 a 0.18751875,0.18751875 0 0 0 0,-0.35352 z m 0.22266,0.48046 5.72265,2.10547 -5.72265,2.10743 c 0.76282,-1.31371 0.76047,-2.88194 0,-4.2129 z"
|
||||
id="path1171" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="path4236">
|
||||
<g
|
||||
id="g1145">
|
||||
<g
|
||||
id="path1147">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-width:0.375;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 199.56031,137.11023 6.55552,2.41063 -6.55552,2.41063 c 1.0473,-1.42323 1.04126,-3.37047 0,-4.82126 z"
|
||||
id="path1151" />
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 199.625,136.93359 a 0.18751875,0.18751875 0 0 0 -0.2168,0.28516 c 0.99512,1.3865 1.00066,3.24437 0.002,4.60156 a 0.18751875,0.18751875 0 0 0 0.21484,0.28711 l 6.55469,-2.41015 a 0.18751875,0.18751875 0 0 0 0,-0.35157 z m 0.22266,0.48243 5.72461,2.10546 -5.72461,2.10547 c 0.7625,-1.31316 0.75952,-2.88028 0,-4.21093 z"
|
||||
id="path1153" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="path4396">
|
||||
<path
|
||||
id="path958"
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;-inkscape-stroke:none"
|
||||
d="M 424.63867 35.234375 L 424.63867 88.695312 L 321.84375 88.695312 L 321.84375 89.695312 L 425.64453 89.695312 L 425.64453 88.695312 L 425.63867 88.695312 L 425.63867 35.234375 L 424.63867 35.234375 z "
|
||||
transform="translate(28.041461,50.336628)" />
|
||||
<g
|
||||
id="g948">
|
||||
<g
|
||||
id="path950">
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-width:0.375;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 355.11503,141.95071 -6.55552,-2.41063 6.55552,-2.41063 c -1.0473,1.42323 -1.04126,3.37047 0,4.82126 z"
|
||||
id="path954" />
|
||||
<path
|
||||
style="color:#000000;fill:#000000;fill-rule:evenodd;stroke-linejoin:round;-inkscape-stroke:none"
|
||||
d="m 355.05078,136.95312 -6.55664,2.41016 a 0.18751875,0.18751875 0 0 0 0,0.35352 l 6.55664,2.41015 a 0.18751875,0.18751875 0 0 0 0.2168,-0.28515 c -0.99512,-1.3865 -1.00066,-3.24437 -0.002,-4.60157 a 0.18751875,0.18751875 0 0 0 -0.21484,-0.28711 z m -0.22266,0.48047 c -0.76281,1.31371 -0.76047,2.88194 0,4.21289 l -5.72265,-2.10742 z"
|
||||
id="path956" />
|
||||
</g>
|
||||
</g>
|
||||
id="path3393"
|
||||
d="m 0.74824682,0.41458137 0,183.67838863"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.46715069px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 17 KiB |
@@ -182,9 +182,7 @@ By default this value is 0.0001.
|
||||
The value given to this parameter is a basic value for ShapeHealing algorithms and the processor. It does its best to reach it. Under certain circumstances, the value you give may not be attached to all of the entities concerned at the end of processing. STEP-to-OpenCASCADE translation does not improve the quality of the geometry in the original STEP file. This means that the value you enter may be impossible to attach to all shapes with the given quality of the geometry in the STEP file.
|
||||
|
||||
<h4>read.maxprecision.val</h4>
|
||||
Defines the maximum allowed tolerance (in internal units, which are specified in xstep.cascade.unit) of the shape.
|
||||
It should be not less than the basic value of tolerance set in the processor (either the uncertainty from the file or *read.precision.val*).
|
||||
Actually, the maximum between *read.maxprecision.val* and the basis tolerance is used to define the maximum allowed tolerance.
|
||||
Defines the maximum allowed tolerance (in mm) of the shape. It should be not less than the basic value of tolerance set in the processor (either the uncertainty from the file or *read.precision.val*). Actually, the maximum between *read.maxprecision.val* and the basis tolerance is used to define the maximum allowed tolerance.
|
||||
|
||||
Read this parameter with:
|
||||
~~~~{.cpp}
|
||||
|
@@ -1,9 +1,8 @@
|
||||
.NET: Import/Export (C#|C++/CLI|WinForms|WPF) {#samples_csharp_occt}
|
||||
OCCT CSharp sample {#samples_csharp_occt}
|
||||
==================
|
||||
|
||||
This sample demonstrates how to use OCCT libraries in <b>.Net</b> application
|
||||
written using **CSharp** and **Windows Forms** or **Windows Presentation Foundation** (WPF).
|
||||
The sample could be found within OCCT repository in folder `/samples/CSharp/`.
|
||||
|
||||
The connection between .Net and OCCT (C++) level is provided by proxy library
|
||||
**OCCProxy**, written in C++/CLI. The proxy library contains a single *ref* class
|
||||
@@ -15,8 +14,6 @@ Both applications provide the same functionality as the standard OCCT Import/Exp
|
||||
The first project is called *IE_WinForms* and uses Windows Forms for GUI.
|
||||
The second application is called *IE_WPF_WinForms* and uses Windows Presentation Foundation.
|
||||
|
||||
@figure{samples_c__ie.png}
|
||||
|
||||
Note a few important details:
|
||||
|
||||
- OCCT template class *NCollection_Haft* is used to encapsulate C++ class into a field of *ref* class;
|
||||
|
@@ -1,9 +1,8 @@
|
||||
.NET: D3D/OpenGL Viewer (C#|C++/CLI|WPF) {#samples_csharp_direct3d}
|
||||
==================
|
||||
Direct3D CSharp sample {#samples_csharp_direct3d}
|
||||
==================
|
||||
|
||||
This sample demonstrates how to use OCCT and DirectX libraries in <b>.Net</b> application
|
||||
written using **CSharp** and **Windows Presentation Foundation** (WPF).
|
||||
The sample could be found within OCCT repository in folder `/samples/CSharp/`.
|
||||
|
||||
The connection between .Net, OCCT (C++) and DirectX level is provided by proxy libraries,
|
||||
**OCCProxy** and **D3DProxy**, written in C++/CLI. The proxy library **OCCProxy** contains a single
|
||||
|
@@ -311,7 +311,7 @@ void OcafSamples::ModifyBoxOcafSample()
|
||||
Handle(TFunction_Function) aFunction;
|
||||
if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction))
|
||||
{
|
||||
myResult << "Object cannot be modified.";
|
||||
myResult << "Object cannot be modify.";
|
||||
return;
|
||||
}
|
||||
// Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute
|
||||
@@ -413,7 +413,7 @@ void OcafSamples::ModifyCylinderOcafSample()
|
||||
Handle(TFunction_Function) aFunction;
|
||||
if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction))
|
||||
{
|
||||
myResult << "Object cannot be modified.";
|
||||
myResult << "Object cannot be modify.";
|
||||
return;
|
||||
}
|
||||
// Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -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()
|
@@ -1,10 +1,4 @@
|
||||
GLFW: 3D Viewer (C++|GLFW) {#occt_samples_glfw}
|
||||
==================
|
||||
|
||||
A sample demonstrating usage of OCCT 3D Viewer within a window created using GLFW.
|
||||
|
||||
Use CMake to build the sample.
|
||||
|
||||
Platforms: Windows, macOS, Linux
|
||||
|
||||
Required: glfw
|
||||
|
@@ -1,15 +1,12 @@
|
||||
iOS: 3D Viewer (Objective-C++|UIKit) {#occt_samples_ios_uikit}
|
||||
OCCT sample for iOS {#occt_samples_ios_uikit}
|
||||
==================
|
||||
|
||||
UIKitSample consists of the Open CASCADE 3D Viewer which provides import of STEP files and toolbar with three buttons.
|
||||
The sample could be found within OCCT repository in folder `/samples/ios/UIKitSample/`.
|
||||
|
||||
The first and second buttons serve for import hardcoded STEP files. The third button displays "About" dialog.
|
||||
|
||||
The viewer supports zoom, pan and rotate actions. The viewer supports selection of solids as well.
|
||||
|
||||
@figure{sample_ios_uikit.png}
|
||||
|
||||
Installation and configuration:
|
||||
1. Make sure you are running Mac OS version 10.12.1 or above and properly installed XCode version 8.1 or above.
|
||||
2. Install Open CASCADE Technology (OCCT) and build static libraries for desired device or/and simulator on your workstation.
|
||||
|
@@ -1,8 +1,7 @@
|
||||
Android: 3D Viewer (Java|C++|Android SDK|JNI) {#samples_java_android_occt}
|
||||
OCCT JniViewer sample for Android {#samples_java_android_occt}
|
||||
==================
|
||||
|
||||
This sample demonstrates simple way of using OCCT libraries in Android application written using Java.
|
||||
The sample could be found within OCCT repository in folder `/samples/java/jniviewer/`.
|
||||
|
||||
The connection between Java and OCCT (C++) level is provided by proxy library, libTKJniSample.so, written in C++ with exported JNI methods of Java class OcctJniRenderer.
|
||||
The proxy library contains single C++ class OcctJni_Viewer encapsulating OCCT viewer and providing functionality to manipulate this viewer
|
||||
@@ -14,8 +13,6 @@ and the code can be programmed on Java level similarly to C++ one.
|
||||
See description of OCCT Java Wrapper in Advanced Samples and Tools on OCCT web site at
|
||||
https://www.opencascade.com/content/advanced-samples-and-tools
|
||||
|
||||
@figure{samples_java_android_occt.jpg}
|
||||
|
||||
Install Android Studio 4.0+ and install building tools (check Tools -> SDK Manager):
|
||||
- Android SDK (API level 21 or higher).
|
||||
- Android SDK build tools.
|
||||
|
@@ -983,7 +983,6 @@ if(NbResults>0){ \n\
|
||||
|
||||
Handle(ISession_Surface) aSurface = new ISession_Surface(SP);
|
||||
Handle(Prs3d_Drawer) CurDrawer = aSurface->Attributes();
|
||||
CurDrawer->SetOwnLineAspects();
|
||||
CurDrawer->UIsoAspect()->SetNumber(10);
|
||||
CurDrawer->VIsoAspect()->SetNumber(10);
|
||||
aDoc->GetAISContext()->SetLocalAttributes(aSurface, CurDrawer, Standard_False);
|
||||
|
@@ -51,7 +51,7 @@ ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d,
|
||||
myDir (gp_Dir(aDir2d.X(),aDir2d.Y(),0.0)),
|
||||
myLength (aLength)
|
||||
{
|
||||
myArrowLength = 1.0;
|
||||
myArrowLength = myDrawer->ArrowAspect()->Length();
|
||||
}
|
||||
|
||||
ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d,
|
||||
@@ -60,7 +60,7 @@ ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d,
|
||||
myDir (gp_Dir(aVec2d.X(), aVec2d.Y(), 0.0))
|
||||
{
|
||||
myLength = aVec2d.Magnitude();
|
||||
myArrowLength = 1.0;
|
||||
myArrowLength = myDrawer->ArrowAspect()->Length();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -26,7 +26,6 @@ void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& ,
|
||||
Handle(GeomAdaptor_Surface) anAdaptorHSurface = new GeomAdaptor_Surface (mySurface);
|
||||
|
||||
Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer();
|
||||
aPoleDrawer->SetOwnLineAspects();
|
||||
aPoleDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_YELLOW3, Aspect_TOL_SOLID, 1.0));
|
||||
switch (theMode)
|
||||
{
|
||||
|
54
samples/mfc/standard/03_Viewer2d/CMakeLists.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
|
||||
project (Viewer2d)
|
||||
|
||||
add_definitions (-DWINVER=0x0501 -DUNICODE -D_UNICODE)
|
||||
set (CMAKE_MFC_FLAG 2)
|
||||
|
||||
set (Viewer2d_SOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_Viewer2d/src)
|
||||
set (Viewer2d_HEADER_FILES ${Viewer2d_SOURCE_DIR}/Viewer2dApp.h
|
||||
${Viewer2d_SOURCE_DIR}/Viewer2dDoc.h
|
||||
${Viewer2d_SOURCE_DIR}/StdAfx.h )
|
||||
set (Viewer2d_SOURCE_FILES ${Viewer2d_SOURCE_DIR}/Viewer2dApp.cpp
|
||||
${Viewer2d_SOURCE_DIR}/Viewer2dDoc.cpp
|
||||
${Viewer2d_SOURCE_DIR}/StdAfx.cpp )
|
||||
|
||||
set (Viewer2d_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_Viewer2d/res)
|
||||
set (Viewer2d_RESOURCE_HEADER ${Viewer2d_RESOURCE_DIR}/resource.h)
|
||||
set (Viewer2d_RESOURCE_FILES ${Viewer2d_RESOURCE_DIR}/Toolbar.bmp
|
||||
${Viewer2d_RESOURCE_DIR}/Viewer2d.rc)
|
||||
|
||||
# groups in the VS solution
|
||||
source_group ("Source Files" FILES ${Viewer2d_SOURCE_FILES}
|
||||
${COMMON_WINMAIN_FILE})
|
||||
|
||||
source_group ("Header Files" FILES ${Viewer2d_HEADER_FILES}
|
||||
${Viewer2d_RESOURCE_HEADER})
|
||||
|
||||
source_group ("Resource Files" FILES ${Viewer2d_RESOURCE_FILES})
|
||||
|
||||
add_executable (Viewer2d WIN32 ${Viewer2d_SOURCE_FILES}
|
||||
${Viewer2d_HEADER_FILES}
|
||||
${COMMON_WINMAIN_FILE}
|
||||
${Viewer2d_RESOURCE_HEADER}
|
||||
${Viewer2d_RESOURCE_FILES})
|
||||
|
||||
set_property (TARGET Viewer2d PROPERTY FOLDER "Samples/mfc")
|
||||
|
||||
if (SINGLE_GENERATOR)
|
||||
install (TARGETS Viewer2d DESTINATION "${INSTALL_DIR_BIN}")
|
||||
else()
|
||||
install (TARGETS Viewer2d
|
||||
CONFIGURATIONS Release RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR_BIN}")
|
||||
install (TARGETS Viewer2d
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR_BIN}d")
|
||||
endif()
|
||||
|
||||
include_directories (${CMAKE_BINARY_DIR}/inc
|
||||
${MFC_STANDARD_SAMPLES_DIR}/03_Viewer2d
|
||||
${Viewer2d_SOURCE_DIR}
|
||||
${MFC_STANDARD_SAMPLES_DIR}/Common)
|
||||
|
||||
target_link_libraries (Viewer2d mfcsample)
|
16
samples/mfc/standard/03_Viewer2d/README.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
Viewer2d sample demonstrates how the functionality of TKV3d package can be
|
||||
used for 2D visualization. It provides samples of 2D objects visualization,
|
||||
dynamic selection and highlighting.
|
||||
It illustrates how to:
|
||||
1) implement 2D view behavior with V3d_View class, with interactive zooming
|
||||
and panning of the 2D scene;
|
||||
2) draw 2D primitives like rectangles, lines, curves;
|
||||
3) draw different types of markers;
|
||||
4) draw text defined by its font, height, style, angle;
|
||||
5) display 2D curves of a face' edges and group them using orientation
|
||||
criterion;
|
||||
6) display zoomable images;
|
||||
6) display circular and rectangular grids .
|
||||
|
||||
Viewer2d support zooming ,panning of displayed objects and
|
||||
circular and rectangular grids.
|
354
samples/mfc/standard/03_Viewer2d/adm/win/vc10/Viewer2d.vcxproj
Normal file
@@ -0,0 +1,354 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{6B905DC2-4E72-4EDA-99C2-7473634690FE}</ProjectGuid>
|
||||
<RootNamespace>Viewer2d</RootNamespace>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>$(VCPlatformToolSet)</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>$(VCPlatformToolSet)</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>$(VCPlatformToolSet)</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>$(VCPlatformToolSet)</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../../../win32\$(VCFMT)\bin\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\win32\obj\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../../win64\$(VCFMT)\bin\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\win64\obj\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../../../win32\$(VCFMT)\bind\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\win32\objd\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../../win64\$(VCFMT)\bind\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\win64\objd\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\win32\obj/Viewer2d.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\Properties;.;..\..\..\src;..\..\..\..\Common;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\win32\obj/Viewer2d.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\win32\obj/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\win32\obj/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\win32\obj/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<CompileAs>Default</CompileAs>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>TKVCAF.lib;TKBRep.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../../../../win32\$(VCFMT)\bin/Viewer2d.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\..\..\win32\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ProgramDatabaseFile>../../../../win32\$(VCFMT)\bin/Viewer2d.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\win64\obj/Viewer2d.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\Properties;.;..\..\..\src;..\..\..\..\Common;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\win64\obj/Viewer2d.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\win64\obj/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\win64\obj/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\win64\obj/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<CompileAs>Default</CompileAs>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>TKVCAF.lib;TKBRep.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../../../../win64\$(VCFMT)\bin/Viewer2d.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\..\..\win64\$(VCFMT)\lib;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ProgramDatabaseFile>../../../../win64\$(VCFMT)\bin/Viewer2d.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>.\win32\objd/Viewer2d.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\Properties;.;..\..\..\src;..\..\..\..\Common;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\win32\objd/Viewer2d.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\win32\objd/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\win32\objd/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\win32\objd/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>TKVCAF.lib;TKBRep.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../../../../win32\$(VCFMT)\bind/Viewer2d.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\..\..\win32\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>../../../../win32\$(VCFMT)\bind/Viewer2d.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<TypeLibraryName>.\win64\objd/Viewer2d.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\src\Properties;.;..\..\..\src;..\..\..\..\Common;$(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;WINVER=0x0501;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\win64\objd/Viewer2d.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\win64\objd/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\win64\objd/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\win64\objd/</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>TKVCAF.lib;TKBRep.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPrim.lib;TKService.lib;TKTopAlgo.lib;TKV3d.lib;TKOpenGl.lib;mfcsample.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../../../../win64\$(VCFMT)\bind/Viewer2d.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\..\..\win64\$(VCFMT)\libd;$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>../../../../win64\$(VCFMT)\bind/Viewer2d.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\StdAfx.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\Viewer2dApp.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\Viewer2dDoc.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\WINMAIN.CPP">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\..\res\Viewer2d.rc">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\res\resource.h" />
|
||||
<ClInclude Include="..\..\..\src\StdAfx.h" />
|
||||
<ClInclude Include="..\..\..\src\Viewer2dApp.h" />
|
||||
<ClInclude Include="..\..\..\src\Viewer2dDoc.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\res\Toolbar.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\mfcsample\adm\win\vc10\mfcsample.vcxproj">
|
||||
<Project>{2d6cbbe8-6965-4016-b503-0d715ae26691}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{a5fbdc06-d5d7-4c8a-b829-e986d5c86642}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{c7319851-4cde-42ce-b4aa-8b7ddd5f0c21}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{ffedd656-2b68-4a6e-8df3-973a1a5b136e}</UniqueIdentifier>
|
||||
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\StdAfx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\Viewer2dApp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\Viewer2dDoc.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\WINMAIN.CPP">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\..\res\Viewer2d.rc">
|
||||
<Filter>Source Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\res\resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\StdAfx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\Viewer2dApp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\Viewer2dDoc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\res\Toolbar.bmp">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
BIN
samples/mfc/standard/03_Viewer2d/res/Toolbar.bmp
Executable file
After Width: | Height: | Size: 1.3 KiB |
420
samples/mfc/standard/03_Viewer2d/res/Viewer2d.rc
Executable file
@@ -0,0 +1,420 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
#include "..\..\Common\res\OCC_Resource.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"#include ""..\\..\\..\\Common\\res\\OCC_Resource.h""\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Toolbar
|
||||
//
|
||||
|
||||
IDR_MAINFRAME TOOLBAR 16, 15
|
||||
BEGIN
|
||||
BUTTON ID_FILE_NEW
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTON_Test_Text
|
||||
BUTTON ID_BUTTON_Test_Markers
|
||||
BUTTON ID_BUTTON_Test_Line
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTON_Test_Face
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTON_Test_Rect
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTON_Test_Curve
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTON32793
|
||||
BUTTON ID_BUTTON_Test_MultiImages
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTON_Erase
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_DIALOG_Color DIALOG 0, 0, 281, 186
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Color Map "
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Type Of The Color Map :",IDC_STATIC,20,10,87,10
|
||||
LTEXT "To be updated ...",IDC_ColorMap_STATIC_Type,110,10,69,10
|
||||
LTEXT "Size Of The Color Map :",IDC_STATIC,20,20,79,10
|
||||
CONTROL "Tab1",IDC_ColorMap_TAB,"SysTabControl32",TCS_BUTTONS,19,53,242,15
|
||||
LTEXT "To be updated ...",IDC_ColorMap_STATIC_Size,110,20,69,10
|
||||
GROUPBOX "Entries :",IDC_STATIC,10,40,264,50
|
||||
LTEXT "Color Name :",IDC_STATIC,20,75,50,10
|
||||
LTEXT "To be updated ...",IDC_ColorMap_STATIC_EntryColorName,204,75,69,10
|
||||
PUSHBUTTON "Add",IDC_ColorMap_BUTTON_AddNewEntry,110,145,55,15
|
||||
GROUPBOX "New Entry",IDC_STATIC,10,100,267,79
|
||||
PUSHBUTTON "Update Current",IDC_ColorMap_BUTTON_UpdateCurrentEntry,20,145,55,15
|
||||
LTEXT "Color Name :",IDC_ColorMap_STATIC_NewEntryColorNameStatic,20,120,55,10
|
||||
PUSHBUTTON "Edit...",IDC_ColorMap_BUTTON_NewEntry_EditColor,204,145,55,15
|
||||
LTEXT "999",IDC_ColorMap_STATIC_EntryColorRed,75,75,35,10
|
||||
LTEXT "999",IDC_ColorMap_STATIC_EntryColorGreen,120,75,35,10
|
||||
LTEXT "999",IDC_ColorMap_STATIC_EntryColorBlue,165,75,35,10
|
||||
EDITTEXT IDC_ColorMap_EDIT_NewEntryColorRed,75,120,35,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_ColorMap_EDIT_NewEntryColorGreen,120,120,30,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_ColorMap_EDIT_NewEntryColorBlue,165,120,35,12,ES_AUTOHSCROLL
|
||||
COMBOBOX IDC_ColorMap_COMBO_NewEntryColorName,204,120,70,193,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "New Generic Color Map",IDC_ColorMap_BUTTON_NewGenericColorMap,179,4,95,13
|
||||
LTEXT "Not available for this type of Color map",IDC_ColorMap_STATIC_NewEntryNotavailable,70,130,160,10
|
||||
PUSHBUTTON "New Color Cube Color Map ",IDC_ColorMap_BUTTON_NewColorCubeColorMap,179,18,95,13
|
||||
PUSHBUTTON "New Color Ramp Color Map",IDC_ColorMap_BUTTON_NewColorRampColorMap,179,31,95,13
|
||||
END
|
||||
|
||||
IDD_DIALOG_Font DIALOGEX 0, 0, 287, 210
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Font Map"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Size Of The Font Map :",IDC_STATIC,20,10,80,10
|
||||
LTEXT "To be updated ...",IDC_FontMap_STATIC_Size,110,10,80,10
|
||||
GROUPBOX "Entries :",IDC_STATIC,10,28,270,97,0,WS_EX_TRANSPARENT
|
||||
CONTROL "Tab1",IDC_FontMap_TAB,"SysTabControl32",TCS_BUTTONS,20,40,242,15
|
||||
GROUPBOX "New Entry",IDC_STATIC,10,130,270,73
|
||||
PUSHBUTTON "Update Current",IDC_FontMap_BUTTON_UpdateCurrent,158,181,55,15
|
||||
PUSHBUTTON "Add",IDC_FontMap_BUTTON_NewEntry,221,179,55,16
|
||||
LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntryValue,63,75,217,10
|
||||
LTEXT "Type :",IDC_STATIC,21,155,23,10
|
||||
LTEXT "Type :",IDC_STATIC,21,60,40,10
|
||||
LTEXT "To be updated ...",IDC_FontMap_STATIC_CurrentEntryType,63,60,80,10
|
||||
LTEXT "Size :",IDC_STATIC,21,174,42,10
|
||||
LTEXT "Slant :",IDC_STATIC,21,189,28,10
|
||||
EDITTEXT IDC_FontMap_EDIT_NewEntrySize,63,172,62,12,ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
EDITTEXT IDC_FontMap_EDIT_NewEntrySlant,63,187,62,12,ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
LTEXT "Size :",IDC_STATIC,21,90,30,10
|
||||
LTEXT "Slant :",IDC_STATIC,21,106,36,10
|
||||
LTEXT "Value :",IDC_STATIC,21,75,40,10
|
||||
LTEXT "Type :",IDC_STATIC,21,140,42,10
|
||||
COMBOBOX IDC_FontMap_COMBO_NewEntryType,63,138,113,77,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
EDITTEXT IDC_FontMap_EDIT_NewEntryValue,63,153,209,12,ES_AUTOHSCROLL | ES_READONLY
|
||||
LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntrySize,63,90,70,10
|
||||
LTEXT "To be updated...",IDC_FontMap_STATIC_CurrentEntrySlant,63,106,80,10
|
||||
PUSHBUTTON "Edit...",IDC_FontMap_BUTTON_NewEntry_EditFont,191,138,55,12
|
||||
END
|
||||
|
||||
IDD_DIALOG_Width DIALOG 0, 0, 281, 167
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Width Map "
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Size Of The Width Map :",IDC_STATIC,15,10,80,10
|
||||
CONTROL "Tab1",IDC_WidthMap_TAB,"SysTabControl32",TCS_BUTTONS,21,40,242,15
|
||||
LTEXT "To be updated ...",IDC_WidthMap_STATIC_Size,107,10,80,10
|
||||
GROUPBOX "Entries :",IDC_STATIC,10,30,264,57
|
||||
LTEXT "Type :",IDC_STATIC,15,60,80,10
|
||||
LTEXT "Width :",IDC_STATIC,15,75,80,10
|
||||
LTEXT "Type :",IDC_STATIC,15,115,49,10
|
||||
LTEXT "Width :",IDC_STATIC,15,130,49,10
|
||||
COMBOBOX IDC_WidthMap_COMBO_NewEntryType,70,113,113,77,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
EDITTEXT IDC_WidthMap_EDIT_NewEntryWidth,70,128,62,12,ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN
|
||||
LTEXT "To be updated ...",IDC_WidthMap_STATIC_EntryType,107,60,80,10
|
||||
LTEXT "To be updated ...",IDC_WidthMap_STATIC_EntryWidth,107,75,80,10
|
||||
PUSHBUTTON "Add",IDC_WidthMap_BUTTON_AddNewEntry,200,130,55,15
|
||||
GROUPBOX "New Entry",IDC_STATIC,7,101,267,51
|
||||
PUSHBUTTON "Update Current",IDC_WidthMap_BUTTON_UpdateCurrentEntry,200,110,55,15
|
||||
END
|
||||
|
||||
IDD_DIALOG_NewColorCube DIALOG 0, 0, 207, 156
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "New Color Cube"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,150,10,50,13
|
||||
PUSHBUTTON "Cancel",IDCANCEL,150,30,50,14
|
||||
LTEXT "base_pixel",IDC_STATIC,20,10,50,10
|
||||
LTEXT "greenmax",IDC_STATIC,20,70,50,10
|
||||
LTEXT "greenmult",IDC_STATIC,20,90,50,10
|
||||
LTEXT "bluemax",IDC_STATIC,20,110,50,10
|
||||
LTEXT "bluemult",IDC_STATIC,20,130,50,10
|
||||
EDITTEXT IDC_NewColorCube_EDIT_bluemult,80,130,50,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_NewColorCube_EDIT_bluemax,80,110,50,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_NewColorCube_EDIT_grennmult,80,90,50,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_NewColorCube_EDIT_greenmax,80,70,50,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_NewColorCube_EDIT_base_pixel,80,10,50,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "redmax",IDC_STATIC,20,30,50,10
|
||||
EDITTEXT IDC_NewColorCube_EDIT_redmax,80,30,50,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "redmult",IDC_STATIC,20,50,50,10
|
||||
EDITTEXT IDC_NewColorCube_EDIT_redmult,80,50,50,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
END
|
||||
|
||||
IDD_DIALOG_NewColorRamp DIALOG 0, 0, 252, 121
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "New Color ramp"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,150,10,50,13
|
||||
PUSHBUTTON "Cancel",IDCANCEL,150,30,50,14
|
||||
LTEXT "base_pixel",-1,20,10,49,10
|
||||
EDITTEXT IDC_NewColorRamp_EDIT_base_pixel,80,10,40,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "dimension",-1,20,30,49,10
|
||||
EDITTEXT IDC_NewColorramp_EDIT_dimension,80,30,40,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "Color Name :",IDC_ColorMap_STATIC_NewEntryColorNameStatic,20,50,49,10
|
||||
PUSHBUTTON "Edit...",IDC_NewColorMapRamp_BUTTON_EditColor,145,70,55,10
|
||||
EDITTEXT IDC_NewColorMapRamp_EDIT_ColorRed,28,70,35,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_NewColorMapRamp_EDIT_ColorGreen,65,70,35,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_NewColorMapRamp_EDIT_ColorBlue,103,70,35,12,ES_AUTOHSCROLL
|
||||
COMBOBOX IDC_NewColorMap_COMBO_NewEntryColorName,80,50,70,193,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_DIALOG_Type DIALOGEX 0, 0, 287, 170
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Type Map"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Size Of The Type Map :",-1,20,10,80,10
|
||||
LTEXT "To be updated ...",IDC_TypeMap_STATIC_Size,110,10,80,10
|
||||
GROUPBOX "Entries :",-1,10,28,270,62,0,WS_EX_TRANSPARENT
|
||||
CONTROL "Tab1",IDC_TypeMap_TAB,"SysTabControl32",TCS_BUTTONS,20,40,242,15
|
||||
GROUPBOX "New Entry",-1,10,100,270,60
|
||||
PUSHBUTTON "Update Current",IDC_FontMap_BUTTON_UpdateCurrent,160,140,55,15
|
||||
PUSHBUTTON "Add",IDC_FontMap_BUTTON_NewEntry,220,140,55,15
|
||||
LTEXT "To be updated...",IDC_TypeMap_STATIC_CurrentEntryValue,63,75,217,10
|
||||
LTEXT "Value :",-1,21,126,42,10
|
||||
LTEXT "Style :",-1,21,60,40,10
|
||||
LTEXT "To be updated ...",IDC_TypeMap_STATIC_CurrentEntryStyle,63,60,80,10
|
||||
LTEXT "Value :",-1,21,75,40,10
|
||||
LTEXT "Style :",-1,21,111,42,10
|
||||
COMBOBOX IDC_TypeMap_COMBO_NewEntryStyle,63,108,113,77,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
EDITTEXT IDC_TypeMap_EDIT_NewEntryValue,63,124,194,12,ES_AUTOHSCROLL | ES_READONLY
|
||||
END
|
||||
|
||||
IDD_DIALOG_Mark DIALOGEX 0, 0, 287, 201
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Mark Map"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Size Of The Mark Map :",AFX_ID_PREVIEW_CLOSE,20,10,80,10
|
||||
LTEXT "To be updated ...",IDC_MarkMap_STATIC_Size,110,10,80,10
|
||||
GROUPBOX "Entries :",-1,10,28,270,92,0,WS_EX_TRANSPARENT
|
||||
CONTROL "Tab1",IDC_MarkMap_TAB,"SysTabControl32",TCS_BUTTONS,20,40,242,15
|
||||
LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryXValue,63,75,217,9
|
||||
LTEXT "Style :",-1,21,60,40,10
|
||||
LTEXT "To be updated ...",IDC_MarkMap_STATIC_CurrentEntryStyle,63,60,80,10
|
||||
LTEXT "XValue :",-1,21,75,40,9
|
||||
LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryYValue,63,90,217,10
|
||||
LTEXT "YValue :",-1,21,90,40,10
|
||||
LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntrySValue,63,105,217,10
|
||||
LTEXT "SValue :",-1,21,105,40,10
|
||||
LTEXT "To be updated...",IDC_MarkMap_STATIC_CurrentEntryValue,62,90,217,10
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDR_MAINFRAME BITMAP "Toolbar.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_2DTYPE MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
|
||||
MENUITEM "&Close", ID_FILE_CLOSE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Export Image...", ID_FILE_EXPORT_IMAGE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", ID_APP_EXIT
|
||||
END
|
||||
POPUP "&View"
|
||||
BEGIN
|
||||
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
|
||||
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
|
||||
END
|
||||
POPUP "&Window"
|
||||
BEGIN
|
||||
MENUITEM "&New Window", ID_WINDOW_NEW
|
||||
MENUITEM "&Cascade", ID_WINDOW_CASCADE
|
||||
MENUITEM "&Tile", ID_WINDOW_TILE_HORZ
|
||||
MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About Viewer2d...", ID_APP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MAINFRAME MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", ID_APP_EXIT
|
||||
END
|
||||
POPUP "&View"
|
||||
BEGIN
|
||||
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
|
||||
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About Viewer2d...", ID_APP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "SAMPLEVIEWER2D MFC Application"
|
||||
VALUE "FileVersion", "1, 0, 0, 1"
|
||||
VALUE "InternalName", "SAMPLEVIEWER2D"
|
||||
VALUE "LegalCopyright", "Copyright <20> 1997"
|
||||
VALUE "OriginalFilename", "VIEWER2D.EXE"
|
||||
VALUE "ProductName", "SAMPLEVIEWER2D Application"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDR_MAINFRAME "Viewer2d"
|
||||
IDR_2DTYPE "\nViewer2d\nViewer2d\n\n\nViewer2d.Document\nViewer2d Document"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_BUTTON_Test_Text "Test Text\nTest Text"
|
||||
ID_BUTTON_Test_Markers "Test Markers\nTest Markers"
|
||||
ID_BUTTON_Test_Line "Test Lines\nTest Lines"
|
||||
ID_BUTTON_Erase "Erase all\nErase"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_BUTTONAxo "Face orientation\nFace orientation"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_BUTTON_Test_Curve "Test Curves\nTest Curves"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_BUTTON32793 "Test Image\nTest Image"
|
||||
ID_BUTTON_Test_MultiImages "Test multi-images\nTest multi-images"
|
||||
ID_BUTTON_Test_Rect "Test Rects\nTest Rects"
|
||||
ID_BUTTON_Test_Face "Test Face\nTest Face"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
122
samples/mfc/standard/03_Viewer2d/res/resource.h
Executable file
@@ -0,0 +1,122 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by Viewer2d.rc
|
||||
//
|
||||
#define ID_BUTTON_Test_Image 0
|
||||
#define IDR_MAINFRAME2 130
|
||||
#define IDR_2DTYPE2 131
|
||||
#define ID_FILE_EXPORT_IMAGE2 133
|
||||
#define ID_MENU_CASCADE_PROPERTIES 148
|
||||
#define IDD_DIALOG_Font 160
|
||||
#define IDD_DIALOG_Width 161
|
||||
#define IDD_DIALOG_Color 162
|
||||
#define IDD_DIALOG_NewColorCube 163
|
||||
#define IDD_DIALOG_NewColorRamp 164
|
||||
#define IDD_DIALOG_Type 165
|
||||
#define IDD_DIALOG_Mark 166
|
||||
#define ID_BUTTON_Test_Text 1043
|
||||
#define ID_BUTTON_Test_Markers 1045
|
||||
#define ID_BUTTON_Test_Line 1048
|
||||
#define ID_BUTTON_Erase 1051
|
||||
#define IDR_MAINFRAME1 1208
|
||||
#define IDC_ColorMap_STATIC_Type 1420
|
||||
#define IDC_ColorMap_STATIC_Size 1421
|
||||
#define IDC_ColorMap_TAB 1422
|
||||
#define IDC_ColorMap_STATIC_EntryColorGreen 1423
|
||||
#define IDC_ColorMap_STATIC_EntryColorRed 1424
|
||||
#define IDC_ColorMap_STATIC_EntryColorBlue 1425
|
||||
#define IDC_ColorMap_STATIC_EntryColorName 1426
|
||||
#define IDC_ColorMap_EDIT_NewEntryColorRed 1427
|
||||
#define IDC_ColorMap_EDIT_NewEntryColorGreen 1428
|
||||
#define IDC_ColorMap_EDIT_NewEntryColorBlue 1429
|
||||
#define IDC_ColorMap_COMBO_NewEntryColorName 1430
|
||||
#define IDC_ColorMap_BUTTON_NewEntry_EditColor 1431
|
||||
#define IDC_ColorMap_BUTTON_UpdateCurrentEntry 1432
|
||||
#define IDC_ColorMap_BUTTON_AddNewEntry 1433
|
||||
#define IDC_ColorMap_BUTTON_NewGenericColorMap 1434
|
||||
#define IDC_ColorMap_STATIC_NewEntryColorNameStatic 1435
|
||||
#define IDC_ColorMap_STATIC_NewEntryNotavailable 1436
|
||||
#define IDC_ColorMap_BUTTON_NewColorCubeColorMap 1437
|
||||
#define IDC_ColorMap_BUTTON_NewColorRampColorMap 1438
|
||||
#define IDC_NewColorMap_COMBO_NewEntryColorName 1439
|
||||
#define IDC_NewColorMap_BUTTON_NewColorRampColorMap 1440
|
||||
#define IDC_NewColorMapRamp_EDIT_ColorRed 1441
|
||||
#define IDC_NewColorMapRamp_EDIT_ColorGreen 1442
|
||||
#define IDC_NewColorMapRamp_EDIT_ColorBlue 1443
|
||||
#define IDC_NewColorMapRamp_BUTTON_EditColor 1444
|
||||
#define IDC_NewColorRamp_EDIT_base_pixel 1445
|
||||
#define IDC_NewColorramp_EDIT_dimension 1446
|
||||
#define IDC_NewColorCube_EDIT_bluemult 1447
|
||||
#define IDC_NewColorCube_EDIT_base_pixel 1448
|
||||
#define IDC_NewColorCube_EDIT_bluemax 1449
|
||||
#define IDC_NewColorCube_EDIT_grennmult 1450
|
||||
#define IDC_NewColorCube_EDIT_greenmax 1451
|
||||
#define IDC_NewColorCube_EDIT_redmax 1452
|
||||
#define IDC_NewColorCube_EDIT_redmult 1453
|
||||
#define IDC_WidthMap_STATIC_Size 1454
|
||||
#define IDC_WidthMap_TAB 1455
|
||||
#define IDC_WidthMap_STATIC_EntryType 1456
|
||||
#define IDC_WidthMap_STATIC_EntryWidth 1457
|
||||
#define IDC_WidthMap_COMBO_NewEntryType 1458
|
||||
#define IDC_WidthMap_EDIT_NewEntryWidth 1459
|
||||
#define IDC_WidthMap_BUTTON_AddNewEntry 1460
|
||||
#define IDC_WidthMap_BUTTON_UpdateCurrentEntry 1461
|
||||
#define IDC_FontMap_STATIC_Size 1462
|
||||
#define IDC_FontMap_TAB 1463
|
||||
#define IDC_FontMap_STATIC_CurrentEntryValue 1464
|
||||
#define IDC_FontMap_STATIC_CurrentEntryType 1465
|
||||
#define IDC_FontMap_STATIC_CurrentEntrySize 1466
|
||||
#define IDC_FontMap_STATIC_CurrentEntrySlant 1467
|
||||
#define IDC_FontMap_BUTTON_NewEntry 1468
|
||||
#define IDC_FontMap_BUTTON_UpdateCurrent 1469
|
||||
#define IDC_FontMap_COMBO_NewEntryType 1470
|
||||
#define IDC_FontMap_EDIT_NewEntryValue 1471
|
||||
#define IDC_FontMap_EDIT_NewEntrySize 1472
|
||||
#define IDC_FontMap_EDIT_NewEntrySlant 1473
|
||||
#define IDC_FontMap_BUTTON_NewEntry_EditFont 1474
|
||||
#define IDC_TypeMap_STATIC_Size 1475
|
||||
#define IDC_TypeMap_TAB 1476
|
||||
#define IDC_TypeMap_STATIC_CurrentEntryStyle 1477
|
||||
#define IDC_TypeMap_STATIC_CurrentEntryValue 1478
|
||||
#define IDC_TypeMap_COMBO_NewEntryStyle 1479
|
||||
#define IDC_TypeMap_EDIT_NewEntryValue 1480
|
||||
#define IDC_MarkMap_STATIC_Size 1481
|
||||
#define IDC_MarkMap_TAB 1482
|
||||
#define IDC_MarkMap_STATIC_CurrentEntryXValue 1483
|
||||
#define IDC_MarkMap_STATIC_CurrentEntryStyle 1484
|
||||
#define IDC_MarkMap_STATIC_CurrentEntryYValue 1485
|
||||
#define IDC_MarkMap_STATIC_CurrentEntrySValue 1486
|
||||
#define IDC_MarkMap_STATIC_CurrentEntryValue 1487
|
||||
#define ID_BUTTON32791 32791
|
||||
#define ID_BUTTON32793 32793
|
||||
#define ID_BUTTON_Test_MultiImages 32794
|
||||
#define ID_BUTTON_Test_Rect 32795
|
||||
#define ID_BUTTON_Test_Face 32796
|
||||
#define ID_BUTTON_Test_Curve 40016
|
||||
#define ID_FILE_NEW2 57601
|
||||
#define ID_FILE_OPEN2 57603
|
||||
#define ID_FILE_CLOSE2 57604
|
||||
#define ID_FILE_SAVE2 57605
|
||||
#define ID_FILE_SAVE_AS2 57606
|
||||
#define ID_WINDOW_NEW2 57652
|
||||
#define ID_WINDOW_ARRANGE2 57653
|
||||
#define ID_WINDOW_CASCADE2 57654
|
||||
#define ID_WINDOW_TILE_HORZ2 57655
|
||||
#define ID_WINDOW_TILE_VERT2 57656
|
||||
#define ID_WINDOW_SPLIT2 57657
|
||||
#define ID_APP_ABOUT2 57666
|
||||
#define ID_APP_EXIT2 57667
|
||||
#define ID_VIEW_TOOLBAR2 59394
|
||||
#define ID_VIEW_STATUS_BAR2 59395
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 179
|
||||
#define _APS_NEXT_COMMAND_VALUE 32797
|
||||
#define _APS_NEXT_CONTROL_VALUE 1100
|
||||
#define _APS_NEXT_SYMED_VALUE 170
|
||||
#endif
|
||||
#endif
|
6
samples/mfc/standard/03_Viewer2d/src/StdAfx.cpp
Executable file
@@ -0,0 +1,6 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// SampleViewer2d.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
158
samples/mfc/standard/03_Viewer2d/src/StdAfx.h
Executable file
@@ -0,0 +1,158 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdisp.h> // MFC OLE automation classes
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#pragma warning( disable : 4244 ) // Issue warning 4244
|
||||
#include "Standard_ShortReal.hxx"
|
||||
#pragma warning( default : 4244 ) // Issue warning 4244
|
||||
|
||||
#include <Standard.hxx>
|
||||
/*
|
||||
#ifndef Version15B
|
||||
# ifndef Version15D
|
||||
# ifndef Version20
|
||||
# define Version15B
|
||||
# endif // Version20
|
||||
# endif // Version15D
|
||||
#endif // Version15B
|
||||
|
||||
#pragma message ("=============================")
|
||||
#ifdef Version15B
|
||||
# pragma message ("Set the libs for version 1.5B")
|
||||
#endif // Version15B
|
||||
|
||||
#ifdef Version15D
|
||||
# pragma message ("Set the libs for version 1.5D")
|
||||
#endif // Version15D
|
||||
|
||||
#ifdef Version20
|
||||
# pragma message ("Set the libs for version 2.0 ")
|
||||
#endif // Version20
|
||||
#pragma message ("=============================")
|
||||
|
||||
#ifdef Version15B
|
||||
# pragma comment (lib,"TKTop.lib")
|
||||
# pragma comment (lib,"TShort.lib")
|
||||
# pragma comment (lib,"TColQuantity.lib")
|
||||
#endif
|
||||
|
||||
#ifdef Version15D
|
||||
# pragma comment (lib,"TKTop.lib")
|
||||
#endif
|
||||
|
||||
#ifdef Version20
|
||||
# pragma comment (lib,"TKTop1.lib")
|
||||
# pragma comment (lib,"TKTop2.lib")
|
||||
#endif
|
||||
|
||||
#pragma message ("Set the specific libs for the application")
|
||||
# pragma comment (lib,"TKGeom.lib")
|
||||
# pragma comment (lib,"TKGlt.lib")
|
||||
# pragma comment (lib,"TKGraphic.lib")
|
||||
# pragma comment (lib,"TKPrsMgr.lib")
|
||||
# pragma comment (lib,"TKViewers.lib")
|
||||
# pragma comment (lib,"gp.lib")
|
||||
# pragma comment (lib,"TKernel.lib")
|
||||
*/
|
||||
|
||||
#include <AIS_Circle.hxx>
|
||||
#include <AIS_Line.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_TextLabel.hxx>
|
||||
|
||||
#include <Aspect_TypeOfline.hxx>
|
||||
#include <Aspect_WidthOfline.hxx>
|
||||
#include <Aspect_Background.hxx>
|
||||
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Bnd_Box2d.hxx>
|
||||
#include <BndLib_Add2dCurve.hxx>
|
||||
|
||||
#include <GCE2d_MakeSegment.hxx>
|
||||
#include <GCPnts_TangentialDeflection.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <GeomTools_Curve2dSet.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_Texture1Dsegment.hxx>
|
||||
#include <gp_Ax2d.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <HLRAlgo_Projector.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_PlaneAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <SelectMgr_SelectableObject.hxx>
|
||||
#include <SelectMgr_SelectionManager.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_IStream.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_IStream.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <WNT_Window.hxx>
|
||||
|
||||
#include <..\res\resource.h>
|
||||
|
||||
class ISession2D_InteractiveObject;
|
||||
|
||||
class V3d_Viewer;
|
||||
class SelectMgr_SelectableObject;
|
||||
class TCollection_AsciiString;
|
||||
class gp_Pnt2d;
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
75
samples/mfc/standard/03_Viewer2d/src/Viewer2dApp.cpp
Executable file
@@ -0,0 +1,75 @@
|
||||
// Viewer2dApp.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "Viewer2dApp.h"
|
||||
|
||||
#include "OCC_MainFrame.h"
|
||||
#include "OCC_2dChildFrame.h"
|
||||
#include "Viewer2dDoc.h"
|
||||
#include "OCC_2dView.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CViewer2dApp construction
|
||||
|
||||
CViewer2dApp::CViewer2dApp() : OCC_App()
|
||||
{
|
||||
SampleName = "Viewer2d"; //for about dialog
|
||||
SetSamplePath (L"..\\..\\03_Viewer2d");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CViewer2dApp object
|
||||
|
||||
CViewer2dApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CViewer2dApp initialization
|
||||
|
||||
BOOL CViewer2dApp::InitInstance()
|
||||
{
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
|
||||
|
||||
// Register the application's document templates. Document templates
|
||||
// serve as the connection between documents, frame windows and views.
|
||||
|
||||
CMultiDocTemplate* pDocTemplate;
|
||||
pDocTemplate = new CMultiDocTemplate(
|
||||
IDR_2DTYPE,
|
||||
RUNTIME_CLASS(CViewer2dDoc),
|
||||
RUNTIME_CLASS(OCC_2dChildFrame),
|
||||
RUNTIME_CLASS(OCC_2dView));
|
||||
AddDocTemplate(pDocTemplate);
|
||||
|
||||
// create main MDI Frame window
|
||||
OCC_MainFrame* pMainFrame = new OCC_MainFrame;
|
||||
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
|
||||
return FALSE;
|
||||
m_pMainWnd = pMainFrame;
|
||||
|
||||
// Parse command line for standard shell commands, DDE, file open
|
||||
CCommandLineInfo cmdInfo;
|
||||
ParseCommandLine(cmdInfo);
|
||||
|
||||
// Dispatch commands specified on the command line
|
||||
if (!ProcessShellCommand(cmdInfo))
|
||||
return FALSE;
|
||||
|
||||
// The main window has been initialized, so show and update it.
|
||||
pMainFrame->ShowWindow(m_nCmdShow);
|
||||
pMainFrame->UpdateWindow();
|
||||
|
||||
return TRUE;
|
||||
}
|
30
samples/mfc/standard/03_Viewer2d/src/Viewer2dApp.h
Executable file
@@ -0,0 +1,30 @@
|
||||
// Viewer2dApp.h : main header file for the VIEWER2D application
|
||||
//
|
||||
|
||||
#if !defined(AFX_VIEWER2DAPP_H__45F76B43_423D_11D7_8612_0060B0EE281E__INCLUDED_)
|
||||
#define AFX_VIEWER2DAPP_H__45F76B43_423D_11D7_8612_0060B0EE281E__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <OCC_App.h>
|
||||
|
||||
class CViewer2dApp : public OCC_App
|
||||
{
|
||||
public:
|
||||
|
||||
CViewer2dApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CViewer2dApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif //(AFX_VIEWER2DAPP_H__45F76B43_423D_11D7_8612_0060B0EE281E__INCLUDED_)
|
405
samples/mfc/standard/03_Viewer2d/src/Viewer2dDoc.cpp
Executable file
@@ -0,0 +1,405 @@
|
||||
// Viewer2dDoc.cpp : implementation of the CViewer2dDoc class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Viewer2dDoc.h"
|
||||
#include "OCC_App.h"
|
||||
#include "Primitive\Sample2D_Markers.h"
|
||||
#include "Primitive\Sample2D_Face.h"
|
||||
#include "Primitive\Sample2D_Image.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CViewer2dDoc
|
||||
|
||||
IMPLEMENT_DYNCREATE(CViewer2dDoc, CDocument)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CViewer2dDoc, CDocument)
|
||||
//{{AFX_MSG_MAP(CViewer2dDoc)
|
||||
ON_COMMAND(ID_BUTTON_Test_Text, OnBUTTONTestText)
|
||||
ON_COMMAND(ID_BUTTON_Test_Markers, OnBUTTONTestMarkers)
|
||||
ON_COMMAND(ID_BUTTON_Test_Line, OnBUTTONTestLine)
|
||||
ON_COMMAND(ID_BUTTON_Erase, OnBUTTONErase)
|
||||
ON_COMMAND(ID_BUTTON_Test_Face, OnBUTTONTestFace)
|
||||
ON_COMMAND(ID_BUTTON_Test_Rect, OnBUTTONTestRect)
|
||||
ON_COMMAND(ID_BUTTON_Test_Curve, OnBUTTONTestCurve)
|
||||
ON_COMMAND(ID_BUTTON32793, OnBUTTONTestImage) // test image
|
||||
ON_COMMAND(ID_BUTTON_Test_MultiImages, OnBUTTONMultipleImage)
|
||||
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CViewer2dDoc construction/destruction
|
||||
|
||||
CViewer2dDoc::CViewer2dDoc()
|
||||
{
|
||||
}
|
||||
|
||||
CViewer2dDoc::~CViewer2dDoc()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CViewer2dDoc::AssertValid() const
|
||||
{
|
||||
CDocument::AssertValid();
|
||||
}
|
||||
|
||||
void CViewer2dDoc::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CDocument::Dump(dc);
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CViewer2dDoc commands
|
||||
|
||||
void CViewer2dDoc::OnBUTTONErase()
|
||||
{
|
||||
myAISContext->EraseAll (Standard_True);
|
||||
}
|
||||
|
||||
void CViewer2dDoc::OnBUTTONTestText()
|
||||
{
|
||||
int aColor = Quantity_NOC_MATRABLUE;
|
||||
for (Standard_Real j = 15; j <= 20; j++)
|
||||
{
|
||||
Handle(AIS_TextLabel) aText = new AIS_TextLabel();
|
||||
aText->SetText (TCollection_AsciiString ("font 0 scale ") + (j / 20.0));
|
||||
aText->SetPosition (gp_Pnt (0.0, 15.0 * (j - 15.0), 0.0));
|
||||
aText->SetAngle (30.0 * M_PI / 180.0);
|
||||
aText->SetColor (Quantity_NameOfColor(aColor++));
|
||||
aText->SetFontAspect (Font_FA_Regular);
|
||||
aText->SetFont ("Courier");
|
||||
aText->SetHeight (j);
|
||||
aText->SetHJustification (Graphic3d_HTA_LEFT);
|
||||
aText->SetVJustification (Graphic3d_VTA_BOTTOM);
|
||||
aText->SetZoomable (Standard_False);
|
||||
myAISContext->Display(aText, Standard_False);
|
||||
}
|
||||
|
||||
for (Standard_Real j = 10; j <= 15; j++)
|
||||
{
|
||||
Handle(AIS_TextLabel) aText = new AIS_TextLabel();
|
||||
aText->SetText (TCollection_AsciiString ("font 1 scale ") + (j / 10.0));
|
||||
aText->SetPosition (gp_Pnt (80.0, 15.0 * (j - 10.0), 0.0));
|
||||
aText->SetAngle (0.0);
|
||||
aText->SetColor (Quantity_NameOfColor(aColor++));
|
||||
aText->SetFontAspect (Font_FA_BoldItalic);
|
||||
aText->SetFont ("Cambria");
|
||||
aText->SetHeight (j * 2);
|
||||
aText->SetHJustification (Graphic3d_HTA_LEFT);
|
||||
aText->SetVJustification (Graphic3d_VTA_BOTTOM);
|
||||
aText->SetZoomable (Standard_False);
|
||||
myAISContext->Display(aText, Standard_False);
|
||||
}
|
||||
|
||||
aColor = Quantity_NOC_MATRABLUE;
|
||||
for (Standard_Real j = 5; j <= 10; j++)
|
||||
{
|
||||
Handle(AIS_TextLabel) aText = new AIS_TextLabel();
|
||||
aText->SetText (TCollection_AsciiString ("font 2 scale ") + (j / 10.0));
|
||||
aText->SetPosition (gp_Pnt (140.0, 15.0 * (j - 5.0), 0.0));
|
||||
aText->SetAngle (0.0);
|
||||
aText->SetColor (Quantity_NameOfColor(aColor++));
|
||||
aText->SetFontAspect (Font_FA_Bold);
|
||||
aText->SetFont ("Arial");
|
||||
aText->SetHeight (j * 2);
|
||||
aText->SetHJustification (Graphic3d_HTA_LEFT);
|
||||
aText->SetVJustification (Graphic3d_VTA_BOTTOM);
|
||||
aText->SetZoomable (Standard_False);
|
||||
myAISContext->Display(aText, Standard_False);
|
||||
}
|
||||
for (Standard_Real j = 10; j <= 15; j++)
|
||||
{
|
||||
Handle(AIS_TextLabel) aText = new AIS_TextLabel();
|
||||
aText->SetText (TCollection_AsciiString ("font 3 scale ") + (j / 10.0));
|
||||
aText->SetPosition (gp_Pnt (200.0, 15.0 * (j - 10.0), 0.0));
|
||||
aText->SetAngle (0.0);
|
||||
aText->SetColor (Quantity_NameOfColor(aColor++));
|
||||
aText->SetFontAspect (Font_FA_Italic);
|
||||
aText->SetFont ("Georgia");
|
||||
aText->SetHeight (j * 2);
|
||||
aText->SetHJustification (Graphic3d_HTA_LEFT);
|
||||
aText->SetVJustification (Graphic3d_VTA_BOTTOM);
|
||||
aText->SetZoomable (Standard_False);
|
||||
myAISContext->Display(aText, Standard_False);
|
||||
}
|
||||
|
||||
FitAll2DViews(Standard_True); // Update Viewer
|
||||
}
|
||||
|
||||
|
||||
void CViewer2dDoc::OnBUTTONTestMarkers()
|
||||
{
|
||||
// generic Markers
|
||||
Standard_Integer aColor = 20;
|
||||
for (int i=1;i<=2;i++)
|
||||
{
|
||||
Handle (Sample2D_Markers) aMarker =
|
||||
new Sample2D_Markers(10+5,5*i,Aspect_TOM_POINT,Quantity_NOC_YELLOW,2.0);
|
||||
myAISContext->Display(aMarker, Standard_False);
|
||||
}
|
||||
for (int i=1;i<=2;i++)
|
||||
{
|
||||
Handle (Sample2D_Markers) aMarker =
|
||||
new Sample2D_Markers(10+10,5*i,Aspect_TOM_O,(Quantity_NameOfColor)(aColor++));
|
||||
myAISContext->Display(aMarker, Standard_False);
|
||||
}
|
||||
for (int i=1;i<=2;i++)
|
||||
{
|
||||
Handle (Sample2D_Markers) aMarker =
|
||||
new Sample2D_Markers(10+15,5*i,Aspect_TOM_O_PLUS,(Quantity_NameOfColor)(aColor++));
|
||||
myAISContext->Display(aMarker, Standard_False);
|
||||
}
|
||||
for (int i=1;i<=2;i++)
|
||||
{
|
||||
Handle (Sample2D_Markers) aMarker =
|
||||
new Sample2D_Markers(10+20,5*i,Aspect_TOM_RING1,(Quantity_NameOfColor)(aColor++));
|
||||
myAISContext->Display(aMarker, Standard_False);
|
||||
}
|
||||
for (int i=1;i<=2;i++)
|
||||
{
|
||||
|
||||
Handle (Sample2D_Markers) aMarker =
|
||||
new Sample2D_Markers(10+25,5*i,Aspect_TOM_STAR,(Quantity_NameOfColor)(aColor++));
|
||||
myAISContext->Display(aMarker, Standard_False);
|
||||
}
|
||||
for (int i=1;i<=2;i++)
|
||||
{
|
||||
Handle (Sample2D_Markers) aMarker =
|
||||
new Sample2D_Markers(10+30,5*i,Aspect_TOM_O_X,(Quantity_NameOfColor)(aColor++));
|
||||
myAISContext->Display(aMarker, Standard_False);
|
||||
}
|
||||
|
||||
FitAll2DViews(Standard_False); // Update Viewer
|
||||
}
|
||||
void CViewer2dDoc::OnBUTTONTestLine()
|
||||
{
|
||||
for (int i=0;i<=13;++i)
|
||||
for (int j=0;j<=5;++j)
|
||||
{
|
||||
//set of rectangles here
|
||||
TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(gp_Pnt(10*i,10*j,0.), gp_Pnt(10*i+7,10*j,0.));
|
||||
TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(gp_Pnt(10*i+7,10*j,0.), gp_Pnt(10*i+7,10*j+5,0.));
|
||||
TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(gp_Pnt(10*i+7,10*j+5,0.), gp_Pnt(10*i,10*j+5,0.));
|
||||
TopoDS_Edge E4 = BRepBuilderAPI_MakeEdge(gp_Pnt(10*i,10*j+5,0.), gp_Pnt(10*i,10*j,0.));
|
||||
TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3,E4);
|
||||
TopoDS_Face F = BRepBuilderAPI_MakeFace(W);
|
||||
Handle(AIS_Shape) aRect = new AIS_Shape(F);
|
||||
//set attributes of boundaries
|
||||
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
|
||||
Handle(Prs3d_LineAspect) aLineAttrib =
|
||||
new Prs3d_LineAspect(Quantity_NOC_YELLOW,
|
||||
(Aspect_TypeOfLine)(Aspect_TOL_SOLID+j),1);
|
||||
aDrawer->SetFaceBoundaryAspect(aLineAttrib);
|
||||
aDrawer->SetFaceBoundaryDraw(Standard_True);
|
||||
aRect->SetAttributes(aDrawer);
|
||||
|
||||
myAISContext->SetDisplayMode (aRect, 1, Standard_False);
|
||||
myAISContext->SetColor(aRect,(Quantity_NameOfColor)(Quantity_NOC_CADETBLUE+2*i),Standard_False);
|
||||
myAISContext->SetMaterial(aRect,Graphic3d_NOM_PLASTIC,Standard_False);
|
||||
myAISContext->Display(aRect, Standard_False);
|
||||
|
||||
}
|
||||
this->FitAll2DViews(Standard_True);
|
||||
}
|
||||
|
||||
|
||||
#include <AIS_Trihedron.hxx>
|
||||
#include <Geom_Axis2Placement.hxx>
|
||||
|
||||
void CViewer2dDoc::OnBUTTONTestFace()
|
||||
{
|
||||
//erase all
|
||||
myAISContext->EraseAll (Standard_True);
|
||||
|
||||
CFileDialog dlg(TRUE,
|
||||
NULL,
|
||||
NULL,
|
||||
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
L"BRep Files (*.brep)|*.brep; ||",
|
||||
NULL );
|
||||
|
||||
CString initdir;
|
||||
initdir.GetEnvironmentVariable (L"CSF_OCCTDataPath");
|
||||
initdir += L"\\occ";
|
||||
|
||||
dlg.m_ofn.lpstrInitialDir = initdir;
|
||||
|
||||
if (dlg.DoModal() == IDOK)
|
||||
{
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
|
||||
|
||||
std::filebuf aFileBuf;
|
||||
std::istream aStream (&aFileBuf);
|
||||
if (!aFileBuf.open (dlg.GetPathName(), std::ios::in))
|
||||
{
|
||||
AfxMessageBox (L"The shape must be not a null Face");
|
||||
return;
|
||||
}
|
||||
|
||||
TopoDS_Shape aFaceShape;
|
||||
BRep_Builder aBuilder;
|
||||
BRepTools::Read (aFaceShape, aStream, aBuilder);
|
||||
if(aFaceShape.IsNull() || aFaceShape.ShapeType() != TopAbs_FACE)
|
||||
{
|
||||
AfxMessageBox (L"The shape must be not a null Face");
|
||||
return;
|
||||
}
|
||||
|
||||
TopoDS_Face aFace = TopoDS::Face(aFaceShape);
|
||||
Handle(Sample2D_Face) anAISFace = new Sample2D_Face(aFaceShape);
|
||||
myAISContext->Display(anAISFace,Standard_True);
|
||||
//activate selection mode for edges selection
|
||||
myAISContext->Activate(anAISFace,2);
|
||||
|
||||
FitAll2DViews(Standard_False);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CViewer2dDoc::OnBUTTONTestRect()
|
||||
{
|
||||
//First rectangle
|
||||
TopoDS_Edge E11 = BRepBuilderAPI_MakeEdge(gp_Pnt(40.,0.,0.), gp_Pnt(82.5,25.,0.));
|
||||
TopoDS_Edge E12 = BRepBuilderAPI_MakeEdge(gp_Pnt(82.5,25.,0.), gp_Pnt(42.5,93.,0.));
|
||||
TopoDS_Edge E13 = BRepBuilderAPI_MakeEdge(gp_Pnt(42.5,93.,0.), gp_Pnt(0.,68.,0.));
|
||||
TopoDS_Edge E14 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,68.,0.), gp_Pnt(40.,0.,0.));
|
||||
TopoDS_Wire W1 = BRepBuilderAPI_MakeWire(E11,E12,E13,E14);
|
||||
Handle(AIS_Shape) aRect1 = new AIS_Shape(W1);
|
||||
myAISContext->Display (aRect1, Standard_False);
|
||||
myAISContext->SetColor (aRect1, Quantity_NOC_YELLOW, Standard_False);
|
||||
|
||||
//Second rectangle
|
||||
TopoDS_Edge E21 = BRepBuilderAPI_MakeEdge(gp_Pnt(110.,0.,0.), gp_Pnt(152.5,25.,0.));
|
||||
TopoDS_Edge E22 = BRepBuilderAPI_MakeEdge(gp_Pnt(152.5,25.,0.), gp_Pnt(112.5,93.,0.));
|
||||
TopoDS_Edge E23 = BRepBuilderAPI_MakeEdge(gp_Pnt(112.5,93.,0.), gp_Pnt(70.,68.,0.));
|
||||
TopoDS_Edge E24 = BRepBuilderAPI_MakeEdge(gp_Pnt(70.,68.,0.), gp_Pnt(110.,0.,0.));
|
||||
TopoDS_Wire W2 = BRepBuilderAPI_MakeWire(E21,E22,E23,E24);
|
||||
Handle(AIS_Shape) aRect2 = new AIS_Shape(W2);
|
||||
myAISContext->Display (aRect2, Standard_False);
|
||||
myAISContext->SetColor (aRect2, Quantity_NOC_YELLOW, Standard_False);
|
||||
myAISContext->Activate(aRect2,2);
|
||||
|
||||
FitAll2DViews(Standard_True); // Update Viewer
|
||||
}
|
||||
|
||||
void CViewer2dDoc::OnBUTTONTestCurve()
|
||||
{
|
||||
for(int i=0;i<=5;++i)
|
||||
for(int j=0;j<=5;++j)
|
||||
{
|
||||
Handle(Geom_Point) aStart = new Geom_CartesianPoint(gp_Pnt(10*i,10*j,0.));
|
||||
Handle(Geom_Point) anEnd = new Geom_CartesianPoint(gp_Pnt(10*i+5,10*j+10,0.));
|
||||
Handle(AIS_Line) aLine = new AIS_Line(aStart,anEnd);
|
||||
Handle(Prs3d_LineAspect) aLineAttrib =
|
||||
new Prs3d_LineAspect((Quantity_NameOfColor)(Quantity_NOC_CADETBLUE+2*i+2*j),
|
||||
(Aspect_TypeOfLine)((Aspect_TOL_DASH+i+j)%5),2+i+j);
|
||||
aLine->Attributes()->SetLineAspect(aLineAttrib);
|
||||
myAISContext->Display(aLine,Standard_False);
|
||||
}
|
||||
FitAll2DViews(Standard_True);
|
||||
}
|
||||
|
||||
void CViewer2dDoc::OnBUTTONTestImage()
|
||||
{
|
||||
CFileDialog anOpenImageDlg (TRUE,
|
||||
NULL,
|
||||
NULL,
|
||||
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
SupportedImageFormats() + L"| all files (*.*)|*.*;||",
|
||||
NULL);
|
||||
|
||||
CString anInitDir;
|
||||
anInitDir.GetEnvironmentVariable (L"CASROOT");
|
||||
anInitDir += L"\\data\\images";
|
||||
|
||||
anOpenImageDlg.m_ofn.lpstrInitialDir = anInitDir;
|
||||
if(anOpenImageDlg.DoModal() == IDOK)
|
||||
{
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor (IDC_WAIT));
|
||||
CString aFilePath = anOpenImageDlg.GetPathName();
|
||||
TCollection_AsciiString aFileName ((const wchar_t* )aFilePath);
|
||||
|
||||
//erase viewer
|
||||
myAISContext->EraseAll (Standard_False);
|
||||
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (40,50) ;
|
||||
anImage->SetScale (1.0);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
FitAll2DViews (Standard_True);
|
||||
}
|
||||
}
|
||||
|
||||
void CViewer2dDoc::OnBUTTONMultipleImage()
|
||||
{
|
||||
CFileDialog anOpenImageDlg (TRUE,
|
||||
NULL,
|
||||
NULL,
|
||||
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
SupportedImageFormats() + L"| all files (*.*)|*.*;||",
|
||||
NULL);
|
||||
|
||||
CString anInitDir;
|
||||
anInitDir.GetEnvironmentVariable (L"CASROOT");
|
||||
anInitDir += L"\\data\\images";
|
||||
|
||||
anOpenImageDlg.m_ofn.lpstrInitialDir = anInitDir;
|
||||
|
||||
if (anOpenImageDlg.DoModal() == IDOK)
|
||||
{
|
||||
SetCursor(AfxGetApp()->LoadStandardCursor (IDC_WAIT));
|
||||
CString aFilePath = anOpenImageDlg.GetPathName();
|
||||
TCollection_AsciiString aFileName ((const wchar_t* )aFilePath);
|
||||
|
||||
//erase viewer
|
||||
myAISContext->EraseAll (Standard_False);
|
||||
|
||||
//create images
|
||||
{ // 1
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (40, 50);
|
||||
anImage->SetScale (0.5);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 2
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (100, 50);
|
||||
anImage->SetScale (0.9);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 3
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (40, 40);
|
||||
anImage->SetScale (0.3);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 4
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (50, 40);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 5
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (80, 45);
|
||||
anImage->SetScale (2);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 6
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (20, -20);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
{ // 7
|
||||
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
|
||||
anImage->SetCoord (0, 0);
|
||||
anImage->SetScale (0.5);
|
||||
myAISContext->Display (anImage, AIS_Shaded, 0, Standard_False);
|
||||
}
|
||||
FitAll2DViews (Standard_True); // Update Viewer
|
||||
}
|
||||
}
|
42
samples/mfc/standard/03_Viewer2d/src/Viewer2dDoc.h
Executable file
@@ -0,0 +1,42 @@
|
||||
// Viewer2dDoc.h : interface of the CViewer2dDoc class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include "OCC_2dDoc.h"
|
||||
|
||||
|
||||
class CViewer2dDoc : public OCC_2dDoc
|
||||
{
|
||||
protected: // create from serialization only
|
||||
CViewer2dDoc();
|
||||
DECLARE_DYNCREATE(CViewer2dDoc)
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CViewer2dDoc();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CViewer2dDoc)
|
||||
afx_msg void OnBUTTONTestText();
|
||||
afx_msg void OnBUTTONTestMarkers();
|
||||
afx_msg void OnBUTTONTestLine();
|
||||
afx_msg void OnBUTTONErase();
|
||||
afx_msg void OnBUTTONTestFace();
|
||||
afx_msg void OnBUTTONTestRect();
|
||||
afx_msg void OnBUTTONTestCurve();
|
||||
afx_msg void OnBUTTONTestImage();
|
||||
afx_msg void OnBUTTONMultipleImage();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
};
|
||||
|
77
samples/mfc/standard/04_Viewer3d/CMakeLists.txt
Normal file
@@ -0,0 +1,77 @@
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
|
||||
project (Viewer3d)
|
||||
|
||||
add_definitions (-DWINVER=0x0501 -DUNICODE -D_UNICODE)
|
||||
set (CMAKE_MFC_FLAG 2)
|
||||
|
||||
set (Viewer3d_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_Viewer3d/src)
|
||||
set (Viewer3d_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_Viewer3d/res)
|
||||
set (Viewer3d_HEADER_FILES ${Viewer3d_SRC_DIR}/BoxRadius.h
|
||||
${Viewer3d_SRC_DIR}/DlgIsos.h
|
||||
${Viewer3d_SRC_DIR}/ISession_Curve.h
|
||||
${Viewer3d_SRC_DIR}/ModelClippingDlg.h
|
||||
${Viewer3d_SRC_DIR}/OCCDemo_Presentation.h
|
||||
${Viewer3d_SRC_DIR}/OffsetDlg.h
|
||||
${Viewer3d_SRC_DIR}/ScaleDlg.h
|
||||
${Viewer3d_SRC_DIR}/ShadingModelDlg.h
|
||||
${Viewer3d_SRC_DIR}/StdAfx.h
|
||||
${Viewer3d_SRC_DIR}/TexturesExt_Presentation.h
|
||||
${Viewer3d_SRC_DIR}/TrihedronDlg.h
|
||||
${Viewer3d_SRC_DIR}/Viewer3dApp.h
|
||||
${Viewer3d_SRC_DIR}/Viewer3dDoc.h
|
||||
${Viewer3d_SRC_DIR}/Viewer3dView.h
|
||||
${Viewer3d_SRC_DIR}/State.h
|
||||
${Viewer3d_RESOURCE_DIR}/resource.h
|
||||
${Viewer3d_RESOURCE_DIR}/resource.hm)
|
||||
set (Viewer3d_SOURCE_FILES ${Viewer3d_SRC_DIR}/BoxRadius.cpp
|
||||
${Viewer3d_SRC_DIR}/DlgIsos.cpp
|
||||
${Viewer3d_SRC_DIR}/ISession_Curve.cpp
|
||||
${Viewer3d_SRC_DIR}/ModelClippingDlg.cpp
|
||||
${Viewer3d_SRC_DIR}/OCCDemo_Presentation.cpp
|
||||
${Viewer3d_SRC_DIR}/OffsetDlg.cpp
|
||||
${Viewer3d_SRC_DIR}/ScaleDlg.cpp
|
||||
${Viewer3d_SRC_DIR}/ShadingModelDlg.cpp
|
||||
${Viewer3d_SRC_DIR}/StdAfx.cpp
|
||||
${Viewer3d_SRC_DIR}/TexturesExt_Presentation.cpp
|
||||
${Viewer3d_SRC_DIR}/TrihedronDlg.cpp
|
||||
${Viewer3d_SRC_DIR}/Viewer3dApp.cpp
|
||||
${Viewer3d_SRC_DIR}/Viewer3dDoc.cpp
|
||||
${Viewer3d_SRC_DIR}/Viewer3dView.cpp)
|
||||
|
||||
set (Viewer3d_RESOURCE_FILES ${Viewer3d_RESOURCE_DIR}/Viewer3d.rc
|
||||
${Viewer3d_RESOURCE_DIR}/AISToolbar.bmp
|
||||
${Viewer3d_RESOURCE_DIR}/AIS_TB.bmp
|
||||
${Viewer3d_RESOURCE_DIR}/Toolbar.bmp)
|
||||
|
||||
# groups in the VS solution
|
||||
source_group ("Source Files" FILES ${Viewer3d_SOURCE_FILES}
|
||||
${COMMON_WINMAIN_FILE})
|
||||
|
||||
source_group ("Header Files" FILES ${Viewer3d_HEADER_FILES})
|
||||
|
||||
source_group ("Resource Files" FILES ${Viewer3d_RESOURCE_FILES})
|
||||
|
||||
add_executable (Viewer3d WIN32 ${Viewer3d_SOURCE_FILES}
|
||||
${Viewer3d_HEADER_FILES}
|
||||
${COMMON_WINMAIN_FILE}
|
||||
${Viewer3d_RESOURCE_FILES})
|
||||
|
||||
set_property (TARGET Viewer3d PROPERTY FOLDER "Samples/mfc")
|
||||
|
||||
if (SINGLE_GENERATOR)
|
||||
install (TARGETS Viewer3d DESTINATION "${INSTALL_DIR_BIN}")
|
||||
else()
|
||||
install (TARGETS Viewer3d
|
||||
CONFIGURATIONS Release RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR_BIN}")
|
||||
install (TARGETS Viewer3d
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR_BIN}d")
|
||||
endif()
|
||||
|
||||
include_directories (${CMAKE_BINARY_DIR}/inc
|
||||
${Viewer3d_SRC_DIR}
|
||||
${MFC_STANDARD_SAMPLES_DIR}/Common)
|
||||
|
||||
target_link_libraries (Viewer3d mfcsample)
|