mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
1 Commits
CR30250_2
...
CR23979_te
Author | SHA1 | Date | |
---|---|---|---|
|
3870430b9c |
@@ -708,18 +708,6 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
|
||||
endif()
|
||||
|
||||
# qt for inspector and samples
|
||||
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
|
||||
# check qt 3rdparty path
|
||||
add_definitions (-DHAVE_QT)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
|
||||
message (STATUS "Info: Qt is used by OCCT")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_QT")
|
||||
endif()
|
||||
|
||||
# check all 3rdparty include paths
|
||||
string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
|
||||
if (3RDPARTY_NOT_INCLUDED)
|
||||
@@ -807,6 +795,17 @@ else()
|
||||
set (SCRIPT_EXT sh)
|
||||
endif()
|
||||
|
||||
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
|
||||
# check qt 3rdparty path
|
||||
add_definitions (-DHAVE_QT)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
|
||||
message (STATUS "Info: Qt is used by OCCT")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_QT")
|
||||
endif()
|
||||
|
||||
# OCCT tools
|
||||
# include the patched or original list of tools
|
||||
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
|
||||
|
@@ -274,7 +274,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
list (LENGTH OCCT_ALL_FILE_NAMES ALL_FILES_NB)
|
||||
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
|
||||
|
||||
# emit warnings if there are unprocessed headers
|
||||
# emit warnings if there is unprocessed headers
|
||||
file (GLOB OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/*.*")
|
||||
file (GLOB OCCT_ALL_FILES_IN_PATCH_DIR "${BUILD_PATCH}/src/${OCCT_PACKAGE}/*.*")
|
||||
|
||||
@@ -307,8 +307,8 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
list (APPEND OCCT_HEADER_FILES_COMPLETE ${OCCT_FILE_IN_DIR})
|
||||
|
||||
# collect header files with name that does not contain its package one
|
||||
string (REGEX MATCH "^${OCCT_PACKAGE}[_.]" IS_HEADER_MATHCING_PACKAGE "${OCCT_FILE_NAME}")
|
||||
if (NOT IS_HEADER_MATHCING_PACKAGE)
|
||||
string (FIND "${OCCT_FILE_NAME}" "${OCCT_PACKAGE}_" FOUND_INDEX)
|
||||
if (NOT ${FOUND_INDEX} EQUAL 0)
|
||||
list (APPEND OCCT_HEADER_FILE_WITH_PROPER_NAMES "${OCCT_FILE_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
@@ -355,12 +355,12 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
|
||||
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
|
||||
if (NOT EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not present in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not presented in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
|
||||
else()
|
||||
list (FIND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${PACKAGE_NAME} IS_HEADER_FOUND)
|
||||
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is present in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is presented in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -1,21 +1,23 @@
|
||||
#qt
|
||||
|
||||
# Qt is searched manually first (just determine root)
|
||||
message (STATUS "Processing Qt 3-rd party")
|
||||
#looking for 3RDPARTY_QT_DIR variable used later in qt_macro.cmake
|
||||
SET(CSF_QtCore "QtCore")
|
||||
THIRDPARTY_PRODUCT("QT" "" "CSF_QtCore" "d")
|
||||
|
||||
if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
|
||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
|
||||
|
||||
if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
|
||||
message (FATAL_ERROR "... Qt root directory was not found")
|
||||
endif()
|
||||
list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_INCLUDE_DIR")
|
||||
list (REMOVE_ITEM 3RDPARTY_NO_LIBS "3RDPARTY_QT_LIBRARY_DIR")
|
||||
list (REMOVE_ITEM 3RDPARTY_NO_DLLS "3RDPARTY_QT_DLL_DIR")
|
||||
|
||||
# Combine directory name with absolute path and show in GUI
|
||||
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
|
||||
message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
|
||||
endif()
|
||||
UNSET (${3RDPARTY_QT_DLL} CACHE)
|
||||
UNSET (${3RDPARTY_QT_DLL_DIR} CACHE)
|
||||
UNSET (${3RDPARTY_QT_INCLUDE_DIR} CACHE)
|
||||
UNSET (${3RDPARTY_QT_LIBRARY} CACHE)
|
||||
UNSET (${3RDPARTY_QT_LIBRARY_DIR} CACHE)
|
||||
|
||||
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
|
||||
message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
|
||||
|
||||
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
|
||||
# Without this setting find_package() will not work
|
||||
|
@@ -24,9 +24,6 @@
|
||||
# load tools
|
||||
source [file join [file dirname [info script]] genconfdeps.tcl]
|
||||
|
||||
# proxy variable for implicit file path normalization
|
||||
set PRODUCTS_PATH_INPUT "$::PRODUCTS_PATH"
|
||||
|
||||
package require Tk
|
||||
|
||||
set aRowIter 0
|
||||
@@ -61,7 +58,7 @@ set SYS_VS_LIST {}
|
||||
set SYS_VC_LIST {}
|
||||
set SYS_VCVARS_LIST {}
|
||||
|
||||
# detect installed Visual Studio 2017+ instances by running vswhere.exe
|
||||
# detect installed Visual Studio 2017 instances by running vswhere.exe
|
||||
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
|
||||
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
|
||||
lappend ::SYS_VC_LIST "vc141"
|
||||
@@ -72,16 +69,6 @@ if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Micr
|
||||
lappend ::SYS_VC_LIST "vc141-uwp"
|
||||
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
|
||||
}
|
||||
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
|
||||
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142)"
|
||||
lappend ::SYS_VC_LIST "vc142"
|
||||
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
|
||||
}
|
||||
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
|
||||
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142) UWP"
|
||||
lappend ::SYS_VC_LIST "vc142-uwp"
|
||||
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
|
||||
}
|
||||
|
||||
# detect installed Visual Studio instances from global environment
|
||||
if { [info exists ::env(VS140COMNTOOLS)] } {
|
||||
@@ -202,14 +189,6 @@ proc wokdep:gui:UpdateList {} {
|
||||
}
|
||||
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"}
|
||||
}
|
||||
if { "$::HAVE_E57" == "true" } {
|
||||
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "e57" "e57/E57Foundation.h" "E57RefImpl" {"e57"}
|
||||
set aCheckLib "xerces-c"
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
set aCheckLib "xerces-c_3"
|
||||
}
|
||||
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "xerces-c" "xercesc/sax2/XMLReaderFactory.hpp" "$aCheckLib" {"xerces"}
|
||||
}
|
||||
if { "$::HAVE_RAPIDJSON" == "true" } {
|
||||
wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
}
|
||||
@@ -236,9 +215,9 @@ proc wokdep:gui:BrowseVcVars {} {
|
||||
}
|
||||
|
||||
proc wokdep:gui:BrowsePartiesRoot {} {
|
||||
set aResult [tk_chooseDirectory -initialdir $::PRODUCTS_PATH_INPUT -title "Choose a directory"]
|
||||
set aResult [tk_chooseDirectory -initialdir $::PRODUCTS_PATH -title "Choose a directory"]
|
||||
if { "$aResult" != "" } {
|
||||
set ::PRODUCTS_PATH_INPUT $aResult
|
||||
set ::PRODUCTS_PATH $aResult
|
||||
wokdep:gui:UpdateList
|
||||
}
|
||||
}
|
||||
@@ -452,7 +431,7 @@ ttk::label .myFrame.myHxxChecks.myScutsLbl -text "Strategy for filling he
|
||||
|
||||
#
|
||||
ttk::label .myFrame.mySrchLbl -text "3rd-parties search path:" -padding {5 5 80 5}
|
||||
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH_INPUT -width 80
|
||||
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH -width 80
|
||||
ttk::button .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
|
||||
checkbutton .myFrame.myChecks.myFImageCheck -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myFImageLbl -text "Use FreeImage"
|
||||
@@ -470,9 +449,6 @@ checkbutton .myFrame.myChecks.myFFmpegCheck -offvalue "false" -onvalue "true
|
||||
ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg"
|
||||
#checkbutton .myFrame.myChecks.myOpenClCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENCL -command wokdep:gui:UpdateList
|
||||
#ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL"
|
||||
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
|
||||
|
||||
checkbutton .myFrame.myChecks.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
|
||||
ttk::label .myFrame.myChecks.myMacGLXLbl -text "Use X11 for windows drawing"
|
||||
ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK"
|
||||
@@ -482,8 +458,9 @@ checkbutton .myFrame.myChecks.myZLibCheck -offvalue "false" -onvalue "true
|
||||
ttk::label .myFrame.myChecks.myZLibLbl -text "Use zlib"
|
||||
checkbutton .myFrame.myChecks.myLzmaCheck -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myLzmaLbl -text "Use liblzma"
|
||||
checkbutton .myFrame.myChecks.myE57Check -offvalue "false" -onvalue "true" -variable HAVE_E57 -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myE57Lbl -text "Use E57"
|
||||
|
||||
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
|
||||
|
||||
checkbutton .myFrame.myChecks.myQt4Check -offvalue "false" -onvalue "true" -variable CHECK_QT4 -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myQt4Lbl -text "Search Qt4"
|
||||
@@ -604,9 +581,6 @@ grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
} elseif { "$::tcl_platform(os)" == "Darwin" } {
|
||||
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
}
|
||||
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
|
||||
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
|
||||
@@ -614,11 +588,14 @@ grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e
|
||||
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
|
||||
|
||||
incr aCheckRowIter
|
||||
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
|
||||
grid .myFrame.myChecks.myE57Lbl -row $aCheckRowIter -column 7 -sticky w
|
||||
if { "$::tcl_platform(os)" == "Darwin" } {
|
||||
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
incr aCheckRowIter
|
||||
}
|
||||
|
||||
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 6 -sticky e
|
||||
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 7 -sticky w
|
||||
incr aCheckRowIter
|
||||
|
||||
# Additional headers search paths
|
||||
@@ -663,7 +640,6 @@ bind .myFrame.myVsFrame.myArchCombo <<ComboboxSelected>> {
|
||||
}
|
||||
|
||||
.myFrame.mySrchEntry configure -validate all -validatecommand {
|
||||
set ::PRODUCTS_PATH [file normalize "$::PRODUCTS_PATH_INPUT"]
|
||||
#return [file exists "$::PRODUCTS_PATH"]
|
||||
wokdep:gui:UpdateList
|
||||
return 1
|
||||
|
@@ -68,7 +68,7 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } {
|
||||
}
|
||||
|
||||
# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
|
||||
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo}
|
||||
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_RAPIDJSON HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo}
|
||||
foreach anEnvIter $THE_ENV_VARIABLES {
|
||||
set ${anEnvIter} "false"
|
||||
if { [info exists ::env(${anEnvIter})] } {
|
||||
@@ -85,14 +85,11 @@ if { "$tcl_platform(platform)" != "windows" } {
|
||||
set HAVE_D3D ""
|
||||
set HAVE_RelWithDebInfo ""
|
||||
}
|
||||
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT } {
|
||||
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT PRODUCTS_PATH} {
|
||||
if { [info exists ::env(${anEnvIter})] } {
|
||||
set ${anEnvIter} "$::env(${anEnvIter})"
|
||||
}
|
||||
}
|
||||
if { [info exists ::env(PRODUCTS_PATH)] } {
|
||||
set PRODUCTS_PATH [file normalize "$::env(PRODUCTS_PATH)"]
|
||||
}
|
||||
|
||||
if { [info exists ::env(CSF_OPT_INC)] } {
|
||||
set CSF_OPT_INC [split "$::env(CSF_OPT_INC)" $::SYS_PATH_SPLITTER]
|
||||
@@ -147,11 +144,8 @@ proc wokdep:SearchHeader {theHeader} {
|
||||
proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} {
|
||||
if { "$theSearchPath" != "" } {
|
||||
set aPath "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath2 "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { "$::tcl_platform(platform)" != "windows" && [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
@@ -160,41 +154,30 @@ proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} {
|
||||
# search in custom paths
|
||||
foreach aLibPath [set ::CSF_OPT_LIB$theBitness] {
|
||||
set aPath "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath2 "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { "$::tcl_platform(platform)" != "windows" && [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
}
|
||||
}
|
||||
|
||||
# search in system
|
||||
if { "$::ARCH" == "$theBitness"} {
|
||||
set aPath "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
|
||||
set aPath2 "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if { "$::tcl_platform(os)" == "Linux" } {
|
||||
if { "$theBitness" == "64" } {
|
||||
set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so"
|
||||
set aPath2 "/usr/lib/x86_64-linux-gnu/lib${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
}
|
||||
} else {
|
||||
set aPath "/usr/lib/i386-linux-gnu/lib${theLib}.so"
|
||||
set aPath2 "/usr/lib/i386-linux-gnu/lib${theLib}.a"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
} elseif { [file exists "$aPath2"] } {
|
||||
return "$aPath2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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" "vc142" "cbp" "xcd" "pro"}
|
||||
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd" "pro"}
|
||||
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
|
||||
set isHelpRequire false
|
||||
|
||||
@@ -284,12 +284,8 @@ proc genproj {theFormat args} {
|
||||
|
||||
# Check optional arguments
|
||||
set aLibType "dynamic"
|
||||
set aSolution "OCCT"
|
||||
for {set anArgIter 0} {$anArgIter < [llength args]} {incr anArgIter} {
|
||||
set arg [lindex $args $anArgIter]
|
||||
if { $arg == "" } {
|
||||
continue
|
||||
} elseif { $arg == "-h" || $arg == "-help" || $arg == "--help" } {
|
||||
foreach arg $args {
|
||||
if { $arg == "-h" || $arg == "-help" || $arg == "--help" } {
|
||||
set isHelpRequire true
|
||||
} elseif { [lsearch -exact $aSupportedPlatforms $arg] >= 0 } {
|
||||
set aPlatform $arg
|
||||
@@ -299,9 +295,6 @@ proc genproj {theFormat args} {
|
||||
} elseif { $arg == "-dynamic" } {
|
||||
set aLibType "dynamic"
|
||||
puts "Dynamic build has been selected"
|
||||
} elseif { $arg == "-solution" } {
|
||||
incr anArgIter
|
||||
set aSolution [lindex $args $anArgIter]
|
||||
} else {
|
||||
puts "Error: genproj: unrecognized option \"$arg\""
|
||||
set isHelpRequire true
|
||||
@@ -319,7 +312,6 @@ proc genproj {theFormat args} {
|
||||
vc12 - Visual Studio 2013
|
||||
vc14 - Visual Studio 2015
|
||||
vc141 - Visual Studio 2017
|
||||
vc142 - Visual Studio 2019
|
||||
cbp - CodeBlocks
|
||||
xcd - XCode
|
||||
pro - Qt Creator
|
||||
@@ -347,9 +339,9 @@ proc genproj {theFormat args} {
|
||||
# base path to where to generate projects, hardcoded from current dir
|
||||
set anAdmPath [file normalize "${::path}/adm"]
|
||||
|
||||
OS:MKPRC "$anAdmPath" "$theFormat" "$aLibType" "$aPlatform" "$aCmpl" "$aSolution"
|
||||
OS:MKPRC "$anAdmPath" "$theFormat" "$aLibType" "$aPlatform" "$aCmpl"
|
||||
|
||||
genprojbat "$theFormat" "$aPlatform" "$aSolution"
|
||||
genprojbat "$theFormat" "$aPlatform"
|
||||
genAllResources
|
||||
}
|
||||
|
||||
@@ -369,8 +361,7 @@ proc copy_with_warning {from to} {
|
||||
file copy -force -- "$from" "$to"
|
||||
}
|
||||
|
||||
# Generate auxiliary scripts for launching IDE.
|
||||
proc genprojbat {theFormat thePlatform theSolution} {
|
||||
proc genprojbat {theFormat thePlatform} {
|
||||
set aTargetPlatformExt sh
|
||||
if { $thePlatform == "wnt" || $thePlatform == "uwp" } {
|
||||
set aTargetPlatformExt bat
|
||||
@@ -398,13 +389,14 @@ proc genprojbat {theFormat thePlatform theSolution} {
|
||||
copy_with_warning "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
|
||||
}
|
||||
|
||||
set aSolShList ""
|
||||
if { [regexp {^vc} $theFormat] } {
|
||||
set aSolShList "msvc.bat"
|
||||
copy_with_warning "$::THE_CASROOT/adm/templates/msvc.bat" "$::path/msvc.bat"
|
||||
} else {
|
||||
switch -exact -- "$theFormat" {
|
||||
"cbp" {
|
||||
set aSolShList { "codeblocks.sh" "codeblocks.bat" }
|
||||
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
|
||||
set aPlatformAndCompiler "${thePlatform}/gcc"
|
||||
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
|
||||
@@ -413,21 +405,9 @@ proc genprojbat {theFormat thePlatform theSolution} {
|
||||
file mkdir "$::path/${aPlatformAndCompiler}/lib"
|
||||
file mkdir "$::path/${aPlatformAndCompiler}/libd"
|
||||
}
|
||||
"xcd" { set aSolShList "xcode.sh" }
|
||||
"xcd" { file copy -force -- "$::THE_CASROOT/adm/templates/xcode.sh" "$::path/xcode.sh" }
|
||||
}
|
||||
}
|
||||
|
||||
foreach aSolSh $aSolShList {
|
||||
set anShFile [open "$::THE_CASROOT/adm/templates/${aSolSh}" "r"]
|
||||
set anShTmpl [read $anShFile]
|
||||
close $anShFile
|
||||
|
||||
regsub -all -- {__SOLUTION__} $anShTmpl "$theSolution" anShTmpl
|
||||
|
||||
set anShFile [open "$::path/${aSolSh}" "w"]
|
||||
puts $anShFile $anShTmpl
|
||||
close $anShFile
|
||||
}
|
||||
}
|
||||
|
||||
###### MSVC #############################################################33
|
||||
@@ -448,8 +428,7 @@ set THE_GUIDS_LIST($aTKNullKey) "{00000000-0000-0000-0000-000000000000}"
|
||||
# @param theLibType Library type - dynamic or static
|
||||
# @param thePlatform Optional target platform for cross-compiling, e.g. ios for iOS
|
||||
# @param theCmpl Compiler option (msvc or gcc)
|
||||
# @param theSolution Solution name
|
||||
proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl theSolution } {
|
||||
proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
|
||||
global path
|
||||
set anOutRoot $theOutDir
|
||||
if { $anOutRoot == "" } {
|
||||
@@ -513,6 +492,9 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl theSolution }
|
||||
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\""
|
||||
@@ -528,12 +510,11 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl theSolution }
|
||||
"vc11" -
|
||||
"vc12" -
|
||||
"vc14" -
|
||||
"vc141" -
|
||||
"vc142" { OS:MKVC $anOutDir $aModules $theSolution $theFormat $isUWP}
|
||||
"cbp" { OS:MKCBP $anOutDir $aModules $theSolution $thePlatform $theCmpl }
|
||||
"vc141" { OS:MKVC $anOutDir $aModules $anAllSolution $theFormat $isUWP}
|
||||
"cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution $thePlatform $theCmpl }
|
||||
"xcd" {
|
||||
set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000"
|
||||
OS:MKXCD $anOutDir $aModules $theSolution $theLibType $thePlatform
|
||||
OS:MKXCD $anOutDir $aModules $anAllSolution $theLibType $thePlatform
|
||||
}
|
||||
}
|
||||
|
||||
@@ -953,7 +934,7 @@ proc osutils:collectinc {theModules theIncPath} {
|
||||
set anIncFiles [glob -tails -nocomplain -dir ${anIncPath} "*"]
|
||||
foreach anIncFile ${anIncFiles} {
|
||||
if { [lsearch -exact ${allHeaderFiles} ${anIncFile}] == -1 } {
|
||||
puts "Warning: file ${anIncPath}/${anIncFile} is not present in the sources and will be removed from ${theIncPath}"
|
||||
puts "Warning: file ${anIncPath}/${anIncFile} is not presented in the sources and will be removed from ${theIncPath}!"
|
||||
file delete -force "${theIncPath}/${anIncFile}"
|
||||
}
|
||||
}
|
||||
@@ -984,7 +965,7 @@ proc osutils:vcsolution:header { vcversion } {
|
||||
append var \
|
||||
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
|
||||
"# Visual Studio 2013\n"
|
||||
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" || "$vcversion" == "vc142" } {
|
||||
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141"} {
|
||||
append var \
|
||||
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
|
||||
"# Visual Studio 14\n"
|
||||
@@ -1222,9 +1203,6 @@ proc osutils:vcproj:readtemplate {theVcVer isUWP isExec} {
|
||||
if { $theVcVer == "vc141" } {
|
||||
set aVCRTVer "vc14"
|
||||
set aToolset "v141"
|
||||
} elseif { $theVcVer == "vc142" } {
|
||||
set aVCRTVer "vc14"
|
||||
set aToolset "v142"
|
||||
}
|
||||
|
||||
set what "$theVcVer"
|
||||
@@ -1370,11 +1348,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
|
||||
if { "$::HAVE_LIBLZMA" == "true" } {
|
||||
set aLibsMap(CSF_LIBLZMA) "liblzma"
|
||||
}
|
||||
if { "$::HAVE_E57" == "true" && "$theOS" != "wnt" } {
|
||||
# exclude wnt, as there are different pragma lib depending on debug/release
|
||||
set aLibsMap(CSF_E57) "E57RefImpl"
|
||||
set aLibsMap(CSF_xerces) "xerces-c"
|
||||
}
|
||||
|
||||
if { "$theOS" == "wnt" } {
|
||||
# WinAPI libraries
|
||||
|
@@ -1,12 +1,11 @@
|
||||
#!/bin/bash
|
||||
# This file has been generated by genproj.tcl script from CASROOT/adm/templates/codeblocks.sh
|
||||
|
||||
export TARGET="cbp"
|
||||
|
||||
source ./env.sh "$1" "$TARGET"
|
||||
|
||||
if [ -e "/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks" ]; then
|
||||
/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks ./adm/$WOKSTATION/cbp/__SOLUTION__.workspace
|
||||
/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks ./adm/$WOKSTATION/cbp/OCCT.workspace
|
||||
else
|
||||
codeblocks ./adm/$WOKSTATION/cbp/__SOLUTION__.workspace
|
||||
codeblocks ./adm/$WOKSTATION/cbp/OCCT.workspace
|
||||
fi
|
||||
|
@@ -25,7 +25,6 @@ set "HAVE_D3D=false"
|
||||
set "HAVE_ZLIB=false"
|
||||
set "HAVE_LIBLZMA=false"
|
||||
set "HAVE_RAPIDJSON=false"
|
||||
set "HAVE_E57=false"
|
||||
set "CSF_OPT_INC="
|
||||
set "CSF_OPT_LIB32="
|
||||
set "CSF_OPT_LIB64="
|
||||
@@ -166,7 +165,6 @@ if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH
|
||||
if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
|
||||
if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
|
||||
if ["%HAVE_RAPIDJSON%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_RAPIDJSON" & set "CSF_DEFINES=HAVE_RAPIDJSON;%CSF_DEFINES%"
|
||||
if ["%HAVE_E57%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_E57" & set "CSF_DEFINES=HAVE_E57;%CSF_DEFINES%"
|
||||
|
||||
rem Eliminate VS warning
|
||||
if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"
|
||||
|
@@ -15,8 +15,6 @@ export HAVE_VTK="false";
|
||||
export HAVE_GLES2="false";
|
||||
export HAVE_ZLIB="false";
|
||||
export HAVE_LIBLZMA="false";
|
||||
export HAVE_RAPIDJSON="false";
|
||||
export HAVE_E57="false";
|
||||
export MACOSX_USE_GLX="false";
|
||||
export CSF_OPT_INC=""
|
||||
export CSF_OPT_LIB32=""
|
||||
@@ -105,8 +103,6 @@ if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -D
|
||||
if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
|
||||
if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
|
||||
if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
|
||||
if [ "$HAVE_RAPIDJSON" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_RAPIDJSON"; fi
|
||||
if [ "$HAVE_E57" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_E57"; fi
|
||||
# Option to compile OCCT with X11 libs on Mac OS X
|
||||
if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi
|
||||
|
||||
|
@@ -1,11 +1,10 @@
|
||||
@echo off
|
||||
rem This file has been generated by genproj.tcl script from CASROOT/adm/templates/msvc.bat
|
||||
|
||||
rem Setup environment
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
rem Define path to project file
|
||||
set "PRJFILE=%~dp0\adm\msvc\%VCVER%\__SOLUTION__.sln"
|
||||
set "PRJFILE=%~dp0\adm\msvc\%VCVER%\OCCT.sln"
|
||||
if not exist "%PRJFILE%" set "PRJFILE=%~dp0\adm\msvc\%VCVER%\Products.sln"
|
||||
if not "%4" == "" (
|
||||
set "PRJFILE=%4"
|
||||
|
@@ -1,8 +1,7 @@
|
||||
#!/bin/bash
|
||||
# This file has been generated by genproj.tcl script from CASROOT/adm/templates/xcode.sh
|
||||
|
||||
export TARGET="xcd"
|
||||
|
||||
source ./env.sh "$1" "$TARGET"
|
||||
|
||||
open -a Xcode ./adm/mac/xcd/__SOLUTION__.xcworkspace
|
||||
open -a Xcode ./adm/mac/xcd/OCCT.xcworkspace
|
||||
|
@@ -136,64 +136,6 @@ const char* GeomTools_Dump (void* theHandlePtr)
|
||||
Dump geometric object to cout.
|
||||
- *theHandlePtr* -- a pointer to the geometric variable (<i>Handle</i> to *Geom_Geometry* or *Geom2d_Curve* or descendant) to be set.
|
||||
|
||||
|
||||
@section occt_debug_dump_json Dump OCCT objects into Json
|
||||
|
||||
Many OCCT classes may dump the current state into the stream. This stream contains the information about the class field into the field value/s.
|
||||
It is possible to prepare recursive dump using corresponded macro for class fields. The depth of this recursion is defined by parameter of the dump.
|
||||
The object defines What parameters should be presented in the Dump. The usual way is to dump all object fields.
|
||||
|
||||
@subsection occt_debug_dump_json_object Implementation in object
|
||||
|
||||
Steps to prepare dump of the object into json:
|
||||
|
||||
1. Create method <b>DumpJson</b>. The method should accept the output stream and the depth for the fields dump.
|
||||
Depth, equal to zero means that only fields of this class should be dumped. Default value -1 means that whole tree of dump will be built recursively calling dump of all fields.
|
||||
|
||||
2. Put into the first row of the method <b>OCCT_DUMP_CLASS_BEGIN</b>. This macro creates a local variable, that will open Json structure on start, and close on exit from this method.
|
||||
|
||||
3. Add several macro to store field values.
|
||||
|
||||
The following macro are defined to cover the object parameters into json format:
|
||||
|
||||
| Name | Result in json |
|
||||
| :-------------------------- | :--------|
|
||||
| OCCT_DUMP_FIELD_VALUE_NUMERICAL | "field": value |
|
||||
| OCCT_DUMP_FIELD_VALUE_STRING | "field": "value" |
|
||||
| OCCT_DUMP_FIELD_VALUE_POINTER | "field": "pointer address" |
|
||||
| OCCT_DUMP_FIELD_VALUES_DUMPED | "field": { result of field->DumpJson(...) } |
|
||||
| OCCT_DUMP_FIELD_VALUES_NUMERICAL | "field": [value_1, ..., value_n]
|
||||
| OCCT_DUMP_FIELD_VALUES_STRING | "field": ["value_1", ..., "value_n"]
|
||||
| OCCT_DUMP_BASE_CLASS | "kind": { result of kind::DumpJson(...) } |
|
||||
|
||||
@subsection occt_debug_dump_json_draw Using in DRAW
|
||||
|
||||
In DRAW, key '-dumpJson' is used to dump an object.
|
||||
It is implemented in 'vaspect' and 'boundingbox' commands.
|
||||
|
||||
Json output for Bnd_OBB (using command 'bounding v -obb -dumpJson'):
|
||||
|
||||
~~~~~
|
||||
"Bnd_OBB": {
|
||||
"Center": {
|
||||
"gp_XYZ": [1, 2, 3]
|
||||
},
|
||||
"Axes[0]": {
|
||||
"gp_XYZ:" [1, 0, 0]
|
||||
},
|
||||
"Axes[1]": {
|
||||
"gp_XYZ:" [0, 1, 0]
|
||||
},
|
||||
"Axes[2]": {
|
||||
"gp_XYZ:" [0, 0, 1]
|
||||
},
|
||||
"HDims[0]": 0,
|
||||
"HDims[1]": 0,
|
||||
"HDims[2]": 0,
|
||||
"IsAABox": 1,
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@section occt_debug_vstudio Using Visual Studio debugger
|
||||
|
||||
@subsection occt_debug_vstudio_command Command window
|
||||
|
@@ -1584,6 +1584,10 @@ To use the custom printer in OCAF, it can be either added to default messenger o
|
||||
@subsection upgrade_740_BRepPrimAPI_MakeRevol Changes in BRepPrimAPI_MakeRevol algorithm
|
||||
Previously the algorithm could create a shape with the same degenerated edge shared between some faces. Now it is prevented. The algorithm creates the different copy of this edge for each face. The method *Generated(...)* has been changed in order to apply restriction to the input shape: input shape can be only of type VERTEX, EDGE, FACE or SOLID. For input shape of another type the method always returns empty list.
|
||||
|
||||
@subsection upgrade_740_extremaalgo Changes in behavior of Extrema algorithms
|
||||
|
||||
Since OCCT 7.4.0 exception is thrown on the attempt of taking points in case of infinite number of solution (IsParallel status). Request of distances is available as before. Method NbExt() always returns 1 in such cases.
|
||||
|
||||
@subsection upgrade_740_removed Removed features
|
||||
* The following methods of the class *BRepAlgoAPI_BooleanOperation* have been removed as obsolete or replaced:
|
||||
- *BuilderCanWork* can be replaced with *IsDone* or *HasErrors* method.
|
||||
@@ -1712,40 +1716,6 @@ aGroup->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< next array
|
||||
aGroup->AddPrimitiveArray (aLines);
|
||||
~~~~
|
||||
|
||||
@subsection upgrade_740_materials Material definition
|
||||
|
||||
Decomposition of Ambient, Diffuse, Specular and Emissive properties has been eliminated within *Graphic3d_MaterialAspect* definition.
|
||||
As result, the following methods of *Graphic3d_MaterialAspect* class have been removed: SetReflectionMode(), SetReflectionModeOn(), Ambient(), Diffuse(), Emissive(), Specular(), SetAmbient(), SetDiffuse(), SetSpecular(), SetEmissive().
|
||||
|
||||
Previously, computation of final value required the following code:
|
||||
~~~~
|
||||
Graphic3d_MaterialAspect theMaterial; Quantity_Color theInteriorColor;
|
||||
Graphic3d_Vec3 anAmbient (0.0f);
|
||||
if (theMaterial.ReflectionMode (Graphic3d_TOR_AMBIENT))
|
||||
{
|
||||
anAmbient = theMaterial.MaterialType (Graphic3d_MATERIAL_ASPECT)
|
||||
? (Graphic3d_Vec3 )theInteriorColor * theMaterial.Ambient()
|
||||
: (Graphic3d_Vec3 )theMaterial.AmbientColor() * theMaterial.Ambient();
|
||||
}
|
||||
~~~~
|
||||
|
||||
New code looks like this:
|
||||
~~~~
|
||||
Graphic3d_MaterialAspect theMaterial; Quantity_Color theInteriorColor;
|
||||
Graphic3d_Vec3 anAmbient = theMaterial.AmbientColor();
|
||||
if (theMaterial.MaterialType (Graphic3d_MATERIAL_ASPECT)) { anAmbient *= (Graphic3d_Vec3 )theInteriorColor; }
|
||||
~~~~
|
||||
|
||||
Existing code should be updated to:
|
||||
- Replace Graphic3d_MaterialAspect::SetReflectionModeOff() with setting black color; SetReflectionModeOn() calls can be simply removed.
|
||||
R.g. theMaterial.SetAmbientColor(Quantity_NOC_BLACK).
|
||||
- Replace Graphic3d_MaterialAspect::Ambient(), SetAmbient(), Diffuse(), SetDiffuse(), Specular(), SetSpecular(), Emissive(), SetEmissive() with methods working with pre-multiplied color.
|
||||
E.g. theMaterial.SetAmbientColor(Graphic3d_Vec3 (1.0f, 0.0f, 0.0f) * 0.2f).
|
||||
- Avoid using Graphic3d_MaterialAspect::Color() and SetColor() with non-physical materials (Graphic3d_MATERIAL_ASPECT).
|
||||
These materials do not include color definition, because it is taken from Graphic3d_Aspects::InteriorColor() - this has not been changed.
|
||||
However, previously it was possible storing the color with SetColor() call and then fetching it with Color() by application code (the rendering ignored this value);
|
||||
now SetColor() explicitly ignores call for Graphic3d_MATERIAL_ASPECT materials and Color() returns DiffuseColor() multiplication coefficients.
|
||||
|
||||
@subsection upgrade_740_text Changes in Graphic3d_Text and OpenGl_Text API
|
||||
|
||||
Parameters of *Text* in *Graphic3d_Group* are moved into a new *Graphic3d_Text* class. *AddText* of *Graphic3d_Group* should be used instead of the previous *Text*.
|
||||
@@ -1811,34 +1781,6 @@ Forward declarations of *Prs3d_Presentation* should be corrected, since it is no
|
||||
|
||||
Proxy classes *SelectBasics_SensitiveEntity* and *SelectBasics_EntityOwner* have been removed - *Select3D_SensitiveEntity* and *SelectMgr_EntityOwner* should be now used directly instead.
|
||||
|
||||
@subsection upgrade_740_offset Polygon offset defaults
|
||||
|
||||
*Graphic3d_PolygonOffset* default constructor has been corrected to define Units=1 instead of Units=0.
|
||||
Default polygon offset settings Mode=Aspect_POM_Fill + Factor=1 + Units=1 are intended to push triangulation
|
||||
(Shaded presentation) a little bit behind of lines (Wireframe and Face Edges)
|
||||
for reducing z-fighting effect of Shaded+Wireframe combination.
|
||||
The change in defaults (Units changed from 0 to 1) is intended to cover scenario when camera direction is perpendicular to model plane (like 2D view).
|
||||
|
||||
Application observing unexpected visual difference on this change should consider customizing this property within AIS_InteractiveContext default attributes
|
||||
or on per-presentation basis via *Graphic3d_Aspects::SetPolygonOffset()* methods.
|
||||
|
||||
@subsection upgrade_740_zlayer Adding ZLayers in given position
|
||||
|
||||
Interface of insertion ZLayer in the viewer has been improved with ability to insert new layer before or after existing one.
|
||||
Previously undocumented behavior of *V3d_Viewer::AddZlayer()* method has been corrected to insert new layer before *Graphic3d_ZLayerId_Top*.
|
||||
Applications might need revising their custom layers creation code and specify precisely their order with new methods *V3d_Viewer::InsertLayerBefore()* and *V3d_Viewer::InsertLayerAfter()*.
|
||||
|
||||
@subsection upgrade_740_enum_changed Modified enumerations
|
||||
|
||||
Applications using integer values of the following enumerations in persistence
|
||||
should be corrected as these enumerations have been modified:
|
||||
|
||||
| Name |
|
||||
| :----- |
|
||||
| AIS_TypeOfAttribute |
|
||||
| Aspect_InteriorStyle |
|
||||
| Font_FontAspect |
|
||||
|
||||
@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.
|
||||
|
@@ -48,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"
|
||||
|
2
genproj
2
genproj
@@ -40,7 +40,7 @@ if [ "$aTarget" == "" ]; then
|
||||
fi
|
||||
|
||||
cd $aScriptPath
|
||||
tclsh "./adm/start.tcl" genproj ${aTarget} -solution "OCCT" $anOpt2 $anOpt3 $anOpt4 $anOpt5
|
||||
tclsh "./adm/start.tcl" genproj ${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5
|
||||
|
||||
export PATH="$anOldPath"
|
||||
export LD_LIBRARY_PATH="$anOldLd"
|
||||
|
@@ -54,5 +54,5 @@ if "%aPrjFmt%" == "" ( set "aPrjFmt=vcxproj" )
|
||||
if "%aPrjFmt%" == "vcxproj" ( set "aPrjFmt=%VCFMT%" )
|
||||
|
||||
cd %~dp0
|
||||
%TCL_EXEC% %~dp0adm/start.tcl genproj %aPrjFmt% %aPlatform% -solution "OCCT" %3 %4 %5
|
||||
%TCL_EXEC% %~dp0adm/start.tcl genproj %aPrjFmt% %aPlatform% %3 %4 %5
|
||||
SET "PATH=%OLD_PATH%"
|
||||
|
@@ -79,10 +79,10 @@ case 6: //color
|
||||
Handle(Graphic3d_Group) mygroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||
myAspect = (new Prs3d_ShadingAspect())->Aspect();
|
||||
Graphic3d_MaterialAspect material = myAspect->FrontMaterial();
|
||||
material.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
material.SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
material.SetSpecularColor(Quantity_NOC_BLACK);
|
||||
material.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
material.SetReflectionModeOff(Graphic3d_TOR_AMBIENT);
|
||||
material.SetReflectionModeOff(Graphic3d_TOR_DIFFUSE);
|
||||
material.SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
|
||||
material.SetReflectionModeOff(Graphic3d_TOR_EMISSION);
|
||||
myAspect->SetFrontMaterial(material);
|
||||
|
||||
mygroup->SetPrimitivesAspect(myAspect);
|
||||
|
@@ -86,4 +86,3 @@ drawObjects 0 ""
|
||||
drawObjects 1 red
|
||||
drawObjects 2 green
|
||||
drawObjects 3 blue1
|
||||
vrepaint
|
||||
|
@@ -75,4 +75,4 @@ vrenderparams -ray -gi -rayDepth 10
|
||||
puts "Make several path tracing iterations to refine the picture, please wait..."
|
||||
vfps 100
|
||||
puts "Done. To improve the image further, or after view manipulations, give command:"
|
||||
puts "vfps \[nb_iteratons\] or vrepaint -continuous"
|
||||
puts "vfps \[nb_iteratons\]"
|
||||
|
@@ -85,4 +85,4 @@ vrenderparams -ray -gi -rayDepth 8
|
||||
puts "Make several path tracing iterations to refine the picture, please wait..."
|
||||
vfps 100
|
||||
puts "Done. To improve the image further, or after view manipulations, give command:"
|
||||
puts "vfps \[nb_iteratons\] or vrepaint -continuous"
|
||||
puts "vfps \[nb_iteratons\]"
|
||||
|
@@ -223,4 +223,4 @@ vrenderparams -ray -gi -rayDepth 10
|
||||
puts "Make several path tracing iterations to refine the picture, please wait..."
|
||||
vfps 512
|
||||
puts "Done. To improve the image further, or after view manipulations, give command:"
|
||||
puts "vfps \[nb_iteratons\] or vrepaint -continuous"
|
||||
puts "vfps \[nb_iteratons\]"
|
||||
|
@@ -403,17 +403,16 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation
|
||||
anArrow->AddVertex (aRightPoint);
|
||||
|
||||
// Set aspect for arrow triangles
|
||||
Graphic3d_PolygonOffset aPolOffset;
|
||||
aPolOffset.Mode = Aspect_POM_Off;
|
||||
aPolOffset.Factor = 0.0f;
|
||||
aPolOffset.Units = 0.0f;
|
||||
Handle(Graphic3d_AspectFillArea3d) aShadingStyle = new Graphic3d_AspectFillArea3d();
|
||||
aShadingStyle->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color());
|
||||
aShadingStyle->SetShadingModel (Graphic3d_TOSM_UNLIT);
|
||||
aShadingStyle->SetPolygonOffset (aPolOffset);
|
||||
Graphic3d_MaterialAspect aShadeMat (Graphic3d_NOM_DEFAULT);
|
||||
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
|
||||
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
|
||||
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
|
||||
|
||||
aGroup->SetPrimitivesAspect (aShadingStyle);
|
||||
Handle(Prs3d_ShadingAspect) aShadingStyle = new Prs3d_ShadingAspect();
|
||||
aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color());
|
||||
aShadingStyle->SetMaterial (aShadeMat);
|
||||
|
||||
aGroup->SetPrimitivesAspect (aShadingStyle->Aspect());
|
||||
aGroup->AddPrimitiveArray (anArrow);
|
||||
}
|
||||
|
||||
@@ -531,9 +530,9 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
|
||||
}
|
||||
|
||||
Graphic3d_MaterialAspect aShadeMat (Graphic3d_NOM_DEFAULT);
|
||||
aShadeMat.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
aShadeMat.SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
aShadeMat.SetSpecularColor(Quantity_NOC_BLACK);
|
||||
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
|
||||
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
|
||||
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorColor (aColor);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackInteriorColor (aColor);
|
||||
myDrawer->ShadingAspect()->SetMaterial (aShadeMat);
|
||||
|
@@ -1968,7 +1968,7 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
|
||||
}
|
||||
|
||||
const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
|
||||
unselectOwners (theIObj);
|
||||
unhighlightOwners (theIObj);
|
||||
myMainPM->SetVisibility (theIObj, aStatus->DisplayMode(), Standard_False);
|
||||
|
||||
if (!myLastPicked.IsNull()
|
||||
@@ -2000,10 +2000,10 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : unselectOwners
|
||||
//function : unhighlightOwners
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::unselectOwners (const Handle(AIS_InteractiveObject)& theObject)
|
||||
void AIS_InteractiveContext::unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject)
|
||||
{
|
||||
SelectMgr_SequenceOfOwner aSeq;
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
|
||||
@@ -2037,7 +2037,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
||||
return;
|
||||
}
|
||||
|
||||
unselectOwners (theIObj);
|
||||
unhighlightOwners (theIObj);
|
||||
|
||||
myMainPM->Erase (theIObj, -1);
|
||||
theIObj->ErasePresentations (true); // make sure highlighting presentations are properly erased
|
||||
|
@@ -1235,7 +1235,7 @@ protected: //! @name internal methods
|
||||
Standard_EXPORT Standard_Integer PurgeViewer (const Handle(V3d_Viewer)& Vwr);
|
||||
|
||||
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
|
||||
Standard_EXPORT void unselectOwners (const Handle(AIS_InteractiveObject)& theObject);
|
||||
Standard_EXPORT void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);
|
||||
|
||||
//! Helper function that highlights the owner given with <theStyle> without
|
||||
//! performing AutoHighlight checks, e.g. is used for dynamic highlight.
|
||||
@@ -1246,16 +1246,12 @@ protected: //! @name internal methods
|
||||
//! for AutoHighlight, e.g. is used for selection.
|
||||
Standard_EXPORT void highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner);
|
||||
|
||||
//! Helper function that highlights the owners with check
|
||||
//! for AutoHighlight, e.g. is used for selection.
|
||||
Standard_EXPORT void highlightOwners (const AIS_NListOfEntityOwner& theOwners);
|
||||
|
||||
//! Helper function that highlights global owner of the object given with <theStyle> with check
|
||||
//! for AutoHighlight, e.g. is used for selection.
|
||||
//! If global owner is null, it simply highlights the whole object
|
||||
Standard_EXPORT void highlightGlobal (const Handle(AIS_InteractiveObject)& theObj,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theDispMode);
|
||||
const Standard_Integer theDispMode) const;
|
||||
|
||||
//! Helper function that unhighlights all owners that are stored in current AIS_Selection.
|
||||
//! The function updates global status and selection state of owner and interactive object.
|
||||
@@ -1263,14 +1259,9 @@ protected: //! @name internal methods
|
||||
//! switched on in AIS_GlobalStatus will be highlighted with context's sub-intensity color.
|
||||
Standard_EXPORT void unhighlightSelected (const Standard_Boolean theIsToHilightSubIntensity = Standard_False);
|
||||
|
||||
//! Helper function that unhighlights the owners with check
|
||||
//! for AutoHighlight, e.g. is used for selection.
|
||||
Standard_EXPORT void unhighlightOwners (const AIS_NListOfEntityOwner& theOwners,
|
||||
const Standard_Boolean theIsToHilightSubIntensity = Standard_False);
|
||||
|
||||
//! Helper function that unhighlights global selection owner of given interactive.
|
||||
//! The function does not perform any updates of global or owner status
|
||||
Standard_EXPORT void unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj);
|
||||
Standard_EXPORT void unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj) const;
|
||||
|
||||
//! Helper function that turns on sub-intensity in global status and highlights
|
||||
//! given objects with sub-intensity color
|
||||
|
@@ -85,7 +85,6 @@ void AIS_InteractiveContext::highlightWithColor (const Handle(SelectMgr_EntityOw
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner)
|
||||
{
|
||||
AIS_NListOfEntityOwner anOwners;
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||
if (anObj.IsNull())
|
||||
{
|
||||
@@ -99,15 +98,17 @@ void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwn
|
||||
{
|
||||
if (aSelIter.Value()->IsSameSelectable (anObj))
|
||||
{
|
||||
anOwners.Append (aSelIter.Value());
|
||||
aSeq.Append (aSelIter.Value());
|
||||
}
|
||||
}
|
||||
anObj->HilightSelected (myMainPM, aSeq);
|
||||
}
|
||||
else
|
||||
{
|
||||
anOwners.Append (theOwner);
|
||||
const Handle(Prs3d_Drawer)& aStyle = getSelStyle (anObj, theOwner);
|
||||
const Standard_Integer aHiMode = getHilightMode (anObj, aStyle, -1);
|
||||
theOwner->HilightWithColor (myMainPM, aStyle, aHiMode);
|
||||
}
|
||||
highlightOwners (anOwners);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -116,7 +117,7 @@ void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwn
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject)& theObj,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theDispMode)
|
||||
const Standard_Integer theDispMode) const
|
||||
{
|
||||
if (theObj.IsNull())
|
||||
{
|
||||
@@ -132,7 +133,6 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
|
||||
return;
|
||||
}
|
||||
|
||||
AIS_NListOfEntityOwner anOwners;
|
||||
if (!aGlobOwner->IsAutoHilight())
|
||||
{
|
||||
SelectMgr_SequenceOfOwner aSeq;
|
||||
@@ -140,15 +140,15 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
|
||||
{
|
||||
if (aSelIter.Value()->IsSameSelectable (theObj))
|
||||
{
|
||||
anOwners.Append (aSelIter.Value());
|
||||
aSeq.Append (aSelIter.Value());
|
||||
}
|
||||
}
|
||||
theObj->HilightSelected (myMainPM, aSeq);
|
||||
}
|
||||
else
|
||||
{
|
||||
anOwners.Append (aGlobOwner);
|
||||
aGlobOwner->HilightWithColor (myMainPM, theStyle, aHiMode);
|
||||
}
|
||||
highlightOwners (anOwners);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -156,19 +156,9 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::unhighlightSelected (const Standard_Boolean theIsToHilightSubIntensity)
|
||||
{
|
||||
unhighlightOwners (mySelection->Objects(), theIsToHilightSubIntensity);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : unhighlightOwners
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& theOwners,
|
||||
const Standard_Boolean theIsToHilightSubIntensity)
|
||||
{
|
||||
NCollection_IndexedMap<Handle(AIS_InteractiveObject)> anObjToClear;
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
|
||||
const Handle(AIS_InteractiveObject) anInteractive = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
@@ -196,7 +186,7 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
|
||||
}
|
||||
if (anOwner == anInteractive->GlobalSelOwner())
|
||||
{
|
||||
aStatus->SetHilightStatus (Standard_False);
|
||||
myObjects.ChangeFind (anInteractive)->SetHilightStatus (Standard_False);
|
||||
}
|
||||
}
|
||||
for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
|
||||
@@ -211,7 +201,7 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
|
||||
//function : unhighlightGlobal
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj)
|
||||
void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj) const
|
||||
{
|
||||
if (theObj.IsNull())
|
||||
{
|
||||
@@ -225,9 +215,15 @@ void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObje
|
||||
return;
|
||||
}
|
||||
|
||||
AIS_NListOfEntityOwner anOwners;
|
||||
anOwners.Append (aGlobOwner);
|
||||
unhighlightOwners (anOwners);
|
||||
if (aGlobOwner->IsAutoHilight())
|
||||
{
|
||||
aGlobOwner->Unhilight (myMainPM);
|
||||
}
|
||||
else
|
||||
{
|
||||
myMainPM->Unhighlight (theObj);
|
||||
theObj->ClearSelected();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -724,27 +720,11 @@ void AIS_InteractiveContext::HilightSelected (const Standard_Boolean theToUpdate
|
||||
{
|
||||
// In case of selection without using local context
|
||||
clearDynamicHighlight();
|
||||
|
||||
highlightOwners (mySelection->Objects());
|
||||
|
||||
if (theToUpdateViewer)
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : highlightOwners
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theOwners)
|
||||
{
|
||||
AIS_MapOfObjSelectedOwners anObjOwnerMap;
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
if (anObj.IsNull())
|
||||
continue;
|
||||
|
||||
const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
|
||||
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind(anObj);
|
||||
if (anOwner == anObj->GlobalSelOwner())
|
||||
@@ -781,6 +761,9 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
|
||||
}
|
||||
anObjOwnerMap.Clear();
|
||||
}
|
||||
|
||||
if (theToUpdateViewer)
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -789,7 +772,17 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::UnhilightSelected (const Standard_Boolean theToUpdateViewer)
|
||||
{
|
||||
unhighlightSelected();
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
if (anOwner == anObj->GlobalSelOwner())
|
||||
{
|
||||
myObjects.ChangeFind (anObj)->SetHilightStatus (Standard_False);
|
||||
}
|
||||
|
||||
anOwner->Unhilight (myMainPM);
|
||||
}
|
||||
|
||||
if (theToUpdateViewer)
|
||||
UpdateCurrentViewer();
|
||||
@@ -944,6 +937,13 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
|
||||
}
|
||||
}
|
||||
|
||||
if (myAutoHilight && theOwner == anObject->GlobalSelOwner())
|
||||
{
|
||||
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (anObject);
|
||||
aState->SetHilightStatus (Standard_True);
|
||||
aState->SetHilightStyle (anObjSelStyle);
|
||||
}
|
||||
|
||||
if (theToUpdateViewer)
|
||||
UpdateCurrentViewer();
|
||||
}
|
||||
@@ -990,17 +990,28 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
|
||||
if (myAutoHilight)
|
||||
{
|
||||
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
|
||||
const Standard_Boolean isGlobal = anObj->GlobalSelOwner() == theOwner;
|
||||
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
|
||||
if (theOwner->IsSelected())
|
||||
{
|
||||
highlightSelected (theOwner);
|
||||
if (isGlobal)
|
||||
{
|
||||
aStatus->SetHilightStatus (Standard_True);
|
||||
aStatus->SetHilightStyle (getSelStyle (anObj, theOwner));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AIS_NListOfEntityOwner anOwners;
|
||||
anOwners.Append (theOwner);
|
||||
unhighlightOwners (anOwners);
|
||||
|
||||
if (theOwner->IsAutoHilight())
|
||||
{
|
||||
theOwner->Unhilight (myMainPM);
|
||||
}
|
||||
else
|
||||
{
|
||||
anObj->ClearSelected();
|
||||
}
|
||||
aStatus->SetHilightStatus (Standard_False);
|
||||
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
|
||||
}
|
||||
}
|
||||
|
@@ -143,16 +143,3 @@ void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& theAspect
|
||||
aGroup->SetGroupPrimitivesAspect (aTextAspect->Aspect());
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, AIS_InteractiveObject);
|
||||
|
||||
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_SelectableObject);
|
||||
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCTXPtr);
|
||||
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwner);
|
||||
}
|
||||
|
@@ -118,8 +118,6 @@ public:
|
||||
Standard_DEPRECATED("Deprecated method, results might be undefined")
|
||||
Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect);
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
|
||||
protected:
|
||||
|
||||
//! The TypeOfPresention3d means that the interactive object
|
||||
|
@@ -132,7 +132,7 @@ void AIS_Manipulator::init()
|
||||
myAxes[2] = Axis (gp::OZ(), Quantity_NOC_BLUE1);
|
||||
|
||||
Graphic3d_MaterialAspect aShadingMaterial;
|
||||
aShadingMaterial.SetSpecularColor(Quantity_NOC_BLACK);
|
||||
aShadingMaterial.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
|
||||
aShadingMaterial.SetMaterialType (Graphic3d_MATERIAL_ASPECT);
|
||||
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
@@ -142,10 +142,10 @@ void AIS_Manipulator::init()
|
||||
|
||||
Graphic3d_MaterialAspect aHilightMaterial;
|
||||
aHilightMaterial.SetColor (Quantity_NOC_AZURE);
|
||||
aHilightMaterial.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
aHilightMaterial.SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
aHilightMaterial.SetSpecularColor(Quantity_NOC_BLACK);
|
||||
aHilightMaterial.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
aHilightMaterial.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
|
||||
aHilightMaterial.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
|
||||
aHilightMaterial.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
|
||||
aHilightMaterial.SetReflectionModeOff (Graphic3d_TOR_EMISSION);
|
||||
aHilightMaterial.SetMaterialType (Graphic3d_MATERIAL_ASPECT);
|
||||
|
||||
myHighlightAspect = new Prs3d_ShadingAspect();
|
||||
@@ -153,10 +153,11 @@ void AIS_Manipulator::init()
|
||||
myHighlightAspect->SetMaterial (aHilightMaterial);
|
||||
|
||||
Graphic3d_MaterialAspect aDraggerMaterial;
|
||||
aDraggerMaterial.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
aDraggerMaterial.SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
aDraggerMaterial.SetSpecularColor(Quantity_NOC_BLACK);
|
||||
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);
|
||||
|
@@ -637,7 +637,7 @@ void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Boolean theToKeepColor,
|
||||
const Standard_Boolean theToKeepTransp) const
|
||||
{
|
||||
const Quantity_Color aColor = theDrawer->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
const Quantity_Color aColor = theDrawer->ShadingAspect()->Material (myCurrentFacingModel).Color();
|
||||
const Standard_Real aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
|
||||
theDrawer->SetupOwnShadingAspect();
|
||||
theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
|
||||
|
@@ -137,7 +137,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
|
||||
Standard_Integer i;
|
||||
Standard_Integer j;
|
||||
|
||||
const Standard_Real ambient = 0.2;
|
||||
Standard_Real ambient = aspect->FrontMaterial().Ambient();
|
||||
if (hasVNormals)
|
||||
{
|
||||
const TShort_Array1OfShortReal& normals = myTriangulation->Normals();
|
||||
|
@@ -223,10 +223,10 @@ void AIS_ViewCube::setDefaultAttributes()
|
||||
void AIS_ViewCube::setDefaultHighlightAttributes()
|
||||
{
|
||||
Graphic3d_MaterialAspect aHighlightMaterial;
|
||||
aHighlightMaterial.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
aHighlightMaterial.SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
aHighlightMaterial.SetSpecularColor(Quantity_NOC_BLACK);
|
||||
aHighlightMaterial.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
aHighlightMaterial.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
|
||||
aHighlightMaterial.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
|
||||
aHighlightMaterial.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
|
||||
aHighlightMaterial.SetReflectionModeOff (Graphic3d_TOR_EMISSION);
|
||||
aHighlightMaterial.SetMaterialType (Graphic3d_MATERIAL_ASPECT);
|
||||
myDynHilightDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
myDynHilightDrawer->ShadingAspect()->SetMaterial (aHighlightMaterial);
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||
#include <BRepClass_FaceClassifier.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
@@ -94,14 +94,8 @@ void BRepExtrema_ExtCF::Perform(const TopoDS_Edge& E, const TopoDS_Face& F2)
|
||||
else
|
||||
{
|
||||
// Exploration of points and classification
|
||||
BRepClass_FaceClassifier classifier;
|
||||
const Standard_Real Tol = BRep_Tool::Tolerance(F2);
|
||||
BRepTopAdaptor_FClass2d classifier (F2, Tol);
|
||||
|
||||
// If the underlying surface of the face is periodic
|
||||
// Extrema should return the point within the period,
|
||||
// so there is no point to adjust it in classifier.
|
||||
Standard_Boolean isAdjustPeriodic = Standard_False;
|
||||
|
||||
Extrema_POnCurv P1;
|
||||
Extrema_POnSurf P2;
|
||||
|
||||
@@ -110,7 +104,8 @@ void BRepExtrema_ExtCF::Perform(const TopoDS_Edge& E, const TopoDS_Face& F2)
|
||||
myExtCS.Points(i, P1, P2);
|
||||
P2.Parameter(U1, U2);
|
||||
const gp_Pnt2d Puv(U1, U2);
|
||||
const TopAbs_State state = classifier.Perform (Puv, isAdjustPeriodic);
|
||||
classifier.Perform(F2, Puv, Tol);
|
||||
const TopAbs_State state = classifier.State();
|
||||
if (state == TopAbs_ON || state == TopAbs_IN)
|
||||
{
|
||||
mySqDist.Append(myExtCS.SquareDistance(i));
|
||||
|
@@ -91,50 +91,31 @@ static gp_Vec MakeFinVec( const TopoDS_Wire aWire, const TopoDS_Vertex aVertex )
|
||||
|
||||
static TopoDS_Wire WireFromList(TopTools_ListOfShape& Edges)
|
||||
{
|
||||
BRep_Builder BB;
|
||||
TopoDS_Wire aWire;
|
||||
BB.MakeWire(aWire);
|
||||
BRepLib_MakeWire MW;
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(Edges.First());
|
||||
BB.Add(aWire, anEdge);
|
||||
MW.Add(anEdge);
|
||||
Edges.RemoveFirst();
|
||||
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(anEdge, V1, V2, Standard_True); //with orientation
|
||||
|
||||
while (!Edges.IsEmpty())
|
||||
{
|
||||
TopoDS_Wire CurWire = MW.Wire();
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(CurWire, V1, V2);
|
||||
TopTools_ListIteratorOfListOfShape itl(Edges);
|
||||
for (; itl.More(); itl.Next())
|
||||
{
|
||||
anEdge = TopoDS::Edge(itl.Value());
|
||||
TopoDS_Vertex V3, V4;
|
||||
TopExp::Vertices(anEdge, V3, V4, Standard_True); //with orientation
|
||||
TopExp::Vertices(anEdge, V3, V4);
|
||||
if (V1.IsSame(V3) || V1.IsSame(V4) ||
|
||||
V2.IsSame(V3) || V2.IsSame(V4))
|
||||
{
|
||||
if (V1.IsSame(V3))
|
||||
{
|
||||
anEdge.Reverse();
|
||||
V1 = V4;
|
||||
}
|
||||
else if (V1.IsSame(V4))
|
||||
V1 = V3;
|
||||
else if (V2.IsSame(V3))
|
||||
V2 = V4;
|
||||
else
|
||||
{
|
||||
anEdge.Reverse();
|
||||
V2 = V3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
BB.Add(aWire, anEdge);
|
||||
MW.Add(anEdge);
|
||||
Edges.Remove(itl);
|
||||
}
|
||||
|
||||
aWire.Closed(Standard_True);
|
||||
return aWire;
|
||||
return (MW.Wire());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -726,6 +707,8 @@ void BRepFill_Filling::Build()
|
||||
}
|
||||
|
||||
TopoDS_Wire FinalWire = WireFromList(FinalEdges);
|
||||
if (!(FinalWire.Closed()))
|
||||
throw Standard_Failure("Wire is not closed");
|
||||
|
||||
myFace = BRepLib_MakeFace( Surface, FinalWire );
|
||||
}
|
||||
|
@@ -126,8 +126,8 @@ void BRepMesh_DefaultRangeSplitter::computeTolerance(
|
||||
const Standard_Real aDiffV = myRangeV.second - myRangeV.first;
|
||||
|
||||
const Standard_Real aDeflectionUV = 1.e-05;
|
||||
myTolerance.first = Max(Min(aDeflectionUV, 0.1 * aDiffU), 1e-7 * aDiffU);
|
||||
myTolerance.second = Max(Min(aDeflectionUV, 0.1 * aDiffV), 1e-7 * aDiffV);
|
||||
myTolerance.first = Max(aDeflectionUV, Precision::Confusion() * aDiffU);
|
||||
myTolerance.second = Max(aDeflectionUV, Precision::Confusion() * aDiffV);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -245,30 +245,6 @@ void BRepMesh_ModelHealer::process(const IMeshData::IFaceHandle& theDFace) const
|
||||
#endif
|
||||
aIntersections = aChecker.GetIntersectingEdges();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (theDFace->WiresNb () == 1)
|
||||
{
|
||||
const IMeshData::IWireHandle& aDWire = theDFace->GetWire (0);
|
||||
|
||||
if (aDWire->EdgesNb () == 2)
|
||||
{
|
||||
const IMeshData::IEdgePtr& aDEdge0 = aDWire->GetEdge (0);
|
||||
const IMeshData::IEdgePtr& aDEdge1 = aDWire->GetEdge (1);
|
||||
|
||||
const IMeshData::IPCurveHandle& aPCurve0 = aDEdge0->GetPCurve (theDFace.get (), aDWire->GetEdgeOrientation (0));
|
||||
const IMeshData::IPCurveHandle& aPCurve1 = aDEdge1->GetPCurve (theDFace.get (), aDWire->GetEdgeOrientation (1));
|
||||
|
||||
if (aPCurve0->ParametersNb () == 2 && aPCurve1->ParametersNb () == 2)
|
||||
{
|
||||
aIntersections = new IMeshData::MapOfIEdgePtr;
|
||||
// a kind of degenerated face - 1 wire, 2 edges and both edges are very small
|
||||
aIntersections->Add (aDEdge0);
|
||||
aIntersections->Add (aDEdge1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure const&)
|
||||
|
@@ -233,8 +233,7 @@ void BRepOffset_SimpleOffset::FillFaceData(const TopoDS_Face& theFace)
|
||||
if (theFace.Orientation() == TopAbs_REVERSED)
|
||||
aMult = -1.0;
|
||||
|
||||
BRepOffset_Status aStatus; // set by BRepOffset::Surface(), could be used to check result...
|
||||
aNFD.myOffsetS = BRepOffset::Surface (aS, aMult * myOffsetValue, aStatus, Standard_True);
|
||||
aNFD.myOffsetS = new Geom_OffsetSurface(aS, aMult * myOffsetValue, Standard_True);
|
||||
aNFD.myL = TopLoc_Location(); // Null transformation.
|
||||
|
||||
// Save offset surface in map.
|
||||
|
@@ -55,9 +55,6 @@
|
||||
#include <Draw_Marker3D.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
Standard_IMPORT Draw_Viewer dout;
|
||||
@@ -501,7 +498,6 @@ static Standard_Integer BoundBox(Draw_Interpretor& theDI,
|
||||
Bnd_Box anAABB;
|
||||
|
||||
Standard_Boolean doPrint = Standard_False;
|
||||
Standard_Boolean doDumpJson = Standard_False;
|
||||
Standard_Boolean useOldSyntax = Standard_False;
|
||||
Standard_Boolean isOBB = Standard_False;
|
||||
Standard_Boolean isTriangulationReq = Standard_True;
|
||||
@@ -536,10 +532,6 @@ static Standard_Integer BoundBox(Draw_Interpretor& theDI,
|
||||
{
|
||||
doPrint = Standard_True;
|
||||
}
|
||||
else if (anArgCase == "-dumpjson")
|
||||
{
|
||||
doDumpJson = Standard_True;
|
||||
}
|
||||
else if (anArgCase == "-save"
|
||||
&& anArgIter + 6 < theNArg
|
||||
&& anOutVars[0].IsEmpty())
|
||||
@@ -609,7 +601,7 @@ static Standard_Integer BoundBox(Draw_Interpretor& theDI,
|
||||
}
|
||||
|
||||
// enable printing (old syntax) if neither saving to shape nor to DRAW variables is requested
|
||||
if (! doPrint && ! doDumpJson && anOutVars[0].IsEmpty() && aResShapeName.IsEmpty())
|
||||
if (! doPrint && anOutVars[0].IsEmpty() && aResShapeName.IsEmpty())
|
||||
{
|
||||
doPrint = Standard_True;
|
||||
useOldSyntax = Standard_True;
|
||||
@@ -644,15 +636,6 @@ static Standard_Integer BoundBox(Draw_Interpretor& theDI,
|
||||
<< "Half Z: " << anOBB.ZHSize() << "\n";
|
||||
}
|
||||
|
||||
if (doDumpJson)
|
||||
{
|
||||
Standard_SStream aStream;
|
||||
anOBB.DumpJson (aStream);
|
||||
|
||||
theDI << "Oriented bounding box\n";
|
||||
theDI << Standard_Dump::FormatJson (aStream);
|
||||
}
|
||||
|
||||
if (hasToDraw
|
||||
&& !anOBB.IsVoid())
|
||||
{
|
||||
@@ -720,15 +703,6 @@ static Standard_Integer BoundBox(Draw_Interpretor& theDI,
|
||||
}
|
||||
}
|
||||
|
||||
if (doDumpJson)
|
||||
{
|
||||
Standard_SStream aStream;
|
||||
anAABB.DumpJson (aStream);
|
||||
|
||||
theDI << "Bounding box\n";
|
||||
theDI << Standard_Dump::FormatJson (aStream);
|
||||
}
|
||||
|
||||
// save DRAW variables
|
||||
if (!anOutVars[0].IsEmpty())
|
||||
{
|
||||
@@ -1501,7 +1475,7 @@ void BRepTest::BasicCommands(Draw_Interpretor& theCommands)
|
||||
theCommands.Add ("bounding",
|
||||
"bounding {shape | xmin ymin zmin xmax ymax zmax}"
|
||||
"\n\t\t: [-obb] [-noTriangulation] [-optimal] [-extToler]"
|
||||
"\n\t\t: [-dump] [-print] [-dumpJson] [-shape name] [-nodraw] [-finitePart]"
|
||||
"\n\t\t: [-dump] [-shape name] [-nodraw] [-finitePart]"
|
||||
"\n\t\t: [-save xmin ymin zmin xmax ymax zmax]"
|
||||
"\n\t\t:"
|
||||
"\n\t\t: Computes a bounding box. Two types of the source data are supported:"
|
||||
@@ -1519,10 +1493,8 @@ void BRepTest::BasicCommands(Draw_Interpretor& theCommands)
|
||||
"\n\t\t:"
|
||||
"\n\t\t: Output options:"
|
||||
"\n\t\t: -dump Prints the information about computed Bounding Box."
|
||||
"\n\t\t: -print Prints the information about computed Bounding Box."
|
||||
"\n\t\t: It is enabled by default (with plain old syntax for AABB)"
|
||||
"\n\t\t: if neither -shape nor -save is specified."
|
||||
"\n\t\t: -dumpJson Prints DumpJson information about Bounding Box."
|
||||
"\n\t\t: -shape Stores computed box as solid in DRAW variable with specified name."
|
||||
"\n\t\t: -save Stores min and max coordinates of AABB in specified variables."
|
||||
"\n\t\t: -noDraw Avoid drawing resulting Bounding Box in DRAW viewer."
|
||||
|
@@ -19,7 +19,6 @@
|
||||
#include <BVH_Constants.hxx>
|
||||
#include <BVH_Types.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
#include <limits>
|
||||
|
||||
@@ -109,14 +108,6 @@ public:
|
||||
//! Returns center of bounding box along the given axis.
|
||||
T Center (const Standard_Integer theAxis) const;
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
|
||||
{
|
||||
(void)theDepth;
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_Box);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsValid());
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
//! Checks if the Box is out of the other box.
|
||||
|
@@ -27,13 +27,6 @@ class BVH_TreeBaseTransient : public Standard_Transient
|
||||
DEFINE_STANDARD_RTTIEXT(BVH_TreeBaseTransient, Standard_Transient)
|
||||
protected:
|
||||
BVH_TreeBaseTransient() {}
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const { (void)theOStream; (void)theDepth; }
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
virtual void DumpNode (const int theNodeIndex, Standard_OStream& theOStream, const Standard_Integer theDepth) const
|
||||
{ (void)theNodeIndex; (void)theOStream; (void)theDepth; }
|
||||
};
|
||||
|
||||
//! Stores parameters of bounding volume hierarchy (BVH).
|
||||
@@ -185,36 +178,6 @@ public: //! @name methods for accessing serialized tree data
|
||||
return myMaxPointBuffer;
|
||||
}
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_TreeBase);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDepth);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Length());
|
||||
|
||||
for (Standard_Integer aNodeIdx = 0; aNodeIdx < Length(); ++aNodeIdx)
|
||||
{
|
||||
DumpNode (aNodeIdx, theOStream, theDepth);
|
||||
}
|
||||
}
|
||||
|
||||
//! Dumps the content of node into the stream
|
||||
virtual void DumpNode (const int theNodeIndex, Standard_OStream& theOStream, const Standard_Integer theDepth) const Standard_OVERRIDE
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_TreeNode);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, theNodeIndex);
|
||||
|
||||
Bnd_Box aBndBox = BVH::ToBndBox (MinPoint (theNodeIndex), MaxPoint (theNodeIndex));
|
||||
Bnd_Box* aPointer = &aBndBox;
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aPointer);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, BegPrimitive (theNodeIndex));
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, EndPrimitive (theNodeIndex));
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Level (theNodeIndex));
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsOuter (theNodeIndex));
|
||||
}
|
||||
|
||||
public: //! @name protected fields
|
||||
|
||||
//! Array of node data records.
|
||||
|
@@ -21,12 +21,10 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <NCollection_Mat4.hxx>
|
||||
#include <NCollection_Vec2.hxx>
|
||||
#include <NCollection_Vec3.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
// GCC supports shrink function only in C++11 mode
|
||||
@@ -59,32 +57,6 @@ namespace BVH
|
||||
typedef NCollection_Vec3<T> Type;
|
||||
};
|
||||
|
||||
template<class T> Bnd_Box ToBndBox (const T& theMin, const T& theMax)
|
||||
{
|
||||
return Bnd_Box (gp_Pnt (theMin, 0., 0.), gp_Pnt (theMax, 0., 0.));
|
||||
}
|
||||
|
||||
template<class T> Bnd_Box ToBndBox (const NCollection_Vec2<T>& theMin,
|
||||
const NCollection_Vec2<T>& theMax)
|
||||
{
|
||||
return Bnd_Box (gp_Pnt (theMin.x(), theMin.y(), 0.),
|
||||
gp_Pnt (theMax.x(), theMax.y(), 0.));
|
||||
}
|
||||
|
||||
template<class T> Bnd_Box ToBndBox (const NCollection_Vec3<T>& theMin,
|
||||
const NCollection_Vec3<T>& theMax)
|
||||
{
|
||||
return Bnd_Box (gp_Pnt (theMin.x(), theMin.y(), theMin.z()),
|
||||
gp_Pnt (theMax.x(), theMax.y(), theMax.z()));
|
||||
}
|
||||
|
||||
template<class T> Bnd_Box ToBndBox (const NCollection_Vec4<T>& theMin,
|
||||
const NCollection_Vec4<T>& theMax)
|
||||
{
|
||||
return Bnd_Box (gp_Pnt (theMin.x(), theMin.y(), theMin.z()),
|
||||
gp_Pnt (theMax.x(), theMax.y(), theMax.z()));
|
||||
}
|
||||
|
||||
template<class T> struct VectorType<T, 4>
|
||||
{
|
||||
typedef NCollection_Vec4<T> Type;
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
// set the flag to one
|
||||
#define ClearVoidFlag() ( Flags &= ~VoidMask )
|
||||
@@ -44,18 +43,6 @@ Bnd_Box::Bnd_Box()
|
||||
SetVoid();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Bnd_Box
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Bnd_Box::Bnd_Box (const gp_Pnt theMin, const gp_Pnt theMax)
|
||||
: Gap (0.0)
|
||||
{
|
||||
SetVoid();
|
||||
Update (theMin.X(), theMin.Y(), theMin.Z(), theMax.X(), theMax.Y(), theMax.Z());
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
@@ -970,18 +957,3 @@ void Bnd_Box::Dump () const
|
||||
std::cout << "\n Gap : " << Gap;
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Bnd_Box::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_Box);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMin", 3, Xmin, Ymin, Zmin)
|
||||
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMax", 3, Xmax, Ymax, Zmax)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags);
|
||||
}
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
@@ -70,11 +69,6 @@ public:
|
||||
//! The constructed box is qualified Void. Its gap is null.
|
||||
Standard_EXPORT Bnd_Box();
|
||||
|
||||
//! Creates a bounding box, it contains:
|
||||
//! - minimum/maximum point of bouning box,
|
||||
//! The constructed box is qualified Void. Its gap is null.
|
||||
Standard_EXPORT Bnd_Box (const gp_Pnt theMin, const gp_Pnt theMax);
|
||||
|
||||
//! Sets this bounding box so that it covers the whole of 3D space.
|
||||
//! It is infinitely long in all directions.
|
||||
void SetWhole() { Flags = WholeMask; }
|
||||
@@ -302,9 +296,6 @@ public:
|
||||
&& Xmax >= Xmin;
|
||||
}
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
|
||||
|
||||
protected:
|
||||
|
||||
//! Bit flags.
|
||||
|
@@ -24,7 +24,6 @@
|
||||
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
//! Auxiliary class to select from the points stored in
|
||||
@@ -973,71 +972,23 @@ Standard_Boolean Bnd_OBB::IsCompletelyInside(const Bnd_OBB& theOther) const
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Bnd_OBB::Add(const gp_Pnt& theP)
|
||||
{
|
||||
if (IsVoid())
|
||||
{
|
||||
myCenter = theP.XYZ();
|
||||
myAxes[0] = gp::DX().XYZ();
|
||||
myAxes[1] = gp::DY().XYZ();
|
||||
myAxes[2] = gp::DZ().XYZ();
|
||||
myHDims[0] = 0.0;
|
||||
myHDims[1] = 0.0;
|
||||
myHDims[2] = 0.0;
|
||||
myIsAABox = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
gp_Pnt aList[9];
|
||||
GetVertex(aList);
|
||||
aList[8] = theP;
|
||||
|
||||
ReBuild(TColgp_Array1OfPnt(aList[0], 0, 8));
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Add
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Bnd_OBB::Add(const Bnd_OBB& theOther)
|
||||
{
|
||||
if (!theOther.IsVoid())
|
||||
{
|
||||
if (IsVoid())
|
||||
{
|
||||
myCenter = theOther.myCenter;
|
||||
myAxes[0] = theOther.myAxes[0];
|
||||
myAxes[1] = theOther.myAxes[1];
|
||||
myAxes[2] = theOther.myAxes[2];
|
||||
myHDims[0] = theOther.myHDims[0];
|
||||
myHDims[1] = theOther.myHDims[1];
|
||||
myHDims[2] = theOther.myHDims[2];
|
||||
myIsAABox = theOther.myIsAABox;
|
||||
}
|
||||
else
|
||||
{
|
||||
gp_Pnt aList[16];
|
||||
GetVertex(&aList[0]);
|
||||
theOther.GetVertex(&aList[8]);
|
||||
ReBuild(TColgp_Array1OfPnt(aList[0], 0, 15));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Bnd_OBB::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_OBB);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter);
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[0]);
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[1]);
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[2]);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[0]);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[1]);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[2]);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsAABox);
|
||||
}
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
@@ -282,9 +281,6 @@ public:
|
||||
//! (which it was created from) and theP.
|
||||
Standard_EXPORT void Add(const gp_Pnt& theP);
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
|
||||
|
||||
protected:
|
||||
|
||||
void ProcessOnePoint(const gp_Pnt& theP)
|
||||
|
@@ -15,7 +15,6 @@
|
||||
|
||||
|
||||
#include <Bnd_Range.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Common
|
||||
@@ -176,15 +175,3 @@ void Bnd_Range::Split(const Standard_Real theVal,
|
||||
theList.Append(Bnd_Range(aValPrev, myLast));
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DumpJson
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Bnd_Range::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_Range);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirst);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLast);
|
||||
}
|
||||
|
@@ -256,9 +256,6 @@ public:
|
||||
return ((myFirst == theOther.myFirst) && (myLast == theOther.myLast));
|
||||
}
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
|
||||
|
||||
private:
|
||||
|
||||
Standard_Real myFirst; //!< Start of range
|
||||
|
@@ -437,7 +437,7 @@ static void CurveHermite (const TopOpeBRepDS_DataStructure& DStr,
|
||||
GeomAdaptor_Curve L (Bezier);
|
||||
Extrema_ExtCC ext (C,L);
|
||||
if (ext.IsDone()){
|
||||
if (!ext.IsParallel() && ext.NbExt()!=0){
|
||||
if (ext.NbExt()!=0){
|
||||
Extrema_POnCurv POnC, POnL;
|
||||
ext.Points(1, POnC, POnL);
|
||||
if (POnC.Value().Distance(POnL.Value()) < Precision::Confusion())
|
||||
|
@@ -17,13 +17,12 @@
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
#include <COMMANDWINDOW.h>
|
||||
#include <Draw_Window.hxx>
|
||||
#include <MAINWINDOW.h>
|
||||
#include <Draw_Appli.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#include <MainWindow.h>
|
||||
#include <CommandWindow.h>
|
||||
|
||||
#define CLIENTWND 0
|
||||
|
||||
#define THE_PROMPT L"Command >> "
|
||||
|
@@ -490,7 +490,7 @@ static unsigned int __stdcall CpuFunc (void * /*param*/)
|
||||
aTimer.Stop();
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
std::cout << "Info: CPU limit (" << CPU_LIMIT << " sec) has been reached but ignored because of attached Debugger" << std::endl;
|
||||
std::cout << "ERROR: CPU limit (" << CPU_LIMIT << " sec) has been reached but ignored because of attached Debugger" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -504,7 +504,7 @@ static unsigned int __stdcall CpuFunc (void * /*param*/)
|
||||
aTimer.Stop();
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
std::cout << "Info: Elapsed limit (" << CPU_LIMIT << " sec) has been reached but ignored because of attached Debugger" << std::endl;
|
||||
std::cout << "ERROR: Elapsed limit (" << CPU_LIMIT << " sec) has been reached but ignored because of attached Debugger" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -913,70 +913,21 @@ static int dperf (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char
|
||||
|
||||
static int dsetsignal (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
|
||||
{
|
||||
OSD_SignalMode aMode = OSD_SignalMode_Set;
|
||||
Standard_Boolean aSetFPE = OSD::ToCatchFloatingSignals();
|
||||
|
||||
// default for FPE signal is defined by CSF_FPE variable, if set
|
||||
OSD_Environment aEnv("CSF_FPE");
|
||||
TCollection_AsciiString aEnvStr = aEnv.Value();
|
||||
if (!aEnvStr.IsEmpty())
|
||||
{
|
||||
aSetFPE = (aEnvStr.Value(1) != '0');
|
||||
}
|
||||
|
||||
// parse arguments
|
||||
for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter)
|
||||
{
|
||||
TCollection_AsciiString anArg(theArgVec[anArgIter]);
|
||||
anArg.LowerCase();
|
||||
if (anArg == "asis")
|
||||
{
|
||||
aMode = OSD_SignalMode_AsIs;
|
||||
}
|
||||
else if (anArg == "set")
|
||||
{
|
||||
aMode = OSD_SignalMode_Set;
|
||||
}
|
||||
else if (anArg == "unhandled")
|
||||
{
|
||||
aMode = OSD_SignalMode_SetUnhandled;
|
||||
}
|
||||
else if (anArg == "unset")
|
||||
{
|
||||
aMode = OSD_SignalMode_Unset;
|
||||
}
|
||||
else if (anArg == "1" || anArg == "on")
|
||||
{
|
||||
aSetFPE = Standard_True;
|
||||
}
|
||||
else if (anArg == "0" || anArg == "off")
|
||||
{
|
||||
aSetFPE = Standard_False;
|
||||
}
|
||||
else if (anArg == "default")
|
||||
// arm FPE handler if argument is provided and its first symbol is not '0'
|
||||
// or if environment variable CSF_FPE is set and its first symbol is not '0'
|
||||
bool setFPE = false;
|
||||
if (theArgNb > 1)
|
||||
{
|
||||
setFPE = (theArgVec[1][0] == '1' || theArgVec[1][0] == 't');
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Syntax error: unknown argument '" << anArg << "'\n";
|
||||
return 1;
|
||||
OSD_Environment aEnv ("CSF_FPE");
|
||||
TCollection_AsciiString aEnvStr = aEnv.Value();
|
||||
setFPE = (! aEnvStr.IsEmpty() && aEnvStr.Value(1) != '0');
|
||||
}
|
||||
}
|
||||
|
||||
OSD::SetSignal(aMode, aSetFPE);
|
||||
|
||||
// report actual status in the end
|
||||
const char* aModeStr = 0;
|
||||
switch (OSD::SignalMode())
|
||||
{
|
||||
default:
|
||||
case OSD_SignalMode_AsIs: aModeStr = "asis"; break;
|
||||
case OSD_SignalMode_Set: aModeStr = "set"; break;
|
||||
case OSD_SignalMode_SetUnhandled: aModeStr = "unhandled"; break;
|
||||
case OSD_SignalMode_Unset: aModeStr = "unset"; break;
|
||||
}
|
||||
theDI << "Signal mode: " << aModeStr << "\n"
|
||||
<< "Catch FPE: " << (OSD::ToCatchFloatingSignals() ? "1" : "0") << "\n";
|
||||
OSD::SetSignal (setFPE);
|
||||
theDI << "Signal handlers are set, with FPE " << (setFPE ? "armed" : "disarmed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1106,7 +1057,7 @@ void Draw::BasicCommands(Draw_Interpretor& theCommands)
|
||||
__FILE__, dmeminfo, g);
|
||||
theCommands.Add("dperf","dperf [reset] -- show performance counters, reset if argument is provided",
|
||||
__FILE__,dperf,g);
|
||||
theCommands.Add("dsetsignal","dsetsignal [{asis|set|unhandled|unset}=set] [{0|1|default=$CSF_FPE}]\n -- set OSD signal handler, with FPE option if argument is given",
|
||||
theCommands.Add("dsetsignal","dsetsignal [fpe=0] -- set OSD signal handler, with FPE option if argument is given",
|
||||
__FILE__,dsetsignal,g);
|
||||
|
||||
theCommands.Add("dparallel",
|
||||
|
@@ -19,9 +19,8 @@
|
||||
#include <windows.h>
|
||||
#include <DrawRessource.h>
|
||||
#include <init.h>
|
||||
#include <Draw_Window.hxx>
|
||||
|
||||
#include <MainWindow.h>
|
||||
#include <Draw_Window.hxx>
|
||||
#include <CommandWindow.h>
|
||||
|
||||
Standard_Boolean Draw_Interprete(const char* command); // Implemented in Draw.cxx
|
||||
|
@@ -28,7 +28,9 @@
|
||||
#include <Standard_Address.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_CurveTool;
|
||||
class Extrema_POnCurv;
|
||||
@@ -36,6 +38,7 @@ class gp_Pnt;
|
||||
class gp_Vec;
|
||||
|
||||
|
||||
|
||||
class Extrema_ECC
|
||||
{
|
||||
public:
|
||||
|
@@ -28,7 +28,9 @@
|
||||
#include <Standard_Address.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_Curve2dTool;
|
||||
class Extrema_POnCurv2d;
|
||||
@@ -36,6 +38,7 @@ class gp_Pnt2d;
|
||||
class gp_Vec2d;
|
||||
|
||||
|
||||
|
||||
class Extrema_ECC2d
|
||||
{
|
||||
public:
|
||||
|
@@ -16,6 +16,9 @@
|
||||
|
||||
#include <Extrema_ECC2d.hxx>
|
||||
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
#include <Extrema_Curve2dTool.hxx>
|
||||
#include <Extrema_ExtPC2d.hxx>
|
||||
|
@@ -16,6 +16,9 @@
|
||||
|
||||
#include <Extrema_ECC.hxx>
|
||||
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Extrema_CurveTool.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfTransient.hxx>
|
||||
@@ -326,6 +327,11 @@ void Extrema_ExtCC::Points(const Standard_Integer N,
|
||||
Extrema_POnCurv& P1,
|
||||
Extrema_POnCurv& P2) const
|
||||
{
|
||||
if (IsParallel())
|
||||
{
|
||||
throw StdFail_InfiniteSolutions();
|
||||
}
|
||||
|
||||
if (N < 1 || N > NbExt())
|
||||
{
|
||||
throw Standard_OutOfRange();
|
||||
|
@@ -29,7 +29,9 @@
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor3d_Curve;
|
||||
class Extrema_POnCurv;
|
||||
class gp_Pnt;
|
||||
|
@@ -34,7 +34,10 @@
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
Extrema_ExtCC2d::Extrema_ExtCC2d()
|
||||
|
@@ -28,7 +28,9 @@
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Adaptor2d_Curve2d;
|
||||
class Extrema_POnCurv2d;
|
||||
class gp_Pnt2d;
|
||||
|
@@ -36,7 +36,10 @@
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
@@ -494,6 +497,11 @@ void Extrema_ExtCS::Points(const Standard_Integer N,
|
||||
Extrema_POnCurv& P1,
|
||||
Extrema_POnSurf& P2) const
|
||||
{
|
||||
if (IsParallel())
|
||||
{
|
||||
throw StdFail_InfiniteSolutions();
|
||||
}
|
||||
|
||||
if (N < 1 || N > NbExt())
|
||||
{
|
||||
throw Standard_OutOfRange();
|
||||
|
@@ -36,7 +36,9 @@
|
||||
#include <math_DirectPolynomialRoots.hxx>
|
||||
#include <math_TrigonometricFunctionRoots.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -1098,6 +1100,11 @@ void Extrema_ExtElC::Points (const Standard_Integer N,
|
||||
Extrema_POnCurv& P1,
|
||||
Extrema_POnCurv& P2) const
|
||||
{
|
||||
if (IsParallel())
|
||||
{
|
||||
throw StdFail_InfiniteSolutions();
|
||||
}
|
||||
|
||||
if (N < 1 || N > NbExt())
|
||||
{
|
||||
throw Standard_OutOfRange();
|
||||
|
@@ -25,7 +25,9 @@
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Lin;
|
||||
class gp_Circ;
|
||||
class gp_Elips;
|
||||
|
@@ -27,7 +27,9 @@
|
||||
#include <math_DirectPolynomialRoots.hxx>
|
||||
#include <math_TrigonometricFunctionRoots.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=======================================================================
|
||||
@@ -457,6 +459,11 @@ void Extrema_ExtElC2d::Points (const Standard_Integer N,
|
||||
Extrema_POnCurv2d& P1,
|
||||
Extrema_POnCurv2d& P2) const
|
||||
{
|
||||
if (IsParallel())
|
||||
{
|
||||
throw StdFail_InfiniteSolutions();
|
||||
}
|
||||
|
||||
if (N < 1 || N > NbExt()) { throw Standard_OutOfRange(); }
|
||||
P1 = myPoint[N-1][0];
|
||||
P2 = myPoint[N-1][1];
|
||||
|
@@ -25,7 +25,9 @@
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Extrema_POnCurv2d.hxx>
|
||||
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Lin2d;
|
||||
class gp_Circ2d;
|
||||
class gp_Elips2d;
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
|
||||
@@ -826,6 +827,11 @@ void Extrema_ExtElCS::Points(const Standard_Integer N,
|
||||
Extrema_POnCurv& P1,
|
||||
Extrema_POnSurf& P2) const
|
||||
{
|
||||
if (IsParallel())
|
||||
{
|
||||
throw StdFail_InfiniteSolutions();
|
||||
}
|
||||
|
||||
if (N < 1 || N > NbExt())
|
||||
{
|
||||
throw Standard_OutOfRange();
|
||||
|
@@ -27,7 +27,9 @@
|
||||
#include <Extrema_HArray1OfPOnCurv.hxx>
|
||||
#include <Extrema_HArray1OfPOnSurf.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Lin;
|
||||
class gp_Pln;
|
||||
class gp_Cylinder;
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
Extrema_ExtElSS::Extrema_ExtElSS()
|
||||
@@ -164,6 +165,11 @@ void Extrema_ExtElSS::Points(const Standard_Integer N,
|
||||
Extrema_POnSurf& P1,
|
||||
Extrema_POnSurf& P2) const
|
||||
{
|
||||
if (IsParallel())
|
||||
{
|
||||
throw StdFail_InfiniteSolutions();
|
||||
}
|
||||
|
||||
if (N < 1 || N > NbExt())
|
||||
{
|
||||
throw Standard_OutOfRange();
|
||||
|
@@ -26,7 +26,9 @@
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <Extrema_HArray1OfPOnSurf.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class StdFail_InfiniteSolutions;
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class gp_Pln;
|
||||
class gp_Sphere;
|
||||
class gp_Cylinder;
|
||||
|
@@ -24,7 +24,10 @@
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <StdFail_InfiniteSolutions.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
Extrema_ExtSS::Extrema_ExtSS()
|
||||
@@ -260,6 +263,11 @@ void Extrema_ExtSS::Points(const Standard_Integer N,
|
||||
Extrema_POnSurf& P1,
|
||||
Extrema_POnSurf& P2) const
|
||||
{
|
||||
if (IsParallel())
|
||||
{
|
||||
throw StdFail_InfiniteSolutions();
|
||||
}
|
||||
|
||||
if (N < 1 || N > NbExt())
|
||||
{
|
||||
throw Standard_OutOfRange();
|
||||
|
@@ -658,6 +658,11 @@ void Extrema_GenExtCC::Points(const Standard_Integer N,
|
||||
POnC& P1,
|
||||
POnC& P2) const
|
||||
{
|
||||
if (IsParallel())
|
||||
{
|
||||
throw StdFail_InfiniteSolutions();
|
||||
}
|
||||
|
||||
if (N < 1 || N > NbExt())
|
||||
{
|
||||
throw Standard_OutOfRange();
|
||||
|
@@ -110,7 +110,6 @@ Graphic3d_NameOfTexture2D.hxx
|
||||
Graphic3d_NameOfTextureEnv.hxx
|
||||
Graphic3d_NameOfTexturePlane.hxx
|
||||
Graphic3d_NMapOfTransient.hxx
|
||||
Graphic3d_PolygonOffset.cxx
|
||||
Graphic3d_PolygonOffset.hxx
|
||||
Graphic3d_PriorityDefinitionError.hxx
|
||||
Graphic3d_RenderingMode.hxx
|
||||
|
@@ -12,7 +12,6 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_Aspects.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
|
||||
|
||||
@@ -61,25 +60,3 @@ void Graphic3d_Aspects::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTe
|
||||
|
||||
myTextureSet = new Graphic3d_TextureSet (theTexture);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Aspects);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInteriorColor);
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackInteriorColor);
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdgeColor);
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPolygonOffset);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSkipFirstEdge);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDistinguishMaterials);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawEdges);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawSilhouette);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSuppressBackFaces);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToMapTexture);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextZoomable);
|
||||
}
|
||||
|
@@ -477,9 +477,6 @@ public:
|
||||
&& myIsTextZoomable == theOther.myIsTextZoomable;
|
||||
}
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
|
||||
|
||||
protected:
|
||||
|
||||
Handle(Graphic3d_ShaderProgram) myProgram;
|
||||
|
@@ -27,13 +27,13 @@ namespace
|
||||
|
||||
static Handle(Graphic3d_AspectFillArea3d) defaultAspect()
|
||||
{
|
||||
Graphic3d_MaterialAspect aMaterial (Graphic3d_NOM_DEFAULT);
|
||||
const Graphic3d_MaterialAspect aMaterial (Graphic3d_NOM_DEFAULT);
|
||||
Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d();
|
||||
anAspect->SetDistinguishOff();
|
||||
anAspect->SetFrontMaterial (aMaterial);
|
||||
anAspect->SetHatchStyle (Aspect_HS_HORIZONTAL);
|
||||
anAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
anAspect->SetInteriorColor (Quantity_NOC_GRAY20);
|
||||
anAspect->SetInteriorColor (aMaterial.Color());
|
||||
anAspect->SetSuppressBackFaces (false);
|
||||
return anAspect;
|
||||
}
|
||||
@@ -177,17 +177,6 @@ Handle(Graphic3d_ClipPlane) Graphic3d_ClipPlane::Clone() const
|
||||
return new Graphic3d_ClipPlane(*this);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingColor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetCappingColor (const Quantity_Color& theColor)
|
||||
{
|
||||
myAspect->SetInteriorColor (theColor);
|
||||
myAspect->ChangeFrontMaterial().SetColor (theColor);
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingMaterial
|
||||
// purpose :
|
||||
@@ -195,10 +184,7 @@ void Graphic3d_ClipPlane::SetCappingColor (const Quantity_Color& theColor)
|
||||
void Graphic3d_ClipPlane::SetCappingMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
{
|
||||
myAspect->SetFrontMaterial (theMat);
|
||||
if (myAspect->FrontMaterial().MaterialType() != Graphic3d_MATERIAL_ASPECT)
|
||||
{
|
||||
myAspect->SetInteriorColor (theMat.Color());
|
||||
}
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
|
@@ -166,12 +166,6 @@ public:
|
||||
|
||||
public: // @name user-defined graphical attributes
|
||||
|
||||
//! Return color for rendering capping surface.
|
||||
Quantity_Color CappingColor() const { return myAspect->FrontMaterial().MaterialType() == Graphic3d_MATERIAL_ASPECT ? myAspect->FrontMaterial().Color() : myAspect->InteriorColor(); }
|
||||
|
||||
//! Set color for rendering capping surface.
|
||||
Standard_EXPORT void SetCappingColor (const Quantity_Color& theColor);
|
||||
|
||||
//! Set material for rendering capping surface.
|
||||
//! @param theMat [in] the material.
|
||||
Standard_EXPORT void SetCappingMaterial (const Graphic3d_MaterialAspect& theMat);
|
||||
|
@@ -447,15 +447,3 @@ void Graphic3d_Group::AddText (const Handle(Graphic3d_Text)& theTextParams,
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DumpJson
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Group);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet);
|
||||
}
|
||||
|
@@ -276,9 +276,6 @@ public:
|
||||
const Standard_Boolean theHasOwnAnchor = Standard_True);
|
||||
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
|
||||
|
||||
protected:
|
||||
|
||||
//! Creates a group in the structure <AStructure>.
|
||||
|
@@ -26,13 +26,13 @@ namespace
|
||||
const char* StringName;
|
||||
Graphic3d_BSDF BSDF;
|
||||
Quantity_Color Colors [Graphic3d_TypeOfReflection_NB];
|
||||
Standard_ShortReal ColorCoef[Graphic3d_TypeOfReflection_NB];
|
||||
Standard_ShortReal TransparencyCoef;
|
||||
Standard_ShortReal RefractionIndex;
|
||||
Standard_ShortReal Shininess;
|
||||
Standard_ShortReal AmbientCoef; //!< coefficient for Graphic3d_MaterialAspect::SetColor()
|
||||
Standard_ShortReal DiffuseCoef; //!< coefficient for Graphic3d_MaterialAspect::SetColor()
|
||||
Graphic3d_TypeOfMaterial MaterialType;
|
||||
Graphic3d_NameOfMaterial MaterialName;
|
||||
Standard_Boolean ReflActivity[Graphic3d_TypeOfReflection_NB];
|
||||
|
||||
RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStringName);
|
||||
|
||||
@@ -80,59 +80,62 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
TransparencyCoef(0.0f),
|
||||
RefractionIndex (1.0f),
|
||||
Shininess (0.039f),
|
||||
AmbientCoef (0.25f),
|
||||
DiffuseCoef (1.0f),
|
||||
MaterialType (Graphic3d_MATERIAL_ASPECT),
|
||||
MaterialName (theName)
|
||||
{
|
||||
ReflActivity[Graphic3d_TOR_AMBIENT] = Standard_True;
|
||||
ReflActivity[Graphic3d_TOR_DIFFUSE] = Standard_True;
|
||||
ReflActivity[Graphic3d_TOR_SPECULAR] = Standard_True;
|
||||
ReflActivity[Graphic3d_TOR_EMISSION] = Standard_False;
|
||||
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 0.3f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 0.65f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 0.0f;
|
||||
ColorCoef[Graphic3d_TOR_EMISSION] = 0.0f;
|
||||
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.2f, 0.2f, 0.2f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.2f, 0.2f, 0.2f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (1.0f, 1.0f, 1.0f));
|
||||
switch (theName)
|
||||
{
|
||||
case Graphic3d_NOM_PLASTIC:
|
||||
MaterialType = Graphic3d_MATERIAL_ASPECT;
|
||||
|
||||
Shininess = 0.0078125f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.50f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.24f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.06f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 0.50f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 0.24f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 0.06f;
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.2f);
|
||||
BSDF.Kd = static_cast<Graphic3d_Vec3> (Colors[Graphic3d_TOR_DIFFUSE]);
|
||||
BSDF.Ks = Graphic3d_Vec4 (0.00784314f, 0.00784314f, 0.00784314f, 0.25f);
|
||||
BSDF.Normalize();
|
||||
break;
|
||||
case Graphic3d_NOM_SHINY_PLASTIC:
|
||||
MaterialType = Graphic3d_MATERIAL_ASPECT;
|
||||
|
||||
Shininess = 1.00f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.44f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.50f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (1.0f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 0.44f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 0.50f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.2f);
|
||||
BSDF.Kd = static_cast<Graphic3d_Vec3> (Colors[Graphic3d_TOR_DIFFUSE]);
|
||||
BSDF.Ks = Graphic3d_Vec4 (0.145f, 0.145f, 0.145f, 0.17f);
|
||||
BSDF.Normalize();
|
||||
break;
|
||||
case Graphic3d_NOM_SATIN:
|
||||
MaterialType = Graphic3d_MATERIAL_ASPECT;
|
||||
|
||||
Shininess = 0.09375f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.33f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.40f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.44f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 0.33f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 0.40f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 0.44f;
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.2f);
|
||||
BSDF.Ks = Graphic3d_Vec4 (0.6f);
|
||||
|
||||
break;
|
||||
case Graphic3d_NOM_NEON_GNC:
|
||||
MaterialType = Graphic3d_MATERIAL_ASPECT;
|
||||
|
||||
Shininess = 0.05f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (1.0f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.62f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (1.0f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 0.62f;
|
||||
ColorCoef[Graphic3d_TOR_EMISSION] = 1.00f;
|
||||
ReflActivity[Graphic3d_TOR_AMBIENT] = Standard_False;
|
||||
ReflActivity[Graphic3d_TOR_EMISSION] = Standard_True;
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.0f);
|
||||
BSDF.Ks = Graphic3d_Vec4 (0.5f, 0.5f, 0.5f, 0.f);
|
||||
@@ -140,160 +143,199 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
BSDF.FresnelBase = Graphic3d_Fresnel::CreateDielectric (1.5f);
|
||||
break;
|
||||
case Graphic3d_NOM_METALIZED:
|
||||
MaterialType = Graphic3d_MATERIAL_ASPECT;
|
||||
|
||||
Shininess = 0.13f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.47f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.45f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 0.90f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 0.47f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 0.45f;
|
||||
ReflActivity[Graphic3d_TOR_AMBIENT] = Standard_False;
|
||||
{
|
||||
const Graphic3d_Vec3 aColor = (Graphic3d_Vec3 )Colors[Graphic3d_TOR_DIFFUSE];
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.2f)), 0.045f);
|
||||
Graphic3d_Fresnel::CreateSchlick (aColor), 0.045f);
|
||||
}
|
||||
break;
|
||||
// Ascending Compatibility physical materials. The same definition is taken as in the next constructor.
|
||||
case Graphic3d_NOM_BRASS:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.65f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.58f, 0.42f, 0.20f)), 0.045f);
|
||||
|
||||
Shininess = 0.65f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.329f, 0.224f, 0.027f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.780f, 0.569f, 0.114f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.992f, 0.941f, 0.808f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_BRONZE:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.65f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.65f, 0.35f, 0.15f)), 0.045f);
|
||||
|
||||
Shininess = 0.65f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.213f, 0.128f, 0.054f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.714f, 0.428f, 0.181f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.590f, 0.408f, 0.250f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_COPPER:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.65f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.955008f, 0.637427f, 0.538163f)), 0.045f);
|
||||
|
||||
Shininess = 0.65f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.191f, 0.074f, 0.023f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.604f, 0.270f, 0.083f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.950f, 0.640f, 0.540f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_GOLD:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.80f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (1.000000f, 0.765557f, 0.336057f)), 0.045f);
|
||||
|
||||
Shininess = 0.80f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.300f, 0.230f, 0.095f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.752f, 0.580f, 0.100f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (1.000f, 0.710f, 0.290f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_PEWTER:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.50f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateConductor (1.8800f, 3.4900f), 0.045f);
|
||||
|
||||
Shininess = 0.50f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.106f, 0.059f, 0.114f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.427f, 0.471f, 0.541f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.333f, 0.333f, 0.522f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_PLASTER:
|
||||
MaterialType = Graphic3d_MATERIAL_ASPECT;
|
||||
|
||||
Shininess = 0.01f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.26f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.75f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.05f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 0.26f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 0.75f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 0.05f;
|
||||
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.192f, 0.192f, 0.192f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.508f, 0.508f, 0.508f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.508f, 0.508f, 0.508f));
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.482353f, 0.482353f, 0.482353f);
|
||||
|
||||
break;
|
||||
case Graphic3d_NOM_SILVER:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.75f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.971519f, 0.959915f, 0.915324f)), 0.045f);
|
||||
|
||||
Shininess = 0.75f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.275f, 0.275f, 0.250f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.630f, 0.630f, 0.630f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.950f, 0.930f, 0.880f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_STEEL:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.90f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateConductor (Graphic3d_Vec3 (2.90f, 2.80f, 2.53f), Graphic3d_Vec3 (3.08f, 2.90f, 2.74f)), 0.045f);
|
||||
|
||||
Shininess = 0.90f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.150f, 0.150f, 0.180f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.500f, 0.510f, 0.520f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.560f, 0.570f, 0.580f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_STONE:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
// special case for SetColor()
|
||||
AmbientCoef = 0.19f * 0.25f;
|
||||
DiffuseCoef = 0.75f;
|
||||
|
||||
Shininess = 0.17f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (1.00f, 0.8f, 0.62f) * 0.19f);
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (1.00f, 0.8f, 0.62f) * 0.75f);
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.98f, 1.0f, 0.60f) * 0.08f);
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 0.19f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 0.75f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 0.08f;
|
||||
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (1.00f, 0.8f, 0.62f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (1.00f, 0.8f, 0.62f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.98f, 1.0f, 0.60f));
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.243137f, 0.243137f, 0.243137f);
|
||||
BSDF.Ks = Graphic3d_Vec4 (0.00392157f, 0.00392157f, 0.00392157f, 0.5f);
|
||||
|
||||
break;
|
||||
// Ascending Compatibility of physical materials. Takes the same definition as in the next constructor. New materials
|
||||
case Graphic3d_NOM_CHROME:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.90f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.549585f, 0.556114f, 0.554256f)), 0.045f);
|
||||
|
||||
Shininess = 0.90f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.200f, 0.200f, 0.225f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.550f, 0.550f, 0.550f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.975f, 0.975f, 0.975f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_ALUMINIUM:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.75f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
|
||||
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.913183f, 0.921494f, 0.924524f)), 0.045f);
|
||||
|
||||
Shininess = 0.75f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.300f, 0.300f, 0.300f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.600f, 0.600f, 0.600f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.910f, 0.920f, 0.920f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_NEON_PHC:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.05f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.62f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f, 0.90f, 0.414f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 0.62f;
|
||||
ColorCoef[Graphic3d_TOR_EMISSION] = 0.90f;
|
||||
ReflActivity[Graphic3d_TOR_AMBIENT] = Standard_False;
|
||||
ReflActivity[Graphic3d_TOR_DIFFUSE] = Standard_False;
|
||||
ReflActivity[Graphic3d_TOR_EMISSION] = Standard_True;
|
||||
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (1.0f, 1.0f, 1.0f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (1.0f, 1.0f, 1.0f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (1.0f, 1.0f, 1.0f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f, 1.0f, 0.46f));
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.0f);
|
||||
BSDF.Ks = Graphic3d_Vec4 (0.5f, 0.5f, 0.5f, 0.f);
|
||||
@@ -304,10 +346,13 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.3f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.0f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.0f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.0f;
|
||||
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.054f, 0.050f, 0.066f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.183f, 0.170f, 0.225f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.333f, 0.329f, 0.346f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.023f, 0.f, 0.023f);
|
||||
BSDF.Ks = Graphic3d_Vec4 (0.0156863f, 0.0156863f, 0.0156863f, 0.1f);
|
||||
@@ -316,10 +361,13 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.10f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.135f, 0.223f, 0.158f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.540f, 0.890f, 0.630f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.316f, 0.316f, 0.316f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
|
||||
BSDF.FresnelBase = Graphic3d_Fresnel::CreateDielectric (1.5f);
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.208658f, 0.415686f, 0.218401f);
|
||||
@@ -329,10 +377,13 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.01f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.050f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.150f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.050f, 0.050f, 0.050f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.150f, 0.150f, 0.150f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.000f, 0.000f, 0.000f));
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.02f, 0.02f, 0.02f);
|
||||
BSDF.Ks = Graphic3d_Vec4 (0.1f, 0.1f, 0.1f, 0.3f);
|
||||
@@ -340,6 +391,10 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
case Graphic3d_NOM_WATER:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.90f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
RefractionIndex = 1.33f;
|
||||
BSDF = Graphic3d_BSDF::CreateGlass (Graphic3d_Vec3 (1.f),
|
||||
Graphic3d_Vec3 (0.7f, 0.75f, 0.85f),
|
||||
@@ -347,15 +402,17 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
RefractionIndex);
|
||||
TransparencyCoef = 0.80f;
|
||||
|
||||
Shininess = 0.90f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.450f, 0.450f, 0.475f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.050f, 0.050f, 0.075f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.380f, 0.380f, 0.380f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_GLASS:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.50f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
RefractionIndex = 1.62f;
|
||||
BSDF = Graphic3d_BSDF::CreateGlass (Graphic3d_Vec3 (1.f),
|
||||
Graphic3d_Vec3 (0.75f, 0.95f, 0.9f),
|
||||
@@ -363,15 +420,17 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
RefractionIndex);
|
||||
TransparencyCoef = 0.80f;
|
||||
|
||||
Shininess = 0.50f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.550f, 0.575f, 0.575f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.050f, 0.075f, 0.075f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.920f, 0.920f, 0.920f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_DIAMOND:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.90f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
RefractionIndex = 2.42f;
|
||||
BSDF = Graphic3d_BSDF::CreateGlass (Graphic3d_Vec3 (1.f),
|
||||
Graphic3d_Vec3 (0.95f, 0.95f, 0.95f),
|
||||
@@ -379,16 +438,18 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
RefractionIndex);
|
||||
TransparencyCoef = 0.80f;
|
||||
|
||||
Shininess = 0.90f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.550f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.100f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.970f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.550f, 0.550f, 0.550f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.100f, 0.100f, 0.100f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.970f, 0.970f, 0.970f));
|
||||
break;
|
||||
|
||||
case Graphic3d_NOM_TRANSPARENT:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
|
||||
Shininess = 0.90f;
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
RefractionIndex = 1.0f;
|
||||
|
||||
BSDF.Kd = Graphic3d_Vec3 (0.1f);
|
||||
@@ -396,26 +457,22 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
|
||||
BSDF.FresnelBase = Graphic3d_Fresnel::CreateConstant (0.0f);
|
||||
TransparencyCoef = 0.80f;
|
||||
|
||||
Shininess = 0.90f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.550f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.100f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.970f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.550f, 0.550f, 0.550f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.100f, 0.100f, 0.100f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.970f, 0.970f, 0.970f));
|
||||
break;
|
||||
case Graphic3d_NOM_UserDefined:
|
||||
MaterialType = Graphic3d_MATERIAL_PHYSIC;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.1f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.8f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.2f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
ColorCoef[Graphic3d_TOR_AMBIENT] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_DIFFUSE] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_SPECULAR] = 1.00f;
|
||||
ColorCoef[Graphic3d_TOR_EMISSION] = 1.00f;
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.1f, 0.1f, 0.1f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.8f, 0.8f, 0.8f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.2f, 0.2f, 0.2f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f, 0.0f, 0.0f));
|
||||
break;
|
||||
case Graphic3d_NOM_DEFAULT:
|
||||
MaterialType = Graphic3d_MATERIAL_ASPECT;
|
||||
|
||||
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.30f));
|
||||
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.65f));
|
||||
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -453,12 +510,20 @@ void Graphic3d_MaterialAspect::init (const Graphic3d_NameOfMaterial theName)
|
||||
myColors[Graphic3d_TOR_DIFFUSE] = aMat.Colors[Graphic3d_TOR_DIFFUSE];
|
||||
myColors[Graphic3d_TOR_SPECULAR] = aMat.Colors[Graphic3d_TOR_SPECULAR];
|
||||
myColors[Graphic3d_TOR_EMISSION] = aMat.Colors[Graphic3d_TOR_EMISSION];
|
||||
myColorCoef[Graphic3d_TOR_AMBIENT] = aMat.ColorCoef[Graphic3d_TOR_AMBIENT];
|
||||
myColorCoef[Graphic3d_TOR_DIFFUSE] = aMat.ColorCoef[Graphic3d_TOR_DIFFUSE];
|
||||
myColorCoef[Graphic3d_TOR_SPECULAR] = aMat.ColorCoef[Graphic3d_TOR_SPECULAR];
|
||||
myColorCoef[Graphic3d_TOR_EMISSION] = aMat.ColorCoef[Graphic3d_TOR_EMISSION];
|
||||
myTransparencyCoef = aMat.TransparencyCoef;
|
||||
myRefractionIndex = aMat.RefractionIndex;
|
||||
myShininess = aMat.Shininess;
|
||||
myMaterialType = aMat.MaterialType;
|
||||
myMaterialName = theName;
|
||||
myRequestedMaterialName = theName;
|
||||
myReflActivity[Graphic3d_TOR_AMBIENT] = aMat.ReflActivity[Graphic3d_TOR_AMBIENT];
|
||||
myReflActivity[Graphic3d_TOR_DIFFUSE] = aMat.ReflActivity[Graphic3d_TOR_DIFFUSE];
|
||||
myReflActivity[Graphic3d_TOR_SPECULAR] = aMat.ReflActivity[Graphic3d_TOR_SPECULAR];
|
||||
myReflActivity[Graphic3d_TOR_EMISSION] = aMat.ReflActivity[Graphic3d_TOR_EMISSION];
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -488,28 +553,42 @@ void Graphic3d_MaterialAspect::SetMaterialType (const Graphic3d_TypeOfMaterial t
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetAmbient
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetAmbient (const Standard_ShortReal theValue)
|
||||
{
|
||||
if (theValue < 0.0f
|
||||
|| theValue > 1.0f)
|
||||
{
|
||||
throw Graphic3d_MaterialDefinitionError("Bad value for SetAmbient < 0. or > 1.0");
|
||||
}
|
||||
|
||||
myColorCoef[Graphic3d_TOR_AMBIENT] = theValue;
|
||||
if (myReflActivity[Graphic3d_TOR_AMBIENT]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetColor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetColor (const Quantity_Color& theColor)
|
||||
{
|
||||
if (myMaterialType == Graphic3d_MATERIAL_ASPECT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const RawMaterial& aSrcMat = THE_MATERIALS[myRequestedMaterialName];
|
||||
const Quantity_Color anAmbient((Graphic3d_Vec3 )theColor * aSrcMat.AmbientCoef);
|
||||
const Quantity_Color aDiffuse ((Graphic3d_Vec3 )theColor * aSrcMat.DiffuseCoef);
|
||||
if (myMaterialName != Graphic3d_NOM_UserDefined
|
||||
&& (!myColors[Graphic3d_TOR_AMBIENT].IsEqual (anAmbient)
|
||||
|| !myColors[Graphic3d_TOR_DIFFUSE].IsEqual (aDiffuse)))
|
||||
const Standard_ShortReal anAmbientCoeff = 0.25f;
|
||||
myColors[Graphic3d_TOR_AMBIENT].SetValues (theColor.Red() * anAmbientCoeff,
|
||||
theColor.Green() * anAmbientCoeff,
|
||||
theColor.Blue() * anAmbientCoeff, Quantity_TOC_RGB);
|
||||
myColors[Graphic3d_TOR_DIFFUSE] = theColor;
|
||||
if (myReflActivity[Graphic3d_TOR_AMBIENT]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
myColors[Graphic3d_TOR_AMBIENT] = anAmbient;
|
||||
myColors[Graphic3d_TOR_DIFFUSE] = aDiffuse;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -518,13 +597,12 @@ void Graphic3d_MaterialAspect::SetColor (const Quantity_Color& theColor)
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetAmbientColor (const Quantity_Color& theColor)
|
||||
{
|
||||
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
|
||||
&& myMaterialName != Graphic3d_NOM_UserDefined
|
||||
&& !myColors[Graphic3d_TOR_AMBIENT].IsEqual (theColor))
|
||||
myColors[Graphic3d_TOR_AMBIENT] = theColor;
|
||||
if (myReflActivity[Graphic3d_TOR_AMBIENT]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
myColors[Graphic3d_TOR_AMBIENT] = theColor;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -533,13 +611,12 @@ void Graphic3d_MaterialAspect::SetAmbientColor (const Quantity_Color& theColor)
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetDiffuseColor (const Quantity_Color& theColor)
|
||||
{
|
||||
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
|
||||
&& myMaterialName != Graphic3d_NOM_UserDefined
|
||||
&& !myColors[Graphic3d_TOR_DIFFUSE].IsEqual (theColor))
|
||||
myColors[Graphic3d_TOR_DIFFUSE] = theColor;
|
||||
if (myReflActivity[Graphic3d_TOR_DIFFUSE]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
myColors[Graphic3d_TOR_DIFFUSE] = theColor;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -548,13 +625,12 @@ void Graphic3d_MaterialAspect::SetDiffuseColor (const Quantity_Color& theColor)
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetSpecularColor (const Quantity_Color& theColor)
|
||||
{
|
||||
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
|
||||
&& myMaterialName != Graphic3d_NOM_UserDefined
|
||||
&& !myColors[Graphic3d_TOR_SPECULAR].IsEqual (theColor))
|
||||
myColors[Graphic3d_TOR_SPECULAR] = theColor;
|
||||
if (myReflActivity[Graphic3d_TOR_SPECULAR]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
myColors[Graphic3d_TOR_SPECULAR] = theColor;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -563,13 +639,86 @@ void Graphic3d_MaterialAspect::SetSpecularColor (const Quantity_Color& theColor)
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetEmissiveColor (const Quantity_Color& theColor)
|
||||
{
|
||||
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
|
||||
&& myMaterialName != Graphic3d_NOM_UserDefined
|
||||
&& !myColors[Graphic3d_TOR_EMISSION].IsEqual (theColor))
|
||||
myColors[Graphic3d_TOR_EMISSION] = theColor;
|
||||
if (myReflActivity[Graphic3d_TOR_EMISSION]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetDiffuse
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetDiffuse (const Standard_ShortReal theValue)
|
||||
{
|
||||
if (theValue < 0.0f
|
||||
|| theValue > 1.0f)
|
||||
{
|
||||
throw Graphic3d_MaterialDefinitionError("Bad value for SetDiffuse < 0. or > 1.0");
|
||||
}
|
||||
|
||||
myColorCoef[Graphic3d_TOR_DIFFUSE] = theValue;
|
||||
if (myReflActivity[Graphic3d_TOR_DIFFUSE]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetEmissive
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetEmissive (const Standard_ShortReal theValue)
|
||||
{
|
||||
if (theValue < 0.0f
|
||||
|| theValue > 1.0f)
|
||||
{
|
||||
throw Graphic3d_MaterialDefinitionError("Bad value for SetEmissive < 0. or > 1.0");
|
||||
}
|
||||
|
||||
myColorCoef[Graphic3d_TOR_EMISSION] = theValue;
|
||||
if (myReflActivity[Graphic3d_TOR_DIFFUSE]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetReflectionMode
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetReflectionMode (const Graphic3d_TypeOfReflection theType,
|
||||
const Standard_Boolean theValue)
|
||||
{
|
||||
myReflActivity[theType] = theValue;
|
||||
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetSpecular
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_MaterialAspect::SetSpecular (const Standard_ShortReal theValue)
|
||||
{
|
||||
if (theValue < 0.0f
|
||||
|| theValue > 1.0f)
|
||||
{
|
||||
throw Graphic3d_MaterialDefinitionError("Bad value for SetSpecular < 0. or > 1.0");
|
||||
}
|
||||
|
||||
myColorCoef[Graphic3d_TOR_SPECULAR] = theValue;
|
||||
if (myReflActivity[Graphic3d_TOR_SPECULAR]
|
||||
&& myMaterialType == Graphic3d_MATERIAL_PHYSIC)
|
||||
{
|
||||
setUserMaterial();
|
||||
}
|
||||
myColors[Graphic3d_TOR_EMISSION] = theColor;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -613,12 +762,9 @@ void Graphic3d_MaterialAspect::SetShininess (const Standard_ShortReal theValue)
|
||||
throw Graphic3d_MaterialDefinitionError("Bad value for Shininess < 0. or > 1.0");
|
||||
}
|
||||
|
||||
if (myShininess != theValue)
|
||||
{
|
||||
myShininess = theValue;
|
||||
setUserMaterial();
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : MaterialName
|
||||
@@ -638,55 +784,47 @@ Standard_CString Graphic3d_MaterialAspect::MaterialName (const Standard_Integer
|
||||
// function : MaterialFromName
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean Graphic3d_MaterialAspect::MaterialFromName (const Standard_CString theName,
|
||||
Graphic3d_NameOfMaterial& theMat)
|
||||
Graphic3d_NameOfMaterial Graphic3d_MaterialAspect::MaterialFromName (const Standard_CString theName)
|
||||
{
|
||||
TCollection_AsciiString aName (theName);
|
||||
aName.LowerCase();
|
||||
aName.Capitalize();
|
||||
const Standard_Integer aNbMaterials = Graphic3d_MaterialAspect::NumberOfMaterials();
|
||||
for (Standard_Integer aMatIter = 0; aMatIter <= aNbMaterials; ++aMatIter)
|
||||
for (Standard_Integer aMatIter = 0; aMatIter < aNbMaterials; ++aMatIter)
|
||||
{
|
||||
const RawMaterial& aMat = THE_MATERIALS[aMatIter];
|
||||
if (aName == aMat.StringName)
|
||||
{
|
||||
theMat = Graphic3d_NameOfMaterial(aMatIter);
|
||||
return Standard_True;
|
||||
return Graphic3d_NameOfMaterial(aMatIter);
|
||||
}
|
||||
}
|
||||
|
||||
// parse aliases
|
||||
if (aName == "Plastic") // Plastified
|
||||
{
|
||||
theMat = Graphic3d_NOM_PLASTIC;
|
||||
return Standard_True;
|
||||
return Graphic3d_NOM_PLASTIC;
|
||||
}
|
||||
else if (aName == "Shiny_plastic") // Shiny_plastified
|
||||
{
|
||||
theMat = Graphic3d_NOM_SHINY_PLASTIC;
|
||||
return Standard_True;
|
||||
return Graphic3d_NOM_SHINY_PLASTIC;
|
||||
}
|
||||
else if (aName == "Plaster") // Plastered
|
||||
{
|
||||
theMat = Graphic3d_NOM_PLASTER;
|
||||
return Standard_True;
|
||||
return Graphic3d_NOM_PLASTER;
|
||||
}
|
||||
else if (aName == "Satin") // Satined
|
||||
{
|
||||
theMat = Graphic3d_NOM_SATIN;
|
||||
return Standard_True;
|
||||
return Graphic3d_NOM_SATIN;
|
||||
}
|
||||
else if (aName == "Neon_gnc") // Ionized
|
||||
{
|
||||
theMat = Graphic3d_NOM_NEON_GNC;
|
||||
return Standard_True;
|
||||
return Graphic3d_NOM_NEON_GNC;
|
||||
}
|
||||
else if (aName == "Neon_phc") // Neon
|
||||
{
|
||||
theMat = Graphic3d_NOM_NEON_PHC;
|
||||
return Standard_True;
|
||||
return Graphic3d_NOM_NEON_PHC;
|
||||
}
|
||||
return Standard_False;
|
||||
return Graphic3d_NOM_DEFAULT;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
@@ -42,20 +42,8 @@ public:
|
||||
//! Returns the type of the predefined material of specified rank within range [1, NumberOfMaterials()].
|
||||
Standard_EXPORT static Graphic3d_TypeOfMaterial MaterialType (const Standard_Integer theRank);
|
||||
|
||||
//! Finds the material for specified name.
|
||||
//! @param theName [in] name to find
|
||||
//! @param theMat [out] found material
|
||||
//! @return FALSE if name was unrecognized
|
||||
Standard_EXPORT static Standard_Boolean MaterialFromName (const Standard_CString theName,
|
||||
Graphic3d_NameOfMaterial& theMat);
|
||||
|
||||
//! Returns the material for specified name or Graphic3d_NOM_DEFAULT if name is unknown.
|
||||
static Graphic3d_NameOfMaterial MaterialFromName (const Standard_CString theName)
|
||||
{
|
||||
Graphic3d_NameOfMaterial aMat = Graphic3d_NOM_DEFAULT;
|
||||
MaterialFromName (theName, aMat);
|
||||
return aMat;
|
||||
}
|
||||
Standard_EXPORT static Graphic3d_NameOfMaterial MaterialFromName (const Standard_CString theName);
|
||||
|
||||
public:
|
||||
|
||||
@@ -99,11 +87,9 @@ public:
|
||||
}
|
||||
|
||||
//! Returns the diffuse color of the surface.
|
||||
//! WARNING! This method does NOT return color for Graphic3d_MATERIAL_ASPECT material (color is defined by Graphic3d_Aspects::InteriorColor()).
|
||||
const Quantity_Color& Color() const { return myColors[Graphic3d_TOR_DIFFUSE]; }
|
||||
|
||||
//! Modifies the ambient and diffuse color of the surface.
|
||||
//! WARNING! Has no effect for Graphic3d_MATERIAL_ASPECT material (color should be set to Graphic3d_Aspects::SetInteriorColor()).
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& theColor);
|
||||
|
||||
//! Returns the transparency coefficient of the surface (1.0 - Alpha); 0.0 means opaque.
|
||||
@@ -146,6 +132,34 @@ public:
|
||||
//! Modifies the emissive color of the surface.
|
||||
Standard_EXPORT void SetEmissiveColor (const Quantity_Color& theColor);
|
||||
|
||||
//! Returns the reflection properties of the surface.
|
||||
Standard_ShortReal Ambient() const { return myColorCoef[Graphic3d_TOR_AMBIENT]; }
|
||||
|
||||
//! Modifies the reflection properties of the surface.
|
||||
//! Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetAmbient (const Standard_ShortReal theValue);
|
||||
|
||||
//! Returns the reflection properties of the surface.
|
||||
Standard_ShortReal Diffuse() const { return myColorCoef[Graphic3d_TOR_DIFFUSE]; }
|
||||
|
||||
//! Modifies the reflection properties of the surface.
|
||||
//! Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetDiffuse (const Standard_ShortReal theValue);
|
||||
|
||||
//! Returns the reflection properties of the surface.
|
||||
Standard_ShortReal Specular() const { return myColorCoef[Graphic3d_TOR_SPECULAR]; }
|
||||
|
||||
//! Modifies the reflection properties of the surface.
|
||||
//! Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetSpecular (const Standard_ShortReal theValue);
|
||||
|
||||
//! Returns the emissive coefficient of the surface.
|
||||
Standard_ShortReal Emissive() const { return myColorCoef[Graphic3d_TOR_EMISSION]; }
|
||||
|
||||
//! Modifies the reflection properties of the surface.
|
||||
//! Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetEmissive (const Standard_ShortReal theValue);
|
||||
|
||||
//! Returns the luminosity of the surface.
|
||||
Standard_ShortReal Shininess() const { return myShininess; }
|
||||
|
||||
@@ -173,11 +187,26 @@ public:
|
||||
//! Returns TRUE if the reflection mode is active, FALSE otherwise.
|
||||
Standard_Boolean ReflectionMode (const Graphic3d_TypeOfReflection theType) const
|
||||
{
|
||||
return !myColors[theType].IsEqual (Quantity_NOC_BLACK);
|
||||
return myReflActivity[theType];
|
||||
}
|
||||
|
||||
//! Returns material type.
|
||||
Graphic3d_TypeOfMaterial MaterialType() const { return myMaterialType; }
|
||||
//! Activates or deactivates the reflective properties of the surface with specified reflection type.
|
||||
//!
|
||||
//! Disabling diffuse and specular reflectance is useful for efficient visualization
|
||||
//! of large amounts of data as definition of normals for graphic primitives is not needed
|
||||
//! when only "all-directional" reflectance is active.
|
||||
//!
|
||||
//! NOTE: Disabling all four reflection modes also turns off the following effects:
|
||||
//! 1. Lighting. Colors of primitives are not affected by the material properties when lighting is off.
|
||||
//! 2. Transparency.
|
||||
Standard_EXPORT void SetReflectionMode (const Graphic3d_TypeOfReflection theType,
|
||||
const Standard_Boolean theValue);
|
||||
|
||||
//! Activates the reflective properties of the surface with specified reflection type.
|
||||
void SetReflectionModeOn (const Graphic3d_TypeOfReflection theType) { SetReflectionMode (theType, Standard_True); }
|
||||
|
||||
//! Deactivates the reflective properties of the surface with specified reflection type.
|
||||
void SetReflectionModeOff (const Graphic3d_TypeOfReflection theType) { SetReflectionMode (theType, Standard_False); }
|
||||
|
||||
//! Returns TRUE if type of this material is equal to specified type.
|
||||
Standard_Boolean MaterialType (const Graphic3d_TypeOfMaterial theType) const { return myMaterialType == theType; }
|
||||
@@ -194,39 +223,27 @@ public:
|
||||
//! Returns TRUE if this material is identical to specified one.
|
||||
Standard_Boolean IsEqual (const Graphic3d_MaterialAspect& theOther) const
|
||||
{
|
||||
return myTransparencyCoef == theOther.myTransparencyCoef
|
||||
return myColorCoef[Graphic3d_TOR_AMBIENT] == theOther.myColorCoef[Graphic3d_TOR_AMBIENT]
|
||||
&& myColorCoef[Graphic3d_TOR_DIFFUSE] == theOther.myColorCoef[Graphic3d_TOR_DIFFUSE]
|
||||
&& myColorCoef[Graphic3d_TOR_SPECULAR] == theOther.myColorCoef[Graphic3d_TOR_SPECULAR]
|
||||
&& myColorCoef[Graphic3d_TOR_EMISSION] == theOther.myColorCoef[Graphic3d_TOR_EMISSION]
|
||||
&& myTransparencyCoef == theOther.myTransparencyCoef
|
||||
&& myRefractionIndex == theOther.myRefractionIndex
|
||||
&& myBSDF == theOther.myBSDF
|
||||
&& myShininess == theOther.myShininess
|
||||
&& myColors[Graphic3d_TOR_AMBIENT] == theOther.myColors[Graphic3d_TOR_AMBIENT]
|
||||
&& myColors[Graphic3d_TOR_DIFFUSE] == theOther.myColors[Graphic3d_TOR_DIFFUSE]
|
||||
&& myColors[Graphic3d_TOR_SPECULAR] == theOther.myColors[Graphic3d_TOR_SPECULAR]
|
||||
&& myColors[Graphic3d_TOR_EMISSION] == theOther.myColors[Graphic3d_TOR_EMISSION];
|
||||
&& myColors[Graphic3d_TOR_EMISSION] == theOther.myColors[Graphic3d_TOR_EMISSION]
|
||||
&& myReflActivity[Graphic3d_TOR_AMBIENT] == theOther.myReflActivity[Graphic3d_TOR_AMBIENT]
|
||||
&& myReflActivity[Graphic3d_TOR_DIFFUSE] == theOther.myReflActivity[Graphic3d_TOR_DIFFUSE]
|
||||
&& myReflActivity[Graphic3d_TOR_SPECULAR] == theOther.myReflActivity[Graphic3d_TOR_SPECULAR]
|
||||
&& myReflActivity[Graphic3d_TOR_EMISSION] == theOther.myReflActivity[Graphic3d_TOR_EMISSION];
|
||||
}
|
||||
|
||||
//! Returns TRUE if this material is identical to specified one.
|
||||
Standard_Boolean operator== (const Graphic3d_MaterialAspect& theOther) const { return IsEqual (theOther); }
|
||||
|
||||
public:
|
||||
|
||||
//! Deactivates the reflective properties of the surface with specified reflection type.
|
||||
Standard_DEPRECATED("Deprecated method, specific material component should be zerroed instead")
|
||||
void SetReflectionModeOff (const Graphic3d_TypeOfReflection theType)
|
||||
{
|
||||
if (!ReflectionMode (theType))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (theType)
|
||||
{
|
||||
case Graphic3d_TOR_AMBIENT: SetAmbientColor (Quantity_NOC_BLACK); break;
|
||||
case Graphic3d_TOR_DIFFUSE: SetDiffuseColor (Quantity_NOC_BLACK); break;
|
||||
case Graphic3d_TOR_SPECULAR: SetSpecularColor(Quantity_NOC_BLACK); break;
|
||||
case Graphic3d_TOR_EMISSION: SetEmissiveColor(Quantity_NOC_BLACK); break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
//! Initialize the standard material.
|
||||
@@ -237,18 +254,16 @@ private:
|
||||
{
|
||||
// if a component of a "standard" material change, the
|
||||
// result is no more standard (a blue gold is not a gold)
|
||||
if (myMaterialName != Graphic3d_NOM_UserDefined)
|
||||
{
|
||||
myMaterialName = Graphic3d_NOM_UserDefined;
|
||||
myStringName = "UserDefined";
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Graphic3d_BSDF myBSDF;
|
||||
TCollection_AsciiString myStringName;
|
||||
Quantity_Color myColors [Graphic3d_TypeOfReflection_NB];
|
||||
Standard_ShortReal myColorCoef[Graphic3d_TypeOfReflection_NB];
|
||||
Standard_ShortReal myTransparencyCoef;
|
||||
Standard_ShortReal myRefractionIndex;
|
||||
Standard_ShortReal myShininess;
|
||||
@@ -257,6 +272,8 @@ private:
|
||||
Graphic3d_NameOfMaterial myMaterialName;
|
||||
Graphic3d_NameOfMaterial myRequestedMaterialName;
|
||||
|
||||
Standard_Boolean myReflActivity[Graphic3d_TypeOfReflection_NB];
|
||||
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_MaterialAspect_HeaderFile
|
||||
|
@@ -1,29 +0,0 @@
|
||||
// Copyright (c) 2016 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 <Graphic3d_PolygonOffset.hxx>
|
||||
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Graphic3d_PolygonOffset::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
|
||||
{
|
||||
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_PolygonOffset);
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Mode);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Factor);
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Units);
|
||||
}
|
@@ -15,7 +15,6 @@
|
||||
#define _Graphic3d_PolygonOffset_HeaderFile
|
||||
|
||||
#include <Aspect_PolygonOffsetMode.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
|
||||
//! Polygon offset parameters.
|
||||
struct Graphic3d_PolygonOffset
|
||||
@@ -34,10 +33,6 @@ struct Graphic3d_PolygonOffset
|
||||
&& Factor == theOther.Factor
|
||||
&& Units == theOther.Units;
|
||||
}
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
|
||||
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_PolygonOffset_HeaderFile
|
||||
|
@@ -20,8 +20,8 @@
|
||||
//! Types of materials specifies if a material can change color.
|
||||
enum Graphic3d_TypeOfMaterial
|
||||
{
|
||||
Graphic3d_MATERIAL_ASPECT, //!< aspect material definition with configurable color (like plastic)
|
||||
Graphic3d_MATERIAL_PHYSIC //!< physical material definition with fixed color (like gold)
|
||||
Graphic3d_MATERIAL_ASPECT,
|
||||
Graphic3d_MATERIAL_PHYSIC
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_TypeOfMaterial_HeaderFile
|
||||
|
@@ -6,5 +6,7 @@ HeaderSection_FileName.cxx
|
||||
HeaderSection_FileName.hxx
|
||||
HeaderSection_FileSchema.cxx
|
||||
HeaderSection_FileSchema.hxx
|
||||
HeaderSection_HeaderRecognizer.cxx
|
||||
HeaderSection_HeaderRecognizer.hxx
|
||||
HeaderSection_Protocol.cxx
|
||||
HeaderSection_Protocol.hxx
|
||||
|
51
src/HeaderSection/HeaderSection_HeaderRecognizer.cxx
Normal file
51
src/HeaderSection/HeaderSection_HeaderRecognizer.cxx
Normal file
@@ -0,0 +1,51 @@
|
||||
// Created on: 1994-06-27
|
||||
// Created by: Frederic MAUPAS
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 <HeaderSection_FileDescription.hxx>
|
||||
#include <HeaderSection_FileName.hxx>
|
||||
#include <HeaderSection_FileSchema.hxx>
|
||||
#include <HeaderSection_HeaderRecognizer.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
|
||||
|
||||
static TCollection_AsciiString reco_FileName ("FILE_NAME");
|
||||
static TCollection_AsciiString reco_FileSchema ("FILE_SCHEMA");
|
||||
static TCollection_AsciiString reco_FileDescription ("FILE_DESCRIPTION");
|
||||
|
||||
|
||||
|
||||
HeaderSection_HeaderRecognizer::HeaderSection_HeaderRecognizer ()
|
||||
{ }
|
||||
|
||||
void HeaderSection_HeaderRecognizer::Eval
|
||||
(const TCollection_AsciiString& key)
|
||||
{
|
||||
if (key.IsEqual(reco_FileName)) {
|
||||
SetOK(new HeaderSection_FileName);
|
||||
return;
|
||||
}
|
||||
if (key.IsEqual(reco_FileSchema)) {
|
||||
SetOK(new HeaderSection_FileSchema);
|
||||
return;
|
||||
}
|
||||
if (key.IsEqual(reco_FileDescription)) {
|
||||
SetOK(new HeaderSection_FileDescription);
|
||||
return;
|
||||
}
|
||||
}
|
66
src/HeaderSection/HeaderSection_HeaderRecognizer.hxx
Normal file
66
src/HeaderSection/HeaderSection_HeaderRecognizer.hxx
Normal file
@@ -0,0 +1,66 @@
|
||||
// Created on: 1994-06-27
|
||||
// Created by: Frederic MAUPAS
|
||||
// Copyright (c) 1994-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 _HeaderSection_HeaderRecognizer_HeaderFile
|
||||
#define _HeaderSection_HeaderRecognizer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepData_FileRecognizer.hxx>
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class HeaderSection_HeaderRecognizer;
|
||||
DEFINE_STANDARD_HANDLE(HeaderSection_HeaderRecognizer, StepData_FileRecognizer)
|
||||
|
||||
//! Recognizes STEP Standard Header Entities
|
||||
//! (FileName, FileDescription, FileSchema)
|
||||
class HeaderSection_HeaderRecognizer : public StepData_FileRecognizer
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT HeaderSection_HeaderRecognizer();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Recognizes data types of Header STEP Standard
|
||||
Standard_EXPORT void Eval (const TCollection_AsciiString& key) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _HeaderSection_HeaderRecognizer_HeaderFile
|
@@ -877,6 +877,62 @@ static IFSelect_ReturnStatus fun27
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
static IFSelect_ReturnStatus fun28
|
||||
(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
const Standard_CString arg2 = pilot->Arg(2);
|
||||
const Standard_CString arg3 = pilot->Arg(3);
|
||||
// **** DefParam ****
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (argc < 2) {
|
||||
Handle(TColStd_HSequenceOfHAsciiString) li = Interface_Static::Items();
|
||||
Standard_Integer i,nb = li->Length();
|
||||
sout<<" List of parameters : "<<nb<<" items :"<<Message_EndLine;
|
||||
for (i = 1; i <= nb; i ++) sout<<" "<<li->Value(i)->ToCString();
|
||||
sout<<Message_EndLine<<" defparam name_param to known more about one"<<Message_EndLine;
|
||||
sout<<" defparam nom_param e options to edit a definition"<<Message_EndLine;
|
||||
|
||||
} else if (argc == 2) {
|
||||
sout<<" Definition of Parameter : "<<arg1<<Message_EndLine;
|
||||
Handle(Interface_Static) unst = Interface_Static::Static (arg1);
|
||||
if (unst.IsNull()) sout<<" undefined"<<Message_EndLine;
|
||||
else unst->Print(sout);
|
||||
return IFSelect_RetVoid;
|
||||
|
||||
} else if (arg2[0] == 'i') {
|
||||
// initialisation : arg1=nompar a2='i' a3=family a4=type [a5=val]
|
||||
if (argc < 5) { sout<<" name init family type [valinit]"<<Message_EndLine; return IFSelect_RetVoid; }
|
||||
char typ = (pilot->Arg(4))[0];
|
||||
Standard_Boolean ok= (argc==5 ? Interface_Static::Init(arg3,arg1,typ) :
|
||||
Interface_Static::Init(arg3,arg1,typ,pilot->Arg(5)));
|
||||
return (ok ? IFSelect_RetDone : IFSelect_RetFail);
|
||||
|
||||
} else if (arg2[0] == 'e') {
|
||||
// edition : arg1=nompar arg2='e' arg3=option arg4...=parametres option
|
||||
char comm[100];
|
||||
if (argc < 4) {
|
||||
sout<<" give name and options ! Options (according type), 1 a time\n"
|
||||
<<" imin ival / imax ival / rmin rval / rmax rval /\n"
|
||||
<<" enum stnum / enum stnum match / eval e1 e2 e3 ... (maxi 10)\n"
|
||||
<<Message_EndLine;
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
if (argc > 4) sout<<"Only the command and ONE more arg are considered"<<Message_EndLine;
|
||||
sprintf(comm,"%s %s",pilot->Arg(3),pilot->Arg(4));
|
||||
sout<<"Editing parameter : "<<arg1<<" , by command : "<<comm<<Message_EndLine;
|
||||
|
||||
Handle(Interface_Static) unst = Interface_Static::Static (arg1);
|
||||
if (unst.IsNull()) { sout<<arg1<<" undefined"<<Message_EndLine; return IFSelect_RetError; }
|
||||
if (Interface_Static::Init(unst->Family(),arg1,'&',comm))
|
||||
{ sout<<"Editing done"<<Message_EndLine; return IFSelect_RetDone; }
|
||||
else { sout<<"Command not processed : "<<comm<<Message_EndLine; return IFSelect_RetFail; }
|
||||
}
|
||||
sout<<"Unknown Option : "<<arg2<<Message_EndLine;
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
static IFSelect_ReturnStatus fun29
|
||||
(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
@@ -2438,6 +2494,7 @@ void IFSelect_Functions::Init()
|
||||
IFSelect_Act::AddFunc("xsave","filename:string : sauve items-session",fun25);
|
||||
IFSelect_Act::AddFunc("xrestore","filename:string : restaure items-session",fun26);
|
||||
IFSelect_Act::AddFunc("param","nompar:string : displays parameter value; + nompar val : changes it",fun27);
|
||||
IFSelect_Act::AddFunc("defparam","nompar:string : display def. param; also : nompar edit, nompar init",fun28);
|
||||
|
||||
IFSelect_Act::AddFunc("sentfiles","Lists files sent from last Load",fun29);
|
||||
IFSelect_Act::AddFunc("fileprefix","prefix:string : definit File Prefix",fun30);
|
||||
|
@@ -87,10 +87,10 @@ static struct dirpage *curpage;
|
||||
/* Utilitaire : Reservation de caracteres
|
||||
Remplace suite de mini-malloc par gestion de page */
|
||||
|
||||
static char* iges_newchar (int lentext)
|
||||
char* iges_newchar (char* newtext, int lentext)
|
||||
{
|
||||
int lnt = onecarpage->used;
|
||||
if (lnt > Maxcar-lentext-1) { /* allouer nouvelle page */
|
||||
int i, lnt;
|
||||
if ((lnt = onecarpage->used) > Maxcar-lentext-1) { /* allouer nouvelle page */
|
||||
struct carpage *newpage;
|
||||
unsigned int sizepage = sizeof(struct carpage);
|
||||
if (lentext >= Maxcar) sizepage += (lentext+1 - Maxcar);
|
||||
@@ -102,8 +102,9 @@ static char* iges_newchar (int lentext)
|
||||
restext = onecarpage->cars + lnt;
|
||||
onecarpage->used = (lnt + lentext + 1);
|
||||
/* strcpy */
|
||||
for (i = lentext-1; i >= 0; i --) restext[i] = newtext[i];
|
||||
restext[lentext] = '\0';
|
||||
return restext;
|
||||
return (restext);
|
||||
}
|
||||
|
||||
|
||||
@@ -192,13 +193,8 @@ void iges_curpart (int dnum)
|
||||
void iges_newparam (int typarg, int longval, char *parval)
|
||||
{
|
||||
char *newval;
|
||||
int i;
|
||||
|
||||
if (curlist == NULL) return; /* non defini : abandon */
|
||||
|
||||
newval = iges_newchar(longval);
|
||||
for (i = 0; i < longval; i++) newval[i] = parval[i];
|
||||
|
||||
newval = iges_newchar(parval,longval);
|
||||
/* curparam = (struct oneparam*) malloc ( sizeof(struct oneparam) ); */
|
||||
if (oneparpage->used > Maxpar) {
|
||||
struct parpage* newparpage;
|
||||
@@ -227,7 +223,7 @@ void iges_addparam (int longval, char* parval)
|
||||
oldval = curparam->parval;
|
||||
long0 = (int)strlen(oldval);
|
||||
/* newval = (char*) malloc(long0+longval+1); */
|
||||
newval = iges_newchar (long0 + longval + 1);
|
||||
newval = iges_newchar("",long0+longval+1);
|
||||
for (i = 0; i < long0; i ++) newval[i] = oldval[i];
|
||||
for (i = 0; i < longval; i ++) newval[i+long0] = parval[i];
|
||||
newval[long0+longval] = '\0';
|
||||
|
@@ -31,10 +31,6 @@
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma comment(lib, "Ole32.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <Image_AlienPixMap.hxx>
|
||||
@@ -593,13 +589,6 @@ bool Image_AlienPixMap::Load (const Standard_Byte* theData,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (FreeImage_GetBPP (anImage) == 1)
|
||||
{
|
||||
FIBITMAP* aTmpImage = FreeImage_ConvertTo8Bits (anImage);
|
||||
FreeImage_Unload (anImage);
|
||||
anImage = aTmpImage;
|
||||
}
|
||||
|
||||
Image_Format aFormat = convertFromFreeFormat (FreeImage_GetImageType(anImage),
|
||||
FreeImage_GetColorType(anImage),
|
||||
FreeImage_GetBPP (anImage));
|
||||
|
@@ -66,7 +66,7 @@ Interface_FileReaderTool::Interface_FileReaderTool ()
|
||||
{
|
||||
themessenger = Message::DefaultMessenger();
|
||||
theerrhand = Standard_True;
|
||||
thetrace = 0;
|
||||
thetrace = 1;
|
||||
thenbrep0 = thenbreps = 0;
|
||||
}
|
||||
|
||||
@@ -334,13 +334,10 @@ void Interface_FileReaderTool::LoadModel
|
||||
}
|
||||
catch (Standard_Failure const&) {
|
||||
// Sendinf of message : Internal error during the header reading
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg11("XSTEP_11");
|
||||
TF->Send (Msg11, Message_Info);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
BeginRead(amodel); // selon la norme
|
||||
|
||||
@@ -370,12 +367,9 @@ void Interface_FileReaderTool::LoadModel
|
||||
// .. Fin Lecture ..
|
||||
if (anent.IsNull()) {
|
||||
// Sending of message : Number of ignored Null Entities
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg21("XSTEP_21");
|
||||
Msg21.Arg(amodel->NbEntities());
|
||||
TF->Send (Msg21, Message_Info);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// LoadedEntity fait AddEntity MAIS PAS SetReport (en bloc a la fin)
|
||||
@@ -401,14 +395,9 @@ void Interface_FileReaderTool::LoadModel
|
||||
if (thetrace > 0)
|
||||
{
|
||||
// Sending of message : Number of ignored Null Entities
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
|
||||
Message_Msg Msg21("XSTEP_21");
|
||||
Msg21.Arg(amodel->NbEntities()+1);
|
||||
|
||||
TF->Send (Msg21, Message_Info);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -420,12 +409,9 @@ void Interface_FileReaderTool::LoadModel
|
||||
|
||||
if (ierr == 2) {
|
||||
// Sending of message : reading of entity failed
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
Msg22.Arg(amodel->StringLabel(anent));
|
||||
TF->Send (Msg22, Message_Info);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -435,13 +421,10 @@ void Interface_FileReaderTool::LoadModel
|
||||
// ce qui serait bien ici serait de recuperer le texte de l erreur pour ach ...
|
||||
if (thetrace > 0) {
|
||||
// Sending of message : recovered entity
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg23("XSTEP_23");
|
||||
Msg23.Arg(num);
|
||||
TF->Send (Msg23, Message_Info);
|
||||
}
|
||||
}
|
||||
|
||||
// Finalement, on charge une Entite Inconnue
|
||||
thenbreps ++;
|
||||
@@ -461,13 +444,10 @@ void Interface_FileReaderTool::LoadModel
|
||||
else {
|
||||
if (thetrace > 0) {
|
||||
// Sending of message : reading of entity failed
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
Msg22.Arg(amodel->StringLabel(anent));
|
||||
TF->Send (Msg22, Message_Info);
|
||||
}
|
||||
}
|
||||
// On garde <rep> telle quelle : pas d analyse fichier supplementaire,
|
||||
// Mais la phase preliminaire eventuelle est conservee
|
||||
// (en particulier, on garde trace du Type lu du fichier, etc...)
|
||||
@@ -480,13 +460,10 @@ void Interface_FileReaderTool::LoadModel
|
||||
if (thetrace > 0)
|
||||
{
|
||||
// Sending of message : report
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg24("XSTEP_24");
|
||||
Msg24.Arg(thenbreps);
|
||||
TF->Send (Msg24, Message_Info);
|
||||
}
|
||||
}
|
||||
amodel->Reservate (-thenbreps-10);
|
||||
thenbreps = thereports->Upper();
|
||||
for (Standard_Integer nr = 1; nr <= thenbreps; nr ++) {
|
||||
@@ -506,13 +483,10 @@ void Interface_FileReaderTool::LoadModel
|
||||
}
|
||||
catch (Standard_Failure const&) {
|
||||
// Sendinf of message : Internal error during the header reading
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg11("XSTEP_11");
|
||||
TF->Send (Msg11, Message_Info);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
EndRead(amodel); // selon la norme
|
||||
}
|
||||
@@ -539,14 +513,11 @@ Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity
|
||||
// Trace Entite Inconnue
|
||||
if (thetrace >= 2 && theproto->IsUnknownEntity(anent)) {
|
||||
Handle(Message_Messenger) TF = Messenger();
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
// Sending of message : reading of entity failed
|
||||
Msg22.Arg(themodel->StringLabel(anent)->String());
|
||||
TF->Send (Msg22, Message_Info);
|
||||
}
|
||||
}
|
||||
// .. Chargement proprement dit : Specifique de la Norme ..
|
||||
AnalyseRecord(num,anent,ach);
|
||||
|
||||
@@ -574,7 +545,7 @@ Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity
|
||||
}
|
||||
thereports->SetValue(irep,rep);
|
||||
|
||||
if ( thetrace >= 2 && !Messenger().IsNull())
|
||||
if ( thetrace >= 2)
|
||||
ach->Print (Messenger(),2);
|
||||
}
|
||||
|
||||
|
@@ -508,11 +508,7 @@ bool Media_PlayerContext::receiveFrame (const Handle(Media_Frame)& theFrame,
|
||||
//================================================================
|
||||
void Media_PlayerContext::doThreadLoop()
|
||||
{
|
||||
// always set OCCT signal handler to catch signals if any;
|
||||
// this is safe (for thread local handler) since the thread
|
||||
// is owned by this class
|
||||
OSD::SetThreadLocalSignal (OSD_SignalMode_Set, false);
|
||||
|
||||
OSD::SetSignal (false);
|
||||
Handle(Media_Frame) aFrame;
|
||||
bool wasSeeked = false;
|
||||
for (;;)
|
||||
|
@@ -34,7 +34,6 @@ MeshVS_CommonSensitiveEntity::MeshVS_CommonSensitiveEntity (const Handle(SelectM
|
||||
myDataSource (theParentMesh->GetDataSource()),
|
||||
mySelMethod (theSelMethod)
|
||||
{
|
||||
myMaxFaceNodes = 0;
|
||||
theParentMesh->GetDrawer()->GetInteger (MeshVS_DA_MaxFaceNodes, myMaxFaceNodes);
|
||||
Standard_ASSERT_RAISE (myMaxFaceNodes > 0,
|
||||
"The maximal amount of nodes in a face must be greater than zero to create sensitive entity");
|
||||
|
@@ -179,7 +179,8 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
||||
//Now we are ready to draw faces with equal colors
|
||||
Aspect_TypeOfLine anEdgeType = Aspect_TOL_SOLID;
|
||||
Aspect_TypeOfLine aLineType = Aspect_TOL_SOLID;
|
||||
Standard_Real anEdgeWidth = 1.0, aLineWidth = 1.0;
|
||||
Standard_Integer anEdgeInt, aLineInt;
|
||||
Standard_Real anEdgeWidth, aLineWidth;
|
||||
Quantity_Color anInteriorColor;
|
||||
Quantity_Color anEdgeColor, aLineColor;
|
||||
Standard_Boolean anEdgeOn = Standard_True, IsReflect = Standard_False,
|
||||
@@ -196,11 +197,9 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
||||
aDrawer->GetBoolean( MeshVS_DA_SmoothShading, IsMeshSmoothShading );
|
||||
aDrawer->GetBoolean (MeshVS_DA_SupressBackFaces, toSupressBackFaces);
|
||||
|
||||
Standard_Integer anEdgeInt = Aspect_TOL_SOLID;
|
||||
if ( aDrawer->GetInteger ( MeshVS_DA_EdgeType, anEdgeInt) )
|
||||
anEdgeType = (Aspect_TypeOfLine) anEdgeInt;
|
||||
|
||||
Standard_Integer aLineInt = Aspect_TOL_SOLID;
|
||||
if ( aDrawer->GetInteger ( MeshVS_DA_BeamType, aLineInt) )
|
||||
aLineType = (Aspect_TypeOfLine) aLineInt;
|
||||
|
||||
@@ -216,14 +215,13 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
||||
PolygonVerticesFor3D, PolygonBoundsFor3D );
|
||||
}
|
||||
|
||||
Graphic3d_MaterialAspect aMaterial[2] = { Graphic3d_NOM_PLASTIC, Graphic3d_NOM_PLASTIC };
|
||||
Graphic3d_MaterialAspect aMaterial[2];
|
||||
for (Standard_Integer i = 0; i < 2; i++)
|
||||
{
|
||||
// OCC20644 "plastic" is most suitable here, as it is "non-physic"
|
||||
// so TelUpdateMaterial() from OpenGl_attri.c uses the interior
|
||||
// color from AspectFillArea3d to calculate all material colors
|
||||
aMaterial[i].SetSpecularColor (Quantity_NOC_BLACK);
|
||||
aMaterial[i].SetEmissiveColor (Quantity_NOC_BLACK);
|
||||
aMaterial[i] = Graphic3d_MaterialAspect ( Graphic3d_NOM_PLASTIC );
|
||||
|
||||
// OCC21720 For single-colored elements turning all material components off is a good idea,
|
||||
// as anyhow the normals are not computed and the lighting will be off,
|
||||
@@ -231,8 +229,10 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
||||
// and there is no need to spend time on updating material properties
|
||||
if ( !IsReflect )
|
||||
{
|
||||
aMaterial[i].SetAmbientColor (Quantity_NOC_BLACK);
|
||||
aMaterial[i].SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
aMaterial[i].SetReflectionModeOff(Graphic3d_TOR_AMBIENT);
|
||||
aMaterial[i].SetReflectionModeOff(Graphic3d_TOR_DIFFUSE);
|
||||
aMaterial[i].SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
|
||||
aMaterial[i].SetReflectionModeOff(Graphic3d_TOR_EMISSION);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -241,8 +241,10 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
||||
// those in the color scale most exactly (the sum of all reflection
|
||||
// coefficients is equal to 1). See also MeshVS_NodalColorPrsBuilder
|
||||
// class for more explanations.
|
||||
aMaterial[i].SetAmbientColor (Quantity_Color (Graphic3d_Vec3 (0.5f)));
|
||||
aMaterial[i].SetDiffuseColor (Quantity_Color (Graphic3d_Vec3 (0.5f)));
|
||||
aMaterial[i].SetAmbient( .5 );
|
||||
aMaterial[i].SetDiffuse( .5 );
|
||||
aMaterial[i].SetSpecular( 0. );
|
||||
aMaterial[i].SetEmissive( 0. );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,14 +481,13 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
||||
CustomBuild(Prs, aCustomElements, IDsToExclude, DisplayMode);
|
||||
}
|
||||
|
||||
Graphic3d_MaterialAspect aMaterial2[2] = { Graphic3d_NOM_PLASTIC, Graphic3d_NOM_PLASTIC };
|
||||
Graphic3d_MaterialAspect aMaterial2[2];
|
||||
for (Standard_Integer i = 0; i < 2; i++)
|
||||
{
|
||||
// OCC20644 "plastic" is most suitable here, as it is "non-physic"
|
||||
// so TelUpdateMaterial() from OpenGl_attri.c uses the interior
|
||||
// color from AspectFillArea3d to calculate all material colors
|
||||
aMaterial2[i].SetSpecularColor (Quantity_NOC_BLACK);
|
||||
aMaterial2[i].SetEmissiveColor (Quantity_NOC_BLACK);
|
||||
aMaterial2[i] = Graphic3d_MaterialAspect ( Graphic3d_NOM_PLASTIC );
|
||||
|
||||
if ( !IsReflect )
|
||||
{
|
||||
@@ -495,8 +496,14 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
||||
// to have different materials for front and back sides!
|
||||
// Instead, trying to make material color "nondirectional" with
|
||||
// only ambient component on.
|
||||
aMaterial2[i].SetAmbientColor (Quantity_Color (Graphic3d_Vec3 (1.0f)));
|
||||
aMaterial2[i].SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
aMaterial2[i].SetReflectionModeOn ( Graphic3d_TOR_AMBIENT );
|
||||
aMaterial2[i].SetReflectionModeOff( Graphic3d_TOR_DIFFUSE );
|
||||
aMaterial2[i].SetReflectionModeOff( Graphic3d_TOR_SPECULAR );
|
||||
aMaterial2[i].SetReflectionModeOff( Graphic3d_TOR_EMISSION );
|
||||
aMaterial2[i].SetAmbient ( 1. );
|
||||
aMaterial2[i].SetDiffuse ( 0. );
|
||||
aMaterial2[i].SetSpecular( 0. );
|
||||
aMaterial2[i].SetEmissive( 0. );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -505,8 +512,10 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
||||
// those in the color scale most exactly (the sum of all reflection
|
||||
// coefficients is equal to 1). See also MeshVS_NodalColorPrsBuilder
|
||||
// class for more explanations.
|
||||
aMaterial2[i].SetAmbientColor (Quantity_Color (Graphic3d_Vec3 (0.5f)));
|
||||
aMaterial2[i].SetDiffuseColor (Quantity_Color (Graphic3d_Vec3 (0.5f)));
|
||||
aMaterial2[i].SetAmbient( .5 );
|
||||
aMaterial2[i].SetDiffuse( .5 );
|
||||
aMaterial2[i].SetSpecular( 0. );
|
||||
aMaterial2[i].SetEmissive( 0. );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -195,7 +195,7 @@ void MeshVS_MeshPrsBuilder::BuildElements( const Handle(Prs3d_Presentation)& Prs
|
||||
aDispMode &= MeshVS_DMF_OCCMask;
|
||||
//--------------------------------------------------------
|
||||
|
||||
Standard_Real aShrinkCoef = 0.0;
|
||||
Standard_Real aShrinkCoef;
|
||||
aDrawer->GetDouble ( MeshVS_DA_ShrinkCoeff, aShrinkCoef );
|
||||
|
||||
Standard_Boolean IsWireFrame = ( aDispMode==MeshVS_DMF_WireFrame ),
|
||||
@@ -203,12 +203,11 @@ void MeshVS_MeshPrsBuilder::BuildElements( const Handle(Prs3d_Presentation)& Prs
|
||||
IsShrink = ( aDispMode==MeshVS_DMF_Shrink ),
|
||||
HasHilightFlag = ( ( DisplayMode & MeshVS_DMF_HilightPrs ) != 0 ),
|
||||
HasSelectFlag = ( ( DisplayMode & MeshVS_DMF_SelectionPrs ) != 0 ),
|
||||
IsMeshReflect = Standard_False, IsMeshAllowOverlap = Standard_False,
|
||||
IsMeshSmoothShading = Standard_False;
|
||||
IsMeshReflect, IsMeshAllowOverlap, IsReflect, IsMeshSmoothShading = Standard_False;
|
||||
|
||||
aDrawer->GetBoolean ( MeshVS_DA_Reflection, IsMeshReflect );
|
||||
aDrawer->GetBoolean ( MeshVS_DA_IsAllowOverlapped, IsMeshAllowOverlap );
|
||||
const Standard_Boolean IsReflect = ( IsMeshReflect && !HasHilightFlag );
|
||||
IsReflect = ( IsMeshReflect && !HasHilightFlag );
|
||||
aDrawer->GetBoolean ( MeshVS_DA_SmoothShading, IsMeshSmoothShading );
|
||||
|
||||
// display mode for highlighted prs of groups
|
||||
@@ -220,10 +219,10 @@ void MeshVS_MeshPrsBuilder::BuildElements( const Handle(Prs3d_Presentation)& Prs
|
||||
aDrawer->GetMaterial ( MeshVS_DA_FrontMaterial, AMat );
|
||||
if ( !IsReflect )
|
||||
{
|
||||
AMat.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
AMat.SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
AMat.SetSpecularColor(Quantity_NOC_BLACK);
|
||||
AMat.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
AMat.SetReflectionModeOff(Graphic3d_TOR_AMBIENT);
|
||||
AMat.SetReflectionModeOff(Graphic3d_TOR_DIFFUSE);
|
||||
AMat.SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
|
||||
AMat.SetReflectionModeOff(Graphic3d_TOR_EMISSION);
|
||||
}
|
||||
Handle( Graphic3d_AspectFillArea3d ) aFill = MeshVS_Tool::CreateAspectFillArea3d( GetDrawer(), AMat );
|
||||
Handle( Graphic3d_AspectLine3d ) aBeam = MeshVS_Tool::CreateAspectLine3d ( GetDrawer() );
|
||||
@@ -534,10 +533,10 @@ void MeshVS_MeshPrsBuilder::BuildHilightPrs ( const Handle(Prs3d_Presentation)&
|
||||
|
||||
Graphic3d_MaterialAspect AMat;
|
||||
aDrawer->GetMaterial ( MeshVS_DA_FrontMaterial, AMat );
|
||||
AMat.SetAmbientColor (Quantity_NOC_BLACK);
|
||||
AMat.SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
AMat.SetSpecularColor(Quantity_NOC_BLACK);
|
||||
AMat.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
AMat.SetReflectionModeOff(Graphic3d_TOR_AMBIENT);
|
||||
AMat.SetReflectionModeOff(Graphic3d_TOR_DIFFUSE);
|
||||
AMat.SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
|
||||
AMat.SetReflectionModeOff(Graphic3d_TOR_EMISSION);
|
||||
|
||||
Handle( Graphic3d_AspectFillArea3d ) aFill = MeshVS_Tool::CreateAspectFillArea3d( GetDrawer(), AMat );
|
||||
Handle( Graphic3d_AspectLine3d ) aBeam = MeshVS_Tool::CreateAspectLine3d( GetDrawer() );
|
||||
|
@@ -189,16 +189,20 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
||||
}
|
||||
|
||||
// Draw faces with nodal color
|
||||
// OCC20644 Use "plastic" material as it is "non-physic" and so it is easier to get the required colors
|
||||
Graphic3d_MaterialAspect aMaterial[2] = { Graphic3d_NOM_PLASTIC, Graphic3d_NOM_PLASTIC };
|
||||
for (Standard_Integer i = 0; i < 2; ++i)
|
||||
// OCC20644 Use "plastic" material as it is "non-physic" and so it is easier
|
||||
// to get the required colors (see TelUpdateMaterial() function in OpenGl_attri.c)
|
||||
Graphic3d_MaterialAspect aMaterial[ 2 ];
|
||||
aMaterial[ 0 ] = Graphic3d_MaterialAspect( Graphic3d_NOM_PLASTIC );
|
||||
aMaterial[ 1 ] = Graphic3d_MaterialAspect( Graphic3d_NOM_PLASTIC );
|
||||
Standard_Integer i;
|
||||
for ( i = 0; i < 2; i++ )
|
||||
{
|
||||
aMaterial[i].SetSpecularColor (Quantity_NOC_BLACK);
|
||||
aMaterial[i].SetEmissiveColor (Quantity_NOC_BLACK);
|
||||
if ( !IsReflect )
|
||||
{
|
||||
aMaterial[i].SetAmbientColor (Quantity_NOC_BLACK);
|
||||
aMaterial[i].SetDiffuseColor (Quantity_NOC_BLACK);
|
||||
aMaterial[ i ].SetReflectionModeOff( Graphic3d_TOR_SPECULAR );
|
||||
aMaterial[ i ].SetReflectionModeOff( Graphic3d_TOR_AMBIENT );
|
||||
aMaterial[ i ].SetReflectionModeOff( Graphic3d_TOR_DIFFUSE );
|
||||
aMaterial[ i ].SetReflectionModeOff( Graphic3d_TOR_EMISSION );
|
||||
}
|
||||
else{
|
||||
// OCC20644 Using the material with reflection properties same as in
|
||||
@@ -211,11 +215,15 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
||||
// is done by TelUpdateMaterial().
|
||||
// 0.5 is used to have the colors in 3D maximally similar to those in the color scale.
|
||||
// This is possible when the sum of all coefficient is equal to 1.
|
||||
aMaterial[i].SetAmbientColor (Quantity_Color (Graphic3d_Vec3 (0.5f)));
|
||||
aMaterial[i].SetDiffuseColor (Quantity_Color (Graphic3d_Vec3 (0.5f)));
|
||||
aMaterial[i].SetAmbient( .5 );
|
||||
aMaterial[i].SetDiffuse( .5 );
|
||||
aMaterial[i].SetSpecular( 0. );
|
||||
aMaterial[i].SetEmissive( 0. );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Create array of polygons for interior presentation of faces and volumes
|
||||
Handle(Graphic3d_ArrayOfPolygons) aCPolyArr = new Graphic3d_ArrayOfPolygons
|
||||
( aMaxFaceNodes * aSize + PolygonVerticesFor3D, aSize + PolygonBoundsFor3D,
|
||||
@@ -275,7 +283,7 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
||||
gp_Dir aDefNorm( 0., 0., 1. );
|
||||
|
||||
// Prepare for scaling the incoming colors
|
||||
const Standard_Real anColorRatio = !IsReflect ? 0.44f : 0.5f;
|
||||
Standard_Real anColorRatio = aMaterial[0].Ambient();
|
||||
|
||||
for (it.Reset(); it.More(); it.Next())
|
||||
{
|
||||
@@ -411,7 +419,8 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
||||
// Aspect_InteriorStyle aStyle;
|
||||
// Standard_Integer aStyleInt;
|
||||
Aspect_TypeOfLine anEdgeType = Aspect_TOL_SOLID;
|
||||
Standard_Real anEdgeWidth = 1.0;
|
||||
Standard_Integer anEdgeInt;
|
||||
Standard_Real anEdgeWidth;
|
||||
Quantity_Color anInteriorColor;
|
||||
Quantity_Color anEdgeColor, aLineColor;
|
||||
Standard_Boolean aShowEdges = Standard_True;
|
||||
@@ -422,7 +431,6 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
||||
aDrawer->GetDouble ( MeshVS_DA_EdgeWidth, anEdgeWidth );
|
||||
aDrawer->GetBoolean( MeshVS_DA_ShowEdges, aShowEdges );
|
||||
|
||||
Standard_Integer anEdgeInt = Aspect_TOL_SOLID;
|
||||
if ( aDrawer->GetInteger ( MeshVS_DA_EdgeType, anEdgeInt ) )
|
||||
anEdgeType = (Aspect_TypeOfLine) anEdgeInt;
|
||||
|
||||
|
@@ -167,27 +167,25 @@ void MeshVS_TextPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
||||
Standard_Real AExpansionFactor = 1.0;
|
||||
Standard_Real ASpace = 0.0;
|
||||
Aspect_TypeOfStyleText ATextStyle = Aspect_TOST_ANNOTATION;
|
||||
Standard_Integer AStyleInt;
|
||||
Aspect_TypeOfDisplayText ADisplayType = Aspect_TODT_NORMAL;
|
||||
TCollection_AsciiString AFontString;
|
||||
Standard_Integer ADispInt;
|
||||
// Bold font is used by default for better text readability
|
||||
Font_FontAspect AFontAspectType = Font_FA_Bold;
|
||||
Standard_Integer AAspect;
|
||||
|
||||
|
||||
aDrawer->GetColor ( MeshVS_DA_TextColor, AColor );
|
||||
aDrawer->GetDouble ( MeshVS_DA_TextExpansionFactor, AExpansionFactor );
|
||||
aDrawer->GetDouble ( MeshVS_DA_TextSpace, ASpace );
|
||||
|
||||
TCollection_AsciiString AFontString = Font_NOF_ASCII_MONO;
|
||||
if ( aDrawer->GetAsciiString ( MeshVS_DA_TextFont, AFontString ) )
|
||||
AFont = AFontString.ToCString();
|
||||
|
||||
Standard_Integer AStyleInt = Aspect_TOST_ANNOTATION;
|
||||
if ( aDrawer->GetInteger ( MeshVS_DA_TextStyle, AStyleInt ) )
|
||||
ATextStyle = (Aspect_TypeOfStyleText) AStyleInt;
|
||||
|
||||
Standard_Integer ADispInt = Aspect_TODT_NORMAL;
|
||||
if ( aDrawer->GetInteger ( MeshVS_DA_TextDisplayType, ADispInt ) )
|
||||
ADisplayType = (Aspect_TypeOfDisplayText) ADispInt;
|
||||
|
||||
Standard_Integer AAspect = Font_FA_Bold;
|
||||
if ( aDrawer->GetInteger ( MeshVS_DA_TextFontAspect, AAspect ) )
|
||||
AFontAspectType = (Font_FontAspect)AAspect;
|
||||
|
||||
|
@@ -13,8 +13,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <NCollection_BaseAllocator.hxx>
|
||||
// Purpose: Implementation of the BaseAllocator class
|
||||
|
||||
#include <NCollection_BaseAllocator.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <NCollection_Map.hxx>
|
||||
@@ -59,38 +60,57 @@ const Handle(NCollection_BaseAllocator)&
|
||||
return pAllocator;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
// global variable to ensure that allocator will be created during loading the library
|
||||
static Handle(NCollection_BaseAllocator) theAllocInit = NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
static Handle(NCollection_BaseAllocator) theAllocInit =
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
|
||||
//! Structure for collecting statistics about blocks of one size
|
||||
//=======================================================================
|
||||
/**
|
||||
* Structure for collecting statistics about blocks of one size
|
||||
*/
|
||||
//=======================================================================
|
||||
struct StorageInfo
|
||||
{
|
||||
Standard_Size roundSize;
|
||||
int nbAlloc;
|
||||
int nbFree;
|
||||
StorageInfo() : roundSize(0), nbAlloc(0), nbFree(0) {}
|
||||
StorageInfo(Standard_Size theSize) : roundSize(theSize), nbAlloc(0), nbFree(0) {}
|
||||
StorageInfo()
|
||||
: roundSize(0), nbAlloc(0), nbFree(0) {}
|
||||
StorageInfo(Standard_Size theSize)
|
||||
: roundSize(theSize), nbAlloc(0), nbFree(0) {}
|
||||
};
|
||||
|
||||
//! Static data map (block_size -> StorageInfo)
|
||||
//=======================================================================
|
||||
/**
|
||||
* Static data map (block_size -> StorageInfo)
|
||||
*/
|
||||
//=======================================================================
|
||||
static NCollection_DataMap<Standard_Size, StorageInfo>& StorageMap()
|
||||
{
|
||||
static NCollection_IncAllocator TheAlloc;
|
||||
static NCollection_DataMap<Standard_Size, StorageInfo> TheMap (1, & TheAlloc);
|
||||
static NCollection_DataMap<Standard_Size, StorageInfo>
|
||||
TheMap (1, & TheAlloc);
|
||||
return TheMap;
|
||||
}
|
||||
|
||||
//! Static data map (address -> AllocationID)
|
||||
//=======================================================================
|
||||
/**
|
||||
* Static data map (address -> AllocationID)
|
||||
*/
|
||||
//=======================================================================
|
||||
static NCollection_DataMap<Standard_Address, Standard_Size>& StorageIDMap()
|
||||
{
|
||||
static NCollection_IncAllocator TheAlloc;
|
||||
static NCollection_DataMap<Standard_Address, Standard_Size> TheMap (1, & TheAlloc);
|
||||
static NCollection_DataMap<Standard_Address, Standard_Size>
|
||||
TheMap (1, & TheAlloc);
|
||||
return TheMap;
|
||||
}
|
||||
|
||||
//! Static map (AllocationID)
|
||||
//=======================================================================
|
||||
/**
|
||||
* Static map (AllocationID)
|
||||
*/
|
||||
//=======================================================================
|
||||
static NCollection_Map<Standard_Size>& StorageIDSet()
|
||||
{
|
||||
static NCollection_IncAllocator TheAlloc;
|
||||
@@ -98,13 +118,6 @@ namespace
|
||||
return TheMap;
|
||||
}
|
||||
|
||||
// dummy function for break point
|
||||
inline void place_for_break_point () {}
|
||||
|
||||
//! Static value of the current allocation ID. It provides unique numbering of allocation events.
|
||||
static Standard_Size CurrentID = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
/**
|
||||
* Exported value to set the block size for which it is required
|
||||
@@ -134,6 +147,14 @@ Standard_EXPORT Standard_Size& StandardCallBack_CatchID()
|
||||
return Value;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
/**
|
||||
* Static value of the current allocation ID. It provides unique
|
||||
* numbering of allocation events.
|
||||
*/
|
||||
//=======================================================================
|
||||
static Standard_Size CurrentID = 0;
|
||||
|
||||
//=======================================================================
|
||||
/**
|
||||
* Exported function to reset the callback system to the initial state
|
||||
@@ -149,6 +170,11 @@ Standard_EXPORT void StandardCallBack_Reset()
|
||||
StandardCallBack_CatchID() = 0;
|
||||
}
|
||||
|
||||
namespace {
|
||||
// dummy function for break point
|
||||
inline void place_for_break_point () {}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : StandardCallBack
|
||||
//purpose : Callback function to register alloc/free calls
|
||||
|
@@ -29,10 +29,8 @@ Standard_Boolean NCollection_BaseMap::BeginResize
|
||||
NCollection_ListNode**& data1,
|
||||
NCollection_ListNode**& data2) const
|
||||
{
|
||||
// get next size for the buckets array
|
||||
N = NextPrimeForMap(NbBuckets);
|
||||
if (N <= myNbBuckets)
|
||||
{
|
||||
if (N <= myNbBuckets) {
|
||||
if (!myData1)
|
||||
N = myNbBuckets;
|
||||
else
|
||||
|
@@ -95,51 +95,49 @@ private:
|
||||
//! Empty constructor
|
||||
Iterator()
|
||||
: myMap (NULL),
|
||||
myNode (NULL),
|
||||
myIndex (0) {}
|
||||
|
||||
//! Constructor
|
||||
Iterator (const NCollection_IndexedDataMap& theMap)
|
||||
: myMap ((NCollection_IndexedDataMap* )&theMap),
|
||||
myNode (!theMap.IsEmpty() ? (IndexedDataMapNode* )myMap->myData2[0] : NULL),
|
||||
myIndex (1) {}
|
||||
|
||||
//! Query if the end of collection is reached by iterator
|
||||
Standard_Boolean More(void) const
|
||||
{ return (myMap != NULL) && (myIndex <= myMap->Extent()); }
|
||||
|
||||
//! Make a step along the collection
|
||||
void Next(void)
|
||||
{ ++myIndex; }
|
||||
|
||||
{
|
||||
myNode = (IndexedDataMapNode* )myMap->myData2[++myIndex - 1];
|
||||
}
|
||||
//! Value access
|
||||
const TheItemType& Value(void) const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if(!More(), "NCollection_IndexedDataMap::Iterator::Value");
|
||||
return myMap->FindFromIndex(myIndex);
|
||||
return myNode->Value();
|
||||
}
|
||||
|
||||
//! ChangeValue access
|
||||
TheItemType& ChangeValue(void) const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if(!More(), "NCollection_IndexedDataMap::Iterator::ChangeValue");
|
||||
return myMap->ChangeFromIndex(myIndex);
|
||||
return myNode->ChangeValue();
|
||||
}
|
||||
|
||||
//! Key
|
||||
const TheKeyType& Key() const
|
||||
{
|
||||
Standard_NoSuchObject_Raise_if(!More(), "NCollection_IndexedDataMap::Iterator::Key");
|
||||
return myMap->FindKey(myIndex);
|
||||
return myNode->Key1();
|
||||
}
|
||||
|
||||
//! Performs comparison of two iterators.
|
||||
Standard_Boolean IsEqual (const Iterator& theOther) const
|
||||
{
|
||||
return myMap == theOther.myMap &&
|
||||
myNode == theOther.myNode &&
|
||||
myIndex == theOther.myIndex;
|
||||
}
|
||||
|
||||
private:
|
||||
NCollection_IndexedDataMap* myMap; //!< Pointer to current node
|
||||
NCollection_IndexedDataMap* myMap; //!< Pointer to the map being iterated
|
||||
IndexedDataMapNode* myNode; //!< Current node
|
||||
Standard_Integer myIndex; //!< Current index
|
||||
};
|
||||
|
||||
|
@@ -93,4 +93,3 @@ OSD_Timer.hxx
|
||||
OSD_WhoAmI.hxx
|
||||
OSD_WNT.cxx
|
||||
OSD_WNT.hxx
|
||||
OSD_SignalMode.hxx
|
||||
|
116
src/OSD/OSD.hxx
116
src/OSD/OSD.hxx
@@ -16,26 +16,49 @@
|
||||
#define _OSD_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
#include <OSD_SignalMode.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
//! Set of Operating Sytem Dependent (OSD) Tools
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class OSD_Error;
|
||||
class OSD_Protection;
|
||||
class OSD_Path;
|
||||
class OSD_FileNode;
|
||||
class OSD_Disk;
|
||||
class OSD_File;
|
||||
class OSD_FileIterator;
|
||||
class OSD_Directory;
|
||||
class OSD_DirectoryIterator;
|
||||
class OSD_Timer;
|
||||
class OSD_Host;
|
||||
class OSD_Environment;
|
||||
class OSD_EnvironmentIterator;
|
||||
class OSD_Process;
|
||||
class OSD_SharedLibrary;
|
||||
class OSD_Thread;
|
||||
|
||||
|
||||
//! Set of Operating Sytem Dependent Tools
|
||||
//! (O)perating (S)ystem (D)ependent
|
||||
class OSD
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Sets or removes signal and FPE (floating-point exception) handlers.
|
||||
//! OCCT signal handlers translate signals raised by C subsystem to C++
|
||||
//! exceptions inheriting Standard_Failure.
|
||||
|
||||
//! Sets signal and exception handlers.
|
||||
//!
|
||||
//! ### Windows-specific notes
|
||||
//!
|
||||
//! Compiled with MS VC++ sets 3 main handlers:
|
||||
//! @li Signal handlers (via ::signal() functions) that translate system signals
|
||||
//! (SIGSEGV, SIGFPE, SIGILL) into C++ exceptions (classes inheriting
|
||||
//! Standard_Failure). They only be called if function ::raise() is called
|
||||
//! Standard_Failure). They only be called if user calls ::raise() function
|
||||
//! with one of supported signal type set.
|
||||
//! @li Exception handler OSD::WntHandler() (via ::SetUnhandledExceptionFilter())
|
||||
//! that will be used when user's code is compiled with /EHs option.
|
||||
@@ -48,68 +71,41 @@ public:
|
||||
//! compile his code with (/EHs or /EHa), signals (or SE exceptions) will be
|
||||
//! translated into Open CASCADE C++ exceptions.
|
||||
//!
|
||||
//! MinGW should use SEH exception mode for signal handling to work.
|
||||
//! If @a theFloatingSignal is TRUE then floating point exceptions will be
|
||||
//! generated in accordance with the mask
|
||||
//! <tt>_EM_INVALID | _EM_DENORMAL | _EM_ZERODIVIDE | _EM_OVERFLOW</tt> that is
|
||||
//! used to call ::_controlfp() system function. If @a theFloatingSignal is FALSE
|
||||
//! corresponding operations (e.g. division by zero) will gracefully complete
|
||||
//! without an exception.
|
||||
//!
|
||||
//! ### Linux-specific notes
|
||||
//! ### Unix-specific notes
|
||||
//!
|
||||
//! OSD::SetSignal() sets handlers (via ::sigaction()) for multiple signals
|
||||
//! (SIGFPE, SIGSEGV, etc).
|
||||
//! (SIGFPE, SIGSEGV, etc). Currently the number of handled signals is much
|
||||
//! greater than for Windows, in the future this may change to provide better
|
||||
//! consistency with Windows.
|
||||
//!
|
||||
//! @a theFloatingSignal is recognized on Sun Solaris, Linux, and SGI Irix to
|
||||
//! generate floating-point exception according to the mask
|
||||
//! <tt>FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW</tt> (in Linux conventions).<br>
|
||||
//! When compiled with OBJS macro defined, already set signal handlers (e.g.
|
||||
//! by Data Base Managers) are not redefined.
|
||||
//!
|
||||
//! ### Common notes
|
||||
//!
|
||||
//! If @a theFloatingSignal is TRUE then floating point exceptions will
|
||||
//! generate SIGFPE in accordance with the mask
|
||||
//! - Windows: _EM_INVALID | _EM_DENORMAL | _EM_ZERODIVIDE | _EM_OVERFLOW,
|
||||
//! see _controlfp() system function.
|
||||
//! - Linux: FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW,
|
||||
//! see feenableexcept() system function.
|
||||
//! If OSD::SetSignal() method is used in at least one thread, it must also be
|
||||
//! called in any other thread where Open CASCADE will be used, to ensure
|
||||
//! consistency of behavior. Its @a aFloatingSignal argument must be consistent
|
||||
//! across threads.
|
||||
//!
|
||||
//! If @a theFloatingSignal is FALSE then floating point calculations will gracefully
|
||||
//! complete regardless of occurred exceptions (e.g. division by zero).
|
||||
//! Otherwise the (thread-specific) FPE flags are set to raise signal if one of
|
||||
//! floating-point exceptions (division by zero, overflow, or invalid operation) occurs.
|
||||
//! Keep in mind that whether the C++ exception will really be thrown (i.e.
|
||||
//! ::throw() will be called) is regulated by the
|
||||
//! OCC_CONVERT_SIGNALS macro used during compilation of Open CASCADE and
|
||||
//! user's code. Refer to Foundation Classes User's Guide for further details.
|
||||
//!
|
||||
//! The recommended approach is to call OSD::SetSignal() in the beginning of the
|
||||
//! execution of the program, in function main() or its equivalent.
|
||||
//! In multithreaded programs it is advisable to call OSD::SetSignal() or
|
||||
//! OSD::SetThreadLocalSignal() with the same parameters in other threads where
|
||||
//! OCCT is used, to ensure consistency of behavior.
|
||||
//!
|
||||
//! Note that in order to handle signals as C++ exceptions on Linux and under
|
||||
//! MinGW on Windows it is necessary to compile both OCCT and application with
|
||||
//! OCC_CONVERT_SIGNALS macro, and use macro OCC_CATCH_SIGNALS within each try{}
|
||||
//! block that has to catch this kind of exceptions.
|
||||
//!
|
||||
//! Refer to documentation of Standard_ErrorHandler.hxx for details.
|
||||
Standard_EXPORT static void SetSignal (OSD_SignalMode theSignalMode,
|
||||
Standard_Boolean theFloatingSignal);
|
||||
Standard_EXPORT static void SetSignal (const Standard_Boolean theFloatingSignal = Standard_True);
|
||||
|
||||
//! Sets signal and FPE handlers.
|
||||
//! Short-cut for OSD::SetSignal (OSD_SignalMode_Set, theFloatingSignal).
|
||||
static void SetSignal (const Standard_Boolean theFloatingSignal = Standard_True)
|
||||
{
|
||||
SetSignal (OSD_SignalMode_Set, theFloatingSignal);
|
||||
}
|
||||
|
||||
//! Initializes thread-local signal handlers.
|
||||
//! This includes _set_se_translator() on Windows platform, and SetFloatingSignal().
|
||||
//! The main purpose of this method is initializing handlers for newly created threads
|
||||
//! without overriding global handlers (set by application or by OSD::SetSignal()).
|
||||
Standard_EXPORT static void SetThreadLocalSignal (OSD_SignalMode theSignalMode,
|
||||
Standard_Boolean theFloatingSignal);
|
||||
|
||||
//! Enables / disables generation of C signal on floating point exceptions (FPE).
|
||||
//! This call does NOT register a handler for signal raised in case of FPE -
|
||||
//! SetSignal() should be called beforehand for complete setup.
|
||||
//! Note that FPE setting is thread-local, new threads inherit it from parent.
|
||||
Standard_EXPORT static void SetFloatingSignal (Standard_Boolean theFloatingSignal);
|
||||
|
||||
//! Returns signal mode set by the last call to SetSignal().
|
||||
//! By default, returns OSD_SignalMode_AsIs.
|
||||
Standard_EXPORT static OSD_SignalMode SignalMode();
|
||||
|
||||
//! Returns true if floating point exceptions will raise C signal
|
||||
//! according to current (platform-dependent) settings in this thread.
|
||||
//! Return floating signal catching value previously set by SetSignal().
|
||||
Standard_EXPORT static Standard_Boolean ToCatchFloatingSignals();
|
||||
|
||||
//! Commands the process to sleep for a number of seconds.
|
||||
|
@@ -246,8 +246,7 @@ void OSD_MAllocHook::LogFileHandler::Close()
|
||||
//function : LogFileHandler::MakeReport
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
namespace
|
||||
{
|
||||
|
||||
struct StorageInfo
|
||||
{
|
||||
Standard_Size size;
|
||||
@@ -270,7 +269,6 @@ namespace
|
||||
return size < theOther.size;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Standard_Boolean OSD_MAllocHook::LogFileHandler::MakeReport
|
||||
(const char* theLogFile,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user