1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Compare commits

..

2 Commits

Author SHA1 Message Date
kgv
0652ae3717 0030552: Foundation Classes - Stack overflow due to math_SingleTab static array size
math_Vector, math_IntegerVector - static size of NCollection_LocalArray has been reduced from 512 to 32.
2019-03-12 10:51:40 +03:00
kgv
31894e9a1b 0030558: Coding - replace math_SingleTab with NCollection_LocalArray
math_Vector::Multiplied() - fixed modification of original array.

math_SVD::Solve(), math_SVD::PseudoInverse(), GeomFill_LocationGuide::InitX() - removed incorrect constness.

math_Vector, math_IntegerVector - math_SingleTab has been replaced by NCollection_LocalArray+NCollection_Array1.
Added accessors returning const value.
2019-03-12 10:48:00 +03:00
418 changed files with 4416 additions and 15626 deletions

View File

@@ -86,11 +86,6 @@ if (BUILD_WITH_DEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
endif()
# option disabling OCCT exceptions in Release builds (No_Exception)
if (NOT DEFINED BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}")
endif()
# option to enable or disable use of precompiled headers
if (NOT DEFINED BUILD_USE_PCH)
set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}")

1
adm/.gitignore vendored
View File

@@ -1 +0,0 @@
/build-*

View File

@@ -1,7 +1,7 @@
FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost TKVulkan
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF
Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE

View File

@@ -206,7 +206,6 @@ n Image
n MeshVS
n OpenGl
n D3DHost
n Vulkan
n Prs3d
n PrsMgr
n Select3D
@@ -224,7 +223,6 @@ r Shaders
t TKMeshVS
t TKOpenGl
t TKD3DHost
t TKVulkan
t TKService
t TKV3d
n BinTObjDrivers

View File

@@ -58,9 +58,6 @@ if (USE_TCL)
endif()
endif()
# Vulkan
set (CSF_vulkan "vulkan-1")
if (WIN32)
set (CSF_advapi32 "advapi32.lib")
set (CSF_gdi32 "gdi32.lib")

View File

@@ -143,7 +143,5 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR MINGW)
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
endif()
if (BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
endif()
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")

View File

@@ -28,11 +28,6 @@ Applies only for Debug configuration.")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
"Append the postfix to names of output libraries")
set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR
"Disables exceptions like Standard_OutOfRange in Release builds.
Defines No_Exception macros for Release builds when enabled (default).
These exceptions are always enabled in Debug builds, but disable in Release for better performance")
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
"Enable/Disable the floating point exceptions (FPE) during DRAW execution only.
Corresponding environment variable (CSF_FPE) can be changed manually

View File

@@ -30,30 +30,10 @@ set aRowIter 0
set aCheckRowIter 0
frame .myFrame -padx 5 -pady 5
pack .myFrame -fill both -expand 1
frame .myFrame.myPrjFrame
frame .myFrame.myVsFrame
frame .myFrame.myHxxChecks
frame .myFrame.myChecks
# project file format
set SYS_PRJFMT_LIST {}
set SYS_PRJNAME_LIST {}
if { "$::tcl_platform(platform)" == "windows" } {
lappend ::SYS_PRJFMT_LIST "vcxproj"
lappend ::SYS_PRJNAME_LIST "Visual Studio (.vcxproj)"
}
if { "$tcl_platform(os)" == "Darwin" } {
lappend ::SYS_PRJFMT_LIST "xcd"
lappend ::SYS_PRJNAME_LIST "XCode (.xcd)"
}
lappend ::SYS_PRJFMT_LIST "cbp"
lappend ::SYS_PRJNAME_LIST "Code Blocks (.cbp)"
lappend ::SYS_PRJFMT_LIST "pro"
lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
set SYS_VS_LIST {}
set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
@@ -121,7 +101,6 @@ proc wokdep:gui:Close {} {
}
proc wokdep:gui:SwitchConfig {} {
set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
@@ -411,8 +390,6 @@ proc wokdep:gui:Show64Bitness { theRowIter } {
}
# Header
ttk::label .myFrame.myPrjFrame.myPrjLbl -text "Project format:" -padding {5 5 20 5}
ttk::combobox .myFrame.myPrjFrame.myPrjCombo -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
ttk::label .myFrame.myVsFrame.myVsLbl -text "Visual Studio configuration:" -padding {5 5 20 5}
ttk::combobox .myFrame.myVsFrame.myVsCombo -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
ttk::combobox .myFrame.myVsFrame.myArchCombo -values { {32} {64} } -textvariable ARCH -state readonly -width 6
@@ -517,10 +494,6 @@ ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
# Create grid
# Header
grid .myFrame.myPrjFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myPrjFrame.myPrjLbl -row 0 -column 0
grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
incr aRowIter
if { "$tcl_platform(platform)" == "windows" } {
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
@@ -619,9 +592,6 @@ grid .myFrame.mySave -row $aRowIter -column 4 -columnspan 2
grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
# Bind events
bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}
bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}

View File

@@ -27,10 +27,8 @@ if { "$tcl_platform(platform)" == "unix" } {
set SYS_EXE_SUFFIX ""
if { "$tcl_platform(os)" == "Darwin" } {
set SYS_LIB_SUFFIX "dylib"
set PRJFMT "xcd"
} else {
set SYS_LIB_SUFFIX "so"
set PRJFMT "cbp"
}
set VCVER "gcc"
set VCVARS ""
@@ -41,7 +39,6 @@ if { "$tcl_platform(platform)" == "unix" } {
set SYS_EXE_SUFFIX ".exe"
set VCVER "vc10"
set VCVARS ""
set PRJFMT "vcxproj"
}
set SHORTCUT_HEADERS "ShortCut"
@@ -85,7 +82,7 @@ if { "$tcl_platform(platform)" != "windows" } {
set HAVE_D3D ""
set HAVE_RelWithDebInfo ""
}
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT PRODUCTS_PATH} {
foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
if { [info exists ::env(${anEnvIter})] } {
set ${anEnvIter} "$::env(${anEnvIter})"
}
@@ -1121,33 +1118,15 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
return "$isFound"
}
# Returns OCCT version string from file Standard_Version.hxx (if available)
proc wokdep:DetectCasVersion {} {
set occt_ver 7.0.0
set aCasRoot [file normalize [file dirname [info script]]]
set filename "${aCasRoot}/src/Standard/Standard_Version.hxx"
if { [file exists $filename] } {
set fh [open $filename "r"]
set fh_loaded [read $fh]
close $fh
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
} else {
puts "Error: file '$filename' not found"
}
return $occt_ver
}
# Generate (override) custom environment file
proc wokdep:SaveCustom {} {
set aGenInfo "This environment file was generated by genconf.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
if { "$::tcl_platform(platform)" == "windows" } {
set aCustomFilePath "./custom.bat"
set aFile [open $aCustomFilePath "w"]
puts $aFile "@echo off"
puts $aFile "rem $aGenInfo"
puts $aFile "rem This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
puts $aFile ""
puts $aFile "set PRJFMT=$::PRJFMT"
puts $aFile "set VCVER=$::VCVER"
puts $aFile "set ARCH=$::ARCH"
puts $aFile "set VCVARS=$::VCVARS"
@@ -1196,10 +1175,9 @@ proc wokdep:SaveCustom {} {
set aCustomFilePath "./custom.sh"
set aFile [open $aCustomFilePath "w"]
puts $aFile "#!/bin/bash"
puts $aFile "# $aGenInfo"
puts $aFile "# This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
puts $aFile ""
puts $aFile "export PRJFMT=$::PRJFMT"
puts $aFile "export ARCH=$::ARCH"
puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
@@ -1233,52 +1211,6 @@ proc wokdep:SaveCustom {} {
close $aFile
}
puts "Configuration saved to file '$aCustomFilePath'"
if { "$::PRJFMT" == "pro" } {
set aCasVer [wokdep:DetectCasVersion]
set aCustomFilePath "./adm/qmake/custom.auto.pri"
set aFile [open $aCustomFilePath "w"]
puts $aFile "# $aGenInfo"
puts $aFile ""
puts $aFile "VERSION=$aCasVer"
puts $aFile "PRODUCTS_PATH=\"$::PRODUCTS_PATH\""
puts $aFile ""
puts $aFile "# Optional 3rd-parties switches"
foreach anEnvIter $::THE_ENV_VARIABLES {
set aName ${anEnvIter}
set aValue [set ::${anEnvIter}]
if { "$aValue" == "true" } {
puts $aFile "CONFIG += ${aName}"
} else {
#puts $aFile "CONFIG -= ${aName}"
}
}
puts $aFile ""
puts $aFile "# Additional headers search paths"
foreach anIncPath $::CSF_OPT_INC {
puts $aFile "INCLUDEPATH += \"${anIncPath}\""
}
puts $aFile ""
puts $aFile "# Additional libraries search paths"
foreach aLibPath [set ::CSF_OPT_LIB$::ARCH] {
puts $aFile "LIBS += -L\"${aLibPath}\""
}
if { "$::tcl_platform(platform)" == "windows" } {
puts $aFile ""
puts $aFile "# Additional DLLs search paths"
foreach aDllPath [set ::CSF_OPT_BIN$::ARCH] {
puts $aFile "LIBS += -L\"${aDllPath}\""
}
}
puts $aFile ""
close $aFile
puts "Configuration saved to file '$aCustomFilePath'"
}
}

View File

@@ -256,7 +256,7 @@ proc genAllResources {} {
# Wrapper-function to generate VS project files
proc genproj {theFormat args} {
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd" "pro"}
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
@@ -314,7 +314,6 @@ proc genproj {theFormat args} {
vc141 - Visual Studio 2017
cbp - CodeBlocks
xcd - XCode
pro - Qt Creator
Platform (optional):
wnt - Windows Desktop
@@ -396,14 +395,9 @@ proc genprojbat {theFormat thePlatform} {
"cbp" {
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.sh" "$::path/codeblocks.sh"
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.bat" "$::path/codeblocks.bat"
# Code::Blocks 16.01 does not create directory for import libs, help him
set aPlatformAndCompiler "${thePlatform}/gcc"
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
set aPlatformAndCompiler "${thePlatform}/clang"
}
file mkdir "$::path/${aPlatformAndCompiler}/lib"
file mkdir "$::path/${aPlatformAndCompiler}/libd"
file mkdir "$::path/$thePlatform/cbp/lib"
file mkdir "$::path/$thePlatform/cbp/libd"
}
"xcd" { file copy -force -- "$::THE_CASROOT/adm/templates/xcode.sh" "$::path/xcode.sh" }
}
@@ -478,6 +472,15 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
}
}
# generate one solution for all projects if complete OS or VAS is processed
set anAllSolution "OCCT"
wokUtils:FILES:mkdir $anOutDir
if { ![file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
return
}
# create the out dir if it does not exist
if (![file isdirectory $path/inc]) {
puts "$path/inc folder does not exists and will be created"
@@ -488,19 +491,6 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
puts "Collecting required header files into $path/inc ..."
osutils:collectinc $aModules $path/inc
if { "$theFormat" == "pro" } {
return
}
# generate one solution for all projects if complete OS or VAS is processed
set anAllSolution "OCCT"
wokUtils:FILES:mkdir $anOutDir
if { ![file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
return
}
# Generating project files for the selected format
switch -exact -- "$theFormat" {
"vc7" -
@@ -1349,8 +1339,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_LIBLZMA) "liblzma"
}
set aLibsMap(CSF_vulkan) "vulkan-1"
if { "$theOS" == "wnt" } {
# WinAPI libraries
set aLibsMap(CSF_kernel32) "kernel32"
@@ -2307,10 +2295,6 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
set aCmplFlagsDebug [list]
set toPassArgsByFile 0
set aLibPrefix "lib"
set aPlatformAndCompiler "${thePlatform}/gcc"
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
set aPlatformAndCompiler "${thePlatform}/clang"
}
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" || "$thePlatform" == "qnx" } {
set toPassArgsByFile 1
}
@@ -2367,17 +2351,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
# Release target configuration
puts $aFile "\t\t\t<Target title=\"Release\">"
if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else {
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bin/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${aPlatformAndCompiler}/lib/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bin/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${thePlatform}/cbp/lib/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else {
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
}
puts $aFile "\t\t\t\t<Option type=\"3\" />"
}
puts $aFile "\t\t\t\t<Option object_output=\"../../../${aPlatformAndCompiler}/obj\" />"
puts $aFile "\t\t\t\t<Option object_output=\"../../../${thePlatform}/cbp/obj\" />"
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
@@ -2400,7 +2384,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
if { $toPassArgsByFile == 1 } {
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkFileName\" />"
}
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aPlatformAndCompiler}/lib\" />"
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${thePlatform}/cbp/lib\" />"
if { "$thePlatform" == "mac" } {
if { [ lsearch $theLibsList X11 ] >= 0} {
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
@@ -2408,7 +2392,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
}
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch})\" />"
if { "$thePlatform" == "lin" } {
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${aPlatformAndCompiler}/lib\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${thePlatform}/cbp/lib\" />"
}
puts $aFile "\t\t\t\t</Linker>"
@@ -2417,17 +2401,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
# Debug target configuration
puts $aFile "\t\t\t<Target title=\"Debug\">"
if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else {
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bind/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${aPlatformAndCompiler}/libd/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bind/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${thePlatform}/cbp/libd/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else {
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
}
puts $aFile "\t\t\t\t<Option type=\"3\" />"
}
puts $aFile "\t\t\t\t<Option object_output=\"../../../${aPlatformAndCompiler}/objd\" />"
puts $aFile "\t\t\t\t<Option object_output=\"../../../${thePlatform}/cbp/objd\" />"
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
@@ -2450,7 +2434,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
if { $toPassArgsByFile == 1 } {
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkDebFileName\" />"
}
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aPlatformAndCompiler}/libd\" />"
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${thePlatform}/cbp/libd\" />"
if { "$thePlatform" == "mac" } {
if { [ lsearch $theLibsList X11 ] >= 0} {
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
@@ -2458,7 +2442,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
}
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch}D)\" />"
if { "$thePlatform" == "lin" } {
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${aPlatformAndCompiler}/libd\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${thePlatform}/cbp/libd\" />"
}
puts $aFile "\t\t\t\t</Linker>"
@@ -2525,8 +2509,8 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
puts $aFile "\t\t\t<Option link=\"0\" />"
puts $aFile "\t\t</Unit>"
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/${aPlatformAndCompiler}/obj/src/"] $aSrcFile]]
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/${aPlatformAndCompiler}/objd/src/"] $aSrcFile]]
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/obj/src/"] $aSrcFile]]
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/objd/src/"] $aSrcFile]]
puts -nonewline $aFileLnkObj "$aFileObj "
puts -nonewline $aFileLnkObjd "$aFileObjd "
} else {

View File

@@ -1,5 +0,0 @@
/*/*.pro
/*/*/*.pro
*.pro.user
custom.pri
custom.auto.pri

View File

@@ -1,134 +0,0 @@
# This is project defines C++ compilation rules for building an OCCT Toolkit.
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
# Disable some dummy Qt defaults
QT -= core gui
CONFIG -= qt app_bundle
CONFIG -= qml_debug
CONFIG -= debug_and_release
OccGitRoot = $$_PRO_FILE_PWD_/../../../..
# Define compilation flags
!win32 { DEFINES += OCC_CONVERT_SIGNALS }
android {
CONFIG += warn_off
QMAKE_CFLAGS += -fexceptions -Wno-ignored-qualifiers -Wall
QMAKE_CXXFLAGS += -fexceptions -Wno-ignored-qualifiers -Wall
#android-g++ { QMAKE_CXXFLAGS += -Wno-strict-overflow }
} else:win32 {
QMAKE_CXXFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_EXCEPTIONS_ON = /EHa
QMAKE_CXXFLAGS_STL_ON = /EHa
QMAKE_CXXFLAGS += -fp:precise
#QMAKE_CXXFLAGS -= -Zc:throwingNew
#QMAKE_CXXFLAGS -= -Zc:rvalueCast
QMAKE_LFLAGS += -INCREMENTAL:NO
CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS += -Od
QMAKE_CXXFLAGS += -Ob1
}
DEFINES -= WIN32
DEFINES -= WIN64
DEFINES += _CRT_SECURE_NO_WARNINGS
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
DEFINES += _SCL_SECURE_NO_WARNINGS
} else:mac {
CONFIG += c++11
CONFIG += warn_off
QMAKE_CXXFLAGS += -Wall
QMAKE_CXXFLAGS += -fvisibility=default
iphoneos {
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
} else {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
}
}
# Define output folder depending on compiler name
MY_BITNESS = 32
equals(QMAKE_TARGET.arch, x86_64) | equals(QMAKE_HOST.arch, x86_64) { MY_BITNESS = 64 }
equals(ANDROID_TARGET_ARCH, arm64-v8a) { MY_BITNESS = 64 }
MY_PLATFORM = platform
CONFIG(iphonesimulator, iphoneos|iphonesimulator) { MY_PLATFORM = iphonesimulator
} else:CONFIG(iphoneos, iphoneos|iphonesimulator) { MY_PLATFORM = iphoneos
} else:android { MY_PLATFORM = android-$$ANDROID_TARGET_ARCH
} else:win32 { MY_PLATFORM = win$$MY_BITNESS
} else:mac { MY_PLATFORM = mac
} else:linux { MY_PLATFORM = lin
} else:unix { MY_PLATFORM = unix
} else { warning (Unknown platform. "$$MY_PLATFORM" is used) }
MY_COMPILER = compiler
MY_VC_VER = 0
android-g++ {
MY_COMPILER = gcc
} else:clang {
MY_COMPILER = clang
} else:gcc {
MY_COMPILER = gcc
} else:win32-msvc2010 {
MY_COMPILER = vc10
MY_VC_VER = 10
} else:win32-msvc2012 {
MY_COMPILER = vc11
MY_VC_VER = 11
} else:win32-msvc2013 {
MY_COMPILER = vc12
MY_VC_VER = 12
} else:win32-msvc2015 {
MY_COMPILER = vc14
MY_VC_VER = 14
} else:win32-msvc2017 {
MY_COMPILER = vc14
MY_VC_VER = 14
} else {
warning (Unknown compiler. "$$MY_COMPILER" is used)
}
MY_PLATFORM_AND_COMPILER = $$MY_PLATFORM/$$MY_COMPILER
#message (The platform is "$$MY_PLATFORM"; bitness is "$$MY_BITNESS"; compiler is "$$MY_COMPILER")
CONFIG(debug, debug|release) { MY_BUILDTYPE = d }
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/lib$${MY_BUILDTYPE}
win32 {
DESTDIR = $$OccGitRoot/win$${MY_BITNESS}/vc$${MY_VC_VER}/bin$${MY_BUILDTYPE}
aLibDest = $$DESTDIR/../lib$${MY_BUILDTYPE}
#DLLDESTDIR = $$DESTDIR/../bin$${MY_BUILDTYPE}
# dummy target creating lib/libd folder
occtkgen_libfolder.input = $$_PRO_FILE_PWD_/../../OcctDummy.in
occtkgen_libfolder.output = $$aLibDest/dummy.tmp
occtkgen_libfolder.config = verbatim
QMAKE_SUBSTITUTES += occtkgen_libfolder
LIBS += -L$$aLibDest
HAVE_RelWithDebInfo {
!CONFIG(debug, debug|release) { CONFIG += force_debug_info }
}
equals(TEMPLATE, lib) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.dll
QMAKE_CLEAN += $$aLibDest/$${TARGET}.lib
QMAKE_CLEAN += $$aLibDest/$${TARGET}.exp
} else {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.exe
}
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.pdb
QMAKE_LFLAGS += -PDB:"$$DESTDIR/$${TARGET}.pdb"
QMAKE_LFLAGS += -IMPLIB:"$$aLibDest/$${TARGET}.lib"
} else {
LIBS += -L$$DESTDIR
equals(TEMPLATE, app) {
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/bin$${MY_BUILDTYPE}
}
}
#OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}

View File

@@ -1,36 +0,0 @@
# This is a project template file defining an OCCT Module.
# This project should be included with predefined OCC_MODULE_NAME variable.
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
# Iterate over Toolkits within current Module and generate sub-project per Toolkit
aModuleList = $$cat(../MODULES, lines)
for (aModuleIter, aModuleList) {
#aTkList = $$list($$aModuleIter) - this doesn't work, qmake bug?
aModule = $$first($$list($$aModuleIter))
equals (aModule, $$OCC_MODULE_NAME) {
for (aToolKit, $$list($$aModuleIter)) {
toSkipToolkit = 0
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
equals (toSkipToolkit, 0) {
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)
eval(occtkgen_$${aToolKit}.config = verbatim)
eval(QMAKE_SUBSTITUTES += occtkgen_$${aToolKit})
SUBDIRS += $${aToolKit}
aModExtList = $$cat(../../src/$${aToolKit}/EXTERNLIB, lines)
aTkDepends = $${aToolKit}.depends
for (aModExtIter, aModExtList) {
contains ($$list($$aModuleIter), $$aModExtIter) { eval ($${aTkDepends} += $$aModExtIter) }
}
#warning($$aToolKit depends on: $$reverse($${aTkDepends}))
}
}
}
}

View File

@@ -1,2 +0,0 @@
OCC_MODULE_NAME = \$\$TARGET
include(../OccModule.pri)

View File

@@ -1,137 +0,0 @@
# This is a project template file defining an OCCT Toolkit.
# This project should be included with predefined OCC_TOOLKIT_NAME variable.
TEMPLATE = lib
!exists(../../src/$$OCC_TOOLKIT_NAME/PACKAGES) {
TEMPLATE = app
CONFIG += console
}
win32 {
# do not append version to DLL name
CONFIG += skip_target_version_ext
}
include(OccCppConfig.pri)
aSrcRoot = $$OccGitRoot/src
aHxxRoot = $$OccGitRoot/inc
INCLUDEPATH += $$aHxxRoot
# CSF variables
CSF_FREETYPE = -lfreetype
CSF_TclLibs = -ltcl8.6
CSF_TclTkLibs = -ltk8.6
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
HAVE_ZLIB { CSF_ZLIB = -lzlib }
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
win32 {
CSF_kernel32 = -lkernel32
CSF_advapi32 = -ladvapi32
CSF_gdi32 = -lgdi32
CSF_user32 = -luser32 -lcomdlg32
CSF_shell32 = -lShell32
CSF_opengl32 = -lopengl32
CSF_wsock32 = -lwsock32
CSF_netapi32 = -lnetapi32
CSF_OpenGlLibs = -lopengl32
HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
CSF_psapi = -lPsapi
CSF_d3d9 = -ld3d9
CSF_TclLibs = -ltcl86
CSF_TclTkLibs = -ltk86
CSF_TBB =
} else:mac {
CSF_dl = -ldl
CSF_objc = -lobjc
CSF_Appkit = -framework AppKit
CSF_IOKit = -framework IOKit
CSF_OpenGlLibs = -framework OpenGL
CSF_TclLibs = -framework Tcl
CSF_TclTkLibs = -framework Tk
} else {
CSF_dl = -ldl
CSF_ThreadLibs = -lpthread -lrt
CSF_OpenGlLibs = -lGL
CSF_TclTkLibs = -lX11 -ltk8.6
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
CSF_MotifLibs = -lX11
HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
}
for (aCfgIter, CONFIG) {
aRes = $$find(aCfgIter, "^HAVE_")
count(aRes, 1) {
DEFINES += $$aCfgIter
}
}
# Define the list of standard OCCT file extensions
aHxxRegex = ^.*\.(hxx|h|lxx|gxx)$
aPxxRegex = ^.*\.(pxx)$
aCxxRegex = ^.*\.(cxx|c)$
mac { aCxxRegex = ^.*\.(cxx|c|m|mm)$ }
# Auxiliary function for probing file extension
defineTest (occCheckExtension) {
aProbe = $$find(1, "$$2")
count(aProbe, 1) { return(true) } else { return(false) }
}
# Auxiliary function for probing compilable files
defineTest (occIsCxxFile) { occCheckExtension ($$1, $$aCxxRegex) { return(true) } else { return(false) } }
# Auxiliary function for probing header files
defineTest (occIsHxxFile) { occCheckExtension ($$1, $$aHxxRegex) { return(true) } else { return(false) } }
aTkFiles = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/FILES, lines)
aTkFiles += CMakeLists.txt
aPackages = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/PACKAGES, lines)
anExternLibs = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/EXTERNLIB, lines)
for (aTkFileIter, aTkFiles) { OTHER_FILES += $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aTkFileIter }
for (anExternLib, anExternLibs) {
hasCsf = $$find(anExternLib, CSF_)
count(hasCsf, 1) {
aList = $$split($$anExternLib, "\n")
LIBS += $$aList
} else {
LIBS += -l$$anExternLib
}
}
# Iterate over Packages and add compilable files into this project
isEmpty (aPackages) { aPackages = $$OCC_TOOLKIT_NAME }
for (aPackage, aPackages) {
aPackageFolder = $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aPackage
aPackageFiles = $$cat($$aSrcRoot/$$aPackage/FILES, lines)
for (aFileIter, aPackageFiles) {
occIsCxxFile($$aFileIter) {
SOURCES += $$aSrcRoot/$$aPackage/$$aFileIter
}
}
}
# extend clean with versioned .so files
!win32 {
aVerList = $$split(VERSION, ".")
aVerMaj = $$member(aVerList, 0)
aVerMin = $$member(aVerList, 1)
aVerMic = $$member(aVerList, 2)
equals(TEMPLATE, app) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
} else {
mac {
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
} else {
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}.$${aVerMic}
}
}
}

View File

@@ -1,2 +0,0 @@
OCC_TOOLKIT_NAME = \$\$TARGET
include(../../OccToolkit.pri)

View File

@@ -1,41 +0,0 @@
# This is an experimental Solution project for building entire OCCT framework using qmake.
# It can be also used for just source code navigation in Qt Creator without actually building OCCT.
# Note, as this is an experimental project, compiler flags might differ from official builds - use it on your own risk!
# Building OCCT using CMake is a preferred solution.
#
# This project GENERATES sub-projects (OCCT modules) dynamically, so to start using it:
# - Launch genconf, select Project Format "Qt Project" and configure dependencies; this will also generate "custom.auto.pri".
# - Launch genproj to fill in "inc" folder with links to header files.
# - Open project in Qt Creator, and call "Run qmake".
# - Close the project in Qt Creator, open it again so that you should see the sub-modules in Project tree; call "Run qmake" again.
# - "Run qmake" and perform Build.
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
OTHER_FILES += OccModule.pro.in \
OcctHeaderLink.hxx.in \
OccToolkit.pro.in \
OccCppConfig.pri \
OccModule.pri \
OccToolkit.pri \
custom.pri.template
# Iterate over Modules and generate sub-projects
aSolModuleList = $$cat(../MODULES, lines)
for (aSolModuleIter, aSolModuleList) {
aSolModule = $$first($$list($$aSolModuleIter))
eval(occtkgen_$${aSolModule}.input = $$_PRO_FILE_PWD_/OccModule.pro.in)
eval(occtkgen_$${aSolModule}.output = $$_PRO_FILE_PWD_/$${aSolModule}/$${aSolModule}.pro)
eval(occtkgen_$${aSolModule}.config = verbatim)
eval(QMAKE_SUBSTITUTES += occtkgen_$${aSolModule})
SUBDIRS += $${aSolModule}
}
# These dependencies are manually defined
ModelingData.depends = FoundationClasses
ModelingAlgorithms.depends = FoundationClasses ModelingData
Visualization.depends = FoundationClasses ModelingData ModelingAlgorithms
ApplicationFramework.depends = FoundationClasses ModelingData ModelingAlgorithms Visualization
DataExchange.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework
Draw.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework DataExchange Visualization

View File

View File

@@ -1 +0,0 @@
#include \"../src/$${OCCT_PACKAGE}/$${OCCT_HEADER}\"

View File

@@ -1,17 +0,0 @@
PRODUCTS_PATH = c:/3rdparty/vc14
#CONFIG += HAVE_FREEIMAGE
#CONFIG += HAVE_FFMPEG
#CONFIG += HAVE_TBB
#CONFIG += HAVE_GLES2
#CONFIG += HAVE_D3D
#CONFIG += HAVE_VTK
aFreeType = $$PRODUCTS_PATH/freetype-2.5.5-vc14-64
aTclTk = $$PRODUCTS_PATH/tcltk-86-64
INCLUDEPATH += $$aFreeType/include
LIBS += -L$$aFreeType/lib
INCLUDEPATH += $$aTclTk/include
LIBS += -L$$aTclTk/lib

View File

@@ -29,7 +29,6 @@ set "CSF_OPT_LIB32="
set "CSF_OPT_LIB64="
set "CSF_OPT_BIN32="
set "CSF_OPT_BIN64="
set "CSF_DEFINES=%CSF_DEFINES_EXTRA%"
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"

View File

@@ -6,7 +6,7 @@ aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath
# Reset values
export CASROOT="__CASROOT__"
export CASDEB=""
export PRJFMT="";
export TARGET="";
export HAVE_TBB="false";
export HAVE_OPENCL="false";
export HAVE_FREEIMAGE="false";
@@ -40,9 +40,9 @@ do
elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
export CASDEB="i"
elif [ "$i" == "cbp" ]; then
export PRJFMT="cbp";
export TARGET="cbp";
elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
export PRJFMT="xcd";
export TARGET="xcd";
fi
done
shopt -u nocasematch
@@ -64,32 +64,28 @@ else
fi
export CASBIN=""
if [ "${PRJFMT}" == "xcd" ]; then
if [ "${TARGET}" == "cbp" ]; then
export CASBIN="${WOKSTATION}/cbp"
elif [ "${TARGET}" == "xcd" ]; then
export CASBIN="adm/mac/xcd/build"
else
if [ "$aSystem" == "Darwin" ]; then
export CASBIN="${WOKSTATION}/clang"
else
export CASBIN="${WOKSTATION}/gcc"
fi
fi
export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
if [ "${PRJFMT}" == "xcd" ]; then
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
else
if [ "${TARGET}" == "cbp" ]; then
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
elif [ "${TARGET}" == "xcd" ]; then
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
fi
export CSF_OPT_CMPL=""
@@ -178,7 +174,7 @@ export CSF_OCCTSamplesPath="${CSF_OCCTSamplesPath:-$CASROOT/samples}"
export CSF_OCCTDataPath="${CSF_OCCTDataPath:-$CASROOT/data}"
export CSF_OCCTTestsPath="${CSF_OCCTTestsPath:-$CASROOT/tests}"
if [ "${PRJFMT}" == "xcd" ]; then
if [ "${TARGET}" == "xcd" ]; then
if [ "${CASDEB}" == "d" ]; then
export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/Debug}"
else

View File

@@ -1716,30 +1716,9 @@ aGroup->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< next array
aGroup->AddPrimitiveArray (aLines);
~~~~
@subsection upgrade_740_prsupdate Presentation invalidation
Historically AIS_InteractiveObject provided two independent mechanisms invalidating presentation (asking presentation manager to recompute specific display mode or all modes):
1. *AIS_InteractiveObject::SetToUpdate()*, marking existing presentation for update.
This is main invalidation API, which is expected to be followed by *AIS_InteractiveContext::Update()* call.
2. *AIS_InteractiveObject::myToRecomputeModes* + *myRecomputeEveryPrs*.
This is auxiliary invalidation API, used internally by AIS_InteractiveContext::SetColor()/UnsetColor() and similar modification methods.
The latter one has been removed to avoid confusion and unexpected behavior.
In addition, two methods *AIS_InteractiveObject::Update()* have been deprecated in favor of new *AIS_InteractiveObject::UpdatePresentations()* recomputing only invalidated presentations.
Custom presentations implementing interface methods *AIS_InteractiveObject::SetColor()* and others should be revised to use *AIS_InteractiveObject::SetToUpdate()*
or updating presentation without recomputation (see *AIS_InteractiveObject::SynchronizeAspects()* and *AIS_InteractiveObject::replaceAspects()*).
@subsection upgrade_740_interiorstyles Interior styles
* *Aspect_IS_HOLLOW* is now an alias to *Aspect_IS_EMPTY* and does not implicitly enables drawing mesh edges anymore.
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_EMPTY) to get previous behavior of Aspect_IS_HOLLOW style.
* *Aspect_IS_HIDDENLINE* does not implicitly enables drawing mesh edges anymore.
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_HIDDENLINE) to get previous behavior of Aspect_IS_HIDDENLINE style.
@subsection upgrade_740_geproj Custom defines within env.bat
*env.bat* produced by Visual Studio project generator *genproj.bat* has been modified so that *%CSF_DEFINES%* variable is reset to initial state.
Custom building environment relying on old behavior and setting extra macros within *%CSF_DEFINES%* before env.bat should be updated
to either modify custom.bat or setup new variable *%CSF_DEFINES_EXTRA%* instead.

View File

@@ -23,7 +23,7 @@ WARNINGS = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = Standard_EXPORT Standard_NODISCARD Standard_OVERRIDE:=override __Standard_API __Draw_API Handle(a):=Handle<a> DEFINE_STANDARD_ALLOC DEFINE_NCOLLECTION_ALLOC "Standard_DEPRECATED=//! @deprecated "
PREDEFINED = Standard_EXPORT Standard_NODISCARD Standard_OVERRIDE:=override __Standard_API __Draw_API Handle(a):=Handle<a> DEFINE_STANDARD_ALLOC DEFINE_NCOLLECTION_ALLOC
GENERATE_HTML = YES
GENERATE_LATEX = NO
SEARCH_INCLUDES = YES

10
genproj
View File

@@ -19,6 +19,10 @@ anOpt2=$2
anOpt3=$3
anOpt4=$4
anOpt5=$5
if [ "$aTarget" == "" ]; then
aTarget="cbp"
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
fi
if [ ! -e "${aScriptPath}/custom.sh" ]; then
tclsh "${aScriptPath}/adm/genconf.tcl"
@@ -33,12 +37,6 @@ source "${aScriptPath}/custom.sh"
if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
if [ "$aTarget" == "" ]; then aTarget=$PRJFMT; fi;
if [ "$aTarget" == "" ]; then
aTarget="cbp"
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
fi
cd $aScriptPath
tclsh "./adm/start.tcl" genproj ${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5

View File

@@ -49,10 +49,6 @@ if "%aPlatform%" == "" (
)
)
set aPrjFmt=%PRJFMT%
if "%aPrjFmt%" == "" ( set "aPrjFmt=vcxproj" )
if "%aPrjFmt%" == "vcxproj" ( set "aPrjFmt=%VCFMT%" )
cd %~dp0
%TCL_EXEC% %~dp0adm/start.tcl genproj %aPrjFmt% %aPlatform% %3 %4 %5
%TCL_EXEC% %~dp0adm/start.tcl genproj %VCFMT% %aPlatform% %3 %4 %5
SET "PATH=%OLD_PATH%"

View File

@@ -17,8 +17,7 @@ void ISession2D_Shape::Add(const TopoDS_Shape& aShape)
myListOfShape.Append(aShape);
myAlgo.Nullify();
myPolyAlgo.Nullify();
SetToUpdate();
UpdatePresentations();
Update(); // protected method used to specify that the presentation are not up to date
}
void ISession2D_Shape::Remove (const TopoDS_Shape& theShape)
@@ -43,17 +42,23 @@ void ISession2D_Shape::SetProjector (HLRAlgo_Projector& aProjector)
myProjector= aProjector;
myAlgo.Nullify();
myPolyAlgo.Nullify();
SetToUpdate();
UpdatePresentations();
Update(); // protected method used to specify that the presentation are not up to date
};
void ISession2D_Shape::SetNbIsos(Standard_Integer& aNbIsos)
{
myNbIsos= aNbIsos;
myAlgo.Nullify();
SetToUpdate();
UpdatePresentations();
{
myNbIsos= aNbIsos;
myAlgo.Nullify();
// declare the mode 100 to 110 as non valid
for (int i=100;i<=110;i++)
Update(i,Standard_False); // protected method used to specify that the presentation are not up to date
// declare the mode 1100 to 1110 as non valid
for (int i=1100;i<=1110;i++)
Update(i,Standard_False); // protected method used to specify that the presentation are not up to date
};
void ISession2D_Shape::BuildAlgo()

View File

@@ -51,7 +51,7 @@ proc drawObjects {theRow theColor} {
uplevel #0 box $aBox $aCtr $aCtr $aCtr $aSize $aSize $aSize
uplevel #0 ttranslate $aSph $x $y 0
uplevel #0 ttranslate $aBox [expr $x + 10] $y 0
uplevel #0 vdisplay -noredraw -dispMode 1 $aSph $aBox
uplevel #0 vdisplay -noredraw $aSph $aBox
uplevel #0 vsetmaterial -noredraw $aSph $aBox $aMatIter
if {$theColor != ""} {
uplevel #0 vsetcolor -noredraw $aSph $aBox $theColor
@@ -64,19 +64,21 @@ proc drawObjects {theRow theColor} {
# setup 3D viewer content
pload MODELING VISUALIZATION
vclear
vclose ALL
catch { vclose View1 }
vinit View1 w=768 h=768
vclear
vtop
vglinfo
vsetgradientbg 180 200 255 180 180 180 2
vlight -change 0 -dir 0.577 -0.577 -0.577
vsetdispmode 1
vrenderparams -msaa 8
# adjust scene bounding box
box bnd 0 0 0 180 210 1
vdisplay -noredraw -dispMode 0 bnd
vdisplay -noredraw bnd
vsetdispmode bnd 0
vfit
vremove -noredraw bnd
@@ -86,3 +88,5 @@ drawObjects 0 ""
drawObjects 1 red
drawObjects 2 green
drawObjects 3 blue1
#vfit
vzfit

View File

@@ -81,7 +81,7 @@ myIsXYZAxis(Standard_True)
Standard_Real aLength;
try {
aLength = UnitsAPI::AnyToLS(100. ,"mm");
} catch (Standard_Failure const&) {
} catch (Standard_Failure) {
aLength = 0.1;
}
DA->SetAxisLength(aLength,aLength,aLength);
@@ -221,7 +221,7 @@ void AIS_Axis::SetColor(const Quantity_Color &aCol)
DA->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
DA->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
DA->LineAspect(Prs3d_DP_ZAxis)->SetColor(aCol);
SynchronizeAspects();
}
//=======================================================================
@@ -230,6 +230,7 @@ void AIS_Axis::SetColor(const Quantity_Color &aCol)
//=======================================================================
void AIS_Axis::SetWidth(const Standard_Real aValue)
{
if(aValue<0.0) return;
if(aValue==0) UnsetWidth();
@@ -239,7 +240,6 @@ void AIS_Axis::SetWidth(const Standard_Real aValue)
DA->LineAspect(Prs3d_DP_XAxis)->SetWidth(aValue);
DA->LineAspect(Prs3d_DP_YAxis)->SetWidth(aValue);
DA->LineAspect(Prs3d_DP_ZAxis)->SetWidth(aValue);
SynchronizeAspects();
}
@@ -324,13 +324,14 @@ AcceptDisplayMode(const Standard_Integer aMode) const
//=======================================================================
void AIS_Axis::UnsetColor()
{
myDrawer->LineAspect()->SetColor(Quantity_NOC_RED);
hasOwnColor = Standard_False;
hasOwnColor=Standard_False;
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(Quantity_NOC_TURQUOISE);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(Quantity_NOC_TURQUOISE);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetColor(Quantity_NOC_TURQUOISE);
SynchronizeAspects();
}
//=======================================================================
//function : UnsetWidth
@@ -339,10 +340,10 @@ void AIS_Axis::UnsetColor()
void AIS_Axis::UnsetWidth()
{
myOwnWidth = 0.0f;
myOwnWidth = 0.0;
myDrawer->LineAspect()->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetWidth(1.);
SynchronizeAspects();
}

View File

@@ -90,7 +90,6 @@ void AIS_CameraFrustum::SetColor (const Quantity_Color& theColor)
AIS_InteractiveObject::SetColor (theColor);
myDrawer->ShadingAspect()->SetColor (theColor);
myDrawer->LineAspect()->SetColor (theColor);
SynchronizeAspects();
}
//=======================================================================
@@ -108,7 +107,6 @@ void AIS_CameraFrustum::UnsetColor()
myDrawer->ShadingAspect()->SetColor (THE_DEFAULT_COLOR);
myDrawer->LineAspect()->SetColor (THE_DEFAULT_COLOR);
SynchronizeAspects();
}
//=======================================================================
@@ -119,7 +117,6 @@ void AIS_CameraFrustum::UnsetTransparency()
{
myDrawer->ShadingAspect()->SetTransparency (0.0f);
myDrawer->SetTransparency (0.0f);
SynchronizeAspects();
}
//=======================================================================

View File

@@ -112,29 +112,6 @@ void AIS_Circle::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
}
//=======================================================================
//function : replaceWithNewLineAspect
//purpose :
//=======================================================================
void AIS_Circle::replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
if (!myDrawer->HasLink())
{
myDrawer->SetLineAspect (theAspect);
return;
}
const Handle(Graphic3d_AspectLine3d) anAspectOld = myDrawer->LineAspect()->Aspect();
const Handle(Graphic3d_AspectLine3d) anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->LineAspect()->Aspect();
if (anAspectNew != anAspectOld)
{
myDrawer->SetLineAspect (theAspect);
Graphic3d_MapOfAspectsToAspects aReplaceMap;
aReplaceMap.Bind (anAspectOld, anAspectNew);
replaceAspects (aReplaceMap);
}
}
//=======================================================================
//function : SetColor
//purpose :
@@ -145,41 +122,34 @@ void AIS_Circle::SetColor(const Quantity_Color &aCol)
hasOwnColor=Standard_True;
myDrawer->SetColor (aCol);
if (!myDrawer->HasOwnLineAspect())
{
Standard_Real WW = HasWidth() ? myOwnWidth :
myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
1.;
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
}
Standard_Real WW = HasWidth() ? myOwnWidth :
myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
1.;
if (!myDrawer->HasOwnLineAspect ())
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
else
{
myDrawer->LineAspect()->SetColor(aCol);
SynchronizeAspects();
}
}
//=======================================================================
//function : SetWidth
//purpose :
//=======================================================================
void AIS_Circle::SetWidth(const Standard_Real aValue)
{
myOwnWidth = (Standard_ShortReal )aValue;
myOwnWidth=aValue;
if (!myDrawer->HasOwnLineAspect())
{
if (!myDrawer->HasOwnLineAspect ()) {
Quantity_Color CC = Quantity_NOC_YELLOW;
if( HasColor() ) CC = myDrawer->Color();
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
}
else
{
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
} else
myDrawer->LineAspect()->SetWidth(aValue);
SynchronizeAspects();
}
}
@@ -191,18 +161,15 @@ void AIS_Circle::UnsetColor()
{
hasOwnColor = Standard_False;
if (!HasWidth())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Handle(Prs3d_LineAspect) NullAsp;
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
else{
Quantity_Color CC = Quantity_NOC_YELLOW;;
if( HasColor() ) CC = myDrawer->Color();
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
myDrawer->LineAspect()->SetColor(CC);
myDrawer->SetColor (CC);
SynchronizeAspects();
}
}
@@ -212,13 +179,11 @@ void AIS_Circle::UnsetColor()
//=======================================================================
void AIS_Circle::UnsetWidth()
{
if (!HasColor())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.0f;
Handle(Prs3d_LineAspect) NullAsp;
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
else{
Standard_Real WW = myDrawer->HasLink() ? AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
myDrawer->LineAspect()->SetWidth(WW);
myOwnWidth = WW;
}

View File

@@ -115,9 +115,6 @@ private:
Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
//! Replace aspects of already computed groups with the new value.
void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
private:
Handle(Geom_Circle) myComponent;

View File

@@ -124,7 +124,8 @@ Handle(AIS_ColoredDrawer) AIS_ColoredShape::CustomAspects (const TopoDS_Shape& t
{
aDrawer = new AIS_ColoredDrawer (myDrawer);
myShapeColors.Bind (theShape, aDrawer);
SetToUpdate();
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
return aDrawer;
}
@@ -140,7 +141,8 @@ void AIS_ColoredShape::ClearCustomAspects()
return;
}
myShapeColors.Clear();
SetToUpdate();
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================
@@ -155,7 +157,8 @@ void AIS_ColoredShape::UnsetCustomAspects (const TopoDS_Shape& theShape,
return;
}
SetToUpdate();
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
if (theToUnregister)
{
myShapeColors.UnBind (theShape);
@@ -180,6 +183,8 @@ void AIS_ColoredShape::SetCustomColor (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setColor (aDrawer, theColor);
aDrawer->SetOwnColor (theColor);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================
@@ -197,6 +202,8 @@ void AIS_ColoredShape::SetCustomTransparency (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setTransparency (aDrawer, theTransparency);
aDrawer->SetOwnTransparency (theTransparency);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================
@@ -214,6 +221,8 @@ void AIS_ColoredShape::SetCustomWidth (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setWidth (aDrawer, theLineWidth);
aDrawer->SetOwnWidth (theLineWidth);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================

View File

@@ -352,7 +352,7 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt
Handle(Font_FTFont) aFont = new Font_FTFont();
aFont->Init (aTextAspect->Aspect()->Font().ToCString(),
aTextAspect->Aspect()->GetTextFontAspect(),
(unsigned int )aTextAspect->Height(),
(const unsigned int)aTextAspect->Height(),
THE_2D_TEXT_RESOLUTION);
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )

View File

@@ -952,8 +952,7 @@ void AIS_InteractiveContext::RecomputePrsOnly (const Handle(AIS_InteractiveObjec
return;
}
theIObj->SetToUpdate();
theIObj->UpdatePresentations (theAllModes);
theIObj->Update (theAllModes);
if (!theToUpdateViewer)
{
return;
@@ -1007,7 +1006,13 @@ void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIOb
return;
}
theIObj->UpdatePresentations();
TColStd_ListOfInteger aPrsModes;
theIObj->ToBeUpdated (aPrsModes);
for (TColStd_ListIteratorOfListOfInteger aPrsModesIt (aPrsModes); aPrsModesIt.More(); aPrsModesIt.Next())
{
theIObj->Update (aPrsModesIt.Value(), Standard_False);
}
mgrSelector->Update(theIObj);
if (theUpdateViewer)
@@ -1364,6 +1369,63 @@ void AIS_InteractiveContext::SetCurrentFacingModel (const Handle(AIS_Interactive
}
}
//=======================================================================
//function : redisplayPrsRecModes
//purpose :
//=======================================================================
void AIS_InteractiveContext::redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer)
{
if (theIObj->RecomputeEveryPrs())
{
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
for (TColStd_ListIteratorOfListOfInteger aModes (theIObj->ListOfRecomputeModes()); aModes.More(); aModes.Next())
{
theIObj->Update (aModes.Value(), Standard_False);
}
theIObj->UpdateSelection();
theIObj->SetRecomputeOk();
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
//function : redisplayPrsModes
//purpose :
//=======================================================================
void AIS_InteractiveContext::redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer)
{
if (theIObj->RecomputeEveryPrs())
{
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
TColStd_ListOfInteger aModes;
theIObj->ToBeUpdated (aModes);
for (TColStd_ListIteratorOfListOfInteger aModeIter (aModes); aModeIter.More(); aModeIter.Next())
{
theIObj->Update (aModeIter.Value(), Standard_False);
}
theIObj->SetRecomputeOk();
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
//function : SetColor
//purpose :
@@ -1379,11 +1441,7 @@ void AIS_InteractiveContext::SetColor (const Handle(AIS_InteractiveObject)& theI
setContextToObject (theIObj);
theIObj->SetColor (theColor);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1428,11 +1486,7 @@ void AIS_InteractiveContext::SetDeviationCoefficient (const Handle(AIS_Interacti
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnDeviationCoefficient (theCoefficient);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1462,11 +1516,7 @@ void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Handle(AIS_Intera
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnHLRDeviationCoefficient (theCoefficient);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1495,11 +1545,7 @@ void AIS_InteractiveContext::SetDeviationAngle (const Handle(AIS_InteractiveObje
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnDeviationAngle (theAngle);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1528,10 +1574,15 @@ void AIS_InteractiveContext::SetAngleAndDeviation (const Handle(AIS_InteractiveO
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetAngleAndDeviation (theAngle);
aShape->UpdatePresentations();
if (theToUpdateViewer)
if (theIObj->RecomputeEveryPrs())
{
UpdateCurrentViewer();
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
Update (theIObj, theToUpdateViewer);
}
}
@@ -1560,11 +1611,7 @@ void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Handle(AIS_Interacti
}
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetHLRAngleAndDeviation (theAngle);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1592,11 +1639,7 @@ void AIS_InteractiveContext::SetHLRDeviationAngle (const Handle(AIS_InteractiveO
}
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnHLRDeviationAngle (theAngle);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1612,11 +1655,7 @@ void AIS_InteractiveContext::UnsetColor (const Handle(AIS_InteractiveObject)& th
}
theIObj->UnsetColor();
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1662,7 +1701,7 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
setContextToObject (theIObj);
theIObj->SetWidth (theWidth);
theIObj->UpdatePresentations();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
{
if (myLastinMain->IsAutoHilight())
@@ -1679,10 +1718,6 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
myLastinMain);
}
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1698,11 +1733,7 @@ void AIS_InteractiveContext::UnsetWidth (const Handle(AIS_InteractiveObject)& th
}
theIObj->UnsetWidth();
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1720,11 +1751,7 @@ void AIS_InteractiveContext::SetMaterial (const Handle(AIS_InteractiveObject)& t
setContextToObject (theIObj);
theIObj->SetMaterial (theMaterial);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1739,11 +1766,7 @@ void AIS_InteractiveContext::UnsetMaterial (const Handle(AIS_InteractiveObject)&
return;
}
theIObj->UnsetMaterial();
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1773,11 +1796,7 @@ void AIS_InteractiveContext::SetTransparency (const Handle(AIS_InteractiveObject
}
theIObj->SetTransparency (theValue);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
//=======================================================================
@@ -1793,11 +1812,7 @@ void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObje
}
theIObj->UnsetTransparency();
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
//=======================================================================

View File

@@ -1082,7 +1082,6 @@ public: //! @name iso-line display attributes
//! Returns true if drawing isolines on triangulation algorithm is enabled.
Standard_EXPORT Standard_Boolean IsoOnTriangulation() const;
//! @name obsolete methods
public:
//! Updates the view of the current object in open context.
@@ -1208,6 +1207,14 @@ protected: //! @name internal methods
Standard_EXPORT void InitAttributes();
Standard_EXPORT Standard_Integer PurgeViewer (const Handle(V3d_Viewer)& Vwr);
//! UNKNOWN
Standard_EXPORT void redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer);
//! UNKNOWN
Standard_EXPORT void redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer);
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
Standard_EXPORT void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);

View File

@@ -52,11 +52,12 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveObject,SelectMgr_SelectableObject)
AIS_InteractiveObject::AIS_InteractiveObject (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d)
: SelectMgr_SelectableObject (aTypeOfPresentation3d),
myCTXPtr (NULL),
myOwnWidth (0.0f),
myOwnWidth (0.0),
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
myInfiniteState (Standard_False),
hasOwnColor (Standard_False),
hasOwnMaterial (Standard_False)
hasOwnMaterial (Standard_False),
myRecomputeEveryPrs (Standard_True)
{
SetCurrentFacingModel();
}
@@ -89,6 +90,14 @@ AIS_KindOfInteractive AIS_InteractiveObject::Type() const
Standard_Integer AIS_InteractiveObject::Signature() const
{return -1;}
//=======================================================================
//function : RecomputeEveryPrs
//purpose :
//=======================================================================
Standard_Boolean AIS_InteractiveObject::RecomputeEveryPrs() const
{return myRecomputeEveryPrs;}
//=======================================================================
//function :
//purpose :
@@ -191,7 +200,7 @@ void AIS_InteractiveObject::UnsetColor()
//=======================================================================
void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
{
myOwnWidth = (Standard_ShortReal )aValue;
myOwnWidth = aValue;
}
//=======================================================================
@@ -200,7 +209,7 @@ void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
//=======================================================================
void AIS_InteractiveObject::UnsetWidth()
{
myOwnWidth = 0.0f;
myOwnWidth = 0.;
}
//=======================================================================
@@ -324,10 +333,32 @@ void AIS_InteractiveObject::UnsetAttributes()
hasOwnColor = Standard_False;
hasOwnMaterial = Standard_False;
myOwnWidth = 0.0f;
myOwnWidth = 0.0;
myDrawer->SetTransparency (0.0f);
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void AIS_InteractiveObject::MustRecomputePrs(const Standard_Integer ) const
{}
//=======================================================================
//function :
//purpose :
//=======================================================================
const TColStd_ListOfInteger& AIS_InteractiveObject::ListOfRecomputeModes() const
{return myToRecomputeModes;}
//=======================================================================
//function :
//purpose :
//=======================================================================
void AIS_InteractiveObject::SetRecomputeOk()
{myToRecomputeModes.Clear();}
//=======================================================================
//function : AcceptDisplayMode
//purpose :

View File

@@ -283,7 +283,7 @@ public:
virtual void Color (Quantity_Color& theColor) const { theColor = myDrawer->Color(); }
//! Returns true if the Interactive Object has width.
Standard_Boolean HasWidth() const { return myOwnWidth != 0.0f; }
Standard_Boolean HasWidth() const { return myOwnWidth != 0.0; }
//! Returns the width setting of the Interactive Object.
Standard_Real Width() const { return myOwnWidth; }
@@ -395,19 +395,36 @@ protected:
//! and then modify them directly followed by SynchronizeAspects() call.
Standard_EXPORT void replaceAspects (const Graphic3d_MapOfAspectsToAspects& theMap);
private:
Standard_EXPORT virtual Standard_Boolean RecomputeEveryPrs() const;
Standard_EXPORT void MustRecomputePrs (const Standard_Integer aMode) const;
Standard_EXPORT const TColStd_ListOfInteger& ListOfRecomputeModes() const;
Standard_EXPORT void SetRecomputeOk();
protected:
//! The TypeOfPresention3d means that the interactive object
//! may have a presentation dependant of the view of Display.
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
protected:
private:
AIS_InteractiveContext* myCTXPtr;
Handle(Standard_Transient) myOwner;
Standard_ShortReal myOwnWidth;
protected:
TColStd_ListOfInteger myToRecomputeModes;
Standard_Real myOwnWidth;
Aspect_TypeOfFacingModel myCurrentFacingModel;
Standard_Boolean myInfiniteState;
Standard_Boolean hasOwnColor;
Standard_Boolean hasOwnMaterial;
Standard_Boolean myRecomputeEveryPrs;
};

View File

@@ -41,6 +41,52 @@
IMPLEMENT_STANDARD_RTTIEXT(AIS_Line,AIS_InteractiveObject)
//==================================================================
// function: FindLimits
// purpose:
//==================================================================
//unused
/*#ifdef OCCT_DEBUG
static void FindLimits(const Adaptor3d_Curve& aCurve,
const Standard_Real aLimit,
gp_Pnt& P1,
gp_Pnt& P2)
{
Standard_Real First = aCurve.FirstParameter();
Standard_Real Last = aCurve.LastParameter();
Standard_Boolean firstInf = Precision::IsNegativeInfinite(First);
Standard_Boolean lastInf = Precision::IsPositiveInfinite(Last);
if (firstInf || lastInf) {
Standard_Real delta = 1;
if (firstInf && lastInf) {
do {
delta *= 2;
First = - delta;
Last = delta;
aCurve.D0(First,P1);
aCurve.D0(Last,P2);
} while (P1.Distance(P2) < aLimit);
}
else if (firstInf) {
aCurve.D0(Last,P2);
do {
delta *= 2;
First = Last - delta;
aCurve.D0(First,P1);
} while (P1.Distance(P2) < aLimit);
}
else if (lastInf) {
aCurve.D0(First,P1);
do {
delta *= 2;
Last = First + delta;
aCurve.D0(Last,P2);
} while (P1.Distance(P2) < aLimit);
}
}
}
#endif
*/
//=======================================================================
//function : AIS_Line
//purpose :
@@ -80,7 +126,8 @@ void AIS_Line::Compute(const Handle(PrsMgr_PresentationManager3d)&,
void AIS_Line::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
// throw Standard_NotImplemented("AIS_Line::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
}
//=======================================================================
@@ -105,29 +152,6 @@ void AIS_Line::ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
}
}
//=======================================================================
//function : replaceWithNewLineAspect
//purpose :
//=======================================================================
void AIS_Line::replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
if (!myDrawer->HasLink())
{
myDrawer->SetLineAspect (theAspect);
return;
}
const Handle(Graphic3d_Aspects)& anAspectOld = myDrawer->LineAspect()->Aspect();
const Handle(Graphic3d_Aspects)& anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->LineAspect()->Aspect();
if (anAspectNew != anAspectOld)
{
myDrawer->SetLineAspect (theAspect);
Graphic3d_MapOfAspectsToAspects aReplaceMap;
aReplaceMap.Bind (anAspectOld, anAspectNew);
replaceAspects (aReplaceMap);
}
}
//=======================================================================
//function : SetColor
//purpose :
@@ -141,15 +165,10 @@ void AIS_Line::SetColor(const Quantity_Color &aCol)
myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
if (!myDrawer->HasOwnLineAspect())
{
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
}
if (!myDrawer->HasOwnLineAspect ())
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
else
{
myDrawer->LineAspect()->SetColor (aCol);
SynchronizeAspects();
}
myDrawer->LineAspect()->SetColor(aCol);
}
@@ -161,19 +180,16 @@ void AIS_Line::UnsetColor()
{
hasOwnColor = Standard_False;
if (!HasWidth())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Handle(Prs3d_LineAspect) NullAsp;
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
else{
Quantity_Color CC = Quantity_NOC_YELLOW;
if( HasColor() ) CC = myDrawer->Color();
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
myDrawer->LineAspect()->SetColor(CC);
myDrawer->SetColor (CC);
SynchronizeAspects();
}
}
}
//=======================================================================
@@ -182,20 +198,15 @@ void AIS_Line::UnsetColor()
//=======================================================================
void AIS_Line::SetWidth(const Standard_Real aValue)
{
myOwnWidth = (Standard_ShortReal )aValue;
myOwnWidth=aValue;
if (!myDrawer->HasOwnLineAspect())
{
if (!myDrawer->HasOwnLineAspect ()) {
Quantity_Color CC = Quantity_NOC_YELLOW;
if( HasColor() ) CC = myDrawer->Color();
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
}
else
{
myDrawer->LineAspect()->SetWidth (aValue);
SynchronizeAspects();
}
myDrawer->SetLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
} else
myDrawer->LineAspect()->SetWidth(aValue);
}
@@ -205,16 +216,14 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
//=======================================================================
void AIS_Line::UnsetWidth()
{
if (!HasColor())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.0f;
myDrawer->LineAspect()->SetWidth (WW);
Handle(Prs3d_LineAspect) NullAsp;
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
else{
Standard_Real WW = myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
myDrawer->LineAspect()->SetWidth(WW);
myOwnWidth = WW;
SynchronizeAspects();
}
}

View File

@@ -107,9 +107,6 @@ private:
Standard_EXPORT void ComputeSegmentLineSelection (const Handle(SelectMgr_Selection)& aSelection);
//! Replace aspects of already computed groups with the new value.
void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
private:
Handle(Geom_Line) myComponent;

View File

@@ -297,7 +297,7 @@ void AIS_Manipulator::SetPart (const Standard_Integer theAxisIndex, const AIS_Ma
//=======================================================================
void AIS_Manipulator::SetPart (const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
for (Standard_Integer anIt = 0; anIt < 4; ++anIt)
{
SetPart (anIt, theMode, theIsEnabled);
}

View File

@@ -387,8 +387,7 @@ void AIS_Plane::SetSize(const Standard_Real aXLength,
myHasOwnSize = Standard_True;
SetToUpdate();
UpdatePresentations();
Update();
UpdateSelection();
}
@@ -419,8 +418,7 @@ void AIS_Plane::UnsetSize()
}
myHasOwnSize = Standard_False;
SetToUpdate();
UpdatePresentations();
Update();
UpdateSelection();
}

View File

@@ -248,7 +248,6 @@ void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
myDrawer->SetColor (aCol);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
SynchronizeAspects();
}

View File

@@ -89,7 +89,7 @@ public:
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
//! Allows you to provide settings for the color aColor.
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
void SetXLabel (const TCollection_AsciiString& theLabel) { myXLabel = theLabel; }

View File

@@ -205,29 +205,6 @@ void AIS_Point::UnsetMarker()
|| theMode == -99;
}
//=======================================================================
//function : replaceWithNewPointAspect
//purpose :
//=======================================================================
void AIS_Point::replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
{
if (!myDrawer->HasLink())
{
myDrawer->SetPointAspect (theAspect);
return;
}
const Handle(Graphic3d_AspectMarker3d) anAspectOld = myDrawer->PointAspect()->Aspect();
const Handle(Graphic3d_AspectMarker3d) anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->PointAspect()->Aspect();
if (anAspectNew != anAspectOld)
{
myDrawer->SetPointAspect (theAspect);
Graphic3d_MapOfAspectsToAspects aReplaceMap;
aReplaceMap.Bind (anAspectOld, anAspectNew);
replaceAspects (aReplaceMap);
}
}
//=======================================================================
//function : UpdatePointValues
//purpose :
@@ -235,14 +212,12 @@ void AIS_Point::replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theA
void AIS_Point::UpdatePointValues()
{
if (!hasOwnColor
&& myOwnWidth == 0.0f
&& !myHasTOM)
if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM)
{
replaceWithNewPointAspect (Handle(Prs3d_PointAspect)());
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
return;
}
Quantity_Color aCol (Quantity_NOC_YELLOW);
Aspect_TypeOfMarker aTOM = Aspect_TOM_PLUS;
Standard_Real aScale = 1.0;
@@ -254,20 +229,20 @@ void AIS_Point::UpdatePointValues()
}
if(hasOwnColor) aCol = myDrawer->Color();
if(myOwnWidth != 0.0f) aScale = myOwnWidth;
if(myOwnWidth!=0.0) aScale = myOwnWidth;
if(myHasTOM) aTOM = myTOM;
if(myDrawer->HasOwnPointAspect())
{
if(myDrawer->HasOwnPointAspect()){
// CLE
// const Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
// ENDCLE
PA->SetColor(aCol);
PA->SetTypeOfMarker(aTOM);
PA->SetScale(aScale);
SynchronizeAspects();
}
else
{
replaceWithNewPointAspect (new Prs3d_PointAspect (aTOM, aCol, aScale));
}
myDrawer->SetPointAspect(new Prs3d_PointAspect(aTOM,aCol,aScale));
}

View File

@@ -59,10 +59,10 @@ public:
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Allows you to provide settings for the Color.
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
//! Allows you to remove color settings.
Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
//! Allows you to provide settings for a marker. These include
//! - type of marker,
@@ -91,9 +91,6 @@ private:
Standard_EXPORT void UpdatePointValues();
//! Replace aspects of already computed groups with the new value.
void replaceWithNewPointAspect (const Handle(Prs3d_PointAspect)& theAspect);
private:
Handle(Geom_Point) myComponent;

View File

@@ -68,6 +68,15 @@
IMPLEMENT_STANDARD_RTTIEXT(AIS_Shape,AIS_InteractiveObject)
static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard_Integer aMode)
{
TColStd_ListIteratorOfListOfInteger It(LL);
for(;It.More();It.Next()){
if(It.Value()==aMode)
return Standard_True;}
return Standard_False;
}
// Auxiliary macros
#define replaceAspectWithDef(theMap, theAspect) \
if (myDrawer->Link()->theAspect()->Aspect() != myDrawer->theAspect()->Aspect()) \
@@ -402,6 +411,8 @@ void AIS_Shape::SetColor (const Quantity_Color& theColor)
myDrawer->SetColor (theColor);
hasOwnColor = Standard_True;
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!toRecompute
|| !myDrawer->HasLink())
{
@@ -421,6 +432,8 @@ void AIS_Shape::SetColor (const Quantity_Color& theColor)
void AIS_Shape::UnsetColor()
{
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!HasColor())
{
return;
@@ -565,8 +578,10 @@ bool AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
{
myOwnWidth = (Standard_ShortReal )theLineWidth;
myOwnWidth = theLineWidth;
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!setWidth (myDrawer, theLineWidth)
|| !myDrawer->HasLink())
{
@@ -586,12 +601,14 @@ void AIS_Shape::SetWidth (const Standard_Real theLineWidth)
void AIS_Shape::UnsetWidth()
{
if (myOwnWidth == 0.0f)
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (myOwnWidth == 0.0)
{
return;
}
myOwnWidth = 0.0f;
myOwnWidth = 0.0;
if (!HasColor())
{
Graphic3d_MapOfAspectsToAspects aReplaceMap;
@@ -664,6 +681,8 @@ void AIS_Shape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
setMaterial (myDrawer, theMat, HasColor(), IsTransparent());
hasOwnMaterial = Standard_True;
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!toRecompute
|| !myDrawer->HasLink())
{
@@ -682,6 +701,8 @@ void AIS_Shape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
void AIS_Shape::UnsetMaterial()
{
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!HasMaterial())
{
return;
@@ -740,6 +761,8 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
setTransparency (myDrawer, theValue);
myDrawer->SetTransparency ((Standard_ShortReal )theValue);
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
if (!toRecompute
|| !myDrawer->HasLink())
{
@@ -758,6 +781,9 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
void AIS_Shape::UnsetTransparency()
{
myRecomputeEveryPrs = false; // no mode to recalculate, only viewer update
myToRecomputeModes.Clear();
myDrawer->SetTransparency (0.0f);
if (!myDrawer->HasOwnShadingAspect())
{
@@ -779,6 +805,18 @@ void AIS_Shape::UnsetTransparency()
}
}
//=======================================================================
//function : LoadRecomputable
//purpose :
//=======================================================================
void AIS_Shape::LoadRecomputable(const Standard_Integer TheMode)
{
myRecomputeEveryPrs = Standard_False;
if(!IsInList(myToRecomputeModes,TheMode))
myToRecomputeModes.Append(TheMode);
}
//=======================================================================
//function : BoundingBox
//purpose :
@@ -865,7 +903,8 @@ Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle ()
void AIS_Shape::SetOwnDeviationCoefficient ( const Standard_Real aCoefficient )
{
myDrawer->SetDeviationCoefficient( aCoefficient );
SetToUpdate();
SetToUpdate(0) ; // WireFrame
SetToUpdate(1) ; // Shadding
}
//=======================================================================
@@ -884,10 +923,11 @@ void AIS_Shape::SetOwnHLRDeviationCoefficient ( const Standard_Real aCoefficien
//purpose :
//=======================================================================
void AIS_Shape::SetOwnDeviationAngle (const Standard_Real theAngle)
void AIS_Shape::SetOwnDeviationAngle ( const Standard_Real anAngle )
{
myDrawer->SetDeviationAngle (theAngle);
SetToUpdate (AIS_WireFrame);
myDrawer->SetDeviationAngle(anAngle );
SetToUpdate(0) ; // WireFrame
}
//=======================================================================
//function : SetOwnDeviationAngle
@@ -901,7 +941,8 @@ void AIS_Shape::SetAngleAndDeviation ( const Standard_Real anAngle )
SetOwnDeviationAngle(anAngle) ;
SetOwnDeviationCoefficient(OutDefl) ;
myInitAng = anAngle;
SetToUpdate();
SetToUpdate(0);
SetToUpdate(1);
}
//=======================================================================

View File

@@ -302,6 +302,8 @@ protected:
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) Standard_OVERRIDE;
Standard_EXPORT void LoadRecomputable (const Standard_Integer TheMode);
//! Create own aspects (if they do not exist) and set color to them.
//! @return TRUE if new aspects have been created
Standard_EXPORT bool setColor (const Handle(Prs3d_Drawer)& theDrawer, const Quantity_Color& theColor) const;

View File

@@ -57,7 +57,6 @@ void AIS_TextLabel::SetColor (const Quantity_Color& theColor)
hasOwnColor = Standard_True;
myDrawer->SetColor (theColor);
myDrawer->TextAspect()->SetColor (theColor);
SynchronizeAspects();
}
//=======================================================================
@@ -75,7 +74,6 @@ void AIS_TextLabel::SetTransparency (const Standard_Real theValue)
myDrawer->TextAspect()->Aspect()->SetColor (aTextColor);
myDrawer->TextAspect()->Aspect()->SetColorSubTitle (aSubColor);
myDrawer->SetTransparency (Standard_ShortReal(theValue));
SynchronizeAspects();
}
//=======================================================================

View File

@@ -425,7 +425,7 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t
updateAttributes (thePrs);
}
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
#ifdef OCCT_DEBUG
std::cout << "AIS_TexturedShape::Compute() in ShadingMode failed \n";

View File

@@ -111,6 +111,9 @@ void AIS_Triangulation::updatePresentation()
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
}
}
myRecomputeEveryPrs = Standard_False; // no mode to recalculate - only viewer update
myToRecomputeModes.Clear();
}
}

View File

@@ -85,7 +85,7 @@ AIS_Trihedron::AIS_Trihedron (const Handle(Geom_Axis2Placement)& theComponent)
void AIS_Trihedron::SetComponent (const Handle(Geom_Axis2Placement)& theComponent)
{
myComponent = theComponent;
SetToUpdate();
LoadRecomputable (AIS_WireFrame);
}
//=======================================================================
@@ -135,8 +135,7 @@ void AIS_Trihedron::SetSize(const Standard_Real aValue)
setOwnDatumAspect();
myDrawer->DatumAspect()->SetAxisLength(aValue, aValue, aValue);
SetToUpdate();
UpdatePresentations();
Update();
UpdateSelection();
}
@@ -163,8 +162,7 @@ void AIS_Trihedron::UnsetSize()
}
else
{
SetToUpdate();
UpdatePresentations();
Update();
}
UpdateSelection();
}
@@ -562,6 +560,19 @@ void AIS_Trihedron::computePresentation (const Handle(PrsMgr_PresentationManager
}
}
//=======================================================================
//function : LoadRecomputable
//purpose :
//=======================================================================
void AIS_Trihedron::LoadRecomputable (const Standard_Integer theMode)
{
myRecomputeEveryPrs = Standard_False;
if (!myToRecomputeModes.Contains (theMode))
{
myToRecomputeModes.Append (theMode);
}
}
//=======================================================================
//function : SetColor
//purpose :

View File

@@ -224,6 +224,8 @@ protected:
protected:
Standard_EXPORT void LoadRecomputable (const Standard_Integer theMode);
//! Creates a sensitive entity for the datum part that will be used in selection owner creation.
Standard_EXPORT Handle(SelectBasics_SensitiveEntity) createSensitiveEntity (const Prs3d_DatumParts thePart,
const Handle(SelectBasics_EntityOwner)& theOwner) const;

View File

@@ -487,7 +487,7 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
try {
Variation.Approximate();
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
return;
}

View File

@@ -34,14 +34,14 @@
//=======================================================================
Approx_ComputeCLine::Approx_ComputeCLine
(const MultiLine& Line,
const Standard_Integer degreemin,
const Standard_Integer degreemax,
const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d,
const Standard_Boolean cutting,
const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
(const MultiLine& Line,
const Standard_Integer degreemin,
const Standard_Integer degreemax,
const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d,
const Standard_Boolean cutting,
const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
{
mydegremin = degreemin;
mydegremax = degreemax;
@@ -61,13 +61,13 @@ const AppParCurves_Constraint LastC)
//=======================================================================
Approx_ComputeCLine::Approx_ComputeCLine
(const Standard_Integer degreemin,
const Standard_Integer degreemax,
const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d,
const Standard_Boolean cutting,
const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
(const Standard_Integer degreemin,
const Standard_Integer degreemax,
const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d,
const Standard_Boolean cutting,
const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
{
alldone = Standard_False;
mydegremin = degreemin;
@@ -88,22 +88,21 @@ const AppParCurves_Constraint LastC)
void Approx_ComputeCLine::Perform(const MultiLine& Line)
{
Standard_Real UFirst, ULast;
Standard_Boolean Finish = Standard_False,
begin = Standard_True, Ok = Standard_False;
Standard_Boolean Finish = Standard_False,
begin = Standard_True, Ok = Standard_False;
Standard_Real thetol3d = Precision::Confusion(), thetol2d = Precision::Confusion();
UFirst = Line.FirstParameter();
ULast = Line.LastParameter();
Standard_Real TolU = Max((ULast - UFirst)*1.e-03, Precision::Confusion());
Standard_Real myfirstU = UFirst;
ULast = Line.LastParameter();
Standard_Real TolU = Max((ULast-UFirst)*1.e-05, Precision::PApproximation());
Standard_Real myfirstU = UFirst;
Standard_Real mylastU = ULast;
Standard_Integer aMaxSegments = 0;
Standard_Integer aMaxSegments1 = myMaxSegments - 1;
Standard_Integer aNbCut = 0, aNbImp = 0, aNbComp = 5;
if (!mycut)
{
alldone = Compute(Line, UFirst, ULast, thetol3d, thetol2d);
if (!alldone)
if (!alldone)
{
tolreached = Standard_False;
myfirstparam.Append(UFirst);
@@ -113,27 +112,25 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
Tolers2d.Append(currenttol2d);
}
}
else
else
{
// previous decision to be taken if we get worse with next cut (eap)
AppParCurves_MultiCurve KeptMultiCurve;
Standard_Real KeptUfirst = 0., KeptUlast = 0., KeptT3d = RealLast(), KeptT2d = 0.;
while (!Finish)
while (!Finish)
{
// Gestion du decoupage de la multiline pour approximer:
if (!begin)
if (!begin)
{
if (Ok)
if (Ok)
{
// Calcul de la partie a approximer.
myfirstU = mylastU;
mylastU = ULast;
aNbCut = 0;
aNbImp = 0;
if (Abs(ULast - myfirstU) <= RealEpsilon()
mylastU = ULast;
if (Abs(ULast-myfirstU) <= RealEpsilon()
|| aMaxSegments >= myMaxSegments)
{
Finish = Standard_True;
@@ -150,60 +147,51 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
{
KeptMultiCurve = TheMultiCurve;
KeptUfirst = myfirstU;
KeptUlast = mylastU;
KeptT3d = thetol3d;
KeptT2d = thetol2d;
aNbImp++;
KeptUfirst = myfirstU;
KeptUlast = mylastU;
KeptT3d = thetol3d;
KeptT2d = thetol2d;
}
// cut an interval
mylastU = (myfirstU + mylastU) / 2;
aNbCut++;
mylastU = (myfirstU + mylastU)/2;
}
}
// Calcul des parametres sur ce nouvel intervalle.
Ok = Compute(Line, myfirstU, mylastU, thetol3d, thetol2d);
if (Ok)
if(Ok)
{
aMaxSegments++;
}
//cout << myfirstU << " - " << mylastU << " tol : " << thetol3d << " " << thetol2d << endl;
Standard_Boolean aStopCutting = Standard_False;
if (aNbCut >= aNbComp)
{
if (aNbCut > aNbImp)
{
aStopCutting = Standard_True;
}
}
// is new decision better?
if (!Ok && (Abs(myfirstU - mylastU) <= TolU || aMaxSegments >= aMaxSegments1 || aStopCutting ))
if (!Ok && (Abs(myfirstU-mylastU) <= TolU || aMaxSegments >= aMaxSegments1))
{
Ok = Standard_True; // stop interval cutting, approx the rest part
Ok = Standard_True; // stop interval cutting, approx the rest part
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
{
KeptMultiCurve = TheMultiCurve;
KeptUfirst = myfirstU;
KeptUlast = mylastU;
KeptT3d = thetol3d;
KeptT2d = thetol2d;
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
{
KeptMultiCurve = TheMultiCurve;
KeptUfirst = myfirstU;
KeptUlast = mylastU;
KeptT3d = thetol3d;
KeptT2d = thetol2d;
}
mylastU = KeptUlast;
tolreached = Standard_False; // helas
myMultiCurves.Append(KeptMultiCurve);
aMaxSegments++;
Tolers3d.Append (KeptT3d);
Tolers2d.Append (KeptT2d);
myfirstparam.Append (KeptUfirst);
mylastparam.Append (KeptUlast);
}
mylastU = KeptUlast;
tolreached = Standard_False; // helas
myMultiCurves.Append(KeptMultiCurve);
aMaxSegments++;
Tolers3d.Append(KeptT3d);
Tolers2d.Append(KeptT2d);
myfirstparam.Append(KeptUfirst);
mylastparam.Append(KeptUlast);
}
begin = Standard_False;
} // while (!Finish)
}
@@ -237,10 +225,10 @@ const
//=======================================================================
Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
const Standard_Real Ufirst,
const Standard_Real Ulast,
Standard_Real& TheTol3d,
Standard_Real& TheTol2d)
const Standard_Real Ufirst,
const Standard_Real Ulast,
Standard_Real& TheTol3d,
Standard_Real& TheTol2d)
{
@@ -255,14 +243,14 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
if (mydone) {
LSquare.Error(Fv, TheTol3d, TheTol2d);
if (TheTol3d <= mytol3d && TheTol2d <= mytol2d) {
// Stockage de la multicurve approximee.
tolreached = Standard_True;
// Stockage de la multicurve approximee.
tolreached = Standard_True;
myMultiCurves.Append(LSquare.Value());
myfirstparam.Append(Ufirst);
mylastparam.Append(Ulast);
Tolers3d.Append(TheTol3d);
Tolers2d.Append(TheTol2d);
return Standard_True;
myfirstparam.Append(Ufirst);
mylastparam.Append(Ulast);
Tolers3d.Append(TheTol3d);
Tolers2d.Append(TheTol2d);
return Standard_True;
}
}
if (deg == mydegremax) {
@@ -270,7 +258,7 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
currenttol3d = TheTol3d;
currenttol2d = TheTol2d;
}
}
return Standard_False;
}
@@ -282,11 +270,11 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line,
//=======================================================================
void Approx_ComputeCLine::Parameters(const Standard_Integer Index,
Standard_Real& firstpar,
Standard_Real& lastpar) const
Standard_Real& firstpar,
Standard_Real& lastpar) const
{
firstpar = myfirstparam.Value(Index);
lastpar = mylastparam.Value(Index);
lastpar = mylastparam.Value(Index);
}
//=======================================================================
@@ -295,7 +283,7 @@ void Approx_ComputeCLine::Parameters(const Standard_Integer Index,
//=======================================================================
void Approx_ComputeCLine::SetDegrees(const Standard_Integer degreemin,
const Standard_Integer degreemax)
const Standard_Integer degreemax)
{
mydegremin = degreemin;
mydegremax = degreemax;
@@ -307,7 +295,7 @@ void Approx_ComputeCLine::SetDegrees(const Standard_Integer degreemin,
//=======================================================================
void Approx_ComputeCLine::SetTolerances(const Standard_Real Tolerance3d,
const Standard_Real Tolerance2d)
const Standard_Real Tolerance2d)
{
mytol3d = Tolerance3d;
mytol2d = Tolerance2d;
@@ -319,10 +307,10 @@ void Approx_ComputeCLine::SetTolerances(const Standard_Real Tolerance3d,
//=======================================================================
void Approx_ComputeCLine::SetConstraints(const AppParCurves_Constraint FirstC,
const AppParCurves_Constraint LastC)
const AppParCurves_Constraint LastC)
{
myfirstC = FirstC;
mylastC = LastC;
mylastC = LastC;
}
//=======================================================================
@@ -330,7 +318,7 @@ void Approx_ComputeCLine::SetConstraints(const AppParCurves_Constraint FirstC,
//purpose : Changes the max number of segments, which is allowed for cutting.
//=======================================================================
void Approx_ComputeCLine::SetMaxSegments(const Standard_Integer theMaxSegments)
void Approx_ComputeCLine:: SetMaxSegments(const Standard_Integer theMaxSegments)
{
myMaxSegments = theMaxSegments;
}
@@ -363,8 +351,8 @@ const {
//=======================================================================
void Approx_ComputeCLine::Error(const Standard_Integer Index,
Standard_Real& tol3d,
Standard_Real& tol2d) const
Standard_Real& tol3d,
Standard_Real& tol2d) const
{
tol3d = Tolers3d.Value(Index);
tol2d = Tolers2d.Value(Index);

View File

@@ -163,21 +163,12 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
myDWeigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
myD2Weigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
if (Num2DSS>0)
{
if (Num2DSS>0) {
myPoles2d = new (TColgp_HArray1OfPnt2d)(1, Num2DSS);
myDPoles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
COnSurfErr = new (TColStd_HArray1OfReal)(1, Num2DSS);
}
else
{
myPoles2d = new TColgp_HArray1OfPnt2d();
myDPoles2d = new TColgp_HArray1OfVec2d();
myD2Poles2d = new TColgp_HArray1OfVec2d();
COnSurfErr = new TColStd_HArray1OfReal();
}
// Checks if myFunc->D2 is implemented
if (continuity >= GeomAbs_C2) {
Standard_Boolean B;

View File

@@ -30,8 +30,6 @@
#include <Aspect_TypeOfResize.hxx>
#include <Standard_Integer.hxx>
#include <Aspect_Drawable.hxx>
class Aspect_DisplayConnection;
class Aspect_WindowDefinitionError;
class Aspect_WindowError;
class Aspect_Background;
@@ -45,80 +43,70 @@ class Aspect_Window : public Standard_Transient
{
public:
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Quantity_Color& color);
//! Modifies the window gradient background.
Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
//! Modifies the window gradient background.
Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
//! Opens the window <me>.
Standard_EXPORT virtual void Map() const = 0;
//! Closes the window <me>.
Standard_EXPORT virtual void Unmap() const = 0;
//! Apply the resizing to the window <me>.
Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const = 0;
//! Apply the mapping change to the window <me>.
//! and returns TRUE if the window is mapped at screen.
Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
//! Returns the window background.
Standard_EXPORT Aspect_Background Background() const;
//! Returns the current image background fill mode.
Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
//! Returns the window gradient background.
Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
//! Returns True if the window <me> is opened
//! and False if the window is closed.
Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
//! Returns True if the window <me> is virtual
Standard_EXPORT Standard_Boolean IsVirtual() const;
//! Setup the virtual state
Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
//! Returns The Window RATIO equal to the physical
//! WIDTH/HEIGHT dimensions
Standard_EXPORT virtual Standard_Real Ratio() const = 0;
//! Returns The Window POSITION in PIXEL
Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
//! Returns The Window SIZE in PIXEL
Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
//! Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
//! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
//! Returns native Window FB config (GLXFBConfig on Xlib)
Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
//! Invalidate entire window content.
//!
//! Implementation is expected to allow calling this method from non-GUI thread,
//! e.g. by queuing exposure event into window message queue or in other thread-safe manner.
//!
//! Optional display argument should be passed when called from non-GUI thread
//! on platforms implementing thread-unsafe connections to display.
//! NULL can be passed instead otherwise.
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
protected:

View File

@@ -232,7 +232,7 @@ void BOPAlgo_ArgumentAnalyzer::Perform()
TestCurveOnSurface();
}
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
BOPAlgo_CheckResult aResult;
aResult.SetCheckStatus(BOPAlgo_CheckUnknown);
myResult.Append(aResult);

View File

@@ -233,7 +233,7 @@ void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
PerformInternal1(theFiller);
}
//
catch (Standard_Failure const&) {
catch (Standard_Failure) {
AddError (new BOPAlgo_AlertBuilderFailed);
}
}

View File

@@ -206,7 +206,7 @@ void BOPAlgo_CheckerSI::Perform()
PostTreat();
}
//
catch (Standard_Failure const&) {
catch (Standard_Failure) {
AddError (new BOPAlgo_AlertIntersectionFailed);
}
}

View File

@@ -223,7 +223,7 @@ void BOPAlgo_PaveFiller::Perform()
PerformInternal();
}
//
catch (Standard_Failure const&) {
catch (Standard_Failure) {
AddError (new BOPAlgo_AlertIntersectionFailed);
}
}

View File

@@ -118,7 +118,7 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo {
myFlag=myContext->ComputeVE (myV, myE, myT, myTolVNew, myFuzzyValue);
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}

View File

@@ -102,7 +102,7 @@ class BOPAlgo_EdgeEdge :
IntTools_EdgeEdge::Perform();
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}

View File

@@ -114,7 +114,7 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo {
myFlag=myContext->ComputeVF(myV, myF, myT1, myT2, myTolVNew, myFuzzyValue);
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}

View File

@@ -113,7 +113,7 @@ class BOPAlgo_EdgeFace :
IntTools_EdgeFace::Perform();
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}

View File

@@ -150,7 +150,7 @@ class BOPAlgo_FaceFace :
IntTools_FaceFace::Perform(myF1, myF2);
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
AddError(new BOPAlgo_AlertIntersectionFailed);
}

View File

@@ -301,7 +301,7 @@ class BOPAlgo_MPC : public BOPAlgo_Algo {
UpdateVertices(aCopyE, myF);
}
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
AddError(new BOPAlgo_AlertBuildingPCurveFailed(TopoDS_Shape()));
}

View File

@@ -155,7 +155,7 @@ void BOPAlgo_RemoveFeatures::Perform()
// Post treatment
PostTreat();
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
AddError(new BOPAlgo_AlertRemoveFeaturesFailed());
}
@@ -354,7 +354,7 @@ public: //! @name Perform the operation
// Trim the extended faces
TrimExtendedFaces(aFaceExtFaceMap);
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
// Make sure the warning will be given on the higher level
myHasAdjacentFaces = Standard_True;

View File

@@ -714,7 +714,7 @@ Standard_Boolean BOPAlgo_Tools::WiresToFaces(const TopoDS_Shape& theWires,
aBB.Add(aRFaces, aFSp);
}
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
continue;
}
}

View File

@@ -136,7 +136,7 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
BRepLib::SameParameter(aE1T);
BRepLib::SameRange(aE1T);
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
iRet = 6;
return iRet;

View File

@@ -326,7 +326,7 @@ void BRepBuilderAPI_FastSewing::Perform(void)
myResShape = aQuilt.Shells();
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
SetStatus(FS_Exception);
#ifdef OCCT_DEBUG

View File

@@ -903,7 +903,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
}
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
isSamePar = Standard_False;
}
@@ -4744,7 +4744,7 @@ void BRepBuilderAPI_Sewing::SameParameterShape()
BRepLib::SameParameter(sec, BRep_Tool::Tolerance(sec));
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
#ifdef OCCT_DEBUG
cout << "Fail: BRepBuilderAPI_Sewing::SameParameterShape exception in BRepLib::SameParameter" << endl;
#endif

View File

@@ -147,6 +147,7 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
if ( ! aRes.IsNull() )
{
aRes->SetFailStatus(exp.Current());
aRes->SetFailStatus(S);
}
}

View File

@@ -238,27 +238,19 @@ static Standard_Boolean KPartCircle
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
Standard_Boolean& myIsDone)
{
TopoDS_Edge E;
for (TopExp_Explorer anEdgeIter (mySpine, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next())
{
if (!E.IsNull())
{
return Standard_False;
}
E = TopoDS::Edge (anEdgeIter.Current());
}
if (E.IsNull())
{
return Standard_False;
TopExp_Explorer exp(mySpine,TopAbs_EDGE);
Standard_Integer NbEdges = 0;
TopoDS_Edge E;
for (; exp.More(); exp.Next()) {
NbEdges++;
E = TopoDS::Edge(exp.Current());
if (NbEdges > 1) return Standard_False;
}
Standard_Real f,l;
TopLoc_Location L;
Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,f,l);
if (C.IsNull())
{
return Standard_False;
}
if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
Handle(Geom_TrimmedCurve) Ct = Handle(Geom_TrimmedCurve)::DownCast(C);
@@ -749,6 +741,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
return;
BRep_Builder myBuilder;
myBuilder.MakeCompound(TopoDS::Compound(myShape));
//---------------------------------------------------------------------
// MapNodeVertex : associate to each node of the map (key1) and to
@@ -792,11 +785,6 @@ void BRepFill_OffsetWire::PerformWithBiLo
TopExp::Vertices(theWire, Ends[0], Ends[1]);
}
if (Locus.NumberOfContours() == 0)
{
return;
}
for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) {
TopoDS_Shape PEE = Link.GeneratingShape(Locus.BasicElt(ic,Locus.NumberOfElts(ic)));
TopoDS_Shape& PE = PEE ;

View File

@@ -2297,7 +2297,7 @@ void BRepLib::EncodeRegularity(TopoDS_Edge& E,
B.Continuity(E,F1,F2,aCont);
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
#ifdef OCCT_DEBUG
cout << "Failure: Exception in BRepLib::EncodeRegularity" << endl;

View File

@@ -152,7 +152,7 @@ static Standard_Boolean Is2DClosed(const TopoDS_Shape& theShape,
TopoDS_Vertex aV2 = TopExp::LastVertex( aLastEdge, Standard_True );
return ( aV1.IsSame( aV2 ) && Is2DConnected( aLastEdge, aFisrtEdge, theSurface, theLocation));
}
catch (Standard_Failure const&) {
catch ( Standard_Failure ) {
return Standard_False;
}
}

View File

@@ -131,10 +131,10 @@ BRepLib_MakeWire::BRepLib_MakeWire(const TopoDS_Wire& W,
void BRepLib_MakeWire::Add(const TopoDS_Wire& W)
{
for (TopoDS_Iterator it(W); it.More(); it.Next()) {
Add(TopoDS::Edge(it.Value()));
if (myError != BRepLib_WireDone)
break;
TopExp_Explorer ex(W,TopAbs_EDGE);
while (ex.More()) {
Add(TopoDS::Edge(ex.Current()));
ex.Next();
}
}

View File

@@ -24,10 +24,10 @@
#include <BRepLib_WireError.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepLib_MakeShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <NCollection_Map.hxx>
#include <Bnd_Box.hxx>
#include <NCollection_UBTree.hxx>
@@ -172,14 +172,14 @@ private:
};
void CollectCoincidentVertices(const TopTools_ListOfShape& theL,
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
void CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
TopTools_DataMapOfShapeShape& theO2NV);
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV);
void CreateNewListOfEdges(const TopTools_ListOfShape& theL,
const TopTools_DataMapOfShapeShape& theO2NV,
TopTools_ListOfShape& theNewEList);
const NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV,
TopTools_ListOfShape& theNewEList);
void Add(const TopoDS_Edge& E, Standard_Boolean IsCheckGeometryProximity);

View File

@@ -58,7 +58,7 @@ void BRepLib_MakeWire::Add(const TopTools_ListOfShape& L)
CollectCoincidentVertices(L, aGrVL);
TopTools_DataMapOfShapeShape anO2NV;
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex> anO2NV;
CreateNewVertices(aGrVL, anO2NV);
@@ -188,13 +188,17 @@ void BRepLib_MakeWire::CollectCoincidentVertices(const TopTools_ListOfShape& the
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL)
{
TopTools_IndexedMapOfShape anAllV;
TopTools_ListIteratorOfListOfShape anItL;
TopTools_IndexedDataMapOfShapeListOfShape aMV2EL;
TopExp::MapShapes(myShape, TopAbs_VERTEX, anAllV);
TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMV2EL);
TopExp_Explorer exp;
for (anItL.Initialize(theL); anItL.More(); anItL.Next())
TopExp::MapShapesAndAncestors(anItL.Value(), TopAbs_VERTEX, TopAbs_EDGE, aMV2EL);
TopTools_ListIteratorOfListOfShape anItL(theL);
for (; anItL.More(); anItL.Next())
TopExp::MapShapes(anItL.Value(), TopAbs_VERTEX, anAllV);
for (int i = 1; i <= aMV2EL.Extent(); i++)
if (aMV2EL(i).Extent() == 1)
anAllV.Add(aMV2EL.FindKey(i));
//aV2CV : vertex <-> its coincident vertices
NCollection_DataMap<TopoDS_Vertex, NCollection_Map<TopoDS_Vertex>> aV2CV;
@@ -299,8 +303,8 @@ void BRepLib_MakeWire::CollectCoincidentVertices(const TopTools_ListOfShape& the
//function : CreateNewVertices
//purpose :
//=======================================================================
void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
TopTools_DataMapOfShapeShape& theO2NV)
void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV)
{
//map [old vertex => new vertex]
//note that already existing shape (i.e. the original ones)
@@ -352,7 +356,7 @@ void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List
//purpose :
//=======================================================================
void BRepLib_MakeWire::CreateNewListOfEdges(const TopTools_ListOfShape& theL,
const TopTools_DataMapOfShapeShape& theO2NV,
const NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV,
TopTools_ListOfShape& theNewEList)
{
///create the new list (theNewEList) from the input list L

View File

@@ -70,12 +70,7 @@ void BRepMAT2d_BisectingLocus::Compute(BRepMAT2d_Explorer& anExplo,
Standard_Integer i;
nbSect.Clear();
theGraph = new MAT_Graph();
nbContours = anExplo.NumberOfContours();
if (nbContours == 0)
{
return;
}
//---------------------------------
// Lecture des donnees de anExplo.
@@ -126,6 +121,7 @@ void BRepMAT2d_BisectingLocus::Compute(BRepMAT2d_Explorer& anExplo,
TheRoots->BackAdd(TheMAT.Bisector());
}
theGraph = new MAT_Graph();
theGraph->Perform(TheMAT.SemiInfinite(),
TheRoots,
theTool.NumberOfItems(),

View File

@@ -123,6 +123,12 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
const TopoDS_Face& aFace,
TopoDS_Face& aNewFace)
{
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin
// This method is totally rewroted to include check
// of connection and creation of a new spine.
NewContour();
myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False;
// Modified by skv - Wed Jun 23 12:23:01 2004 Integration Begin
// Taking into account side of bisecting loci construction.
// TopoDS_Wire aWFwd = TopoDS::Wire(Spine.Oriented(TopAbs_FORWARD));
@@ -130,15 +136,10 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
BRepTools_WireExplorer anExp(Spine, aFace);
// Modified by skv - Wed Jun 23 12:23:02 2004 Integration End
TopTools_IndexedDataMapOfShapeShape anOldNewE;
if (!anExp.More())
return;
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin
// This method is totally rewroted to include check
// of connection and creation of a new spine.
NewContour();
myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False;
TopoDS_Edge aFirstEdge = anExp.Current();
TopoDS_Edge aPrevEdge = aFirstEdge;
Standard_Real UFirst,ULast, aD;

View File

@@ -223,7 +223,7 @@ private:
this->registerNode(BRep_Tool::Pnt(theVertex), aPnt2d,
BRepMesh_Fixed, Standard_False);
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
}
}

View File

@@ -347,7 +347,7 @@ static void ComputeMaxAngleOnShape(const TopoDS_Shape& S,
{
tgtfaces(E, F1, F2, couture, theResAngle);
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
}
}
@@ -562,7 +562,7 @@ TopoDS_Face BRepOffset_MakeSimpleOffset::BuildWallFace(const TopoDS_Edge& theOri
if (aFM.IsDone())
aF = aFM.Face();
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
}

View File

@@ -3103,7 +3103,6 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
TopLoc_Location L;
Handle (Geom_Surface) S = BRep_Tool::Surface(F,L);
Standard_Real UU1,VV1,UU2,VV2;
Standard_Boolean uperiodic = Standard_False, vperiodic = Standard_False;
Standard_Boolean isVV1degen = Standard_False, isVV2degen = Standard_False;
Standard_Real US1,VS1,US2,VS2;
Standard_Real UF1,VF1,UF2,VF2;
@@ -3147,7 +3146,6 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
if (S->IsUPeriodic()) {
uperiodic = Standard_True;
Standard_Real Period = S->UPeriod();
Standard_Real Delta = Period - (UF2 - UF1);
Standard_Real alpha = 0.1;
@@ -3157,7 +3155,6 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
}
if (S->IsVPeriodic()) {
vperiodic = Standard_True;
Standard_Real Period = S->VPeriod();
Standard_Real Delta = Period - (VF2 - VF1);
Standard_Real alpha = 0.1;
@@ -3202,12 +3199,6 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
//Detect closedness in U and V directions
Standard_Boolean uclosed = Standard_False, vclosed = Standard_False;
BRepTools::DetectClosedness(F, uclosed, vclosed);
if (uclosed && !uperiodic &&
(theLenBeforeUfirst != 0. || theLenAfterUlast != 0.))
uclosed = Standard_False;
if (vclosed && !vperiodic &&
(theLenBeforeVfirst != 0. && theLenAfterVlast != 0.))
vclosed = Standard_False;
MakeFace(S,UU1,UU2,VV1,VV2,uclosed,vclosed,isVV1degen,isVV2degen,BF);
BF.Location(L);

View File

@@ -489,7 +489,7 @@ void BRepOffsetAPI_ThruSections::Build()
CreateSmoothed();
}
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
NotDone();
return;

View File

@@ -67,6 +67,25 @@
#include <errno.h>
//=======================================================================
//function : IsPCurveUiso
//purpose :
//=======================================================================
static Standard_Boolean IsPCurveUiso(const Handle(Geom2d_Curve)& thePCurve,
Standard_Real theFirstPar,
Standard_Real theLastPar)
{
gp_Pnt2d FirstP2d = thePCurve->Value(theFirstPar);
gp_Pnt2d LastP2d = thePCurve->Value(theLastPar);
Standard_Real DeltaU = Abs(FirstP2d.X() - LastP2d.X());
Standard_Real DeltaV = Abs(FirstP2d.Y() - LastP2d.Y());
return (DeltaU < DeltaV);
}
//=======================================================================
//function : UVBounds
//purpose :
@@ -958,24 +977,28 @@ void BRepTools::DetectClosedness(const TopoDS_Face& theFace,
{
theUclosed = theVclosed = Standard_False;
BRepAdaptor_Surface BAsurf(theFace, Standard_False);
Standard_Boolean IsSurfUclosed = BAsurf.IsUClosed();
Standard_Boolean IsSurfVclosed = BAsurf.IsVClosed();
if (!IsSurfUclosed && !IsSurfVclosed)
return;
TopExp_Explorer Explo(theFace, TopAbs_EDGE);
for (; Explo.More(); Explo.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
if (BRep_Tool::IsClosed(anEdge, theFace) &&
BRepTools::IsReallyClosed(anEdge, theFace))
if (BRepTools::IsReallyClosed(anEdge, theFace))
{
Standard_Real fpar, lpar;
Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar);
Handle(Geom2d_Curve) PCurve2 = BRep_Tool::CurveOnSurface(TopoDS::Edge(anEdge.Reversed()),
theFace, fpar, lpar);
gp_Pnt2d Point1 = PCurve1->Value(fpar);
gp_Pnt2d Point2 = PCurve2->Value(fpar);
Standard_Boolean IsUiso = (Abs(Point1.X() - Point2.X()) > Abs(Point1.Y() - Point2.Y()));
if (IsUiso)
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar);
Standard_Boolean IsUiso = IsPCurveUiso(aPCurve, fpar, lpar);
if (IsSurfUclosed && IsUiso)
theUclosed = Standard_True;
else
if (IsSurfVclosed && !IsUiso)
theVclosed = Standard_True;
if (theUclosed && theVclosed)
break;
}
}
}

View File

@@ -73,40 +73,31 @@ public:
//purpose :
//=======================================================================
void BSplCLib::Hunt (const TColStd_Array1OfReal& theArray,
const Standard_Real theX,
Standard_Integer& theXPos)
void BSplCLib::Hunt (const Array1OfReal& XX,
const Standard_Real X,
Standard_Integer& Ilc)
{
// replaced by simple dichotomy (RLE)
if (theArray.First() > theX)
{
theXPos = theArray.Lower() - 1;
return;
}
else if (theArray.Last() < theX)
{
theXPos = theArray.Upper() + 1;
return;
}
Ilc = XX.Lower();
if (XX.Length() <= 1) return;
const Standard_Real *px = &XX(Ilc);
px -= Ilc;
theXPos = theArray.Lower();
if (theArray.Length() <= 1)
{
if (X < px[Ilc]) {
Ilc--;
return;
}
Standard_Integer Ihi = XX.Upper();
if (X > px[Ihi]) {
Ilc = Ihi + 1;
return;
}
Standard_Integer Im;
Standard_Integer aHi = theArray.Upper();
while (aHi - theXPos != 1)
{
const Standard_Integer aMid = (aHi + theXPos) / 2;
if (theArray.Value (aMid) < theX)
{
theXPos = aMid;
}
else
{
aHi = aMid;
}
while (Ihi - Ilc != 1) {
Im = (Ihi + Ilc) >> 1;
if (X > px[Im]) Ilc = Im;
else Ihi = Im;
}
}

View File

@@ -124,16 +124,23 @@ public:
DEFINE_STANDARD_ALLOC
//! This routine searches the position of the real value theX
//! in the monotonically increasing set of real values theArray using bisection algorithm.
//! This routine searches the position of the real
//! value X in the ordered set of real values XX.
//!
//! If the given value is out of range or array values, algorithm returns either
//! theArray.Lower()-1 or theArray.Upper()+1 depending on theX position in the ordered set.
//! The elements in the table XX are either
//! monotonically increasing or monotonically
//! decreasing.
//!
//! This routine is used to locate a knot value in a set of knots.
Standard_EXPORT static void Hunt (const TColStd_Array1OfReal& theArray,
const Standard_Real theX,
Standard_Integer& theXPos);
//! The input value Iloc is used to initialize the
//! algorithm : if Iloc is outside of the bounds
//! [XX.Lower(), -- XX.Upper()] the bisection algorithm
//! is used else the routine searches from a previous
//! known position by increasing steps then converges
//! by bisection.
//!
//! This routine is used to locate a knot value in a
//! set of knots.
Standard_EXPORT static void Hunt (const TColStd_Array1OfReal& XX, const Standard_Real X, Standard_Integer& Iloc);
//! Computes the index of the knots value which gives
//! the start point of the curve.
@@ -1337,7 +1344,7 @@ public:
//! (3, NbPoles-2) -> the ends and the tangency are enforced
//! if Problem in BSplineBasis calculation, no change for the curve
//! and FirstIndex, LastIndex = 0
Standard_EXPORT static void MovePoint (const Standard_Real U, const gp_Vec2d& Displ, const Standard_Integer Index1, const Standard_Integer Index2, const Standard_Integer Degree, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Integer& FirstIndex, Standard_Integer& LastIndex, TColgp_Array1OfPnt2d& NewPoles);
Standard_EXPORT static void MovePoint (const Standard_Real U, const gp_Vec2d& Displ, const Standard_Integer Index1, const Standard_Integer Index2, const Standard_Integer Degree, const Standard_Boolean Rational, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Integer& FirstIndex, Standard_Integer& LastIndex, TColgp_Array1OfPnt2d& NewPoles);
//! Find the new poles which allows an old point (with a
//! given u as parameter) to reach a new position
@@ -1348,7 +1355,7 @@ public:
//! (3, NbPoles-2) -> the ends and the tangency are enforced
//! if Problem in BSplineBasis calculation, no change for the curve
//! and FirstIndex, LastIndex = 0
Standard_EXPORT static void MovePoint (const Standard_Real U, const gp_Vec& Displ, const Standard_Integer Index1, const Standard_Integer Index2, const Standard_Integer Degree, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Integer& FirstIndex, Standard_Integer& LastIndex, TColgp_Array1OfPnt& NewPoles);
Standard_EXPORT static void MovePoint (const Standard_Real U, const gp_Vec& Displ, const Standard_Integer Index1, const Standard_Integer Index2, const Standard_Integer Degree, const Standard_Boolean Rational, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Integer& FirstIndex, Standard_Integer& LastIndex, TColgp_Array1OfPnt& NewPoles);
//! This is the dimension free version of the utility
//! U is the parameter must be within the first FlatKnots and the
@@ -1366,7 +1373,7 @@ public:
//! = ...
//! Same holds for EndingCondition
//! Poles are the poles of the curve
//! Weights are the weights of the curve if not NULL
//! Weights are the weights of the curve if Rational = Standard_True
//! NewPoles are the poles of the deformed curve
//! ErrorStatus will be 0 if no error happened
//! 1 if there are not enough knots/poles
@@ -1375,7 +1382,7 @@ public:
//! If StartCondition = 1 and EndCondition = 1 then you need at least
//! 4 + 2 = 6 poles so for example to have a C1 cubic you will need
//! have at least 2 internal knots.
Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const Standard_Integer ArrayDimension, Standard_Real& Delta, Standard_Real& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, Standard_Real& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Real& NewPoles, Standard_Integer& ErrorStatus);
Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const Standard_Integer ArrayDimension, Standard_Real& Delta, Standard_Real& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Boolean Rational, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, Standard_Real& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Real& NewPoles, Standard_Integer& ErrorStatus);
//! This is the dimension free version of the utility
//! U is the parameter must be within the first FlatKnots and the
@@ -1393,7 +1400,7 @@ public:
//! = ...
//! Same holds for EndingCondition
//! Poles are the poles of the curve
//! Weights are the weights of the curve if not NULL
//! Weights are the weights of the curve if Rational = Standard_True
//! NewPoles are the poles of the deformed curve
//! ErrorStatus will be 0 if no error happened
//! 1 if there are not enough knots/poles
@@ -1402,7 +1409,7 @@ public:
//! If StartCondition = 1 and EndCondition = 1 then you need at least
//! 4 + 2 = 6 poles so for example to have a C1 cubic you will need
//! have at least 2 internal knots.
Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const gp_Vec& Delta, const gp_Vec& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, TColgp_Array1OfPnt& NewPoles, Standard_Integer& ErrorStatus);
Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const gp_Vec& Delta, const gp_Vec& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Boolean Rational, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, TColgp_Array1OfPnt& NewPoles, Standard_Integer& ErrorStatus);
//! This is the dimension free version of the utility
//! U is the parameter must be within the first FlatKnots and the
@@ -1420,7 +1427,7 @@ public:
//! = ...
//! Same holds for EndingCondition
//! Poles are the poles of the curve
//! Weights are the weights of the curve if not NULL
//! Weights are the weights of the curve if Rational = Standard_True
//! NewPoles are the poles of the deformed curve
//! ErrorStatus will be 0 if no error happened
//! 1 if there are not enough knots/poles
@@ -1429,7 +1436,7 @@ public:
//! If StartCondition = 1 and EndCondition = 1 then you need at least
//! 4 + 2 = 6 poles so for example to have a C1 cubic you will need
//! have at least 2 internal knots.
Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const gp_Vec2d& Delta, const gp_Vec2d& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, TColgp_Array1OfPnt2d& NewPoles, Standard_Integer& ErrorStatus);
Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const gp_Vec2d& Delta, const gp_Vec2d& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Boolean Rational, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, TColgp_Array1OfPnt2d& NewPoles, Standard_Integer& ErrorStatus);
//! given a tolerance in 3D space returns a

View File

@@ -567,10 +567,11 @@ void BSplCLib::MovePointAndTangent(const Standard_Real U,
Standard_Real &DeltaDerivatives,
const Standard_Real Tolerance,
const Standard_Integer Degree,
const Standard_Boolean Rational,
const Standard_Integer StartingCondition,
const Standard_Integer EndingCondition,
Standard_Real& Poles,
const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Weights,
const TColStd_Array1OfReal& FlatKnots,
Standard_Real& NewPoles,
Standard_Integer& ErrorStatus)
@@ -602,8 +603,8 @@ void BSplCLib::MovePointAndTangent(const Standard_Real U,
ErrorStatus = 0 ;
weights_array = NULL ;
if (Weights != NULL) {
weights_array = const_cast<Standard_Real*>(&Weights->First());
if (Rational) {
weights_array = (Standard_Real *) &Weights(Weights.Lower()) ;
}
poles_array = &Poles ;
@@ -764,7 +765,7 @@ void BSplCLib::MovePointAndTangent(const Standard_Real U,
extrap_mode[0] = Degree ;
extrap_mode[1] = Degree ;
if (Weights != NULL) {
if (Rational) {
//
// evaluate in homogenised form
//

View File

@@ -1218,8 +1218,9 @@ void BSplCLib::MovePoint (const Standard_Real U,
const Standard_Integer Index1,
const Standard_Integer Index2,
const Standard_Integer Degree,
const Standard_Boolean Rational,
const Array1OfPoints& Poles,
const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Weights,
const TColStd_Array1OfReal& FlatKnots,
Standard_Integer& FirstIndex,
Standard_Integer& LastIndex,
@@ -1279,8 +1280,8 @@ void BSplCLib::MovePoint (const Standard_Real U,
for (i = 1; i <= Degree+1; i++) {
ii = i + FirstNonZeroBsplineIndex - 1;
if (Weights != NULL) {
hN = Weights->Value(ii)*BSplineBasis(1, i);
if (Rational) {
hN = Weights(ii)*BSplineBasis(1, i);
D2 += hN;
}
else {
@@ -1300,7 +1301,7 @@ void BSplCLib::MovePoint (const Standard_Real U,
}
}
if (Weights != NULL) {
if (Rational) {
Coef = D2/D1;
}
else {
@@ -1344,10 +1345,11 @@ void BSplCLib::MovePointAndTangent (const Standard_Real U,
const Vector& DeltaDerivatives,
const Standard_Real Tolerance,
const Standard_Integer Degree,
const Standard_Boolean Rational,
const Standard_Integer StartingCondition,
const Standard_Integer EndingCondition,
const Array1OfPoints& Poles,
const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Weights,
const TColStd_Array1OfReal& FlatKnots,
Array1OfPoints& NewPoles,
Standard_Integer & ErrorStatus)
@@ -1374,6 +1376,7 @@ void BSplCLib::MovePointAndTangent (const Standard_Real U,
delta_derivative_array[0],
Tolerance,
Degree,
Rational,
StartingCondition,
EndingCondition,
poles_array[0],

View File

@@ -336,7 +336,7 @@ BinObjMgt_Persistent& BinObjMgt_Persistent::PutCString
alignOffset (1);
Standard_Integer aSize = (Standard_Integer)(strlen (theValue) + 1);
prepareForPut (aSize);
putArray ((void* )theValue, aSize);
putArray ((void* const)theValue, aSize);
return *this;
}
@@ -351,7 +351,7 @@ BinObjMgt_Persistent& BinObjMgt_Persistent::PutAsciiString
alignOffset (BP_INTSIZE, Standard_True);
Standard_Integer aSize = theValue.Length() + 1;
prepareForPut (aSize);
putArray ((void*)theValue.ToCString(), aSize);
putArray ((void* const)theValue.ToCString(), aSize);
return *this;
}
@@ -370,7 +370,7 @@ BinObjMgt_Persistent& BinObjMgt_Persistent::PutExtendedString
Standard_Integer aStartIndex = myIndex;
Standard_Integer aStartOffset = myOffset;
#endif
putArray ((void* )theValue.ToExtString(), aSize);
putArray ((void* const)theValue.ToExtString(), aSize);
#if DO_INVERSE
inverseExtCharData (aStartIndex, aStartOffset, aSize - BP_EXTCHARSIZE);
#endif

View File

@@ -162,7 +162,7 @@ PCDM_ReaderStatus CDF_Application::CanRetrieve(const TCollection_ExtendedString&
if (aReader.IsNull())
return PCDM_RS_NoDriver;
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
// no need to report error, this was just check for availability
}

View File

@@ -121,7 +121,7 @@ PCDM_StoreStatus CDF_StoreList::Store (Handle(CDM_MetaData)& aMetaData, TCollect
}
}
catch (CDF_MetaDataDriverError const& anException) {
catch (CDF_MetaDataDriverError anException) {
CAUGHT(anException, aStatusAssociatedText, TCollection_ExtendedString("metadatadriver failed; reason:"));
status = PCDM_SS_DriverFailure;
}

View File

@@ -27,14 +27,11 @@
//function : ChFiDS_CommonPoint
//purpose :
//=======================================================================
ChFiDS_CommonPoint::ChFiDS_CommonPoint()
: tol (0.0),
prmarc (0.0),
prmtg (0.0),
traarc (TopAbs_FORWARD),
isonarc(Standard_False),
isvtx (Standard_False),
hasvector (Standard_False)
ChFiDS_CommonPoint::ChFiDS_CommonPoint() :
tol(0.),
isonarc(Standard_False),
isvtx(Standard_False),
hasvector(Standard_False)
{
}

View File

@@ -55,12 +55,8 @@ public:
//! Sets the values of a point which is a vertex on
//! the initial facet of restriction of one
//! of the surface.
void SetVertex (const TopoDS_Vertex& theVertex)
{
isvtx = Standard_True;
vtx = theVertex;
}
void SetVertex (const TopoDS_Vertex& V);
//! Sets the values of a point which is on the arc
//! A, at parameter Param.
Standard_EXPORT void SetArc (const Standard_Real Tol, const TopoDS_Edge& A, const Standard_Real Param, const TopAbs_Orientation TArc);
@@ -70,44 +66,30 @@ public:
//! Set the 3d point for a commonpoint that is not
//! a vertex or on an arc.
void SetPoint (const gp_Pnt& thePoint) { point = thePoint; }
void SetPoint (const gp_Pnt& Point);
//! Set the output 3d vector
void SetVector (const gp_Vec& theVector)
{
hasvector = Standard_True;
vector = theVector;
}
void SetVector (const gp_Vec& Vector);
//! This method set the fuzziness on the point.
void SetTolerance (const Standard_Real Tol)
{
if (Tol > tol)
{
tol = Tol;
}
}
void SetTolerance (const Standard_Real Tol);
//! This method returns the fuzziness on the point.
Standard_Real Tolerance() const { return tol; }
Standard_Real Tolerance() const;
//! Returns TRUE if the point is a vertex on the initial
//! restriction facet of the surface.
Standard_Boolean IsVertex() const { return isvtx; }
Standard_Boolean IsVertex() const;
//! Returns the information about the point when it is
//! on the domain of the first patch, i-e when the function
//! IsVertex returns True.
//! Otherwise, an exception is raised.
const TopoDS_Vertex& Vertex() const
{
if (!isvtx) { throw Standard_DomainError(); }
return vtx;
}
const TopoDS_Vertex& Vertex() const;
//! Returns TRUE if the point is a on an edge of the initial
//! restriction facet of the surface.
Standard_Boolean IsOnArc() const { return isonarc; }
Standard_Boolean IsOnArc() const;
//! Returns the arc of restriction containing the
//! vertex.
@@ -125,20 +107,27 @@ public:
Standard_EXPORT Standard_Real Parameter() const;
//! Returns the 3d point
const gp_Pnt& Point() const { return point; }
const gp_Pnt& Point() const;
//! Returns TRUE if the output vector is stored.
Standard_Boolean HasVector() const { return hasvector; }
Standard_Boolean HasVector() const;
//! Returns the output 3d vector
const gp_Vec& Vector() const
{
if (!hasvector) { throw Standard_DomainError ("ChFiDS_CommonPoint::Vector"); }
return vector;
}
const gp_Vec& Vector() const;
protected:
private:
TopoDS_Edge arc;
TopoDS_Vertex vtx;
gp_Pnt point;
@@ -146,11 +135,19 @@ private:
Standard_Real tol;
Standard_Real prmarc;
Standard_Real prmtg;
TopAbs_Orientation traarc;
Standard_Boolean isonarc;
TopAbs_Orientation traarc;
Standard_Boolean isvtx;
Standard_Boolean hasvector;
};
#include <ChFiDS_CommonPoint.lxx>
#endif // _ChFiDS_CommonPoint_HeaderFile

View File

@@ -0,0 +1,140 @@
// Created on: 1993-11-30
// Created by: Isabelle GRIGNON
// Copyright (c) 1993-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.
//=======================================================================
//function : SetVertex
//purpose :
//=======================================================================
inline void ChFiDS_CommonPoint::SetVertex(const TopoDS_Vertex& V)
{
isvtx = Standard_True;
vtx = V;
}
//=======================================================================
//function : SetPoint
//purpose :
//=======================================================================
inline void ChFiDS_CommonPoint::SetPoint(const gp_Pnt& Point)
{
point = Point;
}
//=======================================================================
//function : SetVector
//purpose :
//=======================================================================
inline void ChFiDS_CommonPoint::SetVector(const gp_Vec& Vector)
{
hasvector = Standard_True;
vector = Vector;
}
//=======================================================================
//function : SetTolerance
//purpose :
// PMN : 30/09/1997 : On se contente d'updater la tolerance.
//=======================================================================
inline void ChFiDS_CommonPoint::SetTolerance(const Standard_Real Tol)
{
if (Tol>tol) tol = Tol;
}
//=======================================================================
//function : Tolerance
//purpose :
//=======================================================================
inline Standard_Real ChFiDS_CommonPoint::Tolerance()const
{
return tol;
}
//=======================================================================
//function : IsVertex
//purpose :
//=======================================================================
inline Standard_Boolean ChFiDS_CommonPoint::IsVertex()const
{
return isvtx;
}
//=======================================================================
//function : Vertex
//purpose :
//=======================================================================
inline const TopoDS_Vertex& ChFiDS_CommonPoint::Vertex()const
{
if (!isvtx) {throw Standard_DomainError();}
return vtx;
}
//=======================================================================
//function : Point
//purpose :
//=======================================================================
inline const gp_Pnt& ChFiDS_CommonPoint::Point()const
{
return point;
}
//=======================================================================
//function : HasVector
//purpose :
//=======================================================================
inline Standard_Boolean ChFiDS_CommonPoint::HasVector()const
{
return hasvector;
}
//=======================================================================
//function : Vector
//purpose :
//=======================================================================
inline const gp_Vec& ChFiDS_CommonPoint::Vector()const
{
if (!hasvector) {
throw Standard_DomainError("ChFiDS_CommonPoint::Vector");
}
return vector;
}
//=======================================================================
//function : IsOnArc
//purpose :
//=======================================================================
inline Standard_Boolean ChFiDS_CommonPoint::IsOnArc()const
{
return isonarc;
}

View File

@@ -6,6 +6,7 @@ ChFiDS_CircSection.cxx
ChFiDS_CircSection.hxx
ChFiDS_CommonPoint.cxx
ChFiDS_CommonPoint.hxx
ChFiDS_CommonPoint.lxx
ChFiDS_ElSpine.cxx
ChFiDS_ElSpine.hxx
ChFiDS_ErrorStatus.hxx

View File

@@ -136,10 +136,6 @@ public:
//! Returns nothing on OS X
virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; }
//! Invalidate entire window content by setting NSView::setNeedsDisplay property.
//! Call will be implicitly redirected to the main thread when called from non-GUI thread.
Standard_EXPORT virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp = NULL) Standard_OVERRIDE;
protected:
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE

View File

@@ -66,31 +66,6 @@ static Standard_Integer getScreenBottom()
}
#endif
//! Extension for Cocoa_Window::InvalidateContent().
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
@interface UIView (UIViewOcctAdditions)
- (void )invalidateContentOcct: (id )theSender;
@end
@implementation UIView (UIViewOcctAdditions)
- (void )invalidateContentOcct: (id )theSender
{
(void )theSender;
[self setNeedsDisplay];
}
@end
#else
@interface NSView (NSViewOcctAdditions)
- (void )invalidateContentOcct: (id )theSender;
@end
@implementation NSView (NSViewOcctAdditions)
- (void )invalidateContentOcct: (id )theSender
{
(void )theSender;
[self setNeedsDisplay: YES];
}
@end
#endif
// =======================================================================
// function : Cocoa_Window
// purpose :
@@ -402,30 +377,3 @@ void Cocoa_Window::Size (Standard_Integer& theWidth,
theWidth = (Standard_Integer )aBounds.size.width;
theHeight = (Standard_Integer )aBounds.size.height;
}
// =======================================================================
// function : InvalidateContent
// purpose :
// =======================================================================
void Cocoa_Window::InvalidateContent (const Handle(Aspect_DisplayConnection)& )
{
if (myHView == NULL)
{
return;
}
if ([NSThread isMainThread])
{
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
[myHView setNeedsDisplay];
#else
[myHView setNeedsDisplay: YES];
#endif
}
else
{
[myHView performSelectorOnMainThread: @selector(invalidateContentOcct:)
withObject: NULL
waitUntilDone: NO];
}
}

View File

@@ -182,7 +182,7 @@ Standard_Integer DNaming_Line3DDriver::Execute(Handle(TFunction_Logbook)& theLog
try {
LoadNamingDS(aResultLabel, aWire, anArV, isClosed);
} catch (Standard_Failure const&) {
} catch (Standard_Failure) {
aFunction->SetFailure(NAMING_FAILED);
return -1;
}

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