mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3f53006c35 | ||
|
f9b30c0db3 | ||
|
a5278fc126 | ||
|
74413ca7d3 | ||
|
98e6c6d17b | ||
|
9491df8c1b | ||
|
d325cb7f57 | ||
|
24ee60ffd7 | ||
|
cea8d5c1ab | ||
|
fc867b96a5 | ||
|
aafe169f89 | ||
|
84b904bc36 | ||
|
33defc7121 | ||
|
2a0522b1c6 | ||
|
8693dfd0e8 | ||
|
a738b534ca | ||
|
f996b507d8 | ||
|
d9166000fe | ||
|
3697d4fa2f | ||
|
4bcd07385e | ||
|
d84b49c743 | ||
|
aff73fd598 | ||
|
afb3647b34 | ||
|
2328cae25d | ||
|
85831628d6 | ||
|
667b5eb81b | ||
|
de07af824b | ||
|
cb6cad7df1 | ||
|
ad67e36766 | ||
|
18434846a3 | ||
|
43c8661e5e | ||
|
404504b234 | ||
|
d65f9183fd | ||
|
6b121e2b48 | ||
|
437ef7713e | ||
|
737e9a8da4 | ||
|
ad4b04291f | ||
|
e9fb0cba58 | ||
|
f2b42160f4 | ||
|
6072d5975a | ||
|
85c103d277 | ||
|
31fe1f8ec4 | ||
|
5716d13b43 | ||
|
a7fd4b1bb0 | ||
|
226fce20f0 | ||
|
ac8f17746b | ||
|
a98b97f5da | ||
|
c3c2b331cd | ||
|
af2fa459f1 |
@@ -86,6 +86,11 @@ if (BUILD_WITH_DEBUG)
|
|||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# option disabling OCCT exceptions in Release builds (No_Exception)
|
||||||
|
if (NOT DEFINED BUILD_RELEASE_DISABLE_EXCEPTIONS)
|
||||||
|
set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# option to enable or disable use of precompiled headers
|
# option to enable or disable use of precompiled headers
|
||||||
if (NOT DEFINED BUILD_USE_PCH)
|
if (NOT DEFINED BUILD_USE_PCH)
|
||||||
set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}")
|
set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}")
|
||||||
|
1
adm/.gitignore
vendored
Normal file
1
adm/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build-*
|
@@ -203,6 +203,7 @@ n Aspect
|
|||||||
n DsgPrs
|
n DsgPrs
|
||||||
n Graphic3d
|
n Graphic3d
|
||||||
n Image
|
n Image
|
||||||
|
n Media
|
||||||
n MeshVS
|
n MeshVS
|
||||||
n OpenGl
|
n OpenGl
|
||||||
n D3DHost
|
n D3DHost
|
||||||
|
@@ -65,6 +65,7 @@ if (WIN32)
|
|||||||
set (CSF_shell32 "shell32.lib")
|
set (CSF_shell32 "shell32.lib")
|
||||||
set (CSF_wsock32 "wsock32.lib")
|
set (CSF_wsock32 "wsock32.lib")
|
||||||
set (CSF_psapi "psapi.lib")
|
set (CSF_psapi "psapi.lib")
|
||||||
|
set (CSF_winmm "winmm.lib")
|
||||||
set (CSF_d3d9 "D3D9.lib")
|
set (CSF_d3d9 "D3D9.lib")
|
||||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
|
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
|
||||||
set (CSF_OpenGlLibs "libEGL libGLESv2")
|
set (CSF_OpenGlLibs "libEGL libGLESv2")
|
||||||
|
@@ -143,5 +143,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|||||||
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
|
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
if (BUILD_RELEASE_DISABLE_EXCEPTIONS)
|
||||||
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
||||||
|
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
||||||
|
endif()
|
||||||
|
@@ -28,6 +28,11 @@ Applies only for Debug configuration.")
|
|||||||
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
|
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
|
||||||
"Append the postfix to names of output libraries")
|
"Append the postfix to names of output libraries")
|
||||||
|
|
||||||
|
set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR
|
||||||
|
"Disables exceptions like Standard_OutOfRange in Release builds.
|
||||||
|
Defines No_Exception macros for Release builds when enabled (default).
|
||||||
|
These exceptions are always enabled in Debug builds, but disable in Release for better performance")
|
||||||
|
|
||||||
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
|
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
|
||||||
"Enable/Disable the floating point exceptions (FPE) during DRAW execution only.
|
"Enable/Disable the floating point exceptions (FPE) during DRAW execution only.
|
||||||
Corresponding environment variable (CSF_FPE) can be changed manually
|
Corresponding environment variable (CSF_FPE) can be changed manually
|
||||||
|
@@ -30,10 +30,30 @@ set aRowIter 0
|
|||||||
set aCheckRowIter 0
|
set aCheckRowIter 0
|
||||||
frame .myFrame -padx 5 -pady 5
|
frame .myFrame -padx 5 -pady 5
|
||||||
pack .myFrame -fill both -expand 1
|
pack .myFrame -fill both -expand 1
|
||||||
|
frame .myFrame.myPrjFrame
|
||||||
frame .myFrame.myVsFrame
|
frame .myFrame.myVsFrame
|
||||||
frame .myFrame.myHxxChecks
|
frame .myFrame.myHxxChecks
|
||||||
frame .myFrame.myChecks
|
frame .myFrame.myChecks
|
||||||
|
|
||||||
|
# project file format
|
||||||
|
set SYS_PRJFMT_LIST {}
|
||||||
|
set SYS_PRJNAME_LIST {}
|
||||||
|
if { "$::tcl_platform(platform)" == "windows" } {
|
||||||
|
lappend ::SYS_PRJFMT_LIST "vcxproj"
|
||||||
|
lappend ::SYS_PRJNAME_LIST "Visual Studio (.vcxproj)"
|
||||||
|
}
|
||||||
|
if { "$tcl_platform(os)" == "Darwin" } {
|
||||||
|
lappend ::SYS_PRJFMT_LIST "xcd"
|
||||||
|
lappend ::SYS_PRJNAME_LIST "XCode (.xcd)"
|
||||||
|
}
|
||||||
|
lappend ::SYS_PRJFMT_LIST "cbp"
|
||||||
|
lappend ::SYS_PRJNAME_LIST "Code Blocks (.cbp)"
|
||||||
|
lappend ::SYS_PRJFMT_LIST "pro"
|
||||||
|
lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
|
||||||
|
|
||||||
|
set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
|
||||||
|
set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
|
||||||
|
|
||||||
set SYS_VS_LIST {}
|
set SYS_VS_LIST {}
|
||||||
set SYS_VC_LIST {}
|
set SYS_VC_LIST {}
|
||||||
set SYS_VCVARS_LIST {}
|
set SYS_VCVARS_LIST {}
|
||||||
@@ -101,6 +121,7 @@ proc wokdep:gui:Close {} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proc wokdep:gui:SwitchConfig {} {
|
proc wokdep:gui:SwitchConfig {} {
|
||||||
|
set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
|
||||||
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
|
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
|
||||||
set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
|
set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
|
||||||
|
|
||||||
@@ -390,6 +411,8 @@ proc wokdep:gui:Show64Bitness { theRowIter } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
|
ttk::label .myFrame.myPrjFrame.myPrjLbl -text "Project format:" -padding {5 5 20 5}
|
||||||
|
ttk::combobox .myFrame.myPrjFrame.myPrjCombo -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
|
||||||
ttk::label .myFrame.myVsFrame.myVsLbl -text "Visual Studio configuration:" -padding {5 5 20 5}
|
ttk::label .myFrame.myVsFrame.myVsLbl -text "Visual Studio configuration:" -padding {5 5 20 5}
|
||||||
ttk::combobox .myFrame.myVsFrame.myVsCombo -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
|
ttk::combobox .myFrame.myVsFrame.myVsCombo -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
|
||||||
ttk::combobox .myFrame.myVsFrame.myArchCombo -values { {32} {64} } -textvariable ARCH -state readonly -width 6
|
ttk::combobox .myFrame.myVsFrame.myArchCombo -values { {32} {64} } -textvariable ARCH -state readonly -width 6
|
||||||
@@ -494,6 +517,10 @@ ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
|
|||||||
|
|
||||||
# Create grid
|
# Create grid
|
||||||
# Header
|
# Header
|
||||||
|
grid .myFrame.myPrjFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
|
||||||
|
grid .myFrame.myPrjFrame.myPrjLbl -row 0 -column 0
|
||||||
|
grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
|
||||||
|
incr aRowIter
|
||||||
if { "$tcl_platform(platform)" == "windows" } {
|
if { "$tcl_platform(platform)" == "windows" } {
|
||||||
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
|
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
|
||||||
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
|
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
|
||||||
@@ -592,6 +619,9 @@ grid .myFrame.mySave -row $aRowIter -column 4 -columnspan 2
|
|||||||
grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
|
grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
|
||||||
|
|
||||||
# Bind events
|
# Bind events
|
||||||
|
bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
|
||||||
|
wokdep:gui:SwitchConfig
|
||||||
|
}
|
||||||
bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
|
bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
|
||||||
wokdep:gui:SwitchConfig
|
wokdep:gui:SwitchConfig
|
||||||
}
|
}
|
||||||
|
@@ -27,8 +27,10 @@ if { "$tcl_platform(platform)" == "unix" } {
|
|||||||
set SYS_EXE_SUFFIX ""
|
set SYS_EXE_SUFFIX ""
|
||||||
if { "$tcl_platform(os)" == "Darwin" } {
|
if { "$tcl_platform(os)" == "Darwin" } {
|
||||||
set SYS_LIB_SUFFIX "dylib"
|
set SYS_LIB_SUFFIX "dylib"
|
||||||
|
set PRJFMT "xcd"
|
||||||
} else {
|
} else {
|
||||||
set SYS_LIB_SUFFIX "so"
|
set SYS_LIB_SUFFIX "so"
|
||||||
|
set PRJFMT "cbp"
|
||||||
}
|
}
|
||||||
set VCVER "gcc"
|
set VCVER "gcc"
|
||||||
set VCVARS ""
|
set VCVARS ""
|
||||||
@@ -39,6 +41,7 @@ if { "$tcl_platform(platform)" == "unix" } {
|
|||||||
set SYS_EXE_SUFFIX ".exe"
|
set SYS_EXE_SUFFIX ".exe"
|
||||||
set VCVER "vc10"
|
set VCVER "vc10"
|
||||||
set VCVARS ""
|
set VCVARS ""
|
||||||
|
set PRJFMT "vcxproj"
|
||||||
}
|
}
|
||||||
|
|
||||||
set SHORTCUT_HEADERS "ShortCut"
|
set SHORTCUT_HEADERS "ShortCut"
|
||||||
@@ -82,7 +85,7 @@ if { "$tcl_platform(platform)" != "windows" } {
|
|||||||
set HAVE_D3D ""
|
set HAVE_D3D ""
|
||||||
set HAVE_RelWithDebInfo ""
|
set HAVE_RelWithDebInfo ""
|
||||||
}
|
}
|
||||||
foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
|
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT PRODUCTS_PATH} {
|
||||||
if { [info exists ::env(${anEnvIter})] } {
|
if { [info exists ::env(${anEnvIter})] } {
|
||||||
set ${anEnvIter} "$::env(${anEnvIter})"
|
set ${anEnvIter} "$::env(${anEnvIter})"
|
||||||
}
|
}
|
||||||
@@ -1118,15 +1121,33 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
|
|||||||
return "$isFound"
|
return "$isFound"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Returns OCCT version string from file Standard_Version.hxx (if available)
|
||||||
|
proc wokdep:DetectCasVersion {} {
|
||||||
|
set occt_ver 7.0.0
|
||||||
|
set aCasRoot [file normalize [file dirname [info script]]]
|
||||||
|
set filename "${aCasRoot}/src/Standard/Standard_Version.hxx"
|
||||||
|
if { [file exists $filename] } {
|
||||||
|
set fh [open $filename "r"]
|
||||||
|
set fh_loaded [read $fh]
|
||||||
|
close $fh
|
||||||
|
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
|
||||||
|
} else {
|
||||||
|
puts "Error: file '$filename' not found"
|
||||||
|
}
|
||||||
|
return $occt_ver
|
||||||
|
}
|
||||||
|
|
||||||
# Generate (override) custom environment file
|
# Generate (override) custom environment file
|
||||||
proc wokdep:SaveCustom {} {
|
proc wokdep:SaveCustom {} {
|
||||||
|
set aGenInfo "This environment file was generated by genconf.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
|
||||||
if { "$::tcl_platform(platform)" == "windows" } {
|
if { "$::tcl_platform(platform)" == "windows" } {
|
||||||
set aCustomFilePath "./custom.bat"
|
set aCustomFilePath "./custom.bat"
|
||||||
set aFile [open $aCustomFilePath "w"]
|
set aFile [open $aCustomFilePath "w"]
|
||||||
puts $aFile "@echo off"
|
puts $aFile "@echo off"
|
||||||
puts $aFile "rem This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
|
puts $aFile "rem $aGenInfo"
|
||||||
|
|
||||||
puts $aFile ""
|
puts $aFile ""
|
||||||
|
puts $aFile "set PRJFMT=$::PRJFMT"
|
||||||
puts $aFile "set VCVER=$::VCVER"
|
puts $aFile "set VCVER=$::VCVER"
|
||||||
puts $aFile "set ARCH=$::ARCH"
|
puts $aFile "set ARCH=$::ARCH"
|
||||||
puts $aFile "set VCVARS=$::VCVARS"
|
puts $aFile "set VCVARS=$::VCVARS"
|
||||||
@@ -1175,9 +1196,10 @@ proc wokdep:SaveCustom {} {
|
|||||||
set aCustomFilePath "./custom.sh"
|
set aCustomFilePath "./custom.sh"
|
||||||
set aFile [open $aCustomFilePath "w"]
|
set aFile [open $aCustomFilePath "w"]
|
||||||
puts $aFile "#!/bin/bash"
|
puts $aFile "#!/bin/bash"
|
||||||
puts $aFile "# This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
|
puts $aFile "# $aGenInfo"
|
||||||
|
|
||||||
puts $aFile ""
|
puts $aFile ""
|
||||||
|
puts $aFile "export PRJFMT=$::PRJFMT"
|
||||||
puts $aFile "export ARCH=$::ARCH"
|
puts $aFile "export ARCH=$::ARCH"
|
||||||
puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
|
puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
|
||||||
|
|
||||||
@@ -1211,6 +1233,52 @@ proc wokdep:SaveCustom {} {
|
|||||||
|
|
||||||
close $aFile
|
close $aFile
|
||||||
}
|
}
|
||||||
|
|
||||||
puts "Configuration saved to file '$aCustomFilePath'"
|
puts "Configuration saved to file '$aCustomFilePath'"
|
||||||
|
|
||||||
|
if { "$::PRJFMT" == "pro" } {
|
||||||
|
set aCasVer [wokdep:DetectCasVersion]
|
||||||
|
set aCustomFilePath "./adm/qmake/custom.auto.pri"
|
||||||
|
set aFile [open $aCustomFilePath "w"]
|
||||||
|
puts $aFile "# $aGenInfo"
|
||||||
|
|
||||||
|
puts $aFile ""
|
||||||
|
puts $aFile "VERSION=$aCasVer"
|
||||||
|
puts $aFile "PRODUCTS_PATH=\"$::PRODUCTS_PATH\""
|
||||||
|
|
||||||
|
puts $aFile ""
|
||||||
|
puts $aFile "# Optional 3rd-parties switches"
|
||||||
|
foreach anEnvIter $::THE_ENV_VARIABLES {
|
||||||
|
set aName ${anEnvIter}
|
||||||
|
set aValue [set ::${anEnvIter}]
|
||||||
|
if { "$aValue" == "true" } {
|
||||||
|
puts $aFile "CONFIG += ${aName}"
|
||||||
|
} else {
|
||||||
|
#puts $aFile "CONFIG -= ${aName}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
puts $aFile ""
|
||||||
|
puts $aFile "# Additional headers search paths"
|
||||||
|
foreach anIncPath $::CSF_OPT_INC {
|
||||||
|
puts $aFile "INCLUDEPATH += \"${anIncPath}\""
|
||||||
|
}
|
||||||
|
|
||||||
|
puts $aFile ""
|
||||||
|
puts $aFile "# Additional libraries search paths"
|
||||||
|
foreach aLibPath [set ::CSF_OPT_LIB$::ARCH] {
|
||||||
|
puts $aFile "LIBS += -L\"${aLibPath}\""
|
||||||
|
}
|
||||||
|
|
||||||
|
if { "$::tcl_platform(platform)" == "windows" } {
|
||||||
|
puts $aFile ""
|
||||||
|
puts $aFile "# Additional DLLs search paths"
|
||||||
|
foreach aDllPath [set ::CSF_OPT_BIN$::ARCH] {
|
||||||
|
puts $aFile "LIBS += -L\"${aDllPath}\""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
puts $aFile ""
|
||||||
|
close $aFile
|
||||||
|
puts "Configuration saved to file '$aCustomFilePath'"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -256,7 +256,7 @@ proc genAllResources {} {
|
|||||||
|
|
||||||
# Wrapper-function to generate VS project files
|
# Wrapper-function to generate VS project files
|
||||||
proc genproj {theFormat args} {
|
proc genproj {theFormat args} {
|
||||||
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd"}
|
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd" "pro"}
|
||||||
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
|
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
|
||||||
set isHelpRequire false
|
set isHelpRequire false
|
||||||
|
|
||||||
@@ -314,6 +314,7 @@ proc genproj {theFormat args} {
|
|||||||
vc141 - Visual Studio 2017
|
vc141 - Visual Studio 2017
|
||||||
cbp - CodeBlocks
|
cbp - CodeBlocks
|
||||||
xcd - XCode
|
xcd - XCode
|
||||||
|
pro - Qt Creator
|
||||||
|
|
||||||
Platform (optional):
|
Platform (optional):
|
||||||
wnt - Windows Desktop
|
wnt - Windows Desktop
|
||||||
@@ -395,9 +396,14 @@ proc genprojbat {theFormat thePlatform} {
|
|||||||
"cbp" {
|
"cbp" {
|
||||||
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.sh" "$::path/codeblocks.sh"
|
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.sh" "$::path/codeblocks.sh"
|
||||||
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.bat" "$::path/codeblocks.bat"
|
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.bat" "$::path/codeblocks.bat"
|
||||||
|
|
||||||
# Code::Blocks 16.01 does not create directory for import libs, help him
|
# Code::Blocks 16.01 does not create directory for import libs, help him
|
||||||
file mkdir "$::path/$thePlatform/cbp/lib"
|
set aPlatformAndCompiler "${thePlatform}/gcc"
|
||||||
file mkdir "$::path/$thePlatform/cbp/libd"
|
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
|
||||||
|
set aPlatformAndCompiler "${thePlatform}/clang"
|
||||||
|
}
|
||||||
|
file mkdir "$::path/${aPlatformAndCompiler}/lib"
|
||||||
|
file mkdir "$::path/${aPlatformAndCompiler}/libd"
|
||||||
}
|
}
|
||||||
"xcd" { file copy -force -- "$::THE_CASROOT/adm/templates/xcode.sh" "$::path/xcode.sh" }
|
"xcd" { file copy -force -- "$::THE_CASROOT/adm/templates/xcode.sh" "$::path/xcode.sh" }
|
||||||
}
|
}
|
||||||
@@ -472,15 +478,6 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# generate one solution for all projects if complete OS or VAS is processed
|
|
||||||
set anAllSolution "OCCT"
|
|
||||||
|
|
||||||
wokUtils:FILES:mkdir $anOutDir
|
|
||||||
if { ![file exists $anOutDir] } {
|
|
||||||
puts stderr "Error: Could not create output directory \"$anOutDir\""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# create the out dir if it does not exist
|
# create the out dir if it does not exist
|
||||||
if (![file isdirectory $path/inc]) {
|
if (![file isdirectory $path/inc]) {
|
||||||
puts "$path/inc folder does not exists and will be created"
|
puts "$path/inc folder does not exists and will be created"
|
||||||
@@ -491,6 +488,19 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
|
|||||||
puts "Collecting required header files into $path/inc ..."
|
puts "Collecting required header files into $path/inc ..."
|
||||||
osutils:collectinc $aModules $path/inc
|
osutils:collectinc $aModules $path/inc
|
||||||
|
|
||||||
|
if { "$theFormat" == "pro" } {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# generate one solution for all projects if complete OS or VAS is processed
|
||||||
|
set anAllSolution "OCCT"
|
||||||
|
|
||||||
|
wokUtils:FILES:mkdir $anOutDir
|
||||||
|
if { ![file exists $anOutDir] } {
|
||||||
|
puts stderr "Error: Could not create output directory \"$anOutDir\""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
# Generating project files for the selected format
|
# Generating project files for the selected format
|
||||||
switch -exact -- "$theFormat" {
|
switch -exact -- "$theFormat" {
|
||||||
"vc7" -
|
"vc7" -
|
||||||
@@ -1349,6 +1359,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
|
|||||||
set aLibsMap(CSF_opengl32) "opengl32"
|
set aLibsMap(CSF_opengl32) "opengl32"
|
||||||
set aLibsMap(CSF_wsock32) "wsock32"
|
set aLibsMap(CSF_wsock32) "wsock32"
|
||||||
set aLibsMap(CSF_netapi32) "netapi32"
|
set aLibsMap(CSF_netapi32) "netapi32"
|
||||||
|
set aLibsMap(CSF_winmm) "winmm"
|
||||||
set aLibsMap(CSF_OpenGlLibs) "opengl32"
|
set aLibsMap(CSF_OpenGlLibs) "opengl32"
|
||||||
if { "$::HAVE_GLES2" == "true" } {
|
if { "$::HAVE_GLES2" == "true" } {
|
||||||
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
|
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
|
||||||
@@ -2295,6 +2306,10 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
|||||||
set aCmplFlagsDebug [list]
|
set aCmplFlagsDebug [list]
|
||||||
set toPassArgsByFile 0
|
set toPassArgsByFile 0
|
||||||
set aLibPrefix "lib"
|
set aLibPrefix "lib"
|
||||||
|
set aPlatformAndCompiler "${thePlatform}/gcc"
|
||||||
|
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
|
||||||
|
set aPlatformAndCompiler "${thePlatform}/clang"
|
||||||
|
}
|
||||||
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" || "$thePlatform" == "qnx" } {
|
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" || "$thePlatform" == "qnx" } {
|
||||||
set toPassArgsByFile 1
|
set toPassArgsByFile 1
|
||||||
}
|
}
|
||||||
@@ -2351,17 +2366,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
|||||||
# Release target configuration
|
# Release target configuration
|
||||||
puts $aFile "\t\t\t<Target title=\"Release\">"
|
puts $aFile "\t\t\t<Target title=\"Release\">"
|
||||||
if { "$theIsExe" == "true" } {
|
if { "$theIsExe" == "true" } {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
||||||
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
||||||
} else {
|
} else {
|
||||||
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bin/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${thePlatform}/cbp/lib/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bin/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${aPlatformAndCompiler}/lib/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||||
} else {
|
} else {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t<Option object_output=\"../../../${thePlatform}/cbp/obj\" />"
|
puts $aFile "\t\t\t\t<Option object_output=\"../../../${aPlatformAndCompiler}/obj\" />"
|
||||||
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
|
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
|
||||||
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
|
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
|
||||||
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
||||||
@@ -2384,7 +2399,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
|||||||
if { $toPassArgsByFile == 1 } {
|
if { $toPassArgsByFile == 1 } {
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkFileName\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkFileName\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${thePlatform}/cbp/lib\" />"
|
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aPlatformAndCompiler}/lib\" />"
|
||||||
if { "$thePlatform" == "mac" } {
|
if { "$thePlatform" == "mac" } {
|
||||||
if { [ lsearch $theLibsList X11 ] >= 0} {
|
if { [ lsearch $theLibsList X11 ] >= 0} {
|
||||||
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
|
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
|
||||||
@@ -2392,7 +2407,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
|||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch})\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch})\" />"
|
||||||
if { "$thePlatform" == "lin" } {
|
if { "$thePlatform" == "lin" } {
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${thePlatform}/cbp/lib\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${aPlatformAndCompiler}/lib\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t</Linker>"
|
puts $aFile "\t\t\t\t</Linker>"
|
||||||
|
|
||||||
@@ -2401,17 +2416,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
|||||||
# Debug target configuration
|
# Debug target configuration
|
||||||
puts $aFile "\t\t\t<Target title=\"Debug\">"
|
puts $aFile "\t\t\t<Target title=\"Debug\">"
|
||||||
if { "$theIsExe" == "true" } {
|
if { "$theIsExe" == "true" } {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
||||||
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
||||||
} else {
|
} else {
|
||||||
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bind/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${thePlatform}/cbp/libd/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bind/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${aPlatformAndCompiler}/libd/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||||
} else {
|
} else {
|
||||||
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t<Option object_output=\"../../../${thePlatform}/cbp/objd\" />"
|
puts $aFile "\t\t\t\t<Option object_output=\"../../../${aPlatformAndCompiler}/objd\" />"
|
||||||
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
|
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
|
||||||
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
|
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
|
||||||
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
||||||
@@ -2434,7 +2449,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
|||||||
if { $toPassArgsByFile == 1 } {
|
if { $toPassArgsByFile == 1 } {
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkDebFileName\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkDebFileName\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${thePlatform}/cbp/libd\" />"
|
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aPlatformAndCompiler}/libd\" />"
|
||||||
if { "$thePlatform" == "mac" } {
|
if { "$thePlatform" == "mac" } {
|
||||||
if { [ lsearch $theLibsList X11 ] >= 0} {
|
if { [ lsearch $theLibsList X11 ] >= 0} {
|
||||||
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
|
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
|
||||||
@@ -2442,7 +2457,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
|||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch}D)\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch}D)\" />"
|
||||||
if { "$thePlatform" == "lin" } {
|
if { "$thePlatform" == "lin" } {
|
||||||
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${thePlatform}/cbp/libd\" />"
|
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${aPlatformAndCompiler}/libd\" />"
|
||||||
}
|
}
|
||||||
puts $aFile "\t\t\t\t</Linker>"
|
puts $aFile "\t\t\t\t</Linker>"
|
||||||
|
|
||||||
@@ -2509,8 +2524,8 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
|||||||
puts $aFile "\t\t\t<Option link=\"0\" />"
|
puts $aFile "\t\t\t<Option link=\"0\" />"
|
||||||
puts $aFile "\t\t</Unit>"
|
puts $aFile "\t\t</Unit>"
|
||||||
|
|
||||||
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/obj/src/"] $aSrcFile]]
|
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/${aPlatformAndCompiler}/obj/src/"] $aSrcFile]]
|
||||||
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/objd/src/"] $aSrcFile]]
|
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/${aPlatformAndCompiler}/objd/src/"] $aSrcFile]]
|
||||||
puts -nonewline $aFileLnkObj "$aFileObj "
|
puts -nonewline $aFileLnkObj "$aFileObj "
|
||||||
puts -nonewline $aFileLnkObjd "$aFileObjd "
|
puts -nonewline $aFileLnkObjd "$aFileObjd "
|
||||||
} else {
|
} else {
|
||||||
|
5
adm/qmake/.gitignore
vendored
Normal file
5
adm/qmake/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
/*/*.pro
|
||||||
|
/*/*/*.pro
|
||||||
|
*.pro.user
|
||||||
|
custom.pri
|
||||||
|
custom.auto.pri
|
150
adm/qmake/OccCppConfig.pri
Normal file
150
adm/qmake/OccCppConfig.pri
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
# This is project defines C++ compilation rules for building an OCCT Toolkit.
|
||||||
|
|
||||||
|
exists(custom.auto.pri) { include(custom.auto.pri) }
|
||||||
|
exists(custom.pri) { include(custom.pri) }
|
||||||
|
|
||||||
|
# Disable some dummy Qt defaults
|
||||||
|
QT -= core gui
|
||||||
|
CONFIG -= qt app_bundle
|
||||||
|
CONFIG -= qml_debug
|
||||||
|
CONFIG -= debug_and_release
|
||||||
|
|
||||||
|
OccGitRoot = $$_PRO_FILE_PWD_/../../../..
|
||||||
|
|
||||||
|
# Define compilation flags
|
||||||
|
!win32 { DEFINES += OCC_CONVERT_SIGNALS }
|
||||||
|
android {
|
||||||
|
CONFIG += warn_off
|
||||||
|
QMAKE_CFLAGS += -fexceptions -Wno-ignored-qualifiers -Wall
|
||||||
|
QMAKE_CXXFLAGS += -fexceptions -Wno-ignored-qualifiers -Wall
|
||||||
|
#android-g++ { QMAKE_CXXFLAGS += -Wno-strict-overflow }
|
||||||
|
} else:win32 {
|
||||||
|
QMAKE_CXXFLAGS_WARN_ON = -W4
|
||||||
|
QMAKE_CXXFLAGS_EXCEPTIONS_ON = /EHa
|
||||||
|
QMAKE_CXXFLAGS_STL_ON = /EHa
|
||||||
|
|
||||||
|
QMAKE_CXXFLAGS += -fp:precise
|
||||||
|
#QMAKE_CXXFLAGS -= -Zc:throwingNew
|
||||||
|
#QMAKE_CXXFLAGS -= -Zc:rvalueCast
|
||||||
|
|
||||||
|
QMAKE_LFLAGS += -INCREMENTAL:NO
|
||||||
|
|
||||||
|
CONFIG(debug, debug|release) {
|
||||||
|
QMAKE_CXXFLAGS += -Od
|
||||||
|
QMAKE_CXXFLAGS += -Ob1
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINES -= WIN32
|
||||||
|
DEFINES -= WIN64
|
||||||
|
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||||
|
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
||||||
|
DEFINES += _SCL_SECURE_NO_WARNINGS
|
||||||
|
} else:mac {
|
||||||
|
CONFIG += c++11
|
||||||
|
CONFIG += warn_off
|
||||||
|
QMAKE_CXXFLAGS += -Wall
|
||||||
|
QMAKE_CXXFLAGS += -fvisibility=default
|
||||||
|
iphoneos {
|
||||||
|
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
|
||||||
|
} else {
|
||||||
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Define output folder depending on compiler name
|
||||||
|
MY_BITNESS = 32
|
||||||
|
|
||||||
|
equals(QMAKE_TARGET.arch, x86_64) | equals(QMAKE_HOST.arch, x86_64) { MY_BITNESS = 64 }
|
||||||
|
equals(ANDROID_TARGET_ARCH, arm64-v8a) { MY_BITNESS = 64 }
|
||||||
|
has64Target = $$find(QMAKE_TARGET.arch, "x64")
|
||||||
|
count(has64Target, 1) { MY_BITNESS = 64 }
|
||||||
|
|
||||||
|
MY_PLATFORM = platform
|
||||||
|
CONFIG(iphonesimulator, iphoneos|iphonesimulator) { MY_PLATFORM = iphonesimulator
|
||||||
|
} else:CONFIG(iphoneos, iphoneos|iphonesimulator) { MY_PLATFORM = iphoneos
|
||||||
|
} else:android { MY_PLATFORM = android-$$ANDROID_TARGET_ARCH
|
||||||
|
} else:win32 { MY_PLATFORM = win$$MY_BITNESS
|
||||||
|
} else:mac { MY_PLATFORM = mac
|
||||||
|
} else:linux { MY_PLATFORM = lin
|
||||||
|
} else:unix { MY_PLATFORM = unix
|
||||||
|
} else { warning (Unknown platform. "$$MY_PLATFORM" is used) }
|
||||||
|
|
||||||
|
MY_COMPILER = compiler
|
||||||
|
MY_VC_VER = 0
|
||||||
|
android-g++ {
|
||||||
|
MY_COMPILER = gcc
|
||||||
|
} else:clang {
|
||||||
|
MY_COMPILER = clang
|
||||||
|
} else:gcc {
|
||||||
|
MY_COMPILER = gcc
|
||||||
|
} else:win32-msvc2010 {
|
||||||
|
MY_COMPILER = vc10
|
||||||
|
MY_VC_VER = 10
|
||||||
|
} else:win32-msvc2012 {
|
||||||
|
MY_COMPILER = vc11
|
||||||
|
MY_VC_VER = 11
|
||||||
|
} else:win32-msvc2013 {
|
||||||
|
MY_COMPILER = vc12
|
||||||
|
MY_VC_VER = 12
|
||||||
|
} else:win32-msvc2015 {
|
||||||
|
MY_COMPILER = vc14
|
||||||
|
MY_VC_VER = 14
|
||||||
|
} else:win32-msvc2017 {
|
||||||
|
MY_COMPILER = vc14
|
||||||
|
MY_VC_VER = 14
|
||||||
|
} else:win32-msvc {
|
||||||
|
MY_COMPILER = vc14
|
||||||
|
MY_VC_VER = 14
|
||||||
|
aMsvcVer = $$(VisualStudioVersion)
|
||||||
|
equals(aMsvcVer, 14.0){
|
||||||
|
# VS2015, vc140
|
||||||
|
} else:equals(aMsvcVer, 15.0){
|
||||||
|
# VS2015, vc141
|
||||||
|
} else:equals(aMsvcVer, 16.0){
|
||||||
|
# VS2019, vc142
|
||||||
|
} else {
|
||||||
|
warning (Unknown msvc version. "$$MY_COMPILER" is used)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
warning (Unknown compiler. "$$MY_COMPILER" is used)
|
||||||
|
}
|
||||||
|
MY_PLATFORM_AND_COMPILER = $$MY_PLATFORM/$$MY_COMPILER
|
||||||
|
#warning (The platform is "$$MY_PLATFORM"; bitness is "$$MY_BITNESS"; compiler is "$$MY_COMPILER")
|
||||||
|
|
||||||
|
CONFIG(debug, debug|release) { MY_BUILDTYPE = d }
|
||||||
|
|
||||||
|
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/lib$${MY_BUILDTYPE}
|
||||||
|
win32 {
|
||||||
|
DESTDIR = $$OccGitRoot/win$${MY_BITNESS}/vc$${MY_VC_VER}/bin$${MY_BUILDTYPE}
|
||||||
|
aLibDest = $$DESTDIR/../lib$${MY_BUILDTYPE}
|
||||||
|
#DLLDESTDIR = $$DESTDIR/../bin$${MY_BUILDTYPE}
|
||||||
|
|
||||||
|
# dummy target creating lib/libd folder
|
||||||
|
occtkgen_libfolder.input = $$_PRO_FILE_PWD_/../../OcctDummy.in
|
||||||
|
occtkgen_libfolder.output = $$aLibDest/dummy.tmp
|
||||||
|
occtkgen_libfolder.config = verbatim
|
||||||
|
QMAKE_SUBSTITUTES += occtkgen_libfolder
|
||||||
|
|
||||||
|
LIBS += -L$$aLibDest
|
||||||
|
HAVE_RelWithDebInfo {
|
||||||
|
!CONFIG(debug, debug|release) { CONFIG += force_debug_info }
|
||||||
|
}
|
||||||
|
equals(TEMPLATE, lib) {
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.dll
|
||||||
|
QMAKE_CLEAN += $$aLibDest/$${TARGET}.lib
|
||||||
|
QMAKE_CLEAN += $$aLibDest/$${TARGET}.exp
|
||||||
|
} else {
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.exe
|
||||||
|
}
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.pdb
|
||||||
|
QMAKE_LFLAGS += -PDB:"$$DESTDIR/$${TARGET}.pdb"
|
||||||
|
QMAKE_LFLAGS += -IMPLIB:"$$aLibDest/$${TARGET}.lib"
|
||||||
|
} else {
|
||||||
|
LIBS += -L$$DESTDIR
|
||||||
|
equals(TEMPLATE, app) {
|
||||||
|
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/bin$${MY_BUILDTYPE}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
|
||||||
|
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}
|
36
adm/qmake/OccModule.pri
Normal file
36
adm/qmake/OccModule.pri
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# This is a project template file defining an OCCT Module.
|
||||||
|
# This project should be included with predefined OCC_MODULE_NAME variable.
|
||||||
|
TEMPLATE = subdirs
|
||||||
|
exists(custom.auto.pri) { include(custom.auto.pri) }
|
||||||
|
exists(custom.pri) { include(custom.pri) }
|
||||||
|
|
||||||
|
# Iterate over Toolkits within current Module and generate sub-project per Toolkit
|
||||||
|
aModuleList = $$cat(../MODULES, lines)
|
||||||
|
for (aModuleIter, aModuleList) {
|
||||||
|
#aTkList = $$list($$aModuleIter) - this doesn't work, qmake bug?
|
||||||
|
aModule = $$first($$list($$aModuleIter))
|
||||||
|
equals (aModule, $$OCC_MODULE_NAME) {
|
||||||
|
for (aToolKit, $$list($$aModuleIter)) {
|
||||||
|
toSkipToolkit = 0
|
||||||
|
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
|
||||||
|
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
|
||||||
|
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
|
||||||
|
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
|
||||||
|
equals (toSkipToolkit, 0) {
|
||||||
|
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
|
||||||
|
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
|
||||||
|
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)
|
||||||
|
eval(occtkgen_$${aToolKit}.config = verbatim)
|
||||||
|
eval(QMAKE_SUBSTITUTES += occtkgen_$${aToolKit})
|
||||||
|
SUBDIRS += $${aToolKit}
|
||||||
|
|
||||||
|
aModExtList = $$cat(../../src/$${aToolKit}/EXTERNLIB, lines)
|
||||||
|
aTkDepends = $${aToolKit}.depends
|
||||||
|
for (aModExtIter, aModExtList) {
|
||||||
|
contains ($$list($$aModuleIter), $$aModExtIter) { eval ($${aTkDepends} += $$aModExtIter) }
|
||||||
|
}
|
||||||
|
#warning($$aToolKit depends on: $$reverse($${aTkDepends}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
2
adm/qmake/OccModule.pro.in
Normal file
2
adm/qmake/OccModule.pro.in
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
OCC_MODULE_NAME = \$\$TARGET
|
||||||
|
include(../OccModule.pri)
|
137
adm/qmake/OccToolkit.pri
Normal file
137
adm/qmake/OccToolkit.pri
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
# This is a project template file defining an OCCT Toolkit.
|
||||||
|
# This project should be included with predefined OCC_TOOLKIT_NAME variable.
|
||||||
|
|
||||||
|
TEMPLATE = lib
|
||||||
|
!exists(../../src/$$OCC_TOOLKIT_NAME/PACKAGES) {
|
||||||
|
TEMPLATE = app
|
||||||
|
CONFIG += console
|
||||||
|
}
|
||||||
|
win32 {
|
||||||
|
# do not append version to DLL name
|
||||||
|
CONFIG += skip_target_version_ext
|
||||||
|
}
|
||||||
|
|
||||||
|
include(OccCppConfig.pri)
|
||||||
|
|
||||||
|
aSrcRoot = $$OccGitRoot/src
|
||||||
|
aHxxRoot = $$OccGitRoot/inc
|
||||||
|
INCLUDEPATH += $$aHxxRoot
|
||||||
|
|
||||||
|
# CSF variables
|
||||||
|
CSF_FREETYPE = -lfreetype
|
||||||
|
CSF_TclLibs = -ltcl8.6
|
||||||
|
CSF_TclTkLibs = -ltk8.6
|
||||||
|
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
|
||||||
|
HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
|
||||||
|
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
|
||||||
|
HAVE_ZLIB { CSF_ZLIB = -lzlib }
|
||||||
|
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
|
||||||
|
win32 {
|
||||||
|
CSF_kernel32 = -lkernel32
|
||||||
|
CSF_advapi32 = -ladvapi32
|
||||||
|
CSF_gdi32 = -lgdi32
|
||||||
|
CSF_user32 = -luser32 -lcomdlg32
|
||||||
|
CSF_shell32 = -lShell32
|
||||||
|
CSF_opengl32 = -lopengl32
|
||||||
|
CSF_wsock32 = -lwsock32
|
||||||
|
CSF_netapi32 = -lnetapi32
|
||||||
|
CSF_OpenGlLibs = -lopengl32
|
||||||
|
HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
|
||||||
|
CSF_psapi = -lPsapi
|
||||||
|
CSF_d3d9 = -ld3d9
|
||||||
|
CSF_TclLibs = -ltcl86
|
||||||
|
CSF_TclTkLibs = -ltk86
|
||||||
|
CSF_TBB =
|
||||||
|
} else:mac {
|
||||||
|
CSF_dl = -ldl
|
||||||
|
CSF_objc = -lobjc
|
||||||
|
CSF_Appkit = -framework AppKit
|
||||||
|
CSF_IOKit = -framework IOKit
|
||||||
|
CSF_OpenGlLibs = -framework OpenGL
|
||||||
|
CSF_TclLibs = -framework Tcl
|
||||||
|
CSF_TclTkLibs = -framework Tk
|
||||||
|
} else {
|
||||||
|
CSF_dl = -ldl
|
||||||
|
CSF_ThreadLibs = -lpthread -lrt
|
||||||
|
CSF_OpenGlLibs = -lGL
|
||||||
|
CSF_TclTkLibs = -lX11 -ltk8.6
|
||||||
|
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
|
||||||
|
CSF_MotifLibs = -lX11
|
||||||
|
HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
|
||||||
|
}
|
||||||
|
|
||||||
|
for (aCfgIter, CONFIG) {
|
||||||
|
aRes = $$find(aCfgIter, "^HAVE_")
|
||||||
|
count(aRes, 1) {
|
||||||
|
DEFINES += $$aCfgIter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Define the list of standard OCCT file extensions
|
||||||
|
aHxxRegex = ^.*\.(hxx|h|lxx|gxx)$
|
||||||
|
aPxxRegex = ^.*\.(pxx)$
|
||||||
|
aCxxRegex = ^.*\.(cxx|c)$
|
||||||
|
mac { aCxxRegex = ^.*\.(cxx|c|m|mm)$ }
|
||||||
|
|
||||||
|
# Auxiliary function for probing file extension
|
||||||
|
defineTest (occCheckExtension) {
|
||||||
|
aProbe = $$find(1, "$$2")
|
||||||
|
count(aProbe, 1) { return(true) } else { return(false) }
|
||||||
|
}
|
||||||
|
|
||||||
|
# Auxiliary function for probing compilable files
|
||||||
|
defineTest (occIsCxxFile) { occCheckExtension ($$1, $$aCxxRegex) { return(true) } else { return(false) } }
|
||||||
|
|
||||||
|
# Auxiliary function for probing header files
|
||||||
|
defineTest (occIsHxxFile) { occCheckExtension ($$1, $$aHxxRegex) { return(true) } else { return(false) } }
|
||||||
|
|
||||||
|
aTkFiles = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/FILES, lines)
|
||||||
|
aTkFiles += CMakeLists.txt
|
||||||
|
aPackages = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/PACKAGES, lines)
|
||||||
|
anExternLibs = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/EXTERNLIB, lines)
|
||||||
|
|
||||||
|
for (aTkFileIter, aTkFiles) { OTHER_FILES += $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aTkFileIter }
|
||||||
|
for (anExternLib, anExternLibs) {
|
||||||
|
hasCsf = $$find(anExternLib, CSF_)
|
||||||
|
count(hasCsf, 1) {
|
||||||
|
aList = $$split($$anExternLib, "\n")
|
||||||
|
LIBS += $$aList
|
||||||
|
} else {
|
||||||
|
LIBS += -l$$anExternLib
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Iterate over Packages and add compilable files into this project
|
||||||
|
isEmpty (aPackages) { aPackages = $$OCC_TOOLKIT_NAME }
|
||||||
|
for (aPackage, aPackages) {
|
||||||
|
aPackageFolder = $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aPackage
|
||||||
|
aPackageFiles = $$cat($$aSrcRoot/$$aPackage/FILES, lines)
|
||||||
|
for (aFileIter, aPackageFiles) {
|
||||||
|
occIsCxxFile($$aFileIter) {
|
||||||
|
SOURCES += $$aSrcRoot/$$aPackage/$$aFileIter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# extend clean with versioned .so files
|
||||||
|
!win32 {
|
||||||
|
aVerList = $$split(VERSION, ".")
|
||||||
|
aVerMaj = $$member(aVerList, 0)
|
||||||
|
aVerMin = $$member(aVerList, 1)
|
||||||
|
aVerMic = $$member(aVerList, 2)
|
||||||
|
equals(TEMPLATE, app) {
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
|
||||||
|
} else {
|
||||||
|
mac {
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
|
||||||
|
} else {
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
|
||||||
|
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}.$${aVerMic}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
2
adm/qmake/OccToolkit.pro.in
Normal file
2
adm/qmake/OccToolkit.pro.in
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
OCC_TOOLKIT_NAME = \$\$TARGET
|
||||||
|
include(../../OccToolkit.pri)
|
41
adm/qmake/Occt.pro
Normal file
41
adm/qmake/Occt.pro
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# This is an experimental Solution project for building entire OCCT framework using qmake.
|
||||||
|
# It can be also used for just source code navigation in Qt Creator without actually building OCCT.
|
||||||
|
# Note, as this is an experimental project, compiler flags might differ from official builds - use it on your own risk!
|
||||||
|
# Building OCCT using CMake is a preferred solution.
|
||||||
|
#
|
||||||
|
# This project GENERATES sub-projects (OCCT modules) dynamically, so to start using it:
|
||||||
|
# - Launch genconf, select Project Format "Qt Project" and configure dependencies; this will also generate "custom.auto.pri".
|
||||||
|
# - Launch genproj to fill in "inc" folder with links to header files.
|
||||||
|
# - Open project in Qt Creator, and call "Run qmake".
|
||||||
|
# - Close the project in Qt Creator, open it again so that you should see the sub-modules in Project tree; call "Run qmake" again.
|
||||||
|
# - "Run qmake" and perform Build.
|
||||||
|
TEMPLATE = subdirs
|
||||||
|
exists(custom.auto.pri) { include(custom.auto.pri) }
|
||||||
|
exists(custom.pri) { include(custom.pri) }
|
||||||
|
|
||||||
|
OTHER_FILES += OccModule.pro.in \
|
||||||
|
OcctHeaderLink.hxx.in \
|
||||||
|
OccToolkit.pro.in \
|
||||||
|
OccCppConfig.pri \
|
||||||
|
OccModule.pri \
|
||||||
|
OccToolkit.pri \
|
||||||
|
custom.pri.template
|
||||||
|
|
||||||
|
# Iterate over Modules and generate sub-projects
|
||||||
|
aSolModuleList = $$cat(../MODULES, lines)
|
||||||
|
for (aSolModuleIter, aSolModuleList) {
|
||||||
|
aSolModule = $$first($$list($$aSolModuleIter))
|
||||||
|
eval(occtkgen_$${aSolModule}.input = $$_PRO_FILE_PWD_/OccModule.pro.in)
|
||||||
|
eval(occtkgen_$${aSolModule}.output = $$_PRO_FILE_PWD_/$${aSolModule}/$${aSolModule}.pro)
|
||||||
|
eval(occtkgen_$${aSolModule}.config = verbatim)
|
||||||
|
eval(QMAKE_SUBSTITUTES += occtkgen_$${aSolModule})
|
||||||
|
SUBDIRS += $${aSolModule}
|
||||||
|
}
|
||||||
|
|
||||||
|
# These dependencies are manually defined
|
||||||
|
ModelingData.depends = FoundationClasses
|
||||||
|
ModelingAlgorithms.depends = FoundationClasses ModelingData
|
||||||
|
Visualization.depends = FoundationClasses ModelingData ModelingAlgorithms
|
||||||
|
ApplicationFramework.depends = FoundationClasses ModelingData ModelingAlgorithms Visualization
|
||||||
|
DataExchange.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework
|
||||||
|
Draw.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework DataExchange Visualization
|
0
adm/qmake/OcctDummy.in
Normal file
0
adm/qmake/OcctDummy.in
Normal file
1
adm/qmake/OcctHeaderLink.hxx.in
Normal file
1
adm/qmake/OcctHeaderLink.hxx.in
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include \"../src/$${OCCT_PACKAGE}/$${OCCT_HEADER}\"
|
17
adm/qmake/custom.pri.template
Normal file
17
adm/qmake/custom.pri.template
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
PRODUCTS_PATH = c:/3rdparty/vc14
|
||||||
|
|
||||||
|
#CONFIG += HAVE_FREEIMAGE
|
||||||
|
#CONFIG += HAVE_FFMPEG
|
||||||
|
#CONFIG += HAVE_TBB
|
||||||
|
#CONFIG += HAVE_GLES2
|
||||||
|
#CONFIG += HAVE_D3D
|
||||||
|
#CONFIG += HAVE_VTK
|
||||||
|
|
||||||
|
aFreeType = $$PRODUCTS_PATH/freetype-2.5.5-vc14-64
|
||||||
|
aTclTk = $$PRODUCTS_PATH/tcltk-86-64
|
||||||
|
|
||||||
|
INCLUDEPATH += $$aFreeType/include
|
||||||
|
LIBS += -L$$aFreeType/lib
|
||||||
|
|
||||||
|
INCLUDEPATH += $$aTclTk/include
|
||||||
|
LIBS += -L$$aTclTk/lib
|
@@ -29,6 +29,7 @@ set "CSF_OPT_LIB32="
|
|||||||
set "CSF_OPT_LIB64="
|
set "CSF_OPT_LIB64="
|
||||||
set "CSF_OPT_BIN32="
|
set "CSF_OPT_BIN32="
|
||||||
set "CSF_OPT_BIN64="
|
set "CSF_OPT_BIN64="
|
||||||
|
set "CSF_DEFINES=%CSF_DEFINES_EXTRA%"
|
||||||
|
|
||||||
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
|
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
|
||||||
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
|
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
|
||||||
|
@@ -6,7 +6,7 @@ aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath
|
|||||||
# Reset values
|
# Reset values
|
||||||
export CASROOT="__CASROOT__"
|
export CASROOT="__CASROOT__"
|
||||||
export CASDEB=""
|
export CASDEB=""
|
||||||
export TARGET="";
|
export PRJFMT="";
|
||||||
export HAVE_TBB="false";
|
export HAVE_TBB="false";
|
||||||
export HAVE_OPENCL="false";
|
export HAVE_OPENCL="false";
|
||||||
export HAVE_FREEIMAGE="false";
|
export HAVE_FREEIMAGE="false";
|
||||||
@@ -40,9 +40,9 @@ do
|
|||||||
elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
|
elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
|
||||||
export CASDEB="i"
|
export CASDEB="i"
|
||||||
elif [ "$i" == "cbp" ]; then
|
elif [ "$i" == "cbp" ]; then
|
||||||
export TARGET="cbp";
|
export PRJFMT="cbp";
|
||||||
elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
|
elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
|
||||||
export TARGET="xcd";
|
export PRJFMT="xcd";
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
shopt -u nocasematch
|
shopt -u nocasematch
|
||||||
@@ -64,28 +64,32 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
export CASBIN=""
|
export CASBIN=""
|
||||||
if [ "${TARGET}" == "cbp" ]; then
|
if [ "${PRJFMT}" == "xcd" ]; then
|
||||||
export CASBIN="${WOKSTATION}/cbp"
|
|
||||||
elif [ "${TARGET}" == "xcd" ]; then
|
|
||||||
export CASBIN="adm/mac/xcd/build"
|
export CASBIN="adm/mac/xcd/build"
|
||||||
|
else
|
||||||
|
if [ "$aSystem" == "Darwin" ]; then
|
||||||
|
export CASBIN="${WOKSTATION}/clang"
|
||||||
|
else
|
||||||
|
export CASBIN="${WOKSTATION}/gcc"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
|
export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
|
||||||
|
|
||||||
if [ "${TARGET}" == "cbp" ]; then
|
if [ "${PRJFMT}" == "xcd" ]; then
|
||||||
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
|
|
||||||
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
|
|
||||||
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
|
|
||||||
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
|
|
||||||
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
|
|
||||||
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
|
|
||||||
elif [ "${TARGET}" == "xcd" ]; then
|
|
||||||
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
|
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
|
||||||
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
|
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
|
||||||
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
|
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
|
||||||
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
|
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
|
||||||
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
|
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
|
||||||
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
|
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
|
||||||
|
else
|
||||||
|
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
|
||||||
|
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
|
||||||
|
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
|
||||||
|
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
|
||||||
|
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
|
||||||
|
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export CSF_OPT_CMPL=""
|
export CSF_OPT_CMPL=""
|
||||||
@@ -174,7 +178,7 @@ export CSF_OCCTSamplesPath="${CSF_OCCTSamplesPath:-$CASROOT/samples}"
|
|||||||
export CSF_OCCTDataPath="${CSF_OCCTDataPath:-$CASROOT/data}"
|
export CSF_OCCTDataPath="${CSF_OCCTDataPath:-$CASROOT/data}"
|
||||||
export CSF_OCCTTestsPath="${CSF_OCCTTestsPath:-$CASROOT/tests}"
|
export CSF_OCCTTestsPath="${CSF_OCCTTestsPath:-$CASROOT/tests}"
|
||||||
|
|
||||||
if [ "${TARGET}" == "xcd" ]; then
|
if [ "${PRJFMT}" == "xcd" ]; then
|
||||||
if [ "${CASDEB}" == "d" ]; then
|
if [ "${CASDEB}" == "d" ]; then
|
||||||
export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/Debug}"
|
export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/Debug}"
|
||||||
else
|
else
|
||||||
|
@@ -1716,9 +1716,30 @@ aGroup->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< next array
|
|||||||
aGroup->AddPrimitiveArray (aLines);
|
aGroup->AddPrimitiveArray (aLines);
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@subsection upgrade_740_prsupdate Presentation invalidation
|
||||||
|
|
||||||
|
Historically AIS_InteractiveObject provided two independent mechanisms invalidating presentation (asking presentation manager to recompute specific display mode or all modes):
|
||||||
|
|
||||||
|
1. *AIS_InteractiveObject::SetToUpdate()*, marking existing presentation for update.
|
||||||
|
This is main invalidation API, which is expected to be followed by *AIS_InteractiveContext::Update()* call.
|
||||||
|
2. *AIS_InteractiveObject::myToRecomputeModes* + *myRecomputeEveryPrs*.
|
||||||
|
This is auxiliary invalidation API, used internally by AIS_InteractiveContext::SetColor()/UnsetColor() and similar modification methods.
|
||||||
|
|
||||||
|
The latter one has been removed to avoid confusion and unexpected behavior.
|
||||||
|
In addition, two methods *AIS_InteractiveObject::Update()* have been deprecated in favor of new *AIS_InteractiveObject::UpdatePresentations()* recomputing only invalidated presentations.
|
||||||
|
|
||||||
|
Custom presentations implementing interface methods *AIS_InteractiveObject::SetColor()* and others should be revised to use *AIS_InteractiveObject::SetToUpdate()*
|
||||||
|
or updating presentation without recomputation (see *AIS_InteractiveObject::SynchronizeAspects()* and *AIS_InteractiveObject::replaceAspects()*).
|
||||||
|
|
||||||
@subsection upgrade_740_interiorstyles Interior styles
|
@subsection upgrade_740_interiorstyles Interior styles
|
||||||
|
|
||||||
* *Aspect_IS_HOLLOW* is now an alias to *Aspect_IS_EMPTY* and does not implicitly enables drawing mesh edges anymore.
|
* *Aspect_IS_HOLLOW* is now an alias to *Aspect_IS_EMPTY* and does not implicitly enables drawing mesh edges anymore.
|
||||||
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_EMPTY) to get previous behavior of Aspect_IS_HOLLOW style.
|
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_EMPTY) to get previous behavior of Aspect_IS_HOLLOW style.
|
||||||
* *Aspect_IS_HIDDENLINE* does not implicitly enables drawing mesh edges anymore.
|
* *Aspect_IS_HIDDENLINE* does not implicitly enables drawing mesh edges anymore.
|
||||||
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_HIDDENLINE) to get previous behavior of Aspect_IS_HIDDENLINE style.
|
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_HIDDENLINE) to get previous behavior of Aspect_IS_HIDDENLINE style.
|
||||||
|
|
||||||
|
@subsection upgrade_740_geproj Custom defines within env.bat
|
||||||
|
|
||||||
|
*env.bat* produced by Visual Studio project generator *genproj.bat* has been modified so that *%CSF_DEFINES%* variable is reset to initial state.
|
||||||
|
Custom building environment relying on old behavior and setting extra macros within *%CSF_DEFINES%* before env.bat should be updated
|
||||||
|
to either modify custom.bat or setup new variable *%CSF_DEFINES_EXTRA%* instead.
|
||||||
|
@@ -23,7 +23,7 @@ WARNINGS = NO
|
|||||||
ENABLE_PREPROCESSING = YES
|
ENABLE_PREPROCESSING = YES
|
||||||
MACRO_EXPANSION = YES
|
MACRO_EXPANSION = YES
|
||||||
EXPAND_ONLY_PREDEF = YES
|
EXPAND_ONLY_PREDEF = YES
|
||||||
PREDEFINED = Standard_EXPORT Standard_NODISCARD Standard_OVERRIDE:=override __Standard_API __Draw_API Handle(a):=Handle<a> DEFINE_STANDARD_ALLOC DEFINE_NCOLLECTION_ALLOC
|
PREDEFINED = Standard_EXPORT Standard_NODISCARD Standard_OVERRIDE:=override __Standard_API __Draw_API Handle(a):=Handle<a> DEFINE_STANDARD_ALLOC DEFINE_NCOLLECTION_ALLOC "Standard_DEPRECATED=//! @deprecated "
|
||||||
GENERATE_HTML = YES
|
GENERATE_HTML = YES
|
||||||
GENERATE_LATEX = NO
|
GENERATE_LATEX = NO
|
||||||
SEARCH_INCLUDES = YES
|
SEARCH_INCLUDES = YES
|
||||||
|
10
genproj
10
genproj
@@ -19,10 +19,6 @@ anOpt2=$2
|
|||||||
anOpt3=$3
|
anOpt3=$3
|
||||||
anOpt4=$4
|
anOpt4=$4
|
||||||
anOpt5=$5
|
anOpt5=$5
|
||||||
if [ "$aTarget" == "" ]; then
|
|
||||||
aTarget="cbp"
|
|
||||||
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "${aScriptPath}/custom.sh" ]; then
|
if [ ! -e "${aScriptPath}/custom.sh" ]; then
|
||||||
tclsh "${aScriptPath}/adm/genconf.tcl"
|
tclsh "${aScriptPath}/adm/genconf.tcl"
|
||||||
@@ -37,6 +33,12 @@ source "${aScriptPath}/custom.sh"
|
|||||||
|
|
||||||
if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
|
if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
|
||||||
|
|
||||||
|
if [ "$aTarget" == "" ]; then aTarget=$PRJFMT; fi;
|
||||||
|
if [ "$aTarget" == "" ]; then
|
||||||
|
aTarget="cbp"
|
||||||
|
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
|
||||||
|
fi
|
||||||
|
|
||||||
cd $aScriptPath
|
cd $aScriptPath
|
||||||
tclsh "./adm/start.tcl" genproj ${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5
|
tclsh "./adm/start.tcl" genproj ${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5
|
||||||
|
|
||||||
|
@@ -49,6 +49,10 @@ if "%aPlatform%" == "" (
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set aPrjFmt=%PRJFMT%
|
||||||
|
if "%aPrjFmt%" == "" ( set "aPrjFmt=vcxproj" )
|
||||||
|
if "%aPrjFmt%" == "vcxproj" ( set "aPrjFmt=%VCFMT%" )
|
||||||
|
|
||||||
cd %~dp0
|
cd %~dp0
|
||||||
%TCL_EXEC% %~dp0adm/start.tcl genproj %VCFMT% %aPlatform% %3 %4 %5
|
%TCL_EXEC% %~dp0adm/start.tcl genproj %aPrjFmt% %aPlatform% %3 %4 %5
|
||||||
SET "PATH=%OLD_PATH%"
|
SET "PATH=%OLD_PATH%"
|
||||||
|
@@ -17,7 +17,8 @@ void ISession2D_Shape::Add(const TopoDS_Shape& aShape)
|
|||||||
myListOfShape.Append(aShape);
|
myListOfShape.Append(aShape);
|
||||||
myAlgo.Nullify();
|
myAlgo.Nullify();
|
||||||
myPolyAlgo.Nullify();
|
myPolyAlgo.Nullify();
|
||||||
Update(); // protected method used to specify that the presentation are not up to date
|
SetToUpdate();
|
||||||
|
UpdatePresentations();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ISession2D_Shape::Remove (const TopoDS_Shape& theShape)
|
void ISession2D_Shape::Remove (const TopoDS_Shape& theShape)
|
||||||
@@ -42,23 +43,17 @@ void ISession2D_Shape::SetProjector (HLRAlgo_Projector& aProjector)
|
|||||||
myProjector= aProjector;
|
myProjector= aProjector;
|
||||||
myAlgo.Nullify();
|
myAlgo.Nullify();
|
||||||
myPolyAlgo.Nullify();
|
myPolyAlgo.Nullify();
|
||||||
Update(); // protected method used to specify that the presentation are not up to date
|
SetToUpdate();
|
||||||
|
UpdatePresentations();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void ISession2D_Shape::SetNbIsos(Standard_Integer& aNbIsos)
|
void ISession2D_Shape::SetNbIsos(Standard_Integer& aNbIsos)
|
||||||
{
|
{
|
||||||
myNbIsos= aNbIsos;
|
myNbIsos= aNbIsos;
|
||||||
myAlgo.Nullify();
|
myAlgo.Nullify();
|
||||||
|
SetToUpdate();
|
||||||
// declare the mode 100 to 110 as non valid
|
UpdatePresentations();
|
||||||
for (int i=100;i<=110;i++)
|
|
||||||
Update(i,Standard_False); // protected method used to specify that the presentation are not up to date
|
|
||||||
|
|
||||||
// declare the mode 1100 to 1110 as non valid
|
|
||||||
for (int i=1100;i<=1110;i++)
|
|
||||||
Update(i,Standard_False); // protected method used to specify that the presentation are not up to date
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void ISession2D_Shape::BuildAlgo()
|
void ISession2D_Shape::BuildAlgo()
|
||||||
|
@@ -51,7 +51,7 @@ proc drawObjects {theRow theColor} {
|
|||||||
uplevel #0 box $aBox $aCtr $aCtr $aCtr $aSize $aSize $aSize
|
uplevel #0 box $aBox $aCtr $aCtr $aCtr $aSize $aSize $aSize
|
||||||
uplevel #0 ttranslate $aSph $x $y 0
|
uplevel #0 ttranslate $aSph $x $y 0
|
||||||
uplevel #0 ttranslate $aBox [expr $x + 10] $y 0
|
uplevel #0 ttranslate $aBox [expr $x + 10] $y 0
|
||||||
uplevel #0 vdisplay -noredraw $aSph $aBox
|
uplevel #0 vdisplay -noredraw -dispMode 1 $aSph $aBox
|
||||||
uplevel #0 vsetmaterial -noredraw $aSph $aBox $aMatIter
|
uplevel #0 vsetmaterial -noredraw $aSph $aBox $aMatIter
|
||||||
if {$theColor != ""} {
|
if {$theColor != ""} {
|
||||||
uplevel #0 vsetcolor -noredraw $aSph $aBox $theColor
|
uplevel #0 vsetcolor -noredraw $aSph $aBox $theColor
|
||||||
@@ -64,21 +64,19 @@ proc drawObjects {theRow theColor} {
|
|||||||
# setup 3D viewer content
|
# setup 3D viewer content
|
||||||
pload MODELING VISUALIZATION
|
pload MODELING VISUALIZATION
|
||||||
|
|
||||||
catch { vclose View1 }
|
|
||||||
vinit View1 w=768 h=768
|
|
||||||
vclear
|
vclear
|
||||||
|
vclose ALL
|
||||||
|
vinit View1 w=768 h=768
|
||||||
vtop
|
vtop
|
||||||
vglinfo
|
vglinfo
|
||||||
vsetgradientbg 180 200 255 180 180 180 2
|
vsetgradientbg 180 200 255 180 180 180 2
|
||||||
|
|
||||||
vlight -change 0 -dir 0.577 -0.577 -0.577
|
vlight -change 0 -dir 0.577 -0.577 -0.577
|
||||||
vsetdispmode 1
|
|
||||||
vrenderparams -msaa 8
|
vrenderparams -msaa 8
|
||||||
|
|
||||||
# adjust scene bounding box
|
# adjust scene bounding box
|
||||||
box bnd 0 0 0 180 210 1
|
box bnd 0 0 0 180 210 1
|
||||||
vdisplay -noredraw bnd
|
vdisplay -noredraw -dispMode 0 bnd
|
||||||
vsetdispmode bnd 0
|
|
||||||
vfit
|
vfit
|
||||||
vremove -noredraw bnd
|
vremove -noredraw bnd
|
||||||
|
|
||||||
@@ -88,5 +86,3 @@ drawObjects 0 ""
|
|||||||
drawObjects 1 red
|
drawObjects 1 red
|
||||||
drawObjects 2 green
|
drawObjects 2 green
|
||||||
drawObjects 3 blue1
|
drawObjects 3 blue1
|
||||||
#vfit
|
|
||||||
vzfit
|
|
||||||
|
@@ -168,7 +168,7 @@ void AIS_Animation::StartTimer (const Standard_Real theStartPts,
|
|||||||
{
|
{
|
||||||
if (myTimer.IsNull())
|
if (myTimer.IsNull())
|
||||||
{
|
{
|
||||||
myTimer = new AIS_AnimationTimer();
|
myTimer = new Media_Timer();
|
||||||
}
|
}
|
||||||
myTimer->Stop();
|
myTimer->Stop();
|
||||||
myTimer->Seek (theStartPts);
|
myTimer->Seek (theStartPts);
|
||||||
|
@@ -191,7 +191,7 @@ protected:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Handle(AIS_AnimationTimer) myTimer;
|
Handle(Media_Timer) myTimer;
|
||||||
|
|
||||||
TCollection_AsciiString myName; //!< animation name
|
TCollection_AsciiString myName; //!< animation name
|
||||||
NCollection_Sequence<Handle(AIS_Animation)>
|
NCollection_Sequence<Handle(AIS_Animation)>
|
||||||
|
@@ -15,60 +15,7 @@
|
|||||||
#ifndef _AIS_AnimationTimer_HeaderFile
|
#ifndef _AIS_AnimationTimer_HeaderFile
|
||||||
#define _AIS_AnimationTimer_HeaderFile
|
#define _AIS_AnimationTimer_HeaderFile
|
||||||
|
|
||||||
#include <OSD_Timer.hxx>
|
#include <Media_Timer.hxx>
|
||||||
#include <Standard_Transient.hxx>
|
typedef Media_Timer AIS_AnimationTimer;
|
||||||
#include <Standard_Type.hxx>
|
|
||||||
|
|
||||||
//! Auxiliary class defining the animation timer.
|
|
||||||
class AIS_AnimationTimer : public Standard_Transient
|
|
||||||
{
|
|
||||||
DEFINE_STANDARD_RTTIEXT(AIS_AnimationTimer, Standard_Transient)
|
|
||||||
public:
|
|
||||||
|
|
||||||
//! Empty constructor.
|
|
||||||
AIS_AnimationTimer() : myTimerFrom (0.0), myTimerSpeed (1.0) {}
|
|
||||||
|
|
||||||
//! Return elapsed time in seconds.
|
|
||||||
Standard_Real ElapsedTime() const
|
|
||||||
{
|
|
||||||
return myTimerFrom + myTimer.ElapsedTime() * myTimerSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Return playback speed coefficient (1.0 means normal speed).
|
|
||||||
Standard_Real PlaybackSpeed() const { return myTimerSpeed; }
|
|
||||||
|
|
||||||
//! Setup playback speed coefficient.
|
|
||||||
Standard_EXPORT void SetPlaybackSpeed (const Standard_Real theSpeed);
|
|
||||||
|
|
||||||
//! Return true if timer has been started.
|
|
||||||
Standard_Boolean IsStarted() const
|
|
||||||
{
|
|
||||||
return myTimer.IsStarted();
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Start the timer.
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
myTimer.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Pause the timer.
|
|
||||||
Standard_EXPORT void Pause();
|
|
||||||
|
|
||||||
//! Stop the timer.
|
|
||||||
Standard_EXPORT void Stop();
|
|
||||||
|
|
||||||
//! Seek the timer to specified position.
|
|
||||||
Standard_EXPORT void Seek (const Standard_Real theTime);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
OSD_Timer myTimer;
|
|
||||||
Standard_Real myTimerFrom;
|
|
||||||
Standard_Real myTimerSpeed;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
DEFINE_STANDARD_HANDLE(AIS_AnimationTimer, Standard_Transient)
|
|
||||||
|
|
||||||
#endif // _AIS_AnimationTimer_HeaderFile
|
#endif // _AIS_AnimationTimer_HeaderFile
|
||||||
|
@@ -81,7 +81,7 @@ myIsXYZAxis(Standard_True)
|
|||||||
Standard_Real aLength;
|
Standard_Real aLength;
|
||||||
try {
|
try {
|
||||||
aLength = UnitsAPI::AnyToLS(100. ,"mm");
|
aLength = UnitsAPI::AnyToLS(100. ,"mm");
|
||||||
} catch (Standard_Failure) {
|
} catch (Standard_Failure const&) {
|
||||||
aLength = 0.1;
|
aLength = 0.1;
|
||||||
}
|
}
|
||||||
DA->SetAxisLength(aLength,aLength,aLength);
|
DA->SetAxisLength(aLength,aLength,aLength);
|
||||||
@@ -221,7 +221,7 @@ void AIS_Axis::SetColor(const Quantity_Color &aCol)
|
|||||||
DA->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
|
DA->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
|
||||||
DA->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
|
DA->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
|
||||||
DA->LineAspect(Prs3d_DP_ZAxis)->SetColor(aCol);
|
DA->LineAspect(Prs3d_DP_ZAxis)->SetColor(aCol);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -230,7 +230,6 @@ void AIS_Axis::SetColor(const Quantity_Color &aCol)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Axis::SetWidth(const Standard_Real aValue)
|
void AIS_Axis::SetWidth(const Standard_Real aValue)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(aValue<0.0) return;
|
if(aValue<0.0) return;
|
||||||
if(aValue==0) UnsetWidth();
|
if(aValue==0) UnsetWidth();
|
||||||
|
|
||||||
@@ -240,6 +239,7 @@ void AIS_Axis::SetWidth(const Standard_Real aValue)
|
|||||||
DA->LineAspect(Prs3d_DP_XAxis)->SetWidth(aValue);
|
DA->LineAspect(Prs3d_DP_XAxis)->SetWidth(aValue);
|
||||||
DA->LineAspect(Prs3d_DP_YAxis)->SetWidth(aValue);
|
DA->LineAspect(Prs3d_DP_YAxis)->SetWidth(aValue);
|
||||||
DA->LineAspect(Prs3d_DP_ZAxis)->SetWidth(aValue);
|
DA->LineAspect(Prs3d_DP_ZAxis)->SetWidth(aValue);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -324,14 +324,13 @@ AcceptDisplayMode(const Standard_Integer aMode) const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Axis::UnsetColor()
|
void AIS_Axis::UnsetColor()
|
||||||
{
|
{
|
||||||
|
|
||||||
myDrawer->LineAspect()->SetColor(Quantity_NOC_RED);
|
myDrawer->LineAspect()->SetColor(Quantity_NOC_RED);
|
||||||
|
hasOwnColor = Standard_False;
|
||||||
hasOwnColor=Standard_False;
|
|
||||||
|
|
||||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(Quantity_NOC_TURQUOISE);
|
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(Quantity_NOC_TURQUOISE);
|
||||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(Quantity_NOC_TURQUOISE);
|
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(Quantity_NOC_TURQUOISE);
|
||||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetColor(Quantity_NOC_TURQUOISE);
|
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetColor(Quantity_NOC_TURQUOISE);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : UnsetWidth
|
//function : UnsetWidth
|
||||||
@@ -340,10 +339,10 @@ void AIS_Axis::UnsetColor()
|
|||||||
|
|
||||||
void AIS_Axis::UnsetWidth()
|
void AIS_Axis::UnsetWidth()
|
||||||
{
|
{
|
||||||
myOwnWidth = 0.0;
|
myOwnWidth = 0.0f;
|
||||||
myDrawer->LineAspect()->SetWidth(1.);
|
myDrawer->LineAspect()->SetWidth(1.);
|
||||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetWidth(1.);
|
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetWidth(1.);
|
||||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetWidth(1.);
|
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetWidth(1.);
|
||||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetWidth(1.);
|
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetWidth(1.);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -90,6 +90,7 @@ void AIS_CameraFrustum::SetColor (const Quantity_Color& theColor)
|
|||||||
AIS_InteractiveObject::SetColor (theColor);
|
AIS_InteractiveObject::SetColor (theColor);
|
||||||
myDrawer->ShadingAspect()->SetColor (theColor);
|
myDrawer->ShadingAspect()->SetColor (theColor);
|
||||||
myDrawer->LineAspect()->SetColor (theColor);
|
myDrawer->LineAspect()->SetColor (theColor);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -107,6 +108,7 @@ void AIS_CameraFrustum::UnsetColor()
|
|||||||
|
|
||||||
myDrawer->ShadingAspect()->SetColor (THE_DEFAULT_COLOR);
|
myDrawer->ShadingAspect()->SetColor (THE_DEFAULT_COLOR);
|
||||||
myDrawer->LineAspect()->SetColor (THE_DEFAULT_COLOR);
|
myDrawer->LineAspect()->SetColor (THE_DEFAULT_COLOR);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -117,6 +119,7 @@ void AIS_CameraFrustum::UnsetTransparency()
|
|||||||
{
|
{
|
||||||
myDrawer->ShadingAspect()->SetTransparency (0.0f);
|
myDrawer->ShadingAspect()->SetTransparency (0.0f);
|
||||||
myDrawer->SetTransparency (0.0f);
|
myDrawer->SetTransparency (0.0f);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -112,6 +112,29 @@ void AIS_Circle::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : replaceWithNewLineAspect
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void AIS_Circle::replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||||
|
{
|
||||||
|
if (!myDrawer->HasLink())
|
||||||
|
{
|
||||||
|
myDrawer->SetLineAspect (theAspect);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Handle(Graphic3d_AspectLine3d) anAspectOld = myDrawer->LineAspect()->Aspect();
|
||||||
|
const Handle(Graphic3d_AspectLine3d) anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->LineAspect()->Aspect();
|
||||||
|
if (anAspectNew != anAspectOld)
|
||||||
|
{
|
||||||
|
myDrawer->SetLineAspect (theAspect);
|
||||||
|
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||||
|
aReplaceMap.Bind (anAspectOld, anAspectNew);
|
||||||
|
replaceAspects (aReplaceMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetColor
|
//function : SetColor
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -122,34 +145,41 @@ void AIS_Circle::SetColor(const Quantity_Color &aCol)
|
|||||||
hasOwnColor=Standard_True;
|
hasOwnColor=Standard_True;
|
||||||
myDrawer->SetColor (aCol);
|
myDrawer->SetColor (aCol);
|
||||||
|
|
||||||
Standard_Real WW = HasWidth() ? myOwnWidth :
|
if (!myDrawer->HasOwnLineAspect())
|
||||||
myDrawer->HasLink() ?
|
{
|
||||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
|
Standard_Real WW = HasWidth() ? myOwnWidth :
|
||||||
1.;
|
myDrawer->HasLink() ?
|
||||||
|
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
|
||||||
if (!myDrawer->HasOwnLineAspect ())
|
1.;
|
||||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
myDrawer->LineAspect()->SetColor(aCol);
|
myDrawer->LineAspect()->SetColor(aCol);
|
||||||
|
SynchronizeAspects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetWidth
|
//function : SetWidth
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Circle::SetWidth(const Standard_Real aValue)
|
void AIS_Circle::SetWidth(const Standard_Real aValue)
|
||||||
{
|
{
|
||||||
myOwnWidth=aValue;
|
myOwnWidth = (Standard_ShortReal )aValue;
|
||||||
|
|
||||||
if (!myDrawer->HasOwnLineAspect ()) {
|
if (!myDrawer->HasOwnLineAspect())
|
||||||
|
{
|
||||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||||
if( HasColor() ) CC = myDrawer->Color();
|
if( HasColor() ) CC = myDrawer->Color();
|
||||||
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
myDrawer->LineAspect()->SetWidth(aValue);
|
myDrawer->LineAspect()->SetWidth(aValue);
|
||||||
|
SynchronizeAspects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -161,15 +191,18 @@ void AIS_Circle::UnsetColor()
|
|||||||
{
|
{
|
||||||
hasOwnColor = Standard_False;
|
hasOwnColor = Standard_False;
|
||||||
|
|
||||||
Handle(Prs3d_LineAspect) NullAsp;
|
if (!HasWidth())
|
||||||
|
{
|
||||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
|
||||||
else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Quantity_Color CC = Quantity_NOC_YELLOW;;
|
Quantity_Color CC = Quantity_NOC_YELLOW;;
|
||||||
if( HasColor() ) CC = myDrawer->Color();
|
if( HasColor() ) CC = myDrawer->Color();
|
||||||
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||||
myDrawer->LineAspect()->SetColor(CC);
|
myDrawer->LineAspect()->SetColor(CC);
|
||||||
myDrawer->SetColor (CC);
|
myDrawer->SetColor (CC);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,11 +212,13 @@ void AIS_Circle::UnsetColor()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Circle::UnsetWidth()
|
void AIS_Circle::UnsetWidth()
|
||||||
{
|
{
|
||||||
Handle(Prs3d_LineAspect) NullAsp;
|
if (!HasColor())
|
||||||
|
{
|
||||||
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
|
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
|
||||||
else{
|
}
|
||||||
Standard_Real WW = myDrawer->HasLink() ? AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
|
else
|
||||||
|
{
|
||||||
|
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.0f;
|
||||||
myDrawer->LineAspect()->SetWidth(WW);
|
myDrawer->LineAspect()->SetWidth(WW);
|
||||||
myOwnWidth = WW;
|
myOwnWidth = WW;
|
||||||
}
|
}
|
||||||
|
@@ -115,6 +115,9 @@ private:
|
|||||||
|
|
||||||
Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
|
Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
|
||||||
|
|
||||||
|
//! Replace aspects of already computed groups with the new value.
|
||||||
|
void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Handle(Geom_Circle) myComponent;
|
Handle(Geom_Circle) myComponent;
|
||||||
|
@@ -124,8 +124,7 @@ Handle(AIS_ColoredDrawer) AIS_ColoredShape::CustomAspects (const TopoDS_Shape& t
|
|||||||
{
|
{
|
||||||
aDrawer = new AIS_ColoredDrawer (myDrawer);
|
aDrawer = new AIS_ColoredDrawer (myDrawer);
|
||||||
myShapeColors.Bind (theShape, aDrawer);
|
myShapeColors.Bind (theShape, aDrawer);
|
||||||
LoadRecomputable (AIS_WireFrame);
|
SetToUpdate();
|
||||||
LoadRecomputable (AIS_Shaded);
|
|
||||||
}
|
}
|
||||||
return aDrawer;
|
return aDrawer;
|
||||||
}
|
}
|
||||||
@@ -141,8 +140,7 @@ void AIS_ColoredShape::ClearCustomAspects()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
myShapeColors.Clear();
|
myShapeColors.Clear();
|
||||||
LoadRecomputable (AIS_WireFrame);
|
SetToUpdate();
|
||||||
LoadRecomputable (AIS_Shaded);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -157,8 +155,7 @@ void AIS_ColoredShape::UnsetCustomAspects (const TopoDS_Shape& theShape,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadRecomputable (AIS_WireFrame);
|
SetToUpdate();
|
||||||
LoadRecomputable (AIS_Shaded);
|
|
||||||
if (theToUnregister)
|
if (theToUnregister)
|
||||||
{
|
{
|
||||||
myShapeColors.UnBind (theShape);
|
myShapeColors.UnBind (theShape);
|
||||||
@@ -183,8 +180,6 @@ void AIS_ColoredShape::SetCustomColor (const TopoDS_Shape& theShape,
|
|||||||
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
|
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
|
||||||
setColor (aDrawer, theColor);
|
setColor (aDrawer, theColor);
|
||||||
aDrawer->SetOwnColor (theColor);
|
aDrawer->SetOwnColor (theColor);
|
||||||
LoadRecomputable (AIS_WireFrame);
|
|
||||||
LoadRecomputable (AIS_Shaded);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -202,8 +197,6 @@ void AIS_ColoredShape::SetCustomTransparency (const TopoDS_Shape& theShape,
|
|||||||
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
|
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
|
||||||
setTransparency (aDrawer, theTransparency);
|
setTransparency (aDrawer, theTransparency);
|
||||||
aDrawer->SetOwnTransparency (theTransparency);
|
aDrawer->SetOwnTransparency (theTransparency);
|
||||||
LoadRecomputable (AIS_WireFrame);
|
|
||||||
LoadRecomputable (AIS_Shaded);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -221,8 +214,6 @@ void AIS_ColoredShape::SetCustomWidth (const TopoDS_Shape& theShape,
|
|||||||
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
|
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
|
||||||
setWidth (aDrawer, theLineWidth);
|
setWidth (aDrawer, theLineWidth);
|
||||||
aDrawer->SetOwnWidth (theLineWidth);
|
aDrawer->SetOwnWidth (theLineWidth);
|
||||||
LoadRecomputable (AIS_WireFrame);
|
|
||||||
LoadRecomputable (AIS_Shaded);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -352,7 +352,7 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt
|
|||||||
Handle(Font_FTFont) aFont = new Font_FTFont();
|
Handle(Font_FTFont) aFont = new Font_FTFont();
|
||||||
aFont->Init (aTextAspect->Aspect()->Font().ToCString(),
|
aFont->Init (aTextAspect->Aspect()->Font().ToCString(),
|
||||||
aTextAspect->Aspect()->GetTextFontAspect(),
|
aTextAspect->Aspect()->GetTextFontAspect(),
|
||||||
(const unsigned int)aTextAspect->Height(),
|
(unsigned int )aTextAspect->Height(),
|
||||||
THE_2D_TEXT_RESOLUTION);
|
THE_2D_TEXT_RESOLUTION);
|
||||||
|
|
||||||
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
|
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
|
||||||
|
@@ -952,7 +952,8 @@ void AIS_InteractiveContext::RecomputePrsOnly (const Handle(AIS_InteractiveObjec
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
theIObj->Update (theAllModes);
|
theIObj->SetToUpdate();
|
||||||
|
theIObj->UpdatePresentations (theAllModes);
|
||||||
if (!theToUpdateViewer)
|
if (!theToUpdateViewer)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -1006,13 +1007,7 @@ void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIOb
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TColStd_ListOfInteger aPrsModes;
|
theIObj->UpdatePresentations();
|
||||||
theIObj->ToBeUpdated (aPrsModes);
|
|
||||||
for (TColStd_ListIteratorOfListOfInteger aPrsModesIt (aPrsModes); aPrsModesIt.More(); aPrsModesIt.Next())
|
|
||||||
{
|
|
||||||
theIObj->Update (aPrsModesIt.Value(), Standard_False);
|
|
||||||
}
|
|
||||||
|
|
||||||
mgrSelector->Update(theIObj);
|
mgrSelector->Update(theIObj);
|
||||||
|
|
||||||
if (theUpdateViewer)
|
if (theUpdateViewer)
|
||||||
@@ -1369,63 +1364,6 @@ void AIS_InteractiveContext::SetCurrentFacingModel (const Handle(AIS_Interactive
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : redisplayPrsRecModes
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void AIS_InteractiveContext::redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj,
|
|
||||||
const Standard_Boolean theToUpdateViewer)
|
|
||||||
{
|
|
||||||
if (theIObj->RecomputeEveryPrs())
|
|
||||||
{
|
|
||||||
theIObj->Update (Standard_True);
|
|
||||||
theIObj->UpdateSelection();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (TColStd_ListIteratorOfListOfInteger aModes (theIObj->ListOfRecomputeModes()); aModes.More(); aModes.Next())
|
|
||||||
{
|
|
||||||
theIObj->Update (aModes.Value(), Standard_False);
|
|
||||||
}
|
|
||||||
theIObj->UpdateSelection();
|
|
||||||
theIObj->SetRecomputeOk();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (theToUpdateViewer)
|
|
||||||
{
|
|
||||||
UpdateCurrentViewer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : redisplayPrsModes
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void AIS_InteractiveContext::redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj,
|
|
||||||
const Standard_Boolean theToUpdateViewer)
|
|
||||||
{
|
|
||||||
if (theIObj->RecomputeEveryPrs())
|
|
||||||
{
|
|
||||||
theIObj->Update (Standard_True);
|
|
||||||
theIObj->UpdateSelection();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TColStd_ListOfInteger aModes;
|
|
||||||
theIObj->ToBeUpdated (aModes);
|
|
||||||
for (TColStd_ListIteratorOfListOfInteger aModeIter (aModes); aModeIter.More(); aModeIter.Next())
|
|
||||||
{
|
|
||||||
theIObj->Update (aModeIter.Value(), Standard_False);
|
|
||||||
}
|
|
||||||
theIObj->SetRecomputeOk();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (theToUpdateViewer)
|
|
||||||
{
|
|
||||||
UpdateCurrentViewer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetColor
|
//function : SetColor
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -1441,7 +1379,11 @@ void AIS_InteractiveContext::SetColor (const Handle(AIS_InteractiveObject)& theI
|
|||||||
|
|
||||||
setContextToObject (theIObj);
|
setContextToObject (theIObj);
|
||||||
theIObj->SetColor (theColor);
|
theIObj->SetColor (theColor);
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
theIObj->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1486,7 +1428,11 @@ void AIS_InteractiveContext::SetDeviationCoefficient (const Handle(AIS_Interacti
|
|||||||
|
|
||||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||||
aShape->SetOwnDeviationCoefficient (theCoefficient);
|
aShape->SetOwnDeviationCoefficient (theCoefficient);
|
||||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
aShape->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1516,7 +1462,11 @@ void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Handle(AIS_Intera
|
|||||||
|
|
||||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||||
aShape->SetOwnHLRDeviationCoefficient (theCoefficient);
|
aShape->SetOwnHLRDeviationCoefficient (theCoefficient);
|
||||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
aShape->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1545,7 +1495,11 @@ void AIS_InteractiveContext::SetDeviationAngle (const Handle(AIS_InteractiveObje
|
|||||||
|
|
||||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||||
aShape->SetOwnDeviationAngle (theAngle);
|
aShape->SetOwnDeviationAngle (theAngle);
|
||||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
aShape->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1574,15 +1528,10 @@ void AIS_InteractiveContext::SetAngleAndDeviation (const Handle(AIS_InteractiveO
|
|||||||
|
|
||||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||||
aShape->SetAngleAndDeviation (theAngle);
|
aShape->SetAngleAndDeviation (theAngle);
|
||||||
|
aShape->UpdatePresentations();
|
||||||
if (theIObj->RecomputeEveryPrs())
|
if (theToUpdateViewer)
|
||||||
{
|
{
|
||||||
theIObj->Update (Standard_True);
|
UpdateCurrentViewer();
|
||||||
theIObj->UpdateSelection();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Update (theIObj, theToUpdateViewer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1611,7 +1560,11 @@ void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Handle(AIS_Interacti
|
|||||||
}
|
}
|
||||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||||
aShape->SetHLRAngleAndDeviation (theAngle);
|
aShape->SetHLRAngleAndDeviation (theAngle);
|
||||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
aShape->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1639,7 +1592,11 @@ void AIS_InteractiveContext::SetHLRDeviationAngle (const Handle(AIS_InteractiveO
|
|||||||
}
|
}
|
||||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||||
aShape->SetOwnHLRDeviationAngle (theAngle);
|
aShape->SetOwnHLRDeviationAngle (theAngle);
|
||||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
aShape->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1655,7 +1612,11 @@ void AIS_InteractiveContext::UnsetColor (const Handle(AIS_InteractiveObject)& th
|
|||||||
}
|
}
|
||||||
|
|
||||||
theIObj->UnsetColor();
|
theIObj->UnsetColor();
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
theIObj->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1701,7 +1662,7 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
|
|||||||
|
|
||||||
setContextToObject (theIObj);
|
setContextToObject (theIObj);
|
||||||
theIObj->SetWidth (theWidth);
|
theIObj->SetWidth (theWidth);
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
theIObj->UpdatePresentations();
|
||||||
if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
|
if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
|
||||||
{
|
{
|
||||||
if (myLastinMain->IsAutoHilight())
|
if (myLastinMain->IsAutoHilight())
|
||||||
@@ -1718,6 +1679,10 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
|
|||||||
myLastinMain);
|
myLastinMain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1733,7 +1698,11 @@ void AIS_InteractiveContext::UnsetWidth (const Handle(AIS_InteractiveObject)& th
|
|||||||
}
|
}
|
||||||
|
|
||||||
theIObj->UnsetWidth();
|
theIObj->UnsetWidth();
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
theIObj->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1751,7 +1720,11 @@ void AIS_InteractiveContext::SetMaterial (const Handle(AIS_InteractiveObject)& t
|
|||||||
|
|
||||||
setContextToObject (theIObj);
|
setContextToObject (theIObj);
|
||||||
theIObj->SetMaterial (theMaterial);
|
theIObj->SetMaterial (theMaterial);
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
theIObj->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1766,7 +1739,11 @@ void AIS_InteractiveContext::UnsetMaterial (const Handle(AIS_InteractiveObject)&
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
theIObj->UnsetMaterial();
|
theIObj->UnsetMaterial();
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
theIObj->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1796,7 +1773,11 @@ void AIS_InteractiveContext::SetTransparency (const Handle(AIS_InteractiveObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
theIObj->SetTransparency (theValue);
|
theIObj->SetTransparency (theValue);
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
theIObj->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -1812,7 +1793,11 @@ void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObje
|
|||||||
}
|
}
|
||||||
|
|
||||||
theIObj->UnsetTransparency();
|
theIObj->UnsetTransparency();
|
||||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
theIObj->UpdatePresentations();
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
UpdateCurrentViewer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -1082,6 +1082,7 @@ public: //! @name iso-line display attributes
|
|||||||
//! Returns true if drawing isolines on triangulation algorithm is enabled.
|
//! Returns true if drawing isolines on triangulation algorithm is enabled.
|
||||||
Standard_EXPORT Standard_Boolean IsoOnTriangulation() const;
|
Standard_EXPORT Standard_Boolean IsoOnTriangulation() const;
|
||||||
|
|
||||||
|
//! @name obsolete methods
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Updates the view of the current object in open context.
|
//! Updates the view of the current object in open context.
|
||||||
@@ -1207,14 +1208,6 @@ protected: //! @name internal methods
|
|||||||
Standard_EXPORT void InitAttributes();
|
Standard_EXPORT void InitAttributes();
|
||||||
|
|
||||||
Standard_EXPORT Standard_Integer PurgeViewer (const Handle(V3d_Viewer)& Vwr);
|
Standard_EXPORT Standard_Integer PurgeViewer (const Handle(V3d_Viewer)& Vwr);
|
||||||
|
|
||||||
//! UNKNOWN
|
|
||||||
Standard_EXPORT void redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj,
|
|
||||||
const Standard_Boolean theToUpdateViewer);
|
|
||||||
|
|
||||||
//! UNKNOWN
|
|
||||||
Standard_EXPORT void redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj,
|
|
||||||
const Standard_Boolean theToUpdateViewer);
|
|
||||||
|
|
||||||
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
|
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
|
||||||
Standard_EXPORT void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);
|
Standard_EXPORT void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);
|
||||||
|
@@ -52,12 +52,11 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveObject,SelectMgr_SelectableObject)
|
|||||||
AIS_InteractiveObject::AIS_InteractiveObject (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d)
|
AIS_InteractiveObject::AIS_InteractiveObject (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d)
|
||||||
: SelectMgr_SelectableObject (aTypeOfPresentation3d),
|
: SelectMgr_SelectableObject (aTypeOfPresentation3d),
|
||||||
myCTXPtr (NULL),
|
myCTXPtr (NULL),
|
||||||
myOwnWidth (0.0),
|
myOwnWidth (0.0f),
|
||||||
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
|
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
|
||||||
myInfiniteState (Standard_False),
|
myInfiniteState (Standard_False),
|
||||||
hasOwnColor (Standard_False),
|
hasOwnColor (Standard_False),
|
||||||
hasOwnMaterial (Standard_False),
|
hasOwnMaterial (Standard_False)
|
||||||
myRecomputeEveryPrs (Standard_True)
|
|
||||||
{
|
{
|
||||||
SetCurrentFacingModel();
|
SetCurrentFacingModel();
|
||||||
}
|
}
|
||||||
@@ -90,14 +89,6 @@ AIS_KindOfInteractive AIS_InteractiveObject::Type() const
|
|||||||
Standard_Integer AIS_InteractiveObject::Signature() const
|
Standard_Integer AIS_InteractiveObject::Signature() const
|
||||||
{return -1;}
|
{return -1;}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : RecomputeEveryPrs
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
Standard_Boolean AIS_InteractiveObject::RecomputeEveryPrs() const
|
|
||||||
{return myRecomputeEveryPrs;}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function :
|
//function :
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -200,7 +191,7 @@ void AIS_InteractiveObject::UnsetColor()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
|
void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
|
||||||
{
|
{
|
||||||
myOwnWidth = aValue;
|
myOwnWidth = (Standard_ShortReal )aValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -209,7 +200,7 @@ void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_InteractiveObject::UnsetWidth()
|
void AIS_InteractiveObject::UnsetWidth()
|
||||||
{
|
{
|
||||||
myOwnWidth = 0.;
|
myOwnWidth = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -333,32 +324,10 @@ void AIS_InteractiveObject::UnsetAttributes()
|
|||||||
|
|
||||||
hasOwnColor = Standard_False;
|
hasOwnColor = Standard_False;
|
||||||
hasOwnMaterial = Standard_False;
|
hasOwnMaterial = Standard_False;
|
||||||
myOwnWidth = 0.0;
|
myOwnWidth = 0.0f;
|
||||||
myDrawer->SetTransparency (0.0f);
|
myDrawer->SetTransparency (0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function :
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void AIS_InteractiveObject::MustRecomputePrs(const Standard_Integer ) const
|
|
||||||
{}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function :
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
const TColStd_ListOfInteger& AIS_InteractiveObject::ListOfRecomputeModes() const
|
|
||||||
{return myToRecomputeModes;}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function :
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void AIS_InteractiveObject::SetRecomputeOk()
|
|
||||||
{myToRecomputeModes.Clear();}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AcceptDisplayMode
|
//function : AcceptDisplayMode
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -283,7 +283,7 @@ public:
|
|||||||
virtual void Color (Quantity_Color& theColor) const { theColor = myDrawer->Color(); }
|
virtual void Color (Quantity_Color& theColor) const { theColor = myDrawer->Color(); }
|
||||||
|
|
||||||
//! Returns true if the Interactive Object has width.
|
//! Returns true if the Interactive Object has width.
|
||||||
Standard_Boolean HasWidth() const { return myOwnWidth != 0.0; }
|
Standard_Boolean HasWidth() const { return myOwnWidth != 0.0f; }
|
||||||
|
|
||||||
//! Returns the width setting of the Interactive Object.
|
//! Returns the width setting of the Interactive Object.
|
||||||
Standard_Real Width() const { return myOwnWidth; }
|
Standard_Real Width() const { return myOwnWidth; }
|
||||||
@@ -395,36 +395,19 @@ protected:
|
|||||||
//! and then modify them directly followed by SynchronizeAspects() call.
|
//! and then modify them directly followed by SynchronizeAspects() call.
|
||||||
Standard_EXPORT void replaceAspects (const Graphic3d_MapOfAspectsToAspects& theMap);
|
Standard_EXPORT void replaceAspects (const Graphic3d_MapOfAspectsToAspects& theMap);
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Standard_EXPORT virtual Standard_Boolean RecomputeEveryPrs() const;
|
|
||||||
|
|
||||||
Standard_EXPORT void MustRecomputePrs (const Standard_Integer aMode) const;
|
|
||||||
|
|
||||||
Standard_EXPORT const TColStd_ListOfInteger& ListOfRecomputeModes() const;
|
|
||||||
|
|
||||||
Standard_EXPORT void SetRecomputeOk();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
//! The TypeOfPresention3d means that the interactive object
|
//! The TypeOfPresention3d means that the interactive object
|
||||||
//! may have a presentation dependant of the view of Display.
|
//! may have a presentation dependant of the view of Display.
|
||||||
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
|
|
||||||
AIS_InteractiveContext* myCTXPtr;
|
AIS_InteractiveContext* myCTXPtr;
|
||||||
Handle(Standard_Transient) myOwner;
|
Handle(Standard_Transient) myOwner;
|
||||||
|
Standard_ShortReal myOwnWidth;
|
||||||
protected:
|
|
||||||
|
|
||||||
TColStd_ListOfInteger myToRecomputeModes;
|
|
||||||
Standard_Real myOwnWidth;
|
|
||||||
Aspect_TypeOfFacingModel myCurrentFacingModel;
|
Aspect_TypeOfFacingModel myCurrentFacingModel;
|
||||||
Standard_Boolean myInfiniteState;
|
Standard_Boolean myInfiniteState;
|
||||||
Standard_Boolean hasOwnColor;
|
Standard_Boolean hasOwnColor;
|
||||||
Standard_Boolean hasOwnMaterial;
|
Standard_Boolean hasOwnMaterial;
|
||||||
Standard_Boolean myRecomputeEveryPrs;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -41,52 +41,6 @@
|
|||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_Line,AIS_InteractiveObject)
|
IMPLEMENT_STANDARD_RTTIEXT(AIS_Line,AIS_InteractiveObject)
|
||||||
|
|
||||||
//==================================================================
|
|
||||||
// function: FindLimits
|
|
||||||
// purpose:
|
|
||||||
//==================================================================
|
|
||||||
//unused
|
|
||||||
/*#ifdef OCCT_DEBUG
|
|
||||||
static void FindLimits(const Adaptor3d_Curve& aCurve,
|
|
||||||
const Standard_Real aLimit,
|
|
||||||
gp_Pnt& P1,
|
|
||||||
gp_Pnt& P2)
|
|
||||||
{
|
|
||||||
Standard_Real First = aCurve.FirstParameter();
|
|
||||||
Standard_Real Last = aCurve.LastParameter();
|
|
||||||
Standard_Boolean firstInf = Precision::IsNegativeInfinite(First);
|
|
||||||
Standard_Boolean lastInf = Precision::IsPositiveInfinite(Last);
|
|
||||||
if (firstInf || lastInf) {
|
|
||||||
Standard_Real delta = 1;
|
|
||||||
if (firstInf && lastInf) {
|
|
||||||
do {
|
|
||||||
delta *= 2;
|
|
||||||
First = - delta;
|
|
||||||
Last = delta;
|
|
||||||
aCurve.D0(First,P1);
|
|
||||||
aCurve.D0(Last,P2);
|
|
||||||
} while (P1.Distance(P2) < aLimit);
|
|
||||||
}
|
|
||||||
else if (firstInf) {
|
|
||||||
aCurve.D0(Last,P2);
|
|
||||||
do {
|
|
||||||
delta *= 2;
|
|
||||||
First = Last - delta;
|
|
||||||
aCurve.D0(First,P1);
|
|
||||||
} while (P1.Distance(P2) < aLimit);
|
|
||||||
}
|
|
||||||
else if (lastInf) {
|
|
||||||
aCurve.D0(First,P1);
|
|
||||||
do {
|
|
||||||
delta *= 2;
|
|
||||||
Last = First + delta;
|
|
||||||
aCurve.D0(Last,P2);
|
|
||||||
} while (P1.Distance(P2) < aLimit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AIS_Line
|
//function : AIS_Line
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -126,8 +80,7 @@ void AIS_Line::Compute(const Handle(PrsMgr_PresentationManager3d)&,
|
|||||||
|
|
||||||
void AIS_Line::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
|
void AIS_Line::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
|
||||||
{
|
{
|
||||||
// throw Standard_NotImplemented("AIS_Line::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
|
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
|
||||||
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -152,6 +105,29 @@ void AIS_Line::ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : replaceWithNewLineAspect
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void AIS_Line::replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||||
|
{
|
||||||
|
if (!myDrawer->HasLink())
|
||||||
|
{
|
||||||
|
myDrawer->SetLineAspect (theAspect);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Handle(Graphic3d_Aspects)& anAspectOld = myDrawer->LineAspect()->Aspect();
|
||||||
|
const Handle(Graphic3d_Aspects)& anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->LineAspect()->Aspect();
|
||||||
|
if (anAspectNew != anAspectOld)
|
||||||
|
{
|
||||||
|
myDrawer->SetLineAspect (theAspect);
|
||||||
|
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||||
|
aReplaceMap.Bind (anAspectOld, anAspectNew);
|
||||||
|
replaceAspects (aReplaceMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetColor
|
//function : SetColor
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -165,10 +141,15 @@ void AIS_Line::SetColor(const Quantity_Color &aCol)
|
|||||||
myDrawer->HasLink() ?
|
myDrawer->HasLink() ?
|
||||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
||||||
|
|
||||||
if (!myDrawer->HasOwnLineAspect ())
|
if (!myDrawer->HasOwnLineAspect())
|
||||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
{
|
||||||
|
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
myDrawer->LineAspect()->SetColor(aCol);
|
{
|
||||||
|
myDrawer->LineAspect()->SetColor (aCol);
|
||||||
|
SynchronizeAspects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -180,16 +161,19 @@ void AIS_Line::UnsetColor()
|
|||||||
{
|
{
|
||||||
hasOwnColor = Standard_False;
|
hasOwnColor = Standard_False;
|
||||||
|
|
||||||
Handle(Prs3d_LineAspect) NullAsp;
|
if (!HasWidth())
|
||||||
|
{
|
||||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
|
||||||
else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||||
if( HasColor() ) CC = myDrawer->Color();
|
if( HasColor() ) CC = myDrawer->Color();
|
||||||
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||||
myDrawer->LineAspect()->SetColor(CC);
|
myDrawer->LineAspect()->SetColor(CC);
|
||||||
myDrawer->SetColor (CC);
|
myDrawer->SetColor (CC);
|
||||||
}
|
SynchronizeAspects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -198,15 +182,20 @@ void AIS_Line::UnsetColor()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Line::SetWidth(const Standard_Real aValue)
|
void AIS_Line::SetWidth(const Standard_Real aValue)
|
||||||
{
|
{
|
||||||
myOwnWidth=aValue;
|
myOwnWidth = (Standard_ShortReal )aValue;
|
||||||
|
|
||||||
if (!myDrawer->HasOwnLineAspect ()) {
|
if (!myDrawer->HasOwnLineAspect())
|
||||||
|
{
|
||||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||||
if( HasColor() ) CC = myDrawer->Color();
|
if( HasColor() ) CC = myDrawer->Color();
|
||||||
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
|
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
|
||||||
} else
|
}
|
||||||
myDrawer->LineAspect()->SetWidth(aValue);
|
else
|
||||||
|
{
|
||||||
|
myDrawer->LineAspect()->SetWidth (aValue);
|
||||||
|
SynchronizeAspects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -216,14 +205,16 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Line::UnsetWidth()
|
void AIS_Line::UnsetWidth()
|
||||||
{
|
{
|
||||||
Handle(Prs3d_LineAspect) NullAsp;
|
if (!HasColor())
|
||||||
|
{
|
||||||
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
|
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
|
||||||
else{
|
}
|
||||||
Standard_Real WW = myDrawer->HasLink() ?
|
else
|
||||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
{
|
||||||
myDrawer->LineAspect()->SetWidth(WW);
|
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.0f;
|
||||||
|
myDrawer->LineAspect()->SetWidth (WW);
|
||||||
myOwnWidth = WW;
|
myOwnWidth = WW;
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -107,6 +107,9 @@ private:
|
|||||||
|
|
||||||
Standard_EXPORT void ComputeSegmentLineSelection (const Handle(SelectMgr_Selection)& aSelection);
|
Standard_EXPORT void ComputeSegmentLineSelection (const Handle(SelectMgr_Selection)& aSelection);
|
||||||
|
|
||||||
|
//! Replace aspects of already computed groups with the new value.
|
||||||
|
void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Handle(Geom_Line) myComponent;
|
Handle(Geom_Line) myComponent;
|
||||||
|
@@ -297,7 +297,7 @@ void AIS_Manipulator::SetPart (const Standard_Integer theAxisIndex, const AIS_Ma
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Manipulator::SetPart (const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled)
|
void AIS_Manipulator::SetPart (const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled)
|
||||||
{
|
{
|
||||||
for (Standard_Integer anIt = 0; anIt < 4; ++anIt)
|
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||||
{
|
{
|
||||||
SetPart (anIt, theMode, theIsEnabled);
|
SetPart (anIt, theMode, theIsEnabled);
|
||||||
}
|
}
|
||||||
|
250
src/AIS/AIS_MediaPlayer.cxx
Normal file
250
src/AIS/AIS_MediaPlayer.cxx
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
// Created by: Kirill GAVRILOV
|
||||||
|
// Copyright (c) 2019 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// This file is part of Open CASCADE Technology software library.
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or modify it under
|
||||||
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||||
|
// by the Free Software Foundation, with special exception defined in the file
|
||||||
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||||
|
// distribution for complete text of the license and disclaimer of any warranty.
|
||||||
|
//
|
||||||
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#include <AIS_MediaPlayer.hxx>
|
||||||
|
|
||||||
|
#include <AIS_InteractiveContext.hxx>
|
||||||
|
#include <Media_PlayerContext.hxx>
|
||||||
|
#include <Message.hxx>
|
||||||
|
#include <Message_Messenger.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||||
|
#include <Graphic3d_MediaTexture.hxx>
|
||||||
|
#include <SelectMgr_EntityOwner.hxx>
|
||||||
|
#include <Select3D_SensitivePrimitiveArray.hxx>
|
||||||
|
#include <V3d_Viewer.hxx>
|
||||||
|
|
||||||
|
IMPLEMENT_STANDARD_RTTIEXT(AIS_MediaPlayer, AIS_InteractiveObject)
|
||||||
|
|
||||||
|
//! Create an array of triangles defining a rectangle.
|
||||||
|
static Handle(Graphic3d_ArrayOfTriangles) createRectangleArray (const Graphic3d_Vec2i& theLower,
|
||||||
|
const Graphic3d_Vec2i& theUpper,
|
||||||
|
Graphic3d_ArrayFlags theFlags)
|
||||||
|
{
|
||||||
|
Handle(Graphic3d_ArrayOfTriangles) aRectTris = new Graphic3d_ArrayOfTriangles (4, 6, theFlags);
|
||||||
|
aRectTris->AddVertex (gp_Pnt (theLower.x(), theLower.y(), 0.0), gp_Pnt2d (0.0, 1.0));
|
||||||
|
aRectTris->AddVertex (gp_Pnt (theLower.x(), theUpper.y(), 0.0), gp_Pnt2d (0.0, 0.0));
|
||||||
|
aRectTris->AddVertex (gp_Pnt (theUpper.x(), theUpper.y(), 0.0), gp_Pnt2d (1.0, 0.0));
|
||||||
|
aRectTris->AddVertex (gp_Pnt (theUpper.x(), theLower.y(), 0.0), gp_Pnt2d (1.0, 1.0));
|
||||||
|
aRectTris->AddEdges (1, 2, 3);
|
||||||
|
aRectTris->AddEdges (1, 3, 4);
|
||||||
|
return aRectTris;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : AIS_MediaPlayer
|
||||||
|
// Purpose :
|
||||||
|
//================================================================
|
||||||
|
AIS_MediaPlayer::AIS_MediaPlayer()
|
||||||
|
: myFramePair (new Graphic3d_MediaTextureSet()),
|
||||||
|
myFrameSize (1, 1),
|
||||||
|
myToClosePlayer (false)
|
||||||
|
{
|
||||||
|
SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_2d, Aspect_TOTP_LEFT_LOWER));
|
||||||
|
SetZLayer (Graphic3d_ZLayerId_TopOSD);
|
||||||
|
SetInfiniteState (true);
|
||||||
|
|
||||||
|
Graphic3d_MaterialAspect aMat;
|
||||||
|
myFrameAspect = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_WHITE, Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0f, aMat, aMat);
|
||||||
|
myFrameAspect->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||||
|
myFrameAspect->SetTextureMapOn (true);
|
||||||
|
myFrameAspect->SetTextureSet (myFramePair);
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================
|
||||||
|
// Function : ~AIS_MediaPlayer
|
||||||
|
// Purpose :
|
||||||
|
//================================================================
|
||||||
|
AIS_MediaPlayer::~AIS_MediaPlayer()
|
||||||
|
{
|
||||||
|
// stop threads
|
||||||
|
myFramePair.Nullify();
|
||||||
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : OpenInput
|
||||||
|
// purpose :
|
||||||
|
// =======================================================================
|
||||||
|
void AIS_MediaPlayer::OpenInput (const TCollection_AsciiString& thePath,
|
||||||
|
Standard_Boolean theToWait)
|
||||||
|
{
|
||||||
|
if (myFramePair->PlayerContext().IsNull()
|
||||||
|
&& thePath.IsEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
myFramePair->OpenInput (thePath, theToWait);
|
||||||
|
SynchronizeAspects();
|
||||||
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : PresentFrame
|
||||||
|
// purpose :
|
||||||
|
// =======================================================================
|
||||||
|
bool AIS_MediaPlayer::PresentFrame (const Graphic3d_Vec2i& theLeftCorner,
|
||||||
|
const Graphic3d_Vec2i& theMaxSize)
|
||||||
|
{
|
||||||
|
if (myToClosePlayer)
|
||||||
|
{
|
||||||
|
myToClosePlayer = false;
|
||||||
|
if (!HasInteractiveContext())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!myFramePair->PlayerContext().IsNull())
|
||||||
|
{
|
||||||
|
myFramePair->PlayerContext()->Pause();
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(AIS_InteractiveContext) aCtx = GetContext();
|
||||||
|
Handle(AIS_InteractiveObject) aThis = this;
|
||||||
|
aCtx->Remove (aThis, false);
|
||||||
|
aCtx->CurrentViewer()->Invalidate();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myFramePair->PlayerContext().IsNull())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool toRedraw = myFramePair->SwapFrames();
|
||||||
|
toRedraw = updateSize (theLeftCorner, theMaxSize) || toRedraw;
|
||||||
|
if (toRedraw)
|
||||||
|
{
|
||||||
|
myFrameAspect->SetShaderProgram (myFramePair->ShaderProgram());
|
||||||
|
SynchronizeAspects();
|
||||||
|
}
|
||||||
|
return toRedraw;
|
||||||
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : updateSize
|
||||||
|
// purpose :
|
||||||
|
// =======================================================================
|
||||||
|
bool AIS_MediaPlayer::updateSize (const Graphic3d_Vec2i& theLeftCorner,
|
||||||
|
const Graphic3d_Vec2i& theMaxSize)
|
||||||
|
{
|
||||||
|
const Graphic3d_Vec2i aFrameSize = myFramePair->FrameSize();
|
||||||
|
Graphic3d_Vec2i aNewPos = theLeftCorner;
|
||||||
|
Graphic3d_Vec2i aNewSize = myFrameSize;
|
||||||
|
if (aFrameSize.x() > 0
|
||||||
|
&& aFrameSize.y() > 0)
|
||||||
|
{
|
||||||
|
const double anAspect = double(theMaxSize.x()) / double(theMaxSize.y());
|
||||||
|
const double aFitAspect = double(aFrameSize.x()) / double(aFrameSize.y());
|
||||||
|
aNewSize = aFrameSize;
|
||||||
|
if (aFitAspect >= anAspect)
|
||||||
|
{
|
||||||
|
aNewSize.y() = int(double(aFrameSize.x()) / aFitAspect);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aNewSize.x() = int(double(aFrameSize.y()) * aFitAspect);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int aCoord = 0; aCoord < 2; ++aCoord)
|
||||||
|
{
|
||||||
|
if (aNewSize[aCoord] > theMaxSize[aCoord])
|
||||||
|
{
|
||||||
|
const double aScale = double(theMaxSize[aCoord]) / double(aNewSize[aCoord]);
|
||||||
|
aNewSize.x() = int(double(aNewSize.x()) * aScale);
|
||||||
|
aNewSize.y() = int(double(aNewSize.y()) * aScale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aNewPos = theLeftCorner + theMaxSize / 2 - aNewSize / 2;
|
||||||
|
}
|
||||||
|
else if (myFrameSize.x() < 2
|
||||||
|
|| myFrameSize.y() < 2)
|
||||||
|
{
|
||||||
|
aNewSize = theMaxSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myFrameSize == aNewSize
|
||||||
|
&& myFrameBottomLeft == aNewPos)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
myFrameSize = aNewSize;
|
||||||
|
myFrameBottomLeft = aNewPos;
|
||||||
|
if (HasInteractiveContext())
|
||||||
|
{
|
||||||
|
SetToUpdate();
|
||||||
|
GetContext()->Redisplay (this, false);
|
||||||
|
GetContext()->CurrentViewer()->Invalidate();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : PlayPause
|
||||||
|
// purpose :
|
||||||
|
// =======================================================================
|
||||||
|
void AIS_MediaPlayer::PlayPause()
|
||||||
|
{
|
||||||
|
if (myFramePair->PlayerContext().IsNull())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Real aProgress = 0.0, aDuration = 0.0;
|
||||||
|
bool isPaused = false;
|
||||||
|
myFramePair->PlayerContext()->PlayPause (isPaused, aProgress, aDuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : Compute
|
||||||
|
// purpose :
|
||||||
|
// =======================================================================
|
||||||
|
void AIS_MediaPlayer::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
|
||||||
|
const Handle(Prs3d_Presentation)& thePrs,
|
||||||
|
const Standard_Integer theMode)
|
||||||
|
{
|
||||||
|
thePrs->SetInfiniteState (IsInfinite());
|
||||||
|
if (theMode != 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// main frame
|
||||||
|
{
|
||||||
|
Handle(Graphic3d_ArrayOfTriangles) aTris = createRectangleArray (myFrameBottomLeft, myFrameBottomLeft + myFrameSize, Graphic3d_ArrayFlags_VertexTexel);
|
||||||
|
Handle(Graphic3d_Group) aMainGroup = thePrs->NewGroup();
|
||||||
|
aMainGroup->SetGroupPrimitivesAspect (myFrameAspect);
|
||||||
|
aMainGroup->AddPrimitiveArray (aTris);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : ComputeSelection
|
||||||
|
// purpose :
|
||||||
|
// =======================================================================
|
||||||
|
void AIS_MediaPlayer::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
|
||||||
|
const Standard_Integer theMode)
|
||||||
|
{
|
||||||
|
if (theMode != 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfTriangles) aTris = createRectangleArray (myFrameBottomLeft, myFrameBottomLeft + myFrameSize, Graphic3d_ArrayFlags_None);
|
||||||
|
|
||||||
|
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this, 5);
|
||||||
|
Handle(Select3D_SensitivePrimitiveArray) aSens = new Select3D_SensitivePrimitiveArray (anOwner);
|
||||||
|
aSens->InitTriangulation (aTris->Attributes(), aTris->Indices(), TopLoc_Location());
|
||||||
|
theSel->Add (aSens);
|
||||||
|
}
|
96
src/AIS/AIS_MediaPlayer.hxx
Normal file
96
src/AIS/AIS_MediaPlayer.hxx
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
// Created by: Kirill GAVRILOV
|
||||||
|
// Copyright (c) 2019 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// This file is part of Open CASCADE Technology software library.
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or modify it under
|
||||||
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||||
|
// by the Free Software Foundation, with special exception defined in the file
|
||||||
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||||
|
// distribution for complete text of the license and disclaimer of any warranty.
|
||||||
|
//
|
||||||
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#ifndef _AIS_MediaPlayer_HeaderFile
|
||||||
|
#define _AIS_MediaPlayer_HeaderFile
|
||||||
|
|
||||||
|
#include <AIS_InteractiveObject.hxx>
|
||||||
|
#include <Graphic3d_MediaTextureSet.hxx>
|
||||||
|
|
||||||
|
class Media_PlayerContext;
|
||||||
|
|
||||||
|
//! Presentation for video playback.
|
||||||
|
class AIS_MediaPlayer : public AIS_InteractiveObject
|
||||||
|
{
|
||||||
|
DEFINE_STANDARD_RTTIEXT(AIS_MediaPlayer, AIS_InteractiveObject)
|
||||||
|
public:
|
||||||
|
|
||||||
|
//! Empty constructor.
|
||||||
|
Standard_EXPORT AIS_MediaPlayer();
|
||||||
|
|
||||||
|
//! Destructor.
|
||||||
|
Standard_EXPORT virtual ~AIS_MediaPlayer();
|
||||||
|
|
||||||
|
//! Setup callback to be called on queue progress (e.g. when new frame should be displayed).
|
||||||
|
void SetCallback (Graphic3d_MediaTextureSet::CallbackOnUpdate_t theCallbackFunction, void* theCallbackUserPtr)
|
||||||
|
{
|
||||||
|
myFramePair->SetCallback (theCallbackFunction, theCallbackUserPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! Open specified file.
|
||||||
|
Standard_EXPORT void OpenInput (const TCollection_AsciiString& thePath,
|
||||||
|
Standard_Boolean theToWait);
|
||||||
|
|
||||||
|
//! Display new frame.
|
||||||
|
Standard_EXPORT bool PresentFrame (const Graphic3d_Vec2i& theLeftCorner,
|
||||||
|
const Graphic3d_Vec2i& theMaxSize);
|
||||||
|
|
||||||
|
//! Return player context.
|
||||||
|
const Handle(Media_PlayerContext)& PlayerContext() const { return myFramePair->PlayerContext(); }
|
||||||
|
|
||||||
|
//! Switch playback state.
|
||||||
|
Standard_EXPORT void PlayPause();
|
||||||
|
|
||||||
|
//! Schedule player to be closed.
|
||||||
|
void SetClosePlayer()
|
||||||
|
{
|
||||||
|
myToClosePlayer = true;
|
||||||
|
myFramePair->Notify();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! Return duration.
|
||||||
|
double Duration() const { return myFramePair->Duration(); }
|
||||||
|
|
||||||
|
//! @name AIS_InteractiveObject interface
|
||||||
|
protected:
|
||||||
|
|
||||||
|
//! Accept only display mode 0.
|
||||||
|
virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
|
||||||
|
|
||||||
|
//! Compute presentation.
|
||||||
|
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
|
||||||
|
const Handle(Prs3d_Presentation)& thePrs,
|
||||||
|
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
//! Compute selection
|
||||||
|
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
|
||||||
|
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
//! Update frame size.
|
||||||
|
Standard_EXPORT bool updateSize (const Graphic3d_Vec2i& theLeftCorner,
|
||||||
|
const Graphic3d_Vec2i& theMaxSize);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
Handle(Graphic3d_MediaTextureSet) myFramePair;
|
||||||
|
Handle(Graphic3d_AspectFillArea3d) myFrameAspect;
|
||||||
|
Graphic3d_Vec2i myFrameBottomLeft;
|
||||||
|
Graphic3d_Vec2i myFrameSize;
|
||||||
|
bool myToClosePlayer;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _AIS_MediaPlayer_HeaderFile
|
@@ -387,7 +387,8 @@ void AIS_Plane::SetSize(const Standard_Real aXLength,
|
|||||||
|
|
||||||
|
|
||||||
myHasOwnSize = Standard_True;
|
myHasOwnSize = Standard_True;
|
||||||
Update();
|
SetToUpdate();
|
||||||
|
UpdatePresentations();
|
||||||
UpdateSelection();
|
UpdateSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,7 +419,8 @@ void AIS_Plane::UnsetSize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
myHasOwnSize = Standard_False;
|
myHasOwnSize = Standard_False;
|
||||||
Update();
|
SetToUpdate();
|
||||||
|
UpdatePresentations();
|
||||||
UpdateSelection();
|
UpdateSelection();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -248,6 +248,7 @@ void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
|
|||||||
myDrawer->SetColor (aCol);
|
myDrawer->SetColor (aCol);
|
||||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
|
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
|
||||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
|
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@ public:
|
|||||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
|
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
|
||||||
|
|
||||||
//! Allows you to provide settings for the color aColor.
|
//! Allows you to provide settings for the color aColor.
|
||||||
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||||
|
|
||||||
void SetXLabel (const TCollection_AsciiString& theLabel) { myXLabel = theLabel; }
|
void SetXLabel (const TCollection_AsciiString& theLabel) { myXLabel = theLabel; }
|
||||||
|
|
||||||
|
@@ -205,6 +205,29 @@ void AIS_Point::UnsetMarker()
|
|||||||
|| theMode == -99;
|
|| theMode == -99;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : replaceWithNewPointAspect
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void AIS_Point::replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
|
||||||
|
{
|
||||||
|
if (!myDrawer->HasLink())
|
||||||
|
{
|
||||||
|
myDrawer->SetPointAspect (theAspect);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Handle(Graphic3d_AspectMarker3d) anAspectOld = myDrawer->PointAspect()->Aspect();
|
||||||
|
const Handle(Graphic3d_AspectMarker3d) anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->PointAspect()->Aspect();
|
||||||
|
if (anAspectNew != anAspectOld)
|
||||||
|
{
|
||||||
|
myDrawer->SetPointAspect (theAspect);
|
||||||
|
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||||
|
aReplaceMap.Bind (anAspectOld, anAspectNew);
|
||||||
|
replaceAspects (aReplaceMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : UpdatePointValues
|
//function : UpdatePointValues
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -212,12 +235,14 @@ void AIS_Point::UnsetMarker()
|
|||||||
|
|
||||||
void AIS_Point::UpdatePointValues()
|
void AIS_Point::UpdatePointValues()
|
||||||
{
|
{
|
||||||
|
if (!hasOwnColor
|
||||||
if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM)
|
&& myOwnWidth == 0.0f
|
||||||
|
&& !myHasTOM)
|
||||||
{
|
{
|
||||||
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
|
replaceWithNewPointAspect (Handle(Prs3d_PointAspect)());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Quantity_Color aCol (Quantity_NOC_YELLOW);
|
Quantity_Color aCol (Quantity_NOC_YELLOW);
|
||||||
Aspect_TypeOfMarker aTOM = Aspect_TOM_PLUS;
|
Aspect_TypeOfMarker aTOM = Aspect_TOM_PLUS;
|
||||||
Standard_Real aScale = 1.0;
|
Standard_Real aScale = 1.0;
|
||||||
@@ -229,20 +254,20 @@ void AIS_Point::UpdatePointValues()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(hasOwnColor) aCol = myDrawer->Color();
|
if(hasOwnColor) aCol = myDrawer->Color();
|
||||||
if(myOwnWidth!=0.0) aScale = myOwnWidth;
|
if(myOwnWidth != 0.0f) aScale = myOwnWidth;
|
||||||
if(myHasTOM) aTOM = myTOM;
|
if(myHasTOM) aTOM = myTOM;
|
||||||
|
|
||||||
|
if(myDrawer->HasOwnPointAspect())
|
||||||
if(myDrawer->HasOwnPointAspect()){
|
{
|
||||||
// CLE
|
|
||||||
// const Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
|
||||||
Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
||||||
// ENDCLE
|
|
||||||
PA->SetColor(aCol);
|
PA->SetColor(aCol);
|
||||||
PA->SetTypeOfMarker(aTOM);
|
PA->SetTypeOfMarker(aTOM);
|
||||||
PA->SetScale(aScale);
|
PA->SetScale(aScale);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
myDrawer->SetPointAspect(new Prs3d_PointAspect(aTOM,aCol,aScale));
|
{
|
||||||
|
replaceWithNewPointAspect (new Prs3d_PointAspect (aTOM, aCol, aScale));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -59,10 +59,10 @@ public:
|
|||||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Allows you to provide settings for the Color.
|
//! Allows you to provide settings for the Color.
|
||||||
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Allows you to remove color settings.
|
//! Allows you to remove color settings.
|
||||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Allows you to provide settings for a marker. These include
|
//! Allows you to provide settings for a marker. These include
|
||||||
//! - type of marker,
|
//! - type of marker,
|
||||||
@@ -91,6 +91,9 @@ private:
|
|||||||
|
|
||||||
Standard_EXPORT void UpdatePointValues();
|
Standard_EXPORT void UpdatePointValues();
|
||||||
|
|
||||||
|
//! Replace aspects of already computed groups with the new value.
|
||||||
|
void replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Handle(Geom_Point) myComponent;
|
Handle(Geom_Point) myComponent;
|
||||||
|
@@ -68,15 +68,6 @@
|
|||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_Shape,AIS_InteractiveObject)
|
IMPLEMENT_STANDARD_RTTIEXT(AIS_Shape,AIS_InteractiveObject)
|
||||||
|
|
||||||
static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard_Integer aMode)
|
|
||||||
{
|
|
||||||
TColStd_ListIteratorOfListOfInteger It(LL);
|
|
||||||
for(;It.More();It.Next()){
|
|
||||||
if(It.Value()==aMode)
|
|
||||||
return Standard_True;}
|
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Auxiliary macros
|
// Auxiliary macros
|
||||||
#define replaceAspectWithDef(theMap, theAspect) \
|
#define replaceAspectWithDef(theMap, theAspect) \
|
||||||
if (myDrawer->Link()->theAspect()->Aspect() != myDrawer->theAspect()->Aspect()) \
|
if (myDrawer->Link()->theAspect()->Aspect() != myDrawer->theAspect()->Aspect()) \
|
||||||
@@ -411,8 +402,6 @@ void AIS_Shape::SetColor (const Quantity_Color& theColor)
|
|||||||
myDrawer->SetColor (theColor);
|
myDrawer->SetColor (theColor);
|
||||||
hasOwnColor = Standard_True;
|
hasOwnColor = Standard_True;
|
||||||
|
|
||||||
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
|
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
if (!toRecompute
|
if (!toRecompute
|
||||||
|| !myDrawer->HasLink())
|
|| !myDrawer->HasLink())
|
||||||
{
|
{
|
||||||
@@ -432,8 +421,6 @@ void AIS_Shape::SetColor (const Quantity_Color& theColor)
|
|||||||
|
|
||||||
void AIS_Shape::UnsetColor()
|
void AIS_Shape::UnsetColor()
|
||||||
{
|
{
|
||||||
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
|
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
if (!HasColor())
|
if (!HasColor())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -578,10 +565,8 @@ bool AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
|
|||||||
|
|
||||||
void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
|
void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
|
||||||
{
|
{
|
||||||
myOwnWidth = theLineWidth;
|
myOwnWidth = (Standard_ShortReal )theLineWidth;
|
||||||
|
|
||||||
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
|
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
if (!setWidth (myDrawer, theLineWidth)
|
if (!setWidth (myDrawer, theLineWidth)
|
||||||
|| !myDrawer->HasLink())
|
|| !myDrawer->HasLink())
|
||||||
{
|
{
|
||||||
@@ -601,14 +586,12 @@ void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
|
|||||||
|
|
||||||
void AIS_Shape::UnsetWidth()
|
void AIS_Shape::UnsetWidth()
|
||||||
{
|
{
|
||||||
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
|
if (myOwnWidth == 0.0f)
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
if (myOwnWidth == 0.0)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
myOwnWidth = 0.0;
|
myOwnWidth = 0.0f;
|
||||||
if (!HasColor())
|
if (!HasColor())
|
||||||
{
|
{
|
||||||
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||||
@@ -681,8 +664,6 @@ void AIS_Shape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
|||||||
setMaterial (myDrawer, theMat, HasColor(), IsTransparent());
|
setMaterial (myDrawer, theMat, HasColor(), IsTransparent());
|
||||||
hasOwnMaterial = Standard_True;
|
hasOwnMaterial = Standard_True;
|
||||||
|
|
||||||
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
|
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
if (!toRecompute
|
if (!toRecompute
|
||||||
|| !myDrawer->HasLink())
|
|| !myDrawer->HasLink())
|
||||||
{
|
{
|
||||||
@@ -701,8 +682,6 @@ void AIS_Shape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
|||||||
|
|
||||||
void AIS_Shape::UnsetMaterial()
|
void AIS_Shape::UnsetMaterial()
|
||||||
{
|
{
|
||||||
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
|
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
if (!HasMaterial())
|
if (!HasMaterial())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -761,8 +740,6 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
|
|||||||
setTransparency (myDrawer, theValue);
|
setTransparency (myDrawer, theValue);
|
||||||
myDrawer->SetTransparency ((Standard_ShortReal )theValue);
|
myDrawer->SetTransparency ((Standard_ShortReal )theValue);
|
||||||
|
|
||||||
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
|
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
if (!toRecompute
|
if (!toRecompute
|
||||||
|| !myDrawer->HasLink())
|
|| !myDrawer->HasLink())
|
||||||
{
|
{
|
||||||
@@ -781,9 +758,6 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
|
|||||||
|
|
||||||
void AIS_Shape::UnsetTransparency()
|
void AIS_Shape::UnsetTransparency()
|
||||||
{
|
{
|
||||||
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
|
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
|
|
||||||
myDrawer->SetTransparency (0.0f);
|
myDrawer->SetTransparency (0.0f);
|
||||||
if (!myDrawer->HasOwnShadingAspect())
|
if (!myDrawer->HasOwnShadingAspect())
|
||||||
{
|
{
|
||||||
@@ -805,18 +779,6 @@ void AIS_Shape::UnsetTransparency()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : LoadRecomputable
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
void AIS_Shape::LoadRecomputable(const Standard_Integer TheMode)
|
|
||||||
{
|
|
||||||
myRecomputeEveryPrs = Standard_False;
|
|
||||||
if(!IsInList(myToRecomputeModes,TheMode))
|
|
||||||
myToRecomputeModes.Append(TheMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BoundingBox
|
//function : BoundingBox
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -903,8 +865,7 @@ Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle ()
|
|||||||
void AIS_Shape::SetOwnDeviationCoefficient ( const Standard_Real aCoefficient )
|
void AIS_Shape::SetOwnDeviationCoefficient ( const Standard_Real aCoefficient )
|
||||||
{
|
{
|
||||||
myDrawer->SetDeviationCoefficient( aCoefficient );
|
myDrawer->SetDeviationCoefficient( aCoefficient );
|
||||||
SetToUpdate(0) ; // WireFrame
|
SetToUpdate();
|
||||||
SetToUpdate(1) ; // Shadding
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -923,11 +884,10 @@ void AIS_Shape::SetOwnHLRDeviationCoefficient ( const Standard_Real aCoefficien
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void AIS_Shape::SetOwnDeviationAngle ( const Standard_Real anAngle )
|
void AIS_Shape::SetOwnDeviationAngle (const Standard_Real theAngle)
|
||||||
{
|
{
|
||||||
|
myDrawer->SetDeviationAngle (theAngle);
|
||||||
myDrawer->SetDeviationAngle(anAngle );
|
SetToUpdate (AIS_WireFrame);
|
||||||
SetToUpdate(0) ; // WireFrame
|
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetOwnDeviationAngle
|
//function : SetOwnDeviationAngle
|
||||||
@@ -941,8 +901,7 @@ void AIS_Shape::SetAngleAndDeviation ( const Standard_Real anAngle )
|
|||||||
SetOwnDeviationAngle(anAngle) ;
|
SetOwnDeviationAngle(anAngle) ;
|
||||||
SetOwnDeviationCoefficient(OutDefl) ;
|
SetOwnDeviationCoefficient(OutDefl) ;
|
||||||
myInitAng = anAngle;
|
myInitAng = anAngle;
|
||||||
SetToUpdate(0);
|
SetToUpdate();
|
||||||
SetToUpdate(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -302,8 +302,6 @@ protected:
|
|||||||
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
|
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
|
||||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||||
|
|
||||||
Standard_EXPORT void LoadRecomputable (const Standard_Integer TheMode);
|
|
||||||
|
|
||||||
//! Create own aspects (if they do not exist) and set color to them.
|
//! Create own aspects (if they do not exist) and set color to them.
|
||||||
//! @return TRUE if new aspects have been created
|
//! @return TRUE if new aspects have been created
|
||||||
Standard_EXPORT bool setColor (const Handle(Prs3d_Drawer)& theDrawer, const Quantity_Color& theColor) const;
|
Standard_EXPORT bool setColor (const Handle(Prs3d_Drawer)& theDrawer, const Quantity_Color& theColor) const;
|
||||||
|
@@ -57,6 +57,7 @@ void AIS_TextLabel::SetColor (const Quantity_Color& theColor)
|
|||||||
hasOwnColor = Standard_True;
|
hasOwnColor = Standard_True;
|
||||||
myDrawer->SetColor (theColor);
|
myDrawer->SetColor (theColor);
|
||||||
myDrawer->TextAspect()->SetColor (theColor);
|
myDrawer->TextAspect()->SetColor (theColor);
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -74,6 +75,7 @@ void AIS_TextLabel::SetTransparency (const Standard_Real theValue)
|
|||||||
myDrawer->TextAspect()->Aspect()->SetColor (aTextColor);
|
myDrawer->TextAspect()->Aspect()->SetColor (aTextColor);
|
||||||
myDrawer->TextAspect()->Aspect()->SetColorSubTitle (aSubColor);
|
myDrawer->TextAspect()->Aspect()->SetColorSubTitle (aSubColor);
|
||||||
myDrawer->SetTransparency (Standard_ShortReal(theValue));
|
myDrawer->SetTransparency (Standard_ShortReal(theValue));
|
||||||
|
SynchronizeAspects();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@@ -425,7 +425,7 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t
|
|||||||
updateAttributes (thePrs);
|
updateAttributes (thePrs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
std::cout << "AIS_TexturedShape::Compute() in ShadingMode failed \n";
|
std::cout << "AIS_TexturedShape::Compute() in ShadingMode failed \n";
|
||||||
|
@@ -111,9 +111,6 @@ void AIS_Triangulation::updatePresentation()
|
|||||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myRecomputeEveryPrs = Standard_False; // no mode to recalculate - only viewer update
|
|
||||||
myToRecomputeModes.Clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,7 +85,7 @@ AIS_Trihedron::AIS_Trihedron (const Handle(Geom_Axis2Placement)& theComponent)
|
|||||||
void AIS_Trihedron::SetComponent (const Handle(Geom_Axis2Placement)& theComponent)
|
void AIS_Trihedron::SetComponent (const Handle(Geom_Axis2Placement)& theComponent)
|
||||||
{
|
{
|
||||||
myComponent = theComponent;
|
myComponent = theComponent;
|
||||||
LoadRecomputable (AIS_WireFrame);
|
SetToUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -135,7 +135,8 @@ void AIS_Trihedron::SetSize(const Standard_Real aValue)
|
|||||||
setOwnDatumAspect();
|
setOwnDatumAspect();
|
||||||
myDrawer->DatumAspect()->SetAxisLength(aValue, aValue, aValue);
|
myDrawer->DatumAspect()->SetAxisLength(aValue, aValue, aValue);
|
||||||
|
|
||||||
Update();
|
SetToUpdate();
|
||||||
|
UpdatePresentations();
|
||||||
UpdateSelection();
|
UpdateSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +163,8 @@ void AIS_Trihedron::UnsetSize()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Update();
|
SetToUpdate();
|
||||||
|
UpdatePresentations();
|
||||||
}
|
}
|
||||||
UpdateSelection();
|
UpdateSelection();
|
||||||
}
|
}
|
||||||
@@ -560,19 +562,6 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : LoadRecomputable
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void AIS_Trihedron::LoadRecomputable (const Standard_Integer theMode)
|
|
||||||
{
|
|
||||||
myRecomputeEveryPrs = Standard_False;
|
|
||||||
if (!myToRecomputeModes.Contains (theMode))
|
|
||||||
{
|
|
||||||
myToRecomputeModes.Append (theMode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetColor
|
//function : SetColor
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -224,8 +224,6 @@ protected:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Standard_EXPORT void LoadRecomputable (const Standard_Integer theMode);
|
|
||||||
|
|
||||||
//! Creates a sensitive entity for the datum part that will be used in selection owner creation.
|
//! Creates a sensitive entity for the datum part that will be used in selection owner creation.
|
||||||
Standard_EXPORT Handle(SelectBasics_SensitiveEntity) createSensitiveEntity (const Prs3d_DatumParts thePart,
|
Standard_EXPORT Handle(SelectBasics_SensitiveEntity) createSensitiveEntity (const Prs3d_DatumParts thePart,
|
||||||
const Handle(SelectBasics_EntityOwner)& theOwner) const;
|
const Handle(SelectBasics_EntityOwner)& theOwner) const;
|
||||||
|
@@ -2,7 +2,6 @@ AIS.cxx
|
|||||||
AIS.hxx
|
AIS.hxx
|
||||||
AIS_Animation.cxx
|
AIS_Animation.cxx
|
||||||
AIS_Animation.hxx
|
AIS_Animation.hxx
|
||||||
AIS_AnimationTimer.cxx
|
|
||||||
AIS_AnimationTimer.hxx
|
AIS_AnimationTimer.hxx
|
||||||
AIS_AnimationCamera.cxx
|
AIS_AnimationCamera.cxx
|
||||||
AIS_AnimationCamera.hxx
|
AIS_AnimationCamera.hxx
|
||||||
@@ -105,6 +104,8 @@ AIS_MapIteratorOfMapOfInteractive.hxx
|
|||||||
AIS_MapOfInteractive.hxx
|
AIS_MapOfInteractive.hxx
|
||||||
AIS_MaxRadiusDimension.cxx
|
AIS_MaxRadiusDimension.cxx
|
||||||
AIS_MaxRadiusDimension.hxx
|
AIS_MaxRadiusDimension.hxx
|
||||||
|
AIS_MediaPlayer.cxx
|
||||||
|
AIS_MediaPlayer.hxx
|
||||||
AIS_MidPointRelation.cxx
|
AIS_MidPointRelation.cxx
|
||||||
AIS_MidPointRelation.hxx
|
AIS_MidPointRelation.hxx
|
||||||
AIS_MidPointRelation.lxx
|
AIS_MidPointRelation.lxx
|
||||||
|
@@ -487,7 +487,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
|
|||||||
try {
|
try {
|
||||||
Variation.Approximate();
|
Variation.Approximate();
|
||||||
}
|
}
|
||||||
catch (Standard_Failure) {
|
catch (Standard_Failure const&) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -34,14 +34,14 @@
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Approx_ComputeCLine::Approx_ComputeCLine
|
Approx_ComputeCLine::Approx_ComputeCLine
|
||||||
(const MultiLine& Line,
|
(const MultiLine& Line,
|
||||||
const Standard_Integer degreemin,
|
const Standard_Integer degreemin,
|
||||||
const Standard_Integer degreemax,
|
const Standard_Integer degreemax,
|
||||||
const Standard_Real Tolerance3d,
|
const Standard_Real Tolerance3d,
|
||||||
const Standard_Real Tolerance2d,
|
const Standard_Real Tolerance2d,
|
||||||
const Standard_Boolean cutting,
|
const Standard_Boolean cutting,
|
||||||
const AppParCurves_Constraint FirstC,
|
const AppParCurves_Constraint FirstC,
|
||||||
const AppParCurves_Constraint LastC)
|
const AppParCurves_Constraint LastC)
|
||||||
{
|
{
|
||||||
mydegremin = degreemin;
|
mydegremin = degreemin;
|
||||||
mydegremax = degreemax;
|
mydegremax = degreemax;
|
||||||
@@ -61,13 +61,13 @@ Approx_ComputeCLine::Approx_ComputeCLine
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Approx_ComputeCLine::Approx_ComputeCLine
|
Approx_ComputeCLine::Approx_ComputeCLine
|
||||||
(const Standard_Integer degreemin,
|
(const Standard_Integer degreemin,
|
||||||
const Standard_Integer degreemax,
|
const Standard_Integer degreemax,
|
||||||
const Standard_Real Tolerance3d,
|
const Standard_Real Tolerance3d,
|
||||||
const Standard_Real Tolerance2d,
|
const Standard_Real Tolerance2d,
|
||||||
const Standard_Boolean cutting,
|
const Standard_Boolean cutting,
|
||||||
const AppParCurves_Constraint FirstC,
|
const AppParCurves_Constraint FirstC,
|
||||||
const AppParCurves_Constraint LastC)
|
const AppParCurves_Constraint LastC)
|
||||||
{
|
{
|
||||||
alldone = Standard_False;
|
alldone = Standard_False;
|
||||||
mydegremin = degreemin;
|
mydegremin = degreemin;
|
||||||
@@ -88,21 +88,22 @@ Approx_ComputeCLine::Approx_ComputeCLine
|
|||||||
void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
||||||
{
|
{
|
||||||
Standard_Real UFirst, ULast;
|
Standard_Real UFirst, ULast;
|
||||||
Standard_Boolean Finish = Standard_False,
|
Standard_Boolean Finish = Standard_False,
|
||||||
begin = Standard_True, Ok = Standard_False;
|
begin = Standard_True, Ok = Standard_False;
|
||||||
Standard_Real thetol3d = Precision::Confusion(), thetol2d = Precision::Confusion();
|
Standard_Real thetol3d = Precision::Confusion(), thetol2d = Precision::Confusion();
|
||||||
UFirst = Line.FirstParameter();
|
UFirst = Line.FirstParameter();
|
||||||
ULast = Line.LastParameter();
|
ULast = Line.LastParameter();
|
||||||
Standard_Real TolU = Max((ULast-UFirst)*1.e-05, Precision::PApproximation());
|
Standard_Real TolU = Max((ULast - UFirst)*1.e-03, Precision::Confusion());
|
||||||
Standard_Real myfirstU = UFirst;
|
Standard_Real myfirstU = UFirst;
|
||||||
Standard_Real mylastU = ULast;
|
Standard_Real mylastU = ULast;
|
||||||
Standard_Integer aMaxSegments = 0;
|
Standard_Integer aMaxSegments = 0;
|
||||||
Standard_Integer aMaxSegments1 = myMaxSegments - 1;
|
Standard_Integer aMaxSegments1 = myMaxSegments - 1;
|
||||||
|
Standard_Integer aNbCut = 0, aNbImp = 0, aNbComp = 5;
|
||||||
|
|
||||||
if (!mycut)
|
if (!mycut)
|
||||||
{
|
{
|
||||||
alldone = Compute(Line, UFirst, ULast, thetol3d, thetol2d);
|
alldone = Compute(Line, UFirst, ULast, thetol3d, thetol2d);
|
||||||
if (!alldone)
|
if (!alldone)
|
||||||
{
|
{
|
||||||
tolreached = Standard_False;
|
tolreached = Standard_False;
|
||||||
myfirstparam.Append(UFirst);
|
myfirstparam.Append(UFirst);
|
||||||
@@ -112,25 +113,27 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
|||||||
Tolers2d.Append(currenttol2d);
|
Tolers2d.Append(currenttol2d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
// previous decision to be taken if we get worse with next cut (eap)
|
// previous decision to be taken if we get worse with next cut (eap)
|
||||||
AppParCurves_MultiCurve KeptMultiCurve;
|
AppParCurves_MultiCurve KeptMultiCurve;
|
||||||
Standard_Real KeptUfirst = 0., KeptUlast = 0., KeptT3d = RealLast(), KeptT2d = 0.;
|
Standard_Real KeptUfirst = 0., KeptUlast = 0., KeptT3d = RealLast(), KeptT2d = 0.;
|
||||||
|
|
||||||
while (!Finish)
|
while (!Finish)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Gestion du decoupage de la multiline pour approximer:
|
// Gestion du decoupage de la multiline pour approximer:
|
||||||
if (!begin)
|
if (!begin)
|
||||||
{
|
{
|
||||||
if (Ok)
|
if (Ok)
|
||||||
{
|
{
|
||||||
// Calcul de la partie a approximer.
|
// Calcul de la partie a approximer.
|
||||||
myfirstU = mylastU;
|
myfirstU = mylastU;
|
||||||
mylastU = ULast;
|
mylastU = ULast;
|
||||||
if (Abs(ULast-myfirstU) <= RealEpsilon()
|
aNbCut = 0;
|
||||||
|
aNbImp = 0;
|
||||||
|
if (Abs(ULast - myfirstU) <= RealEpsilon()
|
||||||
|| aMaxSegments >= myMaxSegments)
|
|| aMaxSegments >= myMaxSegments)
|
||||||
{
|
{
|
||||||
Finish = Standard_True;
|
Finish = Standard_True;
|
||||||
@@ -147,50 +150,59 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
|||||||
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
|
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
|
||||||
{
|
{
|
||||||
KeptMultiCurve = TheMultiCurve;
|
KeptMultiCurve = TheMultiCurve;
|
||||||
KeptUfirst = myfirstU;
|
KeptUfirst = myfirstU;
|
||||||
KeptUlast = mylastU;
|
KeptUlast = mylastU;
|
||||||
KeptT3d = thetol3d;
|
KeptT3d = thetol3d;
|
||||||
KeptT2d = thetol2d;
|
KeptT2d = thetol2d;
|
||||||
|
aNbImp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cut an interval
|
// cut an interval
|
||||||
mylastU = (myfirstU + mylastU)/2;
|
mylastU = (myfirstU + mylastU) / 2;
|
||||||
|
aNbCut++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calcul des parametres sur ce nouvel intervalle.
|
// Calcul des parametres sur ce nouvel intervalle.
|
||||||
Ok = Compute(Line, myfirstU, mylastU, thetol3d, thetol2d);
|
Ok = Compute(Line, myfirstU, mylastU, thetol3d, thetol2d);
|
||||||
if(Ok)
|
if (Ok)
|
||||||
{
|
{
|
||||||
aMaxSegments++;
|
aMaxSegments++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//cout << myfirstU << " - " << mylastU << " tol : " << thetol3d << " " << thetol2d << endl;
|
//cout << myfirstU << " - " << mylastU << " tol : " << thetol3d << " " << thetol2d << endl;
|
||||||
|
Standard_Boolean aStopCutting = Standard_False;
|
||||||
// is new decision better?
|
if (aNbCut >= aNbComp)
|
||||||
if (!Ok && (Abs(myfirstU-mylastU) <= TolU || aMaxSegments >= aMaxSegments1))
|
|
||||||
{
|
{
|
||||||
Ok = Standard_True; // stop interval cutting, approx the rest part
|
if (aNbCut > aNbImp)
|
||||||
|
{
|
||||||
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
|
aStopCutting = Standard_True;
|
||||||
{
|
|
||||||
KeptMultiCurve = TheMultiCurve;
|
|
||||||
KeptUfirst = myfirstU;
|
|
||||||
KeptUlast = mylastU;
|
|
||||||
KeptT3d = thetol3d;
|
|
||||||
KeptT2d = thetol2d;
|
|
||||||
}
|
|
||||||
|
|
||||||
mylastU = KeptUlast;
|
|
||||||
|
|
||||||
tolreached = Standard_False; // helas
|
|
||||||
myMultiCurves.Append(KeptMultiCurve);
|
|
||||||
aMaxSegments++;
|
|
||||||
Tolers3d.Append (KeptT3d);
|
|
||||||
Tolers2d.Append (KeptT2d);
|
|
||||||
myfirstparam.Append (KeptUfirst);
|
|
||||||
mylastparam.Append (KeptUlast);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// is new decision better?
|
||||||
|
if (!Ok && (Abs(myfirstU - mylastU) <= TolU || aMaxSegments >= aMaxSegments1 || aStopCutting ))
|
||||||
|
{
|
||||||
|
Ok = Standard_True; // stop interval cutting, approx the rest part
|
||||||
|
|
||||||
|
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
|
||||||
|
{
|
||||||
|
KeptMultiCurve = TheMultiCurve;
|
||||||
|
KeptUfirst = myfirstU;
|
||||||
|
KeptUlast = mylastU;
|
||||||
|
KeptT3d = thetol3d;
|
||||||
|
KeptT2d = thetol2d;
|
||||||
|
}
|
||||||
|
|
||||||
|
mylastU = KeptUlast;
|
||||||
|
|
||||||
|
tolreached = Standard_False; // helas
|
||||||
|
myMultiCurves.Append(KeptMultiCurve);
|
||||||
|
aMaxSegments++;
|
||||||
|
Tolers3d.Append(KeptT3d);
|
||||||
|
Tolers2d.Append(KeptT2d);
|
||||||
|
myfirstparam.Append(KeptUfirst);
|
||||||
|
mylastparam.Append(KeptUlast);
|
||||||
|
}
|
||||||
|
|
||||||
begin = Standard_False;
|
begin = Standard_False;
|
||||||
} // while (!Finish)
|
} // while (!Finish)
|
||||||
@@ -225,10 +237,10 @@ const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
|
Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
|
||||||
const Standard_Real Ufirst,
|
const Standard_Real Ufirst,
|
||||||
const Standard_Real Ulast,
|
const Standard_Real Ulast,
|
||||||
Standard_Real& TheTol3d,
|
Standard_Real& TheTol3d,
|
||||||
Standard_Real& TheTol2d)
|
Standard_Real& TheTol2d)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -243,14 +255,14 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
|
|||||||
if (mydone) {
|
if (mydone) {
|
||||||
LSquare.Error(Fv, TheTol3d, TheTol2d);
|
LSquare.Error(Fv, TheTol3d, TheTol2d);
|
||||||
if (TheTol3d <= mytol3d && TheTol2d <= mytol2d) {
|
if (TheTol3d <= mytol3d && TheTol2d <= mytol2d) {
|
||||||
// Stockage de la multicurve approximee.
|
// Stockage de la multicurve approximee.
|
||||||
tolreached = Standard_True;
|
tolreached = Standard_True;
|
||||||
myMultiCurves.Append(LSquare.Value());
|
myMultiCurves.Append(LSquare.Value());
|
||||||
myfirstparam.Append(Ufirst);
|
myfirstparam.Append(Ufirst);
|
||||||
mylastparam.Append(Ulast);
|
mylastparam.Append(Ulast);
|
||||||
Tolers3d.Append(TheTol3d);
|
Tolers3d.Append(TheTol3d);
|
||||||
Tolers2d.Append(TheTol2d);
|
Tolers2d.Append(TheTol2d);
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (deg == mydegremax) {
|
if (deg == mydegremax) {
|
||||||
@@ -258,7 +270,7 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
|
|||||||
currenttol3d = TheTol3d;
|
currenttol3d = TheTol3d;
|
||||||
currenttol2d = TheTol2d;
|
currenttol2d = TheTol2d;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@@ -270,11 +282,11 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Approx_ComputeCLine::Parameters(const Standard_Integer Index,
|
void Approx_ComputeCLine::Parameters(const Standard_Integer Index,
|
||||||
Standard_Real& firstpar,
|
Standard_Real& firstpar,
|
||||||
Standard_Real& lastpar) const
|
Standard_Real& lastpar) const
|
||||||
{
|
{
|
||||||
firstpar = myfirstparam.Value(Index);
|
firstpar = myfirstparam.Value(Index);
|
||||||
lastpar = mylastparam.Value(Index);
|
lastpar = mylastparam.Value(Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -283,7 +295,7 @@ void Approx_ComputeCLine::Parameters(const Standard_Integer Index,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Approx_ComputeCLine::SetDegrees(const Standard_Integer degreemin,
|
void Approx_ComputeCLine::SetDegrees(const Standard_Integer degreemin,
|
||||||
const Standard_Integer degreemax)
|
const Standard_Integer degreemax)
|
||||||
{
|
{
|
||||||
mydegremin = degreemin;
|
mydegremin = degreemin;
|
||||||
mydegremax = degreemax;
|
mydegremax = degreemax;
|
||||||
@@ -295,7 +307,7 @@ void Approx_ComputeCLine::SetDegrees(const Standard_Integer degreemin,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Approx_ComputeCLine::SetTolerances(const Standard_Real Tolerance3d,
|
void Approx_ComputeCLine::SetTolerances(const Standard_Real Tolerance3d,
|
||||||
const Standard_Real Tolerance2d)
|
const Standard_Real Tolerance2d)
|
||||||
{
|
{
|
||||||
mytol3d = Tolerance3d;
|
mytol3d = Tolerance3d;
|
||||||
mytol2d = Tolerance2d;
|
mytol2d = Tolerance2d;
|
||||||
@@ -307,10 +319,10 @@ void Approx_ComputeCLine::SetTolerances(const Standard_Real Tolerance3d,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Approx_ComputeCLine::SetConstraints(const AppParCurves_Constraint FirstC,
|
void Approx_ComputeCLine::SetConstraints(const AppParCurves_Constraint FirstC,
|
||||||
const AppParCurves_Constraint LastC)
|
const AppParCurves_Constraint LastC)
|
||||||
{
|
{
|
||||||
myfirstC = FirstC;
|
myfirstC = FirstC;
|
||||||
mylastC = LastC;
|
mylastC = LastC;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -318,7 +330,7 @@ void Approx_ComputeCLine::SetConstraints(const AppParCurves_Constraint FirstC,
|
|||||||
//purpose : Changes the max number of segments, which is allowed for cutting.
|
//purpose : Changes the max number of segments, which is allowed for cutting.
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Approx_ComputeCLine:: SetMaxSegments(const Standard_Integer theMaxSegments)
|
void Approx_ComputeCLine::SetMaxSegments(const Standard_Integer theMaxSegments)
|
||||||
{
|
{
|
||||||
myMaxSegments = theMaxSegments;
|
myMaxSegments = theMaxSegments;
|
||||||
}
|
}
|
||||||
@@ -351,8 +363,8 @@ const {
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Approx_ComputeCLine::Error(const Standard_Integer Index,
|
void Approx_ComputeCLine::Error(const Standard_Integer Index,
|
||||||
Standard_Real& tol3d,
|
Standard_Real& tol3d,
|
||||||
Standard_Real& tol2d) const
|
Standard_Real& tol2d) const
|
||||||
{
|
{
|
||||||
tol3d = Tolers3d.Value(Index);
|
tol3d = Tolers3d.Value(Index);
|
||||||
tol2d = Tolers2d.Value(Index);
|
tol2d = Tolers2d.Value(Index);
|
||||||
|
@@ -163,12 +163,21 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
|
|||||||
myDWeigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
|
myDWeigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
|
||||||
myD2Weigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
|
myD2Weigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
|
||||||
|
|
||||||
if (Num2DSS>0) {
|
if (Num2DSS>0)
|
||||||
|
{
|
||||||
myPoles2d = new (TColgp_HArray1OfPnt2d)(1, Num2DSS);
|
myPoles2d = new (TColgp_HArray1OfPnt2d)(1, Num2DSS);
|
||||||
myDPoles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
|
myDPoles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
|
||||||
myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
|
myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
|
||||||
COnSurfErr = new (TColStd_HArray1OfReal)(1, Num2DSS);
|
COnSurfErr = new (TColStd_HArray1OfReal)(1, Num2DSS);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myPoles2d = new TColgp_HArray1OfPnt2d();
|
||||||
|
myDPoles2d = new TColgp_HArray1OfVec2d();
|
||||||
|
myD2Poles2d = new TColgp_HArray1OfVec2d();
|
||||||
|
COnSurfErr = new TColStd_HArray1OfReal();
|
||||||
|
}
|
||||||
|
|
||||||
// Checks if myFunc->D2 is implemented
|
// Checks if myFunc->D2 is implemented
|
||||||
if (continuity >= GeomAbs_C2) {
|
if (continuity >= GeomAbs_C2) {
|
||||||
Standard_Boolean B;
|
Standard_Boolean B;
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
#include <Aspect_TypeOfResize.hxx>
|
#include <Aspect_TypeOfResize.hxx>
|
||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
#include <Aspect_Drawable.hxx>
|
#include <Aspect_Drawable.hxx>
|
||||||
|
|
||||||
|
class Aspect_DisplayConnection;
|
||||||
class Aspect_WindowDefinitionError;
|
class Aspect_WindowDefinitionError;
|
||||||
class Aspect_WindowError;
|
class Aspect_WindowError;
|
||||||
class Aspect_Background;
|
class Aspect_Background;
|
||||||
@@ -43,70 +45,80 @@ class Aspect_Window : public Standard_Transient
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Modifies the window background.
|
//! Modifies the window background.
|
||||||
Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
|
Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
|
||||||
|
|
||||||
//! Modifies the window background.
|
//! Modifies the window background.
|
||||||
Standard_EXPORT void SetBackground (const Quantity_Color& color);
|
Standard_EXPORT void SetBackground (const Quantity_Color& color);
|
||||||
|
|
||||||
//! Modifies the window gradient background.
|
//! Modifies the window gradient background.
|
||||||
Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
|
Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
|
||||||
|
|
||||||
//! Modifies the window gradient background.
|
//! Modifies the window gradient background.
|
||||||
Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
|
Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
|
||||||
|
|
||||||
//! Opens the window <me>.
|
//! Opens the window <me>.
|
||||||
Standard_EXPORT virtual void Map() const = 0;
|
Standard_EXPORT virtual void Map() const = 0;
|
||||||
|
|
||||||
//! Closes the window <me>.
|
//! Closes the window <me>.
|
||||||
Standard_EXPORT virtual void Unmap() const = 0;
|
Standard_EXPORT virtual void Unmap() const = 0;
|
||||||
|
|
||||||
//! Apply the resizing to the window <me>.
|
//! Apply the resizing to the window <me>.
|
||||||
Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const = 0;
|
Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const = 0;
|
||||||
|
|
||||||
//! Apply the mapping change to the window <me>.
|
//! Apply the mapping change to the window <me>.
|
||||||
//! and returns TRUE if the window is mapped at screen.
|
//! and returns TRUE if the window is mapped at screen.
|
||||||
Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
|
Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
|
||||||
|
|
||||||
//! Returns the window background.
|
//! Returns the window background.
|
||||||
Standard_EXPORT Aspect_Background Background() const;
|
Standard_EXPORT Aspect_Background Background() const;
|
||||||
|
|
||||||
//! Returns the current image background fill mode.
|
//! Returns the current image background fill mode.
|
||||||
Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
|
Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
|
||||||
|
|
||||||
//! Returns the window gradient background.
|
//! Returns the window gradient background.
|
||||||
Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
|
Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
|
||||||
|
|
||||||
//! Returns True if the window <me> is opened
|
//! Returns True if the window <me> is opened
|
||||||
//! and False if the window is closed.
|
//! and False if the window is closed.
|
||||||
Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
|
Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
|
||||||
|
|
||||||
//! Returns True if the window <me> is virtual
|
//! Returns True if the window <me> is virtual
|
||||||
Standard_EXPORT Standard_Boolean IsVirtual() const;
|
Standard_EXPORT Standard_Boolean IsVirtual() const;
|
||||||
|
|
||||||
//! Setup the virtual state
|
//! Setup the virtual state
|
||||||
Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
|
Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
|
||||||
|
|
||||||
//! Returns The Window RATIO equal to the physical
|
//! Returns The Window RATIO equal to the physical
|
||||||
//! WIDTH/HEIGHT dimensions
|
//! WIDTH/HEIGHT dimensions
|
||||||
Standard_EXPORT virtual Standard_Real Ratio() const = 0;
|
Standard_EXPORT virtual Standard_Real Ratio() const = 0;
|
||||||
|
|
||||||
//! Returns The Window POSITION in PIXEL
|
//! Returns The Window POSITION in PIXEL
|
||||||
Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
|
Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
|
||||||
|
|
||||||
//! Returns The Window SIZE in PIXEL
|
//! Returns The Window SIZE in PIXEL
|
||||||
Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
|
Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
|
||||||
|
|
||||||
//! Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
|
//! Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
|
||||||
Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
|
Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
|
||||||
|
|
||||||
//! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
|
//! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
|
||||||
Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
|
Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
|
||||||
|
|
||||||
//! Returns native Window FB config (GLXFBConfig on Xlib)
|
//! Returns native Window FB config (GLXFBConfig on Xlib)
|
||||||
Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
|
Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
|
||||||
|
|
||||||
|
//! Invalidate entire window content.
|
||||||
|
//!
|
||||||
|
//! Implementation is expected to allow calling this method from non-GUI thread,
|
||||||
|
//! e.g. by queuing exposure event into window message queue or in other thread-safe manner.
|
||||||
|
//!
|
||||||
|
//! Optional display argument should be passed when called from non-GUI thread
|
||||||
|
//! on platforms implementing thread-unsafe connections to display.
|
||||||
|
//! NULL can be passed instead otherwise.
|
||||||
|
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
|
||||||
|
|
||||||
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
|
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -232,7 +232,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform()
|
|||||||
TestCurveOnSurface();
|
TestCurveOnSurface();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Standard_Failure) {
|
catch(Standard_Failure const&) {
|
||||||
BOPAlgo_CheckResult aResult;
|
BOPAlgo_CheckResult aResult;
|
||||||
aResult.SetCheckStatus(BOPAlgo_CheckUnknown);
|
aResult.SetCheckStatus(BOPAlgo_CheckUnknown);
|
||||||
myResult.Append(aResult);
|
myResult.Append(aResult);
|
||||||
|
@@ -233,7 +233,7 @@ void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
|
|||||||
PerformInternal1(theFiller);
|
PerformInternal1(theFiller);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
catch (Standard_Failure) {
|
catch (Standard_Failure const&) {
|
||||||
AddError (new BOPAlgo_AlertBuilderFailed);
|
AddError (new BOPAlgo_AlertBuilderFailed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -116,33 +116,13 @@ class BOPAlgo_PairOfShapeBoolean : public BOPAlgo_Algo {
|
|||||||
Handle(IntTools_Context) myContext;
|
Handle(IntTools_Context) myContext;
|
||||||
};
|
};
|
||||||
//
|
//
|
||||||
typedef NCollection_Vector<BOPAlgo_PairOfShapeBoolean> \
|
typedef NCollection_Vector<BOPAlgo_PairOfShapeBoolean> BOPAlgo_VectorOfPairOfShapeBoolean;
|
||||||
BOPAlgo_VectorOfPairOfShapeBoolean;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_PairOfShapeBoolean,
|
|
||||||
BOPAlgo_VectorOfPairOfShapeBoolean,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_BuilderSDFaceFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_BuilderSDFaceFunctor,
|
|
||||||
BOPAlgo_VectorOfPairOfShapeBoolean,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_BuilderSDFaceCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// BuilderFace
|
// BuilderFace
|
||||||
//
|
//
|
||||||
typedef NCollection_Vector<BOPAlgo_BuilderFace> BOPAlgo_VectorOfBuilderFace;
|
typedef NCollection_Vector<BOPAlgo_BuilderFace> BOPAlgo_VectorOfBuilderFace;
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_BuilderFace,
|
|
||||||
BOPAlgo_VectorOfBuilderFace> BOPAlgo_BuilderFaceFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_BuilderFaceFunctor,
|
|
||||||
BOPAlgo_VectorOfBuilderFace> BOPAlgo_BuilderFaceCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPAlgo_VFI
|
//class : BOPAlgo_VFI
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -205,18 +185,7 @@ class BOPAlgo_VFI : public BOPAlgo_Algo {
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
typedef NCollection_Vector<BOPAlgo_VFI> BOPAlgo_VectorOfVFI;
|
typedef NCollection_Vector<BOPAlgo_VFI> BOPAlgo_VectorOfVFI;
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_VFI,
|
|
||||||
BOPAlgo_VectorOfVFI,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_VFIFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_VFIFunctor,
|
|
||||||
BOPAlgo_VectorOfVFI,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_VFICnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FillImagesFaces
|
//function : FillImagesFaces
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -474,7 +443,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
|||||||
}// for (i=0; i<aNbS; ++i) {
|
}// for (i=0; i<aNbS; ++i) {
|
||||||
//
|
//
|
||||||
//===================================================
|
//===================================================
|
||||||
BOPAlgo_BuilderFaceCnt::Perform(myRunParallel, aVBF);
|
BOPTools_Parallel::Perform (myRunParallel, aVBF);
|
||||||
//===================================================
|
//===================================================
|
||||||
//
|
//
|
||||||
Standard_Integer aNbBF = aVBF.Length();
|
Standard_Integer aNbBF = aVBF.Length();
|
||||||
@@ -663,7 +632,7 @@ void BOPAlgo_Builder::FillSameDomainFaces()
|
|||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
// Perform analysis
|
// Perform analysis
|
||||||
BOPAlgo_BuilderSDFaceCnt::Perform(myRunParallel, aVPSB, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVPSB, myContext);
|
||||||
//================================================================
|
//================================================================
|
||||||
|
|
||||||
NCollection_List<TopTools_ListOfShape> aMBlocks(aAllocator);
|
NCollection_List<TopTools_ListOfShape> aMBlocks(aAllocator);
|
||||||
@@ -816,7 +785,7 @@ void BOPAlgo_Builder::FillInternalVertices()
|
|||||||
|
|
||||||
// Perform classification
|
// Perform classification
|
||||||
//================================================================
|
//================================================================
|
||||||
BOPAlgo_VFICnt::Perform(myRunParallel, aVVFI, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVVFI, myContext);
|
||||||
//================================================================
|
//================================================================
|
||||||
|
|
||||||
Standard_Integer aNbVFI = aVVFI.Length();
|
Standard_Integer aNbVFI = aVVFI.Length();
|
||||||
|
@@ -341,13 +341,6 @@ private:
|
|||||||
|
|
||||||
// Vector of Solid Builders
|
// Vector of Solid Builders
|
||||||
typedef NCollection_Vector<BOPAlgo_SplitSolid> BOPAlgo_VectorOfBuilderSolid;
|
typedef NCollection_Vector<BOPAlgo_SplitSolid> BOPAlgo_VectorOfBuilderSolid;
|
||||||
// Functors to split solids
|
|
||||||
typedef BOPTools_Functor<BOPAlgo_SplitSolid,
|
|
||||||
BOPAlgo_VectorOfBuilderSolid> BOPAlgo_BuilderSolidFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt<BOPAlgo_BuilderSolidFunctor,
|
|
||||||
BOPAlgo_VectorOfBuilderSolid> BOPAlgo_BuilderSolidCnt;
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BuildSplitSolids
|
//function : BuildSplitSolids
|
||||||
@@ -447,7 +440,7 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
|
|||||||
aNbBS=aVBS.Length();
|
aNbBS=aVBS.Length();
|
||||||
//
|
//
|
||||||
//===================================================
|
//===================================================
|
||||||
BOPAlgo_BuilderSolidCnt::Perform(myRunParallel, aVBS);
|
BOPTools_Parallel::Perform (myRunParallel, aVBS);
|
||||||
//===================================================
|
//===================================================
|
||||||
//
|
//
|
||||||
for (k = 0; k < aNbBS; ++k)
|
for (k = 0; k < aNbBS; ++k)
|
||||||
|
@@ -102,17 +102,7 @@ class BOPAlgo_FaceSelfIntersect :
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_FaceSelfIntersect> BOPAlgo_VectorOfFaceSelfIntersect;
|
||||||
<BOPAlgo_FaceSelfIntersect> BOPAlgo_VectorOfFaceSelfIntersect;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_FaceSelfIntersect,
|
|
||||||
BOPAlgo_VectorOfFaceSelfIntersect> BOPAlgo_FaceSelfIntersectFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_FaceSelfIntersectFunctor,
|
|
||||||
BOPAlgo_VectorOfFaceSelfIntersect> BOPAlgo_FaceSelfIntersectCnt;
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function :
|
//function :
|
||||||
@@ -206,7 +196,7 @@ void BOPAlgo_CheckerSI::Perform()
|
|||||||
PostTreat();
|
PostTreat();
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
catch (Standard_Failure) {
|
catch (Standard_Failure const&) {
|
||||||
AddError (new BOPAlgo_AlertIntersectionFailed);
|
AddError (new BOPAlgo_AlertIntersectionFailed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -447,7 +437,7 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection()
|
|||||||
|
|
||||||
Standard_Integer aNbFace = aVFace.Length();
|
Standard_Integer aNbFace = aVFace.Length();
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPAlgo_FaceSelfIntersectCnt::Perform(myRunParallel, aVFace);
|
BOPTools_Parallel::Perform (myRunParallel, aVFace);
|
||||||
//======================================================
|
//======================================================
|
||||||
//
|
//
|
||||||
for (Standard_Integer k = 0; k < aNbFace; k++)
|
for (Standard_Integer k = 0; k < aNbFace; k++)
|
||||||
|
@@ -115,19 +115,8 @@ class BOPAlgo_VertexSolid {
|
|||||||
Handle(IntTools_Context) myContext;
|
Handle(IntTools_Context) myContext;
|
||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_VertexSolid> BOPAlgo_VectorOfVertexSolid;
|
||||||
<BOPAlgo_VertexSolid> BOPAlgo_VectorOfVertexSolid;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_VertexSolid,
|
|
||||||
BOPAlgo_VectorOfVertexSolid,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_VertexSolidFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_VertexSolidFunctor,
|
|
||||||
BOPAlgo_VectorOfVertexSolid,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_VertexSolidCnt;
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPAlgo_ShapeSolid
|
//class : BOPAlgo_ShapeSolid
|
||||||
@@ -185,17 +174,8 @@ class BOPAlgo_ShapeSolid {
|
|||||||
BOPDS_DS* myDS;
|
BOPDS_DS* myDS;
|
||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_ShapeSolid> BOPAlgo_VectorOfShapeSolid;
|
||||||
<BOPAlgo_ShapeSolid> BOPAlgo_VectorOfShapeSolid;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_ShapeSolid,
|
|
||||||
BOPAlgo_VectorOfShapeSolid> BOPAlgo_ShapeSolidFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_ShapeSolidFunctor,
|
|
||||||
BOPAlgo_VectorOfShapeSolid> BOPAlgo_ShapeSolidCnt;
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPAlgo_SolidSolid
|
//class : BOPAlgo_SolidSolid
|
||||||
@@ -225,18 +205,7 @@ class BOPAlgo_SolidSolid : public BOPAlgo_ShapeSolid {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_SolidSolid> BOPAlgo_VectorOfSolidSolid;
|
||||||
<BOPAlgo_SolidSolid> BOPAlgo_VectorOfSolidSolid;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_SolidSolid,
|
|
||||||
BOPAlgo_VectorOfSolidSolid> BOPAlgo_SolidSolidFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_SolidSolidFunctor,
|
|
||||||
BOPAlgo_VectorOfSolidSolid> BOPAlgo_SolidSolidCnt;
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : PerformVZ
|
//function : PerformVZ
|
||||||
@@ -286,7 +255,7 @@ void BOPAlgo_CheckerSI::PerformVZ()
|
|||||||
//
|
//
|
||||||
aNbVVS=aVVS.Length();
|
aNbVVS=aVVS.Length();
|
||||||
//=============================================================
|
//=============================================================
|
||||||
BOPAlgo_VertexSolidCnt::Perform(myRunParallel, aVVS, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVVS, myContext);
|
||||||
//=============================================================
|
//=============================================================
|
||||||
for (k=0; k < aNbVVS; ++k) {
|
for (k=0; k < aNbVVS; ++k) {
|
||||||
const BOPAlgo_VertexSolid& aVertexSolid=aVVS(k);
|
const BOPAlgo_VertexSolid& aVertexSolid=aVVS(k);
|
||||||
@@ -344,7 +313,7 @@ void BOPAlgo_CheckerSI::PerformZZ()
|
|||||||
//
|
//
|
||||||
aNbSolidSolid=aVSolidSolid.Length();
|
aNbSolidSolid=aVSolidSolid.Length();
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPAlgo_SolidSolidCnt::Perform(myRunParallel, aVSolidSolid);
|
BOPTools_Parallel::Perform (myRunParallel, aVSolidSolid);
|
||||||
//======================================================
|
//======================================================
|
||||||
//
|
//
|
||||||
BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
|
BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
|
||||||
@@ -391,7 +360,7 @@ void BOPAlgo_CheckerSI::PerformSZ(const TopAbs_ShapeEnum aTS)
|
|||||||
//
|
//
|
||||||
aNbShapeSolid=aVShapeSolid.Length();
|
aNbShapeSolid=aVShapeSolid.Length();
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPAlgo_ShapeSolidCnt::Perform(myRunParallel, aVShapeSolid);
|
BOPTools_Parallel::Perform (myRunParallel, aVShapeSolid);
|
||||||
//======================================================
|
//======================================================
|
||||||
//
|
//
|
||||||
BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
|
BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
|
||||||
|
@@ -223,7 +223,7 @@ void BOPAlgo_PaveFiller::Perform()
|
|||||||
PerformInternal();
|
PerformInternal();
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
catch (Standard_Failure) {
|
catch (Standard_Failure const&) {
|
||||||
AddError (new BOPAlgo_AlertIntersectionFailed);
|
AddError (new BOPAlgo_AlertIntersectionFailed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -118,7 +118,7 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo {
|
|||||||
|
|
||||||
myFlag=myContext->ComputeVE (myV, myE, myT, myTolVNew, myFuzzyValue);
|
myFlag=myContext->ComputeVE (myV, myE, myT, myTolVNew, myFuzzyValue);
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
AddError(new BOPAlgo_AlertIntersectionFailed);
|
AddError(new BOPAlgo_AlertIntersectionFailed);
|
||||||
}
|
}
|
||||||
@@ -136,20 +136,8 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo {
|
|||||||
Handle(BOPDS_PaveBlock) myPB;
|
Handle(BOPDS_PaveBlock) myPB;
|
||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
|
||||||
<BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_VertexEdge,
|
|
||||||
BOPAlgo_VectorOfVertexEdge,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_VertexEdgeFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_VertexEdgeFunctor,
|
|
||||||
BOPAlgo_VectorOfVertexEdge,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_VertexEdgeCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: PerformVE
|
// function: PerformVE
|
||||||
// purpose:
|
// purpose:
|
||||||
@@ -271,7 +259,7 @@ void BOPAlgo_PaveFiller::IntersectVE
|
|||||||
//
|
//
|
||||||
// Perform intersection
|
// Perform intersection
|
||||||
//=============================================================
|
//=============================================================
|
||||||
BOPAlgo_VertexEdgeCnt::Perform(myRunParallel, aVVE, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVVE, myContext);
|
||||||
//=============================================================
|
//=============================================================
|
||||||
//
|
//
|
||||||
// Keep the modified edges for further update
|
// Keep the modified edges for further update
|
||||||
|
@@ -102,7 +102,7 @@ class BOPAlgo_EdgeEdge :
|
|||||||
|
|
||||||
IntTools_EdgeEdge::Perform();
|
IntTools_EdgeEdge::Perform();
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
AddError(new BOPAlgo_AlertIntersectionFailed);
|
AddError(new BOPAlgo_AlertIntersectionFailed);
|
||||||
}
|
}
|
||||||
@@ -114,18 +114,8 @@ class BOPAlgo_EdgeEdge :
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
|
||||||
<BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_EdgeEdge,
|
|
||||||
BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_EdgeEdgeFunctor,
|
|
||||||
BOPAlgo_VectorOfEdgeEdge> BOPAlgo_EdgeEdgeCnt;
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: PerformEE
|
// function: PerformEE
|
||||||
// purpose:
|
// purpose:
|
||||||
@@ -234,7 +224,7 @@ void BOPAlgo_PaveFiller::PerformEE()
|
|||||||
//
|
//
|
||||||
aNbEdgeEdge=aVEdgeEdge.Length();
|
aNbEdgeEdge=aVEdgeEdge.Length();
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPAlgo_EdgeEdgeCnt::Perform(myRunParallel, aVEdgeEdge);
|
BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
|
||||||
//======================================================
|
//======================================================
|
||||||
//
|
//
|
||||||
for (k = 0; k < aNbEdgeEdge; ++k) {
|
for (k = 0; k < aNbEdgeEdge; ++k) {
|
||||||
@@ -1050,7 +1040,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
|
|||||||
anAlloc->Reset();
|
anAlloc->Reset();
|
||||||
|
|
||||||
// Perform intersection of the found pairs
|
// Perform intersection of the found pairs
|
||||||
BOPAlgo_EdgeEdgeCnt::Perform(myRunParallel, aVEdgeEdge);
|
BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
|
||||||
|
|
||||||
BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
|
BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
|
||||||
if (aEEs.IsEmpty())
|
if (aEEs.IsEmpty())
|
||||||
|
@@ -114,7 +114,7 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo {
|
|||||||
|
|
||||||
myFlag=myContext->ComputeVF(myV, myF, myT1, myT2, myTolVNew, myFuzzyValue);
|
myFlag=myContext->ComputeVF(myV, myF, myT1, myT2, myTolVNew, myFuzzyValue);
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
AddError(new BOPAlgo_AlertIntersectionFailed);
|
AddError(new BOPAlgo_AlertIntersectionFailed);
|
||||||
}
|
}
|
||||||
@@ -132,20 +132,8 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo {
|
|||||||
Handle(IntTools_Context) myContext;
|
Handle(IntTools_Context) myContext;
|
||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector<BOPAlgo_VertexFace>
|
typedef NCollection_Vector<BOPAlgo_VertexFace> BOPAlgo_VectorOfVertexFace;
|
||||||
BOPAlgo_VectorOfVertexFace;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_VertexFace,
|
|
||||||
BOPAlgo_VectorOfVertexFace,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_VertexFaceFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_VertexFaceFunctor,
|
|
||||||
BOPAlgo_VectorOfVertexFace,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_VertexFaceCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: PerformVF
|
// function: PerformVF
|
||||||
// purpose:
|
// purpose:
|
||||||
@@ -234,7 +222,7 @@ void BOPAlgo_PaveFiller::PerformVF()
|
|||||||
//
|
//
|
||||||
aNbVF=aVVF.Length();
|
aNbVF=aVVF.Length();
|
||||||
//================================================================
|
//================================================================
|
||||||
BOPAlgo_VertexFaceCnt::Perform(myRunParallel, aVVF, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVVF, myContext);
|
||||||
//================================================================
|
//================================================================
|
||||||
//
|
//
|
||||||
for (k=0; k < aNbVF; ++k) {
|
for (k=0; k < aNbVF; ++k) {
|
||||||
|
@@ -113,7 +113,7 @@ class BOPAlgo_EdgeFace :
|
|||||||
|
|
||||||
IntTools_EdgeFace::Perform();
|
IntTools_EdgeFace::Perform();
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
AddError(new BOPAlgo_AlertIntersectionFailed);
|
AddError(new BOPAlgo_AlertIntersectionFailed);
|
||||||
}
|
}
|
||||||
@@ -128,18 +128,7 @@ class BOPAlgo_EdgeFace :
|
|||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector<BOPAlgo_EdgeFace> BOPAlgo_VectorOfEdgeFace;
|
typedef NCollection_Vector<BOPAlgo_EdgeFace> BOPAlgo_VectorOfEdgeFace;
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_EdgeFace,
|
|
||||||
BOPAlgo_VectorOfEdgeFace,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_EdgeFaceFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_EdgeFaceFunctor,
|
|
||||||
BOPAlgo_VectorOfEdgeFace,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_EdgeFaceCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : PerformEF
|
//function : PerformEF
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -265,7 +254,7 @@ void BOPAlgo_PaveFiller::PerformEF()
|
|||||||
//
|
//
|
||||||
aNbEdgeFace=aVEdgeFace.Length();
|
aNbEdgeFace=aVEdgeFace.Length();
|
||||||
//=================================================================
|
//=================================================================
|
||||||
BOPAlgo_EdgeFaceCnt::Perform(myRunParallel, aVEdgeFace, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
|
||||||
//=================================================================
|
//=================================================================
|
||||||
//
|
//
|
||||||
for (k=0; k < aNbEdgeFace; ++k) {
|
for (k=0; k < aNbEdgeFace; ++k) {
|
||||||
@@ -972,7 +961,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
|
|||||||
anAlloc->Reset();
|
anAlloc->Reset();
|
||||||
|
|
||||||
// Perform intersection of the found pairs
|
// Perform intersection of the found pairs
|
||||||
BOPAlgo_EdgeFaceCnt::Perform(myRunParallel, aVEdgeFace, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
|
||||||
|
|
||||||
BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF();
|
BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF();
|
||||||
if (theAddInterf && aEFs.IsEmpty())
|
if (theAddInterf && aEFs.IsEmpty())
|
||||||
|
@@ -150,7 +150,7 @@ class BOPAlgo_FaceFace :
|
|||||||
|
|
||||||
IntTools_FaceFace::Perform(myF1, myF2);
|
IntTools_FaceFace::Perform(myF1, myF2);
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
AddError(new BOPAlgo_AlertIntersectionFailed);
|
AddError(new BOPAlgo_AlertIntersectionFailed);
|
||||||
}
|
}
|
||||||
@@ -165,16 +165,8 @@ class BOPAlgo_FaceFace :
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_FaceFace> BOPAlgo_VectorOfFaceFace;
|
||||||
<BOPAlgo_FaceFace> BOPAlgo_VectorOfFaceFace;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_FaceFace,
|
|
||||||
BOPAlgo_VectorOfFaceFace> BOPAlgo_FaceFaceFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_FaceFaceFunctor,
|
|
||||||
BOPAlgo_VectorOfFaceFace> BOPAlgo_FaceFaceCnt;
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : PerformFF
|
//function : PerformFF
|
||||||
@@ -287,7 +279,7 @@ void BOPAlgo_PaveFiller::PerformFF()
|
|||||||
//
|
//
|
||||||
//======================================================
|
//======================================================
|
||||||
// Perform intersection
|
// Perform intersection
|
||||||
BOPAlgo_FaceFaceCnt::Perform(myRunParallel, aVFaceFace);
|
BOPTools_Parallel::Perform (myRunParallel, aVFaceFace);
|
||||||
//======================================================
|
//======================================================
|
||||||
// Treatment of the results
|
// Treatment of the results
|
||||||
Standard_Integer k, aNbFaceFace = aVFaceFace.Length();
|
Standard_Integer k, aNbFaceFace = aVFaceFace.Length();
|
||||||
|
@@ -169,20 +169,8 @@ class BOPAlgo_SplitEdge : public BOPAlgo_Algo {
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_SplitEdge> BOPAlgo_VectorOfSplitEdge;
|
||||||
<BOPAlgo_SplitEdge> BOPAlgo_VectorOfSplitEdge;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_SplitEdge,
|
|
||||||
BOPAlgo_VectorOfSplitEdge,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_SplitEdgeFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_SplitEdgeFunctor,
|
|
||||||
BOPAlgo_VectorOfSplitEdge,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_SplitEdgeCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPAlgo_MPC
|
//class : BOPAlgo_MPC
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -301,7 +289,7 @@ class BOPAlgo_MPC : public BOPAlgo_Algo {
|
|||||||
UpdateVertices(aCopyE, myF);
|
UpdateVertices(aCopyE, myF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
AddError(new BOPAlgo_AlertBuildingPCurveFailed(TopoDS_Shape()));
|
AddError(new BOPAlgo_AlertBuildingPCurveFailed(TopoDS_Shape()));
|
||||||
}
|
}
|
||||||
@@ -333,20 +321,8 @@ class BOPAlgo_MPC : public BOPAlgo_Algo {
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_MPC> BOPAlgo_VectorOfMPC;
|
||||||
<BOPAlgo_MPC> BOPAlgo_VectorOfMPC;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_MPC,
|
|
||||||
BOPAlgo_VectorOfMPC,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_MPCFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_MPCFunctor,
|
|
||||||
BOPAlgo_VectorOfMPC,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_MPCCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPAlgo_BPC
|
//class : BOPAlgo_BPC
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -391,18 +367,8 @@ class BOPAlgo_BPC {
|
|||||||
Standard_Boolean myToUpdate;
|
Standard_Boolean myToUpdate;
|
||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_BPC> BOPAlgo_VectorOfBPC;
|
||||||
<BOPAlgo_BPC> BOPAlgo_VectorOfBPC;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_BPC,
|
|
||||||
BOPAlgo_VectorOfBPC> BOPAlgo_BPCFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_BPCFunctor,
|
|
||||||
BOPAlgo_VectorOfBPC> BOPAlgo_BPCCnt;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: MakeSplitEdges
|
// function: MakeSplitEdges
|
||||||
// purpose:
|
// purpose:
|
||||||
@@ -524,7 +490,7 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
|
|||||||
//
|
//
|
||||||
aNbVBSE=aVBSE.Length();
|
aNbVBSE=aVBSE.Length();
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPAlgo_SplitEdgeCnt::Perform(myRunParallel, aVBSE, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVBSE, myContext);
|
||||||
//======================================================
|
//======================================================
|
||||||
//
|
//
|
||||||
for (k=0; k < aNbVBSE; ++k) {
|
for (k=0; k < aNbVBSE; ++k) {
|
||||||
@@ -753,7 +719,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
|||||||
}//if (bPCurveOnS1 || bPCurveOnS2 ) {
|
}//if (bPCurveOnS1 || bPCurveOnS2 ) {
|
||||||
//
|
//
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPAlgo_MPCCnt::Perform(myRunParallel, aVMPC, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVMPC, myContext);
|
||||||
//======================================================
|
//======================================================
|
||||||
|
|
||||||
// Add warnings of the failed projections and update edges with new pcurves
|
// Add warnings of the failed projections and update edges with new pcurves
|
||||||
@@ -876,7 +842,7 @@ void BOPAlgo_PaveFiller::Prepare()
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPAlgo_BPCCnt::Perform(myRunParallel, aVBPC);
|
BOPTools_Parallel::Perform (myRunParallel, aVBPC);
|
||||||
//======================================================
|
//======================================================
|
||||||
|
|
||||||
// pcurves are built, and now update edges
|
// pcurves are built, and now update edges
|
||||||
|
@@ -63,20 +63,8 @@ class BOPAlgo_ShrunkRange : public IntTools_ShrunkRange {
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_ShrunkRange> BOPAlgo_VectorOfShrunkRange;
|
||||||
<BOPAlgo_ShrunkRange> BOPAlgo_VectorOfShrunkRange;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_ShrunkRange,
|
|
||||||
BOPAlgo_VectorOfShrunkRange,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_ShrunkRangeFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_ShrunkRangeFunctor,
|
|
||||||
BOPAlgo_VectorOfShrunkRange,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_ShrunkRangeCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: FillShrunkData
|
// function: FillShrunkData
|
||||||
// purpose:
|
// purpose:
|
||||||
@@ -141,7 +129,7 @@ void BOPAlgo_PaveFiller::FillShrunkData(const TopAbs_ShapeEnum aType1,
|
|||||||
//
|
//
|
||||||
aNbVSD=aVSD.Length();
|
aNbVSD=aVSD.Length();
|
||||||
//=============================================================
|
//=============================================================
|
||||||
BOPAlgo_ShrunkRangeCnt::Perform(myRunParallel, aVSD, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVSD, myContext);
|
||||||
//=============================================================
|
//=============================================================
|
||||||
//
|
//
|
||||||
for (k=0; k < aNbVSD; ++k) {
|
for (k=0; k < aNbVSD; ++k) {
|
||||||
|
@@ -155,7 +155,7 @@ void BOPAlgo_RemoveFeatures::Perform()
|
|||||||
// Post treatment
|
// Post treatment
|
||||||
PostTreat();
|
PostTreat();
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
AddError(new BOPAlgo_AlertRemoveFeaturesFailed());
|
AddError(new BOPAlgo_AlertRemoveFeaturesFailed());
|
||||||
}
|
}
|
||||||
@@ -354,7 +354,7 @@ public: //! @name Perform the operation
|
|||||||
// Trim the extended faces
|
// Trim the extended faces
|
||||||
TrimExtendedFaces(aFaceExtFaceMap);
|
TrimExtendedFaces(aFaceExtFaceMap);
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
// Make sure the warning will be given on the higher level
|
// Make sure the warning will be given on the higher level
|
||||||
myHasAdjacentFaces = Standard_True;
|
myHasAdjacentFaces = Standard_True;
|
||||||
@@ -716,12 +716,6 @@ private: //! @name Fields
|
|||||||
|
|
||||||
typedef NCollection_Vector<FillGap> VectorOfFillGap;
|
typedef NCollection_Vector<FillGap> VectorOfFillGap;
|
||||||
|
|
||||||
typedef BOPTools_Functor <FillGap, VectorOfFillGap> FillGapFunctor;
|
|
||||||
|
|
||||||
typedef BOPTools_Cnt <FillGapFunctor, VectorOfFillGap> FillGapCnt;
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: RemoveFeatures
|
// function: RemoveFeatures
|
||||||
// purpose: Remove features by filling the gaps by extension of the
|
// purpose: Remove features by filling the gaps by extension of the
|
||||||
@@ -762,7 +756,7 @@ void BOPAlgo_RemoveFeatures::RemoveFeatures()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Perform the reconstruction of the adjacent faces
|
// Perform the reconstruction of the adjacent faces
|
||||||
FillGapCnt::Perform(myRunParallel, aVFG);
|
BOPTools_Parallel::Perform (myRunParallel, aVFG);
|
||||||
|
|
||||||
// Even if the history is not requested, it is necessary to track:
|
// Even if the history is not requested, it is necessary to track:
|
||||||
// - The solids modification after each feature removal to find
|
// - The solids modification after each feature removal to find
|
||||||
|
@@ -71,17 +71,8 @@ class BOPAlgo_CBK {
|
|||||||
BOPTools_ConnexityBlock *myPCB;
|
BOPTools_ConnexityBlock *myPCB;
|
||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_CBK> BOPAlgo_VectorOfCBK;
|
||||||
<BOPAlgo_CBK> BOPAlgo_VectorOfCBK;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_CBK,
|
|
||||||
BOPAlgo_VectorOfCBK> BOPAlgo_CBKFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_CBKFunctor,
|
|
||||||
BOPAlgo_VectorOfCBK> BOPAlgo_CBKCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function :
|
//function :
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -560,7 +551,7 @@ void BOPAlgo_ShellSplitter::MakeShells()
|
|||||||
//
|
//
|
||||||
aNbVCBK=aVCBK.Length();
|
aNbVCBK=aVCBK.Length();
|
||||||
//===================================================
|
//===================================================
|
||||||
BOPAlgo_CBKCnt::Perform(myRunParallel, aVCBK);
|
BOPTools_Parallel::Perform (myRunParallel, aVCBK);
|
||||||
//===================================================
|
//===================================================
|
||||||
for (k=0; k<aNbVCBK; ++k) {
|
for (k=0; k<aNbVCBK; ++k) {
|
||||||
BOPAlgo_CBK& aCBK=aVCBK(k);
|
BOPAlgo_CBK& aCBK=aVCBK(k);
|
||||||
|
@@ -714,7 +714,7 @@ Standard_Boolean BOPAlgo_Tools::WiresToFaces(const TopoDS_Shape& theWires,
|
|||||||
aBB.Add(aRFaces, aFSp);
|
aBB.Add(aRFaces, aFSp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Standard_Failure) {
|
catch (Standard_Failure const&) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -958,16 +958,8 @@ Standard_Boolean FindPlane(const TopoDS_Shape& theWire,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
class BOPAlgo_TNV;
|
class BOPAlgo_TNV;
|
||||||
typedef NCollection_Vector
|
typedef NCollection_Vector<BOPAlgo_TNV> BOPAlgo_VectorOfTNV;
|
||||||
<BOPAlgo_TNV> BOPAlgo_VectorOfTNV;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPAlgo_TNV,
|
|
||||||
BOPAlgo_VectorOfTNV> BOPAlgo_TNVFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPAlgo_TNVFunctor,
|
|
||||||
BOPAlgo_VectorOfTNV> BOPAlgo_TNVCnt;
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
class BOPAlgo_TNV : public BOPTools_BoxBndTreeSelector{
|
class BOPAlgo_TNV : public BOPTools_BoxBndTreeSelector{
|
||||||
public:
|
public:
|
||||||
@@ -1090,7 +1082,7 @@ void BOPAlgo_Tools::IntersectVertices(const TopTools_IndexedDataMapOfShapeReal&
|
|||||||
aTreeFiller.Fill();
|
aTreeFiller.Fill();
|
||||||
//
|
//
|
||||||
// Perform intersection
|
// Perform intersection
|
||||||
BOPAlgo_TNVCnt::Perform(theRunParallel, aVTNV);
|
BOPTools_Parallel::Perform (theRunParallel, aVTNV);
|
||||||
//
|
//
|
||||||
// Fence map
|
// Fence map
|
||||||
TColStd_MapOfInteger aMFence;
|
TColStd_MapOfInteger aMFence;
|
||||||
@@ -1529,16 +1521,6 @@ void BOPAlgo_FillIn3DParts::MakeConnexityBlock(const TopoDS_Face& theFStart,
|
|||||||
// Vector of solid classifiers
|
// Vector of solid classifiers
|
||||||
typedef NCollection_Vector<BOPAlgo_FillIn3DParts> BOPAlgo_VectorOfFillIn3DParts;
|
typedef NCollection_Vector<BOPAlgo_FillIn3DParts> BOPAlgo_VectorOfFillIn3DParts;
|
||||||
|
|
||||||
// Functors to perform classification
|
|
||||||
typedef BOPTools_ContextFunctor<BOPAlgo_FillIn3DParts,
|
|
||||||
BOPAlgo_VectorOfFillIn3DParts,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_FillIn3DPartsFunctor;
|
|
||||||
|
|
||||||
typedef BOPTools_ContextCnt<BOPAlgo_FillIn3DPartsFunctor,
|
|
||||||
BOPAlgo_VectorOfFillIn3DParts,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_FillIn3DPartsCnt;
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ClassifyFaces
|
//function : ClassifyFaces
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -1629,7 +1611,7 @@ void BOPAlgo_Tools::ClassifyFaces(const TopTools_ListOfShape& theFaces,
|
|||||||
|
|
||||||
// Perform classification
|
// Perform classification
|
||||||
//================================================================
|
//================================================================
|
||||||
BOPAlgo_FillIn3DPartsCnt::Perform(theRunParallel, aVFIP, theContext);
|
BOPTools_Parallel::Perform (theRunParallel, aVFIP, theContext);
|
||||||
//================================================================
|
//================================================================
|
||||||
|
|
||||||
// Analyze the results and fill the resulting map
|
// Analyze the results and fill the resulting map
|
||||||
|
@@ -169,19 +169,7 @@ protected:
|
|||||||
Handle(IntTools_Context) myContext;
|
Handle(IntTools_Context) myContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NCollection_Vector<BOPAlgo_WS_ConnexityBlock> \
|
typedef NCollection_Vector<BOPAlgo_WS_ConnexityBlock> BOPAlgo_VectorOfConnexityBlock;
|
||||||
BOPAlgo_VectorOfConnexityBlock;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextFunctor
|
|
||||||
<BOPAlgo_WS_ConnexityBlock,
|
|
||||||
BOPAlgo_VectorOfConnexityBlock,
|
|
||||||
Handle(IntTools_Context),
|
|
||||||
IntTools_Context> BOPAlgo_SplitBlockFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_ContextCnt
|
|
||||||
<BOPAlgo_SplitBlockFunctor,
|
|
||||||
BOPAlgo_VectorOfConnexityBlock,
|
|
||||||
Handle(IntTools_Context)> BOPAlgo_SplitBlockCnt;
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : MakeWires
|
//function : MakeWires
|
||||||
@@ -214,7 +202,7 @@ void BOPAlgo_WireSplitter::MakeWires()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//===================================================
|
//===================================================
|
||||||
BOPAlgo_SplitBlockCnt::Perform(myRunParallel, aVCB, myContext);
|
BOPTools_Parallel::Perform (myRunParallel, aVCB, myContext);
|
||||||
//===================================================
|
//===================================================
|
||||||
aNbVCB=aVCB.Length();
|
aNbVCB=aVCB.Length();
|
||||||
for (k=0; k<aNbVCB; ++k) {
|
for (k=0; k<aNbVCB; ++k) {
|
||||||
|
@@ -73,9 +73,7 @@ class BOPDS_TSR : public BOPTools_BoxBndTreeSelector{
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector <BOPDS_TSR> BOPDS_VectorOfTSR;
|
typedef NCollection_Vector<BOPDS_TSR> BOPDS_VectorOfTSR;
|
||||||
typedef BOPTools_Functor <BOPDS_TSR,BOPDS_VectorOfTSR> BOPDS_TSRFunctor;
|
|
||||||
typedef BOPTools_Cnt <BOPDS_TSRFunctor, BOPDS_VectorOfTSR> BOPDS_TSRCnt;
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
@@ -323,7 +321,7 @@ void BOPDS_Iterator::Intersect(const Handle(IntTools_Context)& theCtx,
|
|||||||
aTreeFiller.Fill();
|
aTreeFiller.Fill();
|
||||||
//
|
//
|
||||||
//===========================================
|
//===========================================
|
||||||
BOPDS_TSRCnt::Perform(myRunParallel, aVTSR);
|
BOPTools_Parallel::Perform (myRunParallel, aVTSR);
|
||||||
//===========================================
|
//===========================================
|
||||||
//
|
//
|
||||||
BOPDS_MapOfPair aMPFence;
|
BOPDS_MapOfPair aMPFence;
|
||||||
@@ -454,7 +452,7 @@ void BOPDS_Iterator::IntersectExt(const TColStd_MapOfInteger& theIndices)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Perform selection
|
// Perform selection
|
||||||
BOPDS_TSRCnt::Perform(myRunParallel, aVTSR);
|
BOPTools_Parallel::Perform (myRunParallel, aVTSR);
|
||||||
|
|
||||||
// Treat selections
|
// Treat selections
|
||||||
|
|
||||||
|
@@ -136,7 +136,7 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
|||||||
BRepLib::SameParameter(aE1T);
|
BRepLib::SameParameter(aE1T);
|
||||||
BRepLib::SameRange(aE1T);
|
BRepLib::SameRange(aE1T);
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
iRet = 6;
|
iRet = 6;
|
||||||
return iRet;
|
return iRet;
|
||||||
|
@@ -159,15 +159,7 @@ class BOPTools_CPC {
|
|||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector<BOPTools_CPC> BOPTools_VectorOfCPC;
|
typedef NCollection_Vector<BOPTools_CPC> BOPTools_VectorOfCPC;
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPTools_CPC,
|
|
||||||
BOPTools_VectorOfCPC> BOPTools_CPCFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPTools_CPCFunctor,
|
|
||||||
BOPTools_VectorOfCPC> BOPTools_CPCCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPTools_CWT
|
//class : BOPTools_CWT
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -199,15 +191,7 @@ class BOPTools_CWT {
|
|||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector<BOPTools_CWT> BOPTools_VectorOfCWT;
|
typedef NCollection_Vector<BOPTools_CWT> BOPTools_VectorOfCWT;
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPTools_CWT,
|
|
||||||
BOPTools_VectorOfCWT> BOPTools_CWTFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPTools_CWTFunctor,
|
|
||||||
BOPTools_VectorOfCWT> BOPTools_CWTCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPTools_CDT
|
//class : BOPTools_CDT
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -250,15 +234,7 @@ class BOPTools_CDT {
|
|||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector<BOPTools_CDT> BOPTools_VectorOfCDT;
|
typedef NCollection_Vector<BOPTools_CDT> BOPTools_VectorOfCDT;
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPTools_CDT,
|
|
||||||
BOPTools_VectorOfCDT> BOPTools_CDTFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPTools_CDTFunctor,
|
|
||||||
BOPTools_VectorOfCDT> BOPTools_CDTCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPTools_CVT
|
//class : BOPTools_CVT
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -291,15 +267,7 @@ class BOPTools_CVT {
|
|||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector<BOPTools_CVT> BOPTools_VectorOfCVT;
|
typedef NCollection_Vector<BOPTools_CVT> BOPTools_VectorOfCVT;
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPTools_CVT,
|
|
||||||
BOPTools_VectorOfCVT> BOPTools_CVTFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPTools_CVTFunctor,
|
|
||||||
BOPTools_VectorOfCVT> BOPTools_CVTCnt;
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//class : BOPTools_CET
|
//class : BOPTools_CET
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -331,18 +299,7 @@ class BOPTools_CET {
|
|||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef NCollection_Vector<BOPTools_CET> BOPTools_VectorOfCET;
|
typedef NCollection_Vector<BOPTools_CET> BOPTools_VectorOfCET;
|
||||||
//
|
|
||||||
typedef BOPTools_Functor
|
|
||||||
<BOPTools_CET,
|
|
||||||
BOPTools_VectorOfCET> BOPTools_CETFunctor;
|
|
||||||
//
|
|
||||||
typedef BOPTools_Cnt
|
|
||||||
<BOPTools_CETFunctor,
|
|
||||||
BOPTools_VectorOfCET> BOPTools_CETCnt;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//=======================================================================
|
|
||||||
//
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// Function : CorrectTolerances
|
// Function : CorrectTolerances
|
||||||
// purpose :
|
// purpose :
|
||||||
@@ -380,7 +337,7 @@ void BOPTools_AlgoTools::CorrectPointOnCurve
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPTools_CPCCnt::Perform(bRunParallel, aVCPC);
|
BOPTools_Parallel::Perform (bRunParallel, aVCPC);
|
||||||
//======================================================
|
//======================================================
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -418,9 +375,9 @@ void BOPTools_AlgoTools::CorrectCurveOnSurface
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPTools_CWTCnt::Perform(bRunParallel, aVCWT);
|
BOPTools_Parallel::Perform (bRunParallel, aVCWT);
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPTools_CDTCnt::Perform(bRunParallel, aVCDT);
|
BOPTools_Parallel::Perform (bRunParallel, aVCDT);
|
||||||
//======================================================
|
//======================================================
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -445,7 +402,7 @@ void BOPTools_AlgoTools::CorrectShapeTolerances
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPTools_CVTCnt::Perform(bRunParallel, aVCVT);
|
BOPTools_Parallel::Perform (bRunParallel, aVCVT);
|
||||||
//======================================================
|
//======================================================
|
||||||
//
|
//
|
||||||
aExp.Init(aShape, TopAbs_FACE);
|
aExp.Init(aShape, TopAbs_FACE);
|
||||||
@@ -457,7 +414,7 @@ void BOPTools_AlgoTools::CorrectShapeTolerances
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
//======================================================
|
//======================================================
|
||||||
BOPTools_CETCnt::Perform(bRunParallel, aVCET);
|
BOPTools_Parallel::Perform (bRunParallel, aVCET);
|
||||||
//======================================================
|
//======================================================
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@@ -18,158 +18,178 @@
|
|||||||
#include <Standard_Macro.hxx>
|
#include <Standard_Macro.hxx>
|
||||||
#include <Standard_NotImplemented.hxx>
|
#include <Standard_NotImplemented.hxx>
|
||||||
#include <OSD_Parallel.hxx>
|
#include <OSD_Parallel.hxx>
|
||||||
|
#include <OSD_ThreadPool.hxx>
|
||||||
#include <NCollection_DataMap.hxx>
|
#include <NCollection_DataMap.hxx>
|
||||||
#include <Standard_Mutex.hxx>
|
#include <Standard_Mutex.hxx>
|
||||||
#include <OSD_Thread.hxx>
|
#include <OSD_Thread.hxx>
|
||||||
|
|
||||||
//
|
//! Implementation of Functors/Starters
|
||||||
// 1. Implementation of Functors/Starters
|
class BOPTools_Parallel
|
||||||
//
|
|
||||||
// 1.1. Pure version
|
|
||||||
//
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//class : BOPTools_Functor
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
template <class TypeSolver, class TypeSolverVector>
|
|
||||||
class BOPTools_Functor
|
|
||||||
{
|
{
|
||||||
public:
|
template<class TypeSolverVector>
|
||||||
//! Constructor.
|
class Functor
|
||||||
explicit BOPTools_Functor(TypeSolverVector& theSolverVec)
|
|
||||||
: mySolvers(theSolverVec) {}
|
|
||||||
|
|
||||||
//! Defines functor interface.
|
|
||||||
void operator() (const Standard_Integer theIndex) const
|
|
||||||
{
|
{
|
||||||
TypeSolver& aSolver = mySolvers(theIndex);
|
public:
|
||||||
aSolver.Perform();
|
//! Constructor.
|
||||||
}
|
explicit Functor(TypeSolverVector& theSolverVec) : mySolvers (theSolverVec) {}
|
||||||
|
|
||||||
private:
|
//! Defines functor interface.
|
||||||
BOPTools_Functor(const BOPTools_Functor&);
|
void operator() (const Standard_Integer theIndex) const
|
||||||
BOPTools_Functor& operator= (const BOPTools_Functor&);
|
|
||||||
|
|
||||||
private:
|
|
||||||
TypeSolverVector& mySolvers;
|
|
||||||
};
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//class : BOPTools_Cnt
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
template <class TypeFunctor, class TypeSolverVector>
|
|
||||||
class BOPTools_Cnt
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static void Perform( const Standard_Boolean isRunParallel,
|
|
||||||
TypeSolverVector& theSolverVector )
|
|
||||||
{
|
|
||||||
TypeFunctor aFunctor(theSolverVector);
|
|
||||||
OSD_Parallel::For(0, theSolverVector.Length(), aFunctor, !isRunParallel);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// 1.2. Context dependent version
|
|
||||||
//
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//class : BOPTools_ContextFunctor
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
template <class TypeSolver, class TypeSolverVector,
|
|
||||||
class TypeContext, typename TN>
|
|
||||||
class BOPTools_ContextFunctor
|
|
||||||
{
|
|
||||||
//! Auxiliary thread ID hasher.
|
|
||||||
struct Hasher
|
|
||||||
{
|
|
||||||
static Standard_Integer HashCode(const Standard_ThreadId theKey,
|
|
||||||
const Standard_Integer Upper)
|
|
||||||
{
|
{
|
||||||
return ::HashCode((Standard_Size)theKey, Upper);
|
typename TypeSolverVector::value_type& aSolver = mySolvers[theIndex];
|
||||||
|
aSolver.Perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Standard_Boolean IsEqual(const Standard_ThreadId theKey1,
|
private:
|
||||||
const Standard_ThreadId theKey2)
|
Functor(const Functor&);
|
||||||
{
|
Functor& operator= (const Functor&);
|
||||||
return theKey1 == theKey2;
|
|
||||||
}
|
private:
|
||||||
|
TypeSolverVector& mySolvers;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NCollection_DataMap<Standard_ThreadId, TypeContext, Hasher> ContextMap;
|
//! Functor storing map of thread id -> algorithm context
|
||||||
|
template<class TypeSolverVector, class TypeContext>
|
||||||
public:
|
class ContextFunctor
|
||||||
|
|
||||||
//! Constructor
|
|
||||||
explicit BOPTools_ContextFunctor( TypeSolverVector& theVector )
|
|
||||||
: mySolverVector(theVector) {}
|
|
||||||
|
|
||||||
//! Binds main thread context
|
|
||||||
void SetContext( TypeContext& theContext )
|
|
||||||
{
|
{
|
||||||
myContexts.Bind(OSD_Thread::Current(), theContext);
|
//! Auxiliary thread ID hasher.
|
||||||
}
|
struct Hasher
|
||||||
|
|
||||||
//! Returns current thread context
|
|
||||||
TypeContext& GetThreadContext() const
|
|
||||||
{
|
|
||||||
const Standard_ThreadId aThreadID = OSD_Thread::Current();
|
|
||||||
if ( myContexts.IsBound(aThreadID) )
|
|
||||||
{
|
{
|
||||||
TypeContext& aContext = myContexts(aThreadID);
|
static Standard_Integer HashCode(const Standard_ThreadId theKey,
|
||||||
if ( aContext.IsNull() == Standard_False )
|
const Standard_Integer Upper)
|
||||||
return aContext;
|
{
|
||||||
|
return ::HashCode((Standard_Size)theKey, Upper);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Standard_Boolean IsEqual(const Standard_ThreadId theKey1,
|
||||||
|
const Standard_ThreadId theKey2)
|
||||||
|
{
|
||||||
|
return theKey1 == theKey2;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//! Constructor
|
||||||
|
explicit ContextFunctor (TypeSolverVector& theVector) : mySolverVector(theVector) {}
|
||||||
|
|
||||||
|
//! Binds main thread context
|
||||||
|
void SetContext (const opencascade::handle<TypeContext>& theContext)
|
||||||
|
{
|
||||||
|
myContextMap.Bind (OSD_Thread::Current(), theContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new context
|
//! Returns current thread context
|
||||||
TypeContext aContext = new TN
|
const opencascade::handle<TypeContext>& GetThreadContext() const
|
||||||
( NCollection_BaseAllocator::CommonBaseAllocator() );
|
{
|
||||||
|
const Standard_ThreadId aThreadID = OSD_Thread::Current();
|
||||||
|
if (const opencascade::handle<TypeContext>* aContextPtr = myContextMap.Seek (aThreadID))
|
||||||
|
{
|
||||||
|
if (!aContextPtr->IsNull())
|
||||||
|
{
|
||||||
|
return *aContextPtr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Standard_Mutex::Sentry aLocker(myMutex);
|
// Create new context
|
||||||
myContexts.Bind(aThreadID, aContext);
|
opencascade::handle<TypeContext> aContext = new TypeContext (NCollection_BaseAllocator::CommonBaseAllocator());
|
||||||
|
|
||||||
return myContexts(aThreadID);
|
Standard_Mutex::Sentry aLocker (myMutex);
|
||||||
}
|
myContextMap.Bind (aThreadID, aContext);
|
||||||
|
return myContextMap (aThreadID);
|
||||||
|
}
|
||||||
|
|
||||||
//! Defines functor interface
|
//! Defines functor interface
|
||||||
void operator()( const Standard_Integer theIndex ) const
|
void operator()( const Standard_Integer theIndex ) const
|
||||||
|
{
|
||||||
|
const opencascade::handle<TypeContext>& aContext = GetThreadContext();
|
||||||
|
typename TypeSolverVector::value_type& aSolver = mySolverVector[theIndex];
|
||||||
|
|
||||||
|
aSolver.SetContext(aContext);
|
||||||
|
aSolver.Perform();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ContextFunctor(const ContextFunctor&);
|
||||||
|
ContextFunctor& operator= (const ContextFunctor&);
|
||||||
|
|
||||||
|
private:
|
||||||
|
TypeSolverVector& mySolverVector;
|
||||||
|
mutable NCollection_DataMap<Standard_ThreadId, opencascade::handle<TypeContext>, Hasher> myContextMap;
|
||||||
|
mutable Standard_Mutex myMutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
//! Functor storing array of algorithm contexts per thread in pool
|
||||||
|
template<class TypeSolverVector, class TypeContext>
|
||||||
|
class ContextFunctor2
|
||||||
{
|
{
|
||||||
TypeContext& aContext = GetThreadContext();
|
public:
|
||||||
TypeSolver& aSolver = mySolverVector(theIndex);
|
|
||||||
|
|
||||||
aSolver.SetContext(aContext);
|
//! Constructor
|
||||||
aSolver.Perform();
|
explicit ContextFunctor2 (TypeSolverVector& theVector, const OSD_ThreadPool::Launcher& thePoolLauncher)
|
||||||
}
|
: mySolverVector(theVector),
|
||||||
|
myContextArray (thePoolLauncher.LowerThreadIndex(), thePoolLauncher.UpperThreadIndex()) {}
|
||||||
|
|
||||||
private:
|
//! Binds main thread context
|
||||||
BOPTools_ContextFunctor(const BOPTools_ContextFunctor&);
|
void SetContext (const opencascade::handle<TypeContext>& theContext)
|
||||||
BOPTools_ContextFunctor& operator= (const BOPTools_ContextFunctor&);
|
{
|
||||||
|
myContextArray.ChangeLast() = theContext; // OSD_ThreadPool::Launcher::UpperThreadIndex() is reserved for a main thread
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
//! Defines functor interface with serialized thread index.
|
||||||
TypeSolverVector& mySolverVector;
|
void operator() (int theThreadIndex,
|
||||||
mutable ContextMap myContexts;
|
int theIndex) const
|
||||||
mutable Standard_Mutex myMutex;
|
{
|
||||||
};
|
opencascade::handle<TypeContext>& aContext = myContextArray.ChangeValue (theThreadIndex);
|
||||||
|
if (aContext.IsNull())
|
||||||
|
{
|
||||||
|
aContext = new TypeContext (NCollection_BaseAllocator::CommonBaseAllocator());
|
||||||
|
}
|
||||||
|
typename TypeSolverVector::value_type& aSolver = mySolverVector[theIndex];
|
||||||
|
aSolver.SetContext (aContext);
|
||||||
|
aSolver.Perform();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ContextFunctor2(const ContextFunctor2&);
|
||||||
|
ContextFunctor2& operator= (const ContextFunctor2&);
|
||||||
|
|
||||||
|
private:
|
||||||
|
TypeSolverVector& mySolverVector;
|
||||||
|
mutable NCollection_Array1< opencascade::handle<TypeContext> > myContextArray;
|
||||||
|
};
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//class : BOPTools_ContextCnt
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
template <class TypeFunctor, class TypeSolverVector, class TypeContext>
|
|
||||||
class BOPTools_ContextCnt
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
static void Perform( const Standard_Boolean isRunParallel,
|
|
||||||
TypeSolverVector& theSolverVector,
|
|
||||||
TypeContext& theContext )
|
|
||||||
{
|
|
||||||
TypeFunctor aFunctor(theSolverVector);
|
|
||||||
aFunctor.SetContext(theContext);
|
|
||||||
|
|
||||||
OSD_Parallel::For(0, theSolverVector.Length(), aFunctor, !isRunParallel);
|
//! Pure version
|
||||||
|
template<class TypeSolverVector>
|
||||||
|
static void Perform (Standard_Boolean theIsRunParallel,
|
||||||
|
TypeSolverVector& theSolverVector)
|
||||||
|
{
|
||||||
|
Functor<TypeSolverVector> aFunctor (theSolverVector);
|
||||||
|
OSD_Parallel::For (0, theSolverVector.Length(), aFunctor, !theIsRunParallel);
|
||||||
|
}
|
||||||
|
|
||||||
|
//! Context dependent version
|
||||||
|
template<class TypeSolverVector, class TypeContext>
|
||||||
|
static void Perform (Standard_Boolean theIsRunParallel,
|
||||||
|
TypeSolverVector& theSolverVector,
|
||||||
|
opencascade::handle<TypeContext>& theContext)
|
||||||
|
{
|
||||||
|
if (OSD_Parallel::ToUseOcctThreads())
|
||||||
|
{
|
||||||
|
const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
|
||||||
|
OSD_ThreadPool::Launcher aPoolLauncher (*aThreadPool, theIsRunParallel ? theSolverVector.Length() : 0);
|
||||||
|
ContextFunctor2<TypeSolverVector, TypeContext> aFunctor (theSolverVector, aPoolLauncher);
|
||||||
|
aFunctor.SetContext (theContext);
|
||||||
|
aPoolLauncher.Perform (0, theSolverVector.Length(), aFunctor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ContextFunctor<TypeSolverVector, TypeContext> aFunctor (theSolverVector);
|
||||||
|
aFunctor.SetContext (theContext);
|
||||||
|
OSD_Parallel::For (0, theSolverVector.Length(), aFunctor, !theIsRunParallel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -326,7 +326,7 @@ void BRepBuilderAPI_FastSewing::Perform(void)
|
|||||||
|
|
||||||
myResShape = aQuilt.Shells();
|
myResShape = aQuilt.Shells();
|
||||||
}
|
}
|
||||||
catch(Standard_Failure)
|
catch(Standard_Failure const&)
|
||||||
{
|
{
|
||||||
SetStatus(FS_Exception);
|
SetStatus(FS_Exception);
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
|
@@ -903,7 +903,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Standard_Failure)
|
catch(Standard_Failure const&)
|
||||||
{
|
{
|
||||||
isSamePar = Standard_False;
|
isSamePar = Standard_False;
|
||||||
}
|
}
|
||||||
@@ -4744,7 +4744,7 @@ void BRepBuilderAPI_Sewing::SameParameterShape()
|
|||||||
|
|
||||||
BRepLib::SameParameter(sec, BRep_Tool::Tolerance(sec));
|
BRepLib::SameParameter(sec, BRep_Tool::Tolerance(sec));
|
||||||
}
|
}
|
||||||
catch (Standard_Failure) {
|
catch (Standard_Failure const&) {
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
cout << "Fail: BRepBuilderAPI_Sewing::SameParameterShape exception in BRepLib::SameParameter" << endl;
|
cout << "Fail: BRepBuilderAPI_Sewing::SameParameterShape exception in BRepLib::SameParameter" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -147,7 +147,6 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
|
|||||||
|
|
||||||
if ( ! aRes.IsNull() )
|
if ( ! aRes.IsNull() )
|
||||||
{
|
{
|
||||||
aRes->SetFailStatus(exp.Current());
|
|
||||||
aRes->SetFailStatus(S);
|
aRes->SetFailStatus(S);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -238,19 +238,27 @@ static Standard_Boolean KPartCircle
|
|||||||
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
|
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
|
||||||
Standard_Boolean& myIsDone)
|
Standard_Boolean& myIsDone)
|
||||||
{
|
{
|
||||||
TopExp_Explorer exp(mySpine,TopAbs_EDGE);
|
TopoDS_Edge E;
|
||||||
Standard_Integer NbEdges = 0;
|
for (TopExp_Explorer anEdgeIter (mySpine, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next())
|
||||||
TopoDS_Edge E;
|
{
|
||||||
|
if (!E.IsNull())
|
||||||
for (; exp.More(); exp.Next()) {
|
{
|
||||||
NbEdges++;
|
return Standard_False;
|
||||||
E = TopoDS::Edge(exp.Current());
|
}
|
||||||
if (NbEdges > 1) return Standard_False;
|
E = TopoDS::Edge (anEdgeIter.Current());
|
||||||
|
}
|
||||||
|
if (E.IsNull())
|
||||||
|
{
|
||||||
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Real f,l;
|
Standard_Real f,l;
|
||||||
TopLoc_Location L;
|
TopLoc_Location L;
|
||||||
Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,f,l);
|
Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,f,l);
|
||||||
|
if (C.IsNull())
|
||||||
|
{
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
|
if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
|
||||||
Handle(Geom_TrimmedCurve) Ct = Handle(Geom_TrimmedCurve)::DownCast(C);
|
Handle(Geom_TrimmedCurve) Ct = Handle(Geom_TrimmedCurve)::DownCast(C);
|
||||||
@@ -741,7 +749,6 @@ void BRepFill_OffsetWire::PerformWithBiLo
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
BRep_Builder myBuilder;
|
BRep_Builder myBuilder;
|
||||||
myBuilder.MakeCompound(TopoDS::Compound(myShape));
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
// MapNodeVertex : associate to each node of the map (key1) and to
|
// MapNodeVertex : associate to each node of the map (key1) and to
|
||||||
@@ -785,6 +792,11 @@ void BRepFill_OffsetWire::PerformWithBiLo
|
|||||||
TopExp::Vertices(theWire, Ends[0], Ends[1]);
|
TopExp::Vertices(theWire, Ends[0], Ends[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Locus.NumberOfContours() == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) {
|
for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) {
|
||||||
TopoDS_Shape PEE = Link.GeneratingShape(Locus.BasicElt(ic,Locus.NumberOfElts(ic)));
|
TopoDS_Shape PEE = Link.GeneratingShape(Locus.BasicElt(ic,Locus.NumberOfElts(ic)));
|
||||||
TopoDS_Shape& PE = PEE ;
|
TopoDS_Shape& PE = PEE ;
|
||||||
|
@@ -2297,7 +2297,7 @@ void BRepLib::EncodeRegularity(TopoDS_Edge& E,
|
|||||||
B.Continuity(E,F1,F2,aCont);
|
B.Continuity(E,F1,F2,aCont);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(Standard_Failure)
|
catch(Standard_Failure const&)
|
||||||
{
|
{
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
cout << "Failure: Exception in BRepLib::EncodeRegularity" << endl;
|
cout << "Failure: Exception in BRepLib::EncodeRegularity" << endl;
|
||||||
|
@@ -152,7 +152,7 @@ static Standard_Boolean Is2DClosed(const TopoDS_Shape& theShape,
|
|||||||
TopoDS_Vertex aV2 = TopExp::LastVertex( aLastEdge, Standard_True );
|
TopoDS_Vertex aV2 = TopExp::LastVertex( aLastEdge, Standard_True );
|
||||||
return ( aV1.IsSame( aV2 ) && Is2DConnected( aLastEdge, aFisrtEdge, theSurface, theLocation));
|
return ( aV1.IsSame( aV2 ) && Is2DConnected( aLastEdge, aFisrtEdge, theSurface, theLocation));
|
||||||
}
|
}
|
||||||
catch ( Standard_Failure ) {
|
catch (Standard_Failure const&) {
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -131,10 +131,10 @@ BRepLib_MakeWire::BRepLib_MakeWire(const TopoDS_Wire& W,
|
|||||||
|
|
||||||
void BRepLib_MakeWire::Add(const TopoDS_Wire& W)
|
void BRepLib_MakeWire::Add(const TopoDS_Wire& W)
|
||||||
{
|
{
|
||||||
TopExp_Explorer ex(W,TopAbs_EDGE);
|
for (TopoDS_Iterator it(W); it.More(); it.Next()) {
|
||||||
while (ex.More()) {
|
Add(TopoDS::Edge(it.Value()));
|
||||||
Add(TopoDS::Edge(ex.Current()));
|
if (myError != BRepLib_WireDone)
|
||||||
ex.Next();
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,10 +24,10 @@
|
|||||||
#include <BRepLib_WireError.hxx>
|
#include <BRepLib_WireError.hxx>
|
||||||
#include <TopoDS_Edge.hxx>
|
#include <TopoDS_Edge.hxx>
|
||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||||
#include <TopTools_IndexedMapOfShape.hxx>
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
#include <BRepLib_MakeShape.hxx>
|
#include <BRepLib_MakeShape.hxx>
|
||||||
#include <TopTools_ListOfShape.hxx>
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <NCollection_Map.hxx>
|
|
||||||
#include <Bnd_Box.hxx>
|
#include <Bnd_Box.hxx>
|
||||||
#include <NCollection_UBTree.hxx>
|
#include <NCollection_UBTree.hxx>
|
||||||
|
|
||||||
@@ -172,14 +172,14 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void CollectCoincidentVertices(const TopTools_ListOfShape& theL,
|
void CollectCoincidentVertices(const TopTools_ListOfShape& theL,
|
||||||
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
|
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
|
||||||
|
|
||||||
void CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
|
void CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
|
||||||
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV);
|
TopTools_DataMapOfShapeShape& theO2NV);
|
||||||
|
|
||||||
void CreateNewListOfEdges(const TopTools_ListOfShape& theL,
|
void CreateNewListOfEdges(const TopTools_ListOfShape& theL,
|
||||||
const NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV,
|
const TopTools_DataMapOfShapeShape& theO2NV,
|
||||||
TopTools_ListOfShape& theNewEList);
|
TopTools_ListOfShape& theNewEList);
|
||||||
|
|
||||||
void Add(const TopoDS_Edge& E, Standard_Boolean IsCheckGeometryProximity);
|
void Add(const TopoDS_Edge& E, Standard_Boolean IsCheckGeometryProximity);
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@ void BRepLib_MakeWire::Add(const TopTools_ListOfShape& L)
|
|||||||
|
|
||||||
CollectCoincidentVertices(L, aGrVL);
|
CollectCoincidentVertices(L, aGrVL);
|
||||||
|
|
||||||
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex> anO2NV;
|
TopTools_DataMapOfShapeShape anO2NV;
|
||||||
|
|
||||||
CreateNewVertices(aGrVL, anO2NV);
|
CreateNewVertices(aGrVL, anO2NV);
|
||||||
|
|
||||||
@@ -188,17 +188,13 @@ void BRepLib_MakeWire::CollectCoincidentVertices(const TopTools_ListOfShape& the
|
|||||||
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL)
|
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL)
|
||||||
{
|
{
|
||||||
TopTools_IndexedMapOfShape anAllV;
|
TopTools_IndexedMapOfShape anAllV;
|
||||||
TopTools_ListIteratorOfListOfShape anItL;
|
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape aMV2EL;
|
TopTools_IndexedDataMapOfShapeListOfShape aMV2EL;
|
||||||
|
|
||||||
TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMV2EL);
|
TopExp::MapShapes(myShape, TopAbs_VERTEX, anAllV);
|
||||||
TopExp_Explorer exp;
|
|
||||||
for (anItL.Initialize(theL); anItL.More(); anItL.Next())
|
|
||||||
TopExp::MapShapesAndAncestors(anItL.Value(), TopAbs_VERTEX, TopAbs_EDGE, aMV2EL);
|
|
||||||
|
|
||||||
for (int i = 1; i <= aMV2EL.Extent(); i++)
|
TopTools_ListIteratorOfListOfShape anItL(theL);
|
||||||
if (aMV2EL(i).Extent() == 1)
|
for (; anItL.More(); anItL.Next())
|
||||||
anAllV.Add(aMV2EL.FindKey(i));
|
TopExp::MapShapes(anItL.Value(), TopAbs_VERTEX, anAllV);
|
||||||
|
|
||||||
//aV2CV : vertex <-> its coincident vertices
|
//aV2CV : vertex <-> its coincident vertices
|
||||||
NCollection_DataMap<TopoDS_Vertex, NCollection_Map<TopoDS_Vertex>> aV2CV;
|
NCollection_DataMap<TopoDS_Vertex, NCollection_Map<TopoDS_Vertex>> aV2CV;
|
||||||
@@ -303,8 +299,8 @@ void BRepLib_MakeWire::CollectCoincidentVertices(const TopTools_ListOfShape& the
|
|||||||
//function : CreateNewVertices
|
//function : CreateNewVertices
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
|
void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
|
||||||
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV)
|
TopTools_DataMapOfShapeShape& theO2NV)
|
||||||
{
|
{
|
||||||
//map [old vertex => new vertex]
|
//map [old vertex => new vertex]
|
||||||
//note that already existing shape (i.e. the original ones)
|
//note that already existing shape (i.e. the original ones)
|
||||||
@@ -356,7 +352,7 @@ void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BRepLib_MakeWire::CreateNewListOfEdges(const TopTools_ListOfShape& theL,
|
void BRepLib_MakeWire::CreateNewListOfEdges(const TopTools_ListOfShape& theL,
|
||||||
const NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV,
|
const TopTools_DataMapOfShapeShape& theO2NV,
|
||||||
TopTools_ListOfShape& theNewEList)
|
TopTools_ListOfShape& theNewEList)
|
||||||
{
|
{
|
||||||
///create the new list (theNewEList) from the input list L
|
///create the new list (theNewEList) from the input list L
|
||||||
|
@@ -70,7 +70,12 @@ void BRepMAT2d_BisectingLocus::Compute(BRepMAT2d_Explorer& anExplo,
|
|||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
|
|
||||||
nbSect.Clear();
|
nbSect.Clear();
|
||||||
|
theGraph = new MAT_Graph();
|
||||||
nbContours = anExplo.NumberOfContours();
|
nbContours = anExplo.NumberOfContours();
|
||||||
|
if (nbContours == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------
|
//---------------------------------
|
||||||
// Lecture des donnees de anExplo.
|
// Lecture des donnees de anExplo.
|
||||||
@@ -121,7 +126,6 @@ void BRepMAT2d_BisectingLocus::Compute(BRepMAT2d_Explorer& anExplo,
|
|||||||
TheRoots->BackAdd(TheMAT.Bisector());
|
TheRoots->BackAdd(TheMAT.Bisector());
|
||||||
}
|
}
|
||||||
|
|
||||||
theGraph = new MAT_Graph();
|
|
||||||
theGraph->Perform(TheMAT.SemiInfinite(),
|
theGraph->Perform(TheMAT.SemiInfinite(),
|
||||||
TheRoots,
|
TheRoots,
|
||||||
theTool.NumberOfItems(),
|
theTool.NumberOfItems(),
|
||||||
|
@@ -123,12 +123,6 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
|
|||||||
const TopoDS_Face& aFace,
|
const TopoDS_Face& aFace,
|
||||||
TopoDS_Face& aNewFace)
|
TopoDS_Face& aNewFace)
|
||||||
{
|
{
|
||||||
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin
|
|
||||||
// This method is totally rewroted to include check
|
|
||||||
// of connection and creation of a new spine.
|
|
||||||
NewContour();
|
|
||||||
myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False;
|
|
||||||
|
|
||||||
// Modified by skv - Wed Jun 23 12:23:01 2004 Integration Begin
|
// Modified by skv - Wed Jun 23 12:23:01 2004 Integration Begin
|
||||||
// Taking into account side of bisecting loci construction.
|
// Taking into account side of bisecting loci construction.
|
||||||
// TopoDS_Wire aWFwd = TopoDS::Wire(Spine.Oriented(TopAbs_FORWARD));
|
// TopoDS_Wire aWFwd = TopoDS::Wire(Spine.Oriented(TopAbs_FORWARD));
|
||||||
@@ -136,10 +130,15 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
|
|||||||
BRepTools_WireExplorer anExp(Spine, aFace);
|
BRepTools_WireExplorer anExp(Spine, aFace);
|
||||||
// Modified by skv - Wed Jun 23 12:23:02 2004 Integration End
|
// Modified by skv - Wed Jun 23 12:23:02 2004 Integration End
|
||||||
TopTools_IndexedDataMapOfShapeShape anOldNewE;
|
TopTools_IndexedDataMapOfShapeShape anOldNewE;
|
||||||
|
|
||||||
if (!anExp.More())
|
if (!anExp.More())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin
|
||||||
|
// This method is totally rewroted to include check
|
||||||
|
// of connection and creation of a new spine.
|
||||||
|
NewContour();
|
||||||
|
myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False;
|
||||||
|
|
||||||
TopoDS_Edge aFirstEdge = anExp.Current();
|
TopoDS_Edge aFirstEdge = anExp.Current();
|
||||||
TopoDS_Edge aPrevEdge = aFirstEdge;
|
TopoDS_Edge aPrevEdge = aFirstEdge;
|
||||||
Standard_Real UFirst,ULast, aD;
|
Standard_Real UFirst,ULast, aD;
|
||||||
|
@@ -223,7 +223,7 @@ private:
|
|||||||
this->registerNode(BRep_Tool::Pnt(theVertex), aPnt2d,
|
this->registerNode(BRep_Tool::Pnt(theVertex), aPnt2d,
|
||||||
BRepMesh_Fixed, Standard_False);
|
BRepMesh_Fixed, Standard_False);
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -347,7 +347,7 @@ static void ComputeMaxAngleOnShape(const TopoDS_Shape& S,
|
|||||||
{
|
{
|
||||||
tgtfaces(E, F1, F2, couture, theResAngle);
|
tgtfaces(E, F1, F2, couture, theResAngle);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure)
|
catch(Standard_Failure const&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -562,7 +562,7 @@ TopoDS_Face BRepOffset_MakeSimpleOffset::BuildWallFace(const TopoDS_Edge& theOri
|
|||||||
if (aFM.IsDone())
|
if (aFM.IsDone())
|
||||||
aF = aFM.Face();
|
aF = aFM.Face();
|
||||||
}
|
}
|
||||||
catch(Standard_Failure)
|
catch(Standard_Failure const&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3103,6 +3103,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
|||||||
TopLoc_Location L;
|
TopLoc_Location L;
|
||||||
Handle (Geom_Surface) S = BRep_Tool::Surface(F,L);
|
Handle (Geom_Surface) S = BRep_Tool::Surface(F,L);
|
||||||
Standard_Real UU1,VV1,UU2,VV2;
|
Standard_Real UU1,VV1,UU2,VV2;
|
||||||
|
Standard_Boolean uperiodic = Standard_False, vperiodic = Standard_False;
|
||||||
Standard_Boolean isVV1degen = Standard_False, isVV2degen = Standard_False;
|
Standard_Boolean isVV1degen = Standard_False, isVV2degen = Standard_False;
|
||||||
Standard_Real US1,VS1,US2,VS2;
|
Standard_Real US1,VS1,US2,VS2;
|
||||||
Standard_Real UF1,VF1,UF2,VF2;
|
Standard_Real UF1,VF1,UF2,VF2;
|
||||||
@@ -3146,6 +3147,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (S->IsUPeriodic()) {
|
if (S->IsUPeriodic()) {
|
||||||
|
uperiodic = Standard_True;
|
||||||
Standard_Real Period = S->UPeriod();
|
Standard_Real Period = S->UPeriod();
|
||||||
Standard_Real Delta = Period - (UF2 - UF1);
|
Standard_Real Delta = Period - (UF2 - UF1);
|
||||||
Standard_Real alpha = 0.1;
|
Standard_Real alpha = 0.1;
|
||||||
@@ -3155,6 +3157,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (S->IsVPeriodic()) {
|
if (S->IsVPeriodic()) {
|
||||||
|
vperiodic = Standard_True;
|
||||||
Standard_Real Period = S->VPeriod();
|
Standard_Real Period = S->VPeriod();
|
||||||
Standard_Real Delta = Period - (VF2 - VF1);
|
Standard_Real Delta = Period - (VF2 - VF1);
|
||||||
Standard_Real alpha = 0.1;
|
Standard_Real alpha = 0.1;
|
||||||
@@ -3199,6 +3202,12 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
|||||||
//Detect closedness in U and V directions
|
//Detect closedness in U and V directions
|
||||||
Standard_Boolean uclosed = Standard_False, vclosed = Standard_False;
|
Standard_Boolean uclosed = Standard_False, vclosed = Standard_False;
|
||||||
BRepTools::DetectClosedness(F, uclosed, vclosed);
|
BRepTools::DetectClosedness(F, uclosed, vclosed);
|
||||||
|
if (uclosed && !uperiodic &&
|
||||||
|
(theLenBeforeUfirst != 0. || theLenAfterUlast != 0.))
|
||||||
|
uclosed = Standard_False;
|
||||||
|
if (vclosed && !vperiodic &&
|
||||||
|
(theLenBeforeVfirst != 0. && theLenAfterVlast != 0.))
|
||||||
|
vclosed = Standard_False;
|
||||||
|
|
||||||
MakeFace(S,UU1,UU2,VV1,VV2,uclosed,vclosed,isVV1degen,isVV2degen,BF);
|
MakeFace(S,UU1,UU2,VV1,VV2,uclosed,vclosed,isVV1degen,isVV2degen,BF);
|
||||||
BF.Location(L);
|
BF.Location(L);
|
||||||
|
@@ -489,7 +489,7 @@ void BRepOffsetAPI_ThruSections::Build()
|
|||||||
CreateSmoothed();
|
CreateSmoothed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure const&)
|
||||||
{
|
{
|
||||||
NotDone();
|
NotDone();
|
||||||
return;
|
return;
|
||||||
|
@@ -67,25 +67,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IsPCurveUiso
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
static Standard_Boolean IsPCurveUiso(const Handle(Geom2d_Curve)& thePCurve,
|
|
||||||
Standard_Real theFirstPar,
|
|
||||||
Standard_Real theLastPar)
|
|
||||||
{
|
|
||||||
gp_Pnt2d FirstP2d = thePCurve->Value(theFirstPar);
|
|
||||||
gp_Pnt2d LastP2d = thePCurve->Value(theLastPar);
|
|
||||||
|
|
||||||
Standard_Real DeltaU = Abs(FirstP2d.X() - LastP2d.X());
|
|
||||||
Standard_Real DeltaV = Abs(FirstP2d.Y() - LastP2d.Y());
|
|
||||||
|
|
||||||
return (DeltaU < DeltaV);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : UVBounds
|
//function : UVBounds
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -977,28 +958,24 @@ void BRepTools::DetectClosedness(const TopoDS_Face& theFace,
|
|||||||
{
|
{
|
||||||
theUclosed = theVclosed = Standard_False;
|
theUclosed = theVclosed = Standard_False;
|
||||||
|
|
||||||
BRepAdaptor_Surface BAsurf(theFace, Standard_False);
|
|
||||||
Standard_Boolean IsSurfUclosed = BAsurf.IsUClosed();
|
|
||||||
Standard_Boolean IsSurfVclosed = BAsurf.IsVClosed();
|
|
||||||
if (!IsSurfUclosed && !IsSurfVclosed)
|
|
||||||
return;
|
|
||||||
|
|
||||||
TopExp_Explorer Explo(theFace, TopAbs_EDGE);
|
TopExp_Explorer Explo(theFace, TopAbs_EDGE);
|
||||||
for (; Explo.More(); Explo.Next())
|
for (; Explo.More(); Explo.Next())
|
||||||
{
|
{
|
||||||
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
|
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
|
||||||
if (BRepTools::IsReallyClosed(anEdge, theFace))
|
if (BRep_Tool::IsClosed(anEdge, theFace) &&
|
||||||
|
BRepTools::IsReallyClosed(anEdge, theFace))
|
||||||
{
|
{
|
||||||
Standard_Real fpar, lpar;
|
Standard_Real fpar, lpar;
|
||||||
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar);
|
Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar);
|
||||||
Standard_Boolean IsUiso = IsPCurveUiso(aPCurve, fpar, lpar);
|
Handle(Geom2d_Curve) PCurve2 = BRep_Tool::CurveOnSurface(TopoDS::Edge(anEdge.Reversed()),
|
||||||
if (IsSurfUclosed && IsUiso)
|
theFace, fpar, lpar);
|
||||||
|
gp_Pnt2d Point1 = PCurve1->Value(fpar);
|
||||||
|
gp_Pnt2d Point2 = PCurve2->Value(fpar);
|
||||||
|
Standard_Boolean IsUiso = (Abs(Point1.X() - Point2.X()) > Abs(Point1.Y() - Point2.Y()));
|
||||||
|
if (IsUiso)
|
||||||
theUclosed = Standard_True;
|
theUclosed = Standard_True;
|
||||||
if (IsSurfVclosed && !IsUiso)
|
else
|
||||||
theVclosed = Standard_True;
|
theVclosed = Standard_True;
|
||||||
|
|
||||||
if (theUclosed && theVclosed)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user