1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

Compare commits

..

1 Commits

Author SHA1 Message Date
kgv
35a381fd03 0030602: Tests - testdiff does not report known unstable cases properly
Comment TODOs
2019-03-25 09:07:02 +03:00
303 changed files with 1687 additions and 14420 deletions

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

@@ -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

@@ -1737,9 +1737,3 @@ or updating presentation without recomputation (see *AIS_InteractiveObject::Sync
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.

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

@@ -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);

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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

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

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

@@ -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;
}

View File

@@ -74,7 +74,7 @@
#ifdef _WIN32
#define EXCEPTION ...
#else
#define EXCEPTION Standard_Failure const&
#define EXCEPTION Standard_Failure
#endif
#include <ModelDefinitions.hxx>
//#define DEBUG
@@ -697,7 +697,7 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
if(!aSelector.Select(aShape, aCONTEXT, aGeometry, aKeepOrientation))
return 1;
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
cout << "EXCEPTION: SELECTION_IMPOSSIBLE" <<endl;
}
@@ -774,7 +774,7 @@ static Standard_Integer DNaming_XAttachShape (Draw_Interpretor& di,
if(!aSelector.Select(aShape, aCONTEXT, aGeometry, aKeepOrientation))
return 1;
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
cout << "EXCEPTION: SELECTION_IMPOSSIBLE" <<endl;
}

View File

@@ -58,7 +58,7 @@ IMPLEMENT_STANDARD_RTTIEXT(DNaming_TransformationDriver,TFunction_Driver)
#ifdef _WIN32
#define EXCEPTION ...
#else
#define EXCEPTION Standard_Failure const&
#define EXCEPTION Standard_Failure
#endif
#define FACES_TAG 1

View File

@@ -1,6 +1,5 @@
TKDraw
TKMesh
TKShHealing
TKTopAlgo
TKHLR
TKGeomAlgo

View File

@@ -25,8 +25,6 @@
#include <gp_Pnt2d.hxx>
#include <OSD.hxx>
#include <OSD_Environment.hxx>
#include <OSD_File.hxx>
#include <OSD_Process.hxx>
#include <OSD_SharedLibrary.hxx>
#include <OSD_Timer.hxx>
#include <Plugin_MapOfFunctions.hxx>
@@ -77,19 +75,18 @@ Standard_EXPORT Standard_Boolean Draw_Interprete(const char* command);
// read an init file
// *******************************************************************
static void interpreteTclCommand (const TCollection_AsciiString& theCmd)
static void ReadInitFile (const TCollection_AsciiString& theFileName)
{
TCollection_AsciiString aPath = theFileName;
#ifdef _WIN32
aPath.ChangeAll('\\', '/');
if (!Draw_Batch)
{
try
{
while (console_semaphore == HAS_CONSOLE_COMMAND)
{
Sleep(10);
}
{
TCollection_ExtendedString aCmdWide (theCmd);
TCollection_ExtendedString aCmdWide ("source -encoding utf-8 \"");
aCmdWide += TCollection_ExtendedString (aPath) + "\"";
wcscpy_s (console_command, aCmdWide.ToWideString());
}
console_semaphore = HAS_CONSOLE_COMMAND;
@@ -98,127 +95,19 @@ static void interpreteTclCommand (const TCollection_AsciiString& theCmd)
Sleep(10);
}
}
catch (...)
{
std::cout << "Error while reading a script file.\n";
catch(...) {
cout << "Error while reading a script file." << endl;
ExitProcess(0);
}
}
else
} else {
#endif
{
Draw_Interprete (theCmd.ToCString());
}
}
static void ReadInitFile (const TCollection_AsciiString& theFileName)
{
TCollection_AsciiString aCmd = theFileName;
char* com = new char [aPath.Length() + strlen ("source -encoding utf-8 ") + 2];
Sprintf (com, "source -encoding utf-8 %s", aPath.ToCString());
Draw_Interprete (com);
delete [] com;
#ifdef _WIN32
aCmd.ChangeAll ('\\', '/');
}
#endif
aCmd = TCollection_AsciiString ("source -encoding utf-8 \"") + aCmd + "\"";
interpreteTclCommand (aCmd);
}
//! Define environment variable available from Tcl and OCCT.
static void setOcctTclEnv (const TCollection_AsciiString& theName,
TCollection_AsciiString& thePath)
{
if (thePath.IsEmpty())
{
return;
}
thePath.ChangeAll ('\\', '/');
OSD_Environment aRedPathEnv (theName);
aRedPathEnv.SetValue (thePath);
aRedPathEnv.Build();
const TCollection_AsciiString aPutEnv = theName + "=" + thePath;
Tcl_PutEnv (aPutEnv.ToCString());
}
//! Look for resource within standard installation layouts relative to executable location.
//!
//! Bin (INSTALL_DIR_BIN):
//! - Windows: <prefix>/win64/vc10/bin(d)
//! - Unix: <prefix>/bin
//! Resources (INSTALL_DIR_RESOURCE):
//! - Windows: <prefix>/src
//! - Unix: <prefix>/share/opencascade-7.0.0/resources
//! Samples (INSTALL_DIR_SAMPLES):
//! - Windows: <prefix>/samples
//! - Unix: <prefix>/share/opencascade-7.0.0/samples
//! Tests (INSTALL_DIR_TESTS):
//! - Windows: <prefix>/tests
//! - Unix: <prefix>/share/opencascade-7.0.0/tests
//!
//! @param theCasRoot [out] found CASROOT location (e.g. installation folder)
//! @param theResRoot [out] found resources root location
//! @param theResName [in] resource to find ("resources", "samples", etc.)
//! @param theProbeFile [in] file to probe within resources location (e.g. "DrawResources/DrawDefault" within "resources")
static bool searchResources (TCollection_AsciiString& theCasRoot,
TCollection_AsciiString& theResRoot,
const TCollection_AsciiString& theResName,
const TCollection_AsciiString& theProbeFile)
{
const TCollection_AsciiString aResLayouts[] =
{
TCollection_AsciiString("/share/opencascade-" OCC_VERSION_STRING_EXT "/") + theResName,
TCollection_AsciiString("/share/opencascade-" OCC_VERSION_COMPLETE "/") + theResName,
TCollection_AsciiString("/share/opencascade-" OCC_VERSION_STRING "/") + theResName,
TCollection_AsciiString("/share/opencascade/") + theResName,
TCollection_AsciiString("/share/occt-" OCC_VERSION_STRING_EXT "/") + theResName,
TCollection_AsciiString("/share/occt-" OCC_VERSION_COMPLETE "/") + theResName,
TCollection_AsciiString("/share/occt-" OCC_VERSION_STRING "/") + theResName,
TCollection_AsciiString("/share/occt/") + theResName,
TCollection_AsciiString("/") + theResName,
TCollection_AsciiString("/share/opencascade"),
TCollection_AsciiString("/share/occt"),
TCollection_AsciiString("/share"),
TCollection_AsciiString("/src"),
TCollection_AsciiString("")
};
const TCollection_AsciiString anExeDir (OSD_Process::ExecutableFolder());
for (Standard_Integer aLayIter = 0;; ++aLayIter)
{
const TCollection_AsciiString& aResLayout = aResLayouts[aLayIter];
const TCollection_AsciiString aProbeFile = aResLayout + "/" + theProbeFile;
if (OSD_File (anExeDir + aProbeFile).Exists())
{
theCasRoot = anExeDir;
theResRoot = theCasRoot + aResLayout;
return true;
}
// <prefix>/bin(d)
else if (OSD_File (anExeDir + "../" + aProbeFile).Exists())
{
theCasRoot = anExeDir + "..";
theResRoot = theCasRoot + aResLayout;
return true;
}
// <prefix>/gcc/bin(d)
else if (OSD_File (anExeDir + "../../" + aProbeFile).Exists())
{
theCasRoot = anExeDir + "../..";
theResRoot = theCasRoot + aResLayout;
return true;
}
// <prefix>/win64/vc10/bin(d)
else if (OSD_File (anExeDir + "../../../" + aProbeFile).Exists())
{
theCasRoot = anExeDir + "../../..";
theResRoot = theCasRoot + aResLayout;
return true;
}
if (aResLayout.IsEmpty())
{
return false;
}
}
}
//=======================================================================
@@ -436,52 +325,10 @@ void Draw_Appli(int argc, char** argv, const FDraw_InitAppli Draw_InitAppli)
// read init files
// *****************************************************************
// default
const TCollection_AsciiString aDrawDef (OSD_Environment ("DRAWDEFAULT").Value());
if (!aDrawDef.IsEmpty())
if (getenv ("DRAWDEFAULT") == NULL)
{
ReadInitFile (aDrawDef);
}
else
{
TCollection_AsciiString aDrawHome;
TCollection_AsciiString aCasRoot (OSD_Environment ("CASROOT").Value());
if (!aCasRoot.IsEmpty())
{
aDrawHome = aCasRoot + "/src/DrawResources";
}
else
{
// search for relative locations within standard development environment
TCollection_AsciiString aResPath;
if (searchResources (aCasRoot, aResPath, "resources", "DrawResources/DrawDefault"))
{
aDrawHome = aResPath + "/DrawResources";
setOcctTclEnv ("CASROOT", aCasRoot);
setOcctTclEnv ("DRAWHOME", aDrawHome);
setOcctTclEnv ("CSF_OCCTResourcePath", aResPath);
}
TCollection_AsciiString aSamplesPath;
if (OSD_Environment ("CSF_OCCTSamplesPath").Value().IsEmpty()
&& searchResources (aCasRoot, aSamplesPath, "samples", "tcl/Readme.txt"))
{
setOcctTclEnv ("CSF_OCCTSamplesPath", aSamplesPath);
}
TCollection_AsciiString aTestsPath;
if (OSD_Environment ("CSF_TestScriptsPath").Value().IsEmpty()
&& searchResources (aCasRoot, aTestsPath, "tests", "parse.rules"))
{
setOcctTclEnv ("CSF_TestScriptsPath", aTestsPath);
}
}
if (!aDrawHome.IsEmpty())
{
const TCollection_AsciiString aDefStr = aDrawHome + "/DrawDefault";
ReadInitFile (aDefStr);
}
else
if (getenv ("CASROOT") == NULL)
{
#ifdef _WIN32
ReadInitFile ("ddefault");
@@ -490,6 +337,16 @@ void Draw_Appli(int argc, char** argv, const FDraw_InitAppli Draw_InitAppli)
cout << "No default file" << endl;
#endif
}
else
{
TCollection_AsciiString aDefStr (getenv ("CASROOT"));
aDefStr += "/src/DrawResources/DrawDefault";
ReadInitFile (aDefStr);
}
}
else
{
ReadInitFile (getenv ("DRAWDEFAULT"));
}
// read commands from file

View File

@@ -323,7 +323,7 @@ static Standard_Integer dbreak(Draw_Interpretor& di, Standard_Integer, const cha
try {
OSD::ControlBreak();
}
catch (OSD_Exception_CTRL_BREAK const&) {
catch (OSD_Exception_CTRL_BREAK) {
di << "User pressed Control-Break";
return 1; // Tcl exception
}

View File

@@ -33,9 +33,9 @@ void Draw::Commands (Draw_Interpretor& theCommands)
const Handle(Message_Messenger)& aMsgMgr = Message::DefaultMessenger();
if (!aMsgMgr.IsNull())
{
//aMsgMgr->RemovePrinters (STANDARD_TYPE (Message_PrinterOStream));
//aMsgMgr->RemovePrinters (STANDARD_TYPE (Draw_Printer));
//aMsgMgr->AddPrinter (new Draw_Printer (theCommands));
aMsgMgr->RemovePrinters (STANDARD_TYPE (Message_PrinterOStream));
aMsgMgr->RemovePrinters (STANDARD_TYPE (Draw_Printer));
aMsgMgr->AddPrinter (new Draw_Printer (theCommands));
}
isFirstTime = Standard_False;
}

View File

@@ -112,7 +112,16 @@ namespace {
} // anonymous namespace
static Standard_Integer CommandCmd (ClientData theClientData, Tcl_Interp* interp, Standard_Integer argc, const char* argv[])
// MKV 29.03.05
#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
static Standard_Integer CommandCmd
(ClientData theClientData, Tcl_Interp *interp,
Standard_Integer argc, const char* argv[])
#else
static Standard_Integer CommandCmd
(ClientData theClientData, Tcl_Interp *interp,
Standard_Integer argc, char* argv[])
#endif
{
static Standard_Integer code;
code = TCL_OK;
@@ -157,10 +166,18 @@ static Standard_Integer CommandCmd (ClientData theClientData, Tcl_Interp* interp
}
catch (Standard_Failure const& anException) {
// fail if Draw_ExitOnCatch is set
std::cout << "An exception was caught " << anException << std::endl;
const char* toExitOnCatch = Tcl_GetVar (interp, "Draw_ExitOnCatch", TCL_GLOBAL_ONLY);
if (toExitOnCatch != NULL && Draw::Atoi (toExitOnCatch))
{
// MKV 29.03.05
#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
const char* cc = Tcl_GetVar(interp,
"Draw_ExitOnCatch",TCL_GLOBAL_ONLY);
#else
char* const cc = Tcl_GetVar(interp,
"Draw_ExitOnCatch",TCL_GLOBAL_ONLY);
#endif
cout << "An exception was caught " << anException << endl;
if (cc && Draw::Atoi(cc)) {
#ifdef _WIN32
Tcl_Exit(0);
#else
@@ -174,44 +191,6 @@ static Standard_Integer CommandCmd (ClientData theClientData, Tcl_Interp* interp
Tcl_SetResult(interp,(char*)(ss.str().c_str()),TCL_VOLATILE);
code = TCL_ERROR;
}
catch (std::exception const& theStdException)
{
std::cout << "An exception was caught " << theStdException.what() << " [" << typeid(theStdException).name() << "]" << std::endl;
const char* toExitOnCatch = Tcl_GetVar (interp, "Draw_ExitOnCatch", TCL_GLOBAL_ONLY);
if (toExitOnCatch != NULL && Draw::Atoi (toExitOnCatch))
{
#ifdef _WIN32
Tcl_Exit (0);
#else
Tcl_Eval (interp, "exit");
#endif
}
// get the error message
Standard_SStream ss;
ss << "** Exception ** " << theStdException.what() << " [" << typeid(theStdException).name() << "]" << ends;
Tcl_SetResult (interp, (char*)(ss.str().c_str()), TCL_VOLATILE);
code = TCL_ERROR;
}
catch (...)
{
std::cout << "UNKNOWN exception was caught " << std::endl;
const char* toExitOnCatch = Tcl_GetVar (interp, "Draw_ExitOnCatch", TCL_GLOBAL_ONLY);
if (toExitOnCatch != NULL && Draw::Atoi (toExitOnCatch))
{
#ifdef _WIN32
Tcl_Exit (0);
#else
Tcl_Eval (interp,"exit");
#endif
}
// get the error message
Standard_SStream ss;
ss << "** Exception ** UNKNOWN" << ends;
Tcl_SetResult (interp, (char* )(ss.str().c_str()), TCL_VOLATILE);
code = TCL_ERROR;
}
// log command result
if (doLog || doEcho)
@@ -551,7 +530,7 @@ Draw_Interpretor::~Draw_Interpretor()
OCC_CATCH_SIGNALS
Tcl_Exit(0);
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
#ifdef OCCT_DEBUG
cout <<"Tcl_Exit have an exeption" << endl;
#endif

View File

@@ -59,28 +59,18 @@ static Standard_Boolean FindPluginFile (TCollection_AsciiString& thePluginName,
// the order of search : by CSF_<PluginFileName>Defaults and then by CASROOT
TCollection_AsciiString aCSFVariable = TCollection_AsciiString ("CSF_") + thePluginName + "Defaults";
aPluginDir = OSD_Environment (aCSFVariable).Value();
if (aPluginDir.IsEmpty())
{
aPluginDir = OSD_Environment ("DRAWHOME").Value();
if (!aPluginDir.IsEmpty())
{
aPluginDir = getenv (aCSFVariable.ToCString());
if (aPluginDir.IsEmpty()) {
// now try by CASROOT
aPluginDir = getenv("CASROOT");
if ( !aPluginDir.IsEmpty() ) {
aPluginDir +="/src/DrawResources" ;
aToSetCSFVariable = Standard_True; //CSF variable to be set later
}
else
{
// now try by CASROOT
aPluginDir = OSD_Environment ("CASROOT").Value();
if (!aPluginDir.IsEmpty())
{
aPluginDir += "/src/DrawResources";
aToSetCSFVariable = Standard_True; //CSF variable to be set later
}
else
{
aResult = aDirFound = Standard_False;
std::cout << FAILSTR "Neither " << aCSFVariable << ", nor CASROOT variables have been set\n";
}
} else {
aResult = aDirFound = Standard_False;
cout << FAILSTR "Neither " << aCSFVariable.ToCString() << ", nor CASROOT variables have been set" << endl;
}
}

View File

@@ -72,16 +72,26 @@ void Draw_Window::RemoveCallbackBeforeTerminate(FCallbackBeforeTerminate theCB)
static void Prompt(Tcl_Interp *Interp, int partial)
{
Tcl_Channel errChannel;
Tcl_Channel outChannel = Tcl_GetStdChannel(TCL_STDOUT);
const char* promptCmd = Tcl_GetVar (Interp, partial ? "tcl_prompt2" : "tcl_prompt1", TCL_GLOBAL_ONLY);
// MKV 29.03.05
#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
const char *promptCmd;
#else
char *promptCmd;
#endif
int code;
Tcl_Channel outChannel, errChannel;
outChannel = Tcl_GetStdChannel(TCL_STDOUT);
promptCmd = Tcl_GetVar(Interp,(char*)
(partial ? "tcl_prompt2" : "tcl_prompt1"), TCL_GLOBAL_ONLY);
if (promptCmd == NULL) {
defaultPrompt:
if (!partial && outChannel) {
Tcl_Write(outChannel, "% ", 2);
}
} else {
int code = Tcl_Eval(Interp, promptCmd);
code = Tcl_Eval(Interp, promptCmd);
outChannel = Tcl_GetStdChannel(TCL_STDOUT);
errChannel = Tcl_GetStdChannel(TCL_STDERR);
if (code != TCL_OK) {
@@ -1105,7 +1115,7 @@ Standard_Boolean Init_Appli()
try {
OCC_CATCH_SIGNALS
Tk_Init(interp) ;
} catch (Standard_Failure const&) {
} catch (Standard_Failure) {
cout <<" Pb au lancement de TK_Init "<<endl;
}
@@ -1135,7 +1145,7 @@ Standard_Boolean Init_Appli()
{
Draw_DisplayConnection = new Aspect_DisplayConnection();
}
catch (Standard_Failure const&)
catch (Standard_Failure)
{
std::cout << "Cannot open display. Interpret commands in batch mode." << std::endl;
return Standard_False;
@@ -1293,7 +1303,7 @@ static void StdinProc(ClientData clientData, int )
prompt:
if (tty) Prompt(Draw::GetInterpretor().Interp(), gotPartial);
} catch (Standard_Failure const&) {}
} catch (Standard_Failure) {}
}
@@ -2345,24 +2355,23 @@ static DWORD WINAPI tkLoop(VOID)
Standard_Boolean toLoop = Standard_True;
while (toLoop)
{
// The natural way is first flushing events, already put into queue, and then processing custom code in-between.
// Unfortunately, Tcl has no API returning the number of queued events like XPending(), and only empty state can be checked.
// Since events can be continuously fed from parallel threads, Tcl_DoOneEvent might never return empty state at all.
const bool isTclEventQueueEmpty = Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT) == 0;
while(Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT));
if (console_semaphore == HAS_CONSOLE_COMMAND)
{
const TCollection_AsciiString aCmdUtf8 (console_command);
const bool wasInterpreted = Draw_Interprete (aCmdUtf8.ToCString());
if (Draw_IsConsoleSubsystem)
TCollection_AsciiString aCmdUtf8 (console_command);
if (Draw_Interprete (aCmdUtf8.ToCString()))
{
Prompt (interp, wasInterpreted ? 0 : 1);
if (Draw_IsConsoleSubsystem) Prompt (interp, 0);
}
else
{
if (Draw_IsConsoleSubsystem) Prompt (interp, 1);
}
console_semaphore = WAIT_CONSOLE_COMMAND;
}
else if (isTclEventQueueEmpty)
else
{
// release CPU while polling
Sleep (1);
Sleep(100);
}
#ifdef _TK
// We should not exit until the Main Tk window is closed

View File

@@ -43,7 +43,7 @@ Standard_Boolean ExprIntrp::Parse(const Handle(ExprIntrp_Generator)& gen, const
ExprIntrp_stop_string();
return Standard_True;
}
catch (Standard_Failure const&) {}
catch (Standard_Failure) {}
}
ExprIntrp_stop_string();
return Standard_False;

View File

@@ -437,7 +437,7 @@ void Geom2dAPI_PointsToBSpline::Init
try {
Variation.Approximate();
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
return;
}

View File

@@ -315,7 +315,7 @@ void GeomAPI_PointsToBSpline::Init
try {
Variation.Approximate();
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
return;
}

View File

@@ -353,7 +353,7 @@ void GeomAPI_PointsToBSplineSurface::Init(const TColgp_Array2OfPnt& Points,
try {
Variation.Approximate();
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
return;
}
@@ -413,7 +413,7 @@ void GeomAPI_PointsToBSplineSurface::Init(const TColgp_Array2OfPnt& Points,
try {
Variation2.Approximate();
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
return;
}

View File

@@ -608,7 +608,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
Tf(2,1), Tf(2,2), Tf(2,3), Tf(2,4),
Tf(3,1), Tf(3,2), Tf(3,3), Tf(3,4));
}
catch (Standard_ConstructionError const&) {
catch (Standard_ConstructionError) {
IsTrsf = Standard_False;
}
if (!IsTrsf) {

View File

@@ -100,7 +100,7 @@ class GeomLib_CheckCurveOnSurface_TargetFunc :
theFVal = -1.0*aP1.SquareDistance(aP2);
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
return Standard_False;
}
//
@@ -157,7 +157,7 @@ class GeomLib_CheckCurveOnSurface_TargetFunc :
*theDeriv2 = -2.0*(aVec2.SquareMagnitude() + aVec1.Dot(aVec3));
}
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
return Standard_False;
}
@@ -455,7 +455,7 @@ void GeomLib_CheckCurveOnSurface::Perform(const Handle(Geom2d_Curve)& thePCurve,
myMaxDistance = sqrt(Abs(myMaxDistance));
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
myErrorStatus = 3;
}
}
@@ -676,7 +676,7 @@ Standard_Integer FillSubIntervals(const Handle(Geom_Curve)& theCurve3d,
theNbParticles = Max(theNbParticles, aBS2DCurv->Degree());
}
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
#ifdef OCCT_DEBUG
cout << "ERROR! BRepLib_CheckCurveOnSurface.cxx, "
@@ -801,7 +801,7 @@ Standard_Boolean MinComputing (
}
}
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
#ifdef OCCT_DEBUG
cout << "BRepLib_CheckCurveOnSurface.cxx: Exception in MinComputing()!" << endl;

View File

@@ -1129,7 +1129,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
}
}
catch (Standard_Failure const&)
catch (Standard_Failure )
{
di << " Standard Failure \n";
}
@@ -1177,7 +1177,7 @@ static Standard_Integer EllipsUniformAbscissa (Draw_Interpretor& di, Standard_In
DBRep::Set("Ellipse",edge_curve);
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
di << " Standard Failure \n";
}
@@ -1206,7 +1206,7 @@ static Standard_Integer EllipsUniformAbscissa (Draw_Interpretor& di, Standard_In
}
}
catch (Standard_Failure const&)
catch (Standard_Failure )
{
di << " Standard Failure \n";
}

View File

@@ -33,10 +33,6 @@ Graphic3d_Buffer.cxx
Graphic3d_Buffer.hxx
Graphic3d_BufferRange.hxx
Graphic3d_BufferType.hxx
Graphic3d_BvhCStructureSet.cxx
Graphic3d_BvhCStructureSet.hxx
Graphic3d_BvhCStructureSetTrsfPers.cxx
Graphic3d_BvhCStructureSetTrsfPers.hxx
Graphic3d_Camera.cxx
Graphic3d_Camera.hxx
Graphic3d_CameraTile.hxx
@@ -48,8 +44,6 @@ Graphic3d_ClipPlane.hxx
Graphic3d_CStructure.cxx
Graphic3d_CStructure.hxx
Graphic3d_CTexture.hxx
Graphic3d_CullingTool.cxx
Graphic3d_CullingTool.hxx
Graphic3d_CView.cxx
Graphic3d_CView.hxx
Graphic3d_DataStructureManager.cxx
@@ -84,7 +78,6 @@ Graphic3d_MapOfAspectsToAspects.hxx
Graphic3d_MapIteratorOfMapOfStructure.hxx
Graphic3d_MapOfObject.hxx
Graphic3d_MapOfStructure.hxx
Graphic3d_MapOfZLayerSettings.hxx
Graphic3d_MarkerImage.cxx
Graphic3d_MarkerImage.hxx
Graphic3d_Mat4.hxx
@@ -180,7 +173,5 @@ Graphic3d_VerticalTextAlignment.hxx
Graphic3d_ViewAffinity.cxx
Graphic3d_ViewAffinity.hxx
Graphic3d_WorldViewProjState.hxx
Graphic3d_Layer.cxx
Graphic3d_Layer.hxx
Graphic3d_ZLayerId.hxx
Graphic3d_ZLayerSettings.hxx

View File

@@ -19,6 +19,7 @@
#include <Graphic3d_TransModeFlags.hxx>
#include <Graphic3d_GraphicDriver.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CStructure,Standard_Transient)
//=============================================================================
@@ -38,8 +39,7 @@ Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureMana
IsForHighlight (Standard_False),
IsMutable (Standard_False),
Is2dText (Standard_False),
myGraphicDriver (theManager->GraphicDriver()),
myIsCulled (Standard_True)
myGraphicDriver (theManager->GraphicDriver())
{
Id = myGraphicDriver->NewIdentification();
}

View File

@@ -26,7 +26,6 @@
#include <Graphic3d_Vec3.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <Geom_Transformation.hxx>
#include <NCollection_IndexedMap.hxx>
class Graphic3d_GraphicDriver;
class Graphic3d_StructureManager;
@@ -34,35 +33,6 @@ class Graphic3d_StructureManager;
//! Low-level graphic structure interface
class Graphic3d_CStructure : public Standard_Transient
{
protected:
//! Auxiliary wrapper to iterate through structure list.
template<class Struct_t>
class SubclassStructIterator
{
public:
SubclassStructIterator (const NCollection_IndexedMap<const Graphic3d_CStructure*>& theStructs) : myIter (theStructs) {}
Standard_Boolean More() const { return myIter.More(); }
void Next() { myIter.Next(); }
const Struct_t* Value() const { return (const Struct_t* )(myIter.Value()); }
Struct_t* ChangeValue() { return (Struct_t* )(myIter.Value()); }
private:
NCollection_IndexedMap<const Graphic3d_CStructure*>::Iterator myIter;
};
//! Auxiliary wrapper to iterate through group sequence.
template<class Group_t>
class SubclassGroupIterator
{
public:
SubclassGroupIterator (const Graphic3d_SequenceOfGroup& theGroups) : myIter (theGroups) {}
Standard_Boolean More() const { return myIter.More(); }
void Next() { myIter.Next(); }
const Group_t* Value() const { return (const Group_t* )(myIter.Value().get()); }
Group_t* ChangeValue() { return (Group_t* )(myIter.ChangeValue().get()); }
private:
Graphic3d_SequenceOfGroup::Iterator myIter;
};
public:
@@ -133,28 +103,6 @@ public:
//! highlight flag is set to true
const Handle(Graphic3d_PresentationAttributes)& HighlightStyle() const { return myHighlightStyle; }
public:
//! Returns FALSE if the structure hits the current view volume, otherwise returns TRUE.
Standard_Boolean IsCulled() const { return myIsCulled; }
//! Marks structure as culled/not culled - note that IsAlwaysRendered() is ignored here!
void SetCulled (Standard_Boolean theIsCulled) const { myIsCulled = theIsCulled; }
//! Marks structure as overlapping the current view volume one.
//! The method is called during traverse of BVH tree.
void MarkAsNotCulled() const { myIsCulled = Standard_False; }
//! Checks if the structure should be included into BVH tree or not.
Standard_Boolean IsAlwaysRendered() const
{
return IsInfinite
|| IsForHighlight
|| IsMutable
|| Is2dText
|| (!myTrsfPers.IsNull() && myTrsfPers->IsTrihedronOr2d());
}
public:
//! Update structure visibility state
@@ -185,9 +133,6 @@ public:
//! Remove group from this structure
virtual void RemoveGroup (const Handle(Graphic3d_Group)& theGroup) = 0;
//! Update render transformation matrix.
virtual void updateLayerTransformation() {}
public:
int Id;
@@ -223,8 +168,6 @@ protected:
Handle(Graphic3d_SequenceOfHClipPlane) myClipPlanes;
Handle(Graphic3d_PresentationAttributes) myHighlightStyle; //! Current highlight style; is set only if highlight flag is true
mutable Standard_Boolean myIsCulled; //!< A status specifying is structure needs to be rendered after BVH tree traverse
public:
DEFINE_STANDARD_RTTIEXT(Graphic3d_CStructure,Standard_Transient) // Type definition

View File

@@ -33,9 +33,7 @@ namespace
//purpose :
//=======================================================================
Graphic3d_CView::Graphic3d_CView (const Handle(Graphic3d_StructureManager)& theMgr)
: myBgColor (Quantity_NOC_BLACK),
myStructureManager (theMgr),
myCamera (new Graphic3d_Camera()),
: myStructureManager (theMgr),
myHiddenObjects (new Graphic3d_NMapOfTransient()),
myIsInComputedMode (Standard_False),
myIsActive (Standard_False),

View File

@@ -87,12 +87,6 @@ public:
//! Returns true if the view was removed.
Standard_Boolean IsRemoved() const { return myIsRemoved; }
//! Returns camera object of the view.
virtual const Handle(Graphic3d_Camera)& Camera() const { return myCamera; }
//! Sets camera used by the view.
virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) { myCamera = theCamera; }
public:
//! Returns default Shading Model of the view; Graphic3d_TOSM_FRAGMENT by default.
@@ -258,6 +252,20 @@ public:
//! Returns True if the window associated to the view is defined.
virtual Standard_Boolean IsDefined() const = 0;
//! Returns data of a graduated trihedron
virtual const Graphic3d_GraduatedTrihedron& GetGraduatedTrihedron() = 0;
//! Displays Graduated Trihedron.
virtual void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron& theTrihedronData) = 0;
//! Erases Graduated Trihedron.
virtual void GraduatedTrihedronErase() = 0;
//! Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.
//! @param theMin [in] the minimum point of scene.
//! @param theMax [in] the maximum point of scene.
virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) = 0;
//! Dump active rendering buffer into specified memory buffer.
virtual Standard_Boolean BufferDump (Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType) = 0;
@@ -344,10 +352,10 @@ public:
Graphic3d_RenderingParams& ChangeRenderingParams() { return myRenderParams; }
//! Returns background fill color.
virtual Aspect_Background Background() const { return Aspect_Background (myBgColor.GetRGB()); }
virtual Aspect_Background Background() const = 0;
//! Sets background fill color.
virtual void SetBackground (const Aspect_Background& theBackground) { myBgColor.SetRGB (theBackground.Color()); }
virtual void SetBackground (const Aspect_Background& theBackground) = 0;
//! Returns gradient background fill colors.
virtual Aspect_GradientBackground GradientBackground() const = 0;
@@ -379,6 +387,12 @@ public:
//! Sets backfacing model for the view.
virtual void SetBackfacingModel (const Graphic3d_TypeOfBackfacingModel theModel) = 0;
//! Returns camera object of the view.
virtual const Handle(Graphic3d_Camera)& Camera() const = 0;
//! Sets camera used by the view.
virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) = 0;
//! Returns list of lights of the view.
virtual const Handle(Graphic3d_LightSet)& Lights() const = 0;
@@ -407,26 +421,6 @@ public:
//! Fills in the dictionary with statistic performance info.
virtual void StatisticInformation (TColStd_IndexedDataMapOfStringString& theDict) const = 0;
public: //! @name obsolete Graduated Trihedron functionality
//! Returns data of a graduated trihedron
virtual const Graphic3d_GraduatedTrihedron& GetGraduatedTrihedron() { return myGTrihedronData; }
//! Displays Graduated Trihedron.
virtual void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron& theTrihedronData) { (void )theTrihedronData; }
//! Erases Graduated Trihedron.
virtual void GraduatedTrihedronErase() {}
//! Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.
//! @param theMin [in] the minimum point of scene.
//! @param theMax [in] the maximum point of scene.
virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax)
{
(void )theMin;
(void )theMax;
}
private:
//! Adds the structure to display lists of the view.
@@ -454,9 +448,7 @@ protected:
Standard_Integer myId;
Graphic3d_RenderingParams myRenderParams;
Quantity_ColorRGBA myBgColor;
Handle(Graphic3d_StructureManager) myStructureManager;
Handle(Graphic3d_Camera) myCamera;
Graphic3d_SequenceOfStructure myStructsToCompute;
Graphic3d_SequenceOfStructure myStructsComputed;
Graphic3d_MapOfStructure myStructsDisplayed;
@@ -467,10 +459,6 @@ protected:
Graphic3d_TypeOfShadingModel myShadingModel;
Graphic3d_TypeOfVisualization myVisualization;
protected:
Graphic3d_GraduatedTrihedron myGTrihedronData;
};
#endif // _Graphic3d_CView_HeaderFile

View File

@@ -87,7 +87,6 @@ Graphic3d_Camera::Graphic3d_Camera()
myZNear (DEFAULT_ZNEAR),
myZFar (DEFAULT_ZFAR),
myAspect (1.0),
myIsZeroToOneDepth (false),
myScale (1000.0),
myZFocus (1.0),
myZFocusType (FocusType_Relative),
@@ -980,7 +979,7 @@ void Graphic3d_Camera::OrthoProj (const Elem_t theLeft,
const Elem_t theTop,
const Elem_t theNear,
const Elem_t theFar,
NCollection_Mat4<Elem_t>& theOutMx) const
NCollection_Mat4<Elem_t>& theOutMx)
{
// row 0
theOutMx.ChangeValue (0, 0) = Elem_t (2.0) / (theRight - theLeft);
@@ -997,16 +996,8 @@ void Graphic3d_Camera::OrthoProj (const Elem_t theLeft,
// row 2
theOutMx.ChangeValue (2, 0) = Elem_t (0.0);
theOutMx.ChangeValue (2, 1) = Elem_t (0.0);
if (myIsZeroToOneDepth)
{
theOutMx.ChangeValue (2, 2) = Elem_t (-1.0) / (theFar - theNear);
theOutMx.ChangeValue (2, 3) = -theNear / (theFar - theNear);
}
else
{
theOutMx.ChangeValue (2, 2) = Elem_t (-2.0) / (theFar - theNear);
theOutMx.ChangeValue (2, 3) = - (theFar + theNear) / (theFar - theNear);
}
theOutMx.ChangeValue (2, 2) = Elem_t (-2.0) / (theFar - theNear);
theOutMx.ChangeValue (2, 3) = - (theFar + theNear) / (theFar - theNear);
// row 3
theOutMx.ChangeValue (3, 0) = Elem_t (0.0);
@@ -1026,7 +1017,7 @@ void Graphic3d_Camera::PerspectiveProj (const Elem_t theLeft,
const Elem_t theTop,
const Elem_t theNear,
const Elem_t theFar,
NCollection_Mat4<Elem_t>& theOutMx) const
NCollection_Mat4<Elem_t>& theOutMx)
{
// column 0
theOutMx.ChangeValue (0, 0) = (Elem_t (2.0) * theNear) / (theRight - theLeft);
@@ -1043,27 +1034,13 @@ void Graphic3d_Camera::PerspectiveProj (const Elem_t theLeft,
// column 2
theOutMx.ChangeValue (0, 2) = (theRight + theLeft) / (theRight - theLeft);
theOutMx.ChangeValue (1, 2) = (theTop + theBottom) / (theTop - theBottom);
if (myIsZeroToOneDepth)
{
theOutMx.ChangeValue (2, 2) = theFar / (theNear - theFar);
}
else
{
theOutMx.ChangeValue (2, 2) = -(theFar + theNear) / (theFar - theNear);
}
theOutMx.ChangeValue (2, 2) = -(theFar + theNear) / (theFar - theNear);
theOutMx.ChangeValue (3, 2) = Elem_t (-1.0);
// column 3
theOutMx.ChangeValue (0, 3) = Elem_t (0.0);
theOutMx.ChangeValue (1, 3) = Elem_t (0.0);
if (myIsZeroToOneDepth)
{
theOutMx.ChangeValue (2, 3) = -(theFar * theNear) / (theFar - theNear);
}
else
{
theOutMx.ChangeValue (2, 3) = -(Elem_t (2.0) * theFar * theNear) / (theFar - theNear);
}
theOutMx.ChangeValue (2, 3) = -(Elem_t (2.0) * theFar * theNear) / (theFar - theNear);
theOutMx.ChangeValue (3, 3) = Elem_t (0.0);
}
@@ -1081,7 +1058,7 @@ void Graphic3d_Camera::StereoEyeProj (const Elem_t theLeft,
const Elem_t theIOD,
const Elem_t theZFocus,
const Standard_Boolean theIsLeft,
NCollection_Mat4<Elem_t>& theOutMx) const
NCollection_Mat4<Elem_t>& theOutMx)
{
Elem_t aDx = theIsLeft ? Elem_t (0.5) * theIOD : Elem_t (-0.5) * theIOD;
Elem_t aDXStereoShift = aDx * theNear / theZFocus;
@@ -1428,10 +1405,12 @@ void Graphic3d_Camera::FrustumPoints (NCollection_Array1<Graphic3d_Vec3d>& thePo
Standard_Real nLeft = 0.0, nRight = 0.0, nTop = 0.0, nBottom = 0.0;
Standard_Real fLeft = 0.0, fRight = 0.0, fTop = 0.0, fBottom = 0.0;
Standard_Real aNear = myZNear, aFar = myZFar;
Standard_Real aNear = 0.0, aFar = 0.0;
if (!IsOrthographic())
{
// handle perspective projection
aNear = aProjectionMat.GetValue (2, 3) / (-1.0 + aProjectionMat.GetValue (2, 2));
aFar = aProjectionMat.GetValue (2, 3) / ( 1.0 + aProjectionMat.GetValue (2, 2));
// Near plane
nLeft = aNear * (aProjectionMat.GetValue (0, 2) - 1.0) / aProjectionMat.GetValue (0, 0);
nRight = aNear * (aProjectionMat.GetValue (0, 2) + 1.0) / aProjectionMat.GetValue (0, 0);
@@ -1446,6 +1425,8 @@ void Graphic3d_Camera::FrustumPoints (NCollection_Array1<Graphic3d_Vec3d>& thePo
else
{
// handle orthographic projection
aNear = (1.0 / aProjectionMat.GetValue (2, 2)) * (aProjectionMat.GetValue (2, 3) + 1.0);
aFar = (1.0 / aProjectionMat.GetValue (2, 2)) * (aProjectionMat.GetValue (2, 3) - 1.0);
// Near plane
nLeft = ( 1.0 + aProjectionMat.GetValue (0, 3)) / (-aProjectionMat.GetValue (0, 0));
fLeft = nLeft;

View File

@@ -326,20 +326,6 @@ public:
return myZFar;
}
//! Return TRUE if camera should calculate projection matrix for [0, 1] depth range or for [-1, 1] range.
//! FALSE by default.
Standard_Boolean IsZeroToOneDepth() const { return myIsZeroToOneDepth; }
//! Set using [0, 1] depth range or [-1, 1] range.
void SetZeroToOneDepth (Standard_Boolean theIsZeroToOne)
{
if (myIsZeroToOneDepth != theIsZeroToOne)
{
myIsZeroToOneDepth = theIsZeroToOne;
InvalidateProjection();
}
}
//! Changes width / height display ratio.
//! @param theAspect [in] the display ratio.
Standard_EXPORT void SetAspect (const Standard_Real theAspect);
@@ -576,14 +562,14 @@ private:
//! @param theFar [in] the far mapping (clipping) coordinate.
//! @param theOutMx [out] the projection matrix.
template <typename Elem_t>
void
static void
OrthoProj (const Elem_t theLeft,
const Elem_t theRight,
const Elem_t theBottom,
const Elem_t theTop,
const Elem_t theNear,
const Elem_t theFar,
NCollection_Mat4<Elem_t>& theOutMx) const;
NCollection_Mat4<Elem_t>& theOutMx);
//! Compose perspective projection matrix for
//! the passed camera volume mapping.
@@ -595,14 +581,14 @@ private:
//! @param theFar [in] the far mapping (clipping) coordinate.
//! @param theOutMx [out] the projection matrix.
template <typename Elem_t>
void
static void
PerspectiveProj (const Elem_t theLeft,
const Elem_t theRight,
const Elem_t theBottom,
const Elem_t theTop,
const Elem_t theNear,
const Elem_t theFar,
NCollection_Mat4<Elem_t>& theOutMx) const;
NCollection_Mat4<Elem_t>& theOutMx);
//! Compose projection matrix for L/R stereo eyes.
//! @param theLeft [in] the left mapping (clipping) coordinate.
@@ -617,7 +603,7 @@ private:
//! @param theIsLeft [in] boolean flag to choose between L/R eyes.
//! @param theOutMx [out] the projection matrix.
template <typename Elem_t>
void
static void
StereoEyeProj (const Elem_t theLeft,
const Elem_t theRight,
const Elem_t theBottom,
@@ -627,7 +613,7 @@ private:
const Elem_t theIOD,
const Elem_t theZFocus,
const Standard_Boolean theIsLeft,
NCollection_Mat4<Elem_t>& theOutMx) const;
NCollection_Mat4<Elem_t>& theOutMx);
//! Construct "look at" orientation transformation.
//! Reference point differs for perspective and ortho modes
@@ -680,7 +666,6 @@ private:
Standard_Real myZNear; //!< Distance to near clipping plane.
Standard_Real myZFar; //!< Distance to far clipping plane.
Standard_Real myAspect; //!< Width to height display ratio.
Standard_Boolean myIsZeroToOneDepth; //!< use [0, 1] depth range or [-1, 1]
Standard_Real myScale; //!< Specifies parallel scale for orthographic projection.
Standard_Real myZFocus; //!< Stereographic focus value.

View File

@@ -25,71 +25,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_GraphicDriver,Standard_Transient)
Graphic3d_GraphicDriver::Graphic3d_GraphicDriver (const Handle(Aspect_DisplayConnection)& theDisp)
: myDisplayConnection (theDisp)
{
// default layers are always presented in display layer sequence it can not be removed
{
Graphic3d_ZLayerSettings aSettings;
aSettings.SetImmediate (Standard_False);
aSettings.SetEnvironmentTexture (Standard_False);
aSettings.SetEnableDepthTest (Standard_False);
aSettings.SetEnableDepthWrite (Standard_False);
aSettings.SetClearDepth (Standard_False);
aSettings.SetPolygonOffset (Graphic3d_PolygonOffset());
myLayerIds.Add (Graphic3d_ZLayerId_BotOSD);
myLayerSeq.Append (Graphic3d_ZLayerId_BotOSD);
myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_BotOSD, aSettings);
}
{
Graphic3d_ZLayerSettings aSettings;
aSettings.SetImmediate (Standard_False);
aSettings.SetEnvironmentTexture (Standard_True);
aSettings.SetEnableDepthTest (Standard_True);
aSettings.SetEnableDepthWrite (Standard_True);
aSettings.SetClearDepth (Standard_False);
aSettings.SetPolygonOffset (Graphic3d_PolygonOffset());
myLayerIds.Add (Graphic3d_ZLayerId_Default);
myLayerSeq.Append (Graphic3d_ZLayerId_Default);
myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_Default, aSettings);
}
{
Graphic3d_ZLayerSettings aSettings;
aSettings.SetImmediate (Standard_True);
aSettings.SetEnvironmentTexture (Standard_True);
aSettings.SetEnableDepthTest (Standard_True);
aSettings.SetEnableDepthWrite (Standard_True);
aSettings.SetClearDepth (Standard_False);
aSettings.SetPolygonOffset (Graphic3d_PolygonOffset());
myLayerIds.Add (Graphic3d_ZLayerId_Top);
myLayerSeq.Append (Graphic3d_ZLayerId_Top);
myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_Top, aSettings);
}
{
Graphic3d_ZLayerSettings aSettings;
aSettings.SetImmediate (Standard_True);
aSettings.SetEnvironmentTexture (Standard_True);
aSettings.SetEnableDepthTest (Standard_True);
aSettings.SetEnableDepthWrite (Standard_True);
aSettings.SetClearDepth (Standard_True);
aSettings.SetPolygonOffset (Graphic3d_PolygonOffset());
myLayerIds.Add (Graphic3d_ZLayerId_Topmost);
myLayerSeq.Append (Graphic3d_ZLayerId_Topmost);
myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_Topmost, aSettings);
}
{
Graphic3d_ZLayerSettings aSettings;
aSettings.SetImmediate (Standard_True);
aSettings.SetEnvironmentTexture (Standard_False);
aSettings.SetEnableDepthTest (Standard_False);
aSettings.SetEnableDepthWrite (Standard_False);
aSettings.SetClearDepth (Standard_False);
aSettings.SetPolygonOffset (Graphic3d_PolygonOffset());
myLayerIds.Add (Graphic3d_ZLayerId_TopOSD);
myLayerSeq.Append (Graphic3d_ZLayerId_TopOSD);
myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_TopOSD, aSettings);
}
//
}
// =======================================================================
@@ -117,83 +53,4 @@ Standard_Integer Graphic3d_GraphicDriver::NewIdentification()
void Graphic3d_GraphicDriver::RemoveIdentification(const Standard_Integer theId)
{
myStructGenId.Free(theId);
}
//=======================================================================
//function : ZLayerSettings
//purpose :
//=======================================================================
const Graphic3d_ZLayerSettings& Graphic3d_GraphicDriver::ZLayerSettings (const Graphic3d_ZLayerId theLayerId) const
{
Standard_ASSERT_RAISE (myLayerIds.Contains (theLayerId), "Graphic3d_GraphicDriver::ZLayerSettings, Layer with theLayerId does not exist");
return myMapOfZLayerSettings.Find (theLayerId);
}
//=======================================================================
//function : addZLayerIndex
//purpose :
//=======================================================================
void Graphic3d_GraphicDriver::addZLayerIndex (const Graphic3d_ZLayerId theLayerId)
{
// remove index
for (TColStd_SequenceOfInteger::Iterator aLayerIt (myLayerSeq); aLayerIt.More(); aLayerIt.Next())
{
if (aLayerIt.Value() == theLayerId)
{
myLayerSeq.Remove (aLayerIt);
break;
}
}
if (myMapOfZLayerSettings.Find (theLayerId).IsImmediate())
{
myLayerSeq.Append (theLayerId);
return;
}
for (TColStd_SequenceOfInteger::Iterator aLayerIt (myLayerSeq); aLayerIt.More(); aLayerIt.Next())
{
const Graphic3d_ZLayerSettings& aSettings = myMapOfZLayerSettings.Find (aLayerIt.Value());
if (aSettings.IsImmediate())
{
aLayerIt.Previous();
if (aLayerIt.More())
{
myLayerSeq.InsertAfter (aLayerIt, theLayerId);
return;
}
// first non-immediate layer
myLayerSeq.Prepend (theLayerId);
return;
}
}
// no immediate layers
myLayerSeq.Append (theLayerId);
}
//=======================================================================
//function : SetZLayerSettings
//purpose :
//=======================================================================
void Graphic3d_GraphicDriver::SetZLayerSettings (const Graphic3d_ZLayerId theLayerId,
const Graphic3d_ZLayerSettings& theSettings)
{
Graphic3d_ZLayerSettings* aSettings = myMapOfZLayerSettings.ChangeSeek (theLayerId);
if (aSettings != NULL)
{
const bool isChanged = (aSettings->IsImmediate() != theSettings.IsImmediate());
*aSettings = theSettings;
if (isChanged)
{
addZLayerIndex (theLayerId);
}
}
else
{
// abnormal case
myMapOfZLayerSettings.Bind (theLayerId, theSettings);
addZLayerIndex (theLayerId);
}
}
}

View File

@@ -42,11 +42,9 @@
#include <Aspect_Handle.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <Graphic3d_ZLayerSettings.hxx>
#include <Graphic3d_MapOfZLayerSettings.hxx>
#include <Graphic3d_CLight.hxx>
#include <Graphic3d_TypeOfLimit.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_SequenceOfInteger.hxx>
class Aspect_DisplayConnection;
@@ -124,16 +122,13 @@ public:
virtual void RemoveZLayer (const Graphic3d_ZLayerId theLayerId) = 0;
//! Returns list of Z layers defined for the graphical driver.
virtual void ZLayers (TColStd_SequenceOfInteger& theLayerSeq) const
{
theLayerSeq.Assign (myLayerSeq);
}
virtual void ZLayers (TColStd_SequenceOfInteger& theLayerSeq) const = 0;
//! Sets the settings for a single Z layer.
Standard_EXPORT virtual void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings& theSettings) = 0;
virtual void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings& theSettings) = 0;
//! Returns the settings of a single Z layer.
Standard_EXPORT virtual const Graphic3d_ZLayerSettings& ZLayerSettings (const Graphic3d_ZLayerId theLayerId) const;
virtual const Graphic3d_ZLayerSettings& ZLayerSettings (const Graphic3d_ZLayerId theLayerId) const = 0;
//! Returns view associated with the window if it is exists and is activated.
//! Returns Standard_True if the view associated to the window exists.
@@ -155,16 +150,10 @@ protected:
//! Initializes the Driver
Standard_EXPORT Graphic3d_GraphicDriver(const Handle(Aspect_DisplayConnection)& theDisp);
//! Insert index layer at proper position.
Standard_EXPORT void addZLayerIndex (const Graphic3d_ZLayerId theLayerId);
protected:
Handle(Aspect_DisplayConnection) myDisplayConnection;
Aspect_GenId myStructGenId;
TColStd_MapOfInteger myLayerIds;
TColStd_SequenceOfInteger myLayerSeq;
Graphic3d_MapOfZLayerSettings myMapOfZLayerSettings;
};

View File

@@ -1,184 +0,0 @@
// Copyright (c) 2011-2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Graphic3d_Layer_HeaderFile
#define _Graphic3d_Layer_HeaderFile
#include <Graphic3d_BvhCStructureSet.hxx>
#include <Graphic3d_BvhCStructureSetTrsfPers.hxx>
#include <Graphic3d_Camera.hxx>
#include <Graphic3d_ZLayerSettings.hxx>
#include <Graphic3d_RenderingParams.hxx>
#include <NCollection_Array1.hxx>
#include <NCollection_IndexedMap.hxx>
#include <NCollection_Sequence.hxx>
//! Defines index map of structures.
typedef NCollection_IndexedMap<const Graphic3d_CStructure*> Graphic3d_IndexedMapOfStructure;
//! Defines array of indexed maps of structures.
typedef NCollection_Array1<Graphic3d_IndexedMapOfStructure> Graphic3d_ArrayOfIndexedMapOfStructure;
class Graphic3d_CullingTool;
//! Presentations list sorted within priorities.
class Graphic3d_Layer : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_Layer, Standard_Transient)
public:
//! Initializes associated priority list and layer properties
Standard_EXPORT Graphic3d_Layer (Standard_Integer theNbPriorities,
const Handle(Select3D_BVHBuilder3d)& theBuilder);
//! Destructor.
Standard_EXPORT virtual ~Graphic3d_Layer();
//! Returns BVH tree builder for frustom culling.
const Handle(Select3D_BVHBuilder3d)& FrustumCullingBVHBuilder() const { return myBVHPrimitivesTrsfPers.Builder(); }
//! Assigns BVH tree builder for frustom culling.
void SetFrustumCullingBVHBuilder (const Handle(Select3D_BVHBuilder3d)& theBuilder) { myBVHPrimitivesTrsfPers.SetBuilder (theBuilder); }
//! Return true if layer was marked with immediate flag.
Standard_Boolean IsImmediate() const { return myLayerSettings.IsImmediate(); }
//! Returns settings of the layer object.
const Graphic3d_ZLayerSettings& LayerSettings() const { return myLayerSettings; };
//! Sets settings of the layer object.
Standard_EXPORT void SetLayerSettings (const Graphic3d_ZLayerSettings& theSettings);
Standard_EXPORT void Add (const Graphic3d_CStructure* theStruct,
Standard_Integer thePriority,
Standard_Boolean isForChangePriority = Standard_False);
//! Remove structure and returns its priority, if the structure is not found, method returns negative value
Standard_EXPORT bool Remove (const Graphic3d_CStructure* theStruct,
Standard_Integer& thePriority,
Standard_Boolean isForChangePriority = Standard_False);
//! @return the number of structures
Standard_Integer NbStructures() const { return myNbStructures; }
//! Number of NOT culled structures in the layer.
Standard_Integer NbStructuresNotCulled() const { return myNbStructuresNotCulled; }
//! Returns the number of available priority levels
Standard_Integer NbPriorities() const { return myArray.Length(); }
//! Append layer of acceptable type (with similar number of priorities or less).
//! Returns Standard_False if the list can not be accepted.
Standard_EXPORT Standard_Boolean Append (const Graphic3d_Layer& theOther);
//! Returns array of structures.
const Graphic3d_ArrayOfIndexedMapOfStructure& ArrayOfStructures() const { return myArray; }
//! Marks BVH tree for given priority list as dirty and
//! marks primitive set for rebuild.
Standard_EXPORT void InvalidateBVHData();
//! Marks cached bounding box as obsolete.
void InvalidateBoundingBox() const
{
myIsBoundingBoxNeedsReset[0] = myIsBoundingBoxNeedsReset[1] = true;
}
//! Returns layer bounding box.
//! @param theViewId view index to consider View Affinity in structure
//! @param theCamera camera definition
//! @param theWindowWidth viewport width (for applying transformation-persistence)
//! @param theWindowHeight viewport height (for applying transformation-persistence)
//! @param theToIncludeAuxiliary consider also auxiliary presentations (with infinite flag or with trihedron transformation persistence)
//! @return computed bounding box
Standard_EXPORT Bnd_Box BoundingBox (Standard_Integer theViewId,
const Handle(Graphic3d_Camera)& theCamera,
Standard_Integer theWindowWidth,
Standard_Integer theWindowHeight,
Standard_Boolean theToIncludeAuxiliary) const;
//! Returns zoom-scale factor.
Standard_EXPORT Standard_Real considerZoomPersistenceObjects (Standard_Integer theViewId,
const Handle(Graphic3d_Camera)& theCamera,
Standard_Integer theWindowWidth,
Standard_Integer theWindowHeight) const;
//! Update culling state - should be called before rendering.
//! Traverses through BVH tree to determine which structures are in view volume.
Standard_EXPORT void UpdateCulling (Standard_Integer theViewId,
const Graphic3d_CullingTool& theSelector,
const Graphic3d_RenderingParams::FrustumCulling theFrustumCullingState);
//! Returns TRUE if layer is empty or has been discarded entirely by culling test.
bool IsCulled() const { return myNbStructuresNotCulled == 0; }
//! Returns number of transform persistence objects.
Standard_Integer NbOfTransformPersistenceObjects() const
{
return myBVHPrimitivesTrsfPers.Size();
}
public:
//! Returns set of Graphic3d_CStructures structures for building BVH tree.
const Graphic3d_BvhCStructureSet& CullableStructuresBVH() const { return myBVHPrimitives; }
//! Returns set of transform persistent Graphic3d_CStructures for building BVH tree.
const Graphic3d_BvhCStructureSetTrsfPers& CullableTrsfPersStructuresBVH() const { return myBVHPrimitivesTrsfPers; }
//! Returns indexed map of always rendered structures.
const NCollection_IndexedMap<const Graphic3d_CStructure*>& NonCullableStructures() const { return myAlwaysRenderedMap; }
protected:
//! Updates BVH trees if their state has been invalidated.
Standard_EXPORT void updateBVH() const;
private:
//! Array of Graphic3d_CStructures by priority rendered in layer.
Graphic3d_ArrayOfIndexedMapOfStructure myArray;
//! Overall number of structures rendered in the layer.
Standard_Integer myNbStructures;
//! Number of NOT culled structures in the layer.
Standard_Integer myNbStructuresNotCulled;
//! Layer setting flags.
Graphic3d_ZLayerSettings myLayerSettings;
//! Set of Graphic3d_CStructures structures for building BVH tree.
mutable Graphic3d_BvhCStructureSet myBVHPrimitives;
//! Set of transform persistent Graphic3d_CStructures for building BVH tree.
mutable Graphic3d_BvhCStructureSetTrsfPers myBVHPrimitivesTrsfPers;
//! Indexed map of always rendered structures.
mutable NCollection_IndexedMap<const Graphic3d_CStructure*> myAlwaysRenderedMap;
//! Is needed for implementation of stochastic order of BVH traverse.
Standard_Boolean myBVHIsLeftChildQueuedFirst;
//! Defines if the primitive set for BVH is outdated.
mutable Standard_Boolean myIsBVHPrimitivesNeedsReset;
//! Defines if the cached bounding box is outdated.
mutable bool myIsBoundingBoxNeedsReset[2];
//! Cached layer bounding box.
mutable Bnd_Box myBoundingBox[2];
};
#endif // _Graphic3d_Layer_HeaderFile

View File

@@ -18,7 +18,6 @@
#include <Geom_Transformation.hxx>
#include <Graphic3d_LightSet.hxx>
#include <Graphic3d_PolygonOffset.hxx>
#include <Precision.hxx>
#include <TCollection_AsciiString.hxx>
enum Graphic3d_ZLayerSetting

View File

@@ -3325,7 +3325,7 @@ void IFSelect_WorkSession::DumpModel
if (level == 3) C = CT.CheckList();
else C = CT.CompleteCheckList();
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption DumpModel (Check) par Exception ****\n";
S<<" ** ** Exception Raised during Check ! ** **\n";

View File

@@ -11,10 +11,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <IGESData_GlobalSection.hxx>
//#52 rln 06.01.99 writing value 1.e-07
//gka 19.01.99 changing size of ParamSet
//#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000 and YYYYMMDD.HHMMSS after Y2000)
//#66 rln Setting IGES 5.3 by default
//#73 rln 10.03.99 S4135: "read.scale.unit" is applied after translation
#include <gp_XYZ.hxx>
#include <IGESData_BasicEditor.hxx>
#include <IGESData_GlobalSection.hxx>
#include <Interface_Check.hxx>
#include <Interface_FileParameter.hxx>
#include <Interface_FileReaderData.hxx>
@@ -29,19 +34,25 @@
#include <UnitsMethods.hxx>
#include <stdio.h>
// MGE 21/07/98
// valeurs en MILLIMETRE pardefaut, reajustable
//static Standard_Real convunit = 1000.;
// Routines locales copiant une string [l`ideal serait : astr = astr->Copy()]
// et transformant un CString (Hollerith ou non) en HAsciiString non Holl.
// et l inverse
static void CopyString (Handle(TCollection_HAsciiString)& astr)
static void CopyString (Handle(TCollection_HAsciiString)& astr);
static void MakeHollerith(const Handle(TCollection_HAsciiString)& astr,
char* text, Standard_Integer& lt);
void CopyString (Handle(TCollection_HAsciiString)& astr)
{
if (astr.IsNull()) return; // ne rien faire si String pas definie !
Handle(TCollection_HAsciiString) S = new TCollection_HAsciiString("");
S->AssignCat (astr);
astr = S;
S->AssignCat(astr); astr = S;
}
static void MakeHollerith(const Handle(TCollection_HAsciiString)& astr,
void MakeHollerith(const Handle(TCollection_HAsciiString)& astr,
char* text, Standard_Integer& lt)
{
lt = 0; text[0] = '\0';
@@ -52,32 +63,21 @@ static void MakeHollerith(const Handle(TCollection_HAsciiString)& astr,
lt = ln+2; if (ln >= 10) lt ++; if (ln >= 100) lt ++; // strlen text
}
//=======================================================================
//function : IGESData_GlobalSection
//purpose :
//=======================================================================
IGESData_GlobalSection::IGESData_GlobalSection()
: theSeparator (','),
theEndMark (';'),
theIntegerBits (32), // simple = entier = 32b, double = 64
theMaxPower10Single (38),
theMaxDigitsSingle (6),
theMaxPower10Double (308),
theMaxDigitsDouble (15),
theScale (1.0),
theUnitFlag (0),
theLineWeightGrad (1),
theMaxLineWeight (0.0),
theResolution (0.0),
theMaxCoord (0.0),
hasMaxCoord (Standard_False),
theIGESVersion (11), // IGES 5.3 by default
theDraftingStandard (0)
IGESData_GlobalSection::IGESData_GlobalSection ()
{
//
// convunit = 1000.;
//#73 rln 10.03.99 S4135: "read.scale.unit" is applied after translation
//if (Interface_Static::IVal("read.scale.unit") == 1) convunit = 1;
}
// pourrait etre une methode generale au package en fait
//=======================================================================
//function : TranslatedFromHollerith
//purpose :

View File

@@ -44,6 +44,7 @@ public:
DEFINE_STANDARD_ALLOC
//! Creates an empty GlobalSection, ready to be filled,
//! Warning : No default value is provided
Standard_EXPORT IGESData_GlobalSection();
@@ -236,8 +237,19 @@ public:
Standard_EXPORT void SetApplicationProtocol (const Handle(TCollection_HAsciiString)& val);
protected:
private:
Standard_Character theSeparator;
Standard_Character theEndMark;
Handle(TCollection_HAsciiString) theSendName;
@@ -266,6 +278,13 @@ private:
Handle(TCollection_HAsciiString) theLastChangeDate;
Handle(TCollection_HAsciiString) theAppliProtocol;
};
#endif // _IGESData_GlobalSection_HeaderFile

View File

@@ -126,7 +126,7 @@ Standard_Integer IGESFile_Read
OCC_CATCH_SIGNALS
IGESFile_ReadHeader(IR);
} // fin essai 1 (global)
catch (Standard_Failure const&) {
catch (Standard_Failure) {
// Sending of message : Internal error during the header reading
Message_Msg Msg11 = Message_Msg("XSTEP_11");
IGESFile_Check (1,Msg11);
@@ -140,7 +140,7 @@ Standard_Integer IGESFile_Read
// Sending of message : Loaded data
} // fin essai 2 (entites)
catch (Standard_Failure const&) {
catch (Standard_Failure) {
// Sending of message : Internal error during the content reading
if (recupnp == 0) {
Message_Msg Msg13 = Message_Msg("XSTEP_13");

View File

@@ -191,7 +191,7 @@ static Handle(IGESData_FileProtocol) IGESProto;
OCC_CATCH_SIGNALS
dump.Dump(igesent,S,level,(level-1)/3);
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
S << " ** Dump Interrupt **" << endl;
}
}

View File

@@ -114,7 +114,7 @@ static Standard_Boolean EncodeRegul (const TopoDS_Shape& sh)
OCC_CATCH_SIGNALS
BRepLib::EncodeRegularity (sh,tolang);
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
return Standard_False;
}
return Standard_True;
@@ -191,7 +191,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
OCC_CATCH_SIGNALS
shape = CAS.TransferGeometry(ent);
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
shape.Nullify();
}
}

View File

@@ -1121,7 +1121,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve
BSplineRes->Segment(Udeb, Ufin);
res = BSplineRes;
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(BSplineRes2,Udeb,Ufin);
res = gtc;
}

View File

@@ -293,7 +293,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
OCC_CATCH_SIGNALS
res = TransferCurveAndSurface(start);
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
Message_Msg msg1015("IGES_1015");
SendFail(start, msg1015);
}
@@ -325,7 +325,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
OCC_CATCH_SIGNALS
res = TransferGeometry(stsub);
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
res.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail( st408, msg1015);
@@ -368,7 +368,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
OCC_CATCH_SIGNALS
item = TransferGeometry(st308->AssociatedEntity(i));
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
item.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail( st308->AssociatedEntity(i), msg1015);
@@ -422,7 +422,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
OCC_CATCH_SIGNALS
item = TransferGeometry(st402f1->Entity(i));
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
item.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail(st402f1->Entity(i),msg1015);
@@ -485,7 +485,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
OCC_CATCH_SIGNALS
item = TransferGeometry(st402f7->Entity(i));
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
item.Nullify();
Message_Msg msg1015("IGES_1015");
SendFail(st402f7->Entity(i),msg1015);

View File

@@ -296,7 +296,7 @@ static Standard_Boolean EncodeRegul (const TopoDS_Shape& sh)
OCC_CATCH_SIGNALS
BRepLib::EncodeRegularity (sh,tolang);
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
return Standard_False;
}
return Standard_True;
@@ -431,7 +431,7 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible)
TP.Transfer(ent);
shape = TransferBRep::ShapeResult (theProc,ent);
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
Message_Msg msg1005("IGES_1005");
TF->Send (msg1005, Message_Info);
continue;
@@ -540,7 +540,7 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num)
OCC_CATCH_SIGNALS
shape = CAS.TransferGeometry (ent);
}
catch(Standard_Failure const&) {
catch(Standard_Failure) {
Message_Msg msg1015("IGES_1015");
TF->Send (msg1015, Message_Info);
exceptionRaised = Standard_True;

View File

@@ -44,10 +44,10 @@ inline gp_Dir2d IntImp_ZerParFunc::DirectionOnS2() const {
}
inline const ThePSurface& IntImp_ZerParFunc::AuxillarSurface1() const {
return *((const ThePSurface* )surf1);
return (*((const ThePSurface * const)(surf1)));
}
inline const ThePSurface& IntImp_ZerParFunc::AuxillarSurface2() const {
return *((const ThePSurface* )surf2);
return (*((const ThePSurface * const)(surf2)));
}

View File

@@ -68,7 +68,7 @@ public:
(aP1.XYZ()-aP2.XYZ()).Coord(theF(anIndF), theF(anIndF+1), theF(anIndF+2));
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
return Standard_False;
}
@@ -106,7 +106,7 @@ public:
aD2[mySeamCoordInd].Reversed().Coord(theD(anIndRD, anIndCD+2),
theD(anIndRD+1, anIndCD+2), theD(anIndRD+2, anIndCD+2));
}
catch(Standard_Failure const&)
catch(Standard_Failure)
{
return Standard_False;
}

View File

@@ -332,7 +332,7 @@ void Interface_FileReaderTool::LoadModel
OCC_CATCH_SIGNALS
BeginRead(amodel); // selon la norme
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
// Sendinf of message : Internal error during the header reading
Message_Msg Msg11("XSTEP_11");
TF->Send (Msg11, Message_Info);
@@ -481,7 +481,7 @@ void Interface_FileReaderTool::LoadModel
OCC_CATCH_SIGNALS
EndRead(amodel); // selon la norme
}
catch (Standard_Failure const&) {
catch (Standard_Failure) {
// Sendinf of message : Internal error during the header reading
Message_Msg Msg11("XSTEP_11");
TF->Send (Msg11, Message_Info);

View File

@@ -149,7 +149,8 @@ char * LDOM_CharReference::Encode (const char* theSrc, Standard_Integer& theLen,
Standard_Integer aCount = 0;
// Analyse if there is a non-standard character in the string
for(;;) {
const unsigned int iSrc = (unsigned int ) *(const unsigned char* )ptrSrc;
const unsigned int iSrc =
(const unsigned int) * (const unsigned char *) ptrSrc;
if (iSrc == 0) {
endSrc = ptrSrc;
break;
@@ -166,7 +167,8 @@ char * LDOM_CharReference::Encode (const char* theSrc, Standard_Integer& theLen,
char * ptrDest = new char [(endSrc - theSrc) + aCount * 5 + 1];
aDest = ptrDest;
for (ptrSrc = theSrc; ptrSrc < endSrc; ptrSrc++) {
const unsigned int iSrc = (unsigned int ) *(const unsigned char* )ptrSrc;
const unsigned int iSrc =
(const unsigned int) * (const unsigned char *) ptrSrc;
const int aCode = myTab[iSrc];
if (aCode == NORMAL_C) // normal (regular) character
* ptrDest++ = * ptrSrc;

View File

@@ -164,7 +164,7 @@ Standard_Integer LDOM_MemManager::HashTable::Hash (const char * aString,
unsigned int aCRC = 0;
const unsigned char * aPtr = (const unsigned char *) aString;
for (Standard_Integer i = aLen; i > 0; i--) {
const unsigned int bTmp = aCRC ^ (unsigned int) (* aPtr++);
const unsigned int bTmp = aCRC ^ (const unsigned int) (* aPtr++);
aCRC = ((aCRC >> 8) ^ wCRC16a[bTmp & 0x0F]) ^ wCRC16b[(bTmp >> 4) & 0x0F];
}
return Standard_Integer (aCRC & HASH_MASK /* myMask */);

View File

@@ -210,7 +210,8 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord (Standard_IStream& theIStr
} // otherwise ERROR
} // end of switch
myError = "Unknown XML object: ";
myError += TCollection_AsciiString (myPtr, XML_MIN_BUFFER);
myError += TCollection_AsciiString ((const Standard_CString)myPtr,
XML_MIN_BUFFER);
return XML_UNKNOWN;
case '\0':
if (myEOF == Standard_True) continue;

View File

@@ -587,7 +587,7 @@ Standard_Boolean LocOpe_SplitShape::Add(const TopoDS_Wire& W,
if(!AddClosedWire(W,F))
return Standard_False;
}
} catch (Standard_Failure const&) {
} catch (Standard_Failure ) {
#ifdef OCCT_DEBUG
cout << "Warning: SpliShape internal problem detected, some faces may be lost. Check input edges/wires" <<endl;
#endif

View File

@@ -18,7 +18,6 @@ proc Visualization:toolkits { } {
set aResult [list TKService \
TKV3d \
TKOpenGl \
TKVulkan \
TKMeshVS]
if { [info exists ::env(HAVE_VTK)] && "$::env(HAVE_VTK)" == "true" } {

View File

@@ -12,44 +12,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifdef _WIN32
//it is important to undefine NOUSER and enforce including <windows.h> before
//Standard_Macro.hxx defines it and includes <windows.h> causing compilation errors
#ifdef NOUSER
#undef NOUSER // we need SW_HIDE from windows.h
#endif
#include <windows.h>
#endif
#ifndef _WIN32
#include <OSD_Process.hxx>
#include <NCollection_Array1.hxx>
#include <OSD_Environment.hxx>
#include <OSD_OSDError.hxx>
#include <OSD_Path.hxx>
#include <OSD_Process.hxx>
#include <OSD_WhoAmI.hxx>
#include <Standard_PExtCharacter.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Quantity_Date.hxx>
#include <TCollection_AsciiString.hxx>
#ifdef _WIN32
#include <OSD_WNT.hxx>
#include <lmcons.h> // for UNLEN - maximum user name length GetUserName()
#else
const OSD_WhoAmI Iam = OSD_WProcess;
#include <errno.h>
#include <stdlib.h>
#include <sys/param.h>
#include <sys/time.h>
#include <pwd.h> // For command getpwuid
#include <unistd.h>
#endif
const OSD_WhoAmI Iam = OSD_WProcess;
#if defined(__APPLE__)
#include <mach-o/dyld.h>
#endif
#ifndef _WIN32
#include <errno.h>
#include <stdlib.h>
#include <sys/param.h>
#include <sys/time.h>
#include <pwd.h> // For command getpwuid
#include <unistd.h>
OSD_Process::OSD_Process(){
}
@@ -187,6 +167,23 @@ Standard_Integer OSD_Process::Error()const{
//------------------- WNT Sources of OSD_Path ---------------------------
//------------------------------------------------------------------------
//it is important to undefine NOUSER and enforce including <windows.h> before
//Standard_Macro.hxx defines it and includes <windows.h> causing compilation errors
#ifdef NOUSER
#undef NOUSER /* we need SW_HIDE from windows.h */
#endif
#include <windows.h>
#include <OSD_Process.hxx>
#include <OSD_Path.hxx>
#include <Quantity_Date.hxx>
#include <Standard_PExtCharacter.hxx>
#include <TCollection_ExtendedString.hxx>
#include <OSD_WNT.hxx>
#include <lmcons.h> // for UNLEN - maximum user name length GetUserName()
void _osd_wnt_set_error ( OSD_Error&, OSD_WhoAmI, ... );
// =======================================================================
@@ -357,112 +354,3 @@ Standard_Integer OSD_Process :: Error () const {
} // end OSD_Process :: Error
#endif
// =======================================================================
// function : ExecutablePath
// purpose :
// =======================================================================
TCollection_AsciiString OSD_Process::ExecutablePath()
{
#ifdef _WIN32
wchar_t aBuff[MAX_PATH + 2];
DWORD aLenFilled = GetModuleFileNameW (0, aBuff, MAX_PATH + 1);
aBuff[MAX_PATH + 1] = 0;
if (aLenFilled == 0)
{
return TCollection_AsciiString();
}
else if (aLenFilled <= MAX_PATH)
{
return TCollection_AsciiString (aBuff);
}
// buffer is not large enough (e.g. path uses \\?\ prefix)
wchar_t* aBuffDyn = NULL;
for (int anIter = 2;; ++anIter)
{
size_t aBuffLen = MAX_PATH * anIter;
aBuffDyn = reinterpret_cast<wchar_t*> (realloc (aBuffDyn, sizeof(wchar_t) * (aBuffLen + 1)));
if (aBuffDyn == NULL)
{
return TCollection_AsciiString();
}
aLenFilled = GetModuleFileNameW (NULL, aBuffDyn, DWORD(aBuffLen));
if (aLenFilled != aBuffLen)
{
aBuffDyn[aBuffLen] = L'\0';
TCollection_AsciiString aRes (aBuffDyn);
free (aBuffDyn);
return aRes;
}
}
#elif defined(__APPLE__)
// determine buffer size
uint32_t aNbBytes = 0;
_NSGetExecutablePath (NULL, &aNbBytes);
if (aNbBytes == 0)
{
return TCollection_AsciiString();
}
// retrieve path to executable (probably link)
NCollection_Array1<char> aBuff (0, aNbBytes);
_NSGetExecutablePath (&aBuff.ChangeFirst(), &aNbBytes);
aBuff[aNbBytes] = '\0';
// retrieve real path to executable (resolve links and normalize)
char* aResultBuf = realpath (&aBuff.First(), NULL);
if (aResultBuf == NULL)
{
return TCollection_AsciiString();
}
TCollection_AsciiString aProcessPath (aResultBuf);
free (aResultBuf); // according to man for realpath()
return aProcessPath;
#elif defined(__linux__)
// get info from /proc/PID/exe
TCollection_AsciiString aSimLink = TCollection_AsciiString("/proc/") + TCollection_AsciiString(getpid()) + "/exe";
char aBuff[4096];
ssize_t aBytes = readlink (aSimLink.ToCString(), aBuff, 4096);
if (aBytes > 0)
{
aBuff[aBytes] = '\0';
return TCollection_AsciiString(aBuff);
}
return TCollection_AsciiString();
#else
// not implemented
return TCollection_AsciiString();
#endif
}
// =======================================================================
// function : ExecutableFolder
// purpose :
// =======================================================================
TCollection_AsciiString OSD_Process::ExecutableFolder()
{
TCollection_AsciiString aFullPath = ExecutablePath();
Standard_Integer aLastSplit = -1;
#ifdef _WIN32
const char THE_FILE_SEPARATOR = '\\';
#else
const char THE_FILE_SEPARATOR = '/';
#endif
for (Standard_Integer anIter = 1; anIter <= aFullPath.Length(); ++anIter)
{
if (aFullPath.Value (anIter) == THE_FILE_SEPARATOR)
{
aLastSplit = anIter;
}
}
if (aLastSplit != -1)
{
return aFullPath.SubString (1, aLastSplit);
}
return TCollection_AsciiString();
}

View File

@@ -22,9 +22,10 @@
#include <Standard_Handle.hxx>
#include <OSD_Error.hxx>
#include <TCollection_AsciiString.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
class OSD_OSDError;
class TCollection_AsciiString;
class Quantity_Date;
class OSD_Path;
@@ -36,17 +37,10 @@ class OSD_Path;
//! A set of system process tools
class OSD_Process
{
public:
//! Return full path to the current process executable.
Standard_EXPORT static TCollection_AsciiString ExecutablePath();
//! Return full path to the folder containing current process executable with trailing separator.
Standard_EXPORT static TCollection_AsciiString ExecutableFolder();
public:
DEFINE_STANDARD_ALLOC
//! Initializes the object and prepare for a possible dump
Standard_EXPORT OSD_Process();

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