mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
Compare commits
116 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2a6b327cbb | ||
|
2eec394698 | ||
|
4811214cc0 | ||
|
52c38ce17d | ||
|
b271edb092 | ||
|
cca36b6b21 | ||
|
853af31fb1 | ||
|
ab1f458034 | ||
|
49dfdb7a97 | ||
|
43070f2fd8 | ||
|
77bc2ad1e0 | ||
|
858435884d | ||
|
1ac1059961 | ||
|
b44bf0f8fe | ||
|
6f2411378b | ||
|
7dd7c146e8 | ||
|
faa0a91133 | ||
|
42451ec057 | ||
|
66278500db | ||
|
245cbf9441 | ||
|
2b88626548 | ||
|
2506cf29b3 | ||
|
6fd9bdf2cc | ||
|
d1775ee992 | ||
|
293211aee0 | ||
|
1bbd7c793c | ||
|
ba7f665dce | ||
|
130bc3c097 | ||
|
1ec17fb48a | ||
|
2b2be3fb82 | ||
|
833034f301 | ||
|
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 | ||
|
060fc60338 | ||
|
bf5f0ca20a | ||
|
e08a9b0302 | ||
|
55c8f0f7a4 | ||
|
799318357c | ||
|
f522ce50b2 | ||
|
5d0038626b | ||
|
88b12b7c05 | ||
|
7b93ae3c5e | ||
|
6ef0d6f156 | ||
|
967d2f4f30 | ||
|
4ec8ee66a0 | ||
|
0493ffd083 | ||
|
0be7dbe183 | ||
|
1c8fc6bee2 | ||
|
d95f5ce102 | ||
|
1e756cb979 | ||
|
3bb61eb0fe | ||
|
2a33274558 | ||
|
4efe27fc4e | ||
|
ea298f59e4 | ||
|
78d5ea7a71 | ||
|
e084dbbc20 | ||
|
66d1cdc65d | ||
|
e607bd3e6b | ||
|
1ccc1371b9 | ||
|
5ac0f98974 | ||
|
2bda8346dc | ||
|
92435cd0ff | ||
|
597fde688e | ||
|
458ff6a680 | ||
|
a7ced2a456 | ||
|
ab9f6cabdc | ||
|
95c882e9d4 | ||
|
976627e601 | ||
|
d918208af6 | ||
|
98ae54f728 |
@@ -86,6 +86,11 @@ if (BUILD_WITH_DEBUG)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
|
||||
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
|
||||
if (NOT DEFINED BUILD_USE_PCH)
|
||||
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 Graphic3d
|
||||
n Image
|
||||
n Media
|
||||
n MeshVS
|
||||
n OpenGl
|
||||
n D3DHost
|
||||
|
@@ -65,6 +65,7 @@ if (WIN32)
|
||||
set (CSF_shell32 "shell32.lib")
|
||||
set (CSF_wsock32 "wsock32.lib")
|
||||
set (CSF_psapi "psapi.lib")
|
||||
set (CSF_winmm "winmm.lib")
|
||||
set (CSF_d3d9 "D3D9.lib")
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
|
||||
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")
|
||||
endif()
|
||||
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
||||
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
||||
if (BUILD_RELEASE_DISABLE_EXCEPTIONS)
|
||||
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
|
||||
"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
|
||||
"Enable/Disable the floating point exceptions (FPE) during DRAW execution only.
|
||||
Corresponding environment variable (CSF_FPE) can be changed manually
|
||||
|
@@ -30,10 +30,30 @@ set aRowIter 0
|
||||
set aCheckRowIter 0
|
||||
frame .myFrame -padx 5 -pady 5
|
||||
pack .myFrame -fill both -expand 1
|
||||
frame .myFrame.myPrjFrame
|
||||
frame .myFrame.myVsFrame
|
||||
frame .myFrame.myHxxChecks
|
||||
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_VC_LIST {}
|
||||
set SYS_VCVARS_LIST {}
|
||||
@@ -101,6 +121,7 @@ proc wokdep:gui:Close {} {
|
||||
}
|
||||
|
||||
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 ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
|
||||
|
||||
@@ -390,6 +411,8 @@ proc wokdep:gui:Show64Bitness { theRowIter } {
|
||||
}
|
||||
|
||||
# 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::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
|
||||
@@ -494,6 +517,10 @@ ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
|
||||
|
||||
# Create grid
|
||||
# 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" } {
|
||||
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
|
||||
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
|
||||
|
||||
# Bind events
|
||||
bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
|
||||
wokdep:gui:SwitchConfig
|
||||
}
|
||||
bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
|
||||
wokdep:gui:SwitchConfig
|
||||
}
|
||||
|
@@ -27,8 +27,10 @@ if { "$tcl_platform(platform)" == "unix" } {
|
||||
set SYS_EXE_SUFFIX ""
|
||||
if { "$tcl_platform(os)" == "Darwin" } {
|
||||
set SYS_LIB_SUFFIX "dylib"
|
||||
set PRJFMT "xcd"
|
||||
} else {
|
||||
set SYS_LIB_SUFFIX "so"
|
||||
set PRJFMT "cbp"
|
||||
}
|
||||
set VCVER "gcc"
|
||||
set VCVARS ""
|
||||
@@ -39,6 +41,7 @@ if { "$tcl_platform(platform)" == "unix" } {
|
||||
set SYS_EXE_SUFFIX ".exe"
|
||||
set VCVER "vc10"
|
||||
set VCVARS ""
|
||||
set PRJFMT "vcxproj"
|
||||
}
|
||||
|
||||
set SHORTCUT_HEADERS "ShortCut"
|
||||
@@ -82,7 +85,7 @@ if { "$tcl_platform(platform)" != "windows" } {
|
||||
set HAVE_D3D ""
|
||||
set HAVE_RelWithDebInfo ""
|
||||
}
|
||||
foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
|
||||
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT PRODUCTS_PATH} {
|
||||
if { [info exists ::env(${anEnvIter})] } {
|
||||
set ${anEnvIter} "$::env(${anEnvIter})"
|
||||
}
|
||||
@@ -1118,15 +1121,33 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
|
||||
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
|
||||
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" } {
|
||||
set aCustomFilePath "./custom.bat"
|
||||
set aFile [open $aCustomFilePath "w"]
|
||||
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 "set PRJFMT=$::PRJFMT"
|
||||
puts $aFile "set VCVER=$::VCVER"
|
||||
puts $aFile "set ARCH=$::ARCH"
|
||||
puts $aFile "set VCVARS=$::VCVARS"
|
||||
@@ -1146,26 +1167,41 @@ proc wokdep:SaveCustom {} {
|
||||
}
|
||||
|
||||
set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aStringInc [regsub -all "$::PRODUCTS_PATH" $aStringInc "%PRODUCTS_PATH%"]
|
||||
}
|
||||
puts $aFile ""
|
||||
puts $aFile "rem Additional headers search paths"
|
||||
puts $aFile "set \"CSF_OPT_INC=$aStringInc\""
|
||||
|
||||
set aStringLib32 [join $::CSF_OPT_LIB32 $::SYS_PATH_SPLITTER]
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aStringLib32 [regsub -all "$::PRODUCTS_PATH" $aStringLib32 "%PRODUCTS_PATH%"]
|
||||
}
|
||||
puts $aFile ""
|
||||
puts $aFile "rem Additional libraries (32-bit) search paths"
|
||||
puts $aFile "set \"CSF_OPT_LIB32=$aStringLib32\""
|
||||
|
||||
set aStringLib64 [join $::CSF_OPT_LIB64 $::SYS_PATH_SPLITTER]
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aStringLib64 [regsub -all "$::PRODUCTS_PATH" $aStringLib64 "%PRODUCTS_PATH%"]
|
||||
}
|
||||
puts $aFile ""
|
||||
puts $aFile "rem Additional libraries (64-bit) search paths"
|
||||
puts $aFile "set \"CSF_OPT_LIB64=$aStringLib64\""
|
||||
|
||||
set aStringBin32 [join $::CSF_OPT_BIN32 $::SYS_PATH_SPLITTER]
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aStringBin32 [regsub -all "$::PRODUCTS_PATH" $aStringBin32 "%PRODUCTS_PATH%"]
|
||||
}
|
||||
puts $aFile ""
|
||||
puts $aFile "rem Additional (32-bit) search paths"
|
||||
puts $aFile "set \"CSF_OPT_BIN32=$aStringBin32\""
|
||||
|
||||
set aStringBin64 [join $::CSF_OPT_BIN64 $::SYS_PATH_SPLITTER]
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aStringBin64 [regsub -all "$::PRODUCTS_PATH" $aStringBin64 "%PRODUCTS_PATH%"]
|
||||
}
|
||||
puts $aFile ""
|
||||
puts $aFile "rem Additional (64-bit) search paths"
|
||||
puts $aFile "set \"CSF_OPT_BIN64=$aStringBin64\""
|
||||
@@ -1175,9 +1211,10 @@ proc wokdep:SaveCustom {} {
|
||||
set aCustomFilePath "./custom.sh"
|
||||
set aFile [open $aCustomFilePath "w"]
|
||||
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 "export PRJFMT=$::PRJFMT"
|
||||
puts $aFile "export ARCH=$::ARCH"
|
||||
puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
|
||||
|
||||
@@ -1195,22 +1232,88 @@ proc wokdep:SaveCustom {} {
|
||||
}
|
||||
|
||||
set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aStringInc [regsub -all "$::PRODUCTS_PATH" $aStringInc "\${PRODUCTS_PATH}"]
|
||||
}
|
||||
puts $aFile ""
|
||||
puts $aFile "# Additional headers search paths"
|
||||
puts $aFile "export CSF_OPT_INC=\"$aStringInc\""
|
||||
|
||||
set aStringLib$::ARCH [join [set ::CSF_OPT_LIB$::ARCH] $::SYS_PATH_SPLITTER]
|
||||
set aStringLib [join [set ::CSF_OPT_LIB$::ARCH] $::SYS_PATH_SPLITTER]
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aStringLib [regsub -all "$::PRODUCTS_PATH" $aStringLib "\${PRODUCTS_PATH}"]
|
||||
}
|
||||
puts $aFile ""
|
||||
puts $aFile "# Additional libraries ($::ARCH-bit) search paths"
|
||||
puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib$::ARCH]\""
|
||||
puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib]\""
|
||||
|
||||
set aStringBin$::ARCH [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
|
||||
set aStringBin [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aStringBin [regsub -all "$::PRODUCTS_PATH" $aStringBin "\${PRODUCTS_PATH}"]
|
||||
}
|
||||
puts $aFile ""
|
||||
puts $aFile "# Additional ($::ARCH-bit) search paths"
|
||||
puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin$::ARCH]\""
|
||||
puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin]\""
|
||||
|
||||
close $aFile
|
||||
}
|
||||
|
||||
puts "Configuration saved to file '$aCustomFilePath'"
|
||||
|
||||
# generate custom.auto.pri
|
||||
set toExportCustomPri 1
|
||||
if { $toExportCustomPri == 1 } {
|
||||
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 {
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set anIncPath [regsub -all "$::PRODUCTS_PATH" $anIncPath "\$\$\{PRODUCTS_PATH\}"]
|
||||
}
|
||||
puts $aFile "INCLUDEPATH += \"${anIncPath}\""
|
||||
}
|
||||
|
||||
puts $aFile ""
|
||||
puts $aFile "# Additional libraries search paths"
|
||||
foreach aLibPath [set ::CSF_OPT_LIB$::ARCH] {
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aLibPath [regsub -all "$::PRODUCTS_PATH" $aLibPath "\$\$\{PRODUCTS_PATH\}"]
|
||||
}
|
||||
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] {
|
||||
if { "$::PRODUCTS_PATH" != "" } {
|
||||
set aDllPath [regsub -all "$::PRODUCTS_PATH" $aDllPath "\$\$\{PRODUCTS_PATH\}"]
|
||||
}
|
||||
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
|
||||
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 isHelpRequire false
|
||||
|
||||
@@ -314,6 +314,7 @@ proc genproj {theFormat args} {
|
||||
vc141 - Visual Studio 2017
|
||||
cbp - CodeBlocks
|
||||
xcd - XCode
|
||||
pro - Qt Creator
|
||||
|
||||
Platform (optional):
|
||||
wnt - Windows Desktop
|
||||
@@ -395,9 +396,14 @@ proc genprojbat {theFormat thePlatform} {
|
||||
"cbp" {
|
||||
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.sh" "$::path/codeblocks.sh"
|
||||
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
|
||||
file mkdir "$::path/$thePlatform/cbp/lib"
|
||||
file mkdir "$::path/$thePlatform/cbp/libd"
|
||||
set aPlatformAndCompiler "${thePlatform}/gcc"
|
||||
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" }
|
||||
}
|
||||
@@ -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
|
||||
if (![file isdirectory $path/inc]) {
|
||||
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 ..."
|
||||
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
|
||||
switch -exact -- "$theFormat" {
|
||||
"vc7" -
|
||||
@@ -1349,6 +1359,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
|
||||
set aLibsMap(CSF_opengl32) "opengl32"
|
||||
set aLibsMap(CSF_wsock32) "wsock32"
|
||||
set aLibsMap(CSF_netapi32) "netapi32"
|
||||
set aLibsMap(CSF_winmm) "winmm"
|
||||
set aLibsMap(CSF_OpenGlLibs) "opengl32"
|
||||
if { "$::HAVE_GLES2" == "true" } {
|
||||
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
|
||||
@@ -2295,6 +2306,10 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
||||
set aCmplFlagsDebug [list]
|
||||
set toPassArgsByFile 0
|
||||
set aLibPrefix "lib"
|
||||
set aPlatformAndCompiler "${thePlatform}/gcc"
|
||||
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
|
||||
set aPlatformAndCompiler "${thePlatform}/clang"
|
||||
}
|
||||
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" || "$thePlatform" == "qnx" } {
|
||||
set toPassArgsByFile 1
|
||||
}
|
||||
@@ -2351,17 +2366,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
||||
# Release target configuration
|
||||
puts $aFile "\t\t\t<Target title=\"Release\">"
|
||||
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\" />"
|
||||
} else {
|
||||
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 {
|
||||
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 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 createDefFile=\"0\" />"
|
||||
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
||||
@@ -2384,7 +2399,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
||||
if { $toPassArgsByFile == 1 } {
|
||||
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 { [ lsearch $theLibsList X11 ] >= 0} {
|
||||
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})\" />"
|
||||
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>"
|
||||
|
||||
@@ -2401,17 +2416,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
||||
# Debug target configuration
|
||||
puts $aFile "\t\t\t<Target title=\"Debug\">"
|
||||
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\" />"
|
||||
} else {
|
||||
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 {
|
||||
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 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 createDefFile=\"0\" />"
|
||||
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
|
||||
@@ -2434,7 +2449,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
|
||||
if { $toPassArgsByFile == 1 } {
|
||||
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 { [ lsearch $theLibsList X11 ] >= 0} {
|
||||
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)\" />"
|
||||
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>"
|
||||
|
||||
@@ -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</Unit>"
|
||||
|
||||
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/obj/src/"] $aSrcFile]]
|
||||
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/objd/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/" "/${aPlatformAndCompiler}/objd/src/"] $aSrcFile]]
|
||||
puts -nonewline $aFileLnkObj "$aFileObj "
|
||||
puts -nonewline $aFileLnkObjd "$aFileObjd "
|
||||
} 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
|
157
adm/qmake/OccCppConfig.pri
Normal file
157
adm/qmake/OccCppConfig.pri
Normal file
@@ -0,0 +1,157 @@
|
||||
# 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
|
||||
CONFIG += warn_on
|
||||
QMAKE_CFLAGS_WARN_ON = -Wall
|
||||
QMAKE_CXXFLAGS_WARN_ON = -Wall
|
||||
win32 {
|
||||
QMAKE_CFLAGS_WARN_ON = -W4
|
||||
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 {
|
||||
CONFIG += c++11
|
||||
QMAKE_CFLAGS += -fexceptions
|
||||
QMAKE_CXXFLAGS += -fexceptions
|
||||
QMAKE_CXXFLAGS += -fvisibility=default
|
||||
DEFINES += OCC_CONVERT_SIGNALS
|
||||
mac {
|
||||
iphoneos {
|
||||
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
|
||||
} else {
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
|
||||
}
|
||||
}
|
||||
}
|
||||
!CONFIG(debug, debug|release) {
|
||||
# disable exceptions in Release builds
|
||||
DEFINES += No_Exception
|
||||
HAVE_RelWithDebInfo {
|
||||
win32 {
|
||||
CONFIG += force_debug_info
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 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
|
||||
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)
|
138
adm/qmake/OccToolkit.pri
Normal file
138
adm/qmake/OccToolkit.pri
Normal file
@@ -0,0 +1,138 @@
|
||||
# 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_winmm = -lwinmm
|
||||
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_BIN32="
|
||||
set "CSF_OPT_BIN64="
|
||||
set "CSF_DEFINES=%CSF_DEFINES_EXTRA%"
|
||||
|
||||
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
|
||||
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
|
||||
|
@@ -6,7 +6,7 @@ aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath
|
||||
# Reset values
|
||||
export CASROOT="__CASROOT__"
|
||||
export CASDEB=""
|
||||
export TARGET="";
|
||||
export PRJFMT="";
|
||||
export HAVE_TBB="false";
|
||||
export HAVE_OPENCL="false";
|
||||
export HAVE_FREEIMAGE="false";
|
||||
@@ -40,9 +40,9 @@ do
|
||||
elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
|
||||
export CASDEB="i"
|
||||
elif [ "$i" == "cbp" ]; then
|
||||
export TARGET="cbp";
|
||||
export PRJFMT="cbp";
|
||||
elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
|
||||
export TARGET="xcd";
|
||||
export PRJFMT="xcd";
|
||||
fi
|
||||
done
|
||||
shopt -u nocasematch
|
||||
@@ -64,28 +64,32 @@ else
|
||||
fi
|
||||
|
||||
export CASBIN=""
|
||||
if [ "${TARGET}" == "cbp" ]; then
|
||||
export CASBIN="${WOKSTATION}/cbp"
|
||||
elif [ "${TARGET}" == "xcd" ]; then
|
||||
if [ "${PRJFMT}" == "xcd" ]; then
|
||||
export CASBIN="adm/mac/xcd/build"
|
||||
else
|
||||
if [ "$aSystem" == "Darwin" ]; then
|
||||
export CASBIN="${WOKSTATION}/clang"
|
||||
else
|
||||
export CASBIN="${WOKSTATION}/gcc"
|
||||
fi
|
||||
fi
|
||||
|
||||
export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
|
||||
|
||||
if [ "${TARGET}" == "cbp" ]; 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
|
||||
if [ "${PRJFMT}" == "xcd" ]; then
|
||||
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${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_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
|
||||
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${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
|
||||
|
||||
export CSF_OPT_CMPL=""
|
||||
@@ -174,7 +178,7 @@ export CSF_OCCTSamplesPath="${CSF_OCCTSamplesPath:-$CASROOT/samples}"
|
||||
export CSF_OCCTDataPath="${CSF_OCCTDataPath:-$CASROOT/data}"
|
||||
export CSF_OCCTTestsPath="${CSF_OCCTTestsPath:-$CASROOT/tests}"
|
||||
|
||||
if [ "${TARGET}" == "xcd" ]; then
|
||||
if [ "${PRJFMT}" == "xcd" ]; then
|
||||
if [ "${CASDEB}" == "d" ]; then
|
||||
export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/Debug}"
|
||||
else
|
||||
|
@@ -89,6 +89,14 @@ file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nEXTERNAL_SEARCH = NO")
|
||||
# Formula options
|
||||
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nMATHJAX_RELPATH = ${3RDPARTY_MATHJAX_RELATIVE_PATH}")
|
||||
|
||||
# If MSVC is used as build system, change warning format to the one recognized by MSVC
|
||||
if (MSVC)
|
||||
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nWARN_FORMAT = \"$file($line): $text\"")
|
||||
endif()
|
||||
|
||||
# Avoid Doxygen parsing messages in the build log
|
||||
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nQUIET = YES")
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file(COPY "${OCCT_OVERVIEW_RESOURCE_DIR}/index.html" DESTINATION "${OCCT_GENERATED_OVERVIEW_DIR}")
|
||||
|
||||
|
@@ -1091,7 +1091,7 @@ The following environment variables have become redundant:
|
||||
|
||||
* *CSF_UnitsLexicon* and *CSF_UnitsDefinition* are no more used. Units definition (*UnitsAPI/Lexi_Expr.dat* and *UnitsAPI/Units.dat*) is now embedded into source code.
|
||||
* *CSF_XSMessage* and *CSF_XHMessage* are now optional.
|
||||
English messages (XSMessage/*XSTEP.us* and SHMessage/*SHAPE.us*) are now embedded into source code
|
||||
English messages (XSMessage/\*XSTEP.us* and SHMessage/\*SHAPE.us*) are now embedded into source code
|
||||
and automatically loaded when environment variables are not set.
|
||||
* *CSF_ShadersDirectory* is not required any more, though it still can be used to load custom shaders.
|
||||
Mandatory GLSL resources are now embedded into source code.
|
||||
@@ -1678,3 +1678,74 @@ Standard_Boolean meshing_new()
|
||||
Some public methods of the class BRepFilletAPI_MakeChamfer are released from excess arguments:
|
||||
- method Add for symmetric chamfer now takes only 2 arguments: distance and edge;
|
||||
- method GetDistAngle now takes only 3 arguments: index of contour, distance and angle.
|
||||
|
||||
@subsection upgrade_740_aspects Aspects unification
|
||||
|
||||
Fill Area, Line and Marker aspects (classes *Graphic3d_AspectFillArea3d*, *Graphic3d_AspectLine3d*, *Graphic3d_AspectMarker3d* and *Graphic3d_AspectText3d*)
|
||||
have been merged into new class *Graphic3d_Aspects* providing a single state for rendering primitives of any type.
|
||||
The old per-primitive type aspect classes have been preserved as sub-classes of *Graphic3d_Aspects* with default values close to the previous behavior.
|
||||
All aspects except Graphic3d_AspectFillArea3d define Graphic3d_TOSM_UNLIT shading model.
|
||||
|
||||
The previous approach with dedicated aspects per primitive type was handy in simplified case, but lead to confusion otherwise.
|
||||
In fact, drawing points or lines with lighting applied is a valid use case, but only *Graphic3d_AspectFillArea3d* previously defined necessary material properties.
|
||||
|
||||
As aspects for different primitive types have been merged, Graphic3d_Group does no more provide per-type aspect properties.
|
||||
Existing code relying on old behavior and putting interleaved per-type aspects into single Graphic3d_Group should be updated.
|
||||
For example, the following pseudo-code will not work anymore, because all *SetGroupPrimitivesAspect* calls will setup the same property:
|
||||
~~~~
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< overrides previous aspect
|
||||
|
||||
Handle(Graphic3d_ArrayOfSegments) aLines = new Graphic3d_ArrayOfSegments (2);
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris = new Graphic3d_ArrayOfTriangles (3);
|
||||
aGroup->AddPrimitiveArray (aLines); //!< both arrays will use the same aspect
|
||||
aGroup->AddPrimitiveArray (aTris);
|
||||
~~~~
|
||||
|
||||
To solve the problem, the code should be modified to either put primitives into dedicated groups (preferred approach), or using *SetPrimitivesAspect* in proper order:
|
||||
~~~~
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTris = new Graphic3d_ArrayOfTriangles (3);
|
||||
aGroup->AddPrimitiveArray (aTris);
|
||||
|
||||
Handle(Graphic3d_ArrayOfSegments) aLines = new Graphic3d_ArrayOfSegments (2);
|
||||
aGroup->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< next array will use the new aspect
|
||||
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
|
||||
|
||||
* *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.
|
||||
* *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.
|
||||
|
||||
@subsection upgrade_740_modedprs PrsMgr_ModedPresentation removal
|
||||
|
||||
Proxy classes *Prs3d_Presentation*, *PrsMgr_ModedPresentation* and *PrsMgr_Prs* have been removed.
|
||||
Code iterating through the list of low-level structures AIS_InteractiveObject::Presentations() should be updated to access PrsMgr_Presentation directly.
|
||||
Forward declarations of *Prs3d_Presentation* should be corrected, since it is now a typedef to *Graphic3d_Structure*.
|
||||
|
||||
@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
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
PREDEFINED = Standard_EXPORT 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_LATEX = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
|
@@ -16,7 +16,6 @@ WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = \\$file:\$line: \$text\
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.md *.dox
|
||||
RECURSIVE = YES
|
||||
@@ -56,6 +55,6 @@ USE_MATHJAX = YES
|
||||
MATHJAX_FORMAT = HTML-CSS
|
||||
|
||||
# Define alias for inserting images in uniform way (both HTML and PDF)
|
||||
ALIASES += figure{1}="\image html \1 \n"
|
||||
ALIASES += figure{2}="\image html \1 \2 \n"
|
||||
ALIASES += figure{3}="\image html \1 \2 \n"
|
||||
ALIASES += figure{1}="\image html \1"
|
||||
ALIASES += figure{2}="\image html \1 \2"
|
||||
ALIASES += figure{3}="\image html \1 \2"
|
||||
|
@@ -16,7 +16,6 @@ WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = \\$file:\$line: \$text\
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.md *.dox
|
||||
RECURSIVE = YES
|
||||
@@ -49,6 +48,6 @@ LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
|
||||
# Define alias for inserting images in uniform way (both HTML and PDF)
|
||||
ALIASES += figure{1}="\image latex \1 \n"
|
||||
ALIASES += figure{2}="\image latex \1 \2 \n"
|
||||
ALIASES += figure{3}="\image latex \1 \2 width=\3 \n"
|
||||
ALIASES += figure{1}="\image latex \1"
|
||||
ALIASES += figure{2}="\image latex \1 \2"
|
||||
ALIASES += figure{3}="\image latex \1 \2 width=\3"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Draw Test Harness {#occt_user_guides__test_harness}
|
||||
Draw Test Harness {#occt_user_guides__test_harness}
|
||||
===============================
|
||||
|
||||
@tableofcontents
|
||||
@@ -5593,7 +5593,8 @@ Draw provides command to create curves and surfaces by approximation.
|
||||
|
||||
* **2dapprox** fits a curve through 2d points;
|
||||
* **appro** fits a curve through 3d points;
|
||||
* **surfapp** and **grilapp** fit a surface through 3d points;
|
||||
* **surfapp** and **grilapp** fit a surface through 3d points by approximation;
|
||||
* **surfint** fit a surface through 3d points by interpolation;
|
||||
* **2dinterpolate** interpolates a curve.
|
||||
|
||||
@subsubsection occt_draw_6_8_1 appro, dapprox
|
||||
@@ -5614,17 +5615,28 @@ Let us pick points and they will be fitted
|
||||
2dapprox c 10
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_draw_6_8_2 surfapp, grilapp
|
||||
@subsubsection occt_draw_6_8_2 surfapp, grilapp, surfint
|
||||
|
||||
|
||||
Syntax:
|
||||
~~~~~
|
||||
surfapp name nbupoints nbvpoints x y z ....
|
||||
or
|
||||
surfapp name nbupoints nbvpoints surf [periodic_flag = 0]
|
||||
grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ...
|
||||
surfint name surf nbupoints nbvpoints [periodic_flag = 0]
|
||||
~~~~~
|
||||
|
||||
* **surfapp** fits a surface through an array of u and v points, nbupoints*nbvpoints.
|
||||
* **grilapp** has the same function, but the x,y coordinates of the points are on a grid starting at x0,y0 with steps dx,dy.
|
||||
* **surfapp** can take array of points from other input surface, if alternative syntax
|
||||
**surfapp** name nbupoints nbvpoints surf [periodic_flag = 0]
|
||||
is used.
|
||||
Both command use for fitting approximation algorithm.
|
||||
**surfint** uses interpolation algorithm and can take array of point only from other input surface.
|
||||
Optional parameter **periodic_flag** allows to get correct periodical surfaces in U direction.
|
||||
U direction of result surface corresponds colums of initial array of points.
|
||||
If **periodic_flag** = 1, algorithm uses first row of array as last row and builds periodical surface.
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
|
@@ -178,10 +178,10 @@ if (!Interface_Static::SetRVal ("read.maxprecision.val",0.1))
|
||||
Default value is 1.
|
||||
|
||||
<h4>read.stdsameparameter.mode</h4>
|
||||
defines the using of *BRepLib::SameParameter*. Its possible values are:
|
||||
* 0 (Off) -- *BRepLib::SameParameter* is not called,
|
||||
* 1 (On) -- *BRepLib::SameParameter* is called.
|
||||
*BRepLib::SameParameter* is used through *ShapeFix_Edge::SameParameter*. It ensures that the resulting edge will have the lowest tolerance taking pcurves either unmodified from the IGES file or modified by *BRepLib::SameParameter*.
|
||||
defines the using of *BRepLib\::SameParameter*. Its possible values are:
|
||||
* 0 (Off) -- *BRepLib\::SameParameter* is not called,
|
||||
* 1 (On) -- *BRepLib\::SameParameter* is called.
|
||||
*BRepLib\::SameParameter* is used through *ShapeFix_Edge\::SameParameter*. It ensures that the resulting edge will have the lowest tolerance taking pcurves either unmodified from the IGES file or modified by *BRepLib\::SameParameter*.
|
||||
Read this parameter with:
|
||||
~~~~~
|
||||
Standard_Integer mv = Interface_Static::IVal("read.stdsameparameter.mode");
|
||||
@@ -202,7 +202,7 @@ The processor also decides to re-compute either the 3D or the 2D curve even if
|
||||
* the number of sub-curves in the 2D curve is different from the number of sub-curves in the 3D curve. This can be either due to different numbers of sub-curves given in the IGES file or because of splitting of curves during translation.
|
||||
* 3D or 2D curve is a Circular Arc (entity type 100) starting and ending in the same point (note that this case is incorrect according to the IGES standard).
|
||||
|
||||
The parameter *read.surfacecurve.mode* defines which curve (3D or 2D) is used for re-computing the other one:
|
||||
The parameter *read.surfacecurve.mode* defines which curve (3D or 2D) is used for re-computing the other one:
|
||||
* *Default(0)* use the preference flag value in the entity's Parameter Data section. The flag values are:
|
||||
* 0: no preference given,
|
||||
* 1: use 2D for 142 entities and 3D for 141 entities,
|
||||
@@ -400,12 +400,12 @@ reader.PrintTransferInfo (failsonly, mode);
|
||||
~~~~~
|
||||
displays the messages that appeared during the last invocation of *Transfer* or *TransferRoots*.
|
||||
|
||||
If *failsonly* is *IFSelect_FailOnly*, only fail messages will be output, if it is *IFSelect_FailAndWarn*, all messages will be output. Parameter “mode” can have *IFSelect_xxx* values where *xxx* can be:
|
||||
* *GeneralCount* -- gives general statistics on the transfer (number of translated IGES entities, number of fails and warnings, etc)
|
||||
* *CountByItem* -- gives the number of IGES entities with their types per message.
|
||||
* *ListByItem* -- gives the number of IGES entities with their type and DE numbers per message.
|
||||
* *ResultCount* -- gives the number of resulting OCCT shapes per type.
|
||||
* *Mapping* -- gives mapping between roots of the IGES file and the resulting OCCT shape per IGES and OCCT type.
|
||||
If *failsonly* is *IFSelect_FailOnly*, only fail messages will be output, if it is *IFSelect_FailAndWarn*, all messages will be output. Parameter “mode” can have *IFSelect_xxx* values where *xxx* can be:
|
||||
* *GeneralCount* -- gives general statistics on the transfer (number of translated IGES entities, number of fails and warnings, etc)
|
||||
* *CountByItem* -- gives the number of IGES entities with their types per message.
|
||||
* *ListByItem* -- gives the number of IGES entities with their type and DE numbers per message.
|
||||
* *ResultCount* -- gives the number of resulting OCCT shapes per type.
|
||||
* *Mapping* -- gives mapping between roots of the IGES file and the resulting OCCT shape per IGES and OCCT type.
|
||||
|
||||
@subsection occt_iges_2_4 Mapping of IGES entities to Open CASCADE Technology shapes
|
||||
|
||||
|
@@ -1793,12 +1793,11 @@ Create facet attributes.
|
||||
Handle(Graphic3d_AspectFillArea3d) aFaceAspect = new Graphic3d_AspectFillArea3d();
|
||||
Graphic3d_MaterialAspect aBrassMaterial (Graphic3d_NOM_BRASS);
|
||||
Graphic3d_MaterialAspect aGoldMaterial (Graphic3d_NOM_GOLD);
|
||||
aFaceAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
aFaceAspect->SetInteriorStyle (Aspect_IS_SOLID_WIREFRAME);
|
||||
aFaceAspect->SetInteriorColor (aMyColor);
|
||||
aFaceAspect->SetDistinguishOn ();
|
||||
aFaceAspect->SetFrontMaterial (aGoldMaterial);
|
||||
aFaceAspect->SetBackMaterial (aBrassMaterial);
|
||||
aFaceAspect->SetEdgeOn();
|
||||
~~~~~
|
||||
|
||||
Create text attributes.
|
||||
|
10
genproj
10
genproj
@@ -19,10 +19,6 @@ anOpt2=$2
|
||||
anOpt3=$3
|
||||
anOpt4=$4
|
||||
anOpt5=$5
|
||||
if [ "$aTarget" == "" ]; then
|
||||
aTarget="cbp"
|
||||
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
|
||||
fi
|
||||
|
||||
if [ ! -e "${aScriptPath}/custom.sh" ]; then
|
||||
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 [ "$aTarget" == "" ]; then aTarget=$PRJFMT; fi;
|
||||
if [ "$aTarget" == "" ]; then
|
||||
aTarget="cbp"
|
||||
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
|
||||
fi
|
||||
|
||||
cd $aScriptPath
|
||||
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
|
||||
%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%"
|
||||
|
@@ -17,7 +17,8 @@ void ISession2D_Shape::Add(const TopoDS_Shape& aShape)
|
||||
myListOfShape.Append(aShape);
|
||||
myAlgo.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)
|
||||
@@ -42,23 +43,17 @@ void ISession2D_Shape::SetProjector (HLRAlgo_Projector& aProjector)
|
||||
myProjector= aProjector;
|
||||
myAlgo.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)
|
||||
{
|
||||
myNbIsos= aNbIsos;
|
||||
myAlgo.Nullify();
|
||||
|
||||
// declare the mode 100 to 110 as non valid
|
||||
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
|
||||
|
||||
{
|
||||
myNbIsos= aNbIsos;
|
||||
myAlgo.Nullify();
|
||||
SetToUpdate();
|
||||
UpdatePresentations();
|
||||
};
|
||||
|
||||
void ISession2D_Shape::BuildAlgo()
|
||||
|
@@ -14,9 +14,9 @@ Requirements for building sample:
|
||||
* Android NDK r9d or newer
|
||||
* Apache Ant 1.9.4 or higher
|
||||
* OCCT compiled under Android platform and placed in directories:
|
||||
* occt/libs/armeabi-v7a/*.so and occt/inc/*.hxx (libraries and include files of OCCT install)
|
||||
* android/assets/opencascade/shared/Shaders/* (Shaders folder of OCCT install: /share/opencascade/resources/Shaders)
|
||||
* 3rdparty/include/freetype2/*, 3rdparty/include/FreeImage.h and 3rdparty/libs/armeabi-v7a/libFreeImage.so and 3rdparty/libs/armeabi-v7a/libfreetype.so
|
||||
* occt/libs/armeabi-v7a/\*.so and occt/inc/\*.hxx (libraries and include files of OCCT install)
|
||||
* android/assets/opencascade/shared/Shaders/\* (Shaders folder of OCCT install: /share/opencascade/resources/Shaders)
|
||||
* 3rdparty/include/freetype2/\*, 3rdparty/include/FreeImage.h and 3rdparty/libs/armeabi-v7a/libFreeImage.so and 3rdparty/libs/armeabi-v7a/libfreetype.so
|
||||
|
||||
It is also possible to to correct OCCT.pri file an get resources from another tree of directories.
|
||||
|
||||
|
@@ -276,8 +276,7 @@ blend result _model 2 _model_161
|
||||
# Show result
|
||||
pload VISUALIZATION
|
||||
vinit Driver1/Viewer1/View1
|
||||
vsetcolorbg 200 200 255
|
||||
vdisplay result
|
||||
vbackground -color 0.784314 0.784314 1
|
||||
vdisplay -dispMode 1 result
|
||||
vfit
|
||||
vsetdispmode 1
|
||||
vshowfaceboundary result 1
|
||||
vaspects result -setFaceBoundaryDraw 1 -mostContinuity c2
|
||||
|
@@ -262,8 +262,7 @@ unifysamedom result p_1
|
||||
# Show result
|
||||
pload VISUALIZATION
|
||||
vinit Driver1/Viewer1/View1
|
||||
vsetcolorbg 200 200 255
|
||||
vdisplay result
|
||||
vbackground -color 0.784314 0.784314 1
|
||||
vdisplay -dispMode 1 result
|
||||
vfit
|
||||
vsetdispmode 1
|
||||
vshowfaceboundary result 1
|
||||
vaspects result -setFaceBoundaryDraw 1
|
||||
|
@@ -53,7 +53,7 @@ for {set i 1} {$i <= 1} {incr i} {
|
||||
|
||||
# prepare a view
|
||||
vinit Penrose w=1024 h=512
|
||||
vsetcolorbg 255 255 255
|
||||
vbackground -color WHITE
|
||||
vrenderparams -rayTrace -fsaa on -reflections off -shadows off
|
||||
|
||||
# set camera position and adjust lights
|
||||
|
@@ -57,9 +57,7 @@ bcommon res b9 c2
|
||||
# show result
|
||||
donly res
|
||||
trotate res 0 0 0 0 0 1 90
|
||||
vinit
|
||||
vdisplay res
|
||||
vsetdispmode 1
|
||||
vshowfaceboundary res 1 255 255 255
|
||||
vaspects -isoontriangulation 1
|
||||
vinit View1
|
||||
vdisplay -dispMode 1 res
|
||||
vaspects res -setFaceBoundaryDraw 1 -setFaceBoundaryColor WHITE -isoontriangulation 1
|
||||
vfit
|
||||
|
@@ -19,7 +19,7 @@ restore $aBotLoc b
|
||||
vinit View1 w=768 h=768
|
||||
vclear
|
||||
vsetdispmode 0
|
||||
vsetcolorbg 255 255 255
|
||||
vbackground -color WHITE
|
||||
vbottom
|
||||
|
||||
puts "Getting cut projection..."
|
||||
|
@@ -51,7 +51,7 @@ proc drawObjects {theRow theColor} {
|
||||
uplevel #0 box $aBox $aCtr $aCtr $aCtr $aSize $aSize $aSize
|
||||
uplevel #0 ttranslate $aSph $x $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
|
||||
if {$theColor != ""} {
|
||||
uplevel #0 vsetcolor -noredraw $aSph $aBox $theColor
|
||||
@@ -64,21 +64,19 @@ proc drawObjects {theRow theColor} {
|
||||
# setup 3D viewer content
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
catch { vclose View1 }
|
||||
vinit View1 w=768 h=768
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1 w=768 h=768
|
||||
vtop
|
||||
vglinfo
|
||||
vsetgradientbg 180 200 255 180 180 180 2
|
||||
vbackground -gradient 0.705882 0.784314 1 0.705882 0.705882 0.705882 -gradientMode VERTICAL
|
||||
|
||||
vlight -change 0 -dir 0.577 -0.577 -0.577
|
||||
vsetdispmode 1
|
||||
vrenderparams -msaa 8
|
||||
|
||||
# adjust scene bounding box
|
||||
box bnd 0 0 0 180 210 1
|
||||
vdisplay -noredraw bnd
|
||||
vsetdispmode bnd 0
|
||||
vdisplay -noredraw -dispMode 0 bnd
|
||||
vfit
|
||||
vremove -noredraw bnd
|
||||
|
||||
@@ -88,5 +86,3 @@ drawObjects 0 ""
|
||||
drawObjects 1 red
|
||||
drawObjects 2 green
|
||||
drawObjects 3 blue1
|
||||
#vfit
|
||||
vzfit
|
||||
|
@@ -59,7 +59,7 @@ XShow D
|
||||
vfit
|
||||
vsetdispmode 1
|
||||
vrenderparams -msaa 8
|
||||
vsetcolorbg 255 255 255
|
||||
vbackground -color WHITE
|
||||
|
||||
#param write.iges.brep.mode 1
|
||||
#WriteIges D d:/pencil3.igs
|
||||
|
@@ -30,7 +30,7 @@ vsettransparency glass 0.6
|
||||
vlight new spot pos -100 -100 300
|
||||
|
||||
# set white background and fit view
|
||||
vsetcolorbg 255 255 255
|
||||
vbackground -color WHITE
|
||||
vfit
|
||||
|
||||
# set ray tracing
|
||||
|
@@ -129,7 +129,7 @@ vrenderparams -msaa 8
|
||||
vsetcolor snowflake 0 0 0
|
||||
vsetcolor lines 0 0 0
|
||||
vsetcolor text 0 0 0
|
||||
vsetcolorbg 255 255 255
|
||||
vbackground -color WHITE
|
||||
vtop
|
||||
vfit
|
||||
|
||||
|
@@ -14,10 +14,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS.hxx>
|
||||
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
#include <Adaptor3d_HSurface.hxx>
|
||||
#include <AIS.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
|
@@ -17,73 +17,26 @@
|
||||
#ifndef _AIS_HeaderFile
|
||||
#define _AIS_HeaderFile
|
||||
|
||||
#include <AIS_KindOfSurface.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Aspect_TypeOfMarker.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <AIS_KindOfSurface.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Aspect_TypeOfMarker.hxx>
|
||||
class gp_Pnt;
|
||||
class TopoDS_Shape;
|
||||
class gp_Lin;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Plane;
|
||||
class TopoDS_Vertex;
|
||||
class TopoDS_Face;
|
||||
class gp_Pln;
|
||||
class Geom_Surface;
|
||||
class gp_Dir;
|
||||
class Bnd_Box;
|
||||
class gp_Elips;
|
||||
class Prs3d_Presentation;
|
||||
class AIS_Triangulation;
|
||||
class AIS_InteractiveContext;
|
||||
class AIS_GraphicTool;
|
||||
class AIS_GlobalStatus;
|
||||
class AIS_InteractiveObject;
|
||||
class AIS_Point;
|
||||
class AIS_Axis;
|
||||
class AIS_Trihedron;
|
||||
class AIS_PlaneTrihedron;
|
||||
class AIS_Line;
|
||||
class AIS_Circle;
|
||||
class AIS_Plane;
|
||||
class AIS_Shape;
|
||||
class AIS_ConnectedInteractive;
|
||||
class AIS_MultipleConnectedInteractive;
|
||||
class AIS_DimensionOwner;
|
||||
class AIS_Relation;
|
||||
class AIS_EllipseRadiusDimension;
|
||||
class AIS_MaxRadiusDimension;
|
||||
class AIS_MinRadiusDimension;
|
||||
class AIS_Chamf2dDimension;
|
||||
class AIS_Chamf3dDimension;
|
||||
class AIS_OffsetDimension;
|
||||
class AIS_FixRelation;
|
||||
class AIS_PerpendicularRelation;
|
||||
class AIS_ParallelRelation;
|
||||
class AIS_TangentRelation;
|
||||
class AIS_ConcentricRelation;
|
||||
class AIS_IdenticRelation;
|
||||
class AIS_SymmetricRelation;
|
||||
class AIS_MidPointRelation;
|
||||
class AIS_EqualRadiusRelation;
|
||||
class AIS_EqualDistanceRelation;
|
||||
class AIS_TypeFilter;
|
||||
class AIS_SignatureFilter;
|
||||
class AIS_ExclusionFilter;
|
||||
class AIS_AttributeFilter;
|
||||
class AIS_C0RegularityFilter;
|
||||
class AIS_BadEdgeFilter;
|
||||
class AIS_Selection;
|
||||
|
||||
class Geom_Curve;
|
||||
class Geom_Plane;
|
||||
class Geom_Surface;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
//! Application Interactive Services provide the means to create links between an application GUI viewer and
|
||||
//! the packages which are used to manage selection and presentation.
|
||||
|
@@ -168,7 +168,7 @@ void AIS_Animation::StartTimer (const Standard_Real theStartPts,
|
||||
{
|
||||
if (myTimer.IsNull())
|
||||
{
|
||||
myTimer = new AIS_AnimationTimer();
|
||||
myTimer = new Media_Timer();
|
||||
}
|
||||
myTimer->Stop();
|
||||
myTimer->Seek (theStartPts);
|
||||
|
@@ -191,7 +191,7 @@ protected:
|
||||
|
||||
protected:
|
||||
|
||||
Handle(AIS_AnimationTimer) myTimer;
|
||||
Handle(Media_Timer) myTimer;
|
||||
|
||||
TCollection_AsciiString myName; //!< animation name
|
||||
NCollection_Sequence<Handle(AIS_Animation)>
|
||||
|
@@ -15,60 +15,7 @@
|
||||
#ifndef _AIS_AnimationTimer_HeaderFile
|
||||
#define _AIS_AnimationTimer_HeaderFile
|
||||
|
||||
#include <OSD_Timer.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#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)
|
||||
#include <Media_Timer.hxx>
|
||||
typedef Media_Timer AIS_AnimationTimer;
|
||||
|
||||
#endif // _AIS_AnimationTimer_HeaderFile
|
||||
|
@@ -81,7 +81,7 @@ myIsXYZAxis(Standard_True)
|
||||
Standard_Real aLength;
|
||||
try {
|
||||
aLength = UnitsAPI::AnyToLS(100. ,"mm");
|
||||
} catch (Standard_Failure) {
|
||||
} catch (Standard_Failure const&) {
|
||||
aLength = 0.1;
|
||||
}
|
||||
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_YAxis)->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)
|
||||
{
|
||||
|
||||
if(aValue<0.0) return;
|
||||
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_YAxis)->SetWidth(aValue);
|
||||
DA->LineAspect(Prs3d_DP_ZAxis)->SetWidth(aValue);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
|
||||
|
||||
@@ -324,14 +324,13 @@ AcceptDisplayMode(const Standard_Integer aMode) const
|
||||
//=======================================================================
|
||||
void AIS_Axis::UnsetColor()
|
||||
{
|
||||
|
||||
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_YAxis)->SetColor(Quantity_NOC_TURQUOISE);
|
||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetColor(Quantity_NOC_TURQUOISE);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : UnsetWidth
|
||||
@@ -340,10 +339,10 @@ void AIS_Axis::UnsetColor()
|
||||
|
||||
void AIS_Axis::UnsetWidth()
|
||||
{
|
||||
myOwnWidth = 0.0;
|
||||
myOwnWidth = 0.0f;
|
||||
myDrawer->LineAspect()->SetWidth(1.);
|
||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetWidth(1.);
|
||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->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);
|
||||
myDrawer->ShadingAspect()->SetColor (theColor);
|
||||
myDrawer->LineAspect()->SetColor (theColor);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -107,6 +108,7 @@ void AIS_CameraFrustum::UnsetColor()
|
||||
|
||||
myDrawer->ShadingAspect()->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->SetTransparency (0.0f);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -236,17 +239,18 @@ void AIS_CameraFrustum::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
switch (theMode)
|
||||
{
|
||||
case AIS_Shaded:
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (myTriangles);
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case AIS_WireFrame:
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (myBorders);
|
||||
break;
|
||||
|
@@ -17,29 +17,13 @@
|
||||
#ifndef _AIS_Chamf2dDimension_HeaderFile
|
||||
#define _AIS_Chamf2dDimension_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
|
||||
class Geom_Plane;
|
||||
class TCollection_ExtendedString;
|
||||
class gp_Pnt;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_Chamf2dDimension;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Chamf2dDimension, AIS_Relation)
|
||||
|
||||
//! A framework to define display of 2D chamfers.
|
||||
@@ -48,10 +32,9 @@ DEFINE_STANDARD_HANDLE(AIS_Chamf2dDimension, AIS_Relation)
|
||||
//! chamfer, or the angle if it is not.
|
||||
class AIS_Chamf2dDimension : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Chamf2dDimension, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! Constructs the display object for 2D chamfers.
|
||||
//! This object is defined by the face aFShape, the
|
||||
//! dimension aVal, the plane aPlane and the text aText.
|
||||
@@ -79,18 +62,7 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Chamf2dDimension,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
@@ -101,14 +73,8 @@ private:
|
||||
gp_Pnt myPntAttach;
|
||||
gp_Dir myDir;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Chamf2dDimension.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_Chamf2dDimension_HeaderFile
|
||||
|
@@ -17,28 +17,11 @@
|
||||
#ifndef _AIS_Chamf3dDimension_HeaderFile
|
||||
#define _AIS_Chamf3dDimension_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
class TCollection_ExtendedString;
|
||||
class gp_Pnt;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
|
||||
|
||||
class AIS_Chamf3dDimension;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation)
|
||||
|
||||
//! A framework to define display of 3D chamfers.
|
||||
@@ -47,10 +30,9 @@ DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation)
|
||||
//! chamfer, or the angle if it is not.
|
||||
class AIS_Chamf3dDimension : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Chamf3dDimension, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! Constructs a display object for 3D chamfers.
|
||||
//! This object is defined by the shape aFShape, the
|
||||
//! dimension aVal and the text aText.
|
||||
@@ -78,19 +60,8 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Chamf3dDimension,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -100,14 +71,8 @@ private:
|
||||
gp_Pnt myPntAttach;
|
||||
gp_Dir myDir;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Chamf3dDimension.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_Chamf3dDimension_HeaderFile
|
||||
|
@@ -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
|
||||
//purpose :
|
||||
@@ -122,34 +145,41 @@ void AIS_Circle::SetColor(const Quantity_Color &aCol)
|
||||
hasOwnColor=Standard_True;
|
||||
myDrawer->SetColor (aCol);
|
||||
|
||||
Standard_Real WW = HasWidth() ? myOwnWidth :
|
||||
myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
|
||||
1.;
|
||||
|
||||
if (!myDrawer->HasOwnLineAspect ())
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
||||
if (!myDrawer->HasOwnLineAspect())
|
||||
{
|
||||
Standard_Real WW = HasWidth() ? myOwnWidth :
|
||||
myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
|
||||
1.;
|
||||
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->LineAspect()->SetColor(aCol);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
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;
|
||||
if( HasColor() ) CC = myDrawer->Color();
|
||||
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
||||
} else
|
||||
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->LineAspect()->SetWidth(aValue);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,15 +191,18 @@ void AIS_Circle::UnsetColor()
|
||||
{
|
||||
hasOwnColor = Standard_False;
|
||||
|
||||
Handle(Prs3d_LineAspect) NullAsp;
|
||||
|
||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
if (!HasWidth())
|
||||
{
|
||||
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
|
||||
}
|
||||
else
|
||||
{
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;;
|
||||
if( HasColor() ) CC = myDrawer->Color();
|
||||
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
myDrawer->LineAspect()->SetColor(CC);
|
||||
myDrawer->SetColor (CC);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,11 +212,13 @@ void AIS_Circle::UnsetColor()
|
||||
//=======================================================================
|
||||
void AIS_Circle::UnsetWidth()
|
||||
{
|
||||
Handle(Prs3d_LineAspect) NullAsp;
|
||||
|
||||
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Standard_Real WW = myDrawer->HasLink() ? AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
|
||||
if (!HasColor())
|
||||
{
|
||||
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.0f;
|
||||
myDrawer->LineAspect()->SetWidth(WW);
|
||||
myOwnWidth = WW;
|
||||
}
|
||||
|
@@ -115,6 +115,9 @@ private:
|
||||
|
||||
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:
|
||||
|
||||
Handle(Geom_Circle) myComponent;
|
||||
|
@@ -107,6 +107,10 @@ AIS_ColorScale::AIS_ColorScale()
|
||||
myTextHeight (20)
|
||||
{
|
||||
SetDisplayMode (0);
|
||||
myDrawer->SetupOwnShadingAspect();
|
||||
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Opaque);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorColor (Quantity_NOC_WHITE);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -458,15 +462,6 @@ void AIS_ColorScale::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
const Standard_Integer aBarTop = myYPos + myHeight - aTitleOffset - aBarYOffset;
|
||||
const Standard_Integer aBarHeight = aBarTop - aBarBottom;
|
||||
|
||||
// draw title
|
||||
if (!myTitle.IsEmpty())
|
||||
{
|
||||
drawText (Prs3d_Root::CurrentGroup (thePrs), myTitle,
|
||||
myXPos + mySpacing,
|
||||
aBarTop + aBarYOffset,
|
||||
Graphic3d_VTA_BOTTOM);
|
||||
}
|
||||
|
||||
TColStd_SequenceOfExtendedString aLabels;
|
||||
if (myLabelType == Aspect_TOCSD_USER)
|
||||
{
|
||||
@@ -496,11 +491,27 @@ void AIS_ColorScale::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
|
||||
aColorBreadth += aTextWidth;
|
||||
}
|
||||
|
||||
// draw title
|
||||
Handle(Graphic3d_Group) aLabelsGroup;
|
||||
if (!myTitle.IsEmpty()
|
||||
|| !aLabels.IsEmpty())
|
||||
{
|
||||
aLabelsGroup = thePrs->NewGroup();
|
||||
aLabelsGroup->SetGroupPrimitivesAspect (myDrawer->TextAspect()->Aspect());
|
||||
}
|
||||
if (!myTitle.IsEmpty())
|
||||
{
|
||||
drawText (aLabelsGroup, myTitle,
|
||||
myXPos + mySpacing,
|
||||
aBarTop + aBarYOffset,
|
||||
Graphic3d_VTA_BOTTOM);
|
||||
}
|
||||
|
||||
// draw colors
|
||||
drawColorBar (thePrs, aBarBottom, aBarHeight, aTextWidth, aColorBreadth);
|
||||
|
||||
// draw Labels
|
||||
drawLabels (thePrs, aLabels, aBarBottom, aBarHeight, aTextWidth, aColorBreadth);
|
||||
drawLabels (aLabelsGroup, aLabels, aBarBottom, aBarHeight, aTextWidth, aColorBreadth);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -627,7 +638,8 @@ void AIS_ColorScale::drawColorBar (const Handle(Prs3d_Presentation)& thePrs,
|
||||
}
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs);
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (aTriangles);
|
||||
|
||||
const Quantity_Color aFgColor (hasOwnColor ? myDrawer->Color() : Quantity_NOC_WHITE);
|
||||
@@ -642,7 +654,7 @@ void AIS_ColorScale::drawColorBar (const Handle(Prs3d_Presentation)& thePrs,
|
||||
//function : drawLabels
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_ColorScale::drawLabels (const Handle(Prs3d_Presentation)& thePrs,
|
||||
void AIS_ColorScale::drawLabels (const Handle(Graphic3d_Group)& theGroup,
|
||||
const TColStd_SequenceOfExtendedString& theLabels,
|
||||
const Standard_Integer theBarBottom,
|
||||
const Standard_Integer theBarHeight,
|
||||
@@ -716,14 +728,14 @@ void AIS_ColorScale::drawLabels (const Handle(Prs3d_Presentation)& thePrs,
|
||||
Standard_Integer aPos2 = aNbLabels - 1 - i2;
|
||||
if (aFilter && !(aPos1 % aFilter))
|
||||
{
|
||||
drawText (Prs3d_Root::CurrentGroup (thePrs), theLabels.Value (i1 + 1),
|
||||
drawText (theGroup, theLabels.Value (i1 + 1),
|
||||
anXLeft, anYBottom + Standard_Integer(i1 * aStepY + anAscent),
|
||||
Graphic3d_VTA_CENTER);
|
||||
aLast1 = i1;
|
||||
}
|
||||
if (aFilter && !(aPos2 % aFilter))
|
||||
{
|
||||
drawText (Prs3d_Root::CurrentGroup (thePrs), theLabels.Value (i2 + 1),
|
||||
drawText (theGroup, theLabels.Value (i2 + 1),
|
||||
anXLeft, anYBottom + Standard_Integer(i2 * aStepY + anAscent),
|
||||
Graphic3d_VTA_CENTER);
|
||||
aLast2 = i2;
|
||||
@@ -746,7 +758,7 @@ void AIS_ColorScale::drawLabels (const Handle(Prs3d_Presentation)& thePrs,
|
||||
|
||||
if (i0 != -1)
|
||||
{
|
||||
drawText (Prs3d_Root::CurrentGroup (thePrs), theLabels.Value (i0 + 1),
|
||||
drawText (theGroup, theLabels.Value (i0 + 1),
|
||||
anXLeft, anYBottom + Standard_Integer(i0 * aStepY + anAscent),
|
||||
Graphic3d_VTA_CENTER);
|
||||
}
|
||||
@@ -769,8 +781,8 @@ void AIS_ColorScale::drawFrame (const Handle(Prs3d_Presentation)& thePrs,
|
||||
aPrim->AddVertex (theX, theY, 0.0);
|
||||
|
||||
Handle(Graphic3d_AspectLine3d) anAspect = new Graphic3d_AspectLine3d (theColor, Aspect_TOL_SOLID, 1.0);
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs);
|
||||
aGroup->SetPrimitivesAspect (anAspect);
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (anAspect);
|
||||
aGroup->AddPrimitiveArray (aPrim);
|
||||
}
|
||||
|
||||
@@ -784,7 +796,6 @@ void AIS_ColorScale::drawText (const Handle(Graphic3d_Group)& theGroup,
|
||||
const Graphic3d_VerticalTextAlignment theVertAlignment)
|
||||
{
|
||||
const Handle(Prs3d_TextAspect)& anAspect = myDrawer->TextAspect();
|
||||
theGroup->SetPrimitivesAspect (anAspect->Aspect());
|
||||
theGroup->Text (theText,
|
||||
gp_Ax2 (gp_Pnt (theX, theY, 0.0), gp::DZ()),
|
||||
anAspect->Height(),
|
||||
|
@@ -406,7 +406,7 @@ private:
|
||||
Standard_Integer computeMaxLabelWidth (const TColStd_SequenceOfExtendedString& theLabels) const;
|
||||
|
||||
//! Draw labels.
|
||||
void drawLabels (const Handle(Prs3d_Presentation)& thePrs,
|
||||
void drawLabels (const Handle(Graphic3d_Group)& theGroup,
|
||||
const TColStd_SequenceOfExtendedString& theLabels,
|
||||
const Standard_Integer theBarBottom,
|
||||
const Standard_Integer theBarHeight,
|
||||
|
@@ -124,8 +124,7 @@ Handle(AIS_ColoredDrawer) AIS_ColoredShape::CustomAspects (const TopoDS_Shape& t
|
||||
{
|
||||
aDrawer = new AIS_ColoredDrawer (myDrawer);
|
||||
myShapeColors.Bind (theShape, aDrawer);
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
SetToUpdate();
|
||||
}
|
||||
return aDrawer;
|
||||
}
|
||||
@@ -141,8 +140,7 @@ void AIS_ColoredShape::ClearCustomAspects()
|
||||
return;
|
||||
}
|
||||
myShapeColors.Clear();
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -157,8 +155,7 @@ void AIS_ColoredShape::UnsetCustomAspects (const TopoDS_Shape& theShape,
|
||||
return;
|
||||
}
|
||||
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
SetToUpdate();
|
||||
if (theToUnregister)
|
||||
{
|
||||
myShapeColors.UnBind (theShape);
|
||||
@@ -183,8 +180,6 @@ void AIS_ColoredShape::SetCustomColor (const TopoDS_Shape& theShape,
|
||||
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
|
||||
setColor (aDrawer, 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);
|
||||
setTransparency (aDrawer, 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);
|
||||
setWidth (aDrawer, theLineWidth);
|
||||
aDrawer->SetOwnWidth (theLineWidth);
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -232,11 +223,6 @@ void AIS_ColoredShape::SetCustomWidth (const TopoDS_Shape& theShape,
|
||||
|
||||
void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
|
||||
{
|
||||
setColor (myDrawer, theColor);
|
||||
myDrawer->SetColor (theColor);
|
||||
hasOwnColor = Standard_True;
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
|
||||
@@ -262,6 +248,7 @@ void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
|
||||
aDrawer->FaceBoundaryAspect()->SetColor (theColor);
|
||||
}
|
||||
}
|
||||
AIS_Shape::SetColor (theColor);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -271,10 +258,6 @@ void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
|
||||
|
||||
void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
|
||||
{
|
||||
setWidth (myDrawer, theLineWidth);
|
||||
myOwnWidth = theLineWidth;
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
|
||||
@@ -296,6 +279,16 @@ void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
|
||||
aDrawer->FaceBoundaryAspect()->SetWidth (theLineWidth);
|
||||
}
|
||||
}
|
||||
AIS_Shape::SetWidth (theLineWidth);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetWidth
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_ColoredShape::UnsetWidth()
|
||||
{
|
||||
SetWidth (1.0f);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -305,10 +298,6 @@ void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
|
||||
|
||||
void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
|
||||
{
|
||||
setTransparency (myDrawer, theValue);
|
||||
myDrawer->SetTransparency ((Standard_ShortReal )theValue);
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
|
||||
@@ -322,6 +311,7 @@ void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
|
||||
aDrawer->ShadingAspect()->SetTransparency (theValue, myCurrentFacingModel);
|
||||
}
|
||||
}
|
||||
AIS_Shape::SetTransparency (theValue);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -330,27 +320,7 @@ void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
|
||||
//=======================================================================
|
||||
void AIS_ColoredShape::UnsetTransparency()
|
||||
{
|
||||
myDrawer->SetTransparency (0.0f);
|
||||
if (myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
|
||||
if (!HasColor()
|
||||
&& !HasMaterial()
|
||||
&& !myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
|
||||
{
|
||||
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
|
||||
}
|
||||
}
|
||||
|
||||
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(Prs3d_Drawer)& aDrawer = anIter.Value();
|
||||
if (aDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
aDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
|
||||
}
|
||||
}
|
||||
SynchronizeAspects();
|
||||
SetTransparency (0.0f);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -360,10 +330,6 @@ void AIS_ColoredShape::UnsetTransparency()
|
||||
|
||||
void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
|
||||
{
|
||||
setMaterial (myDrawer, theMaterial, HasColor(), IsTransparent());
|
||||
//myOwnMaterial = theMaterial;
|
||||
hasOwnMaterial = Standard_True;
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
|
||||
@@ -373,6 +339,7 @@ void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
|
||||
setMaterial (aDrawer, theMaterial, aDrawer->HasOwnColor(), aDrawer->HasOwnTransparency());
|
||||
}
|
||||
}
|
||||
AIS_Shape::SetMaterial (theMaterial);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -610,7 +577,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
||||
const DataMapOfDrawerCompd& theDrawerClosedFaces,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
Handle(Graphic3d_Group) anOpenGroup, aClosedGroup;
|
||||
Handle(Graphic3d_Group) anOpenGroup, aClosedGroup, anEdgesGroup;
|
||||
for (size_t aShType = 0; aShType <= (size_t )TopAbs_SHAPE; ++aShType)
|
||||
{
|
||||
const Standard_Boolean isClosed = aShType == TopAbs_SHAPE;
|
||||
@@ -664,7 +631,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
||||
{
|
||||
if (aShadedGroup.IsNull())
|
||||
{
|
||||
aShadedGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
aShadedGroup = thePrs->NewGroup();
|
||||
aShadedGroup->SetClosed (isClosed);
|
||||
}
|
||||
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
|
||||
@@ -673,18 +640,15 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
||||
|
||||
if (aDrawer->FaceBoundaryDraw())
|
||||
{
|
||||
Handle(Graphic3d_ArrayOfSegments) aBndSegments = StdPrs_ShadedShape::FillFaceBoundaries (aShapeDraw);
|
||||
if (!aBndSegments.IsNull())
|
||||
if (Handle(Graphic3d_ArrayOfSegments) aBndSegments = StdPrs_ShadedShape::FillFaceBoundaries (aShapeDraw, aDrawer->FaceBoundaryUpperContinuity()))
|
||||
{
|
||||
if (aShadedGroup.IsNull())
|
||||
if (anEdgesGroup.IsNull())
|
||||
{
|
||||
aShadedGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
aShadedGroup->SetClosed (isClosed);
|
||||
anEdgesGroup = thePrs->NewGroup();
|
||||
}
|
||||
|
||||
Handle(Graphic3d_AspectLine3d) aBoundaryAspect = aDrawer->FaceBoundaryAspect()->Aspect();
|
||||
aShadedGroup->SetPrimitivesAspect (aBoundaryAspect);
|
||||
aShadedGroup->AddPrimitiveArray (aBndSegments);
|
||||
anEdgesGroup->SetPrimitivesAspect (aDrawer->FaceBoundaryAspect()->Aspect());
|
||||
anEdgesGroup->AddPrimitiveArray (aBndSegments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -81,11 +81,16 @@ public: //! @name global aspects
|
||||
//! Sets transparency value.
|
||||
Standard_EXPORT virtual void SetTransparency (const Standard_Real theValue) Standard_OVERRIDE;
|
||||
|
||||
//! Sets the material aspect.
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& theAspect) Standard_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
//! Removes the setting for transparency in the reconstructed compound shape.
|
||||
Standard_EXPORT virtual void UnsetTransparency() Standard_OVERRIDE;
|
||||
|
||||
//! Sets the material aspect.
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& theAspect) Standard_OVERRIDE;
|
||||
//! Setup line width of entire shape.
|
||||
Standard_EXPORT virtual void UnsetWidth() Standard_OVERRIDE;
|
||||
|
||||
protected: //! @name override presentation computation
|
||||
|
||||
|
@@ -17,24 +17,11 @@
|
||||
#ifndef _AIS_ConcentricRelation_HeaderFile
|
||||
#define _AIS_ConcentricRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
#include <gp_Dir.hxx>
|
||||
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_ConcentricRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_ConcentricRelation, AIS_Relation)
|
||||
|
||||
//! A framework to define a constraint by a relation of
|
||||
@@ -44,10 +31,9 @@ DEFINE_STANDARD_HANDLE(AIS_ConcentricRelation, AIS_Relation)
|
||||
//! relation of concentricity can be extended.
|
||||
class AIS_ConcentricRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ConcentricRelation, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! Constructs the display object for concentric relations
|
||||
//! between shapes.
|
||||
//! This object is defined by the two shapes, aFShape
|
||||
@@ -65,19 +51,8 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ConcentricRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -95,13 +70,6 @@ private:
|
||||
gp_Dir myDir;
|
||||
gp_Pnt myPnt;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_ConcentricRelation_HeaderFile
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <Select3D_SensitiveEntity.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
@@ -92,12 +91,12 @@ void AIS_ConnectedInteractive::connect (const Handle(AIS_InteractiveObject)& the
|
||||
|
||||
void AIS_ConnectedInteractive::Disconnect()
|
||||
{
|
||||
for(Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
|
||||
for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
const Handle(PrsMgr_Presentation)& aPrs = myPresentations (aPrsIter).Presentation();
|
||||
const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
|
||||
if (!aPrs.IsNull())
|
||||
{
|
||||
aPrs->Presentation()->DisconnectAll (Graphic3d_TOC_DESCENDANT);
|
||||
aPrs->DisconnectAll (Graphic3d_TOC_DESCENDANT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,7 +111,7 @@ void AIS_ConnectedInteractive::Compute (const Handle(PrsMgr_PresentationManager3
|
||||
if (HasConnection())
|
||||
{
|
||||
thePrs->Clear (Standard_False);
|
||||
thePrs->RemoveAll();
|
||||
thePrs->DisconnectAll (Graphic3d_TOC_DESCENDANT);
|
||||
|
||||
if (!myReference->HasInteractiveContext())
|
||||
{
|
||||
|
@@ -335,31 +335,31 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt
|
||||
if (myDrawer->DimensionAspect()->IsText3d())
|
||||
{
|
||||
// text width produced by BRepFont
|
||||
Font_BRepFont aFont (aTextAspect->Aspect()->Font().ToCString(),
|
||||
aTextAspect->Aspect()->GetTextFontAspect(),
|
||||
aTextAspect->Height());
|
||||
|
||||
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
|
||||
Font_BRepFont aFont;
|
||||
if (aFont.FindAndInit (aTextAspect->Aspect()->Font(), aTextAspect->Aspect()->GetTextFontAspect(), aTextAspect->Height(), Font_StrictLevel_Any))
|
||||
{
|
||||
Standard_Utf32Char aCurrChar = *anIter;
|
||||
Standard_Utf32Char aNextChar = *(++anIter);
|
||||
theWidth += aFont.AdvanceX (aCurrChar, aNextChar);
|
||||
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
|
||||
{
|
||||
Standard_Utf32Char aCurrChar = *anIter;
|
||||
Standard_Utf32Char aNextChar = *(++anIter);
|
||||
theWidth += aFont.AdvanceX (aCurrChar, aNextChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Text width for 1:1 scale 2D case
|
||||
Handle(Font_FTFont) aFont = new Font_FTFont();
|
||||
aFont->Init (aTextAspect->Aspect()->Font().ToCString(),
|
||||
aTextAspect->Aspect()->GetTextFontAspect(),
|
||||
(const unsigned int)aTextAspect->Height(),
|
||||
THE_2D_TEXT_RESOLUTION);
|
||||
|
||||
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
|
||||
Font_FTFontParams aFontParams;
|
||||
aFontParams.PointSize = (unsigned int )aTextAspect->Height();
|
||||
aFontParams.Resolution = THE_2D_TEXT_RESOLUTION;
|
||||
if (Handle(Font_FTFont) aFont = Font_FTFont::FindAndCreate (aTextAspect->Aspect()->Font(), aTextAspect->Aspect()->GetTextFontAspect(), aFontParams, Font_StrictLevel_Any))
|
||||
{
|
||||
Standard_Utf32Char aCurrChar = *anIter;
|
||||
Standard_Utf32Char aNextChar = *(++anIter);
|
||||
theWidth += (Standard_Real) aFont->AdvanceX (aCurrChar, aNextChar);
|
||||
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
|
||||
{
|
||||
Standard_Utf32Char aCurrChar = *anIter;
|
||||
Standard_Utf32Char aNextChar = *(++anIter);
|
||||
theWidth += (Standard_Real) aFont->AdvanceX (aCurrChar, aNextChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,6 +431,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
const TCollection_ExtendedString& theText,
|
||||
const Standard_Integer theLabelPosition)
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
if (myDrawer->DimensionAspect()->IsText3d())
|
||||
{
|
||||
// getting font parameters
|
||||
@@ -517,7 +518,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
aCenterOfLabel.Transform (aTextPlaneTrsf);
|
||||
|
||||
gp_Ax2 aFlippingAxes (aCenterOfLabel, GetPlane().Axis().Direction(), aTextDir);
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetFlippingOptions (Standard_True, aFlippingAxes);
|
||||
aGroup->SetFlippingOptions (Standard_True, aFlippingAxes);
|
||||
|
||||
// draw text
|
||||
if (myDrawer->DimensionAspect()->IsTextShaded())
|
||||
@@ -546,11 +547,14 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
{
|
||||
myDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (aColor, Aspect_TOL_SOLID, 1.0));
|
||||
}
|
||||
|
||||
myDrawer->FreeBoundaryAspect()->Aspect()->SetColor (aColor);
|
||||
|
||||
// drawing text
|
||||
StdPrs_WFShape::Add (thePresentation, aTextShape, myDrawer);
|
||||
if (Handle(Graphic3d_ArrayOfPrimitives) anEdges = StdPrs_WFShape::AddAllEdges (aTextShape, myDrawer))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->FreeBoundaryAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (anEdges);
|
||||
}
|
||||
}
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetFlippingOptions (Standard_False, gp_Ax2());
|
||||
|
||||
@@ -565,7 +569,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
// generate primitives for 2D text
|
||||
myDrawer->DimensionAspect()->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_DIMENSION);
|
||||
|
||||
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePresentation),
|
||||
Prs3d_Text::Draw (aGroup,
|
||||
myDrawer->DimensionAspect()->TextAspect(),
|
||||
theText,
|
||||
theTextPos);
|
||||
@@ -599,6 +603,7 @@ void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresenta
|
||||
gp_Pnt aTextPos = ElCLib::Value (theExtensionSize, anExtensionLine);
|
||||
gp_Dir aTextDir = theExtensionDir;
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
drawText (thePresentation,
|
||||
aTextPos,
|
||||
aTextDir,
|
||||
@@ -630,16 +635,17 @@ void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresenta
|
||||
aSensitiveCurve.Append (anExtStart);
|
||||
aSensitiveCurve.Append (anExtEnd);
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
if (!myDrawer->DimensionAspect()->IsText3d() && theMode == ComputeMode_All)
|
||||
{
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetStencilTestOptions (Standard_True);
|
||||
aGroup->SetStencilTestOptions (Standard_True);
|
||||
}
|
||||
Handle(Graphic3d_AspectLine3d) aDimensionLineStyle = myDrawer->DimensionAspect()->LineAspect()->Aspect();
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionLineStyle);
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (anExtPrimitive);
|
||||
aGroup->SetPrimitivesAspect (aDimensionLineStyle);
|
||||
aGroup->AddPrimitiveArray (anExtPrimitive);
|
||||
if (!myDrawer->DimensionAspect()->IsText3d() && theMode == ComputeMode_All)
|
||||
{
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetStencilTestOptions (Standard_False);
|
||||
aGroup->SetStencilTestOptions (Standard_False);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,8 +739,6 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
case LabelPosition_HCenter:
|
||||
{
|
||||
// add label on dimension or extension line to presentation
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
gp_Pnt aTextPos = IsTextPositionCustom() ? myFixedTextPosition
|
||||
: (aCenterLineBegin.XYZ() + aCenterLineEnd.XYZ()) * 0.5;
|
||||
gp_Dir aTextDir = aDimensionLine.Direction();
|
||||
@@ -742,6 +746,7 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
// add text primitives
|
||||
if (theMode == ComputeMode_All || theMode == ComputeMode_Text)
|
||||
{
|
||||
thePresentation->NewGroup();
|
||||
drawText (thePresentation,
|
||||
aTextPos,
|
||||
aTextDir,
|
||||
@@ -799,24 +804,28 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
aDimensionAspect->TextAspect()->SetVerticalJustification (aTextJustificaton);
|
||||
|
||||
// main dimension line, short extension
|
||||
if (!aDimensionAspect->IsText3d() && theMode == ComputeMode_All)
|
||||
{
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetStencilTestOptions (Standard_True);
|
||||
}
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
|
||||
if (!aDimensionAspect->IsText3d() && theMode == ComputeMode_All)
|
||||
{
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetStencilTestOptions (Standard_False);
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
if (!aDimensionAspect->IsText3d() && theMode == ComputeMode_All)
|
||||
{
|
||||
aGroup->SetStencilTestOptions (Standard_True);
|
||||
}
|
||||
aGroup->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (aPrimSegments);
|
||||
if (!aDimensionAspect->IsText3d() && theMode == ComputeMode_All)
|
||||
{
|
||||
aGroup->SetStencilTestOptions (Standard_False);
|
||||
}
|
||||
}
|
||||
|
||||
// add arrows to presentation
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
|
||||
if (!theIsOneSide)
|
||||
{
|
||||
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
|
||||
if (!theIsOneSide)
|
||||
{
|
||||
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isArrowsExternal)
|
||||
@@ -825,19 +834,18 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
}
|
||||
|
||||
// add arrow extension lines to presentation
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
|
||||
aFirstArrowEnd, aFirstExtensionDir,
|
||||
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
|
||||
if (!theIsOneSide)
|
||||
{
|
||||
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
|
||||
aSecondArrowEnd, aSecondExtensionDir,
|
||||
aFirstArrowEnd, aFirstExtensionDir,
|
||||
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
|
||||
if (!theIsOneSide)
|
||||
{
|
||||
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
|
||||
aSecondArrowEnd, aSecondExtensionDir,
|
||||
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// ------------------------------------------------------------------------ //
|
||||
@@ -847,45 +855,48 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
case LabelPosition_Left:
|
||||
{
|
||||
// add label on dimension or extension line to presentation
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
// Left extension with the text
|
||||
DrawExtension (thePresentation, anExtensionSize,
|
||||
isArrowsExternal
|
||||
? aFirstArrowEnd
|
||||
: aFirstArrowBegin,
|
||||
aFirstExtensionDir,
|
||||
aLabelString,
|
||||
aLabelWidth,
|
||||
theMode,
|
||||
aLabelPosition);
|
||||
{
|
||||
// Left extension with the text
|
||||
DrawExtension (thePresentation, anExtensionSize,
|
||||
isArrowsExternal
|
||||
? aFirstArrowEnd
|
||||
: aFirstArrowBegin,
|
||||
aFirstExtensionDir,
|
||||
aLabelString,
|
||||
aLabelWidth,
|
||||
theMode,
|
||||
aLabelPosition);
|
||||
}
|
||||
|
||||
// add dimension line primitives
|
||||
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
|
||||
{
|
||||
// add central dimension line
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
|
||||
// add graphical primitives
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrimSegments->AddVertex (aCenterLineBegin);
|
||||
aPrimSegments->AddVertex (aCenterLineEnd);
|
||||
// add graphical primitives
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrimSegments->AddVertex (aCenterLineBegin);
|
||||
aPrimSegments->AddVertex (aCenterLineEnd);
|
||||
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
|
||||
aGroup->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (aPrimSegments);
|
||||
|
||||
// add selection primitives
|
||||
SelectionGeometry::Curve& aSensitiveCurve = mySelectionGeom.NewCurve();
|
||||
aSensitiveCurve.Append (aCenterLineBegin);
|
||||
aSensitiveCurve.Append (aCenterLineEnd);
|
||||
// add selection primitives
|
||||
SelectionGeometry::Curve& aSensitiveCurve = mySelectionGeom.NewCurve();
|
||||
aSensitiveCurve.Append (aCenterLineBegin);
|
||||
aSensitiveCurve.Append (aCenterLineEnd);
|
||||
}
|
||||
|
||||
// add arrows to presentation
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
|
||||
if (!theIsOneSide)
|
||||
{
|
||||
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
|
||||
if (!theIsOneSide)
|
||||
{
|
||||
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isArrowsExternal || theIsOneSide)
|
||||
@@ -894,11 +905,11 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
}
|
||||
|
||||
// add extension lines for external arrows
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
|
||||
aSecondArrowEnd, aSecondExtensionDir,
|
||||
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
|
||||
{
|
||||
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
|
||||
aSecondArrowEnd, aSecondExtensionDir,
|
||||
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -910,7 +921,6 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
case LabelPosition_Right:
|
||||
{
|
||||
// add label on dimension or extension line to presentation
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
// Right extension with text
|
||||
DrawExtension (thePresentation, anExtensionSize,
|
||||
@@ -925,27 +935,30 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
|
||||
{
|
||||
// add central dimension line
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
|
||||
// add graphical primitives
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrimSegments->AddVertex (aCenterLineBegin);
|
||||
aPrimSegments->AddVertex (aCenterLineEnd);
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
|
||||
// add graphical primitives
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrimSegments->AddVertex (aCenterLineBegin);
|
||||
aPrimSegments->AddVertex (aCenterLineEnd);
|
||||
aGroup->SetGroupPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (aPrimSegments);
|
||||
|
||||
// add selection primitives
|
||||
SelectionGeometry::Curve& aSensitiveCurve = mySelectionGeom.NewCurve();
|
||||
aSensitiveCurve.Append (aCenterLineBegin);
|
||||
aSensitiveCurve.Append (aCenterLineEnd);
|
||||
// add selection primitives
|
||||
SelectionGeometry::Curve& aSensitiveCurve = mySelectionGeom.NewCurve();
|
||||
aSensitiveCurve.Append (aCenterLineBegin);
|
||||
aSensitiveCurve.Append (aCenterLineEnd);
|
||||
}
|
||||
|
||||
// add arrows to presentation
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
|
||||
if (!theIsOneSide)
|
||||
{
|
||||
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
|
||||
thePresentation->NewGroup();
|
||||
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
|
||||
if (!theIsOneSide)
|
||||
{
|
||||
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isArrowsExternal || theIsOneSide)
|
||||
@@ -954,11 +967,11 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
}
|
||||
|
||||
// add extension lines for external arrows
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
|
||||
aFirstArrowEnd, aFirstExtensionDir,
|
||||
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
|
||||
{
|
||||
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
|
||||
aFirstArrowEnd, aFirstExtensionDir,
|
||||
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -968,7 +981,7 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
// add flyout lines to presentation
|
||||
if (theMode == ComputeMode_All)
|
||||
{
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments(4);
|
||||
aPrimSegments->AddVertex (theFirstPoint);
|
||||
@@ -977,8 +990,8 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
aPrimSegments->AddVertex (theSecondPoint);
|
||||
aPrimSegments->AddVertex (aLineEndPoint);
|
||||
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
|
||||
aGroup->SetGroupPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (aPrimSegments);
|
||||
}
|
||||
|
||||
mySelectionGeom.IsComputed = Standard_True;
|
||||
|
@@ -17,32 +17,12 @@
|
||||
#ifndef _AIS_EqualDistanceRelation_HeaderFile
|
||||
#define _AIS_EqualDistanceRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <AIS_TypeOfDist.hxx>
|
||||
class TopoDS_Shape;
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class TopoDS_Edge;
|
||||
class Bnd_Box;
|
||||
class gp_Pnt;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
|
||||
class AIS_EqualDistanceRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation)
|
||||
|
||||
//! A framework to display equivalent distances between
|
||||
@@ -52,10 +32,9 @@ DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation)
|
||||
//! These distances are used to compare shapes by this vector alone.
|
||||
class AIS_EqualDistanceRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! Constructs a framework to display equivalent
|
||||
//! distances between the shapes aShape1, aShape2,
|
||||
//! aShape3, aShape4 and the plane aPlane.
|
||||
@@ -105,19 +84,8 @@ public:
|
||||
//! a line or a circle.
|
||||
Standard_EXPORT static void ComputeOneEdgeOneVertexLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -135,14 +103,8 @@ private:
|
||||
gp_Pnt myPoint3;
|
||||
gp_Pnt myPoint4;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_EqualDistanceRelation.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_EqualDistanceRelation_HeaderFile
|
||||
|
@@ -17,31 +17,17 @@
|
||||
#ifndef _AIS_EqualRadiusRelation_HeaderFile
|
||||
#define _AIS_EqualRadiusRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Edge;
|
||||
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_EqualRadiusRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_EqualRadiusRelation, AIS_Relation)
|
||||
|
||||
|
||||
class AIS_EqualRadiusRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_EqualRadiusRelation, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! Creates equal relation of two arc's radiuses.
|
||||
//! If one of edges is not in the given plane,
|
||||
//! the presentation method projects it onto the plane.
|
||||
@@ -56,19 +42,8 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_EqualRadiusRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -82,13 +57,6 @@ private:
|
||||
gp_Pnt myFirstPoint;
|
||||
gp_Pnt mySecondPoint;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_EqualRadiusRelation_HeaderFile
|
||||
|
@@ -17,32 +17,11 @@
|
||||
#ifndef _AIS_FixRelation_HeaderFile
|
||||
#define _AIS_FixRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
class Geom_Plane;
|
||||
class TopoDS_Wire;
|
||||
class gp_Pnt;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class TopoDS_Vertex;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Edge;
|
||||
class gp_Lin;
|
||||
class gp_Circ;
|
||||
|
||||
|
||||
class AIS_FixRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation)
|
||||
|
||||
//! Constructs and manages a constraint by a fixed
|
||||
@@ -55,9 +34,8 @@ DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation)
|
||||
//! object.
|
||||
class AIS_FixRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_FixRelation, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! initializes the vertex aShape, the
|
||||
//! plane aPlane and the wire aWire, which connects
|
||||
@@ -98,16 +76,6 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_FixRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -141,11 +109,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_FixRelation.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_FixRelation_HeaderFile
|
||||
|
@@ -17,21 +17,14 @@
|
||||
#ifndef _AIS_IdenticRelation_HeaderFile
|
||||
#define _AIS_IdenticRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_ListOfTransient.hxx>
|
||||
|
||||
class TopoDS_Shape;
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class Geom_Line;
|
||||
class gp_Pnt;
|
||||
class Geom_Circle;
|
||||
@@ -40,8 +33,6 @@ class TopoDS_Wire;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Dir;
|
||||
|
||||
|
||||
class AIS_IdenticRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_IdenticRelation, AIS_Relation)
|
||||
|
||||
//! Constructs a constraint by a relation of identity
|
||||
|
@@ -37,7 +37,6 @@
|
||||
#include <Prs3d_PlaneAspect.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <PrsMgr_PresentableObject.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
@@ -952,7 +951,8 @@ void AIS_InteractiveContext::RecomputePrsOnly (const Handle(AIS_InteractiveObjec
|
||||
return;
|
||||
}
|
||||
|
||||
theIObj->Update (theAllModes);
|
||||
theIObj->SetToUpdate();
|
||||
theIObj->UpdatePresentations (theAllModes);
|
||||
if (!theToUpdateViewer)
|
||||
{
|
||||
return;
|
||||
@@ -1006,13 +1006,7 @@ void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIOb
|
||||
return;
|
||||
}
|
||||
|
||||
TColStd_ListOfInteger aPrsModes;
|
||||
theIObj->ToBeUpdated (aPrsModes);
|
||||
for (TColStd_ListIteratorOfListOfInteger aPrsModesIt (aPrsModes); aPrsModesIt.More(); aPrsModesIt.Next())
|
||||
{
|
||||
theIObj->Update (aPrsModesIt.Value(), Standard_False);
|
||||
}
|
||||
|
||||
theIObj->UpdatePresentations();
|
||||
mgrSelector->Update(theIObj);
|
||||
|
||||
if (theUpdateViewer)
|
||||
@@ -1369,63 +1363,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
|
||||
//purpose :
|
||||
@@ -1441,7 +1378,11 @@ void AIS_InteractiveContext::SetColor (const Handle(AIS_InteractiveObject)& theI
|
||||
|
||||
setContextToObject (theIObj);
|
||||
theIObj->SetColor (theColor);
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
theIObj->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1486,7 +1427,11 @@ void AIS_InteractiveContext::SetDeviationCoefficient (const Handle(AIS_Interacti
|
||||
|
||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||
aShape->SetOwnDeviationCoefficient (theCoefficient);
|
||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
||||
aShape->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1516,7 +1461,11 @@ void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Handle(AIS_Intera
|
||||
|
||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||
aShape->SetOwnHLRDeviationCoefficient (theCoefficient);
|
||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
||||
aShape->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1545,7 +1494,11 @@ void AIS_InteractiveContext::SetDeviationAngle (const Handle(AIS_InteractiveObje
|
||||
|
||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||
aShape->SetOwnDeviationAngle (theAngle);
|
||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
||||
aShape->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1574,15 +1527,10 @@ void AIS_InteractiveContext::SetAngleAndDeviation (const Handle(AIS_InteractiveO
|
||||
|
||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||
aShape->SetAngleAndDeviation (theAngle);
|
||||
|
||||
if (theIObj->RecomputeEveryPrs())
|
||||
aShape->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
theIObj->Update (Standard_True);
|
||||
theIObj->UpdateSelection();
|
||||
}
|
||||
else
|
||||
{
|
||||
Update (theIObj, theToUpdateViewer);
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1611,7 +1559,11 @@ void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Handle(AIS_Interacti
|
||||
}
|
||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||
aShape->SetHLRAngleAndDeviation (theAngle);
|
||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
||||
aShape->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1639,7 +1591,11 @@ void AIS_InteractiveContext::SetHLRDeviationAngle (const Handle(AIS_InteractiveO
|
||||
}
|
||||
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
|
||||
aShape->SetOwnHLRDeviationAngle (theAngle);
|
||||
redisplayPrsModes (theIObj, theToUpdateViewer);
|
||||
aShape->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1655,7 +1611,11 @@ void AIS_InteractiveContext::UnsetColor (const Handle(AIS_InteractiveObject)& th
|
||||
}
|
||||
|
||||
theIObj->UnsetColor();
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
theIObj->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1701,7 +1661,7 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
|
||||
|
||||
setContextToObject (theIObj);
|
||||
theIObj->SetWidth (theWidth);
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
theIObj->UpdatePresentations();
|
||||
if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
|
||||
{
|
||||
if (myLastinMain->IsAutoHilight())
|
||||
@@ -1718,6 +1678,10 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
|
||||
myLastinMain);
|
||||
}
|
||||
}
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1733,7 +1697,11 @@ void AIS_InteractiveContext::UnsetWidth (const Handle(AIS_InteractiveObject)& th
|
||||
}
|
||||
|
||||
theIObj->UnsetWidth();
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
theIObj->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1751,7 +1719,11 @@ void AIS_InteractiveContext::SetMaterial (const Handle(AIS_InteractiveObject)& t
|
||||
|
||||
setContextToObject (theIObj);
|
||||
theIObj->SetMaterial (theMaterial);
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
theIObj->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1766,7 +1738,11 @@ void AIS_InteractiveContext::UnsetMaterial (const Handle(AIS_InteractiveObject)&
|
||||
return;
|
||||
}
|
||||
theIObj->UnsetMaterial();
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
theIObj->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1796,7 +1772,11 @@ void AIS_InteractiveContext::SetTransparency (const Handle(AIS_InteractiveObject
|
||||
}
|
||||
|
||||
theIObj->SetTransparency (theValue);
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
theIObj->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1812,7 +1792,11 @@ void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObje
|
||||
}
|
||||
|
||||
theIObj->UnsetTransparency();
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
theIObj->UpdatePresentations();
|
||||
if (theToUpdateViewer)
|
||||
{
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1822,6 +1806,7 @@ void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObje
|
||||
void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)& theAspect,
|
||||
const Standard_Boolean theToUpdateViewer)
|
||||
{
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
Standard_Boolean isFound = Standard_False;
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
@@ -1829,6 +1814,7 @@ void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)&
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (aSelIter.Value()->Selectable());
|
||||
anObj->SetAspect (theAspect);
|
||||
}
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
||||
if (isFound && theToUpdateViewer)
|
||||
{
|
||||
@@ -2460,6 +2446,13 @@ void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& th
|
||||
{
|
||||
Handle(AIS_MultipleConnectedInteractive) theObj (Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly));
|
||||
theObj->Disconnect (theObjToDisconnect);
|
||||
if (!myObjects.IsBound (theObjToDisconnect))
|
||||
{
|
||||
// connected presentation might contain displayed presentations
|
||||
myMainPM->Erase (theObjToDisconnect, -1);
|
||||
theObjToDisconnect->ErasePresentations (true);
|
||||
}
|
||||
|
||||
const Handle(SelectMgr_SelectableObject)& anObj = theObjToDisconnect; // to avoid ambiguity
|
||||
mgrSelector->Remove (anObj);
|
||||
}
|
||||
|
@@ -198,6 +198,21 @@ public: //! @name highlighting management
|
||||
const Handle(Prs3d_Drawer)& HighlightStyle (const Prs3d_TypeOfHighlight theStyleType) const { return myStyles[theStyleType]; }
|
||||
|
||||
//! Setup highlight style settings.
|
||||
//! It is preferred modifying existing style returned by method HighlightStyle()
|
||||
//! instead of creating a new drawer.
|
||||
//!
|
||||
//! If a new highlight style is created, its presentation Zlayer should be checked,
|
||||
//! otherwise highlighting might not work as expected.
|
||||
//! Default values are:
|
||||
//! - Prs3d_TypeOfHighlight_Dynamic: Graphic3d_ZLayerId_Top,
|
||||
//! object highlighting is drawn on top of main scene within Immediate Layers,
|
||||
//! so that V3d_View::RedrawImmediate() will be enough to see update;
|
||||
//! - Prs3d_TypeOfHighlight_LocalDynamic: Graphic3d_ZLayerId_Topmost,
|
||||
//! object parts highlighting is drawn on top of main scene within Immediate Layers
|
||||
//! with depth cleared (even overlapped geometry will be revealed);
|
||||
//! - Prs3d_TypeOfHighlight_Selected: Graphic3d_ZLayerId_UNKNOWN,
|
||||
//! object highlighting is drawn on top of main scene within the same layer
|
||||
//! as object itself (e.g. Graphic3d_ZLayerId_Default by default) and increased priority.
|
||||
void SetHighlightStyle (const Prs3d_TypeOfHighlight theStyleType,
|
||||
const Handle(Prs3d_Drawer)& theStyle) { myStyles[theStyleType] = theStyle; }
|
||||
|
||||
@@ -212,6 +227,14 @@ public: //! @name highlighting management
|
||||
}
|
||||
|
||||
//! Setup the style of dynamic highlighting.
|
||||
//! It is preferred modifying existing style returned by method HighlightStyle()
|
||||
//! instead of creating a new drawer.
|
||||
//!
|
||||
//! If a new highlight style is created, its presentation Zlayer should be checked,
|
||||
//! otherwise highlighting might not work as expected.
|
||||
//! Default value is Graphic3d_ZLayerId_Top,
|
||||
//! object highlighting is drawn on top of main scene within Immediate Layers,
|
||||
//! so that V3d_View::RedrawImmediate() will be enough to see update;
|
||||
void SetHighlightStyle (const Handle(Prs3d_Drawer)& theStyle) { myStyles[Prs3d_TypeOfHighlight_Dynamic] = theStyle; }
|
||||
|
||||
//! Returns current selection style settings.
|
||||
@@ -431,6 +454,7 @@ public: //! @name iteration through detected entities
|
||||
public: //! @name Selection management
|
||||
|
||||
//! Sets the graphic basic aspect to the current presentation of ALL selected objects.
|
||||
Standard_DEPRECATED ("Deprecated method - presentation attributes should be assigned directly to object")
|
||||
Standard_EXPORT void SetSelectedAspect (const Handle(Prs3d_BasicAspect)& theAspect,
|
||||
const Standard_Boolean theToUpdateViewer);
|
||||
|
||||
@@ -1059,6 +1083,7 @@ public: //! @name iso-line display attributes
|
||||
//! Returns true if drawing isolines on triangulation algorithm is enabled.
|
||||
Standard_EXPORT Standard_Boolean IsoOnTriangulation() const;
|
||||
|
||||
//! @name obsolete methods
|
||||
public:
|
||||
|
||||
//! Updates the view of the current object in open context.
|
||||
@@ -1184,14 +1209,6 @@ protected: //! @name internal methods
|
||||
Standard_EXPORT void InitAttributes();
|
||||
|
||||
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.
|
||||
Standard_EXPORT void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);
|
||||
@@ -1262,6 +1279,10 @@ protected: //! @name internal methods
|
||||
return myStyles[!theOwner.IsNull() && theOwner->ComesFromDecomposition() ? Prs3d_TypeOfHighlight_LocalDynamic : Prs3d_TypeOfHighlight_Dynamic];
|
||||
}
|
||||
|
||||
//! Return TRUE if highlight style of owner requires full viewer redraw.
|
||||
Standard_EXPORT Standard_Boolean isSlowHiStyle (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Handle(V3d_Viewer)& theViewer) const;
|
||||
|
||||
//! Helper function that returns correct selection style for the object:
|
||||
//! if custom style is defined via object's highlight drawer, it will be used. Otherwise,
|
||||
//! selection style of interactive context will be returned.
|
||||
|
@@ -293,6 +293,22 @@ void AIS_InteractiveContext::highlightWithSubintensity (const Handle(SelectMgr_E
|
||||
theOwner->HilightWithColor (myMainPM, myStyles[Prs3d_TypeOfHighlight_SubIntensity], theMode);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : isSlowHiStyle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_InteractiveContext::isSlowHiStyle (const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Handle(V3d_Viewer)& theViewer) const
|
||||
{
|
||||
if (const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable()))
|
||||
{
|
||||
const Handle(Prs3d_Drawer)& aHiStyle = getHiStyle (anObj, myLastPicked);
|
||||
return aHiStyle->ZLayer() == Graphic3d_ZLayerId_UNKNOWN
|
||||
|| !theViewer->ZLayerSettings (aHiStyle->ZLayer()).IsImmediate();
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MoveTo
|
||||
//purpose :
|
||||
@@ -372,6 +388,11 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
|
||||
// method call. As result it is necessary to rehighligt it with mySelectionColor.
|
||||
if (!myLastPicked.IsNull() && myLastPicked->HasSelectable())
|
||||
{
|
||||
if (isSlowHiStyle (myLastPicked, theView->Viewer()))
|
||||
{
|
||||
theView->Viewer()->Invalidate();
|
||||
}
|
||||
|
||||
clearDynamicHighlight();
|
||||
toUpdateViewer = Standard_True;
|
||||
}
|
||||
@@ -387,6 +408,11 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
|
||||
&& (!myLastPicked->IsSelected()
|
||||
|| myToHilightSelected))
|
||||
{
|
||||
if (isSlowHiStyle (myLastPicked, theView->Viewer()))
|
||||
{
|
||||
theView->Viewer()->Invalidate();
|
||||
}
|
||||
|
||||
highlightWithColor (myLastPicked, theView->Viewer());
|
||||
toUpdateViewer = Standard_True;
|
||||
}
|
||||
@@ -405,6 +431,11 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
|
||||
&& !myLastPicked.IsNull()
|
||||
&& myLastPicked->HasSelectable())
|
||||
{
|
||||
if (isSlowHiStyle (myLastPicked, theView->Viewer()))
|
||||
{
|
||||
theView->Viewer()->Invalidate();
|
||||
}
|
||||
|
||||
clearDynamicHighlight();
|
||||
toUpdateViewer = Standard_True;
|
||||
}
|
||||
@@ -422,7 +453,14 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
|
||||
}
|
||||
else
|
||||
{
|
||||
theView->Viewer()->RedrawImmediate();
|
||||
if (theView->IsInvalidated())
|
||||
{
|
||||
theView->Viewer()->Redraw();
|
||||
}
|
||||
else
|
||||
{
|
||||
theView->Viewer()->RedrawImmediate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -419,7 +419,7 @@ Standard_Boolean AIS_InteractiveContext::ImmediateAdd (const Handle(AIS_Interact
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
myMainPM->AddToImmediateList (myMainPM->Presentation (theObj, theMode)->Presentation());
|
||||
myMainPM->AddToImmediateList (myMainPM->Presentation (theObj, theMode));
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -16,32 +16,20 @@
|
||||
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <Aspect_PolygonOffsetMode.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_BndBox4f.hxx>
|
||||
#include <Graphic3d_CStructure.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Prs3d_BasicAspect.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_TextAspect.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||
#include <PrsMgr_PresentationManager.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveObject,SelectMgr_SelectableObject)
|
||||
|
||||
@@ -51,15 +39,9 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveObject,SelectMgr_SelectableObject)
|
||||
//=======================================================================
|
||||
AIS_InteractiveObject::AIS_InteractiveObject (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d)
|
||||
: SelectMgr_SelectableObject (aTypeOfPresentation3d),
|
||||
myCTXPtr (NULL),
|
||||
myOwnWidth (0.0),
|
||||
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
|
||||
myInfiniteState (Standard_False),
|
||||
hasOwnColor (Standard_False),
|
||||
hasOwnMaterial (Standard_False),
|
||||
myRecomputeEveryPrs (Standard_True)
|
||||
myCTXPtr (NULL)
|
||||
{
|
||||
SetCurrentFacingModel();
|
||||
//
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -74,30 +56,6 @@ void AIS_InteractiveObject::Redisplay (const Standard_Boolean AllModes)
|
||||
myCTXPtr->Redisplay (this, Standard_False, AllModes);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Type
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
AIS_KindOfInteractive AIS_InteractiveObject::Type() const
|
||||
{return AIS_KOI_None;}
|
||||
|
||||
//=======================================================================
|
||||
//function : Signature
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer AIS_InteractiveObject::Signature() const
|
||||
{return -1;}
|
||||
|
||||
//=======================================================================
|
||||
//function : RecomputeEveryPrs
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean AIS_InteractiveObject::RecomputeEveryPrs() const
|
||||
{return myRecomputeEveryPrs;}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
@@ -125,274 +83,6 @@ void AIS_InteractiveObject::SetContext (const Handle(AIS_InteractiveContext)& th
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_InteractiveObject::HasOwner() const
|
||||
{
|
||||
return (!myOwner.IsNull());
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::ClearOwner()
|
||||
{
|
||||
myOwner.Nullify();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDisplayMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetDisplayMode (const Standard_Integer theMode)
|
||||
{
|
||||
if (AcceptDisplayMode (theMode))
|
||||
{
|
||||
myDrawer->SetDisplayMode (theMode);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetCurrentFacingModel(const Aspect_TypeOfFacingModel aModel) {
|
||||
myCurrentFacingModel = aModel;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CurrentFacingModel
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Aspect_TypeOfFacingModel AIS_InteractiveObject::CurrentFacingModel() const {
|
||||
return myCurrentFacingModel;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveObject::SetColor(const Quantity_Color& theColor)
|
||||
{
|
||||
myDrawer->SetColor (theColor);
|
||||
hasOwnColor = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetColor()
|
||||
{
|
||||
hasOwnColor = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
|
||||
{
|
||||
myOwnWidth = aValue;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetWidth()
|
||||
{
|
||||
myOwnWidth = 0.;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Material
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Graphic3d_NameOfMaterial AIS_InteractiveObject::Material() const
|
||||
{
|
||||
return myDrawer->ShadingAspect()->Material().Name();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
|
||||
{
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
myDrawer->ShadingAspect()->SetMaterial (theMaterial);
|
||||
hasOwnMaterial = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetMaterial()
|
||||
{
|
||||
if (!HasMaterial())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasColor() || IsTransparent())
|
||||
{
|
||||
if(myDrawer->HasLink())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (AIS_GraphicTool::GetMaterial (myDrawer->Link()));
|
||||
}
|
||||
|
||||
if (HasColor())
|
||||
{
|
||||
SetColor (myDrawer->Color());
|
||||
}
|
||||
|
||||
if (IsTransparent())
|
||||
{
|
||||
SetTransparency (myDrawer->Transparency());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Handle(Prs3d_ShadingAspect) anAspect;
|
||||
myDrawer->SetShadingAspect (anAspect);
|
||||
}
|
||||
|
||||
hasOwnMaterial = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTransparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetTransparency (const Standard_Real theValue)
|
||||
{
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
if(myDrawer->HasLink())
|
||||
myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
}
|
||||
|
||||
myDrawer->ShadingAspect()->Aspect()->ChangeFrontMaterial().SetTransparency (Standard_ShortReal(theValue));
|
||||
myDrawer->ShadingAspect()->Aspect()->ChangeBackMaterial() .SetTransparency (Standard_ShortReal(theValue));
|
||||
myDrawer->SetTransparency (Standard_ShortReal(theValue));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetTransparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetTransparency()
|
||||
{
|
||||
if(HasColor() || HasMaterial() )
|
||||
{
|
||||
myDrawer->ShadingAspect()->Aspect()->ChangeFrontMaterial().SetTransparency (0.0f);
|
||||
myDrawer->ShadingAspect()->Aspect()->ChangeBackMaterial() .SetTransparency (0.0f);
|
||||
}
|
||||
else{
|
||||
Handle (Prs3d_ShadingAspect) SA;
|
||||
myDrawer->SetShadingAspect(SA);
|
||||
}
|
||||
myDrawer->SetTransparency (0.0f);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Transparency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real AIS_InteractiveObject::Transparency() const
|
||||
{
|
||||
return (myDrawer->Transparency() <= 0.005f ? 0.0 : myDrawer->Transparency());
|
||||
// Graphic3d_MaterialAspect Mat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
// return Mat.Transparency();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetAttributes()
|
||||
{
|
||||
SelectMgr_SelectableObject::UnsetAttributes();
|
||||
|
||||
hasOwnColor = Standard_False;
|
||||
hasOwnMaterial = Standard_False;
|
||||
myOwnWidth = 0.0;
|
||||
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
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean AIS_InteractiveObject::AcceptDisplayMode(const Standard_Integer ) const
|
||||
{return Standard_True;}
|
||||
|
||||
//=======================================================================
|
||||
//function : DefaultDisplayMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer AIS_InteractiveObject::DefaultDisplayMode() const
|
||||
{return 0;}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetInfiniteState
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetInfiniteState(const Standard_Boolean aFlag)
|
||||
{
|
||||
myInfiniteState = aFlag;
|
||||
Handle(Prs3d_Presentation) P;
|
||||
|
||||
for(Standard_Integer i =1; i<=myPresentations.Length();i++)
|
||||
{
|
||||
P = myPresentations(i).Presentation()->Presentation();
|
||||
if(!P.IsNull())
|
||||
P->SetInfiniteState(myInfiniteState);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasPresentation
|
||||
//purpose :
|
||||
@@ -415,210 +105,41 @@ Handle(Prs3d_Presentation) AIS_InteractiveObject::Presentation() const
|
||||
}
|
||||
|
||||
Handle(PrsMgr_Presentation) aPrs = myCTXPtr->MainPrsMgr()->Presentation (this, myDrawer->DisplayMode(), false);
|
||||
return !aPrs.IsNull()
|
||||
? aPrs->Presentation()
|
||||
: Handle(Prs3d_Presentation)();
|
||||
return aPrs;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetAspect
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& anAspect)
|
||||
void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& theAspect)
|
||||
{
|
||||
|
||||
if( HasPresentation() ) {
|
||||
Handle(Prs3d_Presentation) prs = Presentation();
|
||||
{ Handle(Prs3d_ShadingAspect) aspect =
|
||||
Handle(Prs3d_ShadingAspect)::DownCast(anAspect);
|
||||
if( !aspect.IsNull() ) {
|
||||
Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
|
||||
return;
|
||||
}
|
||||
}
|
||||
{ Handle(Prs3d_LineAspect) aspect =
|
||||
Handle(Prs3d_LineAspect)::DownCast(anAspect);
|
||||
if( !aspect.IsNull() ) {
|
||||
Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
|
||||
return;
|
||||
}
|
||||
}
|
||||
{ Handle(Prs3d_PointAspect) aspect =
|
||||
Handle(Prs3d_PointAspect)::DownCast(anAspect);
|
||||
if( !aspect.IsNull() ) {
|
||||
Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
|
||||
return;
|
||||
}
|
||||
}
|
||||
{ Handle(Prs3d_TextAspect) aspect =
|
||||
Handle(Prs3d_TextAspect)::DownCast(anAspect);
|
||||
if( !aspect.IsNull() ) {
|
||||
Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPolygonOffsets
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer aMode,
|
||||
const Standard_ShortReal aFactor,
|
||||
const Standard_ShortReal aUnits)
|
||||
{
|
||||
if ( !HasPolygonOffsets() )
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
|
||||
myDrawer->ShadingAspect()->Aspect()->SetPolygonOffsets( aMode, aFactor, aUnits );
|
||||
|
||||
// Modify existing presentations
|
||||
for (Standard_Integer aPrsIter = 1, n = myPresentations.Length(); aPrsIter <= n; ++aPrsIter)
|
||||
if (!HasPresentation())
|
||||
{
|
||||
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter).Presentation();
|
||||
if ( !aPrs3d.IsNull() ) {
|
||||
const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
|
||||
if( !aStruct.IsNull() ) {
|
||||
// Workaround for issue 23115: Need to update also groups, because their
|
||||
// face aspect ALWAYS overrides the structure's.
|
||||
const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aGroups); aGroupIter.More(); aGroupIter.Next())
|
||||
{
|
||||
Handle(Graphic3d_Group)& aGrp = aGroupIter.ChangeValue();
|
||||
if (aGrp.IsNull()
|
||||
|| !aGrp->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_AspectFillArea3d) aFaceAsp = aGrp->FillAreaAspect();
|
||||
aFaceAsp->SetPolygonOffsets(aMode, aFactor, aUnits);
|
||||
aGrp->SetGroupPrimitivesAspect(aFaceAsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasPolygonOffsets
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_InteractiveObject::HasPolygonOffsets() const
|
||||
{
|
||||
return !( myDrawer->ShadingAspect().IsNull() ||
|
||||
( myDrawer->HasLink() &&
|
||||
myDrawer->ShadingAspect() == myDrawer->Link()->ShadingAspect() ) );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PolygonOffsets
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::PolygonOffsets(Standard_Integer& aMode,
|
||||
Standard_ShortReal& aFactor,
|
||||
Standard_ShortReal& aUnits) const
|
||||
{
|
||||
if( HasPolygonOffsets() )
|
||||
myDrawer->ShadingAspect()->Aspect()->PolygonOffsets( aMode, aFactor, aUnits );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BoundingBox
|
||||
//purpose : Returns bounding box of object correspondingly to its
|
||||
// current display mode
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::BoundingBox (Bnd_Box& theBndBox)
|
||||
{
|
||||
if (myDrawer->DisplayMode() == -1)
|
||||
Handle(Prs3d_Presentation) aPrs = Presentation();
|
||||
if (aPrs->Groups().IsEmpty())
|
||||
{
|
||||
if (!myPresentations.IsEmpty())
|
||||
{
|
||||
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations.First().Presentation();
|
||||
const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
|
||||
const Graphic3d_BndBox3d& aBndBox = aStruct->CStructure()->BoundingBox();
|
||||
|
||||
if (!aBndBox.IsValid())
|
||||
{
|
||||
theBndBox.SetVoid();
|
||||
return;
|
||||
}
|
||||
|
||||
theBndBox.Update (aBndBox.CornerMin().x(), aBndBox.CornerMin().y(), aBndBox.CornerMin().z(),
|
||||
aBndBox.CornerMax().x(), aBndBox.CornerMax().y(), aBndBox.CornerMax().z());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (Children()); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aChild (Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()));
|
||||
if (aChild.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Bnd_Box aBox;
|
||||
aChild->BoundingBox (aBox);
|
||||
theBndBox.Add (aBox);
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
const Handle(Graphic3d_Group)& aGroup = aPrs->Groups().Last();
|
||||
if (Handle(Prs3d_ShadingAspect) aShadingAspect = Handle(Prs3d_ShadingAspect)::DownCast(theAspect))
|
||||
{
|
||||
for (Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
|
||||
{
|
||||
if (myPresentations (aPrsIter).Mode() == myDrawer->DisplayMode())
|
||||
{
|
||||
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter).Presentation();
|
||||
const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
|
||||
const Graphic3d_BndBox3d& aBndBox = aStruct->CStructure()->BoundingBox();
|
||||
|
||||
if (!aBndBox.IsValid())
|
||||
{
|
||||
theBndBox.SetVoid();
|
||||
return;
|
||||
}
|
||||
|
||||
theBndBox.Update (aBndBox.CornerMin().x(), aBndBox.CornerMin().y(), aBndBox.CornerMin().z(),
|
||||
aBndBox.CornerMax().x(), aBndBox.CornerMax().y(), aBndBox.CornerMax().z());
|
||||
return;
|
||||
}
|
||||
}
|
||||
aGroup->SetGroupPrimitivesAspect (aShadingAspect->Aspect());
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetIsoOnTriangulation
|
||||
//purpose : Enables or disables isoline on triangulation building
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetIsoOnTriangulation (const Standard_Boolean theIsEnabled)
|
||||
{
|
||||
myDrawer->SetIsoOnTriangulation (theIsEnabled);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SynchronizeAspects
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SynchronizeAspects()
|
||||
{
|
||||
for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
|
||||
else if (Handle(Prs3d_LineAspect) aLineAspect = Handle(Prs3d_LineAspect)::DownCast(theAspect))
|
||||
{
|
||||
const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue().Presentation();
|
||||
if (aPrs3d.IsNull()
|
||||
|| aPrs3d->Presentation().IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Presentation()->Groups()); aGroupIter.More(); aGroupIter.Next())
|
||||
{
|
||||
if (!aGroupIter.Value().IsNull())
|
||||
{
|
||||
aGroupIter.ChangeValue()->SynchronizeAspects();
|
||||
}
|
||||
}
|
||||
aGroup->SetGroupPrimitivesAspect (aLineAspect->Aspect());
|
||||
}
|
||||
else if (Handle(Prs3d_PointAspect) aPointAspect = Handle(Prs3d_PointAspect)::DownCast(theAspect))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (aPointAspect->Aspect());
|
||||
}
|
||||
else if (Handle(Prs3d_TextAspect) aTextAspect = Handle(Prs3d_TextAspect)::DownCast(theAspect))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (aTextAspect->Aspect());
|
||||
}
|
||||
}
|
||||
|
@@ -17,139 +17,48 @@
|
||||
#ifndef _AIS_InteractiveObject_HeaderFile
|
||||
#define _AIS_InteractiveObject_HeaderFile
|
||||
|
||||
#include <Aspect_TypeOfFacingModel.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <PrsMgr_TypeOfPresentation3d.hxx>
|
||||
#include <SelectMgr_SelectableObject.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <TColStd_ListOfTransient.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
|
||||
class AIS_InteractiveContext;
|
||||
class Graphic3d_MaterialAspect;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_BasicAspect;
|
||||
class Bnd_Box;
|
||||
|
||||
//! Defines a class of objects with display and selection services.
|
||||
//! Entities which are visualized and selected are
|
||||
//! Interactive Objects. You can make use of classes of
|
||||
//! standard Interactive Objects for which all necessary
|
||||
//! methods have already been programmed, or you can
|
||||
//! implement your own classes of Interactive Objects.
|
||||
//! Specific attributes of entities such as arrow aspect for
|
||||
//! dimensions must be loaded in a Drawer. This Drawer
|
||||
//! is then applied to the Interactive Object in view.
|
||||
//! There are four types of Interactive Object in AIS: the
|
||||
//! construction element or Datum, the Relation, which
|
||||
//! includes both dimensions and constraints, the Object,
|
||||
//! and finally, when the object is of an unknown type, the None type.
|
||||
//! Inside these categories, a signature, or index,
|
||||
//! provides the possibility of additional characterization.
|
||||
//! By default, the Interactive Object has a None type
|
||||
//! and a signature of 0. If you want to give a particular
|
||||
//! type and signature to your interactive object, you must
|
||||
//! redefine the methods, Signature and Type.
|
||||
//! Warning
|
||||
//! In the case of attribute methods, methods for
|
||||
//! standard attributes are virtual. They must be
|
||||
//! redefined by the inheriting classes. Setcolor for a
|
||||
//! point and Setcolor for a plane, for example, do not
|
||||
//! affect the same attributes in the Drawer.
|
||||
//! Entities which are visualized and selected are Interactive Objects.
|
||||
//! Specific attributes of entities such as arrow aspect for dimensions must be loaded in a Prs3d_Drawer.
|
||||
//!
|
||||
//! You can make use of classes of standard Interactive Objects for which all necessary methods have already been programmed,
|
||||
//! or you can implement your own classes of Interactive Objects.
|
||||
//! Key interface methods to be implemented by every Interactive Object:
|
||||
//! * Presentable Object (PrsMgr_PresentableObject)
|
||||
//! Consider defining an enumeration of supported Display Mode indexes for particular Interactive Object or class of Interactive Objects.
|
||||
//! - AcceptDisplayMode() accepting display modes implemented by this object;
|
||||
//! - Compute() computing presentation for the given display mode index;
|
||||
//! * Selectable Object (SelectMgr_SelectableObject)
|
||||
//! Consider defining an enumeration of supported Selection Mode indexes for particular Interactive Object or class of Interactive Objects.
|
||||
//! - ComputeSelection() computing selectable entities for the given selection mode index.
|
||||
class AIS_InteractiveObject : public SelectMgr_SelectableObject
|
||||
{
|
||||
friend class AIS_InteractiveContext;
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_InteractiveObject, SelectMgr_SelectableObject)
|
||||
public:
|
||||
|
||||
//! Returns the kind of Interactive Object:
|
||||
//! - None
|
||||
//! - Datum
|
||||
//! - Relation
|
||||
//! - Object
|
||||
//! By default, the interactive object has a None type.
|
||||
//! Because specific shapes entail different behavior
|
||||
//! according to their sub-shapes, you may need to
|
||||
//! create a Local Context. This will allow you to
|
||||
//! specify the additional characteristics which you
|
||||
//! need to handle these shapes.
|
||||
Standard_EXPORT virtual AIS_KindOfInteractive Type() const;
|
||||
|
||||
//! Specifies additional characteristics of Interactive
|
||||
//! Objects. A signature is, in fact, an index with integer
|
||||
//! values assigned different properties.
|
||||
//! This method is frequently used in conjuction with
|
||||
//! Type to give a particular type and signature to an
|
||||
//! Interactive Object. By default, the Interactive Object
|
||||
//! has a None type and a signature of 0. Among the
|
||||
//! datums, this signature is attributed to the shape
|
||||
//! Returns the kind of Interactive Object; AIS_KOI_None by default.
|
||||
virtual AIS_KindOfInteractive Type() const { return AIS_KOI_None; }
|
||||
|
||||
//! Specifies additional characteristics of Interactive Object of Type(); -1 by default.
|
||||
//! Among the datums, this signature is attributed to the shape.
|
||||
//! The remaining datums have the following default signatures:
|
||||
//! - Point signature 1
|
||||
//! - Axis signature 2
|
||||
//! - Trihedron signature 3
|
||||
//! - PlaneTrihedron signature 4
|
||||
//! - Line signature 5
|
||||
//! - Circle signature 6
|
||||
//! - Plane signature 7.
|
||||
Standard_EXPORT virtual Standard_Integer Signature() const;
|
||||
|
||||
//! Informs the graphic context that the interactive Object
|
||||
//! may be decomposed into sub-shapes for dynamic selection.
|
||||
//! The most used Interactive Object is AIS_Shape.
|
||||
//! Activation methods for standard selection modes are
|
||||
//! proposed in the Interactive Context. These include
|
||||
//! selection by vertex or by edges. For datums with the
|
||||
//! same behavior as AIS_Shape, such as vetices and
|
||||
//! edges, we must redefine the virtual method so that
|
||||
//! AcceptShapeDecomposition returns false.
|
||||
//! Rule for selection :
|
||||
//! Mode 0 : Selection of the interactive Object itself
|
||||
//! Mode 1 : Selection of vertices
|
||||
//! Mode 2 : Selection Of Edges
|
||||
//! Mode 3 : Selection Of Wires
|
||||
//! Mode 4 : Selection Of Faces ...
|
||||
virtual Standard_Boolean AcceptShapeDecomposition() const { return Standard_False; }
|
||||
|
||||
//! change the current facing model apply on polygons for
|
||||
//! SetColor(), SetTransparency(), SetMaterial() methods
|
||||
//! default facing model is Aspect_TOFM_TWO_SIDE. This mean that attributes is
|
||||
//! applying both on the front and back face.
|
||||
Standard_EXPORT void SetCurrentFacingModel (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
|
||||
|
||||
//! Returns the current facing model which is in effect.
|
||||
Standard_EXPORT Aspect_TypeOfFacingModel CurrentFacingModel() const;
|
||||
|
||||
//! Only the interactive object knowns which Drawer attribute is affected by the color, if any
|
||||
//! (ex: for a wire,it's the wireaspect field of the drawer, but for a vertex, only the point aspect field is affected by the color).
|
||||
//! WARNING : Do not forget to set the corresponding fields here (hasOwnColor and myDrawer->SetColor())
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor);
|
||||
|
||||
//! Removes color settings. Only the Interactive Object
|
||||
//! knows which Drawer attribute is affected by the color
|
||||
//! setting. For a wire, for example, wire aspect is the
|
||||
//! attribute affected. For a vertex, however, only point
|
||||
//! aspect is affected by the color setting.
|
||||
Standard_EXPORT virtual void UnsetColor();
|
||||
|
||||
//! Allows you to provide the setting aValue for width.
|
||||
//! Only the Interactive Object knows which Drawer
|
||||
//! attribute is affected by the width setting.
|
||||
Standard_EXPORT virtual void SetWidth (const Standard_Real aValue);
|
||||
|
||||
Standard_EXPORT virtual void UnsetWidth();
|
||||
|
||||
//! Returns true if the class of objects accepts the display mode aMode.
|
||||
//! The interactive context can have a default mode of
|
||||
//! representation for the set of Interactive Objects. This
|
||||
//! mode may not be accepted by a given class of
|
||||
//! objects. Consequently, this virtual method allowing us
|
||||
//! to get information about the class in question must be implemented.
|
||||
Standard_EXPORT virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const;
|
||||
|
||||
//! Returns the default display mode. This method is to
|
||||
//! be implemented when the main mode is not mode 0.
|
||||
Standard_EXPORT virtual Standard_Integer DefaultDisplayMode() const;
|
||||
//! - Point signature 1
|
||||
//! - Axis signature 2
|
||||
//! - Trihedron signature 3
|
||||
//! - PlaneTrihedron signature 4
|
||||
//! - Line signature 5
|
||||
//! - Circle signature 6
|
||||
//! - Plane signature 7.
|
||||
virtual Standard_Integer Signature() const { return -1; }
|
||||
|
||||
//! Updates the active presentation; if <AllModes> = Standard_True
|
||||
//! all the presentations inside are recomputed.
|
||||
@@ -158,33 +67,20 @@ public:
|
||||
//! is accessible. This method just redirects call to myCTXPtr,
|
||||
//! so this class field must be up to date for proper result.
|
||||
Standard_EXPORT void Redisplay (const Standard_Boolean AllModes = Standard_False);
|
||||
|
||||
//! Sets the infinite state flag aFlage.
|
||||
//! if <aFlag> = True , the interactiveObject is
|
||||
//! considered as infinite, i.e. its graphic presentations
|
||||
//! are not taken in account for View FitAll...
|
||||
Standard_EXPORT void SetInfiniteState (const Standard_Boolean aFlag = Standard_True);
|
||||
|
||||
//! Returns true if the interactive object is infinite. In this
|
||||
//! case, its graphic presentations are not taken into
|
||||
//! account in the fit-all view.
|
||||
Standard_Boolean IsInfinite() const { return myInfiniteState; }
|
||||
|
||||
//! Indicates whether the Interactive Object has a pointer to an interactive context.
|
||||
Standard_Boolean HasInteractiveContext() const { return myCTXPtr != NULL; }
|
||||
|
||||
//! Returns the context pointer to the interactive context.
|
||||
Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
|
||||
AIS_InteractiveContext* InteractiveContext() const { return myCTXPtr; }
|
||||
|
||||
//! Sets the interactive context aCtx and provides a link
|
||||
//! to the default drawing tool or "Drawer" if there is none.
|
||||
Standard_EXPORT virtual void SetContext (const Handle(AIS_InteractiveContext)& aCtx);
|
||||
|
||||
//! Returns true if the object has an owner attributed to it.
|
||||
//! The owner can be a shape for a set of sub-shapes or
|
||||
//! a sub-shape for sub-shapes which it is composed of,
|
||||
//! and takes the form of a transient.
|
||||
Standard_EXPORT Standard_Boolean HasOwner() const;
|
||||
//! The owner can be a shape for a set of sub-shapes or a sub-shape for sub-shapes which it is composed of, and takes the form of a transient.
|
||||
Standard_Boolean HasOwner() const { return !myOwner.IsNull(); }
|
||||
|
||||
//! Returns the owner of the Interactive Object.
|
||||
//! The owner can be a shape for a set of sub-shapes or
|
||||
@@ -203,198 +99,24 @@ public:
|
||||
//! is composed of. The owner takes the form of a transient.
|
||||
void SetOwner (const Handle(Standard_Transient)& theApplicativeEntity) { myOwner = theApplicativeEntity; }
|
||||
|
||||
//! Each Interactive Object has methods which allow us
|
||||
//! to attribute an Owner to it in the form of a Transient.
|
||||
//! Each Interactive Object has methods which allow us to attribute an Owner to it in the form of a Transient.
|
||||
//! This method removes the owner from the graphic entity.
|
||||
Standard_EXPORT void ClearOwner();
|
||||
void ClearOwner() { myOwner.Nullify(); }
|
||||
|
||||
//! Returns true if the Interactive Object has a display
|
||||
//! mode setting. Otherwise, it is displayed in Neutral Point.
|
||||
Standard_Boolean HasDisplayMode() const { return myDrawer->DisplayMode() != -1; }
|
||||
public:
|
||||
|
||||
//! Sets the display mode aMode for the interactive object.
|
||||
//! An object can have its own temporary display mode,
|
||||
//! which is different from that proposed by the interactive context.
|
||||
//! The range of possibilities currently proposed is the following:
|
||||
//! - AIS_WireFrame
|
||||
//! - AIS_Shaded
|
||||
//! This range can, however, be extended through the creation of new display modes.
|
||||
Standard_EXPORT void SetDisplayMode (const Standard_Integer aMode);
|
||||
//! Returns the context pointer to the interactive context.
|
||||
Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
|
||||
|
||||
//! Removes display mode settings from the interactive object.
|
||||
void UnsetDisplayMode() { myDrawer->SetDisplayMode (-1); }
|
||||
|
||||
//! Returns the display mode setting of the Interactive Object.
|
||||
//! The range of possibilities is the following:
|
||||
//! - AIS_WireFrame
|
||||
//! - AIS_Shaded
|
||||
//! This range can, however, be extended through the
|
||||
//! creation of new display modes.
|
||||
Standard_Integer DisplayMode() const { return myDrawer->DisplayMode(); }
|
||||
|
||||
//! Returns true if the Interactive Object is in highlight mode.
|
||||
Standard_Boolean HasHilightMode() const { return !myHilightDrawer.IsNull() && myHilightDrawer->DisplayMode() != -1; }
|
||||
|
||||
//! Returns highlight display mode.
|
||||
//! This is obsolete method for backward compatibility - use ::HilightAttributes() and ::DynamicHilightAttributes() instead.
|
||||
Standard_Integer HilightMode() const { return !myHilightDrawer.IsNull() ? myHilightDrawer->DisplayMode() : -1; }
|
||||
|
||||
//! Sets highlight display mode.
|
||||
//! This is obsolete method for backward compatibility - use ::HilightAttributes() and ::DynamicHilightAttributes() instead.
|
||||
void SetHilightMode (const Standard_Integer theMode)
|
||||
{
|
||||
if (myHilightDrawer.IsNull())
|
||||
{
|
||||
myHilightDrawer = new Prs3d_Drawer();
|
||||
myHilightDrawer->Link (myDrawer);
|
||||
myHilightDrawer->SetAutoTriangulation (Standard_False);
|
||||
myHilightDrawer->SetColor (Quantity_NOC_GRAY80);
|
||||
myHilightDrawer->SetZLayer(Graphic3d_ZLayerId_UNKNOWN);
|
||||
}
|
||||
if (myDynHilightDrawer.IsNull())
|
||||
{
|
||||
myDynHilightDrawer = new Prs3d_Drawer();
|
||||
myDynHilightDrawer->Link (myDrawer);
|
||||
myDynHilightDrawer->SetColor (Quantity_NOC_CYAN1);
|
||||
myDynHilightDrawer->SetAutoTriangulation (Standard_False);
|
||||
myDynHilightDrawer->SetZLayer(Graphic3d_ZLayerId_Top);
|
||||
}
|
||||
myHilightDrawer ->SetDisplayMode (theMode);
|
||||
myDynHilightDrawer->SetDisplayMode (theMode);
|
||||
}
|
||||
|
||||
//! Unsets highlight display mode.
|
||||
void UnsetHilightMode()
|
||||
{
|
||||
if (!myHilightDrawer.IsNull())
|
||||
{
|
||||
myHilightDrawer->SetDisplayMode (-1);
|
||||
}
|
||||
if (!myDynHilightDrawer.IsNull())
|
||||
{
|
||||
myDynHilightDrawer->SetDisplayMode (-1);
|
||||
}
|
||||
}
|
||||
|
||||
//! Returns true if the Interactive Object has color.
|
||||
Standard_Boolean HasColor() const { return hasOwnColor; }
|
||||
|
||||
//! Returns the color setting of the Interactive Object.
|
||||
virtual void Color (Quantity_Color& theColor) const { theColor = myDrawer->Color(); }
|
||||
|
||||
//! Returns true if the Interactive Object has width.
|
||||
Standard_Boolean HasWidth() const { return myOwnWidth != 0.0; }
|
||||
|
||||
//! Returns the width setting of the Interactive Object.
|
||||
Standard_Real Width() const { return myOwnWidth; }
|
||||
|
||||
//! Returns true if the Interactive Object has a setting for material.
|
||||
Standard_Boolean HasMaterial() const { return hasOwnMaterial; }
|
||||
|
||||
//! Returns the current material setting.
|
||||
//! This will be on of the following materials:
|
||||
//! - Brass
|
||||
//! - Bronze
|
||||
//! - Gold
|
||||
//! - Pewter
|
||||
//! - Silver
|
||||
//! - Stone.
|
||||
Standard_EXPORT virtual Graphic3d_NameOfMaterial Material() const;
|
||||
|
||||
//! Sets the material aMat defining this display attribute
|
||||
//! for the interactive object.
|
||||
//! Material aspect determines shading aspect, color and
|
||||
//! transparency of visible entities.
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& aName);
|
||||
|
||||
//! Removes the setting for material.
|
||||
Standard_EXPORT virtual void UnsetMaterial();
|
||||
|
||||
//! Attributes a setting aValue for transparency.
|
||||
//! The transparency value should be between 0.0 and 1.0.
|
||||
//! At 0.0 an object will be totally opaque, and at 1.0, fully transparent.
|
||||
//! Warning At a value of 1.0, there may be nothing visible.
|
||||
Standard_EXPORT virtual void SetTransparency (const Standard_Real aValue = 0.6);
|
||||
|
||||
//! Returns true if there is a transparency setting.
|
||||
Standard_Boolean IsTransparent() const { return myDrawer->Transparency() > 0.005f; }
|
||||
|
||||
//! Returns the transparency setting.
|
||||
//! This will be between 0.0 and 1.0.
|
||||
//! At 0.0 an object will be totally opaque, and at 1.0, fully transparent.
|
||||
Standard_EXPORT virtual Standard_Real Transparency() const;
|
||||
|
||||
//! Removes the transparency setting. The object is opaque by default.
|
||||
Standard_EXPORT virtual void UnsetTransparency();
|
||||
|
||||
//! Clears settings provided by the drawing tool aDrawer.
|
||||
Standard_EXPORT virtual void UnsetAttributes() Standard_OVERRIDE;
|
||||
|
||||
//! Returns TRUE when this object has a presentation
|
||||
//! in the current DisplayMode()
|
||||
//! Returns TRUE when this object has a presentation in the current DisplayMode()
|
||||
Standard_EXPORT Standard_Boolean HasPresentation() const;
|
||||
|
||||
//! Returns the current presentation of this object
|
||||
//! according to the current DisplayMode()
|
||||
|
||||
//! Returns the current presentation of this object according to the current DisplayMode()
|
||||
Standard_EXPORT Handle(Prs3d_Presentation) Presentation() const;
|
||||
|
||||
//! Sets the graphic basic aspect to the current presentation.
|
||||
Standard_DEPRECATED("Deprecated method, results might be undefined")
|
||||
Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect);
|
||||
|
||||
//! Sets up polygon offsets for this object.
|
||||
//! It modifies all existing presentations of <anObj> (if any),
|
||||
//! so it is reasonable to call this method after <anObj> has been displayed.
|
||||
//! Otherwise, Compute() method should pass Graphic3d_AspectFillArea3d
|
||||
//! aspect from <myDrawer> to Graphic3d_Group to make polygon offsets work.
|
||||
//!
|
||||
//! <aMode> parameter can contain various combinations of
|
||||
//! Aspect_PolygonOffsetMode enumeration elements (Aspect_POM_None means
|
||||
//! that polygon offsets are not changed).
|
||||
//! If <aMode> is different from Aspect_POM_Off and Aspect_POM_None, then <aFactor> and <aUnits>
|
||||
//! arguments are used by graphic renderer to calculate a depth offset value:
|
||||
//!
|
||||
//! offset = <aFactor> * m + <aUnits> * r, where
|
||||
//! m - maximum depth slope for the polygon currently being displayed,
|
||||
//! r - minimum window coordinates depth resolution (implementation-specific).
|
||||
//!
|
||||
//! Deafult settings for OCC 3D viewer: mode = Aspect_POM_Fill, factor = 1., units = 0.
|
||||
//!
|
||||
//! Negative offset values move polygons closer to the viewport,
|
||||
//! while positive values shift polygons away.
|
||||
//! Consult OpenGL reference for details (glPolygonOffset function description).
|
||||
//!
|
||||
//! NOTE: This method has a side effect - it creates own shading aspect
|
||||
//! if not yet created, so it is better to set up object material,
|
||||
//! color, etc. first.
|
||||
Standard_EXPORT virtual void SetPolygonOffsets (const Standard_Integer aMode, const Standard_ShortReal aFactor = 1.0, const Standard_ShortReal aUnits = 0.0);
|
||||
|
||||
//! Returns Standard_True if <myDrawer> has non-null shading aspect
|
||||
Standard_EXPORT virtual Standard_Boolean HasPolygonOffsets() const;
|
||||
|
||||
//! Retrieves current polygon offsets settings from <myDrawer>.
|
||||
Standard_EXPORT virtual void PolygonOffsets (Standard_Integer& aMode, Standard_ShortReal& aFactor, Standard_ShortReal& aUnits) const;
|
||||
|
||||
//! Returns bounding box of object correspondingly to its current display mode.
|
||||
Standard_EXPORT virtual void BoundingBox (Bnd_Box& theBndBox) Standard_OVERRIDE;
|
||||
|
||||
//! Enables or disables on-triangulation build of isolines according to the flag given.
|
||||
Standard_EXPORT void SetIsoOnTriangulation (const Standard_Boolean theIsEnabled);
|
||||
|
||||
//! Synchronize presentation aspects after their modification.
|
||||
//!
|
||||
//! This method should be called after modifying primitive aspect properties (material, texture, shader)
|
||||
//! so that modifications will take effect on already computed presentation groups (thus avoiding re-displaying the object).
|
||||
Standard_EXPORT void SynchronizeAspects();
|
||||
|
||||
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:
|
||||
|
||||
@@ -402,20 +124,10 @@ protected:
|
||||
//! may have a presentation dependant of the view of Display.
|
||||
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
||||
|
||||
private:
|
||||
|
||||
AIS_InteractiveContext* myCTXPtr;
|
||||
Handle(Standard_Transient) myOwner;
|
||||
|
||||
protected:
|
||||
|
||||
TColStd_ListOfInteger myToRecomputeModes;
|
||||
Standard_Real myOwnWidth;
|
||||
Aspect_TypeOfFacingModel myCurrentFacingModel;
|
||||
Standard_Boolean myInfiniteState;
|
||||
Standard_Boolean hasOwnColor;
|
||||
Standard_Boolean hasOwnMaterial;
|
||||
Standard_Boolean myRecomputeEveryPrs;
|
||||
AIS_InteractiveContext* myCTXPtr; //!< pointer to Interactive Context, where object is currently displayed; @sa SetContext()
|
||||
Handle(Standard_Transient) myOwner; //!< application-specific owner object
|
||||
|
||||
};
|
||||
|
||||
|
@@ -18,37 +18,13 @@
|
||||
#include <AIS_Dimension.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
class TopoDS_Face;
|
||||
class TCollection_ExtendedString;
|
||||
class gp_Pnt;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Shape;
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class SelectMgr_Selection;
|
||||
class Bnd_Box;
|
||||
class gp_Dir;
|
||||
class TopoDS_Vertex;
|
||||
class Standard_Transient;
|
||||
class AIS_LengthDimension;
|
||||
|
||||
DEFINE_STANDARD_HANDLE (AIS_LengthDimension, AIS_Dimension)
|
||||
|
||||
|
@@ -41,52 +41,6 @@
|
||||
|
||||
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
|
||||
//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)
|
||||
{
|
||||
// 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
|
||||
//purpose :
|
||||
@@ -165,10 +141,15 @@ void AIS_Line::SetColor(const Quantity_Color &aCol)
|
||||
myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
||||
|
||||
if (!myDrawer->HasOwnLineAspect ())
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
||||
if (!myDrawer->HasOwnLineAspect())
|
||||
{
|
||||
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
|
||||
}
|
||||
else
|
||||
myDrawer->LineAspect()->SetColor(aCol);
|
||||
{
|
||||
myDrawer->LineAspect()->SetColor (aCol);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,16 +161,19 @@ void AIS_Line::UnsetColor()
|
||||
{
|
||||
hasOwnColor = Standard_False;
|
||||
|
||||
Handle(Prs3d_LineAspect) NullAsp;
|
||||
|
||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
if (!HasWidth())
|
||||
{
|
||||
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
|
||||
}
|
||||
else
|
||||
{
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if( HasColor() ) CC = myDrawer->Color();
|
||||
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->LineAspect()->SetColor(CC);
|
||||
myDrawer->SetColor (CC);
|
||||
}
|
||||
SynchronizeAspects();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -198,15 +182,20 @@ void AIS_Line::UnsetColor()
|
||||
//=======================================================================
|
||||
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;
|
||||
if( HasColor() ) CC = myDrawer->Color();
|
||||
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
|
||||
} else
|
||||
myDrawer->LineAspect()->SetWidth(aValue);
|
||||
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->LineAspect()->SetWidth (aValue);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -216,14 +205,16 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
|
||||
//=======================================================================
|
||||
void AIS_Line::UnsetWidth()
|
||||
{
|
||||
Handle(Prs3d_LineAspect) NullAsp;
|
||||
|
||||
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Standard_Real WW = myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
||||
myDrawer->LineAspect()->SetWidth(WW);
|
||||
if (!HasColor())
|
||||
{
|
||||
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.0f;
|
||||
myDrawer->LineAspect()->SetWidth (WW);
|
||||
myOwnWidth = WW;
|
||||
SynchronizeAspects();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -107,6 +107,9 @@ private:
|
||||
|
||||
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:
|
||||
|
||||
Handle(Geom_Line) myComponent;
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_ToolDisk.hxx>
|
||||
#include <Prs3d_ToolSector.hxx>
|
||||
#include <Prs3d_ToolSphere.hxx>
|
||||
#include <Select3D_SensitiveCircle.hxx>
|
||||
#include <Select3D_SensitivePoint.hxx>
|
||||
@@ -151,6 +152,19 @@ void AIS_Manipulator::init()
|
||||
myHighlightAspect->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
myHighlightAspect->SetMaterial (aHilightMaterial);
|
||||
|
||||
Graphic3d_MaterialAspect aDraggerMaterial;
|
||||
aDraggerMaterial.SetReflectionModeOff(Graphic3d_TOR_DIFFUSE);
|
||||
aDraggerMaterial.SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
|
||||
aDraggerMaterial.SetReflectionModeOff(Graphic3d_TOR_EMISSION);
|
||||
aDraggerMaterial.SetMaterialType(Graphic3d_MATERIAL_ASPECT);
|
||||
aDraggerMaterial.SetAmbient(1.0);
|
||||
|
||||
myDraggerHighlight = new Prs3d_ShadingAspect();
|
||||
myDraggerHighlight->Aspect()->SetInteriorStyle(Aspect_IS_SOLID);
|
||||
myDraggerHighlight->SetMaterial(aDraggerMaterial);
|
||||
|
||||
myDraggerHighlight->SetTransparency(0.5);
|
||||
|
||||
SetSize (100);
|
||||
SetZLayer (Graphic3d_ZLayerId_Topmost);
|
||||
}
|
||||
@@ -170,10 +184,11 @@ Handle(Prs3d_Presentation) AIS_Manipulator::getHighlightPresentation (const Hand
|
||||
|
||||
switch (anOwner->Mode())
|
||||
{
|
||||
case AIS_MM_Translation: return myAxes[anOwner->Index()].TranslatorHighlightPrs();
|
||||
case AIS_MM_Rotation : return myAxes[anOwner->Index()].RotatorHighlightPrs();
|
||||
case AIS_MM_Scaling : return myAxes[anOwner->Index()].ScalerHighlightPrs();
|
||||
case AIS_MM_None : break;
|
||||
case AIS_MM_Translation : return myAxes[anOwner->Index()].TranslatorHighlightPrs();
|
||||
case AIS_MM_Rotation : return myAxes[anOwner->Index()].RotatorHighlightPrs();
|
||||
case AIS_MM_Scaling : return myAxes[anOwner->Index()].ScalerHighlightPrs();
|
||||
case AIS_MM_TranslationPlane: return myAxes[anOwner->Index()].DraggerHighlightPrs();
|
||||
case AIS_MM_None : break;
|
||||
}
|
||||
|
||||
return aDummyPrs;
|
||||
@@ -194,10 +209,11 @@ Handle(Graphic3d_Group) AIS_Manipulator::getGroup (const Standard_Integer theInd
|
||||
|
||||
switch (theMode)
|
||||
{
|
||||
case AIS_MM_Translation: return myAxes[theIndex].TranslatorGroup();
|
||||
case AIS_MM_Rotation : return myAxes[theIndex].RotatorGroup();
|
||||
case AIS_MM_Scaling : return myAxes[theIndex].ScalerGroup();
|
||||
case AIS_MM_None : break;
|
||||
case AIS_MM_Translation : return myAxes[theIndex].TranslatorGroup();
|
||||
case AIS_MM_Rotation : return myAxes[theIndex].RotatorGroup();
|
||||
case AIS_MM_Scaling : return myAxes[theIndex].ScalerGroup();
|
||||
case AIS_MM_TranslationPlane: return myAxes[theIndex].DraggerGroup();
|
||||
case AIS_MM_None : break;
|
||||
}
|
||||
|
||||
return aDummyGroup;
|
||||
@@ -266,6 +282,10 @@ void AIS_Manipulator::SetPart (const Standard_Integer theAxisIndex, const AIS_Ma
|
||||
myAxes[theAxisIndex].SetScaling (theIsEnabled);
|
||||
break;
|
||||
|
||||
case AIS_MM_TranslationPlane:
|
||||
myAxes[theAxisIndex].SetDragging(theIsEnabled);
|
||||
break;
|
||||
|
||||
case AIS_MM_None:
|
||||
break;
|
||||
}
|
||||
@@ -400,6 +420,7 @@ void AIS_Manipulator::Attach (const Handle(AIS_ManipulatorObjectSequence)& theOb
|
||||
EnableMode (AIS_MM_Rotation);
|
||||
EnableMode (AIS_MM_Translation);
|
||||
EnableMode (AIS_MM_Scaling);
|
||||
EnableMode (AIS_MM_TranslationPlane);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,6 +514,7 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
const gp_Lin aLine (myStartPosition.Location(), myAxes[myCurrentIndex].Position().Direction());
|
||||
Extrema_ExtElC anExtrema (anInputLine, aLine, Precision::Angular());
|
||||
if (!anExtrema.IsDone()
|
||||
|| anExtrema.IsParallel()
|
||||
|| anExtrema.NbExt() != 1)
|
||||
{
|
||||
// translation cannot be done co-directed with camera
|
||||
@@ -538,7 +560,9 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
const gp_Pnt aPosLoc = myStartPosition.Location();
|
||||
const gp_Ax1 aCurrAxis = getAx1FromAx2Dir (myStartPosition, myCurrentIndex);
|
||||
IntAna_IntConicQuad aIntersector (anInputLine, gp_Pln (aPosLoc, aCurrAxis.Direction()), Precision::Angular(), Precision::Intersection());
|
||||
if (!aIntersector.IsDone() || aIntersector.NbPoints() < 1)
|
||||
if (!aIntersector.IsDone()
|
||||
|| aIntersector.IsParallel()
|
||||
|| aIntersector.NbPoints() < 1)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
@@ -583,6 +607,34 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
|
||||
myPrevState = anAngle;
|
||||
return Standard_True;
|
||||
}
|
||||
case AIS_MM_TranslationPlane:
|
||||
{
|
||||
const gp_Pnt aPosLoc = myStartPosition.Location();
|
||||
const gp_Ax1 aCurrAxis = getAx1FromAx2Dir(myStartPosition, myCurrentIndex);
|
||||
IntAna_IntConicQuad aIntersector(anInputLine, gp_Pln(aPosLoc, aCurrAxis.Direction()), Precision::Angular(), Precision::Intersection());
|
||||
if (!aIntersector.IsDone() || aIntersector.NbPoints() < 1)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
const gp_Pnt aNewPosition = aIntersector.Point(1);
|
||||
if (!myHasStartedTransformation)
|
||||
{
|
||||
myStartPick = aNewPosition;
|
||||
myHasStartedTransformation = Standard_True;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
if (aNewPosition.Distance(myStartPick) < Precision::Confusion())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
gp_Trsf aNewTrsf;
|
||||
aNewTrsf.SetTranslation(gp_Vec(myStartPick, aNewPosition));
|
||||
theTrsf *= aNewTrsf;
|
||||
return Standard_True;
|
||||
}
|
||||
case AIS_MM_None:
|
||||
{
|
||||
return Standard_False;
|
||||
@@ -650,12 +702,26 @@ void AIS_Manipulator::Transform (const gp_Trsf& theTrsf)
|
||||
NCollection_Sequence<gp_Trsf>::Iterator aTrsfIter (myStartTrsfs);
|
||||
for (; anObjIter.More(); anObjIter.Next(), aTrsfIter.Next())
|
||||
{
|
||||
anObjIter.ChangeValue()->SetLocalTransformation (theTrsf * aTrsfIter.Value());
|
||||
const Handle(AIS_InteractiveObject)& anObj = anObjIter.ChangeValue();
|
||||
const gp_Trsf& anOldTrsf = aTrsfIter.Value();
|
||||
const Handle(Geom_Transformation)& aParentTrsf = anObj->CombinedParentTransformation();
|
||||
if (!aParentTrsf.IsNull()
|
||||
&& aParentTrsf->Form() != gp_Identity)
|
||||
{
|
||||
// recompute local transformation relative to parent transformation
|
||||
const gp_Trsf aNewLocalTrsf = aParentTrsf->Trsf().Inverted() * theTrsf * aParentTrsf->Trsf() * anOldTrsf;
|
||||
anObj->SetLocalTransformation (aNewLocalTrsf);
|
||||
}
|
||||
else
|
||||
{
|
||||
anObj->SetLocalTransformation (theTrsf * anOldTrsf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((myCurrentMode == AIS_MM_Translation && myBehaviorOnTransform.FollowTranslation)
|
||||
|| (myCurrentMode == AIS_MM_Rotation && myBehaviorOnTransform.FollowRotation))
|
||||
if ((myCurrentMode == AIS_MM_Translation && myBehaviorOnTransform.FollowTranslation)
|
||||
|| (myCurrentMode == AIS_MM_Rotation && myBehaviorOnTransform.FollowRotation)
|
||||
|| (myCurrentMode == AIS_MM_TranslationPlane && myBehaviorOnTransform.FollowDragging))
|
||||
{
|
||||
gp_Pnt aPos = myStartPosition.Location().Transformed (theTrsf);
|
||||
gp_Dir aVDir = myStartPosition.Direction().Transformed (theTrsf);
|
||||
@@ -783,8 +849,13 @@ void AIS_Manipulator::DeactivateCurrentMode()
|
||||
Handle(Prs3d_ShadingAspect) anAspect = new Prs3d_ShadingAspect();
|
||||
anAspect->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
anAspect->SetMaterial (myDrawer->ShadingAspect()->Material());
|
||||
anAspect->SetTransparency (myDrawer->ShadingAspect()->Transparency());
|
||||
anAspect->SetColor (myAxes[myCurrentIndex].Color());
|
||||
if (myCurrentMode == AIS_MM_TranslationPlane)
|
||||
anAspect->SetTransparency(1.0);
|
||||
else
|
||||
{
|
||||
anAspect->SetTransparency(myDrawer->ShadingAspect()->Transparency());
|
||||
anAspect->SetColor(myAxes[myCurrentIndex].Color());
|
||||
}
|
||||
|
||||
aGroup->SetGroupPrimitivesAspect (anAspect->Aspect());
|
||||
}
|
||||
@@ -879,14 +950,14 @@ void AIS_Manipulator::Compute (const Handle(PrsMgr_PresentationManager3d)& thePr
|
||||
|
||||
// Display center
|
||||
myCenter.Init (myAxes[0].AxisRadius() * 2.0f, gp::Origin());
|
||||
aGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
aGroup = thePrs->NewGroup ();
|
||||
aGroup->SetPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (myCenter.Array());
|
||||
|
||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||
{
|
||||
// Display axes
|
||||
aGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
aGroup = thePrs->NewGroup ();
|
||||
|
||||
Handle(Prs3d_ShadingAspect) anAspectAx = new Prs3d_ShadingAspect (new Graphic3d_AspectFillArea3d(*anAspect->Aspect()));
|
||||
anAspectAx->SetColor (myAxes[anIt].Color());
|
||||
@@ -929,7 +1000,13 @@ void AIS_Manipulator::HilightSelected (const Handle(PrsMgr_PresentationManager3d
|
||||
return;
|
||||
}
|
||||
|
||||
aGroup->SetGroupPrimitivesAspect (myHighlightAspect->Aspect());
|
||||
if (anOwner->Mode() == AIS_MM_TranslationPlane)
|
||||
{
|
||||
myDraggerHighlight->SetColor(myAxes[anOwner->Index()].Color());
|
||||
aGroup->SetGroupPrimitivesAspect(myDraggerHighlight->Aspect());
|
||||
}
|
||||
else
|
||||
aGroup->SetGroupPrimitivesAspect(myHighlightAspect->Aspect());
|
||||
|
||||
myCurrentIndex = anOwner->Index();
|
||||
myCurrentMode = anOwner->Mode();
|
||||
@@ -958,13 +1035,20 @@ void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationMan
|
||||
{
|
||||
return;
|
||||
}
|
||||
aPresentation->Highlight (theStyle);
|
||||
if (anOwner->Mode() == AIS_MM_TranslationPlane)
|
||||
{
|
||||
Handle(Prs3d_Drawer) aStyle = new Prs3d_Drawer();
|
||||
aStyle->SetColor(myAxes[anOwner->Index()].Color());
|
||||
aStyle->SetTransparency(0.5);
|
||||
aPresentation->Highlight(aStyle);
|
||||
}
|
||||
else
|
||||
aPresentation->Highlight(theStyle);
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPresentation->Groups());
|
||||
aGroupIter.More(); aGroupIter.Next())
|
||||
{
|
||||
Handle(Graphic3d_Group)& aGrp = aGroupIter.ChangeValue();
|
||||
if (!aGrp.IsNull()
|
||||
&& aGrp->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
if (!aGrp.IsNull())
|
||||
{
|
||||
aGrp->SetGroupPrimitivesAspect (myHighlightAspect->Aspect());
|
||||
}
|
||||
@@ -1073,6 +1157,38 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
|
||||
theSelection->Add (aTri);
|
||||
}
|
||||
}
|
||||
|
||||
if (aMode == AIS_MM_TranslationPlane || aMode == AIS_MM_None)
|
||||
{
|
||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||
{
|
||||
if (!myAxes[anIt].HasDragging())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (aMode != AIS_MM_None)
|
||||
{
|
||||
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
|
||||
}
|
||||
|
||||
// define sensitivity by two crossed lines
|
||||
gp_Pnt aP1, aP2;
|
||||
aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition();
|
||||
aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition();
|
||||
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
|
||||
|
||||
Handle(Select3D_SensitiveSegment) aLine1 = new Select3D_SensitiveSegment(anOwner, aP1, aP2);
|
||||
aLine1->SetSensitivityFactor(10);
|
||||
theSelection->Add(aLine1);
|
||||
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, gp::Origin(), aMidP);
|
||||
aLine2->SetSensitivityFactor(10);
|
||||
theSelection->Add(aLine2);
|
||||
|
||||
// enlarge sensitivity by triangulation
|
||||
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].DraggerSector().Triangulation(), TopLoc_Location(), Standard_True);
|
||||
theSelection->Add(aTri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1188,6 +1304,24 @@ void AIS_Manipulator::Cube::addTriangle (const Standard_Integer theIndex,
|
||||
myArray->AddVertex (theP3, theNormal);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//class : Sector
|
||||
//function : Init
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Manipulator::Sector::Init (const Standard_ShortReal theRadius,
|
||||
const gp_Ax1& thePosition,
|
||||
const gp_Dir& theXDirection,
|
||||
const Standard_Integer theSlicesNb,
|
||||
const Standard_Integer theStacksNb)
|
||||
{
|
||||
Prs3d_ToolSector aTool(theRadius, theSlicesNb, theStacksNb);
|
||||
gp_Ax3 aSystem(thePosition.Location(), thePosition.Direction(), theXDirection);
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTransformation(aSystem, gp_Ax3());
|
||||
aTool.FillArray(myArray, myTriangulation, aTrsf);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//class : Axis
|
||||
//function : Constructor
|
||||
@@ -1208,6 +1342,7 @@ AIS_Manipulator::Axis::Axis (const gp_Ax1& theAxis,
|
||||
myInnerRadius (myLength + myBoxSize),
|
||||
myDiskThickness (myBoxSize * 0.5f),
|
||||
myIndent (0.2f),
|
||||
myHasDragging(Standard_True),
|
||||
myFacettesNumber (20),
|
||||
myCircleRadius (myLength + myBoxSize + myBoxSize * 0.5f * 0.5f)
|
||||
{
|
||||
@@ -1236,7 +1371,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myAxisRadius * 1.5,
|
||||
anArrowLength,
|
||||
myFacettesNumber);
|
||||
myTranslatorGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
myTranslatorGroup = thePrs->NewGroup ();
|
||||
myTranslatorGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
myTranslatorGroup->AddPrimitiveArray (myTriangleArray);
|
||||
|
||||
@@ -1260,7 +1395,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
myCubePos = myReferenceAxis.Direction().XYZ() * (myLength + myIndent);
|
||||
myCube.Init (gp_Ax1 (myCubePos, myReferenceAxis.Direction()), myBoxSize);
|
||||
|
||||
myScalerGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
myScalerGroup = thePrs->NewGroup ();
|
||||
myScalerGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
myScalerGroup->AddPrimitiveArray (myCube.Array());
|
||||
|
||||
@@ -1283,7 +1418,7 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
{
|
||||
myCircleRadius = myInnerRadius + myIndent * 2 + myDiskThickness * 0.5f;
|
||||
myCircle.Init (myInnerRadius + myIndent * 2, myInnerRadius + myDiskThickness + myIndent * 2, gp_Ax1(gp::Origin(), myReferenceAxis.Direction()), myFacettesNumber * 2);
|
||||
myRotatorGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
myRotatorGroup = thePrs->NewGroup ();
|
||||
myRotatorGroup->SetGroupPrimitivesAspect (theAspect->Aspect());
|
||||
myRotatorGroup->AddPrimitiveArray (myCircle.Array());
|
||||
|
||||
@@ -1301,4 +1436,36 @@ void AIS_Manipulator::Axis::Compute (const Handle(PrsMgr_PresentationManager)& t
|
||||
aGroup->AddPrimitiveArray (myCircle.Array());
|
||||
}
|
||||
}
|
||||
|
||||
if (myHasDragging)
|
||||
{
|
||||
gp_Dir aXDirection;
|
||||
if (myReferenceAxis.Direction().X() > 0)
|
||||
aXDirection = gp::DY();
|
||||
else if (myReferenceAxis.Direction().Y() > 0)
|
||||
aXDirection = gp::DZ();
|
||||
else
|
||||
aXDirection = gp::DX();
|
||||
|
||||
mySector.Init(myInnerRadius + myIndent * 2, gp_Ax1(gp::Origin(), myReferenceAxis.Direction()), aXDirection, myFacettesNumber * 2);
|
||||
myDraggerGroup = thePrs->NewGroup();
|
||||
|
||||
Handle(Graphic3d_AspectFillArea3d) aFillArea = new Graphic3d_AspectFillArea3d();
|
||||
myDraggerGroup->SetGroupPrimitivesAspect(aFillArea);
|
||||
myDraggerGroup->AddPrimitiveArray(mySector.Array());
|
||||
|
||||
if (myHighlightDragger.IsNull())
|
||||
{
|
||||
myHighlightDragger = new Prs3d_Presentation(thePrsMgr->StructureManager());
|
||||
}
|
||||
else
|
||||
{
|
||||
myHighlightDragger->Clear();
|
||||
}
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(myHighlightDragger);
|
||||
aGroup->SetGroupPrimitivesAspect(aFillArea);
|
||||
aGroup->AddPrimitiveArray(mySector.Array());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -280,12 +280,14 @@ public:
|
||||
//! - FollowRotation - whether the manipulator will be rotated together with an object.
|
||||
struct BehaviorOnTransform {
|
||||
|
||||
BehaviorOnTransform() : FollowTranslation (Standard_True), FollowRotation (Standard_True) {}
|
||||
BehaviorOnTransform() : FollowTranslation (Standard_True), FollowRotation (Standard_True), FollowDragging (Standard_True) {}
|
||||
BehaviorOnTransform& SetFollowTranslation (const Standard_Boolean theApply) { FollowTranslation = theApply; return *this; }
|
||||
BehaviorOnTransform& SetFollowRotation (const Standard_Boolean theApply) { FollowRotation = theApply; return *this; }
|
||||
BehaviorOnTransform& SetFollowDragging (const Standard_Boolean theApply) { FollowDragging = theApply; return *this; }
|
||||
|
||||
Standard_Boolean FollowTranslation;
|
||||
Standard_Boolean FollowRotation;
|
||||
Standard_Boolean FollowDragging;
|
||||
};
|
||||
|
||||
//! Sets behavior settings for transformation action carried on the manipulator,
|
||||
@@ -446,6 +448,29 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
Handle(Graphic3d_ArrayOfTriangles) myArray;
|
||||
};
|
||||
|
||||
class Sector : public Quadric
|
||||
{
|
||||
public:
|
||||
|
||||
Sector()
|
||||
: Quadric(),
|
||||
myRadius(0.0f)
|
||||
{ }
|
||||
|
||||
~Sector() { }
|
||||
|
||||
void Init(const Standard_ShortReal theRadius,
|
||||
const gp_Ax1& thePosition,
|
||||
const gp_Dir& theXDirection,
|
||||
const Standard_Integer theSlicesNb = 5,
|
||||
const Standard_Integer theStacksNb = 5);
|
||||
|
||||
protected:
|
||||
|
||||
gp_Ax1 myPosition;
|
||||
Standard_ShortReal myRadius;
|
||||
};
|
||||
|
||||
//! The class describes on axis sub-object.
|
||||
//! It includes sub-objects itself:
|
||||
//! -rotator
|
||||
@@ -485,6 +510,11 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
{
|
||||
myHighlightRotator->SetTransformPersistence (theTrsfPers);
|
||||
}
|
||||
|
||||
if (!myHighlightDragger.IsNull())
|
||||
{
|
||||
myHighlightDragger->SetTransformPersistence(theTrsfPers);
|
||||
}
|
||||
}
|
||||
|
||||
void Transform (const Handle(Geom_Transformation)& theTransformation)
|
||||
@@ -503,6 +533,11 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
{
|
||||
myHighlightRotator->SetTransformation (theTransformation);
|
||||
}
|
||||
|
||||
if (!myHighlightDragger.IsNull())
|
||||
{
|
||||
myHighlightDragger->SetTransformation(theTransformation);
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean HasTranslation() const { return myHasTranslation; }
|
||||
@@ -511,12 +546,16 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
|
||||
Standard_Boolean HasScaling() const { return myHasScaling; }
|
||||
|
||||
Standard_Boolean HasDragging() const { return myHasDragging; }
|
||||
|
||||
void SetTranslation (const Standard_Boolean theIsEnabled) { myHasTranslation = theIsEnabled; }
|
||||
|
||||
void SetRotation (const Standard_Boolean theIsEnabled) { myHasRotation = theIsEnabled; }
|
||||
|
||||
void SetScaling (const Standard_Boolean theIsEnabled) { myHasScaling = theIsEnabled; }
|
||||
|
||||
void SetDragging(const Standard_Boolean theIsEnabled) { myHasDragging = theIsEnabled; }
|
||||
|
||||
Quantity_Color Color() const { return myColor; }
|
||||
|
||||
Standard_ShortReal AxisLength() const { return myLength; }
|
||||
@@ -531,12 +570,16 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
|
||||
const Handle(Prs3d_Presentation)& ScalerHighlightPrs() const { return myHighlightScaler; }
|
||||
|
||||
const Handle(Prs3d_Presentation)& DraggerHighlightPrs() const { return myHighlightDragger; }
|
||||
|
||||
const Handle(Graphic3d_Group)& TranslatorGroup() const { return myTranslatorGroup; }
|
||||
|
||||
const Handle(Graphic3d_Group)& RotatorGroup() const { return myRotatorGroup; }
|
||||
|
||||
const Handle(Graphic3d_Group)& ScalerGroup() const { return myScalerGroup; }
|
||||
|
||||
const Handle(Graphic3d_Group)& DraggerGroup() const { return myDraggerGroup; }
|
||||
|
||||
const Handle(Graphic3d_ArrayOfTriangles)& TriangleArray() const { return myTriangleArray; }
|
||||
|
||||
void SetIndent (const Standard_ShortReal theValue) { myIndent = theValue; }
|
||||
@@ -570,6 +613,7 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
public:
|
||||
|
||||
const gp_Pnt& TranslatorTipPosition() const { return myArrowTipPos; }
|
||||
const Sector& DraggerSector() const { return mySector; }
|
||||
const Disk& RotatorDisk() const { return myCircle; }
|
||||
float RotatorDiskRadius() const { return myCircleRadius; }
|
||||
const Cube& ScalerCube() const { return myCube; }
|
||||
@@ -593,11 +637,14 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
Standard_ShortReal myDiskThickness;
|
||||
Standard_ShortReal myIndent; //!< Gap between visual part of the manipulator.
|
||||
|
||||
Standard_Boolean myHasDragging;
|
||||
|
||||
protected:
|
||||
|
||||
Standard_Integer myFacettesNumber;
|
||||
|
||||
gp_Pnt myArrowTipPos;
|
||||
Sector mySector;
|
||||
Disk myCircle;
|
||||
float myCircleRadius;
|
||||
Cube myCube;
|
||||
@@ -606,10 +653,12 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
Handle(Graphic3d_Group) myTranslatorGroup;
|
||||
Handle(Graphic3d_Group) myScalerGroup;
|
||||
Handle(Graphic3d_Group) myRotatorGroup;
|
||||
Handle(Graphic3d_Group) myDraggerGroup;
|
||||
|
||||
Handle(Prs3d_Presentation) myHighlightTranslator;
|
||||
Handle(Prs3d_Presentation) myHighlightScaler;
|
||||
Handle(Prs3d_Presentation) myHighlightRotator;
|
||||
Handle(Prs3d_Presentation) myHighlightDragger;
|
||||
|
||||
Handle(Graphic3d_ArrayOfTriangles) myTriangleArray;
|
||||
|
||||
@@ -638,6 +687,9 @@ protected: //! @name Fields for interactive transformation. Fields only for inte
|
||||
|
||||
//! Aspect used to color current detected part and current selected part.
|
||||
Handle(Prs3d_ShadingAspect) myHighlightAspect;
|
||||
|
||||
//! Aspect used to color sector part when it's selected.
|
||||
Handle(Prs3d_ShadingAspect) myDraggerHighlight;
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Manipulator, AIS_InteractiveObject)
|
||||
|
@@ -22,7 +22,8 @@ enum AIS_ManipulatorMode
|
||||
AIS_MM_None = 0,
|
||||
AIS_MM_Translation = 1,
|
||||
AIS_MM_Rotation,
|
||||
AIS_MM_Scaling
|
||||
AIS_MM_Scaling,
|
||||
AIS_MM_TranslationPlane
|
||||
};
|
||||
|
||||
#endif
|
@@ -17,38 +17,19 @@
|
||||
#ifndef _AIS_MaxRadiusDimension_HeaderFile
|
||||
#define _AIS_MaxRadiusDimension_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_EllipseRadiusDimension.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class Standard_ConstructionError;
|
||||
class TopoDS_Shape;
|
||||
class TCollection_ExtendedString;
|
||||
class gp_Pnt;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_MaxRadiusDimension;
|
||||
DEFINE_STANDARD_HANDLE(AIS_MaxRadiusDimension, AIS_EllipseRadiusDimension)
|
||||
|
||||
|
||||
//! Ellipse Max radius dimension of a Shape which can be Edge
|
||||
//! or Face (planar or cylindrical(surface of extrusion or
|
||||
//! surface of offset))
|
||||
class AIS_MaxRadiusDimension : public AIS_EllipseRadiusDimension
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_MaxRadiusDimension, AIS_EllipseRadiusDimension)
|
||||
public:
|
||||
|
||||
|
||||
//! Max Ellipse radius dimension
|
||||
//! Shape can be edge , planar face or cylindrical face
|
||||
Standard_EXPORT AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
|
||||
@@ -66,19 +47,8 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_MaxRadiusDimension,AIS_EllipseRadiusDimension)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -93,13 +63,6 @@ private:
|
||||
gp_Pnt myApexN;
|
||||
gp_Pnt myEndOfArrow;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_MaxRadiusDimension_HeaderFile
|
||||
|
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
|
@@ -16,37 +16,22 @@
|
||||
#ifndef _AIS_MidPointRelation_HeaderFile
|
||||
#define _AIS_MidPointRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class gp_Lin;
|
||||
class gp_Pnt;
|
||||
class gp_Circ;
|
||||
class gp_Elips;
|
||||
|
||||
|
||||
class AIS_MidPointRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_MidPointRelation, AIS_Relation)
|
||||
|
||||
//! presentation of equal distance to point myMidPoint
|
||||
class AIS_MidPointRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_MidPointRelation, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT AIS_MidPointRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
|
||||
|
||||
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
|
||||
@@ -64,19 +49,8 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_MidPointRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -118,14 +92,8 @@ private:
|
||||
gp_Pnt mySecondPnt1;
|
||||
gp_Pnt mySecondPnt2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_MidPointRelation.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_MidPointRelation_HeaderFile
|
||||
|
@@ -17,26 +17,9 @@
|
||||
#ifndef _AIS_MinRadiusDimension_HeaderFile
|
||||
#define _AIS_MinRadiusDimension_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_EllipseRadiusDimension.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class Standard_ConstructionError;
|
||||
class TopoDS_Shape;
|
||||
class TCollection_ExtendedString;
|
||||
class gp_Pnt;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_MinRadiusDimension;
|
||||
DEFINE_STANDARD_HANDLE(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension)
|
||||
|
||||
//! -- Ellipse Min radius dimension of a Shape which
|
||||
@@ -44,10 +27,9 @@ DEFINE_STANDARD_HANDLE(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension)
|
||||
//! extrusion or surface of offset))
|
||||
class AIS_MinRadiusDimension : public AIS_EllipseRadiusDimension
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension)
|
||||
public:
|
||||
|
||||
|
||||
//! Max Ellipse radius dimension
|
||||
//! Shape can be edge , planar face or cylindrical face
|
||||
Standard_EXPORT AIS_MinRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
|
||||
@@ -65,18 +47,7 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_MinRadiusDimension,AIS_EllipseRadiusDimension)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
@@ -92,13 +63,6 @@ private:
|
||||
gp_Pnt myApexN;
|
||||
gp_Pnt myEndOfArrow;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_MinRadiusDimension_HeaderFile
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <Select3D_SensitiveEntity.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
@@ -17,28 +17,9 @@
|
||||
#ifndef _AIS_OffsetDimension_HeaderFile
|
||||
#define _AIS_OffsetDimension_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TopoDS_Shape;
|
||||
class TCollection_ExtendedString;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class gp_Trsf;
|
||||
|
||||
|
||||
class AIS_OffsetDimension;
|
||||
DEFINE_STANDARD_HANDLE(AIS_OffsetDimension, AIS_Relation)
|
||||
|
||||
//! A framework to display dimensions of offsets.
|
||||
@@ -48,10 +29,9 @@ DEFINE_STANDARD_HANDLE(AIS_OffsetDimension, AIS_Relation)
|
||||
//! and the basis shape.
|
||||
class AIS_OffsetDimension : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_OffsetDimension, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! Constructs the offset display object defined by the
|
||||
//! first shape aFShape, the second shape aSShape, the
|
||||
//! dimension aVal, and the text aText.
|
||||
@@ -77,19 +57,8 @@ public:
|
||||
//! selection to a relative position.
|
||||
void SetRelativePos (const gp_Trsf& aTrsf);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_OffsetDimension,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -108,14 +77,8 @@ private:
|
||||
gp_Dir myDirAttach2;
|
||||
gp_Trsf myRelativePos;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_OffsetDimension.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_OffsetDimension_HeaderFile
|
||||
|
@@ -17,27 +17,9 @@
|
||||
#ifndef _AIS_ParallelRelation_HeaderFile
|
||||
#define _AIS_ParallelRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
class Geom_Plane;
|
||||
class gp_Pnt;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_ParallelRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_ParallelRelation, AIS_Relation)
|
||||
|
||||
//! A framework to display constraints of parallelism
|
||||
@@ -45,7 +27,7 @@ DEFINE_STANDARD_HANDLE(AIS_ParallelRelation, AIS_Relation)
|
||||
//! entities can be faces or edges.
|
||||
class AIS_ParallelRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ParallelRelation, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
@@ -73,19 +55,8 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ParallelRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -100,14 +71,8 @@ private:
|
||||
gp_Pnt mySAttach;
|
||||
gp_Dir myDirAttach;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_ParallelRelation.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_ParallelRelation_HeaderFile
|
||||
|
@@ -17,22 +17,8 @@
|
||||
#ifndef _AIS_PerpendicularRelation_HeaderFile
|
||||
#define _AIS_PerpendicularRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_PerpendicularRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_PerpendicularRelation, AIS_Relation)
|
||||
|
||||
//! A framework to display constraints of perpendicularity
|
||||
@@ -40,10 +26,9 @@ DEFINE_STANDARD_HANDLE(AIS_PerpendicularRelation, AIS_Relation)
|
||||
//! datums can be edges or faces.
|
||||
class AIS_PerpendicularRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_PerpendicularRelation, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! Constructs an object to display constraints of
|
||||
//! perpendicularity on shapes.
|
||||
//! This object is defined by a first shape aFShape, a
|
||||
@@ -68,16 +53,6 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_PerpendicularRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -94,13 +69,6 @@ private:
|
||||
gp_Pnt myFAttach;
|
||||
gp_Pnt mySAttach;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_PerpendicularRelation_HeaderFile
|
||||
|
@@ -387,7 +387,8 @@ void AIS_Plane::SetSize(const Standard_Real aXLength,
|
||||
|
||||
|
||||
myHasOwnSize = Standard_True;
|
||||
Update();
|
||||
SetToUpdate();
|
||||
UpdatePresentations();
|
||||
UpdateSelection();
|
||||
}
|
||||
|
||||
@@ -418,7 +419,8 @@ void AIS_Plane::UnsetSize()
|
||||
}
|
||||
|
||||
myHasOwnSize = Standard_False;
|
||||
Update();
|
||||
SetToUpdate();
|
||||
UpdatePresentations();
|
||||
UpdateSelection();
|
||||
|
||||
}
|
||||
|
@@ -248,6 +248,7 @@ void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
|
||||
myDrawer->SetColor (aCol);
|
||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->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; }
|
||||
|
||||
//! 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; }
|
||||
|
||||
|
@@ -205,6 +205,29 @@ void AIS_Point::UnsetMarker()
|
||||
|| 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
|
||||
//purpose :
|
||||
@@ -212,12 +235,14 @@ void AIS_Point::UnsetMarker()
|
||||
|
||||
void AIS_Point::UpdatePointValues()
|
||||
{
|
||||
|
||||
if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM)
|
||||
if (!hasOwnColor
|
||||
&& myOwnWidth == 0.0f
|
||||
&& !myHasTOM)
|
||||
{
|
||||
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
|
||||
replaceWithNewPointAspect (Handle(Prs3d_PointAspect)());
|
||||
return;
|
||||
}
|
||||
|
||||
Quantity_Color aCol (Quantity_NOC_YELLOW);
|
||||
Aspect_TypeOfMarker aTOM = Aspect_TOM_PLUS;
|
||||
Standard_Real aScale = 1.0;
|
||||
@@ -229,20 +254,20 @@ void AIS_Point::UpdatePointValues()
|
||||
}
|
||||
|
||||
if(hasOwnColor) aCol = myDrawer->Color();
|
||||
if(myOwnWidth!=0.0) aScale = myOwnWidth;
|
||||
if(myOwnWidth != 0.0f) aScale = myOwnWidth;
|
||||
if(myHasTOM) aTOM = myTOM;
|
||||
|
||||
|
||||
if(myDrawer->HasOwnPointAspect()){
|
||||
// CLE
|
||||
// const Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
||||
|
||||
if(myDrawer->HasOwnPointAspect())
|
||||
{
|
||||
Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
||||
// ENDCLE
|
||||
PA->SetColor(aCol);
|
||||
PA->SetTypeOfMarker(aTOM);
|
||||
PA->SetScale(aScale);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
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;
|
||||
|
||||
//! 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.
|
||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
|
||||
|
||||
//! Allows you to provide settings for a marker. These include
|
||||
//! - type of marker,
|
||||
@@ -91,6 +91,9 @@ private:
|
||||
|
||||
Standard_EXPORT void UpdatePointValues();
|
||||
|
||||
//! Replace aspects of already computed groups with the new value.
|
||||
void replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect);
|
||||
|
||||
private:
|
||||
|
||||
Handle(Geom_Point) myComponent;
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <PrsMgr_Presentations.hxx>
|
||||
#include <Select3D_SensitiveBox.hxx>
|
||||
#include <Select3D_SensitivePrimitiveArray.hxx>
|
||||
@@ -173,8 +172,8 @@ void AIS_PointCloudOwner::Clear (const Handle(PrsMgr_PresentationManager)& thePr
|
||||
//==================================================
|
||||
AIS_PointCloud::AIS_PointCloud()
|
||||
{
|
||||
// override default point style to Aspect_TOM_POINT
|
||||
myDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_YELLOW, 1.0));
|
||||
myDrawer->SetupOwnShadingAspect();
|
||||
myDrawer->ShadingAspect()->Aspect()->SetMarkerType (Aspect_TOM_POINT);
|
||||
|
||||
SetDisplayMode (AIS_PointCloud::DM_Points);
|
||||
SetHilightMode (AIS_PointCloud::DM_BndBox);
|
||||
@@ -282,52 +281,8 @@ void AIS_PointCloud::SetColor (const Quantity_Color& theColor)
|
||||
{
|
||||
AIS_InteractiveObject::SetColor(theColor);
|
||||
|
||||
if (!myDrawer->HasOwnPointAspect())
|
||||
{
|
||||
myDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, theColor, 1.0));
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->PointAspect()->Aspect() = *myDrawer->Link()->PointAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
// Override color
|
||||
myDrawer->ShadingAspect()->SetColor (theColor);
|
||||
myDrawer->PointAspect() ->SetColor (theColor);
|
||||
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectMarker3d) aPointAspect = myDrawer->PointAspect()->Aspect();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAspect = myDrawer->ShadingAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_PointCloud::DM_Points)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_MARKER))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (aPointAspect);
|
||||
}
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAspect);
|
||||
}
|
||||
}
|
||||
}
|
||||
SynchronizeAspects();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -342,34 +297,20 @@ void AIS_PointCloud::UnsetColor()
|
||||
}
|
||||
|
||||
AIS_InteractiveObject::UnsetColor();
|
||||
|
||||
if (!HasWidth())
|
||||
{
|
||||
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->PointAspect()->SetColor (myDrawer->HasLink()
|
||||
? myDrawer->Link()->PointAspect()->Aspect()->Color()
|
||||
: Quantity_Color (Quantity_NOC_YELLOW));
|
||||
}
|
||||
|
||||
if (HasMaterial()
|
||||
|| IsTransparent())
|
||||
{
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
Graphic3d_MaterialAspect aMat = aDefaultMat;
|
||||
Quantity_Color aColor = aDefaultMat.Color();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
}
|
||||
if (HasMaterial() || myDrawer->HasLink())
|
||||
{
|
||||
aMat = AIS_GraphicTool::GetMaterial (HasMaterial() ? myDrawer : myDrawer->Link());
|
||||
}
|
||||
if (HasMaterial())
|
||||
{
|
||||
Quantity_Color aColor = aDefaultMat.AmbientColor();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
}
|
||||
aMat.SetColor (aColor);
|
||||
}
|
||||
if (IsTransparent())
|
||||
@@ -378,43 +319,10 @@ void AIS_PointCloud::UnsetColor()
|
||||
aMat.SetTransparency (Standard_ShortReal(aTransp));
|
||||
}
|
||||
myDrawer->ShadingAspect()->SetMaterial (aMat, myCurrentFacingModel);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorColor (aColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
|
||||
}
|
||||
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
Handle(Graphic3d_AspectMarker3d) aMarkerAsp = myDrawer->Link()->PointAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_PointCloud::DM_Points)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
|
||||
// Check if aspect of given type is set for the group,
|
||||
// because setting aspect for group with no already set aspect
|
||||
// can lead to loss of presentation data
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||
}
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_MARKER))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (aMarkerAsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
SynchronizeAspects();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -423,14 +331,6 @@ void AIS_PointCloud::UnsetColor()
|
||||
//=======================================================================
|
||||
void AIS_PointCloud::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
{
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
hasOwnMaterial = Standard_True;
|
||||
|
||||
myDrawer->ShadingAspect()->SetMaterial (theMat, myCurrentFacingModel);
|
||||
@@ -439,28 +339,7 @@ void AIS_PointCloud::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
myDrawer->ShadingAspect()->SetColor (myDrawer->Color(), myCurrentFacingModel);
|
||||
}
|
||||
myDrawer->ShadingAspect()->SetTransparency (myDrawer->Transparency(), myCurrentFacingModel);
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_PointCloud::DM_Points)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
SynchronizeAspects();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -474,8 +353,6 @@ void AIS_PointCloud::UnsetMaterial()
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasColor()
|
||||
|| IsTransparent())
|
||||
{
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->HasLink() ?
|
||||
@@ -488,33 +365,8 @@ void AIS_PointCloud::UnsetMaterial()
|
||||
myDrawer->ShadingAspect()->SetTransparency (myDrawer->Transparency(), myCurrentFacingModel);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
|
||||
}
|
||||
hasOwnMaterial = Standard_False;
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_PointCloud::DM_Points)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
SynchronizeAspects();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -535,8 +387,7 @@ void AIS_PointCloud::Compute (const Handle(PrsMgr_PresentationManager3d)& /*theP
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs);
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
|
||||
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (aPoints);
|
||||
break;
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
@@ -184,8 +185,13 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
|
||||
pa->SetTypeOfMarker(aProjTOM);
|
||||
}
|
||||
|
||||
// calcul du projete
|
||||
StdPrs_Point::Add(aPrs, new Geom_CartesianPoint(ProjPoint), myDrawer);
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = aPrs->NewGroup();
|
||||
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
|
||||
anArrayOfPoints->AddVertex (ProjPoint);
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (anArrayOfPoints);
|
||||
}
|
||||
|
||||
if (!myDrawer->HasOwnWireAspect()){
|
||||
myDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aCallTOL,2.));}
|
||||
@@ -197,10 +203,14 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
|
||||
}
|
||||
|
||||
// Si les points ne sont pas confondus...
|
||||
if (!ProjPoint.IsEqual (BRep_Tool::Pnt(aVertex),Precision::Confusion())) {
|
||||
// calcul des lignes de rappel
|
||||
BRepBuilderAPI_MakeEdge MakEd (ProjPoint,BRep_Tool::Pnt(aVertex));
|
||||
StdPrs_WFShape::Add (aPrs, MakEd.Edge(), myDrawer);
|
||||
if (!ProjPoint.IsEqual (BRep_Tool::Pnt(aVertex),Precision::Confusion()))
|
||||
{
|
||||
Handle(Graphic3d_Group) aGroup = aPrs->NewGroup();
|
||||
Handle(Graphic3d_ArrayOfSegments) anArrayOfLines = new Graphic3d_ArrayOfSegments (2);
|
||||
anArrayOfLines->AddVertex (ProjPoint);
|
||||
anArrayOfLines->AddVertex (BRep_Tool::Pnt(aVertex));
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->WireAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (anArrayOfLines);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <PrsMgr_TypeOfPresentation3d.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
|
@@ -392,13 +392,12 @@ void AIS_RubberBand::Compute (const Handle(PrsMgr_PresentationManager3d)& /*theP
|
||||
const Handle(Prs3d_Presentation)& thePresentation,
|
||||
const Standard_Integer /*theMode*/)
|
||||
{
|
||||
Handle (Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePresentation);
|
||||
|
||||
// Draw filling
|
||||
if (IsFilling() && fillTriangles())
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (myTriangles);
|
||||
Handle(Graphic3d_Group) aGroup1 = thePresentation->NewGroup();
|
||||
aGroup1->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
aGroup1->AddPrimitiveArray (myTriangles);
|
||||
}
|
||||
|
||||
// Draw frame
|
||||
@@ -433,6 +432,7 @@ void AIS_RubberBand::Compute (const Handle(PrsMgr_PresentationManager3d)& /*theP
|
||||
}
|
||||
}
|
||||
|
||||
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
|
||||
aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
aGroup->AddPrimitiveArray (myBorders);
|
||||
}
|
||||
|
@@ -48,7 +48,6 @@
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <StdPrs_BndBox.hxx>
|
||||
#include <StdPrs_ToolTriangulatedShape.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Select3D_SensitiveBox.hxx>
|
||||
#include <Select3D_SensitiveEntity.hxx>
|
||||
@@ -68,13 +67,38 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_Shape,AIS_InteractiveObject)
|
||||
|
||||
static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard_Integer aMode)
|
||||
// Auxiliary macros
|
||||
#define replaceAspectWithDef(theMap, theAspect) \
|
||||
if (myDrawer->Link()->theAspect()->Aspect() != myDrawer->theAspect()->Aspect()) \
|
||||
{ \
|
||||
theMap.Bind (myDrawer->theAspect()->Aspect(), myDrawer->Link()->theAspect()->Aspect()); \
|
||||
}
|
||||
|
||||
// Auxiliary macros for replaceWithNewOwnAspects()
|
||||
#define replaceAspectWithOwn(theMap, theAspect) \
|
||||
if (myDrawer->Link()->theAspect()->Aspect() != myDrawer->theAspect()->Aspect()) \
|
||||
{ \
|
||||
theMap.Bind (myDrawer->Link()->theAspect()->Aspect(), myDrawer->theAspect()->Aspect()); \
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : replaceWithNewOwnAspects
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Shape::replaceWithNewOwnAspects()
|
||||
{
|
||||
TColStd_ListIteratorOfListOfInteger It(LL);
|
||||
for(;It.More();It.Next()){
|
||||
if(It.Value()==aMode)
|
||||
return Standard_True;}
|
||||
return Standard_False;
|
||||
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||
|
||||
replaceAspectWithOwn (aReplaceMap, ShadingAspect);
|
||||
replaceAspectWithOwn (aReplaceMap, LineAspect);
|
||||
replaceAspectWithOwn (aReplaceMap, WireAspect);
|
||||
replaceAspectWithOwn (aReplaceMap, FreeBoundaryAspect);
|
||||
replaceAspectWithOwn (aReplaceMap, UnFreeBoundaryAspect);
|
||||
replaceAspectWithOwn (aReplaceMap, SeenLineAspect);
|
||||
replaceAspectWithOwn (aReplaceMap, FaceBoundaryAspect);
|
||||
replaceAspectWithOwn (aReplaceMap, PointAspect);
|
||||
|
||||
replaceAspects (aReplaceMap);
|
||||
}
|
||||
|
||||
//==================================================
|
||||
@@ -350,78 +374,9 @@ bool AIS_Shape::setColor (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Quantity_Color& theColor) const
|
||||
{
|
||||
bool toRecompute = false;
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnLineAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnWireAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnPointAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_PLUS, Quantity_NOC_BLACK, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnFreeBoundaryAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnUnFreeBoundaryAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnSeenLineAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetSeenLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->SeenLineAspect()->Aspect() = *theDrawer->Link()->SeenLineAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnFaceBoundaryAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetFaceBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->FaceBoundaryAspect()->Aspect() = *theDrawer->Link()->FaceBoundaryAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
toRecompute = theDrawer->SetupOwnShadingAspect() || toRecompute;
|
||||
toRecompute = theDrawer->SetOwnLineAspects() || toRecompute;
|
||||
toRecompute = theDrawer->SetupOwnPointAspect() || toRecompute;
|
||||
|
||||
// override color
|
||||
theDrawer->ShadingAspect()->SetColor (theColor, myCurrentFacingModel);
|
||||
@@ -445,52 +400,17 @@ void AIS_Shape::SetColor (const Quantity_Color& theColor)
|
||||
const bool toRecompute = setColor (myDrawer, theColor);
|
||||
myDrawer->SetColor (theColor);
|
||||
hasOwnColor = Standard_True;
|
||||
if (!toRecompute)
|
||||
|
||||
if (!toRecompute
|
||||
|| !myDrawer->HasLink())
|
||||
{
|
||||
myToRecomputeModes.Clear();
|
||||
myRecomputeEveryPrs = false;
|
||||
SynchronizeAspects();
|
||||
return;
|
||||
}
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAspect = myDrawer->ShadingAspect()->Aspect();
|
||||
Handle(Graphic3d_AspectLine3d) aLineAspect = myDrawer->LineAspect()->Aspect();
|
||||
Handle(Graphic3d_AspectMarker3d) aPointAspect = myDrawer->PointAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
else
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_Shaded)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
|
||||
// Check if aspect of given type is set for the group,
|
||||
// because setting aspect for group with no already set aspect
|
||||
// can lead to loss of presentation data
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAspect);
|
||||
}
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_LINE))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (aLineAspect);
|
||||
}
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_MARKER))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (aPointAspect);
|
||||
}
|
||||
}
|
||||
replaceWithNewOwnAspects();
|
||||
}
|
||||
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
LoadRecomputable (2);
|
||||
recomputeComputed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -502,23 +422,27 @@ void AIS_Shape::UnsetColor()
|
||||
{
|
||||
if (!HasColor())
|
||||
{
|
||||
myToRecomputeModes.Clear();
|
||||
myRecomputeEveryPrs = false;
|
||||
return;
|
||||
}
|
||||
|
||||
hasOwnColor = Standard_False;
|
||||
myDrawer->SetColor (myDrawer->HasLink() ? myDrawer->Link()->Color() : Quantity_Color (Quantity_NOC_WHITE));
|
||||
|
||||
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||
if (!HasWidth())
|
||||
{
|
||||
Handle(Prs3d_LineAspect) anEmptyAsp;
|
||||
myDrawer->SetLineAspect (anEmptyAsp);
|
||||
myDrawer->SetWireAspect (anEmptyAsp);
|
||||
myDrawer->SetFreeBoundaryAspect (anEmptyAsp);
|
||||
myDrawer->SetUnFreeBoundaryAspect(anEmptyAsp);
|
||||
myDrawer->SetSeenLineAspect (anEmptyAsp);
|
||||
myDrawer->SetFaceBoundaryAspect (anEmptyAsp);
|
||||
replaceAspectWithDef (aReplaceMap, LineAspect);
|
||||
replaceAspectWithDef (aReplaceMap, WireAspect);
|
||||
replaceAspectWithDef (aReplaceMap, FreeBoundaryAspect);
|
||||
replaceAspectWithDef (aReplaceMap, UnFreeBoundaryAspect);
|
||||
replaceAspectWithDef (aReplaceMap, SeenLineAspect);
|
||||
replaceAspectWithDef (aReplaceMap, FaceBoundaryAspect);
|
||||
myDrawer->SetLineAspect (Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetWireAspect (Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetFreeBoundaryAspect (Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetUnFreeBoundaryAspect(Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetSeenLineAspect (Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetFaceBoundaryAspect (Handle(Prs3d_LineAspect)());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -600,10 +524,17 @@ void AIS_Shape::UnsetColor()
|
||||
}
|
||||
else
|
||||
{
|
||||
replaceAspectWithDef (aReplaceMap, ShadingAspect);
|
||||
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
|
||||
}
|
||||
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
|
||||
myRecomputeEveryPrs = true;
|
||||
if (myDrawer->HasOwnPointAspect())
|
||||
{
|
||||
replaceAspectWithDef (aReplaceMap, PointAspect);
|
||||
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
|
||||
}
|
||||
replaceAspects (aReplaceMap);
|
||||
SynchronizeAspects();
|
||||
recomputeComputed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -614,61 +545,7 @@ void AIS_Shape::UnsetColor()
|
||||
bool AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Real theLineWidth) const
|
||||
{
|
||||
bool toRecompute = false;
|
||||
if (!theDrawer->HasOwnLineAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnWireAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnFreeBoundaryAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnUnFreeBoundaryAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnSeenLineAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetSeenLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->SeenLineAspect()->Aspect() = *theDrawer->Link()->SeenLineAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasOwnFaceBoundaryAspect())
|
||||
{
|
||||
toRecompute = true;
|
||||
theDrawer->SetFaceBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->FaceBoundaryAspect()->Aspect() = *theDrawer->Link()->FaceBoundaryAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
bool toRecompute = theDrawer->SetOwnLineAspects();
|
||||
|
||||
// override width
|
||||
theDrawer->LineAspect()->SetWidth (theLineWidth);
|
||||
@@ -687,17 +564,18 @@ bool AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
|
||||
void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
|
||||
{
|
||||
myOwnWidth = theLineWidth;
|
||||
if (setWidth (myDrawer, theLineWidth))
|
||||
myOwnWidth = (Standard_ShortReal )theLineWidth;
|
||||
|
||||
if (!setWidth (myDrawer, theLineWidth)
|
||||
|| !myDrawer->HasLink())
|
||||
{
|
||||
myRecomputeEveryPrs = true;
|
||||
SynchronizeAspects();
|
||||
}
|
||||
else
|
||||
{
|
||||
myRecomputeEveryPrs = false;
|
||||
myToRecomputeModes.Clear();
|
||||
SynchronizeAspects();
|
||||
replaceWithNewOwnAspects();
|
||||
}
|
||||
recomputeComputed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -707,24 +585,28 @@ void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
|
||||
|
||||
void AIS_Shape::UnsetWidth()
|
||||
{
|
||||
if (myOwnWidth == 0.0)
|
||||
if (myOwnWidth == 0.0f)
|
||||
{
|
||||
myToRecomputeModes.Clear();
|
||||
myRecomputeEveryPrs = false;
|
||||
return;
|
||||
}
|
||||
|
||||
myOwnWidth = 0.0;
|
||||
myOwnWidth = 0.0f;
|
||||
if (!HasColor())
|
||||
{
|
||||
const Handle(Prs3d_LineAspect) anEmptyAsp;
|
||||
myDrawer->SetLineAspect (anEmptyAsp);
|
||||
myDrawer->SetWireAspect (anEmptyAsp);
|
||||
myDrawer->SetFreeBoundaryAspect (anEmptyAsp);
|
||||
myDrawer->SetUnFreeBoundaryAspect(anEmptyAsp);
|
||||
myDrawer->SetSeenLineAspect (anEmptyAsp);
|
||||
myDrawer->SetFaceBoundaryAspect (anEmptyAsp);
|
||||
myRecomputeEveryPrs = true;
|
||||
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||
replaceAspectWithDef (aReplaceMap, LineAspect);
|
||||
replaceAspectWithDef (aReplaceMap, WireAspect);
|
||||
replaceAspectWithDef (aReplaceMap, FreeBoundaryAspect);
|
||||
replaceAspectWithDef (aReplaceMap, UnFreeBoundaryAspect);
|
||||
replaceAspectWithDef (aReplaceMap, SeenLineAspect);
|
||||
replaceAspectWithDef (aReplaceMap, FaceBoundaryAspect);
|
||||
myDrawer->SetLineAspect (Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetWireAspect (Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetFreeBoundaryAspect (Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetUnFreeBoundaryAspect(Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetSeenLineAspect (Handle(Prs3d_LineAspect)());
|
||||
myDrawer->SetFaceBoundaryAspect (Handle(Prs3d_LineAspect)());
|
||||
replaceAspects (aReplaceMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -741,9 +623,8 @@ void AIS_Shape::UnsetWidth()
|
||||
myDrawer->FaceBoundaryAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_FaceBoundary) : 1.);
|
||||
SynchronizeAspects();
|
||||
myToRecomputeModes.Clear();
|
||||
myRecomputeEveryPrs = false;
|
||||
}
|
||||
recomputeComputed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -758,14 +639,7 @@ void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
{
|
||||
const Quantity_Color aColor = theDrawer->ShadingAspect()->Material (myCurrentFacingModel).Color();
|
||||
const Standard_Real aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
theDrawer->SetupOwnShadingAspect();
|
||||
theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
|
||||
|
||||
if (theToKeepColor)
|
||||
@@ -785,37 +659,19 @@ void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
|
||||
void AIS_Shape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
{
|
||||
const bool toRecompute = !myDrawer->HasOwnShadingAspect();
|
||||
setMaterial (myDrawer, theMat, HasColor(), IsTransparent());
|
||||
hasOwnMaterial = Standard_True;
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
if (!toRecompute
|
||||
|| !myDrawer->HasLink())
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_Shaded)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
|
||||
// Check if aspect of given type is set for the group,
|
||||
// because setting aspect for group with no already set aspect
|
||||
// can lead to loss of presentation data
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||
}
|
||||
}
|
||||
SynchronizeAspects();
|
||||
}
|
||||
else
|
||||
{
|
||||
replaceWithNewOwnAspects();
|
||||
}
|
||||
|
||||
myRecomputeEveryPrs = Standard_False; // no mode to recalculate :only viewer update
|
||||
myToRecomputeModes.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -848,37 +704,15 @@ void AIS_Shape::UnsetMaterial()
|
||||
myDrawer->ShadingAspect()->SetColor (myDrawer->Color(), myCurrentFacingModel);
|
||||
myDrawer->ShadingAspect()->SetTransparency (myDrawer->Transparency(), myCurrentFacingModel);
|
||||
}
|
||||
SynchronizeAspects();
|
||||
}
|
||||
else
|
||||
{
|
||||
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||
replaceAspectWithDef (aReplaceMap, ShadingAspect);
|
||||
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
|
||||
replaceAspects (aReplaceMap);
|
||||
}
|
||||
hasOwnMaterial = Standard_False;
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_Shaded)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
myRecomputeEveryPrs = Standard_False; // no mode to recalculate :only viewer update
|
||||
myToRecomputeModes.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -889,15 +723,7 @@ void AIS_Shape::UnsetMaterial()
|
||||
void AIS_Shape::setTransparency (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Real theValue) const
|
||||
{
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
theDrawer->SetupOwnShadingAspect();
|
||||
// override transparency
|
||||
theDrawer->ShadingAspect()->SetTransparency (theValue, myCurrentFacingModel);
|
||||
}
|
||||
@@ -909,33 +735,19 @@ void AIS_Shape::setTransparency (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
|
||||
void AIS_Shape::SetTransparency (const Standard_Real theValue)
|
||||
{
|
||||
const bool toRecompute = !myDrawer->HasOwnShadingAspect();
|
||||
setTransparency (myDrawer, theValue);
|
||||
myDrawer->SetTransparency ((Standard_ShortReal )theValue);
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
if (!toRecompute
|
||||
|| !myDrawer->HasLink())
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_Shaded)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||
}
|
||||
}
|
||||
SynchronizeAspects();
|
||||
}
|
||||
else
|
||||
{
|
||||
replaceWithNewOwnAspects();
|
||||
}
|
||||
|
||||
myRecomputeEveryPrs = Standard_False; // no mode to recalculate - only viewer update
|
||||
myToRecomputeModes.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -955,48 +767,15 @@ void AIS_Shape::UnsetTransparency()
|
||||
|| myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
|
||||
SynchronizeAspects();
|
||||
}
|
||||
else
|
||||
{
|
||||
Graphic3d_MapOfAspectsToAspects aReplaceMap;
|
||||
replaceAspectWithDef (aReplaceMap, ShadingAspect);
|
||||
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
|
||||
replaceAspects (aReplaceMap);
|
||||
}
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
if (aPrsModed.Mode() != AIS_Shaded)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
myRecomputeEveryPrs = Standard_False; // no mode to recalculate :only viewer update
|
||||
myToRecomputeModes.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LoadRecomputable
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::LoadRecomputable(const Standard_Integer TheMode)
|
||||
{
|
||||
myRecomputeEveryPrs = Standard_False;
|
||||
if(!IsInList(myToRecomputeModes,TheMode))
|
||||
myToRecomputeModes.Append(TheMode);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1085,8 +864,7 @@ Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle ()
|
||||
void AIS_Shape::SetOwnDeviationCoefficient ( const Standard_Real aCoefficient )
|
||||
{
|
||||
myDrawer->SetDeviationCoefficient( aCoefficient );
|
||||
SetToUpdate(0) ; // WireFrame
|
||||
SetToUpdate(1) ; // Shadding
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1105,11 +883,10 @@ void AIS_Shape::SetOwnHLRDeviationCoefficient ( const Standard_Real aCoefficien
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::SetOwnDeviationAngle ( const Standard_Real anAngle )
|
||||
void AIS_Shape::SetOwnDeviationAngle (const Standard_Real theAngle)
|
||||
{
|
||||
|
||||
myDrawer->SetDeviationAngle(anAngle );
|
||||
SetToUpdate(0) ; // WireFrame
|
||||
myDrawer->SetDeviationAngle (theAngle);
|
||||
SetToUpdate (AIS_WireFrame);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetOwnDeviationAngle
|
||||
@@ -1123,8 +900,7 @@ void AIS_Shape::SetAngleAndDeviation ( const Standard_Real anAngle )
|
||||
SetOwnDeviationAngle(anAngle) ;
|
||||
SetOwnDeviationCoefficient(OutDefl) ;
|
||||
myInitAng = anAngle;
|
||||
SetToUpdate(0);
|
||||
SetToUpdate(1);
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -51,7 +51,7 @@
|
||||
//! To generate texture coordinates, appropriate shading attribute should be set before computing presentation in AIS_Shaded display mode:
|
||||
//! @code
|
||||
//! Handle(AIS_Shape) aPrs = new AIS_Shape();
|
||||
//! aPrs->Attributes()->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
//! aPrs->Attributes()->SetupOwnShadingAspect();
|
||||
//! aPrs->Attributes()->ShadingAspect()->Aspect()->SetTextureMapOn();
|
||||
//! aPrs->Attributes()->ShadingAspect()->Aspect()->SetTextureMap (new Graphic3d_Texture2Dmanual (Graphic3d_NOT_2D_ALUMINUM));
|
||||
//! @endcode
|
||||
@@ -302,8 +302,6 @@ protected:
|
||||
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
|
||||
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.
|
||||
//! @return TRUE if new aspects have been created
|
||||
Standard_EXPORT bool setColor (const Handle(Prs3d_Drawer)& theDrawer, const Quantity_Color& theColor) const;
|
||||
@@ -316,6 +314,9 @@ protected:
|
||||
|
||||
Standard_EXPORT void setMaterial (const Handle(Prs3d_Drawer)& theDrawer, const Graphic3d_MaterialAspect& theMaterial, const Standard_Boolean theToKeepColor, const Standard_Boolean theToKeepTransp) const;
|
||||
|
||||
//! Replace aspects of already computed groups from drawer link by the new own value.
|
||||
Standard_EXPORT void replaceWithNewOwnAspects();
|
||||
|
||||
public:
|
||||
|
||||
//! Compute HLR presentation for specified shape.
|
||||
|
@@ -17,25 +17,11 @@
|
||||
#ifndef _AIS_SymmetricRelation_HeaderFile
|
||||
#define _AIS_SymmetricRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_SymmetricRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_SymmetricRelation, AIS_Relation)
|
||||
|
||||
//! A framework to display constraints of symmetricity
|
||||
@@ -44,10 +30,9 @@ DEFINE_STANDARD_HANDLE(AIS_SymmetricRelation, AIS_Relation)
|
||||
//! shapes of which the datums are parts.
|
||||
class AIS_SymmetricRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_SymmetricRelation, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! Constructs an object to display constraints of symmetricity.
|
||||
//! This object is defined by a tool aSymmTool, a first
|
||||
//! shape FirstShape, a second shape SecondShape, and a plane aPlane.
|
||||
@@ -79,19 +64,8 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_SymmetricRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -110,14 +84,8 @@ private:
|
||||
gp_Dir myFDirAttach;
|
||||
gp_Dir myAxisDirAttach;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_SymmetricRelation.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_SymmetricRelation_HeaderFile
|
||||
|
@@ -17,24 +17,8 @@
|
||||
#ifndef _AIS_TangentRelation_HeaderFile
|
||||
#define _AIS_TangentRelation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
class TopoDS_Shape;
|
||||
class Geom_Plane;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
|
||||
|
||||
class AIS_TangentRelation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_TangentRelation, AIS_Relation)
|
||||
|
||||
//! A framework to display tangency constraints between
|
||||
@@ -42,10 +26,9 @@ DEFINE_STANDARD_HANDLE(AIS_TangentRelation, AIS_Relation)
|
||||
//! The datums are normally faces or edges.
|
||||
class AIS_TangentRelation : public AIS_Relation
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_TangentRelation, AIS_Relation)
|
||||
public:
|
||||
|
||||
|
||||
//! TwoFacesTangent or TwoEdgesTangent relation
|
||||
//! Constructs an object to display tangency constraints.
|
||||
//! This object is defined by the first shape aFShape, the
|
||||
@@ -79,19 +62,8 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_TangentRelation,AIS_Relation)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -107,13 +79,6 @@ private:
|
||||
Standard_Real myLength;
|
||||
Standard_Integer myExternRef;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AIS_TangentRelation_HeaderFile
|
||||
|
@@ -57,6 +57,7 @@ void AIS_TextLabel::SetColor (const Quantity_Color& theColor)
|
||||
hasOwnColor = Standard_True;
|
||||
myDrawer->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()->SetColorSubTitle (aSubColor);
|
||||
myDrawer->SetTransparency (Standard_ShortReal(theValue));
|
||||
SynchronizeAspects();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -261,14 +263,14 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
||||
if (myHasFlipping)
|
||||
{
|
||||
// Get width and height of text
|
||||
Font_FTFont aFont;
|
||||
unsigned int aResolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution;
|
||||
if (aFont.Init (anAsp->Aspect()->Font().ToCString(),
|
||||
anAsp->Aspect()->GetTextFontAspect(), (unsigned int)anAsp->Height(), aResolution))
|
||||
Font_FTFontParams aFontParams;
|
||||
aFontParams.PointSize = (unsigned int )anAsp->Height();
|
||||
aFontParams.Resolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution;
|
||||
if (Handle(Font_FTFont) aFont = Font_FTFont::FindAndCreate (anAsp->Aspect()->Font(), anAsp->Aspect()->GetTextFontAspect(), aFontParams))
|
||||
{
|
||||
isInit = Standard_True;
|
||||
const NCollection_String aText (myText.ToExtString());
|
||||
Font_Rect aBndBox = aFont.BoundingBox (aText, anAsp->HorizontalJustification(), anAsp->VerticalJustification());
|
||||
Font_Rect aBndBox = aFont->BoundingBox (aText, anAsp->HorizontalJustification(), anAsp->VerticalJustification());
|
||||
Standard_Real aWidth = Abs (aBndBox.Width());
|
||||
Standard_Real aHeight = Abs (aBndBox.Height());
|
||||
gp_Pnt aCenterOfLabel = aPosition;
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
@@ -199,14 +198,12 @@ void AIS_TexturedShape::SetColor (const Quantity_Color& theColor)
|
||||
{
|
||||
AIS_Shape::SetColor (theColor);
|
||||
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
|
||||
for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
|
||||
|
||||
if (aPrsModed.Mode() != 3)
|
||||
continue;
|
||||
|
||||
updateAttributes (aPrsModed.Presentation()->Presentation());
|
||||
if (aPrsIter.Value()->Mode() == 3)
|
||||
{
|
||||
updateAttributes (aPrsIter.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,36 +215,6 @@ void AIS_TexturedShape::SetColor (const Quantity_Color& theColor)
|
||||
void AIS_TexturedShape::UnsetColor()
|
||||
{
|
||||
AIS_Shape::UnsetColor();
|
||||
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
|
||||
|
||||
if (aPrsModed.Mode() != 3)
|
||||
continue;
|
||||
|
||||
Handle(Prs3d_Presentation) aPrs = aPrsModed.Presentation()->Presentation();
|
||||
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (aPrs);
|
||||
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
Handle(Graphic3d_AspectLine3d) aLineAsp = myDrawer->Link()->LineAspect()->Aspect();
|
||||
Quantity_Color aColor;
|
||||
AIS_GraphicTool::GetInteriorColor (myDrawer->Link(), aColor);
|
||||
anAreaAsp->SetInteriorColor (aColor);
|
||||
// Check if aspect of given type is set for the group,
|
||||
// because setting aspect for group with no already set aspect
|
||||
// can lead to loss of presentation data
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
|
||||
}
|
||||
if (aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_LINE))
|
||||
{
|
||||
aGroup->SetGroupPrimitivesAspect (aLineAsp);
|
||||
}
|
||||
|
||||
updateAttributes (aPrs);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -258,15 +225,12 @@ void AIS_TexturedShape::UnsetColor()
|
||||
void AIS_TexturedShape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
{
|
||||
AIS_Shape::SetMaterial (theMat);
|
||||
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
|
||||
for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
|
||||
|
||||
if (aPrsModed.Mode() != 3)
|
||||
continue;
|
||||
|
||||
updateAttributes (aPrsModed.Presentation()->Presentation());
|
||||
if (aPrsIter.Value()->Mode() == 3)
|
||||
{
|
||||
updateAttributes (aPrsIter.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,15 +241,12 @@ void AIS_TexturedShape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
void AIS_TexturedShape::UnsetMaterial()
|
||||
{
|
||||
AIS_Shape::UnsetMaterial();
|
||||
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
|
||||
for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
|
||||
|
||||
if (aPrsModed.Mode() != 3)
|
||||
continue;
|
||||
|
||||
updateAttributes (aPrsModed.Presentation()->Presentation());
|
||||
if (aPrsIter.Value()->Mode() == 3)
|
||||
{
|
||||
updateAttributes (aPrsIter.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,10 +338,6 @@ void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& theP
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (thePrs->Groups()); aGroupIt.More(); aGroupIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
|
||||
if (!aGroup->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
aGroup->SetGroupPrimitivesAspect (myAspect);
|
||||
}
|
||||
}
|
||||
@@ -459,7 +416,7 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t
|
||||
updateAttributes (thePrs);
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure)
|
||||
catch (Standard_Failure const&)
|
||||
{
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "AIS_TexturedShape::Compute() in ShadingMode failed \n";
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user