1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Compare commits

..

7 Commits

Author SHA1 Message Date
nds
87e6cca9a7 Patch of issue #27958 (Visualization, AIS_Trihedron - add Shading display mode) adapted to OCCT 7.1.0
PATCH_TO_OCCT_710 define is used for cases of difference for specific code for 7.1.0 version.
2017-03-10 14:37:58 +03:00
nds
9d2f9eb5c3 Patch of issue #27958 (Visualization, AIS_Trihedron - add Shading display mode) adapted to OCCT 7.1.0
PATCH_TO_OCCT_710 define is used for cases of difference for specific code for 7.1.0 version.
2017-03-10 10:58:29 +03:00
dbv
d057720d07 0028425: Open/save NamedShape changes order of shapes
Changed order of shapes when reading from bin and xml document.

Small correction of test case for issue CR28425
2017-03-09 12:21:28 +03:00
mpv
84eea67f81 0028428: BinMNaming_NamedShapeDriver fails if there are no nodes in NamedShape
Unit test and additional parsing rule for tests are added as well as a minor fix of the draw command for bug24164_2 unit test (in reference array it was impossible to set only one value).

Added the exception for the checking in issue 2269, when bad document is read.

It checks that there is no crash, but just an error message. If crash is appeared, this test will not skipped anyway.

Correction of test for bug2269 and parse.rules

(cherry picked from commit 6d1e872b4d)
2017-03-09 12:02:18 +03:00
nds
9d84c361f5 Fix for issue #0028365: Visualization, AIS_InteractiveContext - apply selection filter in AddOrRemoveSelected at Neutral point 2017-01-19 15:17:41 +03:00
nds
d486ae29c5 Fix for issue #0028365: Visualization, AIS_InteractiveContext - apply selection filter in AddOrRemoveSelected at Neutral point 2017-01-18 15:38:29 +03:00
apl
7c49995584 0028310: Visualization - crash on iteration through detected interactive objects
AIS_InteractiveContext::Remove (anIObj, ...) removes object from sequence of detected owners.
Therefore further iteration on detected will not require updating this list with ::MoveTo().
Additional modification includes incrementing properly the iterator of CurrentDetectedObject
and resets iterator of Highlighted detected objects, because nothing is really highlighted after that.
2017-01-16 18:57:22 +03:00
1029 changed files with 17773 additions and 35692 deletions

View File

@@ -37,11 +37,6 @@ endif()
# the name of the project
project (OCCT)
if (WIN32)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
endif()
# include occt macros
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
@@ -338,17 +333,6 @@ if (WIN32)
set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
endif()
# Enable/Disable the floating point exceptions (FPE) during runtime.
if (NOT BUILD_ENABLE_FPE_SIGNAL_HANDLER)
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER OFF CACHE BOOL "${BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR}" FORCE)
endif()
if (BUILD_ENABLE_FPE_SIGNAL_HANDLER)
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 1)
else()
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 0)
endif()
# include the patched or original list of modules
# list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
# list <OCCT_MODULES> will contain all modules
@@ -599,25 +583,6 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
endif()
# EIGEN
# search for CSF_EIGEN variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
if (CAN_USE_EIGEN)
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
if (USE_EIGEN)
add_definitions (-DHAVE_EIGEN)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EIGEN")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_EIGEN")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EIGEN")
endif()
# Doxygen
if (BUILD_DOC_Overview)
if (NOT DEFINED INSTALL_DOC_Overview)

View File

@@ -360,7 +360,6 @@ n XCAFApp
n XCAFDimTolObjects
n XCAFDoc
n XCAFPrs
n XCAFView
n XSAlgo
n XSControl
n XmlMXCAFDoc

View File

@@ -1,71 +0,0 @@
# eigen
# eigen directory
if (NOT DEFINED 3RDPARTY_EIGEN_DIR)
set (3RDPARTY_EIGEN_DIR "" CACHE PATH "The directory containing eigen")
endif()
# search for eigen in user defined directory
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_EIGEN_DIR OR NOT EXISTS "${3RDPARTY_EIGEN_DIR}")
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" Eigen EIGEN_DIR_NAME)
if (EIGEN_DIR_NAME)
set (3RDPARTY_EIGEN_DIR "${3RDPARTY_DIR}/${EIGEN_DIR_NAME}" CACHE PATH "The directory containing eigen" FORCE)
endif()
endif()
endif()
if (NOT DEFINED 3RDPARTY_EIGEN_INCLUDE_DIR)
set (3RDPARTY_EIGEN_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of the EIGEN")
endif()
if (NOT 3RDPARTY_EIGEN_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_EIGEN_INCLUDE_DIR}")
set (HEADER_NAMES Eigen)
set (3RDPARTY_EIGEN_INCLUDE_DIR "3RDPARTY_EIGEN_INCLUDE_DIR-NOTFOUND" CACHE PATH "the path to Eigen header file" FORCE)
if (3RDPARTY_EIGEN_DIR AND EXISTS "${3RDPARTY_EIGEN_DIR}")
find_path (3RDPARTY_EIGEN_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_EIGEN_DIR}
PATH_SUFFIXES include eigen3 include/eigen3
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_EIGEN_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATH_SUFFIXES include eigen3 include/eigen3
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
# use default (CMake) EIGEN search
if (NOT 3RDPARTY_EIGEN_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_EIGEN_INCLUDE_DIR}")
# use 3RDPARTY_FREETYPE_DIR if it is specified for freetype search
if (3RDPARTY_EIGEN_DIR AND EXISTS "${3RDPARTY_EIGEN_DIR}")
set (CACHED_EIGEN_DIR $ENV{Eigen3_DIR})
set (ENV{Eigen3_DIR} "${3RDPARTY_EIGEN_DIR}")
endif()
find_package(Eigen3 QUIET)
# restore ENV{Eigen3_DIR}
if (3RDPARTY_EIGEN_DIR AND EXISTS "${3RDPARTY_EIGEN_DIR}")
set (ENV{Eigen3_DIR} ${CACHED_EIGEN_DIR})
endif()
if (${EIGEN3_FOUND})
set (3RDPARTY_EIGEN_INCLUDE_DIR "${EIGEN3_INCLUDE_DIR}" CACHE PATH "the path to Eigen header file" FORCE)
set (3RDPARTY_EIGEN_DIR "${EIGEN3_ROOT_DIR}" CACHE PATH "The directory containing eigen" FORCE)
endif()
endif()
endif()
if (3RDPARTY_EIGEN_INCLUDE_DIR AND EXISTS "${3RDPARTY_EIGEN_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_EIGEN_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_EIGEN_INCLUDE_DIR)
set (3RDPARTY_EIGEN_INCLUDE_DIR "" CACHE PATH "the path to Eigen header file" FORCE)
endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET(Eigen3_DIR)

View File

@@ -34,6 +34,7 @@ if (WIN32)
set (CSF_user32 "user32.lib")
set (CSF_wsock32 "wsock32.lib")
set (CSF_psapi "Psapi.lib")
set (CSF_AviLibs "ws2_32.lib vfw32.lib")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
set (CSF_OpenGlLibs "libEGL.lib libGLESv2.lib")
else()

View File

@@ -219,7 +219,7 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if (NOT "${CURRENT_CSF}" STREQUAL "")
# prepare a list from a string with whitespaces
separate_arguments (CURRENT_CSF)
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})

View File

@@ -28,11 +28,6 @@ Applies only for Debug configuration.")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
"Append the postfix to names of output libraries")
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
"Enable/Disable the floating point exceptions (FPE) during DRAW execution only.
Corresponding environment variable (CSF_FPE) can be changed manually
in custom.bat/sh scripts without regeneration by CMake.")
# install variables
set (INSTALL_DIR_DESCR
"The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable),

View File

@@ -140,11 +140,8 @@ proc wokdep:gui:UpdateList {} {
if { "$::HAVE_FREEIMAGE" == "true" } {
wokdep:SearchFreeImage anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_FFMPEG" == "true" } {
wokdep:SearchFFmpeg anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_GL2PS" == "true" } {
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "gl2ps" "gl2ps.h" "gl2ps" {"gl2ps"}
wokdep:SearchGL2PS anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_TBB" == "true" } {
wokdep:SearchTBB anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
@@ -155,18 +152,6 @@ proc wokdep:gui:UpdateList {} {
if { "$::HAVE_VTK" == "true" } {
wokdep:SearchVTK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_ZLIB" == "true" } {
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "zlib" {"zlib"}
}
if { "$::HAVE_LIBLZMA" == "true" } {
set aCheckLib "lzma"
if { "$::tcl_platform(platform)" == "windows" } {
set aCheckLib "liblzma"
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"}
}
if { "$::CHECK_QT4" == "true" } {
wokdep:SearchQt4 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
@@ -417,20 +402,12 @@ if { "$::tcl_platform(platform)" == "windows" } {
checkbutton .myFrame.myChecks.myD3dCheck -offvalue "false" -onvalue "true" -variable HAVE_D3D -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myD3dLbl -text "Use Direct3D"
}
checkbutton .myFrame.myChecks.myFFmpegCheck -offvalue "false" -onvalue "true" -variable HAVE_FFMPEG -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg"
#checkbutton .myFrame.myChecks.myOpenClCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENCL -command wokdep:gui:UpdateList
#ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL"
checkbutton .myFrame.myChecks.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
ttk::label .myFrame.myChecks.myMacGLXLbl -text "Use X11 for windows drawing"
ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK"
checkbutton .myFrame.myChecks.myVtkCheck -offvalue "false" -onvalue "true" -variable HAVE_VTK -command wokdep:gui:UpdateList
checkbutton .myFrame.myChecks.myZLibCheck -offvalue "false" -onvalue "true" -variable HAVE_ZLIB -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myZLibLbl -text "Use zlib"
checkbutton .myFrame.myChecks.myLzmaCheck -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myLzmaLbl -text "Use liblzma"
checkbutton .myFrame.myChecks.myQt4Check -offvalue "false" -onvalue "true" -variable CHECK_QT4 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myQt4Lbl -text "Search Qt4"
checkbutton .myFrame.myChecks.myJDKCheck -offvalue "false" -onvalue "true" -variable CHECK_JDK -command wokdep:gui:UpdateList
@@ -522,35 +499,23 @@ grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(os)" != "Darwin" } {
grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 5 -sticky w
}
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 5 -sticky w
grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 7 -sticky w
#grid .myFrame.myChecks.myOpenClCheck -row $aCheckRowIter -column 6 -sticky e
#grid .myFrame.myChecks.myOpenClLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myZLibCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myZLibLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myGl2psCheck -row $aCheckRowIter -column 8 -sticky e
grid .myFrame.myChecks.myGl2psLbl -row $aCheckRowIter -column 9 -sticky w
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 10 -sticky e
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 11 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myGl2psCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myGl2psLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 5 -sticky w
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 7 -sticky w
}
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 10 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 11 -sticky w
incr aCheckRowIter
if { "$::tcl_platform(os)" == "Darwin" } {
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e

View File

@@ -43,6 +43,16 @@ if { "$tcl_platform(platform)" == "unix" } {
set SHORTCUT_HEADERS "ShortCut"
set HAVE_FREEIMAGE "false"
set HAVE_GL2PS "false"
set HAVE_TBB "false"
set HAVE_D3D "false"
set HAVE_GLES2 "false"
set HAVE_OPENCL "false"
set HAVE_VTK "false"
set MACOSX_USE_GLX "false"
set CHECK_QT4 "false"
set CHECK_JDK "false"
set PRODUCTS_PATH ""
set CSF_OPT_INC [list]
set CSF_OPT_LIB32 [list]
@@ -56,37 +66,51 @@ if { "$tcl_platform(pointerSize)" == "4" } {
if { [info exists ::env(ARCH)] } {
set ARCH "$::env(ARCH)"
}
if { [info exists ::env(VCVER)] } {
set VCVER "$::env(VCVER)"
}
if { [info exists ::env(VCVARS)] } {
set VCVARS "$::env(VCVARS)"
}
if { [info exists ::env(SHORTCUT_HEADERS)] } {
set SHORTCUT_HEADERS "$::env(SHORTCUT_HEADERS)"
if { $SHORTCUT_HEADERS == "true" } {
set SHORTCUT_HEADERS "ShortCut"
}
}
# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_GL2PS HAVE_ZLIB HAVE_LIBLZMA HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX}
foreach anEnvIter $THE_ENV_VARIABLES {
set ${anEnvIter} "false"
if { [info exists ::env(${anEnvIter})] } {
set ${anEnvIter} "$::env(${anEnvIter})"
}
if { [info exists ::env(HAVE_FREEIMAGE)] } {
set HAVE_FREEIMAGE "$::env(HAVE_FREEIMAGE)"
}
# do not export platform-specific variables
if { "$::tcl_platform(os)" == "Darwin" } {
set HAVE_GLES2 ""
} else {
set MACOSX_USE_GLX ""
if { "$tcl_platform(platform)" != "windows" } {
set HAVE_D3D ""
}
if { [info exists ::env(HAVE_GL2PS)] } {
set HAVE_GL2PS "$::env(HAVE_GL2PS)"
}
foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
if { [info exists ::env(${anEnvIter})] } {
set ${anEnvIter} "$::env(${anEnvIter})"
}
if { [info exists ::env(HAVE_TBB)] } {
set HAVE_TBB "$::env(HAVE_TBB)"
}
if { [info exists ::env(HAVE_D3D)] } {
set HAVE_D3D "$::env(HAVE_D3D)"
}
if { [info exists ::env(HAVE_GLES2)] } {
set HAVE_GLES2 "$::env(HAVE_GLES2)"
}
if { [info exists ::env(HAVE_OPENCL)] } {
set HAVE_OPENCL "$::env(HAVE_OPENCL)"
}
if { [info exists ::env(HAVE_VTK)] } {
set HAVE_VTK "$::env(HAVE_VTK)"
}
if { [info exists ::env(MACOSX_USE_GLX)] } {
set MACOSX_USE_GLX "$::env(MACOSX_USE_GLX)"
}
if { [info exists ::env(CHECK_QT4)] } {
set CHECK_QT4 "$::env(CHECK_QT4)"
}
if { [info exists ::env(CHECK_JDK)] } {
set CHECK_JDK "$::env(CHECK_JDK)"
}
if { [info exists ::env(PRODUCTS_PATH)] } {
set PRODUCTS_PATH "$::env(PRODUCTS_PATH)"
}
if { [info exists ::env(CSF_OPT_INC)] } {
set CSF_OPT_INC [split "$::env(CSF_OPT_INC)" $::SYS_PATH_SPLITTER]
}
@@ -228,83 +252,6 @@ proc wokdep:Preferred {theList theCmpl theArch} {
return [lindex [lsort -decreasing $aVeryShortList] 0]
}
# Search library placement
proc wokdep:SearchStandardLibrary {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64 theName theCheckHeader theCheckLib theCheckFolders} {
upvar $theErrInc anErrInc
upvar $theErrLib32 anErrLib32
upvar $theErrLib64 anErrLib64
upvar $theErrBin32 anErrBin32
upvar $theErrBin64 anErrBin64
set isFound "true"
set aHeaderPath [wokdep:SearchHeader "$theCheckHeader"]
if { "$aHeaderPath" == "" } {
set hasHeader false
foreach aFolderIter $theCheckFolders {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" != "" && [file exists "$aPath/include/$theCheckHeader"] } {
lappend ::CSF_OPT_INC "$aPath/include"
set hasHeader true
break
}
}
if { !$hasHeader } {
lappend anErrInc "Error: '$theCheckHeader' not found ($theName)"
set isFound "false"
}
}
foreach anArchIter {64 32} {
set aLibPath [wokdep:SearchLib "$theCheckLib" "$anArchIter"]
if { "$aLibPath" == "" } {
set hasLib false
foreach aFolderIter $theCheckFolders {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$anArchIter" ]
set aLibPath [wokdep:SearchLib "$theCheckLib" "$anArchIter" "$aPath/lib"]
if { "$aLibPath" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
set hasLib true
break
}
}
if { !$hasLib } {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}$theCheckLib.${::SYS_LIB_SUFFIX}' not found ($theName)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter"]
if { "$aDllPath" == "" } {
set hasDll false
foreach aFolderIter $theCheckFolders {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$anArchIter" ]
set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter" "$aPath/bin"]
if { "$aDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
set hasDll true
break
} else {
set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter" "$aPath/lib"]
if { "$aDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
set hasDll true
break
}
}
}
if { !$hasDll } {
lappend anErrBin$anArchIter "Error: '$theCheckLib.dll' not found ($theName)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
}
}
return "$isFound"
}
# Search Tcl/Tk libraries placement
proc wokdep:SearchTclTk {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
@@ -542,8 +489,8 @@ proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theEr
return "$isFound"
}
# Search FFmpeg framework placement
proc wokdep:SearchFFmpeg {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
# Search GL2PS library placement
proc wokdep:SearchGL2PS {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
upvar $theErrLib32 anErrLib32
upvar $theErrLib64 anErrLib64
@@ -551,30 +498,47 @@ proc wokdep:SearchFFmpeg {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBi
upvar $theErrBin64 anErrBin64
set isFound "true"
set aFFmpegHPath [wokdep:SearchHeader "libavutil/avutil.h"]
if { "$aFFmpegHPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{ffmpeg}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" != "" && [file exists "$aPath/include/libavutil/avutil.h"] } {
set aGl2psHPath [wokdep:SearchHeader "gl2ps.h"]
if { "$aGl2psHPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" != "" && [file exists "$aPath/include/gl2ps.h"] } {
lappend ::CSF_OPT_INC "$aPath/include"
} else {
lappend anErrInc "Error: 'libavutil/avutil.h' not found (FFmpeg)"
lappend anErrInc "Error: 'gl2ps.h' not found (GL2PS)"
set isFound "false"
}
}
foreach anArchIter {64 32} {
set aFFmpegLibPath [wokdep:SearchLib "avutil" "$anArchIter"]
if { "$aFFmpegLibPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{ffmpeg}*] "$::VCVER" "$anArchIter" ]
set aFFmpegLibPath [wokdep:SearchLib "avutil" "$anArchIter" "$aPath/lib"]
if { "$aFFmpegLibPath" != "" } {
set aGl2psLibPath [wokdep:SearchLib "gl2ps" "$anArchIter"]
if { "$aGl2psLibPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$anArchIter" ]
set aGl2psLibPath [wokdep:SearchLib "gl2ps" "$anArchIter" "$aPath/lib"]
if { "$aGl2psLibPath" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}avutil.${::SYS_LIB_SUFFIX}' not found (FFmpeg)"
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}gl2ps.${::SYS_LIB_SUFFIX}' not found (GL2PS)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter"]
if { "$aGl2psDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$anArchIter" ]
set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter" "$aPath/bin"]
if { "$aGl2psDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter" "$aPath/lib"]
if { "$aGl2psDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
} else {
lappend anErrBin$anArchIter "Error: 'gl2ps.dll' not found (GL2PS)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
}
}
}
return "$isFound"
@@ -1111,13 +1075,15 @@ proc wokdep:SaveCustom {} {
puts $aFile ""
puts $aFile "rem Optional 3rd-parties switches"
foreach anEnvIter $::THE_ENV_VARIABLES {
set aName ${anEnvIter}
set aValue [set ::${anEnvIter}]
if { "$aValue" != "" } {
puts $aFile "set ${aName}=$aValue"
}
}
puts $aFile "set HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
puts $aFile "set HAVE_GL2PS=$::HAVE_GL2PS"
puts $aFile "set HAVE_TBB=$::HAVE_TBB"
puts $aFile "set HAVE_GLES2=$::HAVE_GLES2"
puts $aFile "set HAVE_D3D=$::HAVE_D3D"
puts $aFile "set HAVE_OPENCL=$::HAVE_OPENCL"
puts $aFile "set HAVE_VTK=$::HAVE_VTK"
puts $aFile "set CHECK_QT4=$::CHECK_QT4"
puts $aFile "set CHECK_JDK=$::CHECK_JDK"
set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
puts $aFile ""
@@ -1160,13 +1126,17 @@ proc wokdep:SaveCustom {} {
puts $aFile ""
puts $aFile "# Optional 3rd-parties switches"
foreach anEnvIter $::THE_ENV_VARIABLES {
set aName ${anEnvIter}
set aValue [set ::${anEnvIter}]
if { "$aValue" != "" } {
puts $aFile "export ${aName}=${aValue}"
}
puts $aFile "export HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
puts $aFile "export HAVE_GL2PS=$::HAVE_GL2PS"
puts $aFile "export HAVE_TBB=$::HAVE_TBB"
puts $aFile "export HAVE_GLES2=$::HAVE_GLES2"
puts $aFile "export HAVE_OPENCL=$::HAVE_OPENCL"
puts $aFile "export HAVE_VTK=$::HAVE_VTK"
if { "$::tcl_platform(os)" == "Darwin" } {
puts $aFile "export MACOSX_USE_GLX=$::MACOSX_USE_GLX"
}
puts $aFile "export CHECK_QT4=$::CHECK_QT4"
puts $aFile "export CHECK_JDK=$::CHECK_JDK"
set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
puts $aFile ""

View File

@@ -816,7 +816,6 @@ proc osutils:collectinc {theModules theIncPath} {
}
}
set allHeaderFiles {}
if { $aCopyType == "shortcut" } {
# template preparation
if { ![file exists $::THE_CASROOT/adm/templates/header.in] } {
@@ -830,12 +829,9 @@ proc osutils:collectinc {theModules theIncPath} {
# create and copy short-cut header files
foreach anUnit $anUnits {
osutils:checksrcfiles ${anUnit}
set aHFiles [_get_used_files ${anUnit} true false]
foreach aHeaderFile ${aHFiles} {
set aHeaderFileName [lindex ${aHeaderFile} 1]
lappend allHeaderFiles "${aHeaderFileName}"
set aHFiles [glob -nocomplain -dir $aCasRoot/src/$anUnit "*.h"]
foreach aHeaderFile [concat [glob -nocomplain -dir $aCasRoot/src/$anUnit "*.\[hgl\]xx"] $aHFiles] {
set aHeaderFileName [file tail $aHeaderFile]
regsub -all -- {@OCCT_HEADER_FILE_CONTENT@} $aHeaderTmpl "#include \"$aFromBuildIncToSrcPath/$anUnit/$aHeaderFileName\"" aShortCutHeaderFileContent
@@ -867,15 +863,12 @@ proc osutils:collectinc {theModules theIncPath} {
} else {
set nbcopied 0
foreach anUnit $anUnits {
osutils:checksrcfiles ${anUnit}
set aHFiles [_get_used_files ${anUnit} true false]
foreach aHeaderFile ${aHFiles} {
set aHeaderFileName [lindex ${aHeaderFile} 1]
lappend allHeaderFiles "${aHeaderFileName}"
set aHFiles [glob -nocomplain -dir $aCasRoot/src/$anUnit "*.h"]
foreach aHeaderFile [concat [glob -nocomplain -dir $aCasRoot/src/$anUnit "*.\[hgl\]xx"] $aHFiles] {
set aHeaderFileName [file tail $aHeaderFile]
# copy file only if target does not exist or is older than original
set torig [file mtime $aCasRoot/src/$anUnit/$aHeaderFileName]
set torig [file mtime $aHeaderFile]
set tcopy 0
if { [file isfile $anIncPath/$aHeaderFileName] } {
set tcopy [file mtime $anIncPath/$aHeaderFileName]
@@ -886,26 +879,17 @@ proc osutils:collectinc {theModules theIncPath} {
if { $tcopy != 0 } {
file delete -force "$theIncPath/$aHeaderFileName"
}
file link -hard $anIncPath/$aHeaderFileName $aCasRoot/src/$anUnit/$aHeaderFileName
file link -hard $anIncPath/$aHeaderFileName $aHeaderFile
} else {
file copy -force $aCasRoot/src/$anUnit/$aHeaderFileName $anIncPath/$aHeaderFileName
file copy -force $aHeaderFile $anIncPath/$aHeaderFileName
}
} elseif { $tcopy != $torig } {
puts "Warning: file $anIncPath/$aHeaderFileName is newer than $aCasRoot/src/$anUnit/$aHeaderFileName, not changed!"
puts "Warning: file $anIncPath/$aHeaderFileName is newer than $aHeaderFile, not changed!"
}
}
}
puts "Info: $nbcopied files updated"
}
# remove header files not listed in FILES
set anIncFiles [glob -tails -nocomplain -dir ${anIncPath} "*"]
foreach anIncFile ${anIncFiles} {
if { [lsearch -exact ${allHeaderFiles} ${anIncFile}] == -1 } {
puts "Warning: file ${anIncPath}/${anIncFile} is not presented in the sources and will be removed from ${theIncPath}!"
file delete -force "${theIncPath}/${anIncFile}"
}
}
}
# Generate header for VS solution file
@@ -1170,7 +1154,7 @@ proc osutils:vcproj:readtemplate {theVcVer isexec} {
set aVerExt "v${aVerExt}0"
set aCmpl32 ""
set aCmpl64 ""
set aCharSet "Unicode"
set aCharSet "MultiByte"
if { $isexec } {
set anExt "${anExt}x"
set what "$what executable"
@@ -1191,6 +1175,7 @@ proc osutils:vcproj:readtemplate {theVcVer isexec} {
}
set aCmpl${bitness} "[set aCmpl${bitness}]${indent}${UwpWinRt}"
}
set aCharSet "Unicode"
}
foreach bitness {32 64} {
@@ -1275,9 +1260,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_FreeImagePlus) "freeimage"
}
}
if { "$::HAVE_FFMPEG" == "true" } {
set aLibsMap(CSF_FFmpeg) "avcodec avformat swscale avutil"
}
if { "$::HAVE_GL2PS" == "true" } {
set aLibsMap(CSF_GL2PS) "gl2ps"
}
@@ -1291,12 +1273,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_VTK) [osutils:vtkCsf "unix"]
}
}
if { "$::HAVE_ZLIB" == "true" } {
set aLibsMap(CSF_ZLIB) "zlib"
}
if { "$::HAVE_LIBLZMA" == "true" } {
set aLibsMap(CSF_LIBLZMA) "liblzma"
}
if { "$theOS" == "wnt" } {
# WinAPI libraries
@@ -1307,6 +1283,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_opengl32) "opengl32"
set aLibsMap(CSF_wsock32) "wsock32"
set aLibsMap(CSF_netapi32) "netapi32"
set aLibsMap(CSF_AviLibs) "ws2_32 vfw32"
set aLibsMap(CSF_OpenGlLibs) "opengl32"
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
@@ -1824,9 +1801,6 @@ proc osutils:tk:files { tkloc thePlatform } {
"n" { set utyp "nocdlpack" }
"x" { set utyp "executable" }
}
if { $utyp == "" } {
puts "Error: '$loc' is undefined within UDLIST"
}
if [array exists map] { unset map }
osutils:tk:loadunit $loc map
#puts " loc = $loc === > [array names map]"
@@ -3064,12 +3038,12 @@ proc osutils:xcdtk { theOutDir theToolKit theGuidsMap theIsStatic thePlatform {t
if { "$thePlatform" == "ios" } {
puts $aPbxprojFile "\t\t\t\t\"ARCHS\[sdk=iphoneos\*\]\" = \"\$(ARCHS_STANDARD)\";";
puts $aPbxprojFile "\t\t\t\t\"ARCHS\[sdk=iphonesimulator\*\]\" = \"x86_64\";";
puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";"
puts $aPbxprojFile "\t\t\t\tCLANG_ENABLE_MODULES = YES;"
puts $aPbxprojFile "\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;"
}
puts $aPbxprojFile "\t\t\t\tARCHS = \"\$(ARCHS_STANDARD_64_BIT)\";"
puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";"
puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";"
puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";"
puts $aPbxprojFile "\t\t\t\tCOPY_PHASE_STRIP = NO;"
puts $aPbxprojFile "\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;"
puts $aPbxprojFile "\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;"
@@ -3107,12 +3081,12 @@ proc osutils:xcdtk { theOutDir theToolKit theGuidsMap theIsStatic thePlatform {t
if { "$thePlatform" == "ios" } {
puts $aPbxprojFile "\t\t\t\t\"ARCHS\[sdk=iphoneos\*\]\" = \"\$(ARCHS_STANDARD)\";";
puts $aPbxprojFile "\t\t\t\t\"ARCHS\[sdk=iphonesimulator\*\]\" = \"x86_64\";";
puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";"
puts $aPbxprojFile "\t\t\t\tCLANG_ENABLE_MODULES = YES;"
puts $aPbxprojFile "\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;"
}
puts $aPbxprojFile "\t\t\t\tARCHS = \"\$(ARCHS_STANDARD_64_BIT)\";"
puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";"
puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";"
puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";"
puts $aPbxprojFile "\t\t\t\tCOPY_PHASE_STRIP = YES;"
puts $aPbxprojFile "\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;"
puts $aPbxprojFile "\t\t\t\tGCC_ENABLE_OBJC_EXCEPTIONS = YES;"
@@ -3350,35 +3324,3 @@ proc osutils:uwp:proj { theVcVer theProjTmpl } {
return ${theProjTmpl}
}
# Report all files found in package directory but not listed in FILES
proc osutils:checksrcfiles { theUnit } {
global path
set aCasRoot [file normalize ${path}]
if {![file isdirectory ${aCasRoot}]} {
puts "OCCT directory is not defined correctly: ${aCasRoot}"
return
}
set anUnitAbsPath [file normalize "${aCasRoot}/src/${theUnit}"]
if {[file exists "${anUnitAbsPath}/FILES"]} {
set aFilesFile [open "${anUnitAbsPath}/FILES" rb]
set aFilesFileList [split [read ${aFilesFile}] "\n"]
close ${aFilesFile}
set aFilesFileList [lsearch -inline -all -not -exact ${aFilesFileList} ""]
# report all files not listed in FILES
set anAllFiles [glob -tails -nocomplain -dir ${anUnitAbsPath} "*"]
foreach aFile ${anAllFiles} {
if { "${aFile}" == "FILES" } {
continue
}
if { [lsearch -exact ${aFilesFileList} ${aFile}] == -1 } {
puts "Warning: file ${anUnitAbsPath}/${aFile} is not listed in ${anUnitAbsPath}/FILES!"
}
}
}
}

View File

@@ -1,8 +0,0 @@
# A toolchain file to configure a Makefile Generators or the Ninja generator to target Android for cross-compiling.
# Set CMAKE_ANDROID_NDK variable equal to your Android NDK path.
set (CMAKE_SYSTEM_NAME Android)
set (CMAKE_SYSTEM_VERSION 15) # API level
set (CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
set (CMAKE_ANDROID_NDK "")
set (CMAKE_ANDROID_STL_TYPE gnustl_shared)

View File

@@ -2,9 +2,6 @@ echo off
if /I "%VCVER%" == "@COMPILER@" (
if "%ARCH%" == "@COMPILER_BITNESS@" (
rem set environment variables used by OCCT
set CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
set "TK_DIR=@3RDPARTY_TK_DLL_DIR@"
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"

View File

@@ -2,9 +2,6 @@
if [ "$1" == "@BIN_LETTER@" ]; then
if [ "$2" == "@COMPILER_BITNESS@" ]; then
# set environment variables used by OCCT
export CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
export TCL_DIR="@3RDPARTY_TCL_LIBRARY_DIR@"
export TK_DIR="@3RDPARTY_TK_LIBRARY_DIR@"
export FREETYPE_DIR="@3RDPARTY_FREETYPE_LIBRARY_DIR@"

View File

@@ -4,9 +4,6 @@ rem CASDEB comes as third argument
if /I "%VCVER%" == "@COMPILER@" (
if "%ARCH%" == "@COMPILER_BITNESS@" (
rem set environment variables used by OCCT
set CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
set "TCL_DIR=@USED_3RDPARTY_TCL_DIR@"
set "TK_DIR=@USED_3RDPARTY_TK_DIR@"
set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"

View File

@@ -2,9 +2,6 @@
if [ "$1" == "@BIN_LETTER@" ]; then
if [ "$2" == "@COMPILER_BITNESS@" ]; then
# set environment variables used by OCCT
export CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
export TCL_DIR="@USED_3RDPARTY_TCL_DIR@"
export TK_DIR="@USED_3RDPARTY_TK_DIR@"
export FREETYPE_DIR="@USED_3RDPARTY_FREETYPE_DIR@"

View File

@@ -18,13 +18,10 @@ set "VCVARS="
set "HAVE_TBB=false"
set "HAVE_OPENCL=false"
set "HAVE_FREEIMAGE=false"
set "HAVE_FFMPEG=false"
set "HAVE_GL2PS=false"
set "HAVE_VTK=false"
set "HAVE_GLES2=false"
set "HAVE_D3D=false"
set "HAVE_ZLIB=false"
set "HAVE_LIBLZMA=false"
set "CSF_OPT_INC="
set "CSF_OPT_LIB32="
set "CSF_OPT_LIB64="
@@ -61,16 +58,20 @@ set "CSF_OPT_BIN64I=%CSF_OPT_BIN64%"
rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
set "CSF_OPT_CMPL="
set "PRODUCTS_DEFINES="
if ["%HAVE_TBB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TBB" & set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENCL" & set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
if ["%HAVE_GL2PS%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS" & set "CSF_DEFINES=HAVE_GL2PS;%CSF_DEFINES%"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
if ["%HAVE_FFMPEG%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FFMPEG" & set "CSF_DEFINES=HAVE_FFMPEG;%CSF_DEFINES%"
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK" & set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2" & set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D" & set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
if ["%HAVE_TBB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TBB"
if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENCL"
if ["%HAVE_GL2PS%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE"
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK"
if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2"
if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D"
if ["%HAVE_TBB%"] == ["true"] set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
if ["%HAVE_OPENCL%"] == ["true"] set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
if ["%HAVE_GL2PS%"] == ["true"] set "CSF_DEFINES=HAVE_GL2PS;%CSF_DEFINES%"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
if ["%HAVE_VTK%"] == ["true"] set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
if ["%HAVE_GLES2%"] == ["true"] set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
if ["%HAVE_D3D%"] == ["true"] set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
rem Eliminate VS warning
if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"

View File

@@ -10,12 +10,9 @@ export TARGET="";
export HAVE_TBB="false";
export HAVE_OPENCL="false";
export HAVE_FREEIMAGE="false";
export HAVE_FFMPEG="false";
export HAVE_GL2PS="false";
export HAVE_VTK="false";
export HAVE_GLES2="false";
export HAVE_ZLIB="false";
export HAVE_LIBLZMA="false";
export MACOSX_USE_GLX="false";
export CSF_OPT_INC=""
export CSF_OPT_LIB32=""
@@ -94,17 +91,28 @@ fi
export CSF_OPT_CMPL=""
# Optiona 3rd-parties should be enabled by HAVE macros
if [ "$HAVE_TBB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"; fi
if [ "$HAVE_OPENCL" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"; fi
if [ "$HAVE_FREEIMAGE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"; fi
if [ "$HAVE_FFMPEG" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FFMPEG"; fi
if [ "$HAVE_GL2PS" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"; fi
if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"; fi
if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
if [ "$HAVE_TBB" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"
fi
if [ "$HAVE_OPENCL" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"
fi
if [ "$HAVE_FREEIMAGE" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"
fi
if [ "$HAVE_GL2PS" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"
fi
if [ "$HAVE_GLES2" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"
fi
if [ "$HAVE_VTK" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"
fi
# Option to compile OCCT with X11 libs on Mac OS X
if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi
if [ "$MACOSX_USE_GLX" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"
fi
# To split string into array
aDelimBack=$IFS

View File

@@ -110,7 +110,7 @@
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>__TKDEP__;ws2_32.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\..\..\..\win32\__VCVER__\bin\__TKNAM__.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\lib;$(CSF_OPT_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -158,7 +158,7 @@
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>__TKDEP__;ws2_32.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\..\..\..\win32\__VCVER__\bind\__TKNAM__.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\libd;$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -205,7 +205,7 @@
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>__TKDEP__;ws2_32.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\..\..\..\win64\__VCVER__\bin\__TKNAM__.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\lib;$(CSF_OPT_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -253,7 +253,7 @@
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>__TKDEP__;ws2_32.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\..\..\..\win64\__VCVER__\bind\__TKNAM__.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\libd;$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

View File

@@ -36,7 +36,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
OutputFile=".\..\..\..\win32\vc7\bin\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -105,7 +105,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
OutputFile=".\..\..\..\win32\vc7\bind\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"

View File

@@ -78,7 +78,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
OutputFile=".\..\..\..\win32\vc8\bin\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
@@ -178,7 +178,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
OutputFile=".\..\..\..\win32\vc8\bind\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
@@ -276,7 +276,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
OutputFile=".\..\..\..\win64\vc8\bin\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
@@ -376,7 +376,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
OutputFile=".\..\..\..\win64\vc8\bind\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="true"

View File

@@ -79,7 +79,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ ws2_32.lib"
AdditionalDependencies="__TKDEP__ ws2_32.lib vfw32.lib"
OutputFile=".\..\..\..\win32\vc9\bin\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
@@ -178,7 +178,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ ws2_32.lib"
AdditionalDependencies="__TKDEP__ ws2_32.lib vfw32.lib"
OutputFile=".\..\..\..\win32\vc9\bind\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
@@ -272,7 +272,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ ws2_32.lib"
AdditionalDependencies="__TKDEP__ ws2_32.lib vfw32.lib"
OutputFile=".\..\..\..\win64\vc9\bin\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
@@ -368,7 +368,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="__TKDEP__ ws2_32.lib"
AdditionalDependencies="__TKDEP__ ws2_32.lib vfw32.lib"
OutputFile=".\..\..\..\win64\vc9\bind\__TKNAM__.dll"
LinkIncremental="1"
SuppressStartupBanner="true"

View File

@@ -10,40 +10,32 @@ The steps on Windows and Ubuntu are similar. There is the only one difference: m
on Windows and native GNU make on Ubuntu.
Required tools (download and install if it is required):
- CMake v3.7+ http://www.cmake.org/cmake/resources/software.html
- CMake v3.0+ http://www.cmake.org/cmake/resources/software.html
- Cross-compilation toolchain for CMake https://github.com/taka-no-me/android-cmake
- Android NDK rev.10+ https://developer.android.com/tools/sdk/ndk/index.html
- GNU Make: MinGW v4.82+ for Windows (http://sourceforge.net/projects/mingw/files/), GNU Make 4.0 for Ubuntu.
## Prerequisites
In toolchain file <i>$CASROOT/adm/templates/android.toolchain.config.cmake</i>:
- Set CMAKE_ANDROID_NDK variable equal to your Android NDK path.
- Set CMAKE_ANDROID_STL_TYPE variable to specify which C++ standard library to use.
The default value of CMAKE_ANDROID_STL_TYPE is <i>gnustl_shared</i> (GNU libstdc++ Shared)
@figure{/dev_guides/building/android/images/android_image001.png}
## Generation of makefiles using CMake GUI tool
## Generation of makefiles
Run GUI tool provided by CMake: cmake-gui
### Tools configuration
- Specify the root folder of OCCT (<i>$CASROOT</i>, which contains *CMakelists.txt* file) by clicking **Browse Source**.
- Specify the location (build folder) for Cmake generated project files by clicking **Browse Build**.
@figure{/dev_guides/building/android/images/android_image002.png}
@figure{/dev_guides/building/android/images/android_image001.png}
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
Select "MinGW Makefiles" item from the list
Select "MinGW MakeFiles" item from the list
- Choose "Specify toolchain file for cross-compiling"
- Click "Next"
@figure{/dev_guides/building/android/images/android_image002.png}
- Specify a toolchain file at the next dialog by android.toolchain.cmake . It is contained by cross-compilation toolchain for CMake
- Click "Finish"
@figure{/dev_guides/building/android/images/android_image003.png}
- Specify a toolchain file at the next dialog by <i>android.toolchain.config.cmake</i> . It is contained by cross-compilation toolchain for CMake
- Click "Finish"
If ANDROID_NDK environment variable is not defined in current OS, add cache entry ANDROID_NDK (entry type is PATH) -- path to the NDK folder ("Add Entry" button)
@figure{/dev_guides/building/android/images/android_image004.png}
If on Windows the message is appeared: "CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles"
@@ -54,19 +46,18 @@ specify **CMAKE_MAKE_PROGRAM** to mingw32-make executable.
### OCCT Configuration
How to configure OCCT, see "OCCT Configuration" section of @ref occt_dev_guides__building_cmake "Building with CMake"
taking into account the specific configuration variables for android:
- ANDROID_ABI = armeabi-v7a
- ANDROID_NATIVE_API_LEVEL = 15
- ANDROID_NDK_LAYOUT is equal to CMAKE_BUILD_TYPE variable
- **BUILD_MODULE_Draw = OFF**
@figure{/dev_guides/building/android/images/android_image006.png}
### Generation of makefiles
Click **Generate** button and wait until the generation process is finished.
Then makefiles will appear in the build folder (e.g. <i> D:/occt/build-android </i>).
## Generation of makefiles using CMake from the command line
Alternatively one may specify the values without a toolchain file:
> cmake -G "MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=D:/DevTools/android-ndk-r13b -DCMAKE_ANDROID_STL_TYPE=gnustl_shared -DCMAKE_SYSTEM_VERSION=15 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_MAKE_PROGRAM=D:/DevTools/MinGW/bin/mingw32-make.exe -D3RDPARTY_DIR=D:/occt-3rdparty D:/occt
@figure{/dev_guides/building/android/images/android_image006.png}
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
## Building makefiles of OCCT

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -60,9 +60,7 @@ Once the source and build directories are selected, "Configure" button should be
@figure{/dev_guides/building/cmake/images/cmake_image002.png}
To build OCCT for **Universal Windows Platform (UWP)** specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
Alternatively, if you are using CMake from the command line add options -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 .
To build OCCT for Universal Windows Platform (UWP) specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
**Note**: Universal Windows Platform (UWP) is supported only on "Visual Studio 14 2015". File <i>d:/occt/samples/xaml/ReadMe.md</i> describes the building procedure of XAML (UWP) sample.
@@ -100,7 +98,6 @@ The following table gives the full list of environment variables used at the con
| BUILD_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this option leads to automatic search of Doxygen binaries. Its building calls Doxygen command to generate the documentation in HTML format |
| BUILD_PATCH | Path | Points to the directory recognized as a "patch" for OCCT. If specified, the files from this directory take precedence over the corresponding native OCCT sources. This way you are able to introduce patches to Open CASCADE Technology not affecting the original source distribution |
| BUILD_WITH_DEBUG | Boolean flag | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean flag | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |

View File

@@ -715,24 +715,11 @@ Possible options are:
* 1 -- outputs only differences;
* 2 -- additionally outputs the list of logs and directories present in one of directories only;
* 3 -- (by default) additionally outputs progress messages;
* <i>-image [filename]</i> - compare images and save the resulting log in specified file (<i>$dir1/diffimage-$dir2.log</i> by default)
* <i>-cpu [filename]</i> - compare overall CPU and save the resulting log in specified file (<i>$dir1/diffcpu-$dir2.log</i> by default)
* <i>-memory [filename]</i> - compare memory delta and save the resulting log in specified file (<i>$dir1/diffmemory-$dir2.log</i> by default)
* <i>-highlight_percent \<value\></i> - highlight considerable (>value in %) deviations of CPU and memory (default value is 5%)
Example:
~~~~~
Draw[]> testdiff results/CR12345-2012-10-10T08:00 results/master-2012-10-09T21:20
~~~~~
Particular tests can generate additional data that need to be compared by *testdiff* command.
For that, for each parameter to be controlled, the test should produce the line containing keyword "COUNTER* followed by arbitrary name of the parameter, then colon and numeric value of the parameter.
Example of test code:
~~~~~
puts "COUNTER Memory heap usage at step 5: [meminfo h]"
Draw[]> testdiff results-CR12345-2012-10-10T08:00 results-master-2012-10-09T21:20
~~~~~
@section testmanual_5 APPENDIX

View File

@@ -950,11 +950,6 @@ The related classes, e.g. *AIS_LocalContext*, and methods ( <i>AIS_InteractiveCo
The main functionality provided by Local Context - selection of object subparts - can be now used within Neutral Point without opening any Local Context.
The property *::SelectionMode()* has been removed from the class *AIS_InteractiveObject*.
This property contradicts to selection logic, since it is allowed to activate several Selection modes at once.
Therefore keeping one selection mode as object field makes no sense.
Applications that used this method should implement selection mode caching at application level, if it is necessary for some reason.
@subsection upgrade_occt700_separate_caf_visualisation Separation of visualization part from TKCAF
Visualization CAF attributes have been moved into a new toolkit *TKVCAF*.
@@ -988,13 +983,6 @@ Textured objects now have the priority over the environment mapping.
Redundant enumerations *V3d_TypeOfSurface* and *Graphic3d_TypeOfSurface*, class *OpenGl_SurfaceDetailState*, the corresponding methods from *Graphic3d_CView, OpenGl_ShaderManager, OpenGl_View, V3d_View* and *V3d_Viewer* have been deleted.
Draw command *VSetTextureMode* has been deleted.
@subsection upgrade_occt700_wfshape Shape presentation builders
Presentation tools for building Wireframe presentation have been refactored to eliminate duplicated code and interfaces.
Therefore, the following classes have been modified:
* *StdPrs_WFDeflectionShape* and *Prs3d_WFShape* have been removed. *StdPrs_WFShape* should be used instead.
* *StdPrs_ToolShadedShape* has been renamed to *StdPrs_ToolTriangulatedShape*.
@section upgrade_occt710 Upgrade to OCCT 7.1.0
@subsection upgrade_710_aspects Presentation attributes
@@ -1115,97 +1103,3 @@ The following classes have been changed:
* The last optional argument *RemoveInvalidFaces* has been removed from the constructor of class *BRepOffset_MakeOffset* and method *Initialize*.
* The public method *BOPDS_DS::VerticesOnIn* has been renamed into *SubShapesOnIn* and the new output parameter *theCommonPB* has been added.
@section upgrade_occt720 Upgrade to OCCT 7.2.0
@subsection upgrade_720_removed Removed features
The following obsolete features have been removed:
* *AIS_InteractiveContext::PreSelectionColor()*, *::DefaultColor()*, *::WasCurrentTouched()*, *::ZDetection()*.
These properties were unused, and therefore application should remove occurrences of these methods.
* *AIS_InteractiveObject::SelectionPriority()*.
These property was not implemented.
@subsection upgrade_occt720_correction_of_Offset_API Corrections in BRepOffset API
Class *BRepOffsetAPI_MakeOffsetShape*:
* *BRepOffsetAPI_MakeOffsetShape::BRepOffsetAPI_MakeOffsetShape()* - constructor with parameters has been deleted.
* *BRepOffsetAPI_MakeOffsetShape::PerformByJoin()* - method has been added. This method is old algorithm behaviour.
The code below shows new calling procedure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
BRepOffsetAPI_MakeOffsetShape OffsetMaker;
OffsetMaker.PerformByJoin(Shape, OffsetValue, Tolerance);
NewShape = OffsetMaker.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Class *BRepOffsetAPI_MakeThickSolid*:
* *BRepOffsetAPI_MakeThickSolid::BRepOffsetAPI_MakeThickSolid()* - constructor with parameters has been deleted.
* *BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin()* - method has been added. This method is old algorithm behaviour.
The code below shows new calling procedure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
BRepOffsetAPI_MakeThickSolid BodyMaker;
BodyMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = BodyMaker.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@subsection upgrade_720_highlight Highlight style
Management of highlight attributes has been revised and might require modifications from application side:
* New class *Graphic3d_PresentationAttributes* defining basic presentation attributes has been introduced.
It's definition includes properties previously defined by class Graphic3d_HighlightStyle (*Color*, *Transparency*),
and new properties (*Display mode*, *ZLayer*, optional *FillArea aspect*).
* Class *Prs3d_Drawer* now inherits class *Graphic3d_PresentationAttributes*.
So that overall presentation attributes are now split into two parts - Basic attributes and Detailed attributes.
* Class *Graphic3d_HighlightStyle* has been dropped.
It is now defined as a typedef to *Prs3d_Drawer*.
Therefore, highlight style now also includes not only Basic presentation attributes, but also Detailed attributes
which can be used by custom presentation builders.
* Highlighting style defined by class *Graphic3d_PresentationAttributes* now provides more options:
- *Graphic3d_PresentationAttributes::BasicFillAreaAspect()* property providing complete Material definition.
This option, when defined, can be used instead of the pair Object Material + Highlight Color.
- *Graphic3d_PresentationAttributes::ZLayer()* property specifying the Layer where highlighted presentation should be shown.
This property can be set to Graphic3d_ZLayerId_UNKNOWN, which means that ZLayer of main presentation should be used instead.
- *Graphic3d_PresentationAttributes::DisplayMode()* property specifying Display Mode for highlight presentation.
* Since Highlight and Selection styles within *AIS_InteractiveContext* are now defined by *Prs3d_Drawer* inheriting from *Graphic3d_PresentationAttributes*,
it is now possible to customize default highlight attributes like *Display Mode* and *ZLayer*, which previously could be defined only on Object level.
* Properties *Prs3d_Drawer::HighlightStyle()* and *Prs3d_Drawer::SelectionStyle()* have been removed.
Instead, *AIS_InteractiveObject* now defines *::DynamicHilightAttributes()* for dynamic highlighting in addition to *::HilightAttributes()* used for highlighting in selected state.
* The following protected fields have been removed from class *AIS_InteractiveObject*:
- *myOwnColor*, replaced by *myDrawer->Color()*
- *myTransparency*, replaced by *myDrawer->Transparency()*
- *myZLayer*, replaced by *myDrawer->ZLayer()*
* The method *PrsMgr_PresentationManager::Unhighlight()* taking Display Mode as an argument has been marked deprecated.
Implementation now performs unhighlighting of all highlighted presentation mode.
@subsection upgrade_720_implicit_viewer_update Elimination of implicit 3D Viewer updates
Most AIS_InteractiveContext methods are defined with a flag to update viewer immediatly or not.
Within previous version of OCCT, this argument had default value TRUE.
While immediate viewer updates are useful for beginners (the result is displayed as soon as possible),
this approach is inefficent for batch viewer updates, and having default value as TRUE
leaded to non-intended accidential updates which are difficult to find.
To avoid such issues, the interface has been modified and default value has been removed.
Therefore, old application code should be updated to set the flag theToUpdateViewer explicitly
to desired value (TRUE to preserve old previous behavior), if it was not already set.
The follow AIS_InteractiveContext methods have been changed:
Display, Erase, EraseAll, DisplayAll, EraseSelected, DisplaySelected, ClearPrs, Remove, RemoveAll, Hilight,
HilightWithColor, Unhilight, Redisplay, RecomputePrsOnly, Update, SetDisplayMode, UnsetDisplayMode, SetColor,
UnsetColor, SetWidth, UnsetWidth, SetMaterial, UnsetMaterial, SetTransparency, UnsetTransparency,
SetLocalAttributes, UnsetLocalAttributes, SetPolygonOffsets, SetTrihedronSize, SetPlaneSize, SetPlaneSize,
SetDeviationCoefficient, SetDeviationAngle, SetAngleAndDeviation, SetHLRDeviationCoefficient,
SetHLRDeviationAngle, SetHLRAngleAndDeviation, SetSelectedAspect, MoveTo, Select, ShiftSelect, SetSelected,
UpdateSelected, AddOrRemoveSelected, HilightSelected, UnhilightSelected, ClearSelected, ResetOriginalState,
SubIntensityOn, SubIntensityOff, FitSelected, EraseGlobal, ClearGlobal, ClearGlobalPrs.
@subsection upgrade_720_Result_Of_BOP_On_Containers Result of Boolean operations on containers
* The result of Boolean operations on arguments of collection types (WIRE/SHELL/COMPSOLID) is now filtered from duplicating containers.
@subsection upgrade_720_changes_methods Other changes
* Class GeomPlate_BuildPlateSurface accepts base class Adaptor3d_HCurve (instead of inherited Adaptor3d_HCurveOnSurface accepted earlier).
* Types GeomPlate_Array1OfHCurveOnSurface and GeomPlate_HArray1OfHCurveOnSurface have been replaced with GeomPlate_Array1OfHCurve and GeomPlate_HArray1OfHCurve correspondingly (accept base class Adaptor3d_HCurve instead of Adaptor3d_HCurveOnSurface).

View File

@@ -484,12 +484,10 @@ The collection for shapes can be found in the *TopTools* package. As *BRepOffset
facesToRemove.Append(faceToRemove);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All the necessary data are now available so you can create your hollowed solid by calling the *BRepOffsetAPI_MakeThickSolid* MakeThickSolidByJoin method:
All the necessary data are now available so you can create your hollowed solid by calling the *BRepOffsetAPI_MakeThickSolid* constructor:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
BRepOffsetAPI_MakeThickSolid BodyMaker;
BodyMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = BodyMaker.Shape();
MyBody = BRepOffsetAPI_MakeThickSolid(myBody, facesToRemove, -myThickness / 50, 1.e-3);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -814,9 +812,7 @@ Complete definition of MakeBottle function (defined in the file src/MakeBottle.c
TopTools_ListOfShape facesToRemove;
facesToRemove.Append(faceToRemove);
BRepOffsetAPI_MakeThickSolid BodyMaker;
BodyMaker.MakeThickSolidByJoin(myBody, facesToRemove, -myThickness / 50, 1.e-3);
myBody = BodyMaker.Shape();
myBody = BRepOffsetAPI_MakeThickSolid(myBody, facesToRemove, -myThickness / 50, 1.e-3);
// Threading : Create Surfaces
Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);

View File

@@ -1080,11 +1080,9 @@ The input data for this step is a *BOPAlgo_Builder* object after building result
* The result of the operation *Cut12* for arguments *S1* and *S2* contains the parts of argument *S1* that have state **OUT** relative to the opposite argument *S2*.
* The result of the operation *Cut21* for arguments *S1* and *S2* contains the parts of argument *S2* that have state **OUT** relative to the opposite argument *S1*.
* For the arguments of collection type (WIRE, SHELL, COMPSOLID) the type will be passed in the result. For example, the result of Common operation between Shell and Wire will be a compound containing Wire.
* For the arguments of collection type (WIRE, SHELL, COMPSOLID) containing overlapping parts the overlapping parts passed into result will be repeated for each container from the input shapes containing such parts. The containers completely included in other containers will be avoided in the result.
* For the arguments of collection type (WIRE, SHELL, COMPSOLID) the containers included into result will have the same orientation as the original containers from arguments. In case of duplication its orientation will be defined by the orientation of the first container in arguments. Each container included into result will have coherent orientation of its sub-shapes.
* The result of the operation Fuse for the arguments of collection type (WIRE, SHELL) will consist of the shapes of the same collection type. The overlapping parts (EDGES/FACES) will be shared among containers, but duplicating containers will be avoided in the result. For example, the result of Fuse operation between two fully coinciding wires will be one wire, but the result of Fuse operation between two partially coinciding wires will be two wires sharing coinciding edges.
* The result of the operation Fuse for the arguments of type COMPSOLID will consist of the compound containing COMPSOLIDs created from connexity blocks of fused solids.
* The result of the operation Common for the arguments of collection type (WIRE, SHELL, COMPSOLID) will consist of the unique containers containing the overlapping parts. For example, the result of Common operation between two fully overlapping wires will be one wire containing all splits of edges. The number of wires in the result of Common operation between two partially overlapping wires will be equal to the number of connexity blocks of overlapping edges.
* For the arguments of collection type (WIRE, SHELL, COMPSOLID) containing overlapping parts the overlapping parts passed into result will be repeated for each container from the input shapes containing such parts.
* The result of the operation Fuse for the arguments of collection type (WIRE, SHELL, COMPSOLID) will contain the same number of containers as the arguments. The overlapping parts (EDGES/FACES/SOLIDS) will be shared among them. For example, the result of Fuse operation between two wires will be two wires sharing coinciding edges if any.
* The result of the operation Common for the arguments of collection type (WIRE, SHELL, COMPSOLID) will consist of the containers containing the same overlapping parts. For example, the result of Common operation between two fully/partially overlapping wires will be two wires containing the same edges.
@subsection occt_algorithms_9_4 Examples
@@ -1557,7 +1555,7 @@ Let us consider two Wires that have overlapping edges, *W1* is the object and *W
@figure{/user_guides/boolean_operations/images/boolean_image140.png}
* The result of *Common* operation is a compound containing one Wire consisting of an overlapping edge. The new Wire is created from the objects:
* The result of *Common* operation is a compound containing two Wires both consisting of an overlapping edge. The new Wires are created from the objects:
@figure{/user_guides/boolean_operations/images/boolean_image141.png}
@@ -1864,81 +1862,7 @@ Some aspects of building the result are described in the next paragraph
| :---- | :---- | :------ |
| 1 | Build the result of the operation using all information contained in *FaceInfo*, Common Block, Shared entities of the arguments, etc. | *BOPAlgo_Section:: BuildSection()* |
@section occt_algorithms_10b Volume Maker Algorithm
The Volume Maker algorithm has been designed for building the elementary volumes (solids) from a set of connected, intersecting, or nested shapes. The algorithm can also be useful for splitting solids into parts, or constructing new solid(s) from set of intersecting or connected faces or shells.
The algorithm creates only closed solids. In general case the result solids are non-manifold: fragments of the input shapes (wires, faces) located inside the solids are added as internal sub-shapes to these solids.
But the algorithm allows preventing the addition of the internal for solids parts into result. In this case the result solids will be manifold and not contain any internal parts. However, this option does not prevent from the occurrence of the internal edges or vertices in the faces.<br>
Non-closed faces, free wires etc. located outside of any solid are always excluded from the result.
The Volume Maker algorithm is implemented in the class BOPAlgo_MakerVolume. It is based on the General Fuse (GF) algorithm. All the options of the GF algorithm such as possibility to run algorithm in parallel mode, fuzzy option, safe mode, glue options and history support are also available in this algorithm.
The requirements for the arguments are the same as for the arguments of GF algorithm - they could be of any type, but each argument should be valid and not self-interfered.
The algorithm allows disabling the calculation of intersections among the arguments. In this case the algorithm will run much faster, but the user should guarantee that the arguments do not interfere with each other, otherwise the result will be invalid (e.g. contain unexpected parts) or empty.
This option is useful e.g. for building a solid from the faces of one shell or from the shapes that have already been intersected.
@subsection occt_algorithms_10b_1 Usage
#### C++ Level
The usage of the algorithm on the API level:
~~~~
BOPAlgo_MakerVolume aMV;
BOPCol_ListOfShape aLS = …; // arguments
Standard_Boolean bRunParallel = Standard_False; /* parallel or single mode (the default value is FALSE)*/
Standard_Boolean bIntersect = Standard_True; /* intersect or not the arguments (the default value is TRUE)*/
Standard_Real aTol = 0.0; /* fuzzy option (default value is 0)*/
Standard_Boolean bSafeMode = Standard_False; /* protect or not the arguments from modification*/
BOPAlgo_Glue aGlue = BOPAlgo_GlueOff; /* Glue option to speed up intersection of the arguments*/
Standard_Boolean bAvoidInternalShapes = Standard_False; /* Avoid or not the internal for solids shapes in the result*/
//
aMV.SetArguments(aLS);
aMV.SetRunParallel(bRunParallel);
aMV.SetIntersect(bIntersect);
aMV.SetFuzzyValue(aTol);
aMV.SetNonDestructive(bSafeMode);
aMV.SetGlue(aGlue);
aMV.SetAvoidInternalShapes(bAvoidInternalShapes);
//
aMV.Perform(); //perform the operation
if (aMV.ErrorStatus()) { //check error status
return;
}
//
const TopoDS_Shape& aResult = aMV.Shape(); // result of the operation
~~~~
#### Tcl Level
To use the algorithm in Draw the command mkvolume has been implemented. The usage of this command is following:
~~~~
Usage: mkvolume r b1 b2 ... [-c] [-ni] [-ai]
Options:
-c - use this option to have input compounds considered as set of separate arguments (allows passing multiple arguments as one compound);
-ni - use this option to disable the intersection of the arguments;
-ai - use this option to avoid internal for solids shapes in the result.
~~~~
@subsection occt_algorithms_10b_2 Examples
#### Example 1
Creation of 9832 solids from sphere and set of 63 planes:
<table align="center">
<tr>
<td>@figure{/user_guides/boolean_operations/images/mkvolume_image001.png, "Arguments"}</td>
<td>@figure{/user_guides/boolean_operations/images/mkvolume_image002.png, "Results"}</td>
</tr>
</table>
#### Example 2
Creating compartments on a ship defined by hull shell and a set of planes. The ship is divided on compartments by five transverse bulkheads and a deck six compartments are created:
<table align="center">
<tr>
<td>@figure{/user_guides/boolean_operations/images/mkvolume_image003.png, "Arguments"}</td>
<td>@figure{/user_guides/boolean_operations/images/mkvolume_image004.png, "Results"}</td>
</tr>
</table>
@section occt_algorithms_10 Algorithm Limitations
@@ -2176,10 +2100,10 @@ With the Fuzzy option it is possible to get the expected result -- it is just ne
Fuzzy option is included in interface of Intersection Part (class *BOPAlgo_PaveFiller*) and application programming interface (class *BRepAlgoAPI_BooleanOperation*)
@subsubsection occt_algorithms_11a_1_1 Examples
@subsection occt_algorithms_11a_2 Examples
The following examples demonstrate the advantages of usage Fuzzy option operations over the Basic Operations in typical situations.
#### Case 1
@subsubsection occt_algorithms_11a_1_1 Case 1
In this example the cylinder (shown in yellow and transparent) is subtracted from the box (shown in red). The cylinder is shifted by 5e<sup>-5</sup> relatively to the box along its axis (the distance between rear faces of the box and cylinder is 5e<sup>-5</sup>).
@@ -2193,7 +2117,7 @@ The following results are obtained using Basic Operations and the Fuzzy ones wit
In this example Fuzzy option allows eliminating a very thin part of the result shape produced by Basic algorithm due to misalignment of rear faces of the box and the cylinder.
#### Case 2
@subsubsection occt_algorithms_11a_1_2 Case 2
In this example two boxes are fused. One of them has dimensions 10*10*10, and the other is 10*10.000001*10.000001 and adjacent to the first one. There is no gap in this case as the surfaces of the neighboring faces coincide, but one box is slightly greater than the other.
@@ -2207,7 +2131,7 @@ The following results are obtained using Basic Operations and the Fuzzy ones wit
In this example Fuzzy option allows eliminating an extremely narrow face in the result produced by Basic operation.
#### Case 3
@subsubsection occt_algorithms_11a_1_3 Case 3
In this example the small planar face (shown in orange) is subtracted from the big one (shown in yellow). There is a gap 1e<sup>-5</sup> between the edges of these faces.
@@ -2221,7 +2145,7 @@ The following results are obtained using Basic Operations and the Fuzzy ones wit
In this example Fuzzy options eliminated a pin-like protrusion resulting from the gap between edges of the argument faces.
#### Case 4
@subsubsection occt_algorithms_11a_1_4 Case 4
In this example the small edge is subtracted from the big one. The edges are overlapping not precisely, with max deviation between them equal to 5.28004e<sup>-5</sup>. We will use 6e<sup>-5</sup> value for Fuzzy option.
@@ -2235,71 +2159,6 @@ The following results are obtained using Basic Operations and the Fuzzy ones wit
This example stresses not only the validity, but also the performance issue. The usage of Fuzzy option with the appropriate value allows processing the case much faster than with the pure Basic operation. The performance gain for the case is 45 (Processor: Intel(R) Core(TM) i5-3450 CPU @ 3.10 GHz).
@subsection occt_algorithms_11a_2 Gluing Operation
The Gluing operation is the option of the Basic Operations, such as General Fuse, Boolean and Section operations.
It has been designed to speed up the computation of the interferences among arguments of the operations on special cases, in which the arguments may be overlapping but do not have real intersections between their sub-shapes.
This option cannot be used on the shapes having real intersections, like intersection vertex between edges, or intersection vertex between edge and a face or intersection line between faces:
@figure{/user_guides/boolean_operations/images/glue_options_image002.png, "Intersecting faces"}
There are two possibilities of overlapping shapes:
* The shapes can be partially coinciding - the faces do not have intersection curves, but overlapping. The faces of such arguments will be split during the operation. The following picture illustrates such shapes:
@figure{/user_guides/boolean_operations/images/glue_options_image001.png, "Partially coinciding faces"}
* The shapes can be fully coinciding - there should be no partial overlapping of the faces, thus no intersection of type EDGE/FACE at all. In such cases the faces will not be split during the operation
@figure{/user_guides/boolean_operations/images/glue_options_image003.png, "Full coinciding faces of the boxes"}
Thus, there are two possible options - for full and partial coincidence of the shapes.
Even though there are no real intersections on such cases without Gluing options the algorithm will still intersect the sub-shapes of the arguments with interfering bounding boxes.
The performance improvement in gluing mode is achieved by excluding the most time consuming computations and in some case can go up to 90%:
* Exclude computation of FACE/FACE intersections for partial coincidence;
* Exclude computation of VERTEX/FACE, EDGE/FACE and FACE/FACE intersections for full coincidence.
By setting the Gluing option for the operation user should guarantee that the arguments are really coinciding. The algorithm does not check this itself. Setting inappropriate option for the operation is likely to lead to incorrect result.
@subsubsection occt_algorithms_11a_2_1 Usage
The Gluing option is an enumeration implemented in BOPAlgo_GlueEnum.hxx:
* BOPAlgo_GlueOff - default value for the algorithms, Gluing is switched off;
* BOPAlgo_GlueShift - Glue option for shapes with partial coincidence;
* BOPAlgo_GlueFull - Glue option for shapes with full coincidence.
#### API level
For setting the Gluing options for the algorithm it is just necessary to call the SetGlue(const BOPAlgo_Glue) method with appropriate value:
~~~~
BOPAlgo_Builder aGF;
//
....
// setting the gluing option to speed up intersection of the arguments
aGF.SetGlue(BOPAlgo_GlueShift)
//
....
~~~~
#### TCL level
For setting the Gluing options in DRAW it is necessary to call the <i>bglue</i> command with appropriate value:
* 0 - default value, Gluing is off;
* 1 - for partial coincidence;
* 2 - for full coincidence
~~~~
bglue 1
~~~~
@subsubsection occt_algorithms_11a_2_2 Examples
#### Case1 - Fusing the 64 bspline boxes into one solid
@figure{/user_guides/boolean_operations/images/glue_options_image004.png, "BSpline Boxes with partial coincidence"}
Performance improvement from using the GlueShift option in this case is about 70 percent.
#### Case2 - Sewing faces of the shape after reading from IGES
@figure{/user_guides/boolean_operations/images/glue_options_image005.png, "Faces with coinciding but not shared edges"}
Performance improvement in this case is also about 70 percent.
@section occt_algorithms_11b Usage
The chapter contains some examples of the OCCT Boolean Component usage. The usage is possible on two levels: C++ and Tcl.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -610,7 +610,7 @@ wait
Syntax:
~~~~~
chrono [ name start/stop/reset/show/restart/[counter text]]
chrono [ name start/stop/reset/show]
~~~~~
Without arguments, **chrono** activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed.
@@ -619,9 +619,7 @@ With arguments, **chrono** is used to manage activated chronometers. You can per
* run the chronometer (start).
* stop the chronometer (stop).
* reset the chronometer to 0 (reset).
* restart the chronometer (restart).
* display the current time (show).
* display the current time with specified text (output example - *COUNTER text: N*), command <i>testdiff</i> will compare such outputs between two test runs (counter).
**Example:**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
@@ -1966,6 +1964,26 @@ vsensera
Erases active entities.
@subsubsection occt_draw_4_3_22 vperf
Syntax:
~~~~~
vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
~~~~~
Tests the animation of an object along a predefined trajectory.
**Example:**
~~~~~
vinit
box b 10 10 10
psphere s 20
vdisplay b s
vfit
vsetdispmode 0
vperf b 1 1
~~~~~
@subsubsection occt_draw_4_3_23 vr
Syntax:
@@ -8912,19 +8930,6 @@ Sets a shape at the indicated label.
XSetShape D 0:1:1:3 b
~~~~~
@subsubsection occt_draw_8_6_15 XUpdateAssemblies
Syntax:
~~~~~
XUpdateAssemblies <document>
~~~~~
Updates all assembly compounds in the XDE document.
**Example:**
~~~~~
XUpdateAssemblies D
~~~~~
@subsection occt_draw_8_7_ XDE color commands

View File

@@ -683,7 +683,7 @@ Handle (Geom_Surface) Surf (Mapp.Surface());
// create a face corresponding to the approximated Plate
Surface
Standard_Real Umin, Umax, Vmin, Vmax;
PSurf->Bounds( Umin, Umax, Vmin, Vmax);
PSurf-Bounds( Umin, Umax, Vmin, Vmax);
BRepBuilderAPI_MakeFace MF(Surf,Umin, Umax, Vmin, Vmax);
~~~~~
@@ -2100,44 +2100,11 @@ These classes provide the following services:
* Creation of tapered shapes using draft angles;
* Creation of sweeps.
@subsection occt_modalg_7_1 Offset computation
Offset computation can be performed using *BRepOffsetAPI_MakeOffsetShape*. This class provides API to the two different offset algorithms:
Offset algorithm based on computation of the analytical continuation. Meaning of the parameters can be found in *BRepOffsetAPI_MakeOffsetShape::PerformByJoin* method description. The list below demonstrates principal scheme of this algorithm:
* At the first step, the offsets are computed.
* After this, the analytical continuations are computed for each offset.
* Pairwise intersection is computed according to the original topological information (sharing, number of neighbors, etc.).
* The offset shape is assembled.
The second algorithm is based on the fact that the offset computation for a single face without continuation can always be built. The list below shows simple offset algorithm:
* Each surface is mapped to its geometric offset surface.
* For each edge, pcurves are mapped to the same pcurves on offset surfaces.
* For each edge, 3d curve is constructed by re-approximation of pcurve on the first offset face.
* Position of each vertex in a result shell is computed as average point of all ends of edges sharing that vertex.
* Tolerances are updated according to the resulting geometry.
The possible drawback of the simple algorithm is that it leads, in general case, to tolerance increasing. The tolerances have to grow in order to cover the gaps between the neighbor faces in the output. It should be noted that the actual tolerance growth depends on the offset distance and the quality of joints between the input faces. Anyway the good input shell (smooth connections between adjacent faces) will lead to good result.
The snippets below show usage examples:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
BRepOffsetAPI_MakeOffsetShape OffsetMaker1;
// Computes offset shape using analytical continuation mechanism.
OffsetMaker1.PerformByJoin(Shape, OffsetValue, Tolerance);
if (OffsetMaker1.IsDone())
NewShape = OffsetMaker1.Shape();
BRepOffsetAPI_MakeOffsetShape OffsetMaker2;
// Computes offset shape using simple algorithm.
OffsetMaker2.PerformBySimple(Shape, OffsetValue);
if (OffsetMaker2.IsDone())
NewShape = OffsetMaker2.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@subsection occt_modalg_7_2 Shelling
@subsection occt_modalg_7_1 Shelling
Shelling is used to offset given faces of a solid by a specific value. It rounds or intersects adjacent faces along its edges depending on the convexity of the edge.
The MakeThickSolidByJoin method of the *BRepOffsetAPI_MakeThickSolid* takes the solid, the list of faces to remove and an offset value as input.
The constructor *BRepOffsetAPI_MakeThickSolid* shelling operator takes the solid, the list of faces to remove and an offset value as input.
~~~~~
TopoDS_Solid SolidInitial = ...;
@@ -2152,28 +2119,17 @@ for (Standard_Integer i = 1 ;i <= n; i++) {
LCF.Append(SF);
}
BRepOffsetAPI_MakeThickSolid SolidMaker;
SolidMaker.MakeThickSolidByJoin(SolidInitial,
LCF,
Of,
Tol);
if (SolidMaker.IsDone())
Result = SolidMaker.Shape();
Result = BRepOffsetAPI_MakeThickSolid (SolidInitial,
LCF,
Of,
Tol);
~~~~~
@image html /user_guides/modeling_algos/images/modeling_algos_image042.png "Shelling"
@image latex /user_guides/modeling_algos/images/modeling_algos_image042.png "Shelling"
Also it is possible to create solid between shell, offset shell. This functionality can be called using *BRepOffsetAPI_MakeThickSolid::MakeThickSolidBySimple* method. The code below shows usage example:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
BRepOffsetAPI_MakeThickSolid SolidMaker;
SolidMaker.MakeThickSolidBySimple(Shell, OffsetValue);
if (myDone.IsDone())
Solid = SolidMaker.Shape();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@subsection occt_modalg_7_3 Draft Angle
@subsection occt_modalg_7_2 Draft Angle
*BRepOffsetAPI_DraftAngle* class allows modifying a shape by applying draft angles to its planar, cylindrical and conical faces.
@@ -2226,7 +2182,7 @@ else {
@image html /user_guides/modeling_algos/images/modeling_algos_image043.png "DraftAngle"
@image latex /user_guides/modeling_algos/images/modeling_algos_image043.png "DraftAngle"
@subsection occt_modalg_7_4 Pipe Constructor
@subsection occt_modalg_7_3 Pipe Constructor
*BRepOffsetAPI_MakePipe* class allows creating a pipe from a Spine, which is a Wire and a Profile which is a Shape. This implementation is limited to spines with smooth transitions, sharp transitions are precessed by *BRepOffsetAPI_MakePipeShell*. To be more precise the continuity must be G1, which means that the tangent must have the same direction, though not necessarily the same magnitude, at neighboring edges.
@@ -2241,7 +2197,7 @@ TopoDS_Shape Pipe = BRepOffsetAPI_MakePipe(Spine,Profile);
@image html /user_guides/modeling_algos/images/modeling_algos_image044.png "Example of a Pipe"
@image latex /user_guides/modeling_algos/images/modeling_algos_image044.png "Example of a Pipe"
@subsection occt_modalg_7_5 Evolved Solid
@subsection occt_modalg_7_4 Evolved Solid
*BRepOffsetAPI_MakeEvolved* class allows creating an evolved solid from a Spine (planar face or wire) and a profile (wire).

View File

@@ -156,16 +156,14 @@ You can then query or edit this Assembly node, the Main Item or another one (*my
**Note** that for the examples in the rest of this guide, *myAssembly* is always presumed to be accessed this way, so this information will not be repeated.
@subsubsection occt_xde_2_2_3 Updating the Assemblies after Filling or Editing
@subsubsection occt_xde_2_2_3 Updating the Assembly after Filling or Editing
Some actions in this chapter affect the content of the document, considered as an Assembly. As a result, you will sometimes need to update various representations (including the compounds).
To update the representations, use:
~~~~~
myAssembly->UpdateAssemblies();
myAssembly->UpdateAssembly(aLabel);
~~~~~
This call performs a top-down update of the Assembly compounds stored in the document.
**Note** that you have to run this method manually to actualize your Assemblies after any low-level modifications on shapes.
Since this call is always used by the editing functions, you need not apply it for such functions. However, you will need this call if special edits, not using XCAF functions, are used on the document.
@subsubsection occt_xde_2_2_4 Adding or Setting Top Level Shapes

View File

@@ -222,7 +222,7 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->Select(theX1, theY1, theX2, theY2, myView());
}
}
@@ -233,7 +233,7 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (Standard_True);
myAISContext()->Select();
}
}
@@ -244,7 +244,7 @@ public:
{
if ((!myAISContext().IsNull()) && (!myView().IsNull()))
{
myAISContext()->MoveTo (theX, theY, myView(), Standard_True);
myAISContext()->MoveTo(theX, theY, myView());
}
}
@@ -255,7 +255,7 @@ public:
{
if ((!myAISContext().IsNull()) && (!myView().IsNull()))
{
myAISContext()->ShiftSelect (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->ShiftSelect(theX1, theY1, theX2, theY2, myView());
}
}
@@ -266,7 +266,7 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->ShiftSelect (Standard_True);
myAISContext()->ShiftSelect();
}
}
@@ -463,15 +463,15 @@ public:
aCurrentMode=AIS_Shaded;
}
if(myAISContext()->NbSelected()==0)
if(myAISContext()->NbCurrents()==0 || myAISContext()->NbSelected()==0)
{
myAISContext()->SetDisplayMode (aCurrentMode, Standard_False);
myAISContext()->SetDisplayMode(aCurrentMode);
}
else
{
for(myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for(myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
myAISContext()->SetDisplayMode (myAISContext()->SelectedInteractive(), theMode, Standard_False);
myAISContext()->SetDisplayMode(myAISContext()->Current(), theMode, Standard_False);
}
}
myAISContext()->UpdateCurrentViewer();
@@ -487,11 +487,10 @@ public:
return;
}
Quantity_Color aCol = Quantity_Color(theR/255.,theG/255.,theB/255.,Quantity_TOC_RGB);
for (; myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (;myAISContext()->MoreCurrent ();myAISContext()->NextCurrent ())
{
myAISContext()->SetColor (myAISContext()->SelectedInteractive(), aCol.Name(), Standard_False);
myAISContext()->SetColor (myAISContext()->Current(),aCol.Name());
}
myAISContext()->UpdateCurrentViewer();
}
/// <summary>
@@ -528,15 +527,15 @@ public:
theBlue=255;
Handle(AIS_InteractiveObject) aCurrent ;
Quantity_Color anObjCol;
myAISContext()->InitSelected();
if (!myAISContext()->MoreSelected())
myAISContext()->InitCurrent();
if (!myAISContext()->MoreCurrent())
{
return;
}
aCurrent = myAISContext()->SelectedInteractive();
aCurrent = myAISContext()->Current();
if ( aCurrent->HasColor () )
{
anObjCol = myAISContext()->Color(aCurrent);
anObjCol = myAISContext()->Color(myAISContext()->Current());
Quantity_Parameter r1, r2, r3;
anObjCol.Values(r1, r2, r3, Quantity_TOC_RGB);
theRed=(int)r1*255;
@@ -576,8 +575,8 @@ public:
return;
}
myAISContext()->EraseSelected (Standard_False);
myAISContext()->ClearSelected (Standard_True);
myAISContext()->EraseSelected (Standard_True);
myAISContext()->ClearCurrents();
}
/// <summary>
@@ -597,9 +596,9 @@ public:
{
return;
}
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent (); myAISContext()->NextCurrent () )
{
myAISContext()->SetMaterial (myAISContext()->SelectedInteractive(), (Graphic3d_NameOfMaterial)theMaterial, Standard_False);
myAISContext()->SetMaterial( myAISContext()->Current(), (Graphic3d_NameOfMaterial)theMaterial );
}
myAISContext()->UpdateCurrentViewer();
}
@@ -613,11 +612,10 @@ public:
{
return;
}
for( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() )
for( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextSelected() )
{
myAISContext()->SetTransparency (myAISContext()->SelectedInteractive(), ((Standard_Real)theTrans) / 10.0, Standard_False);
myAISContext()->SetTransparency( myAISContext()->Current(), ((Standard_Real)theTrans) / 10.0 );
}
myAISContext()->UpdateCurrentViewer();
}
/// <summary>
@@ -629,8 +627,8 @@ public:
{
return false;
}
myAISContext()->InitSelected();
return myAISContext()->MoreSelected() != Standard_False;
myAISContext()->InitCurrent();
return myAISContext()->MoreCurrent() != Standard_False;
}
/// <summary>
@@ -645,13 +643,13 @@ public:
int aMode = -1;
bool OneOrMoreInShading = false;
bool OneOrMoreInWireframe = false;
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
if ( myAISContext()->IsDisplayed( myAISContext()->SelectedInteractive(), 1 ) )
if ( myAISContext()->IsDisplayed( myAISContext()->Current(), 1 ) )
{
OneOrMoreInShading = true;
}
if ( myAISContext()->IsDisplayed( myAISContext()->SelectedInteractive(), 0 ) )
if ( myAISContext()->IsDisplayed( myAISContext()->Current(), 0 ) )
{
OneOrMoreInWireframe = true;
}
@@ -755,8 +753,11 @@ public:
{
return false;
}
myAISContext()->Display (new AIS_Shape (aShape), Standard_True);
if(myAISContext()->HasOpenedContext())
{
myAISContext()->CloseLocalContext();
}
myAISContext()->Display(new AIS_Shape(aShape));
return true;
}
@@ -785,9 +786,8 @@ public:
for ( int i = 1; i <= aNbShap; i++ )
{
TopoDS_Shape aShape = aReader.Shape( i );
myAISContext()->Display (new AIS_Shape (aShape), Standard_False);
myAISContext()->Display(new AIS_Shape(aShape));
}
myAISContext()->UpdateCurrentViewer();
}
}
}
@@ -813,7 +813,7 @@ public:
{
aReader.TransferRoots();
TopoDS_Shape aShape = aReader.OneShape();
myAISContext()->Display (new AIS_Shape (aShape), Standard_False);
myAISContext()->Display(new AIS_Shape(aShape));
}
else
{
@@ -830,13 +830,13 @@ public:
/// <param name="theFileName">Name of export file</param>
bool ExportBRep(char* theFileName)
{
myAISContext()->InitSelected();
if (!myAISContext()->MoreSelected())
myAISContext()->InitCurrent();
if (!myAISContext()->MoreCurrent())
{
return false;
}
Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive();
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast(anIO);
return BRepTools::Write (anIS->Shape(), (Standard_CString)theFileName) != Standard_False;
}
@@ -850,9 +850,9 @@ public:
STEPControl_StepModelType aType = STEPControl_AsIs;
IFSelect_ReturnStatus aStatus;
STEPControl_Writer aWriter;
for ( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() )
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
{
Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive();
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
TopoDS_Shape aShape = anIS->Shape();
aStatus = aWriter.Transfer( aShape , aType );
@@ -881,9 +881,9 @@ public:
IGESControl_Writer aWriter( Interface_Static::CVal( "XSTEP.iges.unit" ),
Interface_Static::IVal( "XSTEP.iges.writebrep.mode" ) );
for ( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() )
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
{
Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive();
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
TopoDS_Shape aShape = anIS->Shape();
aWriter.AddShape ( aShape );
@@ -903,9 +903,9 @@ public:
BRep_Builder aBuilder;
aBuilder.MakeCompound( aRes );
for ( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() )
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
{
Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive();
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
TopoDS_Shape aShape = anIS->Shape();
if ( aShape.IsNull() )
@@ -932,9 +932,9 @@ public:
BRep_Builder aBuilder;
aBuilder.MakeCompound( aComp );
for ( myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected() )
for ( myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent() )
{
Handle(AIS_InteractiveObject) anIO = myAISContext()->SelectedInteractive();
Handle(AIS_InteractiveObject) anIO = myAISContext()->Current();
Handle(AIS_Shape) anIS=Handle(AIS_Shape)::DownCast(anIO);
TopoDS_Shape aShape = anIS->Shape();
if ( aShape.IsNull() )

View File

@@ -238,7 +238,7 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->Select (theX1, theY1, theX2, theY2, myView());
}
}
@@ -249,7 +249,7 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (Standard_True);
myAISContext()->Select();
}
}
@@ -260,7 +260,7 @@ public:
{
if (!myAISContext().IsNull() && !myView().IsNull())
{
myAISContext()->MoveTo (theX, theY, myView(), Standard_True);
myAISContext()->MoveTo (theX, theY, myView());
}
}
@@ -271,7 +271,7 @@ public:
{
if (!myAISContext().IsNull() && !myView().IsNull())
{
myAISContext()->ShiftSelect (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->ShiftSelect (theX1, theY1, theX2, theY2, myView());
}
}
@@ -282,7 +282,7 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->ShiftSelect (Standard_True);
myAISContext()->ShiftSelect();
}
}
@@ -465,15 +465,16 @@ public:
AIS_DisplayMode aCurrentMode = theMode == 0
? AIS_WireFrame
: AIS_Shaded;
if (myAISContext()->NbSelected() == 0)
if (myAISContext()->NbCurrents() == 0
|| myAISContext()->NbSelected() == 0)
{
myAISContext()->SetDisplayMode (aCurrentMode, Standard_False);
myAISContext()->SetDisplayMode (aCurrentMode);
}
else
{
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
myAISContext()->SetDisplayMode (myAISContext()->SelectedInteractive(), theMode, Standard_False);
myAISContext()->SetDisplayMode (myAISContext()->Current(), theMode, Standard_False);
}
}
myAISContext()->UpdateCurrentViewer();
@@ -490,11 +491,10 @@ public:
}
Quantity_Color aCol (theR / 255.0, theG / 255.0, theB / 255.0, Quantity_TOC_RGB);
for (; myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (; myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
myAISContext()->SetColor (myAISContext()->SelectedInteractive(), aCol.Name(), false);
myAISContext()->SetColor (myAISContext()->Current(), aCol.Name());
}
myAISContext()->UpdateCurrentViewer();
}
/// <summary>
@@ -540,16 +540,16 @@ public:
theRed = 255;
theGreen = 255;
theBlue = 255;
myAISContext()->InitSelected();
if (!myAISContext()->MoreSelected())
myAISContext()->InitCurrent();
if (!myAISContext()->MoreCurrent())
{
return;
}
Handle(AIS_InteractiveObject) aCurrent = myAISContext()->SelectedInteractive();
Handle(AIS_InteractiveObject) aCurrent = myAISContext()->Current();
if (aCurrent->HasColor())
{
Quantity_Color anObjCol = myAISContext()->Color (aCurrent);
Quantity_Color anObjCol = myAISContext()->Color (myAISContext()->Current());
theRed = int(anObjCol.Red() * 255.0);
theGreen = int(anObjCol.Green() * 255.0);
theBlue = int(anObjCol.Blue() * 255.0);
@@ -577,8 +577,8 @@ public:
return;
}
myAISContext()->EraseSelected (Standard_False);
myAISContext()->ClearSelected (Standard_True);
myAISContext()->EraseSelected (Standard_True);
myAISContext()->ClearCurrents();
}
/// <summary>
@@ -598,9 +598,9 @@ public:
{
return;
}
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
myAISContext()->SetMaterial (myAISContext()->SelectedInteractive(), (Graphic3d_NameOfMaterial )theMaterial, Standard_False);
myAISContext()->SetMaterial (myAISContext()->Current(), (Graphic3d_NameOfMaterial )theMaterial);
}
myAISContext()->UpdateCurrentViewer();
}
@@ -614,11 +614,10 @@ public:
{
return;
}
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextSelected())
{
myAISContext()->SetTransparency (myAISContext()->Current(), ((Standard_Real )theTrans) / 10.0, Standard_False);
myAISContext()->SetTransparency (myAISContext()->Current(), ((Standard_Real )theTrans) / 10.0);
}
myAISContext()->UpdateCurrentViewer();
}
/// <summary>
@@ -630,8 +629,8 @@ public:
{
return false;
}
myAISContext()->InitSelected();
return myAISContext()->MoreSelected() != Standard_False;
myAISContext()->InitCurrent();
return myAISContext()->MoreCurrent() != Standard_False;
}
/// <summary>
@@ -646,13 +645,13 @@ public:
bool isOneOrMoreInShading = false;
bool isOneOrMoreInWireframe = false;
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
if (myAISContext()->IsDisplayed (myAISContext()->SelectedInteractive(), AIS_Shaded))
if (myAISContext()->IsDisplayed (myAISContext()->Current(), AIS_Shaded))
{
isOneOrMoreInShading = true;
}
if (myAISContext()->IsDisplayed (myAISContext()->SelectedInteractive(), AIS_WireFrame))
if (myAISContext()->IsDisplayed (myAISContext()->Current(), AIS_WireFrame))
{
isOneOrMoreInWireframe = true;
}
@@ -730,11 +729,14 @@ public:
{
return false;
}
if (myAISContext()->HasOpenedContext())
{
myAISContext()->CloseLocalContext();
}
Handle(AIS_Shape) aPrs = new AIS_Shape (aShape);
myAISContext()->SetMaterial (aPrs, Graphic3d_NOM_GOLD, Standard_False);
myAISContext()->SetMaterial (aPrs, Graphic3d_NOM_GOLD);
myAISContext()->SetDisplayMode(aPrs, AIS_Shaded, Standard_False);
myAISContext()->Display (aPrs, Standard_True);
myAISContext()->Display (aPrs);
return true;
}
@@ -763,9 +765,8 @@ public:
{
for (int aShapeIter = 1; aShapeIter <= aNbShap; ++aShapeIter)
{
myAISContext()->Display (new AIS_Shape (aReader.Shape (aShapeIter)), Standard_False);
myAISContext()->Display (new AIS_Shape (aReader.Shape (aShapeIter)), Standard_True);
}
myAISContext()->UpdateCurrentViewer();
}
}
return true;
@@ -796,13 +797,13 @@ public:
/// <param name="theFileName">Name of export file</param>
bool ExportBRep (char* theFileName)
{
myAISContext()->InitSelected();
if (!myAISContext()->MoreSelected())
myAISContext()->InitCurrent();
if (!myAISContext()->MoreCurrent())
{
return false;
}
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive());
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
return !anIS.IsNull()
&& BRepTools::Write (anIS->Shape(), theFileName);
}
@@ -815,9 +816,9 @@ public:
{
STEPControl_StepModelType aType = STEPControl_AsIs;
STEPControl_Writer aWriter;
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive());
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
if (anIS.IsNull())
{
return false;
@@ -841,9 +842,9 @@ public:
IGESControl_Controller::Init();
IGESControl_Writer aWriter (Interface_Static::CVal ("XSTEP.iges.unit"),
Interface_Static::IVal ("XSTEP.iges.writebrep.mode"));
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive());
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
if (anIS.IsNull())
{
return false;
@@ -865,9 +866,9 @@ public:
TopoDS_Compound aRes;
BRep_Builder aBuilder;
aBuilder.MakeCompound (aRes);
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive());
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
if (anIS.IsNull())
{
return false;
@@ -889,9 +890,9 @@ public:
TopoDS_Compound aComp;
BRep_Builder aBuilder;
aBuilder.MakeCompound (aComp);
for (myAISContext()->InitSelected(); myAISContext()->MoreSelected(); myAISContext()->NextSelected())
for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
{
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->SelectedInteractive());
Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
if (anIS.IsNull())
{
return false;

View File

@@ -56,7 +56,7 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresen
{
GeomAdaptor_Curve anAdaptorCurve(myCurve);
if (hasOwnColor)
myDrawer->LineAspect()->SetColor (myDrawer->Color());
myDrawer->LineAspect()->SetColor(myOwnColor);
myDrawer->Link()->SetDiscretisation(100);
myDrawer->Link()->SetMaximalParameterValue(500);

View File

@@ -20,13 +20,13 @@ void GeomSources::PreProcess(CGeometryDoc* aDoc,DisplayType aDisplayType)
{
if (aDisplayType == No2D3D )
{
aDoc->GetAISContext()->EraseAll (Standard_True);
aDoc->GetAISContext()->EraseAll();
aDoc->Put3DOnTop();
}
if (aDisplayType == a2DNo3D)
{
aDoc->GetISessionContext()->EraseAll (Standard_True);
aDoc->GetISessionContext()->EraseAll();
aDoc->Put2DOnTop();
}
@@ -42,8 +42,8 @@ void GeomSources::PreProcess(CGeometryDoc* aDoc,DisplayType aDisplayType)
if (aDisplayType == a2D3D)
{
aDoc->GetAISContext()->EraseAll (Standard_True);
aDoc->GetISessionContext()->EraseAll (Standard_True);
aDoc->GetAISContext()->EraseAll();
aDoc->GetISessionContext()->EraseAll();
aDoc->Put3DOnTop(false);
aDoc->Put2DOnTop(false);
@@ -986,7 +986,7 @@ if(NbResults>0){ \n\
Handle(Prs3d_Drawer) CurDrawer = aSurface->Attributes();
CurDrawer->UIsoAspect()->SetNumber(10);
CurDrawer->VIsoAspect()->SetNumber(10);
aDoc->GetAISContext()->SetLocalAttributes(aSurface, CurDrawer, Standard_False);
aDoc->GetAISContext()->SetLocalAttributes(aSurface, CurDrawer);
aDoc->GetAISContext()->Display(aSurface, Standard_False);
if(NbResults>0)
@@ -2495,13 +2495,13 @@ else
}
Handle(ISession_Curve) aCurve = new ISession_Curve(SPL1);
aDoc->GetAISContext()->SetDisplayMode(aCurve,1, Standard_False);
aDoc->GetAISContext()->SetDisplayMode(aCurve,1);
aDoc->GetAISContext()->Display(aCurve, Standard_False);
if (anInterpolation.IsDone())
{
Handle(ISession_Curve) aCurve2 = new ISession_Curve(SPL2);
aDoc->GetAISContext()->SetDisplayMode(aCurve2,1, Standard_False);
aDoc->GetAISContext()->SetDisplayMode(aCurve2,1);
aDoc->GetAISContext()->Display(aCurve2, Standard_False);
}
@@ -4140,12 +4140,12 @@ aBox.Get( aXmin, aYmin,aZmin, aXmax,aYmax,aZmax); \n\
Quantity_NameOfColor aNameOfColor= Quantity_NOC_GREEN;
Handle(ISession_Surface) aGraphicalSurface = new ISession_Surface(aSurf);
aDoc->GetAISContext()->SetColor (aGraphicalSurface, aNameOfColor, Standard_False);
aDoc->GetAISContext()->SetColor(aGraphicalSurface,aNameOfColor);
aGraphicalSurface->Attributes()->FreeBoundaryAspect()->SetColor(aNameOfColor);
aGraphicalSurface->Attributes()->UIsoAspect()->SetColor(aNameOfColor);
aGraphicalSurface->Attributes()->VIsoAspect()->SetColor(aNameOfColor);
aDoc->GetAISContext()->SetDisplayMode (aGraphicalSurface, 1, Standard_False);
aDoc->GetAISContext()->SetDisplayMode(aGraphicalSurface,1);
aDoc->GetAISContext()->Display(aGraphicalSurface,false);
// DisplaySurface(aDoc,aSurf,Quantity_NOC_GREEN);

View File

@@ -261,7 +261,7 @@ void CGeometryDoc::MoveEvent2D(const Standard_Integer x,
//View is not updated automatically in ConvertToGrid
aView->Update();
}
this->myAISContext2D->MoveTo (x, y, aView, Standard_True);
this->myAISContext2D->MoveTo(x, y, aView);
}
//-----------------------------------------------------------------------------------------
@@ -325,8 +325,8 @@ void CGeometryDoc::Popup (const Standard_Integer theMouseX,
const Handle(V3d_View)& theView)
{
Standard_Integer PopupMenuNumber=0;
GetAISContext()->InitSelected();
if (GetAISContext()->MoreSelected())
GetAISContext()->InitCurrent();
if (GetAISContext()->MoreCurrent())
{
PopupMenuNumber=1;
}
@@ -352,7 +352,7 @@ void CGeometryDoc::InputEvent (const Standard_Integer /*theMouseX*/,
const Standard_Integer /*theMouseY*/,
const Handle(V3d_View)& /*theView*/)
{
myAISContext->Select (Standard_True);
myAISContext->Select();
}
//-----------------------------------------------------------------------------------------
@@ -1177,7 +1177,7 @@ void CGeometryDoc::OnSimplify()
myCResultDialog.SetText(initfile);
return;
}
myAISContext->SetDisplayMode(AIS_Shaded, Standard_True);
myAISContext->SetDisplayMode(AIS_Shaded);
simplify(aShape);
}
@@ -1541,7 +1541,7 @@ Handle(AIS_InteractiveObject) CGeometryDoc::drawSurface
Fit();
}
else
myAISContext->Display (aGraphicSurface, Standard_True);
myAISContext->Display (aGraphicSurface);
}
return aGraphicSurface;
@@ -1578,7 +1578,7 @@ Handle(AIS_Point) CGeometryDoc::drawPoint
myAISContext->SetColor (aGraphicPoint, theColor, toDisplay);
if (toDisplay)
{
myAISContext->Display (aGraphicPoint, Standard_True);
myAISContext->Display (aGraphicPoint);
//COCCDemoDoc::Fit();
}
@@ -1601,7 +1601,7 @@ Handle(AIS_Shape) CGeometryDoc::drawShape
Fit();
}
else
myAISContext->Display (aGraphicShape, Standard_True);
myAISContext->Display (aGraphicShape);
}
return aGraphicShape;

File diff suppressed because it is too large Load Diff

View File

@@ -108,7 +108,7 @@
#include <LocOpe_FindEdges.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Solid.hxx>
#include <GeomPlate_HArray1OfHCurve.hxx>
#include <GeomPlate_HArray1OfHCurveOnSurface.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <GeomAdaptor_HSurface.hxx>

View File

@@ -56,7 +56,9 @@ void CViewer2dDoc::Dump(CDumpContext& dc) const
void CViewer2dDoc::OnBUTTONErase()
{
myAISContext->EraseAll (Standard_True);
if(myAISContext->HasOpenedContext())
myAISContext->CloseAllContexts();
myAISContext->EraseAll();
}
void CViewer2dDoc::OnBUTTONTestText()
@@ -196,7 +198,7 @@ void CViewer2dDoc::OnBUTTONTestLine()
aDrawer->SetFaceBoundaryDraw(Standard_True);
aRect->SetAttributes(aDrawer);
myAISContext->SetDisplayMode (aRect, 1, Standard_False);
myAISContext->SetDisplayMode(aRect,1);
myAISContext->SetColor(aRect,(Quantity_NameOfColor)(Quantity_NOC_CADETBLUE+2*i),Standard_False);
myAISContext->SetMaterial(aRect,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(aRect, Standard_False);
@@ -212,7 +214,9 @@ void CViewer2dDoc::OnBUTTONTestLine()
void CViewer2dDoc::OnBUTTONTestFace()
{
//erase all
myAISContext->EraseAll (Standard_True);
if(myAISContext->HasOpenedContext())
myAISContext->CloseAllContexts();
myAISContext->EraseAll();
CFileDialog dlg(TRUE,
NULL,
@@ -251,6 +255,7 @@ void CViewer2dDoc::OnBUTTONTestFace()
Handle(Sample2D_Face) anAISFace = new Sample2D_Face(aFaceShape);
myAISContext->Display(anAISFace,Standard_True);
//activate selection mode for edges selection
myAISContext->OpenLocalContext();
myAISContext->Activate(anAISFace,2);
FitAll2DViews(Standard_False);
@@ -269,8 +274,8 @@ void CViewer2dDoc::OnBUTTONTestRect()
TopoDS_Edge E14 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,68.,0.), gp_Pnt(40.,0.,0.));
TopoDS_Wire W1 = BRepBuilderAPI_MakeWire(E11,E12,E13,E14);
Handle(AIS_Shape) aRect1 = new AIS_Shape(W1);
myAISContext->Display (aRect1, Standard_False);
myAISContext->SetColor (aRect1, Quantity_NOC_YELLOW, Standard_False);
myAISContext->Display(aRect1);
myAISContext->SetColor(aRect1,Quantity_NOC_YELLOW);
//Second rectangle
TopoDS_Edge E21 = BRepBuilderAPI_MakeEdge(gp_Pnt(110.,0.,0.), gp_Pnt(152.5,25.,0.));
@@ -279,8 +284,8 @@ void CViewer2dDoc::OnBUTTONTestRect()
TopoDS_Edge E24 = BRepBuilderAPI_MakeEdge(gp_Pnt(70.,68.,0.), gp_Pnt(110.,0.,0.));
TopoDS_Wire W2 = BRepBuilderAPI_MakeWire(E21,E22,E23,E24);
Handle(AIS_Shape) aRect2 = new AIS_Shape(W2);
myAISContext->Display (aRect2, Standard_False);
myAISContext->SetColor (aRect2, Quantity_NOC_YELLOW, Standard_False);
myAISContext->Display(aRect2);
myAISContext->SetColor(aRect2,Quantity_NOC_YELLOW);
myAISContext->Activate(aRect2,2);
FitAll2DViews(Standard_True); // Update Viewer
@@ -323,7 +328,9 @@ void CViewer2dDoc::OnBUTTONTestImage()
TCollection_AsciiString aFileName ((const wchar_t* )aFilePath);
//erase viewer
myAISContext->EraseAll (Standard_False);
if(myAISContext->HasOpenedContext())
myAISContext->CloseAllContexts();
myAISContext->EraseAll();
Handle(Sample2D_Image) anImage = new Sample2D_Image (aFileName);
anImage->SetCoord (40,50) ;
@@ -355,7 +362,9 @@ void CViewer2dDoc::OnBUTTONMultipleImage()
TCollection_AsciiString aFileName ((const wchar_t* )aFilePath);
//erase viewer
myAISContext->EraseAll (Standard_False);
if(myAISContext->HasOpenedContext())
myAISContext->CloseAllContexts();
myAISContext->EraseAll();
//create images
{ // 1

View File

@@ -37,7 +37,7 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres
{
GeomAdaptor_Curve anAdaptorCurve(myCurve);
if (hasOwnColor)
myDrawer->LineAspect()->SetColor (myDrawer->Color());
myDrawer->LineAspect()->SetColor(myOwnColor);
myDrawer->Link()->SetDiscretisation(100);
myDrawer->Link()->SetMaximalParameterValue(500);

View File

@@ -81,7 +81,7 @@ void CModelClippingDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBa
if (m_ModelClippingONOFF)
{
myDoc->GetAISContext()->SetLocation (myShape, TopLoc_Location (myTrsf));
myDoc->GetAISContext()->Redisplay (myShape, Standard_True);
myDoc->GetAISContext()->Redisplay (myShape);
myView->Update();
}
else
@@ -141,7 +141,7 @@ BOOL CModelClippingDlg::OnInitDialog()
myClippingPlane->SetOn (Standard_True);
myDoc->GetAISContext()->Display (myShape, Standard_True);
myDoc->GetAISContext()->Display (myShape);
}
UpdateData (FALSE);
@@ -172,7 +172,7 @@ void CModelClippingDlg::OnChangeEditModelclippingZ()
if (m_ModelClippingONOFF)
{
myDoc->GetAISContext()->SetLocation (myShape, TopLoc_Location (myTrsf));
myDoc->GetAISContext()->Redisplay (myShape, Standard_False);
myDoc->GetAISContext()->Redisplay (myShape);
myView->Update();
}
else
@@ -223,14 +223,14 @@ void CModelClippingDlg::OnCheckModelclippingonoff()
myClippingPlane->SetOn (Standard_True);
myDoc->GetAISContext()->Display (myShape, Standard_False);
myDoc->GetAISContext()->Display (myShape);
}
else
{
// deactivate clipping plane
myClippingPlane->SetOn (Standard_False);
myDoc->GetAISContext()->Remove (myShape, Standard_False);
myDoc->GetAISContext()->Remove (myShape);
}
myView->Update();
@@ -275,7 +275,7 @@ void CModelClippingDlg::OnCancel()
if (!myShape.IsNull())
{
myDoc->GetAISContext()->Remove (myShape, Standard_False);
myDoc->GetAISContext()->Remove (myShape);
}
myView->Update();
@@ -291,7 +291,7 @@ void CModelClippingDlg::OnOK()
{
if (!myShape.IsNull())
{
myDoc->GetAISContext()->Remove (myShape, Standard_True);
myDoc->GetAISContext()->Remove (myShape);
}
CDialog::OnOK();

View File

@@ -100,7 +100,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicSurface, Standard_True);
getAISContext()->Display (aGraphicSurface);
}
return aGraphicSurface;
@@ -125,7 +125,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve, Standard_True);
getAISContext()->Display (aGraphicCurve);
}
return aGraphicCurve;
@@ -172,7 +172,7 @@ Handle(AIS_Point) OCCDemo_Presentation::drawPoint
getAISContext()->SetColor (aGraphicPoint, theColor, toDisplay);
if (toDisplay) {
getAISContext()->Display (aGraphicPoint, Standard_True);
getAISContext()->Display (aGraphicPoint);
//COCCDemoDoc::Fit();
}
@@ -210,7 +210,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve, Standard_True);
getAISContext()->Display (aGraphicCurve);
}
return aGraphicCurve;
@@ -231,7 +231,7 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape, Standard_True);
getAISContext()->Display (aGraphicShape);
}
return aGraphicShape;
@@ -251,7 +251,7 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
CViewer3dDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape, Standard_True);
getAISContext()->Display (aGraphicShape);
}
return aGraphicShape;

View File

@@ -135,34 +135,25 @@ void COffsetDlg::SetOffsets(Standard_Real theFactor, Standard_Real theUnits)
Standard_ShortReal aFactor = (Standard_ShortReal)theFactor;
Standard_ShortReal aUnits = (Standard_ShortReal)theUnits;
for (aAISContext->InitSelected(); aAISContext->MoreSelected(); aAISContext->NextSelected())
if (aAISContext->IsDisplayed(aAISContext->SelectedInteractive())) OneOrMoreCurrentIsDisplayed=true;
for (aAISContext->InitCurrent();aAISContext->MoreCurrent ();aAISContext->NextCurrent ())
if (aAISContext->IsDisplayed(aAISContext->Current())) OneOrMoreCurrentIsDisplayed=true;
if(OneOrMoreCurrentIsDisplayed){
// A small trick to avoid complier error (C2668).
const Handle(AIS_InteractiveObject)& anIOOverlappedBox = aOverlappedBox;
const Handle(AIS_InteractiveObject)& anIOBox = aBox;
if((aAISContext->IsSelected(anIOOverlappedBox) || aAISContext->IsSelected(anIOBox))
if((aAISContext->IsCurrent(aOverlappedBox) || aAISContext->IsCurrent(aBox))
&& aAISContext->IsDisplayed(aOverlappedBox)){
aOverlappedBox->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits);
Message = "Box2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n";
//myDoc -> AddTextInDialog(Message);
}
// A small trick to avoid complier error (C2668).
const Handle(AIS_InteractiveObject)& anIOOverlappedCylinder = aOverlappedCylinder;
const Handle(AIS_InteractiveObject)& anIOCylinder = aCylinder;
if((aAISContext->IsSelected(anIOOverlappedCylinder) || aAISContext->IsSelected(anIOCylinder))
if((aAISContext->IsCurrent(aOverlappedCylinder) || aAISContext->IsCurrent(aCylinder))
&& aAISContext->IsDisplayed(aOverlappedCylinder)){
aOverlappedCylinder->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits);
Message = Message + "Cylinder2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n";
//myDoc -> AddTextInDialog(Message);
}
// A small trick to avoid complier error (C2668).
const Handle(AIS_InteractiveObject)& anIOOverlappedSphere = aOverlappedSphere;
const Handle(AIS_InteractiveObject)& anIOSphere = aSphere;
if((aAISContext->IsSelected(anIOOverlappedSphere) || aAISContext->IsSelected(anIOSphere))
if((aAISContext->IsCurrent(aOverlappedSphere) || aAISContext->IsCurrent(aSphere))
&& aAISContext->IsDisplayed(aOverlappedSphere)){
aOverlappedSphere->SetPolygonOffsets(Aspect_POM_Fill,aFactor,aUnits);
Message = Message + "Sphere2 -> SetPolygonOffsets(Aspect_POM_Fill, Factor, Units);\n";
@@ -218,23 +209,18 @@ void COffsetDlg::UpdateValues()
BOOL IsOverlappedSphereDisplayed = aAISContext->IsDisplayed(aOverlappedSphere);
BOOL IsOverlappedBoxDisplayed = aAISContext->IsDisplayed(aOverlappedBox);
const Handle(AIS_InteractiveObject)& anIOOverlappedCylinder = aOverlappedCylinder;
const Handle(AIS_InteractiveObject)& anIOOverlappedSphere = aOverlappedSphere;
const Handle(AIS_InteractiveObject)& anIOOverlappedBox = aOverlappedBox;
BOOL IsOverlappedCylinderCurrent = aAISContext->IsSelected(anIOOverlappedCylinder);
BOOL IsOverlappedSphereCurrent = aAISContext->IsSelected(anIOOverlappedSphere);
BOOL IsOverlappedBoxCurrent = aAISContext->IsSelected(anIOOverlappedBox);
BOOL IsOverlappedCylinderCurrent = aAISContext->IsCurrent(aOverlappedCylinder);
BOOL IsOverlappedSphereCurrent = aAISContext->IsCurrent(aOverlappedSphere);
BOOL IsOverlappedBoxCurrent = aAISContext->IsCurrent(aOverlappedBox);
/*BOOL IsAnyOverlappedObjectCurrent =
IsOverlappedCylinderCurrent || IsOverlappedSphereCurrent || IsOverlappedBoxCurrent;*/
const Handle(AIS_InteractiveObject)& anIOCylinder = aCylinder;
const Handle(AIS_InteractiveObject)& anIOSphere = aSphere;
const Handle(AIS_InteractiveObject)& anIOBox = aBox;
BOOL IsCylinderCurrent = aAISContext->IsSelected(anIOCylinder);
BOOL IsSphereCurrent = aAISContext->IsSelected(anIOSphere);
BOOL IsBoxCurrent = aAISContext->IsSelected(anIOBox);
BOOL IsCylinderCurrent = aAISContext->IsCurrent(aCylinder);
BOOL IsSphereCurrent = aAISContext->IsCurrent(aSphere);
BOOL IsBoxCurrent = aAISContext->IsCurrent(aBox);
BOOL IsAnyObjectCurrent =
IsOverlappedCylinderCurrent || IsOverlappedSphereCurrent || IsOverlappedBoxCurrent
@@ -244,8 +230,8 @@ void COffsetDlg::UpdateValues()
IsOverlappedCylinderDisplayed || IsOverlappedSphereDisplayed || IsOverlappedBoxDisplayed;
Standard_Boolean OneOrMoreCurrentIsDisplayed=false;
for (aAISContext->InitSelected();aAISContext->MoreSelected ();aAISContext->NextSelected ())
if (aAISContext->IsDisplayed(aAISContext->SelectedInteractive())) OneOrMoreCurrentIsDisplayed=true;
for (aAISContext->InitCurrent();aAISContext->MoreCurrent ();aAISContext->NextCurrent ())
if (aAISContext->IsDisplayed(aAISContext->Current())) OneOrMoreCurrentIsDisplayed=true;
if(OneOrMoreCurrentIsDisplayed){
if(IsOverlappedBoxDisplayed && (IsBoxCurrent || IsOverlappedBoxCurrent)){

View File

@@ -56,7 +56,7 @@ void TexturesExt_Presentation::DoSample()
{
((CViewer3dApp*) AfxGetApp())->SetSampleName (L"Viewer3d");
((CViewer3dApp*) AfxGetApp())->SetSamplePath (L"..\\..\\04_Viewer3d");
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
{
// turn lights on for terrain sample
@@ -299,7 +299,7 @@ void TexturesExt_Presentation::sampleTerrain()
aTransform.Perform(aFaces(1));
aShape = aTransform;
getAISContext()->Display (Texturize (aShape, "terrain.gif"), Standard_True);
getAISContext()->Display(Texturize(aShape, "terrain.gif"));
}

View File

@@ -153,10 +153,10 @@ void CViewer3dDoc::OnBox()
myBox = new AIS_Shape(B.Shape());
myAISContext->SetMaterial (myBox, Graphic3d_NOM_PEWTER, Standard_False);
myAISContext->SetDisplayMode (myBox, 1, Standard_False);
myAISContext->SetMaterial(myBox,Graphic3d_NOM_PEWTER);
myAISContext->SetDisplayMode(myBox,1);
myAISContext->Display (myBox, Standard_True);
myAISContext->Display(myBox);
TCollection_AsciiString Message("\
BRepPrimAPI_MakeBox Box1(gp_Pnt(0,-400,-100), 200.,150.,100.);\n\
");
@@ -172,9 +172,9 @@ void CViewer3dDoc::OnCylinder()
gp_Ax2 CylAx2(gp_Pnt(0,0,-100), gp_Dir(gp_Vec(gp_Pnt(0,0,-100),gp_Pnt(0,0,100))));
myCylinder = new User_Cylinder(CylAx2, 80.,200.);
myAISContext->SetDisplayMode (myCylinder, 1, Standard_False);
myAISContext->SetDisplayMode(myCylinder,1);
myAISContext->Display (myCylinder, Standard_True);
myAISContext->Display(myCylinder);
TCollection_AsciiString Message("\
gp_Ax2 CylAx2(gp_Pnt(0,0,-100), gp_Dir(gp_Vec(gp_Pnt(0,0,-100),gp_Pnt(0,0,100))));\n\
@@ -193,10 +193,10 @@ void CViewer3dDoc::OnSphere()
mySphere = new AIS_Shape(S.Shape());
myAISContext->SetMaterial (mySphere, Graphic3d_NOM_BRONZE, Standard_False);
myAISContext->SetDisplayMode (mySphere, 1, Standard_False);
myAISContext->SetMaterial(mySphere,Graphic3d_NOM_BRONZE);
myAISContext->SetDisplayMode(mySphere,1);
myAISContext->Display (mySphere, Standard_False);
myAISContext->Display(mySphere);
TCollection_AsciiString Message("\
BRepPrimAPI_MakeSphere S(gp_Pnt(0,300,0), 100.);\n\
");
@@ -212,10 +212,10 @@ void CViewer3dDoc::OnRemoveAll()
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aListOfObjects);aListIterator.More();aListIterator.Next()){
myAISContext->Remove (aListIterator.Value(), Standard_False);
myAISContext->Remove(aListIterator.Value());
}
myAISContext->Remove (myCylinder, Standard_True);
myAISContext->Remove(myCylinder);
myCylinder.Nullify();
@@ -240,10 +240,10 @@ void CViewer3dDoc::OnOverlappedBox()
myOverlappedBox = new AIS_Shape(aBoxShape2);
myAISContext->SetMaterial (myOverlappedBox, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->SetDisplayMode (myOverlappedBox, 1, Standard_False);
myAISContext->SetMaterial(myOverlappedBox,Graphic3d_NOM_GOLD);
myAISContext->SetDisplayMode(myOverlappedBox,1);
myAISContext->Display (myOverlappedBox, Standard_True);
myAISContext->Display(myOverlappedBox);
TCollection_AsciiString Message("\
BRepPrimAPI_MakeBox Box1(gp_Pnt(0,-400,-100), 200.,150.,100.);\n\
\n\
@@ -270,10 +270,10 @@ void CViewer3dDoc::OnOverlappedCylinder()
myOverlappedCylinder = new AIS_Shape(aCylShape2);
myAISContext->SetMaterial (myOverlappedCylinder, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->SetDisplayMode (myOverlappedCylinder, 1, Standard_False);
myAISContext->SetMaterial(myOverlappedCylinder,Graphic3d_NOM_GOLD);
myAISContext->SetDisplayMode(myOverlappedCylinder,1);
myAISContext->Display (myOverlappedCylinder, Standard_True);
myAISContext->Display(myOverlappedCylinder);
TCollection_AsciiString Message("\
gp_Ax2 CylAx2(gp_Pnt(0,0,-100), gp_Dir(gp_Vec(gp_Pnt(0,0,-100),gp_Pnt(0,0,100))));\n\
@@ -301,11 +301,11 @@ void CViewer3dDoc::OnOverlappedSphere()
myOverlappedSphere = new AIS_Shape(aSphereShape2);
myAISContext->SetMaterial (myOverlappedSphere, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->SetMaterial(myOverlappedSphere,Graphic3d_NOM_GOLD);
myAISContext->SetDisplayMode (myOverlappedSphere, 1, Standard_False);
myAISContext->SetDisplayMode(myOverlappedSphere,1);
myAISContext->Display (myOverlappedSphere, Standard_True);
myAISContext->Display(myOverlappedSphere);
TCollection_AsciiString Message("\
BRepPrimAPI_MakeSphere Sphere1(gp_Pnt(0,300,0), 100.);\n\
@@ -403,34 +403,27 @@ void CViewer3dDoc::OnUpdateOverlappedBox(CCmdUI* pCmdUI)
void CViewer3dDoc::OnObjectRemove()
{
// A small trick to avoid complier error (C2668).
const Handle(AIS_InteractiveObject)& aBox = myBox;
if(myAISContext->IsSelected (aBox))
if(myAISContext->IsCurrent(myBox))
myBox.Nullify();
const Handle(AIS_InteractiveObject)& aCylinder = myCylinder;
if(myAISContext->IsSelected (aCylinder))
if(myAISContext->IsCurrent(myCylinder))
myCylinder.Nullify();
const Handle(AIS_InteractiveObject)& aSphere = mySphere;
if(myAISContext->IsSelected (aSphere))
if(myAISContext->IsCurrent(mySphere))
mySphere.Nullify();
const Handle(AIS_InteractiveObject)& anOverlappedBox = myOverlappedBox;
if(myAISContext->IsSelected (anOverlappedBox))
if(myAISContext->IsCurrent(myOverlappedBox))
myOverlappedBox.Nullify();
const Handle(AIS_InteractiveObject)& anOverlappedCylinder = myOverlappedCylinder;
if(myAISContext->IsSelected (anOverlappedCylinder))
if(myAISContext->IsCurrent(myOverlappedCylinder))
myOverlappedCylinder.Nullify();
const Handle(AIS_InteractiveObject)& anOverlappedSphere = myOverlappedSphere;
if(myAISContext->IsSelected (anOverlappedSphere))
if(myAISContext->IsCurrent(myOverlappedSphere))
myOverlappedSphere.Nullify();
for(myAISContext->InitSelected();myAISContext->MoreSelected();myAISContext->InitSelected())
myAISContext->Remove(myAISContext->SelectedInteractive(),Standard_True);
for(myAISContext->InitCurrent();myAISContext->MoreCurrent();myAISContext->InitCurrent())
myAISContext->Remove(myAISContext->Current(),Standard_True);
if(myOffsetDlg && myOffsetDlg->IsWindowVisible())
myOffsetDlg->UpdateValues();
@@ -506,7 +499,7 @@ void CViewer3dDoc::InputEvent(const Standard_Integer /*x*/,
Quantity_Color CSFColor;
COLORREF MSColor;
myAISContext->Select (Standard_True);
myAISContext->Select();
// Change the color of a selected face in a user cylinder
if (myState == FACE_COLOR)
@@ -537,8 +530,9 @@ void CViewer3dDoc::InputEvent(const Standard_Integer /*x*/,
Handle(AIS_InteractiveObject) aSelectedObject = myAISContext->SelectedInteractive();
Handle(User_Cylinder)::DownCast (aSelectedObject)->SetColor (CSFColor.Name());
myAISContext->Redisplay (aSelectedObject, Standard_True);
myAISContext->Redisplay (aSelectedObject);
myState = -1;
myAISContext->CloseLocalContext();
}
}
@@ -594,22 +588,20 @@ void CViewer3dDoc::ShiftInputEvent (const Standard_Integer theX,
void CViewer3dDoc::OnObjectColoredMesh()
{
for(myAISContext->InitSelected();myAISContext->MoreSelected();myAISContext->NextSelected())
if (myAISContext->SelectedInteractive()->IsKind(STANDARD_TYPE(User_Cylinder)))
for(myAISContext->InitCurrent();myAISContext->MoreCurrent();myAISContext->NextCurrent())
if (myAISContext->Current()->IsKind(STANDARD_TYPE(User_Cylinder)))
{
myAISContext->ClearPrs(myAISContext->SelectedInteractive(),6,Standard_False);
myAISContext->RecomputePrsOnly(myAISContext->SelectedInteractive(), Standard_False);
myAISContext->SetDisplayMode(myAISContext->SelectedInteractive(), 6, Standard_False);
myAISContext->ClearPrs(myAISContext->Current(),6,Standard_False);
myAISContext->RecomputePrsOnly(myAISContext->Current(),Standard_False);
myAISContext->SetDisplayMode(myAISContext->Current(),6);
}
myAISContext->UpdateCurrentViewer();
}
void CViewer3dDoc::OnUpdateObjectColoredMesh(CCmdUI* pCmdUI)
{
bool CylinderIsCurrentAndDisplayed = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if(myAISContext->SelectedInteractive()->IsKind(STANDARD_TYPE(User_Cylinder)))
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if(myAISContext->Current()->IsKind(STANDARD_TYPE(User_Cylinder)))
CylinderIsCurrentAndDisplayed=true;
pCmdUI->Enable (CylinderIsCurrentAndDisplayed);
}
@@ -617,8 +609,8 @@ void CViewer3dDoc::OnUpdateObjectColoredMesh(CCmdUI* pCmdUI)
void CViewer3dDoc::OnUpdateObjectWireframe(CCmdUI* pCmdUI)
{
bool OneOrMoreInShadingOrColoredMesh = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(), 1) || myAISContext->IsDisplayed(myAISContext->SelectedInteractive(), 6))
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1) || myAISContext->IsDisplayed(myAISContext->Current(),6))
OneOrMoreInShadingOrColoredMesh=true;
pCmdUI->Enable (OneOrMoreInShadingOrColoredMesh);
}
@@ -627,8 +619,8 @@ void CViewer3dDoc::OnUpdateObjectWireframe(CCmdUI* pCmdUI)
void CViewer3dDoc::OnUpdateObjectShading(CCmdUI* pCmdUI)
{
bool OneOrMoreInWireframeOrColoredMesh = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),0) || myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),6))
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),0) || myAISContext->IsDisplayed(myAISContext->Current(),6))
OneOrMoreInWireframeOrColoredMesh=true;
pCmdUI->Enable (OneOrMoreInWireframeOrColoredMesh);
}
@@ -637,14 +629,14 @@ void CViewer3dDoc::OnOptionsTrihedronDynamicTrihedron()
{
if (myAISContext -> IsDisplayed(myTrihedron))
{
myAISContext->Remove(myTrihedron, Standard_True);
myAISContext->Remove(myTrihedron);
}
else
{
Handle(Geom_Axis2Placement) myTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
myTrihedron=new AIS_Trihedron(myTrihedronAxis);
myAISContext->SetTrihedronSize(200, Standard_False);
myAISContext->Display(myTrihedron, Standard_True);
myAISContext->SetTrihedronSize(200, Standard_True);
myAISContext->Display(myTrihedron);
}
}
@@ -676,10 +668,10 @@ void CViewer3dDoc::Popup (const Standard_Integer x,
{
myPopupMenuNumber=0;
// Specified check for context menu number to call
myAISContext->InitSelected();
if (myAISContext->MoreSelected())
myAISContext->InitCurrent();
if (myAISContext->MoreCurrent())
{
if (myAISContext->SelectedInteractive()->IsKind(STANDARD_TYPE(User_Cylinder)))
if (myAISContext->Current()->IsKind(STANDARD_TYPE(User_Cylinder)))
{
myPopupMenuNumber = 2;
//return;
@@ -691,7 +683,9 @@ void CViewer3dDoc::Popup (const Standard_Integer x,
//Set faces selection mode
void CViewer3dDoc::OnFaces()
{
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_FACE));
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_FACE);
myCResultDialog.SetTitle("Standard mode: TopAbs_FACE");
myCResultDialog.SetText(" myAISContext->OpenLocalContext(); \n"
@@ -704,7 +698,9 @@ void CViewer3dDoc::OnFaces()
//Set edges selection mode
void CViewer3dDoc::OnEdges()
{
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_EDGE);
myCResultDialog.SetTitle("Standard mode: TopAbs_EDGE");
myCResultDialog.SetText(" myAISContext->OpenLocalContext(); \n"
@@ -717,7 +713,9 @@ void CViewer3dDoc::OnEdges()
// Set vertices selection mode
void CViewer3dDoc::OnVertices()
{
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX));
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_VERTEX);
myCResultDialog.SetTitle("Standard mode: TopAbs_VERTEX");
myCResultDialog.SetText(" myAISContext->OpenLocalContext(); \n"
@@ -730,6 +728,8 @@ void CViewer3dDoc::OnVertices()
//Neutral selection mode
void CViewer3dDoc::OnNeutral()
{
myAISContext->CloseAllContexts();
myCResultDialog.SetTitle("Standard mode: Neutral");
myCResultDialog.SetText(" myAISContext->CloseAllContexts(); \n"
" \n");
@@ -739,7 +739,8 @@ void CViewer3dDoc::OnNeutral()
// Change the color of faces on a user cylinder
void CViewer3dDoc::OnUsercylinderChangefacecolor()
{
myAISContext->Activate(myAISContext->SelectedInteractive(), 4);
myAISContext->OpenLocalContext();
myAISContext->Activate(myAISContext->Current(),4);
myState = FACE_COLOR;
// see the following of treatment in inputevent
}
@@ -749,6 +750,13 @@ void CViewer3dDoc::OnUsercylinderChangefacecolor()
// before running this function
void CViewer3dDoc::OnFillet3d()
{
if (!myAISContext->HasOpenedContext())
{
AfxMessageBox (L"It is necessary to activate the edges selection mode\n"
L"and select edges on an object before \nrunning this function");
return;
}
myAISContext->InitSelected();
if (myAISContext->MoreSelected())
{
@@ -802,7 +810,7 @@ void CViewer3dDoc::OnFillet3d()
}
aSelInteractive ->Set (aNewShape);
myAISContext->Redisplay (aSelInteractive, Standard_True);
myAISContext->Redisplay (aSelInteractive);
}
myCResultDialog.SetTitle("Make a fillet");
@@ -834,7 +842,7 @@ void CViewer3dDoc::OnCircle()
// Handle(AIS_Circle) anAISCirc = new AIS_Circle(C.Value());
Handle(AIS_Circle) anAISCirc = new AIS_Circle(aGeomCircle);
myAISContext->Display (anAISCirc, Standard_True);
myAISContext->Display (anAISCirc);
myCResultDialog.SetTitle("Create a circle");
myCResultDialog.SetText(" GC_MakeCircle C(gp_Pnt(-100.,-300.,0.),gp_Pnt(-50.,-200.,0.),gp_Pnt(-10.,-250.,0.)); \n"
@@ -852,7 +860,7 @@ void CViewer3dDoc::OnLine()
gp_Lin aGpLin (gp_Pnt (0., 0., 0.), gp_Dir(1., 0., 0.));
Handle(Geom_Line) aGeomLin = new Geom_Line (aGpLin);
Handle(AIS_Line) anAISLine = new AIS_Line (aGeomLin);
myAISContext->Display (anAISLine, Standard_True);
myAISContext->Display (anAISLine);
myCResultDialog.SetTitle("Create a line");
myCResultDialog.SetText(" gp_Lin L(gp_Pnt(0.,0.,0.),gp_Dir(1.,0.,0.)); \n"
@@ -896,8 +904,8 @@ BOOL CViewer3dDoc::OnNewDocument()
// (SDI documents will reuse this document)
SetTitle(myPresentation->GetName());
myAISContext->EraseAll (Standard_False);
myAISContext->SetDisplayMode(AIS_Shaded, Standard_True);
myAISContext->EraseAll();
myAISContext->SetDisplayMode(AIS_Shaded);
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
@@ -956,14 +964,14 @@ void CViewer3dDoc::DoSample()
void CViewer3dDoc::OnBUTTONStart()
{
myAISContext->EraseAll (Standard_True);
myAISContext->EraseAll();
myPresentation->FirstSample();
DoSample();
}
void CViewer3dDoc::OnBUTTONEnd()
{
myAISContext->EraseAll (Standard_True);
myAISContext->EraseAll();
myPresentation->LastSample();
DoSample();
}

View File

@@ -401,6 +401,7 @@ void CViewer3dView::OnLButtonDown(UINT nFlags, CPoint point)
{
p1 = ConvertClickToPoint(point.x,point.y,myView);
myCurrent_PositionalLight->SetPosition(p1.X(),p1.Y(),p1.Z()) ;
GetDocument()->GetAISContext()->CloseLocalContext();
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Ready");
myCurrentMode = CurAction3d_Nothing;
@@ -422,7 +423,7 @@ GetDocument()->UpdateResultMessageDlg("SetPosition",Message);
BRepPrimAPI_MakeCone MakeCone(gp_Ax2(p1, gp_Dir(gp_Vec(p1, p2))),
0, (p1.Distance(p2))/tan(1.04), coneHeigth);
spotConeShape->Set(MakeCone.Solid());
GetDocument()->GetAISContext()->Display (spotConeShape, 0, -1, Standard_True);
GetDocument()->GetAISContext()->Display(spotConeShape,0,-1);
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Pick the target point");
myCurrentMode = CurAction3d_TargetSpotLight;
@@ -447,7 +448,8 @@ GetDocument()->UpdateResultMessageDlg("SetAngle",Message);
}
break;
case CurAction3d_EndSpotLight :
GetDocument()->GetAISContext()->Erase (spotConeShape, Standard_True);
GetDocument()->GetAISContext()->Erase(spotConeShape);
GetDocument()->GetAISContext()->CloseLocalContext();
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Ready");
myCurrentMode = CurAction3d_Nothing;
break;
@@ -457,7 +459,7 @@ GetDocument()->UpdateResultMessageDlg("SetAngle",Message);
p2 = gp_Pnt(p1.X(),p1.Y(),p1.Z()+1.);
BRepBuilderAPI_MakeEdge MakeEdge(p1, p2);
directionalEdgeShape->Set(MakeEdge.Edge());
GetDocument()->GetAISContext()->Display (directionalEdgeShape, 0, -1, Standard_True);
GetDocument()->GetAISContext()->Display(directionalEdgeShape,0,-1);
// Create a directional light
myCurrent_DirectionalLight = new V3d_DirectionalLight(myView->Viewer(), p1.X(),p1.Y(),p1.Z(),0.,0.,1.);
myView->SetLightOn(myCurrent_DirectionalLight);
@@ -474,7 +476,8 @@ GetDocument()->UpdateResultMessageDlg("SetDirection",Message);
}
break;
case CurAction3d_EndDirectionalLight:
GetDocument()->GetAISContext()->Erase (directionalEdgeShape, Standard_True);
GetDocument()->GetAISContext()->Erase(directionalEdgeShape);
GetDocument()->GetAISContext()->CloseLocalContext();
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Ready");
myCurrentMode = CurAction3d_Nothing;
break;
@@ -885,6 +888,7 @@ void CViewer3dView::OnDirectionalLight()
UpdateData(TRUE);
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Pick a first point");
GetDocument()->GetAISContext()->OpenLocalContext();
myCurrentMode = CurAction3d_BeginDirectionalLight;
TCollection_AsciiString Message("\
@@ -910,6 +914,7 @@ void CViewer3dView::OnSpotLight()
return;
}
GetDocument()->GetAISContext()->OpenLocalContext();
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Pick the light position");
myCurrentMode = CurAction3d_BeginSpotLight;
@@ -936,6 +941,7 @@ void CViewer3dView::OnPositionalLight()
return;
}
GetDocument()->GetAISContext()->OpenLocalContext();
myCurrent_PositionalLight=new V3d_PositionalLight(myView->Viewer(),0,0,0,Quantity_NOC_GREEN,1,0);
myView->SetLightOn(myCurrent_PositionalLight);
NbActiveLights++;
@@ -965,9 +971,11 @@ void CViewer3dView::OnAmbientLight()
return;
}
GetDocument()->GetAISContext()->OpenLocalContext();
myCurrent_AmbientLight=new V3d_AmbientLight(myView->Viewer(), Quantity_NOC_GRAY);
myView->SetLightOn(myCurrent_AmbientLight) ;
NbActiveLights++;
GetDocument()->GetAISContext()->CloseLocalContext();
myView->UpdateLights();
@@ -1175,18 +1183,18 @@ void CViewer3dView::RedrawVisMode()
switch (myVisMode)
{
case VIS_WIREFRAME:
GetDocument()->GetAISContext()->SetDisplayMode (AIS_WireFrame, Standard_True);
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
myView->SetComputedMode (Standard_False);
break;
case VIS_SHADE:
GetDocument()->GetAISContext()->SetDisplayMode (AIS_Shaded, Standard_True);
GetDocument()->GetAISContext()->SetDisplayMode(AIS_Shaded);
myView->SetComputedMode (Standard_False);
break;
case VIS_HLR:
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetComputedMode (Standard_True);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
GetDocument()->GetAISContext()->SetDisplayMode (AIS_WireFrame, Standard_True);
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
break;
}
}

View File

@@ -45,9 +45,8 @@ void CColoredShapes::Display(Handle(AIS_InteractiveContext)& anAIScontext)
for ( TopoDS_ListIteratorOfListOfShape iter(m_shapeList); iter.More(); iter.Next() )
{
Handle(AIS_Shape) ais = new AIS_Shape(iter.Value());
anAIScontext->SetColor(ais, (Quantity_NameOfColor)m_colorMap.Find(iter.Value()), Standard_False);
anAIScontext->SetMaterial(ais, Graphic3d_NOM_GOLD, Standard_False);
anAIScontext->SetColor(ais, (Quantity_NameOfColor)m_colorMap.Find(iter.Value()));
anAIScontext->SetMaterial(ais, Graphic3d_NOM_GOLD, Standard_False);
anAIScontext->Display(ais, Standard_False);
}
anAIScontext->UpdateCurrentViewer();
}

View File

@@ -190,8 +190,8 @@ void CImportExportDoc::Popup(const Standard_Integer x,
const Handle(V3d_View)& aView )
{
Standard_Integer PopupMenuNumber=0;
myAISContext->InitSelected();
if (myAISContext->MoreSelected())
myAISContext->InitCurrent();
if (myAISContext->MoreCurrent())
PopupMenuNumber=1;
CMenu menu;
@@ -202,8 +202,8 @@ void CImportExportDoc::Popup(const Standard_Integer x,
if (PopupMenuNumber == 1) // more than 1 object.
{
bool OneOrMoreInShading = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1)) OneOrMoreInShading=true;
if(!OneOrMoreInShading)
pPopup->EnableMenuItem(5, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
}
@@ -224,7 +224,7 @@ void CImportExportDoc::OnBox()
myAISContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){
myAISContext->Remove (aListIterator.Value(), Standard_False);
myAISContext->Remove(aListIterator.Value());
}
BRepPrimAPI_MakeBox B(200.,150.,100.);
@@ -244,7 +244,7 @@ void CImportExportDoc::OnCylinder()
myAISContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){
myAISContext->Remove (aListIterator.Value(), Standard_False);
myAISContext->Remove(aListIterator.Value());
}
BRepPrimAPI_MakeCylinder C(50.,200.);
@@ -260,8 +260,8 @@ void CImportExportDoc::OnCylinder()
void CImportExportDoc::OnObjectRemove()
{
for(GetAISContext()->InitSelected();GetAISContext()->MoreSelected();GetAISContext()->NextSelected()) {
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(GetAISContext()->SelectedInteractive());
for(GetAISContext()->InitCurrent();GetAISContext()->MoreCurrent();GetAISContext()->NextCurrent()) {
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(GetAISContext()->Current());
if(!aShape.IsNull()) {
m_pcoloredshapeList->Remove(aShape->Shape());
}
@@ -272,8 +272,8 @@ void CImportExportDoc::OnObjectRemove()
void CImportExportDoc::OnObjectErase()
{
for(GetAISContext()->InitSelected();GetAISContext()->MoreSelected();GetAISContext()->NextSelected()) {
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(GetAISContext()->SelectedInteractive());
for(GetAISContext()->InitCurrent();GetAISContext()->MoreCurrent();GetAISContext()->NextCurrent()) {
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(GetAISContext()->Current());
if(!aShape.IsNull()) {
m_pcoloredshapeList->Remove(aShape->Shape());
}

View File

@@ -74,7 +74,7 @@ COcafDoc::~COcafDoc()
Handle(AIS_InteractiveContext) CTX;
TPrsStd_AISViewer::Find(myOcafDoc->Main(), CTX);
CTX->SetDisplayMode (AIS_Shaded, Standard_True);
CTX->SetDisplayMode(AIS_Shaded);
myAISContext=CTX;
// Set the maximum number of available "undo" actions
@@ -316,8 +316,8 @@ D->CommitCommand(); \n\
void COcafDoc::OnModify()
{
// Get the selected interactive object
myAISContext->InitSelected();
Handle(AIS_InteractiveObject) curAISObject = myAISContext->SelectedInteractive();
myAISContext->InitCurrent();
Handle(AIS_InteractiveObject) curAISObject = myAISContext->Current();
// Get the main label of the selected object
@@ -678,17 +678,17 @@ D->CommitCommand(); \n\
void COcafDoc::OnUpdateModify(CCmdUI* pCmdUI)
{
// Disable the "modify" button if there is no selected object or several selected objects
myAISContext->InitSelected();
if(myAISContext->NbSelected()!=1)
myAISContext->InitCurrent();
if(myAISContext->NbCurrents()!=1)
{
pCmdUI->Enable(Standard_False);
return;
}
// Get the root label of the selected object using its TPrsStd_AISPresentation
myAISContext->InitSelected();
myAISContext->InitCurrent();
Handle(TPrsStd_AISPresentation) ObjectPrs =
Handle(TPrsStd_AISPresentation)::DownCast(myAISContext->SelectedInteractive()->GetOwner());
Handle(TPrsStd_AISPresentation)::DownCast(myAISContext->Current()->GetOwner());
if (!ObjectPrs.IsNull()){
TDF_Label LabObject = ObjectPrs->Label();
@@ -815,10 +815,10 @@ void COcafDoc::OnObjectDelete()
D->NewCommand();
AIS_SequenceOfInteractive aSequence;
for(myAISContext->InitSelected();
myAISContext->MoreSelected();
myAISContext->NextSelected())
aSequence.Append(myAISContext->SelectedInteractive());
for(myAISContext->InitCurrent();
myAISContext->MoreCurrent();
myAISContext->NextCurrent())
aSequence.Append(myAISContext->Current());
for(int iter=1;iter <=aSequence.Length();iter++)
{
@@ -860,8 +860,8 @@ void COcafDoc::OnObjectDelete()
void COcafDoc::OnUpdateObjectDelete(CCmdUI* pCmdUI)
{
myAISContext->InitSelected();
pCmdUI->Enable (myAISContext->MoreSelected());
myAISContext->InitCurrent();
pCmdUI->Enable (myAISContext->MoreCurrent());
}
void COcafDoc::DisplayPrs()
@@ -1107,7 +1107,7 @@ BOOL COcafDoc::OnOpenDocument(LPCTSTR lpszPathName)
Handle(AIS_InteractiveContext) aContext;
TPrsStd_AISViewer::Find (myOcafDoc->Main(), aContext);
aContext->SetDisplayMode (AIS_Shaded, Standard_True);
aContext->SetDisplayMode (AIS_Shaded);
myAISContext = aContext;
// Display the presentations (which was not stored in the document)
@@ -1172,8 +1172,8 @@ void COcafDoc::Popup(const Standard_Integer x,
const Handle(V3d_View)& aView )
{
Standard_Integer PopupMenuNumber=0;
myAISContext->InitSelected();
if (myAISContext->MoreSelected())
myAISContext->InitCurrent();
if (myAISContext->MoreCurrent())
PopupMenuNumber=1;
CMenu menu;
@@ -1184,8 +1184,8 @@ void COcafDoc::Popup(const Standard_Integer x,
if (PopupMenuNumber == 1) // more than 1 object.
{
bool OneOrMoreInShading = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1)) OneOrMoreInShading=true;
if(!OneOrMoreInShading)
pPopup->EnableMenuItem(5, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
}

View File

@@ -37,7 +37,7 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres
{
GeomAdaptor_Curve anAdaptorCurve(myCurve);
if (hasOwnColor)
myDrawer->LineAspect()->SetColor (myDrawer->Color());
myDrawer->LineAspect()->SetColor(myOwnColor);
myDrawer->Link()->SetDiscretisation(100);
myDrawer->Link()->SetMaximalParameterValue(500);

View File

@@ -101,7 +101,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
CTriangulationDoc::Fit();
}
else
getAISContext()->Display (aGraphicSurface, Standard_True);
getAISContext()->Display (aGraphicSurface);
}
return aGraphicSurface;
@@ -126,7 +126,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
CTriangulationDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve, Standard_True);
getAISContext()->Display (aGraphicCurve);
}
return aGraphicCurve;
@@ -173,7 +173,7 @@ Handle(AIS_Point) OCCDemo_Presentation::drawPoint
getAISContext()->SetColor (aGraphicPoint, theColor, toDisplay);
if (toDisplay) {
getAISContext()->Display (aGraphicPoint, Standard_True);
getAISContext()->Display (aGraphicPoint);
//COCCDemoDoc::Fit();
}
@@ -211,7 +211,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
CTriangulationDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve, Standard_True);
getAISContext()->Display (aGraphicCurve);
}
return aGraphicCurve;
@@ -232,7 +232,7 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
CTriangulationDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape, Standard_True);
getAISContext()->Display (aGraphicShape);
}
return aGraphicShape;
@@ -252,7 +252,7 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
CTriangulationDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape, Standard_True);
getAISContext()->Display (aGraphicShape);
}
return aGraphicShape;

View File

@@ -66,7 +66,7 @@ void Tesselate_Presentation::DoSample()
{
((CTriangulationApp*) AfxGetApp())->SetSampleName (L"Tesselate");
((CTriangulationApp*) AfxGetApp())->SetSamplePath (L"");
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbSamples)
sample (myFileNames[myIndex]);
}
@@ -269,11 +269,11 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
}
}
getAISContext()->EraseAll (Standard_False);
getAISContext()->EraseAll();
aShowShape = drawShape(aShape);
if(WAIT_A_SECOND) return;
aShowEdge = drawShape(aComp2,Quantity_NOC_GREEN);
getAISContext()->Erase (aShowShape, Standard_True);
getAISContext()->Erase(aShowShape);
if(WAIT_A_SECOND) return;
}
}
@@ -368,7 +368,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
if(aCount == aNumOfFace)
{
aShowFace = drawShape(aComp1,Quantity_NOC_GREEN);
getAISContext()->Erase (aShowEdge, Standard_True);
getAISContext()->Erase(aShowEdge);
}
}
else
@@ -389,7 +389,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
if(WAIT_A_SECOND) return;
drawShape(aCompound,Quantity_NOC_GREEN);
getAISContext()->Erase (aShowFace, Standard_True);
getAISContext()->Erase(aShowFace);
}

View File

@@ -75,7 +75,7 @@ void CTriangulationDoc::OnTriangu()
myAISContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){
myAISContext->Remove (aListIterator.Value(), Standard_False);
myAISContext->Remove(aListIterator.Value());
}
TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200,60,60);
@@ -84,10 +84,10 @@ void CTriangulationDoc::OnTriangu()
BRepMesh_IncrementalMesh(ShapeFused,1);
Handle (AIS_Shape) aSection = new AIS_Shape(ShapeFused);
myAISContext->SetDisplayMode (aSection, 1, Standard_False);
myAISContext->SetColor (aSection, Quantity_NOC_RED, Standard_False);
myAISContext->SetMaterial (aSection, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->Display (aSection, Standard_False);
myAISContext->SetDisplayMode(aSection,1);
myAISContext->SetColor(aSection,Quantity_NOC_RED);
myAISContext->SetMaterial(aSection,Graphic3d_NOM_GOLD);
myAISContext->Display(aSection);
Standard_Integer result(0);
@@ -133,7 +133,7 @@ void CTriangulationDoc::OnVisu()
myAISContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){
myAISContext->Remove (aListIterator.Value(), Standard_False);
myAISContext->Remove(aListIterator.Value());
}
TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200,60,60).Shape();
@@ -142,11 +142,11 @@ TopoDS_Shape ShapeFused = BRepAlgoAPI_Fuse(theSphere, theBox).Shape();
BRepMesh_IncrementalMesh(ShapeFused,1);
Handle (AIS_Shape) aSection = new AIS_Shape(ShapeFused);
myAISContext->SetDisplayMode (aSection, 1, Standard_False);
myAISContext->SetColor (aSection, Quantity_NOC_RED, Standard_False);
myAISContext->SetMaterial (aSection, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->SetTransparency (aSection, 0.1, Standard_False);
myAISContext->Display (aSection, Standard_False);
myAISContext->SetDisplayMode(aSection,1);
myAISContext->SetColor(aSection,Quantity_NOC_RED);
myAISContext->SetMaterial(aSection,Graphic3d_NOM_GOLD);
myAISContext->SetTransparency(aSection,0.1);
myAISContext->Display(aSection);
BRep_Builder builder;
TopoDS_Compound Comp;
@@ -188,9 +188,9 @@ for (TopExp_Explorer ex(ShapeFused,TopAbs_FACE) ; ex.More(); ex.Next()) {
}
}
Handle (AIS_Shape) atriangulation = new AIS_Shape(Comp);
myAISContext->SetDisplayMode (atriangulation, 0, Standard_False);
myAISContext->SetColor (atriangulation, Quantity_NOC_WHITE, Standard_False);
myAISContext->Display (atriangulation, Standard_False);
myAISContext->SetDisplayMode(atriangulation,0);
myAISContext->SetColor(atriangulation,Quantity_NOC_WHITE);
myAISContext->Display(atriangulation);
Fit();
@@ -258,7 +258,7 @@ void CTriangulationDoc::OnClear()
myAISContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){
myAISContext->Remove (aListIterator.Value(), Standard_False);
myAISContext->Remove(aListIterator.Value());
}
TopoDS_Shape theBox = BRepPrimAPI_MakeBox(200, 60, 60).Shape();
@@ -268,10 +268,10 @@ BRepMesh_IncrementalMesh(ShapeFused,1);
Handle (AIS_Shape) aSection = new AIS_Shape(ShapeFused);
myAISContext->SetDisplayMode (aSection, 1, Standard_False);
myAISContext->SetColor (aSection, Quantity_NOC_RED, Standard_False);
myAISContext->SetMaterial (aSection, Graphic3d_NOM_GOLD, Standard_False);
myAISContext->Display (aSection, Standard_False);
myAISContext->SetDisplayMode(aSection,1);
myAISContext->SetColor(aSection,Quantity_NOC_RED);
myAISContext->SetMaterial(aSection,Graphic3d_NOM_GOLD);
myAISContext->Display(aSection);
BRepTools::Clean(ShapeFused);
@@ -360,14 +360,14 @@ void CTriangulationDoc::DoSample()
void CTriangulationDoc::OnBUTTONStart()
{
myAISContext->EraseAll (Standard_True);
myAISContext->EraseAll();
myPresentation->FirstSample();
DoSample();
}
void CTriangulationDoc::OnBUTTONEnd()
{
myAISContext->EraseAll (Standard_True);
myAISContext->EraseAll();
myPresentation->LastSample();
DoSample();
}

View File

@@ -182,20 +182,20 @@ void CHLRDoc::Fit()
void CHLRDoc::OnObjectErase()
{
Standard_Boolean toUpdateDisplayable = Standard_False;
myAISContext->InitSelected();
while (myAISContext->MoreSelected())
myAISContext->InitCurrent();
while (myAISContext->MoreCurrent())
{
if (myAISContext->SelectedInteractive()->Type() == AIS_KOI_Shape && myCSelectionDialogIsCreated)
if (myAISContext->Current()->Type() == AIS_KOI_Shape && myCSelectionDialogIsCreated)
{
myCSelectionDialog->DiplayableShape()->Remove (Handle(AIS_Shape)::DownCast (myAISContext->SelectedInteractive())->Shape());
myCSelectionDialog->DiplayableShape()->Remove (Handle(AIS_Shape)::DownCast (myAISContext->Current())->Shape());
toUpdateDisplayable = Standard_True;
}
myAISContext->Erase (myAISContext->SelectedInteractive(), Standard_True);
myAISContext->InitSelected();
myAISContext->Erase (myAISContext->Current(), Standard_True);
myAISContext->InitCurrent();
}
myAISContext->ClearSelected (Standard_True);
myAISContext->ClearCurrents();
if (toUpdateDisplayable)
{

View File

@@ -145,7 +145,7 @@ void CSelectionDialog::OnDisplay (bool isFit)
Handle(Geom_Axis2Placement) aTrihedronAxis = new Geom_Axis2Placement (gp::XOY());
myTrihedron = new AIS_Trihedron (aTrihedronAxis);
myInteractiveContext->Display (myTrihedron, Standard_False);
myInteractiveContext->Display (myTrihedron);
myIsDisplayed = Standard_True;
}
if(isFit)
@@ -167,25 +167,25 @@ void CSelectionDialog::SetTitle (const CString & aTitle)
void CSelectionDialog::UpdateViews()
{
// Clear HLR dialog view
myInteractiveContext->RemoveAll (Standard_False);
myInteractiveContext->Display (myTrihedron, Standard_False);
myInteractiveContext->RemoveAll();
myInteractiveContext->Display (myTrihedron);
UpdateProjector();
// Display chosen shapes in the HLR dialog view.
Standard_Boolean OneOrMoreFound = Standard_False;
for (myDoc->GetAISContext()->InitSelected();
myDoc->GetAISContext()->MoreSelected();
myDoc->GetAISContext()->NextSelected())
for (myDoc->GetAISContext()->InitCurrent();
myDoc->GetAISContext()->MoreCurrent();
myDoc->GetAISContext()->NextCurrent())
{
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->SelectedInteractive());
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->Current());
if (!anAISShape.IsNull())
{
OneOrMoreFound = Standard_True;
myInteractiveContext->Display (anAISShape, Standard_False);
myInteractiveContext->Display (anAISShape);
}
}
myInteractiveContext->UpdateCurrentViewer();
// Apply HLR to chosen shapes and display result into the 2d view.
Apply();
// Update viewer
@@ -203,15 +203,15 @@ void CSelectionDialog::OnGetSelectedShapes()
myDisplayableShape->SetNbIsos (m_NbIsos);
// Clear HLR dialog view
myInteractiveContext->RemoveAll (Standard_False);
myInteractiveContext->Display (myTrihedron, Standard_False);
myInteractiveContext->RemoveAll();
myInteractiveContext->Display (myTrihedron);
Standard_Boolean OneOrMoreFound = Standard_False;
for (myDoc->GetAISContext()->InitSelected();
myDoc->GetAISContext()->MoreSelected();
myDoc->GetAISContext()->NextSelected())
for (myDoc->GetAISContext()->InitCurrent();
myDoc->GetAISContext()->MoreCurrent();
myDoc->GetAISContext()->NextCurrent())
{
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->SelectedInteractive());
Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast (myDoc->GetAISContext()->Current());
if (!anAISShape.IsNull())
{
@@ -219,10 +219,10 @@ void CSelectionDialog::OnGetSelectedShapes()
TopoDS_Shape aShape = anAISShape->Shape();
myDisplayableShape->Add (aShape);
Handle(AIS_Shape) aSelectedShape = new AIS_Shape (aShape);
myInteractiveContext->Display (aSelectedShape, Standard_False);
myInteractiveContext->Display (aSelectedShape);
}
}
myInteractiveContext->UpdateCurrentViewer();
// Apply HLR to chosen shapes and display result into the 2d view.
Apply();
// Update viewer
@@ -236,7 +236,7 @@ void CSelectionDialog::OnGetSelectedShapes()
void CSelectionDialog::Apply()
{
SetCursor(AfxGetApp()->LoadStandardCursor (IDC_WAIT));
myDoc->GetInteractiveContext2D()->RemoveAll (Standard_False);
myDoc->GetInteractiveContext2D()->RemoveAll();
UpdateData (true);
Standard_Integer aDisplayMode = m_DisplayMode;

View File

@@ -127,24 +127,24 @@ CAnimationDoc::CAnimationDoc()
myAISContext->SetDeviationCoefficient(myDeviation);
myAisCylinderHead = new AIS_Shape (CylinderHead);
myAISContext->SetColor (myAisCylinderHead, Quantity_NOC_WHITE, Standard_False);
myAISContext->SetMaterial (myAisCylinderHead, Graphic3d_NOM_PLASTIC, Standard_False);
myAISContext->SetColor (myAisCylinderHead, Quantity_NOC_WHITE);
myAISContext->SetMaterial (myAisCylinderHead, Graphic3d_NOM_PLASTIC);
myAisEngineBlock = new AIS_Shape (EngineBlock);
myAISContext->SetColor(myAisEngineBlock, Quantity_NOC_WHITE, Standard_False);
myAISContext->SetMaterial(myAisEngineBlock,Graphic3d_NOM_PLASTIC, Standard_False);
myAISContext->SetColor(myAisEngineBlock, Quantity_NOC_WHITE);
myAISContext->SetMaterial(myAisEngineBlock,Graphic3d_NOM_PLASTIC);
myAISContext->Display(myAisCylinderHead ,1,-1,Standard_False,Standard_False);
myAISContext->Display(myAisEngineBlock ,1,-1,Standard_False,Standard_False);
myAisCrankArm = new AIS_Shape (CrankArm);
myAISContext->SetColor (myAisCrankArm, Quantity_NOC_HOTPINK, Standard_False);
myAISContext->SetMaterial(myAisCrankArm, Graphic3d_NOM_PLASTIC, Standard_False);
myAISContext->SetColor (myAisCrankArm, Quantity_NOC_HOTPINK);
myAISContext->SetMaterial(myAisCrankArm, Graphic3d_NOM_PLASTIC);
myAisPiston = new AIS_Shape (Piston);
myAISContext->SetColor (myAisPiston , Quantity_NOC_WHITE, Standard_False);
myAISContext->SetMaterial(myAisPiston , Graphic3d_NOM_PLASTIC, Standard_False);
myAISContext->SetColor (myAisPiston , Quantity_NOC_WHITE);
myAISContext->SetMaterial(myAisPiston , Graphic3d_NOM_PLASTIC);
myAisPropeller = new AIS_Shape (Propeller);
myAISContext->SetColor (myAisPropeller, Quantity_NOC_RED, Standard_False);
myAISContext->SetMaterial(myAisPropeller, Graphic3d_NOM_PLASTIC, Standard_False);
myAISContext->SetColor (myAisPropeller, Quantity_NOC_RED);
myAISContext->SetMaterial(myAisPropeller, Graphic3d_NOM_PLASTIC);
myAISContext->Display(myAisCrankArm ,1,-1,Standard_False,Standard_False);
myAISContext->Display(myAisPropeller ,1,-1,Standard_False,Standard_False);
@@ -204,7 +204,7 @@ void CAnimationDoc::DragEvent(const Standard_Integer x ,
}
if (TheState == 1)
myAISContext->Select (theButtonDownX, theButtonDownY, x, y, aView, Standard_True);
myAISContext->Select(theButtonDownX,theButtonDownY,x,y,aView);
}
//-----------------------------------------------------------------------------------------
@@ -214,7 +214,7 @@ void CAnimationDoc::InputEvent(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/ )
{
myAISContext->Select (Standard_True);
myAISContext->Select();
}
//-----------------------------------------------------------------------------------------
@@ -224,7 +224,7 @@ void CAnimationDoc::MoveEvent(const Standard_Integer x ,
const Standard_Integer y ,
const Handle(V3d_View)& aView )
{
myAISContext->MoveTo (x, y, aView, Standard_True);
myAISContext->MoveTo(x,y,aView);
}
//-----------------------------------------------------------------------------------------
@@ -234,7 +234,7 @@ void CAnimationDoc::ShiftMoveEvent(const Standard_Integer x ,
const Standard_Integer y ,
const Handle(V3d_View)& aView )
{
myAISContext->MoveTo (x, y, aView, Standard_True);
myAISContext->MoveTo(x,y,aView);
}
//-----------------------------------------------------------------------------------------
@@ -255,7 +255,7 @@ void CAnimationDoc::ShiftDragEvent(const Standard_Integer x ,
}
if (TheState == 0)
myAISContext->ShiftSelect (theButtonDownX, theButtonDownY, x, y, aView, Standard_True);
myAISContext->ShiftSelect(theButtonDownX,theButtonDownY,x,y,aView);
}
@@ -266,7 +266,7 @@ void CAnimationDoc::ShiftInputEvent(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/)
{
myAISContext->ShiftSelect (Standard_True);
myAISContext->ShiftSelect();
}
//-----------------------------------------------------------------------------------------
@@ -333,7 +333,7 @@ void CAnimationDoc::OnShading()
myAisPropeller->Set(Propeller);
myAISContext->Deactivate(myAisPropeller);
myAISContext->Redisplay (myAisPropeller, Standard_True);
myAISContext->Redisplay(myAisPropeller);
}
((CAnimationView3D *)pCurrentView)->OnRestart();
}
@@ -401,7 +401,7 @@ void CAnimationDoc::OnFileLoadgrid()
myFace = aMkFace.Face();
// Remove all other shapes
myAISContext->RemoveAll (Standard_False);
myAISContext->RemoveAll();
Handle(AIS_Shape) myAISSurface = new AIS_Shape(myFace);

View File

@@ -77,7 +77,7 @@ void Convert_Presentation::DoSample()
{
((COCCDemoApp*) AfxGetApp())->SetSampleName (L"Convert");
((COCCDemoApp*) AfxGetApp())->SetSamplePath (L"..\\..\\10_Convert");
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
if (myIndex >=0 && myIndex < myNbFuncs)
(this->*SampleFuncs[myIndex])();
}
@@ -238,7 +238,7 @@ void Convert_Presentation::sampleBezier()
//================================================================
void Convert_Presentation::sampleBezierSurface()
{
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
Standard_CString aName = "BezierSurface";
// Create a BezierSurface
@@ -292,7 +292,7 @@ void Convert_Presentation::sampleBezierSurface()
//================================================================
void Convert_Presentation::sampleCylindricalSurface()
{
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
Standard_CString aName = "Cylindrical Surface";
TCollection_AsciiString aText (
@@ -332,7 +332,7 @@ void Convert_Presentation::sampleRevolSurface()
TranslateView(-176.84682, -102.12892);
SetViewScale(0.69326);
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
Standard_CString aName = "Surface of revolution";
TCollection_AsciiString aText (
@@ -384,7 +384,7 @@ void Convert_Presentation::sampleRevolSurface()
//================================================================
void Convert_Presentation::sampleToroidalSurface()
{
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
Standard_CString aName = "Toroidal surface";
TCollection_AsciiString aText (
@@ -407,7 +407,7 @@ void Convert_Presentation::sampleToroidalSurface()
//================================================================
void Convert_Presentation::sampleConicalSurface()
{
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
Standard_CString aName = "Conical surface";
TCollection_AsciiString aText (
@@ -440,7 +440,7 @@ void Convert_Presentation::sampleConicalSurface()
//================================================================
void Convert_Presentation::sampleSphericalSurface()
{
getAISContext()->EraseAll (Standard_True);
getAISContext()->EraseAll();
Standard_CString aName = "Spherical surface";
TCollection_AsciiString aText (

View File

@@ -37,7 +37,7 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres
{
GeomAdaptor_Curve anAdaptorCurve(myCurve);
if (hasOwnColor)
myDrawer->LineAspect()->SetColor (myDrawer->Color());
myDrawer->LineAspect()->SetColor(myOwnColor);
myDrawer->Link()->SetDiscretisation(100);
myDrawer->Link()->SetMaximalParameterValue(500);

View File

@@ -102,7 +102,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawSurface
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicSurface, Standard_True);
getAISContext()->Display (aGraphicSurface);
}
return aGraphicSurface;
@@ -127,7 +127,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawCurve
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve, Standard_True);
getAISContext()->Display (aGraphicCurve);
}
return aGraphicCurve;
@@ -174,7 +174,7 @@ Handle(AIS_Point) OCCDemo_Presentation::drawPoint
getAISContext()->SetColor (aGraphicPoint, theColor, toDisplay);
if (toDisplay) {
getAISContext()->Display (aGraphicPoint, Standard_True);
getAISContext()->Display (aGraphicPoint);
//COCCDemoDoc::Fit();
}
@@ -212,7 +212,7 @@ Handle(AIS_InteractiveObject) OCCDemo_Presentation::drawVector
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicCurve, Standard_True);
getAISContext()->Display (aGraphicCurve);
}
return aGraphicCurve;
@@ -233,7 +233,7 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape, Standard_True);
getAISContext()->Display (aGraphicShape);
}
return aGraphicShape;
@@ -253,7 +253,7 @@ Handle(AIS_Shape) OCCDemo_Presentation::drawShape
COCCDemoDoc::Fit();
}
else
getAISContext()->Display (aGraphicShape, Standard_True);
getAISContext()->Display (aGraphicShape);
}
return aGraphicShape;

View File

@@ -73,8 +73,8 @@ BOOL COCCDemoDoc::OnNewDocument()
// (SDI documents will reuse this document)
SetTitle(myPresentation->GetName());
myAISContext->EraseAll (Standard_False);
myAISContext->SetDisplayMode (AIS_Shaded, Standard_True);
myAISContext->EraseAll();
myAISContext->SetDisplayMode(AIS_Shaded);
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
@@ -163,14 +163,14 @@ void COCCDemoDoc::DoSample()
void COCCDemoDoc::OnBUTTONStart()
{
myAISContext->EraseAll (Standard_True);
myAISContext->EraseAll();
myPresentation->FirstSample();
DoSample();
}
void COCCDemoDoc::OnBUTTONEnd()
{
myAISContext->EraseAll (Standard_True);
myAISContext->EraseAll();
myPresentation->LastSample();
DoSample();
}

View File

@@ -494,18 +494,18 @@ void COCCDemoView::RedrawVisMode()
switch (myVisMode)
{
case VIS_WIREFRAME:
GetDocument()->GetAISContext()->SetDisplayMode (AIS_WireFrame, Standard_True);
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
myView->SetComputedMode (Standard_False);
break;
case VIS_SHADE:
GetDocument()->GetAISContext()->SetDisplayMode (AIS_Shaded, Standard_True);
GetDocument()->GetAISContext()->SetDisplayMode(AIS_Shaded);
myView->SetComputedMode (Standard_False);
break;
case VIS_HLR:
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetComputedMode (Standard_True);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
GetDocument()->GetAISContext()->SetDisplayMode (AIS_WireFrame, Standard_True);
GetDocument()->GetAISContext()->SetDisplayMode(AIS_WireFrame);
break;
}
}

View File

@@ -312,12 +312,11 @@ void CDialogMaterial::OnMaterial(UINT nID)
void CDialogMaterial::SetMaterial(Graphic3d_NameOfMaterial Material)
{
Standard_Real aTransparency;
for (myCurrentIC->InitSelected();myCurrentIC->MoreSelected ();myCurrentIC->NextSelected ()){
aTransparency = myCurrentIC->SelectedInteractive()->Transparency();
myCurrentIC->SetMaterial (myCurrentIC->SelectedInteractive(), (Graphic3d_NameOfMaterial)(Material), Standard_False);
myCurrentIC->SetTransparency (myCurrentIC->SelectedInteractive(), aTransparency, Standard_False);
for (myCurrentIC->InitCurrent();myCurrentIC->MoreCurrent ();myCurrentIC->NextCurrent ()){
aTransparency = myCurrentIC->Current()->Transparency();
myCurrentIC->SetMaterial (myCurrentIC->Current(),(Graphic3d_NameOfMaterial)(Material));
myCurrentIC->SetTransparency (myCurrentIC->Current(),aTransparency);
}
myCurrentIC->UpdateCurrentViewer();
}
void CDialogMaterial::OnObjectMaterialAluminium () { SetMaterial ( Graphic3d_NOM_ALUMINIUM ) ; }
@@ -359,11 +358,11 @@ CDialogTransparency::CDialogTransparency(Handle(AIS_InteractiveContext) CurrentI
Standard_Real temp = 10;
Standard_Real t;
for (myCurrentIC->InitSelected();
myCurrentIC->MoreSelected ();
myCurrentIC->NextSelected ())
for (myCurrentIC->InitCurrent();
myCurrentIC->MoreCurrent ();
myCurrentIC->NextCurrent ())
{
t = CurrentIC->SelectedInteractive()->Transparency();
t = CurrentIC->Current()->Transparency();
if (temp > t)
temp = t;
//myCurrentIC->SetTransparency (myCurrentIC->Current(), m_TransValue);
@@ -373,14 +372,14 @@ CDialogTransparency::CDialogTransparency(Handle(AIS_InteractiveContext) CurrentI
if (Abs(m_TransValue - temp * 10) > 0.01)
m_TransValue = int (temp * 10) + 1;
for (myCurrentIC->InitSelected();
myCurrentIC->MoreSelected ();
myCurrentIC->NextSelected ())
{
myCurrentIC->SetTransparency (myCurrentIC->SelectedInteractive(), temp, Standard_False);
}
for (myCurrentIC->InitCurrent();
myCurrentIC->MoreCurrent ();
myCurrentIC->NextCurrent ())
{
myCurrentIC->SetTransparency (myCurrentIC->Current(), temp);
}
myCurrentIC->UpdateCurrentViewer();
}
@@ -415,13 +414,13 @@ void CDialogTransparency::OnDeltaposSpinaistransp(NMHDR* pNMHDR, LRESULT* pResul
UpdateData (false);
for (myCurrentIC->InitSelected();
myCurrentIC->MoreSelected ();
myCurrentIC->NextSelected())
{
myCurrentIC->SetTransparency (myCurrentIC->SelectedInteractive(), m_TransValue/10.0, Standard_False);
}
myCurrentIC->UpdateCurrentViewer();
for (myCurrentIC->InitCurrent();
myCurrentIC->MoreCurrent ();
myCurrentIC->NextCurrent())
{
myCurrentIC->SetTransparency (myCurrentIC->Current(), m_TransValue/10.0);
}
*pResult = 0;
}
@@ -432,13 +431,12 @@ void CDialogTransparency::OnChangeEditaistransp()
// TODO: Add your control notification handler code here
int temp = m_TransValue;
if (UpdateData (true)){
for (myCurrentIC->InitSelected();
myCurrentIC->MoreSelected ();
myCurrentIC->NextSelected())
{
myCurrentIC->SetTransparency (myCurrentIC->SelectedInteractive(), m_TransValue/10.0, Standard_False);
}
myCurrentIC->UpdateCurrentViewer();
for (myCurrentIC->InitCurrent();
myCurrentIC->MoreCurrent ();
myCurrentIC->NextCurrent())
{
myCurrentIC->SetTransparency (myCurrentIC->Current(), m_TransValue/10.0);
}
}
else{
m_TransValue = temp;

View File

@@ -63,12 +63,20 @@ END_MESSAGE_MAP()
void CAngleParamsVerticesPage::OnBnClickedVertex1Btn()
{
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX));
// Open local context and choose the vertex for angle dimensions
if (!myAISContext->HasOpenedContext())
{
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_VERTEX);
AfxMessageBox (_T ("Local context was not opened. Choose the edge and press the button again"),
MB_ICONINFORMATION | MB_OK);
return;
}
// Now it's ok, edge selection mode is activated
// Now it's ok, local context is opened and edge selection mode is activated
// Check if some vertex is selected
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_VERTEX)
{
AfxMessageBox (_T ("Choose the vertex and press the button again"),
@@ -76,8 +84,8 @@ void CAngleParamsVerticesPage::OnBnClickedVertex1Btn()
return;
}
myFirstVertex = TopoDS::Vertex (myAISContext->SelectedShape());
myAISContext->ClearSelected (Standard_True);
myFirstVertex = TopoDS::Vertex (myAISContext->LocalContext()->SelectedShape());
myAISContext->LocalContext()->ClearSelected();
}
//=======================================================================
@@ -87,17 +95,17 @@ void CAngleParamsVerticesPage::OnBnClickedVertex1Btn()
void CAngleParamsVerticesPage::OnBnClickedVertex2Btn()
{
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_VERTEX)
{
AfxMessageBox ( _T("Choose the vertex and press the button again"), MB_ICONINFORMATION | MB_OK);
return;
}
mySecondVertex = TopoDS::Vertex (myAISContext->SelectedShape());
mySecondVertex = TopoDS::Vertex (myAISContext->LocalContext()->SelectedShape());
myAISContext->ClearSelected (Standard_True);
myAISContext->LocalContext()->ClearSelected();
}
//=======================================================================
@@ -107,15 +115,15 @@ void CAngleParamsVerticesPage::OnBnClickedVertex2Btn()
void CAngleParamsVerticesPage::OnBnClickedVertex3Btn()
{
myAISContext->InitSelected();
if (!myAISContext->MoreSelected())
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected())
{
AfxMessageBox (_T ("Choose the vertex and press the button again"), MB_ICONINFORMATION | MB_OK);
return;
}
myThirdVertex = TopoDS::Vertex (myAISContext->SelectedShape());
myAISContext->ClearSelected (Standard_False);
myThirdVertex = TopoDS::Vertex (myAISContext->LocalContext()->SelectedShape());
myAISContext->LocalContext()->ClearSelected();
//Build dimension here
TopoDS_Edge anEdge12 = BRepBuilderAPI_MakeEdge (myFirstVertex, mySecondVertex);
@@ -151,6 +159,8 @@ void CAngleParamsVerticesPage::OnBnClickedVertex3Btn()
}
}
anAngleDim->SetDimensionAspect (anAspect);
myAISContext->Display (anAngleDim, Standard_True);
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX));
myAISContext->CloseAllContexts();
myAISContext->Display (anAngleDim);
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_VERTEX);
}

View File

@@ -139,6 +139,11 @@ void CDimensionDlg::DoDataExchange (CDataExchange* pDX)
void CDimensionDlg::OnBnClickedOk()
{
if (myAISContext->HasOpenedContext())
{
myAISContext->CloseAllContexts();
}
OnOK();
}
@@ -292,6 +297,8 @@ void CDimensionDlg::CreateDiameterParamsTab()
void CDimensionDlg::UpdateStandardModeForAngle()
{
int aTabNum = ((CTabCtrl*) GetDlgItem (IDC_AngleTab))->GetCurSel();
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
TopAbs_ShapeEnum aMode;
if (aTabNum == 1)
@@ -307,7 +314,7 @@ void CDimensionDlg::UpdateStandardModeForAngle()
aMode = TopAbs_EDGE;
}
myAISContext->Activate (AIS_Shape::SelectionMode (aMode));
myAISContext->ActivateStandardMode (aMode);
}
//=======================================================================
@@ -318,7 +325,8 @@ void CDimensionDlg::UpdateStandardModeForAngle()
void CDimensionDlg::UpdateStandardModeForLength()
{
int aTabNum = ((CTabCtrl*) GetDlgItem (IDC_LengthTab))->GetCurSel();
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
TopAbs_ShapeEnum aMode;
if (aTabNum == 1)
@@ -333,7 +341,7 @@ void CDimensionDlg::UpdateStandardModeForLength()
{
aMode = TopAbs_EDGE;
}
myAISContext->Activate (AIS_Shape::SelectionMode (aMode));
myAISContext->ActivateStandardMode (aMode);
}
//=======================================================================
@@ -355,7 +363,8 @@ void CDimensionDlg::UpdateStandardMode()
case IDC_DimRadius:
case IDC_DimDiameter:
{
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_EDGE);
}
break;
}
@@ -405,7 +414,9 @@ void CDimensionDlg::OnBnClickedDimAngle()
void CDimensionDlg::OnBnClickedDimDiameter()
{
// Update parameters
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_EDGE);
GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE);
GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE);
@@ -424,7 +435,9 @@ void CDimensionDlg::OnBnClickedDimDiameter()
void CDimensionDlg::OnBnClickedDimRadius()
{
// Update parameters
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_EDGE);
GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE);
GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE);
GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_SHOW);
@@ -517,7 +530,16 @@ void CDimensionDlg::OnTcnSelChangingAngleTab (NMHDR * /*pNMHDR*/, LRESULT *pResu
void CDimensionDlg::DeactivateAllStandardModes()
{
myAISContext->Deactivate();
if (myAISContext->HasOpenedContext())
{
myAISContext->CloseAllContexts();
for (TColStd_ListIteratorOfListOfInteger anIt (myAISContext->LocalContext()->StandardModes());
anIt.More();
anIt.Next())
{
myAISContext->LocalContext()->DeactivateStandardMode ((TopAbs_ShapeEnum)anIt.Value());
}
}
}
//=======================================================================
@@ -527,6 +549,10 @@ void CDimensionDlg::DeactivateAllStandardModes()
void CDimensionDlg::OnDestroy()
{
if (myAISContext->HasOpenedContext())
{
myAISContext->CloseAllContexts();
}
CWnd *aWnd;
TC_ITEM anItem;
anItem.mask = TCIF_PARAM;
@@ -728,5 +754,9 @@ const Quantity_Color CDimensionDlg::GetDimensionColor() const
void CDimensionDlg::OnClose()
{
if (myAISContext->HasOpenedContext())
{
myAISContext->CloseAllContexts();
}
CDialog::OnClose();
}

View File

@@ -56,7 +56,7 @@ Handle(TopTools_HSequenceOfShape) CImportExport::BuildSequenceFromContext(const
Handle(TColStd_HArray1OfReal)& anArrayOfTransparencies)
{
Handle(TopTools_HSequenceOfShape) aSequence;
Standard_Integer nb = anInteractiveContext->NbSelected(), i = 1;
Standard_Integer nb = anInteractiveContext->NbCurrents(), i = 1;
if (!nb)
return aSequence;
@@ -65,10 +65,10 @@ Handle(TopTools_HSequenceOfShape) CImportExport::BuildSequenceFromContext(const
anArrayOfTransparencies = new TColStd_HArray1OfReal (1, nb);
Handle(AIS_InteractiveObject) picked;
for (anInteractiveContext->InitSelected(); anInteractiveContext->MoreSelected(); anInteractiveContext->NextSelected())
for(anInteractiveContext->InitCurrent();anInteractiveContext->MoreCurrent();anInteractiveContext->NextCurrent())
{
picked = anInteractiveContext->SelectedInteractive();
if (picked->IsKind (STANDARD_TYPE (AIS_Shape)))
picked = anInteractiveContext->Current();
if (anInteractiveContext->Current()->IsKind(STANDARD_TYPE(AIS_Shape)))
{
Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast(picked);
TopoDS_Shape aShape = aisShape->Shape();
@@ -103,8 +103,7 @@ int CImportExport::ReadBREP (const Handle(AIS_InteractiveContext)& anInteractive
aShape = new AIS_Shape(aSequence->Value(i));
anInteractiveContext->SetDisplayMode(aShape, 1, Standard_False);
anInteractiveContext->Display(aShape, Standard_False);
const Handle(AIS_InteractiveObject)& aPrs = aShape; // A small trick to avoid compiler error (C2668).
anInteractiveContext->SetSelected (aPrs, Standard_False);
anInteractiveContext->SetCurrentObject(aShape, Standard_False);
}
return 0;
}
@@ -168,8 +167,8 @@ Standard_Boolean CImportExport::ReadBREP(CString aFileName,
void CImportExport::SaveBREP(const Handle(AIS_InteractiveContext)& anInteractiveContext)
{
anInteractiveContext->InitSelected();
if (anInteractiveContext->NbSelected() == 0){
anInteractiveContext->InitCurrent();
if (anInteractiveContext->NbCurrents() == 0){
AfxMessageBox (L"No shape selected for export!");
return;
}
@@ -251,8 +250,8 @@ void CImportExport::ReadIGES(const Handle(AIS_InteractiveContext)& anInteractive
{
Handle(TopTools_HSequenceOfShape) aSequence = CImportExport::ReadIGES();
for(int i=1;i<= aSequence->Length();i++)
anInteractiveContext->Display (new AIS_Shape (aSequence->Value (i)), Standard_False);
anInteractiveContext->UpdateCurrentViewer();
anInteractiveContext->Display(new AIS_Shape(aSequence->Value(i)));
}
Handle(TopTools_HSequenceOfShape) CImportExport::ReadIGES()// not by reference --> the sequence is created here !!
@@ -306,8 +305,8 @@ Standard_Integer CImportExport::ReadIGES(const Standard_CString& aFileName,
void CImportExport::SaveIGES(const Handle(AIS_InteractiveContext)& anInteractiveContext)
{
anInteractiveContext->InitSelected();
if (anInteractiveContext->NbSelected() == 0){
anInteractiveContext->InitCurrent();
if (anInteractiveContext->NbCurrents() == 0){
AfxMessageBox (L"No shape selected for export!");
return;
}
@@ -457,8 +456,8 @@ IFSelect_ReturnStatus CImportExport::ReadSTEP(const Standard_CString& aFileName,
//----------------------------------------------------------------------
void CImportExport::SaveSTEP(const Handle(AIS_InteractiveContext)& anInteractiveContext)
{
anInteractiveContext->InitSelected();
if (anInteractiveContext->NbSelected() == 0){
anInteractiveContext->InitCurrent();
if (anInteractiveContext->NbCurrents() == 0){
AfxMessageBox (L"No shape selected for export!");
return;
}
@@ -577,8 +576,8 @@ const STEPControl_StepModelType aValue /* =TopoDSToCc1Act_ManifoldSolidBrep */ )
void CImportExport::SaveSTL(const Handle(AIS_InteractiveContext)& anInteractiveContext)
{
anInteractiveContext->InitSelected();
if (anInteractiveContext->NbSelected() == 0){
anInteractiveContext->InitCurrent();
if (anInteractiveContext->NbCurrents() == 0){
AfxMessageBox (L"No shape selected for export!");
return;
}
@@ -664,8 +663,8 @@ Standard_Boolean CImportExport::SaveSTL(const Standard_CString& aFileName,
void CImportExport::SaveVRML(const Handle(AIS_InteractiveContext)& anInteractiveContext)
{
anInteractiveContext->InitSelected();
if (anInteractiveContext->NbSelected() == 0){
anInteractiveContext->InitCurrent();
if (anInteractiveContext->NbCurrents() == 0){
AfxMessageBox (L"No shape selected for export!");
return;
}

View File

@@ -67,9 +67,9 @@ CButton* CLengthParamsEdgePage::GetButton()
void CLengthParamsEdgePage::OnBnClickedChooseEdgeBtn()
{
myAISContext->InitSelected();
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->MoreSelected() ||
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE)
{
AfxMessageBox ( _T("Choose the edge and press the button again"), MB_ICONINFORMATION | MB_OK);
@@ -79,7 +79,7 @@ void CLengthParamsEdgePage::OnBnClickedChooseEdgeBtn()
TopoDS_Shape aSelShape = myAISContext->SelectedShape();
const TopoDS_Edge& anEdge = TopoDS::Edge (aSelShape);
myAISContext->ClearSelected (Standard_False);
myAISContext->LocalContext()->ClearSelected();
TopoDS_Vertex aFirstVertex, aSecondVertex;
TopExp::Vertices (TopoDS::Edge (anEdge), aFirstVertex, aSecondVertex);
@@ -108,6 +108,8 @@ void CLengthParamsEdgePage::OnBnClickedChooseEdgeBtn()
aLenDim->SetDimensionAspect (anAspect);
aLenDim->SetFlyout (aDimDlg->GetFlyout());
myAISContext->Display (aLenDim, Standard_True);
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
myAISContext->CloseAllContexts();
myAISContext->Display (aLenDim);
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_EDGE);
}

View File

@@ -58,12 +58,20 @@ END_MESSAGE_MAP()
void CLengthParamsEdgesPage::OnBnClickedEdge1Btn()
{
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
// Open local context and choose the edge for length dimensions
if (!myAISContext->HasOpenedContext())
{
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_EDGE);
AfxMessageBox (_T("Local context was not opened. Choose the edge and press the button again"),
MB_ICONINFORMATION | MB_OK);
return;
}
// Now it's ok, edge selection mode is activated
// Now it's ok, local context is opened and edge selection mode is activated
// Check if some edge is selected
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE)
{
AfxMessageBox(_T("Choose the edge and press the button again"),
@@ -73,7 +81,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge1Btn()
myFirstEdge = TopoDS::Edge (myAISContext->SelectedShape());
myAISContext->ClearSelected (Standard_True);
myAISContext->LocalContext()->ClearSelected();
}
//=======================================================================
@@ -83,8 +91,8 @@ void CLengthParamsEdgesPage::OnBnClickedEdge1Btn()
void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
{
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE)
{
AfxMessageBox (_T("Choose the edge and press the button again"),
@@ -94,7 +102,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
mySecondEdge = TopoDS::Edge (myAISContext->SelectedShape());
myAISContext->ClearSelected (Standard_True);
myAISContext->LocalContext()->ClearSelected();
// Build plane through three points
BRepAdaptor_Curve aCurve1 (myFirstEdge);
@@ -110,6 +118,8 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner());
myAISContext->CloseAllContexts();
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
anAspect->MakeArrows3d (Standard_False);
anAspect->MakeText3d (aDimDlg->GetTextType());
@@ -137,7 +147,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
}
anAngleDim->SetFlyout (aDimDlg->GetFlyout());
myAISContext->Display (anAngleDim, Standard_True);
myAISContext->Display (anAngleDim);
}
else
{
@@ -149,8 +159,9 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
aLenDim->SetDisplayUnits (aDimDlg->GetUnits());
}
myAISContext->Display (aLenDim, Standard_True);
myAISContext->Display (aLenDim);
}
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_EDGE);
}

View File

@@ -59,21 +59,29 @@ END_MESSAGE_MAP()
void CLengthParamsVerticesPage::OnBnClickedVertex1Btn()
{
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX));
// Open local context and choose the edge for length dimensions
if (!myAISContext->HasOpenedContext())
{
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_VERTEX);
AfxMessageBox(_T("Local context was not opened. Choose the vertices and press the button again"),
MB_ICONINFORMATION | MB_OK);
return;
}
// Now it's ok, edge selection mode is activated
// Now it's ok, local context is opened and edge selection mode is activated
// Check if some edge is selected
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_VERTEX)
{
AfxMessageBox (_T ("Choose the vertex and press the button again"), MB_ICONINFORMATION | MB_OK);
return;
}
myFirstVertex = TopoDS::Vertex (myAISContext->SelectedShape());
myFirstVertex = TopoDS::Vertex (myAISContext->LocalContext()->SelectedShape());
myAISContext->ClearSelected (Standard_True);
myAISContext->LocalContext()->ClearSelected();
}
//=======================================================================
@@ -83,16 +91,16 @@ void CLengthParamsVerticesPage::OnBnClickedVertex1Btn()
void CLengthParamsVerticesPage::OnBnClickedVertex2Btn()
{
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_VERTEX)
{
AfxMessageBox (_T ("Choose the vertex and press the button again"), MB_ICONINFORMATION | MB_OK);
return;
}
mySecondVertex = TopoDS::Vertex (myAISContext->SelectedShape());
myAISContext->ClearSelected (Standard_False);
mySecondVertex = TopoDS::Vertex (myAISContext->LocalContext()->SelectedShape());
myAISContext->LocalContext()->ClearSelected();
//Build dimension here
gp_Pnt aP1=BRep_Tool::Pnt (myFirstVertex);
@@ -120,8 +128,10 @@ void CLengthParamsVerticesPage::OnBnClickedVertex2Btn()
aLenDim->SetDimensionAspect (anAspect);
aLenDim->SetFlyout (aDimDlg->GetFlyout());
myAISContext->Display (aLenDim, Standard_True);
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_VERTEX));
myAISContext->CloseAllContexts();
myAISContext->Display (aLenDim);
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_VERTEX);
}
//=======================================================================

View File

@@ -60,12 +60,12 @@ void OCC_2dDoc::MoveEvent(const Standard_Integer theMouseX,
const Standard_Integer theMouseY,
const Handle(V3d_View)& theView)
{
myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_True);
myAISContext->MoveTo (theMouseX, theMouseY, theView);
}
void OCC_2dDoc::ShiftMoveEvent(const Standard_Integer theMouseX,
const Standard_Integer theMouseY,
const Handle(V3d_View)& theView)
{
myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_True);
myAISContext->MoveTo (theMouseX, theMouseY, theView);
}

View File

@@ -579,8 +579,8 @@ void OCC_2dView::DragEvent2D(const Standard_Integer x,
if (TheState == 0)
{
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->MoveTo (x, y, myV2dView, Standard_False);
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->Select (theButtonDownX, theButtonDownY, x, y, myV2dView, Standard_True);
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->MoveTo(x,y,myV2dView);
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->Select(theButtonDownX,theButtonDownY,x,y,myV2dView);
}
if (TheState == 1)
@@ -612,7 +612,7 @@ void OCC_2dView::MoveEvent2D(const Standard_Integer x,
//View is not updated automatically in ConvertToGrid
myV2dView->Update();
}
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->MoveTo (x, y, myV2dView, Standard_True);
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->MoveTo(x,y,myV2dView);
}
//-----------------------------------------------------------------------------------------
@@ -622,7 +622,7 @@ void OCC_2dView::MultiMoveEvent2D(const Standard_Integer x,
const Standard_Integer y)
{
// MultiMoveEvent2D means we move the mouse in a multi selection mode
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->MoveTo (x, y, myV2dView, Standard_True);
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->MoveTo(x,y,myV2dView);
}
//-----------------------------------------------------------------------------------------
@@ -643,8 +643,8 @@ void OCC_2dView::MultiDragEvent2D(const Standard_Integer x ,
if (TheState == 0)
{
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->MoveTo (x, y, myV2dView, Standard_False);
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->ShiftSelect (theButtonDownX, theButtonDownY, x, y, myV2dView, Standard_True);
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->MoveTo(x,y,myV2dView);
((OCC_2dDoc*)GetDocument())->GetInteractiveContext()->ShiftSelect(theButtonDownX,theButtonDownY,x,y,myV2dView);;
}
if (TheState == 1)

View File

@@ -114,7 +114,7 @@ void OCC_3dBaseDoc::DragEvent (const Standard_Integer theMouseX,
{
myAISContext->Select (aStartDragX, aStartDragY,
theMouseX, theMouseY,
theView, Standard_True);
theView);
break;
}
};
@@ -127,8 +127,8 @@ void OCC_3dBaseDoc::InputEvent (const Standard_Integer theMouseX,
const Standard_Integer theMouseY,
const Handle(V3d_View)& theView)
{
myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_False);
myAISContext->Select (Standard_True);
myAISContext->MoveTo (theMouseX, theMouseY, theView);
myAISContext->Select();
}
//-----------------------------------------------------------------------------------------
@@ -138,7 +138,7 @@ void OCC_3dBaseDoc::MoveEvent (const Standard_Integer theMouseX,
const Standard_Integer theMouseY,
const Handle(V3d_View)& theView)
{
myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_True);
myAISContext->MoveTo (theMouseX, theMouseY, theView);
}
//-----------------------------------------------------------------------------------------
@@ -148,7 +148,7 @@ void OCC_3dBaseDoc::ShiftMoveEvent (const Standard_Integer theMouseX,
const Standard_Integer theMouseY,
const Handle(V3d_View)& theView)
{
myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_True);
myAISContext->MoveTo (theMouseX, theMouseY, theView);
}
//-----------------------------------------------------------------------------------------
@@ -178,7 +178,7 @@ void OCC_3dBaseDoc::ShiftDragEvent (const Standard_Integer theMouseX,
// button up
myAISContext->ShiftSelect (aStartDragX, aStartDragY,
theMouseX, theMouseY,
theView, Standard_True);
theView);
}
}
@@ -189,7 +189,7 @@ void OCC_3dBaseDoc::ShiftInputEvent (const Standard_Integer /*theMouseX*/,
const Standard_Integer /*theMouseY*/,
const Handle(V3d_View)& /*theView*/)
{
myAISContext->ShiftSelect (Standard_True);
myAISContext->ShiftSelect();
}
//-----------------------------------------------------------------------------------------
@@ -202,8 +202,8 @@ void OCC_3dBaseDoc::Popup (const Standard_Integer theMouseX,
// Base check which context menu to call
if (!myPopupMenuNumber)
{
myAISContext->InitSelected();
if (myAISContext->MoreSelected())
myAISContext->InitCurrent();
if (myAISContext->MoreCurrent())
myPopupMenuNumber=1;
}
@@ -215,8 +215,8 @@ void OCC_3dBaseDoc::Popup (const Standard_Integer theMouseX,
if (myPopupMenuNumber == 1) // more than 1 object.
{
bool OneOrMoreInShading = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1)) OneOrMoreInShading=true;
if(!OneOrMoreInShading)
pPopup->EnableMenuItem(5, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
}
@@ -261,10 +261,10 @@ void OCC_3dBaseDoc::OnObjectColor()
COLORREF MSColor ;
Quantity_Color CSFColor ;
myAISContext->InitSelected();
Current = myAISContext->SelectedInteractive();
myAISContext->InitCurrent();
Current = myAISContext->Current();
if ( Current->HasColor () ) {
CSFColor = myAISContext->Color(Current);
CSFColor = myAISContext->Color(myAISContext->Current());
MSColor = RGB (CSFColor.Red()*255.,CSFColor.Green()*255.,CSFColor.Blue()*255.);
}
else {
@@ -277,32 +277,31 @@ void OCC_3dBaseDoc::OnObjectColor()
MSColor = dlgColor.GetColor();
CSFColor = Quantity_Color (GetRValue(MSColor)/255.,GetGValue(MSColor)/255.,
GetBValue(MSColor)/255.,Quantity_TOC_RGB);
for (;myAISContext->MoreSelected ();myAISContext->NextSelected ())
myAISContext->SetColor (myAISContext->SelectedInteractive(),CSFColor.Name(), Standard_False);
myAISContext->UpdateCurrentViewer();
for (;myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
myAISContext->SetColor (myAISContext->Current(),CSFColor.Name());
}
}
void OCC_3dBaseDoc::OnUpdateObjectColor(CCmdUI* pCmdUI)
{
bool OneOrMoreIsShadingOrWireframe = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),0)
||myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1))
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),0)
||myAISContext->IsDisplayed(myAISContext->Current(),1))
OneOrMoreIsShadingOrWireframe=true;
pCmdUI->Enable (OneOrMoreIsShadingOrWireframe);
}
void OCC_3dBaseDoc::OnObjectErase()
{
myAISContext->EraseSelected (Standard_False);
myAISContext->ClearSelected (Standard_True);
myAISContext->EraseSelected();
myAISContext->ClearCurrents();
}
void OCC_3dBaseDoc::OnUpdateObjectErase(CCmdUI* pCmdUI)
{
bool OneOrMoreIsDisplayed = false;
for (myAISContext->InitSelected(); myAISContext->MoreSelected(); myAISContext->NextSelected())
for (myAISContext->InitCurrent(); myAISContext->MoreCurrent(); myAISContext->NextCurrent())
{
if (myAISContext->IsDisplayed (myAISContext->SelectedInteractive()))
if (myAISContext->IsDisplayed (myAISContext->Current()))
OneOrMoreIsDisplayed = true;
}
pCmdUI->Enable (OneOrMoreIsDisplayed);
@@ -310,30 +309,28 @@ void OCC_3dBaseDoc::OnUpdateObjectErase(CCmdUI* pCmdUI)
void OCC_3dBaseDoc::OnObjectWireframe()
{
for(myAISContext->InitSelected();myAISContext->MoreSelected();myAISContext->NextSelected())
myAISContext->SetDisplayMode (myAISContext->SelectedInteractive(), 0, Standard_False);
myAISContext->UpdateCurrentViewer();
for(myAISContext->InitCurrent();myAISContext->MoreCurrent();myAISContext->NextCurrent())
myAISContext->SetDisplayMode(myAISContext->Current(),0);
}
void OCC_3dBaseDoc::OnUpdateObjectWireframe(CCmdUI* pCmdUI)
{
bool OneOrMoreInShading = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1)) OneOrMoreInShading=true;
pCmdUI->Enable (OneOrMoreInShading);
}
void OCC_3dBaseDoc::OnObjectShading()
{
for(myAISContext->InitSelected();myAISContext->MoreSelected();myAISContext->NextSelected())
myAISContext->SetDisplayMode (myAISContext->SelectedInteractive(), 1, Standard_False);
myAISContext->UpdateCurrentViewer();
for(myAISContext->InitCurrent();myAISContext->MoreCurrent();myAISContext->NextCurrent())
myAISContext->SetDisplayMode(myAISContext->Current(),1);
}
void OCC_3dBaseDoc::OnUpdateObjectShading(CCmdUI* pCmdUI)
{
bool OneOrMoreInWireframe = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),0)) OneOrMoreInWireframe=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),0)) OneOrMoreInWireframe=true;
pCmdUI->Enable (OneOrMoreInWireframe);
}
@@ -349,8 +346,8 @@ void OCC_3dBaseDoc::OnObjectMaterial()
void OCC_3dBaseDoc::OnUpdateObjectMaterial(CCmdUI* pCmdUI)
{
bool OneOrMoreInShading = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1)) OneOrMoreInShading=true;
pCmdUI->Enable (OneOrMoreInShading);
}
@@ -360,12 +357,11 @@ BOOL OCC_3dBaseDoc::OnObjectMaterialRange(UINT nID)
// continue with the same values as enumeration Type Of Material
Standard_Real aTransparency;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ()){
aTransparency = myAISContext->SelectedInteractive()->Transparency();
myAISContext->SetMaterial (myAISContext->SelectedInteractive(),(Graphic3d_NameOfMaterial)(nID-ID_OBJECT_MATERIAL_BRASS), Standard_False);
myAISContext->SetTransparency (myAISContext->SelectedInteractive(),aTransparency, Standard_False);
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ()){
aTransparency = myAISContext->Current()->Transparency();
myAISContext->SetMaterial (myAISContext->Current(),(Graphic3d_NameOfMaterial)(nID-ID_OBJECT_MATERIAL_BRASS));
myAISContext->SetTransparency (myAISContext->Current(),aTransparency);
}
myAISContext->UpdateCurrentViewer();
return true;
}
@@ -373,11 +369,11 @@ BOOL OCC_3dBaseDoc::OnObjectMaterialRange(UINT nID)
void OCC_3dBaseDoc::OnUpdateObjectMaterialRange(CCmdUI* pCmdUI)
{
bool OneOrMoreInShading = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1)) OneOrMoreInShading=true;
pCmdUI->Enable (OneOrMoreInShading);
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->SelectedInteractive()->Material() - (pCmdUI->m_nID - ID_OBJECT_MATERIAL_BRASS) == 0)
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->Current()->Material() - (pCmdUI->m_nID - ID_OBJECT_MATERIAL_BRASS) == 0)
pCmdUI->SetCheck(1);
}
@@ -395,15 +391,15 @@ void OCC_3dBaseDoc::OnObjectTransparency()
void OCC_3dBaseDoc::OnUpdateObjectTransparency(CCmdUI* pCmdUI)
{
bool OneOrMoreInShading = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive(),1)) OneOrMoreInShading=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current(),1)) OneOrMoreInShading=true;
pCmdUI->Enable (OneOrMoreInShading);
}
void OCC_3dBaseDoc::OnObjectDisplayall()
{
myAISContext->DisplayAll (Standard_True);
myAISContext->DisplayAll();
}
void OCC_3dBaseDoc::OnUpdateObjectDisplayall(CCmdUI* pCmdUI)
@@ -423,24 +419,23 @@ void OCC_3dBaseDoc::OnUpdateObjectDisplayall(CCmdUI* pCmdUI)
void OCC_3dBaseDoc::OnObjectRemove()
{
for(myAISContext->InitSelected();myAISContext->MoreSelected();myAISContext->InitSelected())
myAISContext->Remove(myAISContext->SelectedInteractive(),Standard_True);
for(myAISContext->InitCurrent();myAISContext->MoreCurrent();myAISContext->InitCurrent())
myAISContext->Remove(myAISContext->Current(),Standard_True);
}
void OCC_3dBaseDoc::OnUpdateObjectRemove(CCmdUI* pCmdUI)
{
bool OneOrMoreIsDisplayed = false;
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
if (myAISContext->IsDisplayed(myAISContext->SelectedInteractive())) OneOrMoreIsDisplayed=true;
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
if (myAISContext->IsDisplayed(myAISContext->Current())) OneOrMoreIsDisplayed=true;
pCmdUI->Enable (OneOrMoreIsDisplayed);
}
void OCC_3dBaseDoc::SetMaterial(Graphic3d_NameOfMaterial Material)
{
for (myAISContext->InitSelected();myAISContext->MoreSelected ();myAISContext->NextSelected ())
myAISContext->SetMaterial (myAISContext->SelectedInteractive(),
(Graphic3d_NameOfMaterial)(Material), Standard_False);
myAISContext->UpdateCurrentViewer();
for (myAISContext->InitCurrent();myAISContext->MoreCurrent ();myAISContext->NextCurrent ())
myAISContext->SetMaterial (myAISContext->Current(),
(Graphic3d_NameOfMaterial)(Material));
}

View File

@@ -5,6 +5,7 @@
#include "ParamsFacesPage.h"
#include "DimensionDlg.h"
#include <AIS_InteractiveContext.hxx>
#include <AIS_LocalContext.hxx>
#include <AIS_LengthDimension.hxx>
#include <AIS_AngleDimension.hxx>
@@ -42,8 +43,8 @@ END_MESSAGE_MAP()
void CParamsFacesPage::OnBnClickedFacesbtn1()
{
// Check if face is selected
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_FACE)
{
AfxMessageBox(_T("Choose the face and press the button again"),
@@ -53,16 +54,14 @@ void CParamsFacesPage::OnBnClickedFacesbtn1()
myFirstFace = TopoDS::Face (myAISContext->SelectedShape());
myAISContext->ClearSelected (Standard_True);
myAISContext->LocalContext()->ClearSelected();
}
void CParamsFacesPage::OnBnClickedFacesbtn2()
{
const Standard_Integer aSelectionMode = AIS_Shape::SelectionMode (TopAbs_FACE);
// Check if face is selected
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_FACE)
{
AfxMessageBox(_T("Choose the face and press the button again"),
@@ -71,11 +70,12 @@ void CParamsFacesPage::OnBnClickedFacesbtn2()
}
mySecondFace = TopoDS::Face (myAISContext->SelectedShape());
myAISContext->ClearSelected (Standard_False);
myAISContext->LocalContext()->ClearSelected();
CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner());
myAISContext->Deactivate (aSelectionMode);
myAISContext->CloseAllContexts();
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
anAspect->MakeArrows3d (Standard_False);
@@ -104,7 +104,7 @@ void CParamsFacesPage::OnBnClickedFacesbtn2()
}
anAngleDim->SetFlyout (aDimDlg->GetFlyout());
myAISContext->Display (anAngleDim, Standard_True);
myAISContext->Display (anAngleDim);
}
else
{
@@ -117,8 +117,9 @@ void CParamsFacesPage::OnBnClickedFacesbtn2()
aLenDim->SetDisplayUnits (aDimDlg->GetUnits());
}
myAISContext->Display (aLenDim, Standard_True);
myAISContext->Display (aLenDim);
}
myAISContext->Activate (aSelectionMode);
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_FACE);
}

View File

@@ -331,7 +331,7 @@ void Sample2D_Face::ClearSelected ()
//Method for advanced customizable highlighting of picked object
void Sample2D_Face::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationManager3d)& thePM,
const Handle(Prs3d_Drawer)& theStyle,
const Handle(Graphic3d_HighlightStyle)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
Handle( Prs3d_Presentation ) aHighlightPrs;

View File

@@ -53,7 +53,7 @@ private:
const SelectMgr_SequenceOfOwner& theOwners);
void HilightOwnerWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
const Handle(Prs3d_Drawer)& theStyle,
const Handle(Graphic3d_HighlightStyle)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner);
void Compute ( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,

View File

@@ -58,8 +58,8 @@ END_MESSAGE_MAP()
void CRadiusParamsPage::OnBnClickedObjectBtn()
{
//Build dimension here
myAISContext->InitSelected();
if (!myAISContext->MoreSelected() ||
myAISContext->LocalContext()->InitSelected();
if (!myAISContext->LocalContext()->MoreSelected() ||
myAISContext->SelectedShape().ShapeType() != TopAbs_EDGE)
{
AfxMessageBox (_T ("Choose the edge and press the button again"), MB_ICONINFORMATION | MB_OK);
@@ -94,7 +94,7 @@ void CRadiusParamsPage::OnBnClickedObjectBtn()
}
}
myAISContext->ClearSelected (Standard_False);
myAISContext->LocalContext()->ClearSelected();
CDimensionDlg *aDimDlg = (CDimensionDlg*)(this->GetParentOwner());
// Try to create dimension if it is possible
Handle(AIS_Dimension) aDim;
@@ -124,7 +124,10 @@ void CRadiusParamsPage::OnBnClickedObjectBtn()
aDim->SetDimensionAspect (anAspect);
// Display dimension in the neutral point
myAISContext->CloseAllContexts();
myAISContext->Display (aDim, Standard_True);
myAISContext->Activate (AIS_Shape::SelectionMode (TopAbs_EDGE));
myAISContext->Display (aDim);
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_EDGE);
}

View File

@@ -544,11 +544,11 @@ void ApplicationCommonWindow::onSelectionChanged()
int numSel = context->NbSelected();
if ( numSel )
{
for ( context->InitSelected(); context->MoreSelected(); context->NextSelected() )
for ( context->InitCurrent(); context->MoreCurrent(); context->NextCurrent() )
{
if ( context->IsDisplayed( context->SelectedInteractive(), 1 ) )
if ( context->IsDisplayed( context->Current(), 1 ) )
OneOrMoreInShading = true;
if ( context->IsDisplayed( context->SelectedInteractive(), 0 ) )
if ( context->IsDisplayed( context->Current(), 0 ) )
OneOrMoreInWireframe = true;
}
myToolActions.at( ToolWireframeId )->setEnabled( OneOrMoreInShading );

View File

@@ -159,8 +159,8 @@ void DocumentCommon::fitAll()
void DocumentCommon::onWireframe()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() )
myContext->SetDisplayMode( myContext->SelectedInteractive(), 0, false );
for( myContext->InitCurrent(); myContext->MoreCurrent(); myContext->NextCurrent() )
myContext->SetDisplayMode( myContext->Current(), 0, false );
myContext->UpdateCurrentViewer();
getApplication()->onSelectionChanged();
QApplication::restoreOverrideCursor();
@@ -169,8 +169,8 @@ void DocumentCommon::onWireframe()
void DocumentCommon::onShading()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() )
myContext->SetDisplayMode( myContext->SelectedInteractive(), 1, false );
for( myContext->InitCurrent(); myContext->MoreCurrent(); myContext->NextCurrent() )
myContext->SetDisplayMode( myContext->Current(), 1, false );
myContext->UpdateCurrentViewer();
getApplication()->onSelectionChanged();
QApplication::restoreOverrideCursor();
@@ -180,8 +180,8 @@ void DocumentCommon::onColor()
{
QColor aColor ;
Quantity_Color aShapeColor;
myContext->InitSelected();
Handle(AIS_InteractiveObject) Current = myContext->SelectedInteractive() ;
myContext->InitCurrent();
Handle(AIS_InteractiveObject) Current = myContext->Current() ;
if ( Current->HasColor () )
{
aShapeColor = myContext->Color( Current );
@@ -195,17 +195,15 @@ void DocumentCommon::onColor()
{
Quantity_Color color( aRetColor.red() / 255., aRetColor.green() / 255.,
aRetColor.blue() / 255., Quantity_TOC_RGB );
for (; myContext->MoreSelected(); myContext->NextSelected() )
myContext->SetColor( myContext->SelectedInteractive(), color.Name(), Standard_False);
myContext->UpdateCurrentViewer();
for (; myContext->MoreCurrent(); myContext->NextCurrent() )
myContext->SetColor( myContext->Current(), color.Name() );
}
}
void DocumentCommon::onMaterial( int theMaterial )
{
for ( myContext->InitSelected(); myContext->MoreSelected (); myContext->NextSelected () )
myContext->SetMaterial( myContext->SelectedInteractive(), (Graphic3d_NameOfMaterial)theMaterial, Standard_False);
myContext->UpdateCurrentViewer();
for ( myContext->InitCurrent(); myContext->MoreCurrent (); myContext->NextCurrent () )
myContext->SetMaterial( myContext->Current(), (Graphic3d_NameOfMaterial)theMaterial );
}
void DocumentCommon::onMaterial()
@@ -217,9 +215,8 @@ void DocumentCommon::onMaterial()
void DocumentCommon::onTransparency( int theTrans )
{
for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() )
myContext->SetTransparency (myContext->SelectedInteractive(), ((Standard_Real)theTrans) / 10.0, Standard_False);
myContext->UpdateCurrentViewer();
for( myContext->InitCurrent(); myContext->MoreCurrent(); myContext->NextSelected() )
myContext->SetTransparency( myContext->Current(), ((Standard_Real)theTrans) / 10.0 );
}
void DocumentCommon::onTransparency()
@@ -232,7 +229,7 @@ void DocumentCommon::onTransparency()
void DocumentCommon::onDelete()
{
myContext->EraseSelected (Standard_False);
myContext->ClearSelected (Standard_False);
myContext->ClearSelected();
myContext->UpdateCurrentViewer();
getApplication()->onSelectionChanged();
}

View File

@@ -128,9 +128,7 @@ void MDIWindow::dump()
if ( !QFileInfo( file ).completeSuffix().length() )
file += QString( ".bmp" );
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
bool res = myView->dump( anUtf8Path.ToCString() );
bool res = myView->dump( (Standard_CString)file.toLatin1().constData() );
QApplication::restoreOverrideCursor();
if ( !res )
{

View File

@@ -820,25 +820,25 @@ void View::DragEvent( const int x, const int y, const int TheState )
if ( TheState == 1 )
{
myContext->Select( theButtonDownX, theButtonDownY, x, y, myView, Standard_True );
myContext->Select( theButtonDownX, theButtonDownY, x, y, myView );
emit selectionChanged();
}
}
void View::InputEvent( const int /*x*/, const int /*y*/ )
{
myContext->Select (Standard_True);
myContext->Select();
emit selectionChanged();
}
void View::MoveEvent( const int x, const int y )
{
myContext->MoveTo( x, y, myView, Standard_True );
myContext->MoveTo( x, y, myView );
}
void View::MultiMoveEvent( const int x, const int y )
{
myContext->MoveTo( x, y, myView, Standard_True );
myContext->MoveTo( x, y, myView );
}
void View::MultiDragEvent( const int x, const int y, const int TheState )
@@ -853,14 +853,14 @@ void View::MultiDragEvent( const int x, const int y, const int TheState )
}
if ( TheState == 0 )
{
myContext->ShiftSelect( theButtonDownX, theButtonDownY, x, y, myView, Standard_True );
myContext->ShiftSelect( theButtonDownX, theButtonDownY, x, y, myView );
emit selectionChanged();
}
}
void View::MultiInputEvent( const int /*x*/, const int /*y*/ )
{
myContext->ShiftSelect (Standard_True);
myContext->ShiftSelect();
emit selectionChanged();
}
@@ -1011,10 +1011,8 @@ void View::onEnvironmentMap()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
tr("All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)"));
const TCollection_AsciiString anUtf8Path (fileName.toUtf8().data());
Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv( anUtf8Path );
Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv( fileName.toLatin1().data() );
myView->SetTextureEnv (aTexture);
}

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(CircleDriver, BaseDriver)
DEFINE_STANDARD_RTTIEXT(CircleDriver, TFunction_Driver)
};
#endif // !defined(_CIRCLEDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(ConeDriver, BaseDriver)
DEFINE_STANDARD_RTTIEXT(ConeDriver, TFunction_Driver)
};
#endif // !defined(_CONEDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(CylinderDriver, BaseDriver)
DEFINE_STANDARD_RTTIEXT(CylinderDriver, TFunction_Driver)
};
#endif // !defined(_CYLINDERDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(PointDriver, BaseDriver)
DEFINE_STANDARD_RTTIEXT(PointDriver, TFunction_Driver)
};
#endif // !defined(_PointDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(PrismDriver, BaseDriver)
DEFINE_STANDARD_RTTIEXT(PrismDriver, TFunction_Driver)
};
#endif // !defined(_PRISMDRIVER_H_)

View File

@@ -30,7 +30,7 @@ public:
// Execution.
virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
DEFINE_STANDARD_RTTIEXT(ShapeSaverDriver, BaseDriver)
DEFINE_STANDARD_RTTIEXT(ShapeSaverDriver, TFunction_Driver)
};
#endif // !defined(_SHAPESAVERDRIVER_H_)

View File

@@ -275,9 +275,9 @@ Handle(TopTools_HSequenceOfShape) Translate::getShapes( const Handle(AIS_Interac
{
Handle(TopTools_HSequenceOfShape) aSequence;
Handle(AIS_InteractiveObject) picked;
for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() )
for ( ic->InitCurrent(); ic->MoreCurrent(); ic->NextCurrent() )
{
Handle(AIS_InteractiveObject) obj = ic->SelectedInteractive();
Handle(AIS_InteractiveObject) obj = ic->Current();
if ( obj->IsKind( STANDARD_TYPE( AIS_Shape ) ) )
{
TopoDS_Shape shape = Handle(AIS_Shape)::DownCast(obj)->Shape();
@@ -457,10 +457,7 @@ bool Translate::exportBREP( const QString& file, const Handle(TopTools_HSequence
return false;
TopoDS_Shape shape = shapes->Value( 1 );
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
return BRepTools::Write( shape, anUtf8Path.ToCString() );
return BRepTools::Write( shape, (Standard_CString)file.toLatin1().constData() );
}
bool Translate::exportIGES( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes )
@@ -475,10 +472,7 @@ bool Translate::exportIGES( const QString& file, const Handle(TopTools_HSequence
for ( int i = 1; i <= shapes->Length(); i++ )
writer.AddShape ( shapes->Value( i ) );
writer.ComputeModel();
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
return writer.Write( anUtf8Path.ToCString() );
return writer.Write( (Standard_CString)file.toLatin1().constData() );
}
bool Translate::exportSTEP( const QString& file, const Handle(TopTools_HSequenceOfShape)& shapes )
@@ -506,10 +500,8 @@ bool Translate::exportSTEP( const QString& file, const Handle(TopTools_HSequence
if ( status != IFSelect_RetDone )
return false;
}
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
status = writer.Write( anUtf8Path.ToCString() );
status = writer.Write( (Standard_CString)file.toLatin1().constData() );
switch ( status )
{
@@ -547,10 +539,7 @@ bool Translate::exportSTL( const QString& file, const Handle(TopTools_HSequenceO
}
StlAPI_Writer writer;
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
writer.Write( res, anUtf8Path.ToCString() );
writer.Write( res, (Standard_CString)file.toLatin1().constData() );
return true;
}
@@ -576,10 +565,7 @@ bool Translate::exportVRML( const QString& file, const Handle(TopTools_HSequence
}
VrmlAPI_Writer writer;
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
writer.Write( res, anUtf8Path.ToCString() );
writer.Write( res, (Standard_CString)file.toLatin1().constData() );
return true;
}

View File

@@ -24,11 +24,10 @@ void DocumentTut::onMakeBottle()
QApplication::setOverrideCursor( Qt::WaitCursor );
TopoDS_Shape aBottle=MakeBottle(50,70,30);
Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);
getContext()->SetMaterial (AISBottle, Graphic3d_NOM_GOLD, Standard_False);
getContext()->SetDisplayMode(AISBottle, 1, Standard_False);
getContext()->SetMaterial(AISBottle,Graphic3d_NOM_GOLD);
getContext()->SetDisplayMode(AISBottle,1,Standard_False);
getContext()->Display(AISBottle, Standard_False);
const Handle(AIS_InteractiveObject)& anIOAISBottle = AISBottle;
getContext()->SetSelected(anIOAISBottle,Standard_False);
getContext()->SetCurrentObject(AISBottle,Standard_False);
emit selectionChanged();
fitAll();
QApplication::restoreOverrideCursor();

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