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

Compare commits

..

3 Commits

Author SHA1 Message Date
ski
24f6335ebc Added test case. 2016-10-10 18:26:34 +03:00
ski
3253efc138 Removed unnecessary slash at the end of path returned by method CurrentDirectory of OSD_Process class 2016-10-07 17:03:01 +03:00
ski
1ae262d9be 0024296: Test "bugs fclasses bug309" is crashed if current directory is into disc-root
Fixed incorrect inclusion of slash symbol to the path.
2016-10-07 17:03:00 +03:00
3787 changed files with 284565 additions and 134071 deletions

3
.gitattributes vendored
View File

@@ -37,9 +37,6 @@
*.vrml eol=lf
*.md eol=lf
*.natvis eol=lf
*.fs eol=lf
*.vs eol=lf
*.glsl eol=lf
FILES eol=lf
PACKAGES eol=lf
EXTERNLIB eol=lf

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")
@@ -57,9 +52,6 @@ set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE}
set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}")
# Regeneration of OCCT resource files
set (BUILD_RESOURCES OFF CACHE BOOL "${BUILD_RESOURCES_DESCR}")
# single-configuration generator
set (SINGLE_GENERATOR OFF)
if (CMAKE_BUILD_TYPE)
@@ -293,16 +285,13 @@ if (NOT DEFINED INSTALL_DIR_CMAKE)
endif()
endif()
# include occt macros
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_resources")
# install LICENSE_LGPL_21.txt and OCCT_LGPL_EXCEPTION.txt files
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" "${INSTALL_DIR_DOC}")
OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" "${INSTALL_DIR_DOC}")
OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" "${INSTALL_DIR}/${INSTALL_DIR_DOC}")
OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" "${INSTALL_DIR}/${INSTALL_DIR_DOC}")
else()
OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" ".")
OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" ".")
OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" "${INSTALL_DIR}")
OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" "${INSTALL_DIR}")
endif()
if(APPLE)
@@ -338,17 +327,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 +577,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)
@@ -625,11 +584,11 @@ if (BUILD_DOC_Overview)
endif()
if (INSTALL_DOC_Overview)
install (DIRECTORY "${CMAKE_BINARY_DIR}/doc/overview" DESTINATION "${INSTALL_DIR_DOC}")
install (DIRECTORY "${CMAKE_BINARY_DIR}/doc/overview" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_DOC}")
# create overview.html only for windows
if (WIN32 AND "${INSTALL_DIR_LAYOUT}" STREQUAL "Windows")
OCCT_INSTALL_FILE_OR_DIR ("dox/resources/overview.html" "${INSTALL_DIR_DOC}/..")
OCCT_INSTALL_FILE_OR_DIR ("dox/resources/overview.html" "${INSTALL_DIR}/${INSTALL_DIR_DOC}/..")
endif()
endif()
@@ -716,12 +675,6 @@ COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}"
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX)
if (${DRAWEXE_INDEX} GREATER -1)
OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR_DATA}")
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR_SAMPLES}")
endif()
if (WIN32)
set (SCRIPT_EXT bat)
else()
@@ -729,51 +682,45 @@ else()
endif()
# OCCT samples
# get absolute path from INSTALL_DIR
set (INSTALL_DIR_ABSOLUTE "${INSTALL_DIR}")
if(NOT IS_ABSOLUTE "${INSTALL_DIR_ABSOLUTE}")
get_filename_component(INSTALL_DIR_ABSOLUTE "${CMAKE_BINARY_DIR}/${INSTALL_DIR}" ABSOLUTE)
endif()
if (INSTALL_SAMPLES)
OCCT_CONFIGURE ("adm/templates/env.samples.${SCRIPT_EXT}.in" "env.samples.${SCRIPT_EXT}")
if (WIN32)
OCCT_INSTALL_FILE_OR_DIR ("samples/CSharp" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/mfc" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/CSharp" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/mfc" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
OCCT_INSTALL_FILE_OR_DIR ("samples/xaml" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/xaml" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
endif()
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/CSharp" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/mfc/standard" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/CSharp" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/mfc/standard" RENAME "env.${SCRIPT_EXT}")
endif()
OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/Tutorial" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/qt/Tutorial" RENAME "env.${SCRIPT_EXT}")
endif()
if (INSTALL_TEST_CASES)
OCCT_INSTALL_FILE_OR_DIR ("tests/" "${INSTALL_DIR_TESTS}")
OCCT_INSTALL_FILE_OR_DIR ("tests/" "${INSTALL_DIR}/${INSTALL_DIR_TESTS}")
endif()
list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX)
if (${DRAWEXE_INDEX} GREATER -1)
# copy data and samples/tcl folders to install script folder
OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR_DATA}")
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR}/${INSTALL_DIR_DATA}")
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
# copy draw script to install script folder
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}")
install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
else()
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
endif()
@@ -797,18 +744,18 @@ if (EXISTS "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}")
file (WRITE "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
else()
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}")
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
endif()
# write current custom.bat/sh (for install directory)
set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}")
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR_SCRIPT}")
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
# write current custom.bat/sh (for build directory)
OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}")
if (BUILD_MODULE_MfcSamples)
OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR_SCRIPT}")
OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.bat" "${CMAKE_BINARY_DIR}")
endif()
@@ -816,7 +763,7 @@ endif()
OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
# install env script
install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}")
install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
# copy DrawAppliInit from OCCT source to build directory
if (NOT EXISTS "${CMAKE_BINARY_DIR}/DrawAppliInit")
@@ -829,9 +776,9 @@ foreach(RESOURCE ${RESOURCES})
get_filename_component(RESOURCE_FOLDER ${RESOURCE} DIRECTORY)
if(NOT "${RESOURCE_FOLDER}" STREQUAL "")
get_filename_component(RESOURCE_FOLDER ${RESOURCE_FOLDER} NAME)
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
else()
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}")
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}")
endif()
endforeach()
@@ -986,7 +933,7 @@ endif()
# Configure and install cmake config file
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADEConfig.cmake.in" "OpenCASCADEConfig.cmake" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfig.cmake" DESTINATION "${INSTALL_DIR_CMAKE}")
install(FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfig.cmake" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_CMAKE}")
# Configure cmake version file
include(CMakePackageConfigHelpers)
@@ -995,7 +942,7 @@ write_basic_package_version_file( ${CMAKE_BINARY_DIR}/OpenCASCADEConfigVersion.c
COMPATIBILITY ExactVersion )
# Install cmake version file
install (FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfigVersion.cmake" DESTINATION "${INSTALL_DIR_CMAKE}")
install (FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfigVersion.cmake" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_CMAKE}")
# Install the export set for use with the install-tree for each configuration
foreach (OCCT_MODULE ${OCCT_MODULES_ENABLED})

View File

@@ -6,5 +6,6 @@ Shaders
XSMessage
XSTEPResource
XmlOcafResource
UnitsAPI/Lexi_Expr.dat
UnitsAPI/Units.dat
TObj/TObj.msg

View File

@@ -5,6 +5,7 @@ n Bnd
n BVH
n CSLib
n Convert
n Dico
n ElCLib
n ElSLib
n Expr
@@ -437,4 +438,3 @@ n IVtkDraw
t TKIVtkDraw
n Geom2dEvaluator
t TKVCAF
n XCAFView

View File

@@ -196,17 +196,17 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
if (WIN32)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" DESTINATION "${INSTALL_DIR_BIN}")
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
else()
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}i")
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(ABS_PATH ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} REALPATH)
@@ -215,19 +215,19 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
get_filename_component(FREEIMLIB ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} NAME)
if (SINGLE_GENERATOR)
install (FILES "${ABS_PATH}" DESTINATION "${INSTALL_DIR_LIB}" RENAME ${FREEIMLIB}.3)
install (FILES "${ABS_PATH}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}" RENAME ${FREEIMLIB}.3)
else()
install (FILES "${ABS_PATH}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}"
RENAME ${FREEIMLIB}.3)
install (FILES "${ABS_PATH}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}i"
RENAME ${FREEIMLIB}.3)
install (FILES "${ABS_PATH}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}d"
RENAME ${FREEIMLIB}.3)
endif()
endif()
@@ -236,19 +236,19 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
get_filename_component(GL2PSLIB ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} NAME)
if (SINGLE_GENERATOR)
install (FILES "${ABS_PATH}" DESTINATION "${INSTALL_DIR_LIB}" RENAME ${GL2PSLIB}.1)
install (FILES "${ABS_PATH}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}" RENAME ${GL2PSLIB}.1)
else()
install (FILES "${ABS_PATH}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}"
RENAME ${GL2PSLIB}.1)
install (FILES "${ABS_PATH}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}i"
RENAME ${GL2PSLIB}.1)
install (FILES "${ABS_PATH}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}d"
RENAME ${GL2PSLIB}.1)
endif()
endif()

View File

@@ -1,10 +1,9 @@
# doxygen
set (DOXYGEN_MINIMUM_VERSION 1.8.4)
if (DO_ONLY_CHECK_FOR_DOXYGEN)
message (STATUS "Info. Detecting doxygen")
set (DOXYGEN_SKIP_DOT ON)
find_package (Doxygen ${DOXYGEN_MINIMUM_VERSION})
find_package (Doxygen)
set (CAN_DOXYGEN_BE_USED OFF)
if (DOXYGEN_EXECUTABLE)
@@ -34,7 +33,7 @@ else()
if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE OR (NOT 3RDPARTY_SKIP_DOT_EXECUTABLE AND NOT 3RDPARTY_DOT_EXECUTABLE))
set (DOXYGEN_SKIP_DOT ${3RDPARTY_SKIP_DOT_EXECUTABLE})
find_package (Doxygen ${DOXYGEN_MINIMUM_VERSION})
find_package (Doxygen)
if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE AND DOXYGEN_EXECUTABLE)
set (3RDPARTY_DOXYGEN_EXECUTABLE "${DOXYGEN_EXECUTABLE}" CACHE FILEPATH "${3RDPARTY_DOXYGEN_EXECUTABLE_DESCR}" FORCE)

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

@@ -300,17 +300,17 @@ if (BUILD_SHARED_LIBS)
if (WIN32)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_FREETYPE_DLL}" DESTINATION "${INSTALL_DIR_BIN}")
install (FILES "${3RDPARTY_FREETYPE_DLL}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
else()
install (FILES "${3RDPARTY_FREETYPE_DLL}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
install (FILES "${3RDPARTY_FREETYPE_DLL}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}i")
install (FILES "${3RDPARTY_FREETYPE_DLL}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(3RDPARTY_FREETYPE_LIBRARY_ABS ${3RDPARTY_FREETYPE_LIBRARY} REALPATH)
@@ -318,20 +318,20 @@ if (BUILD_SHARED_LIBS)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
DESTINATION "${INSTALL_DIR_LIB}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}"
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
else()
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}"
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}i"
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}d"
RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6)
endif()
endif()

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

@@ -122,14 +122,7 @@ if(MINGW)
add_definitions(-D_WIN32_WINNT=0x0501)
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
elseif ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
if (APPLE)
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
set (CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
else()
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()

View File

@@ -257,8 +257,6 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
foreach (FILE_INDEX RANGE ${ALL_FILES_NB})
list (GET OCCT_ALL_FILE_NAMES ${FILE_INDEX} OCCT_FILE_NAME)
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE_NAME "${OCCT_FILE_NAME}")
if ("${OCCT_FILE_IN_DIR_NAME}" STREQUAL "${OCCT_FILE_NAME}")
set (OCCT_FILE_IN_DIR_STATUS ON)
@@ -298,11 +296,10 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"")
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY)
endforeach()
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR_INCLUDE}")
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...")

View File

@@ -1,77 +0,0 @@
# OCCT resource files generation
macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
set (RESOURCE_FILES)
set (isResDirectory FALSE)
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/src/${CurrentResource}")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource}/FILES" RESOURCE_FILES)
set (CurrentResource_Directory "${CurrentResource}")
set (isResDirectory TRUE)
else()
get_filename_component (CurrentResource_Name "${CurrentResource}" NAME)
list (APPEND RESOURCE_FILES "res:::${CurrentResource_Name}")
get_filename_component (CurrentResource_Directory "${CurrentResource}" DIRECTORY)
endif()
# Add current toolkit into RESOURCE_TOOLKITS array to copy it to the BUILD directory
list (APPEND RESOURCE_TOOLKITS "${CurrentResource_Directory}")
list (REMOVE_DUPLICATES RESOURCE_TOOLKITS)
if (BUILD_RESOURCES)
foreach (RESOURCE_FILE ${RESOURCE_FILES})
string (REGEX MATCH "^[^:]+:::" IS_RESOURCE "${RESOURCE_FILE}")
if (IS_RESOURCE)
string (REGEX REPLACE "[^:]+:+" "" RESOURCE_FILE "${RESOURCE_FILE}")
get_filename_component (CurrentResource_FileName "${RESOURCE_FILE}" NAME)
string (REPLACE "." "_" CurrentResource_FileName "${CurrentResource_FileName}")
set (HEADER_FILE_NAME "${CurrentResource_Directory}_${CurrentResource_FileName}.pxx")
set (toProcessResFile TRUE)
if (isResDirectory)
list (FIND RESOURCE_FILES "${HEADER_FILE_NAME}" aResIndex)
if ("${aResIndex}" STREQUAL "-1")
set (toProcessResFile FALSE)
endif()
endif()
if (toProcessResFile)
message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}")
# generate content for header file
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
# read resource file
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
string (REPLACE "\"" "\\\"" line "${line}")
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
endforeach()
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};")
# Save generated content to header file
set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}")
if (EXISTS "${HEADER_FILE}")
file (REMOVE "${HEADER_FILE}")
endif()
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
endif()
endif()
endforeach()
endif()
endmacro()
FILE_TO_LIST ("adm/RESOURCES" RESOURCES)
foreach (CurrentResource ${RESOURCES})
get_filename_component (CurrentResource_FileName "${CurrentResource}" NAME)
if ("${CurrentResource_FileName}" STREQUAL TObj.msg OR
"${CurrentResource_FileName}" STREQUAL Units.dat OR
"${CurrentResource}" STREQUAL XSMessage OR
"${CurrentResource}" STREQUAL SHMessage OR
"${CurrentResource}" STREQUAL Shaders)
OCCT_GENERATE_CONTENT_ONLY ("${CurrentResource}")
endif()
endforeach()

View File

@@ -147,14 +147,14 @@ if ("${PROJECT_NAME}" STREQUAL "DRAWEXE")
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE})
install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE})
if (MSVC)
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
endif()
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
@@ -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

@@ -237,37 +237,37 @@ macro (TBB_PRODUCT_SEARCH PRODUCT_NAME)
if (WIN32)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
else()
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}i")
install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} NAME)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
DESTINATION "${INSTALL_DIR_LIB}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
else()
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}i"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}d"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
endif()
endif()

View File

@@ -210,40 +210,40 @@ if (BUILD_SHARED_LIBS)
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
if (SINGLE_GENERATOR)
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
else()
install (FILES ${TCL_DLLS}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
install (FILES ${TCL_DLLS}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}i")
install (FILES ${TCL_DLLS}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}d")
endif()
endif()
if (TCL_TCLSH_VERSION)
# tcl is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
message (STATUS "\nWarning: tclX.X subdir won't be copyied during the installation process.")
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")

View File

@@ -216,39 +216,39 @@ if (BUILD_SHARED_LIBS)
file (GLOB TK_DLLS "${3RDPARTY_TK_DLL_DIR}/*.dll")
if (SINGLE_GENERATOR)
install (FILES ${TK_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${TK_DLLS} DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
else()
install (FILES ${TK_DLLS}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
install (FILES ${TK_DLLS}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}i")
install (FILES ${TK_DLLS}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(3RDPARTY_TK_LIBRARY_REALPATH ${3RDPARTY_TK_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}/")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}/")
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}/i")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}/i")
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}d")
endif()
endif()
if (TCL_TCLSH_VERSION)
# tk is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
message (STATUS "\nWarning: tkX.X subdir won't be copyied during the installation process.")
message (STATUS "Try seeking tk within another folder by changing 3RDPARTY_TK_DIR variable.")

View File

@@ -18,8 +18,6 @@ set (BUILD_YACCLEX_DESCR
ExprIntrp functionality are generated automatically with Flex/Bison. Checking this options
leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files")
set (BUILD_RESOURCES_DESCR "Enables regeneration of OCCT resource files")
set (BUILD_WITH_DEBUG_DESCR
"Enables extended messages of many OCCT algorithms, usually printed to cout.
These include messages on internal errors and special cases encountered, timing etc.
@@ -28,11 +26,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

@@ -70,7 +70,7 @@ proc gendoc {args} {
set DOCLABEL ""
set VERB_MODE "NO"
set SEARCH_MODE "none"
set MATHJAX_LOCATION "https://cdn.mathjax.org/mathjax/latest"
set MATHJAX_LOCATION "http://cdn.mathjax.org/mathjax/latest"
set mathjax_js_name "MathJax.js"
set DOCTYPE_COMBO_FLAG 0
set GENMODE_COMBO_FLAG 0

View File

@@ -108,155 +108,9 @@ proc osutils:findSrcSubPath {theSubPath} {
return "$::THE_CASROOT/src/$theSubPath"
}
# Auxiliary tool comparing content of two files line-by-line.
proc osutils:isEqualContent { theContent1 theContent2 } {
set aLen1 [llength $theContent1]
set aLen2 [llength $theContent2]
if { $aLen1 != $aLen2 } {
return false
}
for {set aLineIter 0} {$aLineIter < $aLen1} {incr aLineIter} {
set aLine1 [lindex $theContent1 $aLineIter]
set aLine2 [lindex $theContent2 $aLineIter]
if { $aLine1 != $aLine2 } {
return false
}
}
return true
}
# Auxiliary function for writing new file content only if it has been actually changed
# (e.g. to preserve file timestamp on no change).
# Useful for automatically (re)generated files.
proc osutils:writeTextFile { theFile theContent {theEol lf} } {
if {[file exists "${theFile}"]} {
set aFileOld [open "${theFile}" rb]
fconfigure $aFileOld -translation crlf
set aLineListOld [split [read $aFileOld] "\n"]
close $aFileOld
# append empty line for proper comparison (which will be implicitly added by last puts below)
set aContent $theContent
lappend aContent ""
if { [osutils:isEqualContent $aLineListOld $aContent] == true } {
return false
}
file delete -force "${theFile}"
}
set anOutFile [open "$theFile" "w"]
fconfigure $anOutFile -translation $theEol
foreach aLine ${theContent} {
puts $anOutFile "${aLine}"
}
close $anOutFile
return true
}
# Function re-generating header files for specified text resource
proc genResources { theResource } {
global path
set aResFileList {}
set aResourceAbsPath [file normalize "${path}/src/${theResource}"]
set aResourceDirectory ""
set isResDirectory false
if {[file isdirectory "${aResourceAbsPath}"]} {
if {[file exists "${aResourceAbsPath}/FILES"]} {
set aFilesFile [open "${aResourceAbsPath}/FILES" rb]
set aResFileList [split [read $aFilesFile] "\n"]
close $aFilesFile
}
set aResFileList [lsearch -inline -all -not -exact $aResFileList ""]
set aResourceDirectory "${theResource}"
set isResDirectory true
} else {
set aResourceName [file tail "${theResource}"]
lappend aResFileList "res:::${aResourceName}"
set aResourceDirectory [file dirname "${theResource}"]
}
foreach aResFileIter ${aResFileList} {
if {![regexp {^[^:]+:::(.+)} "${aResFileIter}" dump aResFileIter]} {
continue
}
set aResFileName [file tail "${aResFileIter}"]
regsub -all {\.} "${aResFileName}" {_} aResFileName
set aHeaderFileName "${aResourceDirectory}_${aResFileName}.pxx"
if { $isResDirectory == true && [lsearch $aResFileList $aHeaderFileName] == -1 } {
continue
}
# generate
set aContent {}
lappend aContent "// This file has been automatically generated from resource file src/${aResourceDirectory}/${aResFileIter}"
lappend aContent ""
# generate necessary structures
set aLineList {}
if {[file exists "${path}/src/${aResourceDirectory}/${aResFileIter}"]} {
set anInputFile [open "${path}/src/${aResourceDirectory}/${aResFileIter}" rb]
fconfigure $anInputFile -translation crlf
set aLineList [split [read $anInputFile] "\n"]
close $anInputFile
}
# drop empty trailing line
set anEndOfFile ""
if { [lindex $aLineList end] == "" } {
set aLineList [lreplace $aLineList end end]
set anEndOfFile "\\n"
}
lappend aContent "static const char ${aResourceDirectory}_${aResFileName}\[\] ="
set aNbLines [llength $aLineList]
set aLastLine [expr $aNbLines - 1]
for {set aLineIter 0} {$aLineIter < $aNbLines} {incr aLineIter} {
set aLine [lindex $aLineList $aLineIter]
regsub -all {\"} "${aLine}" {\\"} aLine
if { $aLineIter == $aLastLine } {
lappend aContent " \"${aLine}${anEndOfFile}\";"
} else {
lappend aContent " \"${aLine}\\n\""
}
}
# Save generated content to header file
set aHeaderFilePath "${path}/src/${aResourceDirectory}/${aHeaderFileName}"
if { [osutils:writeTextFile $aHeaderFilePath $aContent] == true } {
puts "Generating header file from resource file: ${path}/src/${aResourceDirectory}/${aResFileIter}"
} else {
#puts "Header file from resource ${path}/src/${aResourceDirectory}/${aResFileIter} is up-to-date"
}
}
}
# Function re-generating header files for all text resources
proc genAllResources {} {
global path
set aCasRoot [file normalize $path]
if {![file exists "$aCasRoot/adm/RESOURCES"]} {
puts "OCCT directory is not defined correctly: $aCasRoot"
return
}
set aFileResources [open "$aCasRoot/adm/RESOURCES" rb]
set anAdmResources [split [read $aFileResources] "\r\n"]
close $aFileResources
set anAdmResources [lsearch -inline -all -not -exact $anAdmResources ""]
foreach line $anAdmResources {
genResources "${line}"
}
}
# Wrapper-function to generate VS project files
proc genproj {theIDE args} {
set aSupportedIDEs { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc14-uwp" "cbp" "xcd"}
set aSupportedIDEs { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" }
set aSupportedPlatforms { "wnt" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
@@ -305,15 +159,14 @@ proc genproj {theIDE args} {
puts "usage: genproj IDE \[Platform\] \[-static\] \[-h|-help|--help\]
IDE must be one of:
vc8 - Visual Studio 2005
vc9 - Visual Studio 2008
vc10 - Visual Studio 2010
vc11 - Visual Studio 2012
vc12 - Visual Studio 2013
vc14 - Visual Studio 2015
vc14-uwp - Visual Studio 2015 for Universal Windows Platform project
cbp - CodeBlocks
xcd - XCode
vc8 - Visual Studio 2005
vc9 - Visual Studio 2008
vc10 - Visual Studio 2010
vc11 - Visual Studio 2012
vc12 - Visual Studio 2013
vc14 - Visual Studio 2015
cbp - CodeBlocks
xcd - XCode
Platform (optional, only for CodeBlocks and XCode):
wnt - Windows
@@ -340,7 +193,6 @@ proc genproj {theIDE args} {
OS:MKPRC "$anAdmPath" "$theIDE" "$aLibType" "$aPlatform" "$aCmpl"
genprojbat "$theIDE" $aPlatform
genAllResources
}
proc genprojbat {theIDE thePlatform} {
@@ -371,7 +223,7 @@ proc genprojbat {theIDE thePlatform} {
file copy -force -- "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
}
if {[regexp {(vc)[0-9]*$} $theIDE] == 1 || [regexp {(vc)[0-9]*-uwp$} $theIDE] == 1} {
if {[regexp {(vc)[0-9]*$} $theIDE] == 1} {
file copy -force -- "$::THE_CASROOT/adm/templates/msvc.bat" "$::path/msvc.bat"
} else {
switch -exact -- "$theIDE" {
@@ -414,7 +266,7 @@ proc OS:MKPRC { theOutDir theIDE theLibType thePlatform theCmpl } {
# Create output directory
set aWokStation "$thePlatform"
if { [lsearch -exact {vc7 vc8 vc9 vc10 vc11 vc12 vc14 vc14-uwp} $theIDE] != -1 } {
if { [lsearch -exact {vc7 vc8 vc9 vc10 vc11 vc12 vc14} $theIDE] != -1 } {
set aWokStation "msvc"
}
@@ -442,14 +294,6 @@ proc OS:MKPRC { theOutDir theIDE theLibType thePlatform theCmpl } {
set aModules [osutils:juststation $goaway $aModules]
}
# Draw module is turned off due to it is not supported on UWP
if { [regexp {(vc)[0-9]*-uwp$} $theIDE] == 1 } {
set aDrawIndex [lsearch -exact ${aModules} "Draw"]
if { ${aDrawIndex} != -1 } {
set aModules [lreplace ${aModules} ${aDrawIndex} ${aDrawIndex}]
}
}
# generate one solution for all projects if complete OS or VAS is processed
set anAllSolution "OCCT"
@@ -474,13 +318,12 @@ proc OS:MKPRC { theOutDir theIDE theLibType thePlatform theCmpl } {
"vc7" -
"vc8" -
"vc9" -
"vc10" -
"vc11" -
"vc12" -
"vc14" -
"vc14-uwp" { OS:MKVC $anOutDir $aModules $anAllSolution $theIDE }
"cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution $thePlatform $theCmpl }
"xcd" {
"vc10" -
"vc11" -
"vc12" -
"vc14" { OS:MKVC $anOutDir $aModules $anAllSolution $theIDE }
"cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution $thePlatform $theCmpl }
"xcd" {
set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000"
OS:MKXCD $anOutDir $aModules $anAllSolution $theLibType $thePlatform
}
@@ -816,7 +659,6 @@ proc osutils:collectinc {theModules theIncPath} {
}
}
set allHeaderFiles {}
if { $aCopyType == "shortcut" } {
# template preparation
if { ![file exists $::THE_CASROOT/adm/templates/header.in] } {
@@ -830,14 +672,11 @@ proc osutils:collectinc {theModules theIncPath} {
# create and copy short-cut header files
foreach anUnit $anUnits {
osutils:checksrcfiles ${anUnit}
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]
set aHFiles [_get_used_files ${anUnit} true false]
foreach aHeaderFile ${aHFiles} {
set aHeaderFileName [lindex ${aHeaderFile} 1]
lappend allHeaderFiles "${aHeaderFileName}"
regsub -all -- {@OCCT_HEADER_FILE_CONTENT@} $aHeaderTmpl "#include \"$aFromBuildIncToSrcPath/$anUnit/$aHeaderFileName\"" aShortCutHeaderFileContent
regsub -all -- {@OCCT_HEADER_FILE@} $aHeaderTmpl "$aFromBuildIncToSrcPath/$anUnit/$aHeaderFileName" aShortCutHeaderFileContent
if {[file exists "$theIncPath/$aHeaderFileName"] && [file readable "$theIncPath/$aHeaderFileName"]} {
set fp [open "$theIncPath/$aHeaderFileName" r]
@@ -867,15 +706,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 +722,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
@@ -933,7 +760,7 @@ proc osutils:vcsolution:header { vcversion } {
append var \
"Microsoft Visual Studio Solution File, Format Version 13.00\n" \
"# Visual Studio 2013\n"
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc14-uwp"} {
} elseif { "$vcversion" == "vc14" } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 14\n"
@@ -1170,40 +997,19 @@ proc osutils:vcproj:readtemplate {theVcVer isexec} {
set aVerExt "v${aVerExt}0"
set aCmpl32 ""
set aCmpl64 ""
set aCharSet "Unicode"
if { $isexec } {
set anExt "${anExt}x"
set what "$what executable"
}
if { "$theVcVer" == "vc10" } {
# SSE2 is enabled by default in vc11+, but not in vc10 for 32-bit target
set aCmpl32 "<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>"
set aCmpl32 "\n <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>"
}
set aTmpl [osutils:readtemplate $anExt "MS VC++ project ($what)"]
if { $theVcVer == "vc14-uwp" } {
set aVerExt "v140"
set UwpWinRt "<CompileAsWinRT>false</CompileAsWinRT>"
foreach bitness {32 64} {
set indent ""
if {"[set aCmpl${bitness}]" != ""} {
set indent "\n "
}
set aCmpl${bitness} "[set aCmpl${bitness}]${indent}${UwpWinRt}"
}
}
foreach bitness {32 64} {
set format_template ""
if {"[set aCmpl${bitness}]" == ""} {
set format_template "\[\\r\\n\\s\]*"
}
regsub -all -- "${format_template}__VCMPL${bitness}__" $aTmpl "[set aCmpl${bitness}]" aTmpl
}
regsub -all -- {__VCVER__} $aTmpl $theVcVer aTmpl
regsub -all -- {__VCVEREXT__} $aTmpl $aVerExt aTmpl
regsub -all -- {__VCCHARSET__} $aTmpl $aCharSet aTmpl
regsub -all -- {__VCVER__} $aTmpl $theVcVer aTmpl
regsub -all -- {__VCVEREXT__} $aTmpl $aVerExt aTmpl
regsub -all -- {__VCMPL32__} $aTmpl $aCmpl32 aTmpl
regsub -all -- {__VCMPL64__} $aTmpl $aCmpl64 aTmpl
return $aTmpl
}
@@ -1275,9 +1081,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 +1094,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 +1104,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"
@@ -1655,14 +1453,7 @@ proc osutils:vcproj { theVcVer theOutDir theToolKit theGuidsMap {theProjTmpl {}
}
regsub -all -- {__PROJECT_GUID__} $theProjTmpl $aGuidsMap($theToolKit) theProjTmpl
set theProjTmpl [osutils:uwp:proj ${theVcVer} ${theProjTmpl}]
set aUsedLibs [list]
if { "$theVcVer" == "vc14-uwp" } {
lappend aUsedLibs "WindowsApp.lib"
}
foreach tkx [osutils:commonUsedTK $theToolKit] {
lappend aUsedLibs "${tkx}.lib"
}
@@ -3061,12 +2852,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;"
@@ -3104,12 +2895,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;"
@@ -3289,93 +3080,3 @@ proc osutils:xcdx { theOutDir theExecutable theGuidsMap } {
puts $aPlistFile $aPlistTmpl
close $aPlistFile
}
# Returns available Windows SDKs versions
proc osutils:sdk { theSdkMajorVer {isQuietMode false} {theSdkDirectories {}} } {
if { ![llength ${theSdkDirectories}] } {
foreach anEnvVar { "ProgramFiles" "ProgramFiles\(x86\)" "ProgramW6432" } {
if {[ info exists ::env(${anEnvVar}) ]} {
lappend theSdkDirectories "$::env(${anEnvVar})/Windows Kits/${theSdkMajorVer}/Include"
}
}
}
set sdk_versions {}
foreach sdk_dir ${theSdkDirectories} {
if { [file isdirectory ${sdk_dir}] } {
lappend sdk_versions [glob -tails -directory "${sdk_dir}" -type d *]
}
}
if {![llength ${sdk_versions}] && !${isQuietMode}} {
error "Error : Could not find Windows SDK ${theSdkMajorVer}"
}
return [join [lsort -unique ${sdk_versions}] " "]
}
# Generate global properties to Visual Studio project file for UWP solution
proc osutils:uwp:proj { theVcVer theProjTmpl } {
set uwp_properties ""
set uwp_generate_metadata ""
set uwp_app_container ""
set format_template ""
if { ${theVcVer} == "vc14-uwp" } {
set sdk_versions [osutils:sdk 10]
set sdk_max_ver [lindex ${sdk_versions} end]
set uwp_properties "<DefaultLanguage>en-US</DefaultLanguage>\n \
<ApplicationType>Windows Store</ApplicationType>\n \
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>\n \
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>\n \
<AppContainerApplication>true</AppContainerApplication>\n \
<WindowsTargetPlatformVersion>${sdk_max_ver}</WindowsTargetPlatformVersion>\n \
<WindowsTargetPlatformMinVersion>${sdk_max_ver}</WindowsTargetPlatformMinVersion>"
set uwp_generate_metadata "<GenerateWindowsMetadata>false</GenerateWindowsMetadata>"
regsub -all -- {[\r\n\s]*<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>} ${theProjTmpl} "" theProjTmpl
} else {
set format_template "\[\\r\\n\\s\]*"
}
regsub -all -- "${format_template}__UWP_PROPERTIES__" ${theProjTmpl} "${uwp_properties}" theProjTmpl
regsub -all -- "${format_template}__UWP_GENERATE_METADATA__" ${theProjTmpl} "${uwp_generate_metadata}" 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

@@ -2,7 +2,6 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
@@ -15,7 +14,6 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
@@ -28,7 +26,6 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples

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@"
@@ -20,18 +17,18 @@ if /I "%VCVER%" == "@COMPILER@" (
set "TCL_VERSION_WITH_DOT=@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
set "TK_VERSION_WITH_DOT=@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
set "CSF_OCCTBinPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_BIN@%3"
set "CSF_OCCTLibPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_LIB@%3"
set "CSF_OCCTBinPath=@INSTALL_DIR@/@INSTALL_DIR_BIN@%3"
set "CSF_OCCTLibPath=@INSTALL_DIR@/@INSTALL_DIR_LIB@%3"
set "CSF_OCCTIncludePath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_INCLUDE@"
set "CSF_OCCTResourcePath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_RESOURCE@"
set "CSF_OCCTDataPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_DATA@"
set "CSF_OCCTSamplesPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_SAMPLES@"
set "CSF_OCCTTestsPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_TESTS@"
set "CSF_OCCTDocPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_DOC@"
set "CSF_OCCTIncludePath=@INSTALL_DIR@/@INSTALL_DIR_INCLUDE@"
set "CSF_OCCTResourcePath=@INSTALL_DIR@/@INSTALL_DIR_RESOURCE@"
set "CSF_OCCTDataPath=@INSTALL_DIR@/@INSTALL_DIR_DATA@"
set "CSF_OCCTSamplesPath=@INSTALL_DIR@/@INSTALL_DIR_SAMPLES@"
set "CSF_OCCTTestsPath=@INSTALL_DIR@/@INSTALL_DIR_TESTS@"
set "CSF_OCCTDocPath=@INSTALL_DIR@/@INSTALL_DIR_DOC@"
rem for compatability with external application using CASROOT
set "CASROOT=@INSTALL_DIR_ABSOLUTE@"
set "CASROOT=@INSTALL_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@"
@@ -16,17 +13,17 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
export CSF_OCCTBinPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_BIN@"
export CSF_OCCTLibPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_LIB@"
export CSF_OCCTIncludePath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_INCLUDE@"
export CSF_OCCTResourcePath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_RESOURCE@"
export CSF_OCCTDataPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_DATA@"
export CSF_OCCTSamplesPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_SAMPLES@"
export CSF_OCCTTestsPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_TESTS@"
export CSF_OCCTDocPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_DOC@"
export CSF_OCCTBinPath="@INSTALL_DIR@/@INSTALL_DIR_BIN@"
export CSF_OCCTLibPath="@INSTALL_DIR@/@INSTALL_DIR_LIB@"
export CSF_OCCTIncludePath="@INSTALL_DIR@/@INSTALL_DIR_INCLUDE@"
export CSF_OCCTResourcePath="@INSTALL_DIR@/@INSTALL_DIR_RESOURCE@"
export CSF_OCCTDataPath="@INSTALL_DIR@/@INSTALL_DIR_DATA@"
export CSF_OCCTSamplesPath="@INSTALL_DIR@/@INSTALL_DIR_SAMPLES@"
export CSF_OCCTTestsPath="@INSTALL_DIR@/@INSTALL_DIR_TESTS@"
export CSF_OCCTDocPath="@INSTALL_DIR@/@INSTALL_DIR_DOC@"
# for compatability with external application using CASROOT
export CASROOT="@INSTALL_DIR_ABSOLUTE@"
export CASROOT="@INSTALL_DIR@"
fi
fi

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=;"
@@ -136,6 +137,8 @@ set "CSF_PluginDefaults=%CSF_OCCTResourcePath%\StdResource"
set "CSF_XCAFDefaults=%CSF_OCCTResourcePath%\StdResource"
set "CSF_TObjDefaults=%CSF_OCCTResourcePath%\StdResource"
set "CSF_StandardLiteDefaults=%CSF_OCCTResourcePath%\StdResource"
set "CSF_UnitsLexicon=%CSF_OCCTResourcePath%\UnitsAPI\Lexi_Expr.dat"
set "CSF_UnitsDefinition=%CSF_OCCTResourcePath%\UnitsAPI\Units.dat"
set "CSF_IGESDefaults=%CSF_OCCTResourcePath%\XSTEPResource"
set "CSF_STEPDefaults=%CSF_OCCTResourcePath%\XSTEPResource"
set "CSF_XmlOcafResource=%CSF_OCCTResourcePath%\XmlOcafResource"

View File

@@ -58,6 +58,8 @@ set "CSF_PluginDefaults=%CSF_OCCTResourcePath%\StdResource"
set "CSF_XCAFDefaults=%CSF_OCCTResourcePath%\StdResource"
set "CSF_TObjDefaults=%CSF_OCCTResourcePath%\StdResource"
set "CSF_StandardLiteDefaults=%CSF_OCCTResourcePath%\StdResource"
set "CSF_UnitsLexicon=%CSF_OCCTResourcePath%\UnitsAPI\Lexi_Expr.dat"
set "CSF_UnitsDefinition=%CSF_OCCTResourcePath%\UnitsAPI\Units.dat"
set "CSF_IGESDefaults=%CSF_OCCTResourcePath%\XSTEPResource"
set "CSF_STEPDefaults=%CSF_OCCTResourcePath%\XSTEPResource"
set "CSF_XmlOcafResource=%CSF_OCCTResourcePath%\XmlOcafResource"

View File

@@ -4,7 +4,7 @@ if exist "%~dp0custom.bat" (
call "%~dp0custom.bat" %1 %2 %3
)
call "@INSTALL_DIR_ABSOLUTE@\@INSTALL_DIR_SCRIPT@\env.bat" %1 %2 %3
call "@INSTALL_DIR@\@INSTALL_DIR_SCRIPT@\env.bat" %1 %2 %3
set "BIN_DIR=win%ARCH%\%VCVER%\bind"
set "LIB_DIR=win%ARCH%\%VCVER%\libd"

View File

@@ -6,8 +6,8 @@ if [ -e "custom.sh" ]; then
source "custom.sh";
fi
if [ -e "@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_SCRIPT@/env.sh" ]; then
source "@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_SCRIPT@/env.sh";
if [ -e "@INSTALL_DIR@/@INSTALL_DIR_SCRIPT@/env.sh" ]; then
source "@INSTALL_DIR@/@INSTALL_DIR_SCRIPT@/env.sh";
fi
if test "${QTDIR}" == ""; then

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
@@ -209,6 +217,8 @@ export CSF_PluginDefaults="${CASROOT}/src/StdResource"
export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
export CSF_TObjDefaults="${CASROOT}/src/StdResource"
export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat"
export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat"
export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"

View File

@@ -114,6 +114,8 @@ export CSF_PluginDefaults="${CSF_OCCTResourcePath}/StdResource"
export CSF_XCAFDefaults="${CSF_OCCTResourcePath}/StdResource"
export CSF_TObjDefaults="${CSF_OCCTResourcePath}/StdResource"
export CSF_StandardLiteDefaults="${CSF_OCCTResourcePath}/StdResource"
export CSF_UnitsLexicon="${CSF_OCCTResourcePath}/UnitsAPI/Lexi_Expr.dat"
export CSF_UnitsDefinition="${CSF_OCCTResourcePath}/UnitsAPI/Units.dat"
export CSF_IGESDefaults="${CSF_OCCTResourcePath}/XSTEPResource"
export CSF_STEPDefaults="${CSF_OCCTResourcePath}/XSTEPResource"
export CSF_XmlOcafResource="${CSF_OCCTResourcePath}/XmlOcafResource"

View File

@@ -1 +1 @@
@OCCT_HEADER_FILE_CONTENT@
#include "@OCCT_HEADER_FILE@"

View File

@@ -28,8 +28,6 @@ if /I "%VCVER%" == "vc8" (
set "VisualStudioExpressName=WDExpress"
) else if /I "%VCVER%" == "vc14" (
set "DevEnvDir=%VS140COMNTOOLS%..\IDE"
) else if /I "%VCVER%" == "vc14-uwp" (
set "DevEnvDir=%VS140COMNTOOLS%..\IDE"
) else (
echo Error: wrong VS identifier
exit /B

View File

@@ -20,28 +20,23 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>__PROJECT_GUID__</ProjectGuid>
__UWP_PROPERTIES__
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>__VCVEREXT__</PlatformToolset>
<CharacterSet>__VCCHARSET__</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>__VCVEREXT__</PlatformToolset>
<CharacterSet>__VCCHARSET__</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>__VCVEREXT__</PlatformToolset>
<CharacterSet>__VCCHARSET__</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>__VCVEREXT__</PlatformToolset>
<CharacterSet>__VCCHARSET__</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -101,16 +96,14 @@
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL32__
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<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>
@@ -118,7 +111,6 @@
<ProgramDatabaseFile>.\..\..\..\win32\__VCVER__\bin\__TKNAM__.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>..\..\..\win32\__VCVER__\lib\__TKNAM__.lib</ImportLibrary>
__UWP_GENERATE_METADATA__
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -149,16 +141,14 @@
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL32__
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<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>
@@ -166,7 +156,6 @@
<ProgramDatabaseFile>..\..\..\win32\__VCVER__\bind\__TKNAM__.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>..\..\..\win32\__VCVER__\libd\__TKNAM__.lib</ImportLibrary>
__UWP_GENERATE_METADATA__
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -196,16 +185,14 @@
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL64__
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<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>
@@ -213,7 +200,6 @@
<ProgramDatabaseFile>.\..\..\..\win64\__VCVER__\bin\__TKNAM__.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>..\..\..\win64\__VCVER__\lib\__TKNAM__.lib</ImportLibrary>
__UWP_GENERATE_METADATA__
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -244,16 +230,14 @@
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL64__
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<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>
@@ -261,7 +245,6 @@
<ProgramDatabaseFile>..\..\..\win64\__VCVER__\bind\__TKNAM__.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>..\..\..\win64\__VCVER__\libd\__TKNAM__.lib</ImportLibrary>
__UWP_GENERATE_METADATA__
</Link>
</ItemDefinitionGroup>
<ItemGroup>

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

@@ -2,7 +2,6 @@
BRepExtrema_OverlappedSubShapes BRepExtrema_MapOfIntegerPackedMapOfInteger
ShapeConstruct_CompBezierCurves2dToBSplineCurve2d Convert_CompBezierCurves2dToBSplineCurve2d
ShapeConstruct_CompBezierCurves2dToBSplineCurve Convert_CompBezierCurves2dToBSplineCurve
Image_PixMap::Img Image_Format_
[tcollection]
AdvApp2Var_SequenceOfNode

BIN
data/images/Image.xwd Executable file

Binary file not shown.

BIN
data/images/hlr.xwd Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -35,7 +35,7 @@ endif()
# configuration file for doxygen
set (OCCT_CONFIG_FOR_DOXYGEN "${OCCT_GENERATED_DOC_DIR}/occt.cfg")
set (3RDPARTY_MATHJAX_RELATIVE_PATH "https://cdn.mathjax.org/mathjax/latest")
set (3RDPARTY_MATHJAX_RELATIVE_PATH "http://cdn.mathjax.org/mathjax/latest")
configure_file ("${OCCT_OVERVIEW_RESOURCE_DIR}/occt_ug_html.doxyfile" "${OCCT_CONFIG_FOR_DOXYGEN}" COPYONLY)
@@ -92,22 +92,11 @@ file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nMATHJAX_RELPATH = ${3RDPARTY_M
# Copy index file to provide fast access to HTML documentation
file(COPY "${OCCT_OVERVIEW_RESOURCE_DIR}/index.html" DESTINATION "${OCCT_GENERATED_OVERVIEW_DIR}")
# get relative paths to documentation source files
file (GLOB_RECURSE OCCT_OVERVIEW_FILES "${OCCT_OVERVIEW_DIR}/*")
add_custom_target (${PROJECT_NAME}
COMMAND ${3RDPARTY_DOXYGEN_EXECUTABLE} ${OCCT_CONFIG_FOR_DOXYGEN}
WORKING_DIRECTORY ${OCCT_GENERATED_DOC_DIR}
COMMENT "Generating OCCT overview documentation with Doxygen"
SOURCES ${OCCT_ARTICLES_ABSPATH}
VERBATIM)
add_custom_command(OUTPUT "${OCCT_GENERATED_DOC_DIR}/overview/html/occt_logo.png"
COMMAND ${3RDPARTY_DOXYGEN_EXECUTABLE} ${OCCT_CONFIG_FOR_DOXYGEN}
DEPENDS ${OCCT_OVERVIEW_FILES}
WORKING_DIRECTORY ${OCCT_GENERATED_DOC_DIR}
COMMENT "Generating OCCT overview documentation with Doxygen"
VERBATIM
)
add_custom_target(${PROJECT_NAME} ALL
DEPENDS "${OCCT_GENERATED_DOC_DIR}/overview/html/occt_logo.png" ${OCCT_OVERVIEW_FILES}
SOURCES ${OCCT_ARTICLES_ABSPATH}
VERBATIM
)
# Create Documentation folder in solution view
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Documentation")

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

@@ -5,26 +5,26 @@ Building with CMake {#occt_dev_guides__building_cmake}
@section build_cmake_intro General
This article describes the **CMake**-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources. *OCCT requires CMake version 2.8.12 or later*.
This article describes the **CMake**-based build process which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources. *OCCT requires CMake version 2.8.12 or later*.
@note Compared to the previous (6.x) releases of Open CASCADE Technology, OCCT 7.x has a complete set of CMake scripts and projects, so that there is no need to use WOK anymore. Moreover, CMake gives you a powerful configuration tool, which allows to control many aspects of OCCT deployment. At the same time this tool is quite intuitive, which is a significant advantage over the legacy WOK utilities.
@note Comparing to the previous (6.x) releases of Open CASCADE Technology, OCCT 7.0 comes with a complete set of CMake scripts and projects, so that there is no need to use WOK anymore. Moreover, CMake gives you a powerful configuration tool which allows to control many aspects of OCCT deployment. At the same time this tool is quite intuitive which is a significant advantage over the legacy WOK utilities.
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
Here we describe the build procedure on example of Windows platform with Visual Studio 2010.
However, CMake is cross-platform and can be used to build OCCT on Linux and OS X in essentially the same way.
@note Before you start, make sure to have installed all 3-rd party products that you are going to use with OCCT; see @ref occt_dev_guides__building.
@note Before you start, make sure to have installed all the 3-rd party products that you are going to use with OCCT; see @ref occt_dev_guides__building.
@section build_cmake_start Start CMake
CMake is a tool that generates the actual project files for the selected target build system (e.g. Unix makefiles) or IDE (e.g. Visual Studio 2010).
For unexperienced users we recommend to start with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* can also be used.
For unexpericnced users we recommend to start with *cmake-gui* -- cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* also can be used.
CMake deals with three directories: source, build or binary and installation.
CMake deals with three directories: source, build or binary and install.
* The source directory is where the sources of OCCT are located in your file system;
* The build or binary directory is where all files created during CMake configuration and generation process will be located. The mentioned process will be described below.
* The source directory is where the sources of OCCT are located in your filesystem
* The build or binary directory is where all the files created during CMake configuration and generation process will be located. The mentioned process will be described below.
* The installation directory is where binaries will be installed after building the *INSTALL* project that is created by CMake generation process, along with header files and resources required for OCCT use in applications.
The good practice is not to use the source directory as a build one.
@@ -48,9 +48,9 @@ If the command-line tool is used, run the tool from the build directory with a s
Press *c* to configure.
All actions required in the configuration process with the GUI tool will be described below.
All required actions in the configuration process will be described with using the GUI tool below.
If the GUI tool is used, run this tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**.
If the gui-tool is used, run the tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**.
@figure{/dev_guides/building/cmake/images/cmake_image001.png}
@@ -60,31 +60,29 @@ 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>.
To build OCCT with using Universal Windows Platform (UWP) specify 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 .
**Note**: Universal Windows Platform (UWP) is supported only on "Visual Studio 14 2015". File <i>d:/occt/samples/xaml/ReadMe.md</i> desribes building procedure of XAML (UWP) sample.
**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.
Once "Finish" button is pressed, the first pass of the configuration process is executed. At the end of the process, CMake outputs the list of environment variables, which have to be properly specified for successful configuration.
Once "Finish" button is pressed, the first pass of the configuration process is executed. At the end of the process, CMake outputs the list of environment variables which have to be properly specified for successful configuration.
@figure{/dev_guides/building/cmake/images/cmake_image003.png}
The error message provides some information about these variables. This message will appear after each pass of the process until all required variables are specified correctly.
The error message provides an information about these variables. This message will appear after each pass of the process until all required variables are specified correctly.
The change of the state of some variables can lead to the appearance of new variables. The new variables appeared after the pass of the configuration process are highlighted with red color by CMake GUI tool.
The change of the state of some variables can lead to the appearance of new variables. The new variables appeared after the pass of the configuration process is notified with red color by CMake GUI tool.
Note: There is "grouped" option, which groups variables with a common prefix.
Note: There is "grouped" option which groups variables with a common prefix.
The following table gives the full list of environment variables used at the configuration stage:
The following table enumerates the full list of environment variables used at configuration stage:
| Variable | Type | Purpose |
|----------|------|---------|
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREEIMAGE | Boolean flag | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
| USE_GL2PS | Boolean flag | Indicates whether GL2PS product should be used in OCCT visualization module for support of vector image formats (PS, EPS, etc.) |
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (sush as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREEIMAGE | Boolean flag | Indicates whether Freeimage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP etc) |
| USE_GL2PS | Boolean flag | Indicates whether GL2PS product should be used in OCCT visualization module for support of vector image formats (PS, EPS etc) |
| USE_TBB | Boolean flag | Indicates whether TBB 3rd party is used or not. TBB stands for Threading Building Blocks, the technology of Intel Corp, which comes with different mechanisms and patterns for injecting parallelism into your application. OCCT remains parallel even without TBB product |
| USE_VTK | Boolean flag | Indicates whether VTK 3rd party is used or not. VTK stands for Visualization ToolKit, the technology of Kitware Inc intended for general-purpose scientific visualization. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
| USE_VTK | Boolean flag | Indicates whether VTK 3rd party is used or not. VTK stands for Visualization ToolKit, the technology of Kitware Inc intended for general-purpose scientific visualization. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. The official documentation @ref occt_user_guides__vis for the details on VIS |
| 3RDPARTY_DIR | Path | Defines the root directory where all required 3rd party products will be searched. Once you define this path it is very convenient to click "Configure" button in order to let CMake automatically detect all necessary products|
| 3RDPARTY_FREETYPE_* | Path | Path to Freetype binaries |
| 3RDPARTY_TCL_* 3RDPARTY_TK_* | Path | Path to Tcl/Tk binaries |
@@ -93,22 +91,20 @@ The following table gives the full list of environment variables used at the con
| 3RDPARTY_TBB* | Path | Path to TBB binaries |
| 3RDPARTY_VTK_* | Path | Path to VTK binaries |
| BUILD_MODULE_<MODULE>| Boolean flag | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in @ref user_guides |
| BUILD_LIBRARY_TYPE | String | Specifies the type of library to be created. "Shared" libraries are linked dynamically and loaded at runtime. "Static" libraries are archives of object files used when linking other targets |
| BUILD_LIBRARY_TYPE | String | Specifies the type of library to be created. "Shared" libraries are linked dynamically and loaded at runtime. "Static" libraries are archives of object files for use when linking other targets |
| BUILD_ADDITIONAL_TOOLKITS | String | Semicolon-separated individual toolkits to include into build process. If you want to build some particular libraries (toolkits) only, then you may uncheck all modules in the corresponding *BUILD_MODUE_\<MODULE\>* options and provide the list of necessary libraries here. Of course, all dependencies will be resolved automatically |
| BUILD_YACCLEX | Boolean flag | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this option leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_YACCLEX | Boolean flag | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this options leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_MODULE_MfcSamples | Boolean flag | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
| 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_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 options leads to automatic search of Doxygen binaries. Building of it will be call 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. |
| 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 |
| 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 | Path | Points to the installation directory. INSTALL_DIR is synonym of CMAKE_INSTALL_PREFIX . 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}) |
| INSTALL_DIR_SCRIPT | Path | Relative path to the scripts installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}) |
| INSTALL_DIR_LIB | Path | Relative path to the libraries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_LIB}) |
| INSTALL_DIR_INCLUDE | Path | Relative path to the includes installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}) |
| INSTALL_DIR_RESOURCE | Path | Relative path to the resources installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}) |
| INSTALL_DIR_LAYOUT | String | Defines the structure of OCCT files (binaries, resources, headers, etc.) for the install directory. Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout). If needed, the layout can be customized with INSTALL_DIR_* variables |
| INSTALL_DIR_DATA | Path | Relative path to the data files installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DATA}) |
| INSTALL_DIR_SAMPLES | Path | Relative path to the samples installation directory. Note that only "samples/tcl" folder will be installed. (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}) |
| INSTALL_DIR_TESTS | Path | Relative path to the tests installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_TESTS}) |
@@ -122,7 +118,7 @@ The following table gives the full list of environment variables used at the con
| INSTALL_TEST_CASES | Boolean flag | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
| INSTALL_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation should be installed into the installation directory |
**Note:** Only the forward slashes ("/") are acceptable in the CMake options defining paths.
**Note:** In those CMake options defining paths only the forward slashes ("/") are acceptable.
@section build_cmake_3rdparty 3rd party search mechanism
@@ -130,7 +126,7 @@ If *3RDPARTY_DIR* directory is defined, then required 3rd party binaries are sou
The procedure expects to find binary and header files of each 3rd party product in its own sub-directory: *bin*, *lib* and *include*.
The results of the search (achieved on the next pass of the configuration process) are recorded in the corresponding variables:
The results of the search (achived on the next pass of the configuration process) are recorded in the corresponding variables:
* *3RDPARTY_\<PRODUCT\>_DIR* -- path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>)
* *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR* -- path to the directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>).

View File

@@ -248,8 +248,7 @@ Use of tabulation characters for indentation is disallowed.
Punctuation rules follow the rules of the English language.
* C/C++ reserved words, commas, colons and semicolons should be followed by a space character if they are not at the end of a line.
* There should be no space characters after '(' and before ')'. Closing and opening brackets should be separated by a space character.
* For better readability it is also recommended to surround conventional operators by a space character.
Examples:
* For better readability it is also recommended to surround conventional operators by a space character. See the following examples:
~~~~~{.cpp}
while (true) // NOT: while( true ) ...
@@ -262,30 +261,6 @@ for (anIter = 0; anIter < 10; ++anIter) // NOT: for (anIter=0;anIter<10;++anIter
}
~~~~~
### Declaration of pointers and references
In declarations of simple pointers and references put asterisk (*) or ampersand (&) right after the type without extra space.
Since declaration of several variables with mixed pointer types contrudicts this rule, it should be avoided. Instead, declare each variable independently with fully qualified type.
Examples:
~~~~~{.cpp}
Standard_Integer *theVariable; // not recommended
Standard_Integer * theVariable; // not recommended
Standard_Integer* theVariable; // this is OK
Standard_Integer *&theVariable; // not recommended
Standard_Integer *& theVariable; // not recommended
Standard_Integer*& theVariable; // this is OK
Standard_Integer **theVariable; // not recommended
Standard_Integer ** theVariable; // not recommended
Standard_Integer** theVariable; // this is OK
Standard_Integer *theA, theB, **theC; // not recommended (declare each variable independently)
~~~~~
### Separate logical blocks
Separate logical blocks of code with one blank line and comments.
@@ -370,25 +345,6 @@ if (!theAlgo.IsNull()) // preferred
Having all code in the same line is less convenient for debugging.
### Comparison expressions with constants
In comparisons, put the variable (in the current context) on the left side and constant on the right side of expression.
That is, the so called "Yoda style" is to be avoided.
~~~~~{.cpp}
if (NULL != thePointer) // Yoda style, not recommended
if (thePointer != NULL) // OK
if (34 < anIter) // Yoda style, not recommended
if (anIter > 34) // OK
if (theNbValues >= anIter) // bad style (constant function argument vs. local variable)
if (anIter <= theNbValues) // OK
if (THE_LIMIT == theValue) // bad style (global constant vs. variable)
if (theValue == THE_LIMIT) // OK
~~~~~
### Alignment
Use alignment wherever it enhances the readability. See the following example:

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
@@ -1307,7 +1294,6 @@ Allowed options are:
* <i>-s AREA</i> -- command *sprops*, computes the mass properties of all faces with a surface density of 1;
* <i>-v VOLUME</i> -- command *vprops*, computes the mass properties of all solids with a density of 1;
* <i>-eps EPSILON</i> -- the epsilon defines relative precision of computation;
* <i>-deps DEPSILON</i> -- the epsilon defines relative precision to compare corresponding values;
* <i>-equal SHAPE</i> -- compares area, volume and length of input shapes. Puts error if they are not equal;
* <i>-notequal SHAPE</i> -- compares area, volume and length of input shapes. Puts error if they are equal.

View File

@@ -58,7 +58,7 @@ for (Standard_Integer aGr = 1; aGr <= aLen; ++aGr)
Porting of user applications from an earlier OCCT version to version 6.5.2 requires taking into account the following major changes:
* Any code that has been generated by WOK from CDL generic classes *Tcollection_DataMap* and *Tcollection_IndexedDataMap* needs to be regenerated by WOK to take into account the change in the interface of these classes.
* The enumerations *CDF_StoreStatus* and *CDF_RetrievableStatus* have been replaced by the enumerations *PCDM_StoreStatus* and *PCDM_ReaderStatus*. Correspondingly, the methods *Open, Save* and *SaveAs* of the class *TDocStd_Application* have changed their return value. Any code, which uses these enumerations, needs to be updated.
* *BRepLib_MakeFace* has been modified to receive tolerance value for resolution of degenerated edges. This tolerance parameter has no default value to ensure that the client code takes care of passing a meaningful value, not just *Precision::Confusion*, so some porting overheads are expected.
* *BRepLib_MakeFace* has been modified to accept tolerance value for resolution of degenerated edges. This tolerance parameter has no default value to ensure that the client code takes care of passing a meaningful value, not just *Precision::Confusion*, so some porting overheads are expected.
* If the callback mechanism in call_togl_redraw function was used in the application code, it is necessary to revise it to take into account the new callback execution and provide a check of reason value of Aspect_GraphicCallbackStruct in callback methods to confirm that the callback code is executed at the right moment. Now the callbacks are executed before redrawing the underlayer, before redrawing the overlayer and at the end of redrawing. The information about the moment when the callback is invoked is provided with the reason value in form of an additional bit flag <i>(OCC_PRE_REDRAW, OCC_PRE_OVERLAY)</i>. The state of OpenGl changed in callback methods will not be restored automatically, which might lead to unwanted behavior in redrawing procedure.
* The print method used in the application code might need to be revised to take into account the ability to choose between print algorithms: tile and stretch. The stretch algorithm will be selected by default during porting.
* It is recommended to *BRepMesh_DiscretFactory* users, to check *BRepMesh_DiscretFactory::SetDefault()* return value to determine plugin availability / validity. *BRepMesh_DiscretFactory::Discret()* method now returns handle instead of pointer. The code should be updated in the following manner:
@@ -82,7 +82,7 @@ Porting of user applications from an earlier OCCT version to version 6.5.3 requi
* Method *HashCode()* has been removed from class *Standard_Transient*. It is advisable to use global function <i>HashCode()</i> for Handle objects instead.
* Declaration of operators new/delete for classes has become consistent and is encapsulated in macros.
* Memory management has been changed to use standard heap <i>(MMGT_OPT=0)</i> and reentrant mode <i>(MMGT_REENTRANT=1)</i> by default.
* Map classes in *NCollection* package now receive one more argument defining a hash tool.
* Map classes in *NCollection* package now accept one more argument defining a hash tool.
@section upgrade_654 Upgrade to OCCT 6.5.4
@@ -251,7 +251,6 @@ Porting of user applications from an earlier OCCT version to version 6.9.0 requi
3D Viewer now uses GLSL programs for managing frame buffer and stereoscopic output.
For proper initialization, application should configure **CSF_ShadersDirectory** environment variable pointing to a folder with GLSL resources - files from folder **CASROOT**/src/Shaders.
*Note that **CSF_ShadersDirectory** become optional since OCCT 7.1.0 release*.
@subsection upgrade_690_selection Changes in Selection
@@ -508,7 +507,7 @@ This will eliminate the need to include the header *A* in each source file where
#### Ambiguity of calls to overloaded functions
This issue appears in the compilers that do not support default arguments in template functions (known cases are Visual C++ 10 and 11): the compiler reports an ambiguity error if a handle is used in the argument of a call to the function that has two or more overloaded versions, receiving handles to different types.
This issue appears in the compilers that do not support default arguments in template functions (known cases are Visual C++ 10 and 11): the compiler reports an ambiguity error if a handle is used in the argument of a call to the function that has two or more overloaded versions, accepting handles to different types.
The problem is that operator <i> const handle<T2>& </i> is defined for any type *T2*, thus the compiler cannot make the right choice.
Example:
@@ -887,7 +886,7 @@ void UserDrawObject::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrs
aGroup->AddElement(anElem);
// invalidate bounding box of the scene
thePrsMgr->StructureManager()->Update();
thePrsMgr->StructureManager()->Update (thePrsMgr->StructureManager()->UpdateMode());
}
~~~~~
@@ -950,11 +949,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,33 +982,34 @@ 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_occt710_correction_of_Parab2d Correction in *gp_Parab2d, gce_MakeParab2d* and *GCE2d_MakeParabola* classes:
1. Constructors *GCE2d_MakeParabola(const gp_Ax22d& D, const gp_Pnt2d& F)*, *gce_MakeParab2d(const gp_Ax22d& D, const gp_Pnt2d& F)* and *gp_Parab2d(const gp_Ax22d& D, const gp_Pnt2d& F)* have been deleted.
2. Objects created with some constructors of *gp_Parab2d* class may differ from the previous version. Please see the updated documentation for *gp_Parab2d* class (file *gp_Parab2d.hxx*).
3. Result returned by gp_Parab2d::Directrix() method has another direction in compare with previous OCCT-version.
@subsection upgrade_710_aspects Presentation attributes
This section should be considered if application defines custom presentations, i.e. inherited from *AIS_InteractiveObject*.
The previous versions of OCCT have three levels for defining presentation properties (e.g. colors, materials, etc.):
This section should be considered if application defines custom presentations (inherited from AIS_InteractiveObject).
Previous versions of OCCT have three levels for defining presentation properties (e.g. colors, materials):
1. For the entire structure - *Graphic3d_Structure* / *Prs3d_Presentation*.
2. For a specific group of primitives - *Graphic3d_Group::SetGroupPrimitivesAspect()* overriding structure aspects.
3. For a specific primitive array within the graphic group - *Graphic3d_Group::SetPrimitivesAspect()*.
1. For entire structure (Graphic3d_Structure / Prs3d_Presentation).
2. For specific group of primitives (Graphic3d_Group::SetGroupPrimitivesAspect()) overriding structure aspects.
3. For specific primitive array within graphic group (Graphic3d_Group::SetPrimitivesAspect()).
The structure level has de facto not been used for a long time since OCCT presentations always define aspects at the graphic group level (overriding any structure aspects).
Within this OCCT release, structure level of aspects has been completely removed. In most cases the application code should just remove missing methods. In those rare cases, when this functionality was intentionally used, the application should explicitly define aspects to the appropriate graphic groups.
The first one is de facto not used for a long time since OCCT presentations always define aspects at graphic group level (overriding any structure aspects).
Within this OCCT release, this first level of aspects has been completely removed. In most cases application code should just remove missing methods; in rare cases where this functionality was intentionally used - application should explicitly define aspects to appropriate graphic groups.
Note that defining several different aspects within the same graphic group should also be avoided in the application code since it is a deprecated functionality which can be removed in further releases.
*Graphic3d_Group::SetGroupPrimitivesAspect()* should be the main method defining presentation attributes.
Note that the 3rd level (defining several different aspects within the same graphic group) is also should be avoided in application code since it is deprecated functionality which can be removed in further releases.
Graphic3d_Group::SetGroupPrimitivesAspect() should be the main method defining presentation attributes.
The implementation of *Graphic3d_Group::SetGroupPrimitivesAspect()* has been changed from copying aspect values to keeping the passed object.
Although it was not documented, previously it was possible to modify a single aspect instance, like *Graphic3d_AspectFillArea3d* and set it to multiple groups.
Now such code would produce an unexpected result and therefore should be updated to create the dedicated aspect instance.
The implementation of Graphic3d_Group::SetGroupPrimitivesAspect() has been changed from copying aspect values to keeping passed object.
Although it was not documented, previosly it was possible to modify single aspects instance (like Graphic3d_AspectFillArea3d) and set it to multiple groups.
Now such code would produce unexpected result and therefore should be updated to create dedicated aspect instance.
@subsection upgrade_710_types Typedefs
@@ -1025,206 +1020,64 @@ The following type definitions in OCCT has been modified to use C++11 types:
- *Standard_Utf16Char* is now *char16_t* (previously *uint16_t* for compatibility with old compilers).
- *Standard_Utf32Char* is now *char32_t* (previously *uint32_t* for compatibility with old compilers).
For most applications this change should be transparent on the level of source code. Binary compatibility is not maintained, as *bool* has a different size in comparison with *unsigned int*.
For most applications this change should be transparent, since the size of types have not been changed.
@subsection upgrade_710_ffp Programmable Pipeline
Fixed-function pipeline has been already deprecated since OCCT 7.0.0.
Release 7.1.0 disables this functionality by default in favor of Programmable Pipeline (based on GLSL programs).
Method *V3d_View::Export()*, based on *gl2ps* library, requires fixed pipeline and will return error if used with default settings.
Applications should explicitly enable fixed pipeline by setting *OpenGl_Caps::ffpEnable* flag to TRUE within *OpenGl_GraphicDriver::ChangeOptions()* before creating the viewer to use *V3d_View::Export()*.
This method is declared as deprecated and will be removed in one of the the next OCCT releases.
The recommended way to generate a vector image of a 3D model or scene is to use an application-level solution independent from OpenGL.
This also means that method *V3d_View::Export()* based on gl2ps library and requiring disabled by default functionality has been deprecated as well.
Applications should explicitly enable deprecated functionality by setting OpenGl_Caps::ffpEnable flag to TRUE within OpenGl_GraphicDriver::ChangeOptions() before creating the viewer to use V3d_View::Export(),
but being aware that this functionality is likely to be removed in a next OCCT release.
Thus the recommended way to generate vector image of a 3D model or scene is to use application-level solution independent from OpenGL.
@subsection upgrade_710_trsfpers Transformation persistence
The behavior of transformation persistence flags *Graphic3d_TMF_ZoomPers* and *Graphic3d_TMF_TriedronPers* has been changed for consistency with a textured fixed-size 2D text.
An object with these flags is considered as defined in pixel units, and the presentation is no more scaled depending on the view height.
The applications that need to scale such objects depending on viewport size should update them manually.
The behavior of transformation persistence flags *Graphic3d_TMF_ZoomPers* and *Graphic3d_TMF_TriedronPers* have been changed to be consistent with textured fixed-size 2D text.
Object with these flags is considered to be defined in pixel units, and presentation is no more scaled depending on view height.
Applications that need to scale such objects depending on viewport size should update them manually.
Flags *Graphic3d_TMF_PanPers* and *Graphic3d_TMF_FullPers* have been removed.
*Graphic3d_TMF_TriedronPers* or *Graphic3d_TMF_2d* can be used instead depending on the context.
Flags *Graphic3d_TMF_PanPers* and *Graphic3d_TMF_FullPers* has been removed.
*Graphic3d_TMF_TriedronPers* or *Graphic3d_TMF_2d* can be used instead depending on context.
*Graphic3d_TransModeFlags* is not an integer bitmask anymore - enumeration values should be specified instead.
Several transformation persistence methods in *PrsMgr_PresentableObject* have been marked deprecated.
Transformation persistence should be defined using *Graphic3d_TransformPers* constructor directly and passed by a handle, not value.
Several transformation persistence methods in PrsMgr_PresentableObject have been marked deprecated.
Transformation persistence should be defined using directly Graphic3d_TransformPers constructor and passed by a handle, not value.
@subsection upgrade_710_selprops Dynamic highlight and selection properties
@subsection_upgrade_710_selprops Dynamic highlight and selection properties
Release 7.1.0 introduces *Graphic3d_HighlightStyle* - an entity that allows flexible customization of highlighting parameters (such as highlighting method, color, and transparency). Therefore, the signatures of the following methods related to highlighting:
- *AIS_InteractiveContext::Hilight()*;
- *AIS_InteractiveContext::HilightWithColor()*;
- *PrsMgr_PresentationManager::Color()*;
- *SelectMgr_EntityOwner::HilightWithColor()*;
have been changed to receive *Graphic3d_HighlightStyle* instead of *Quantity_Color*.
Release 7.1.0 introduces *Graphic3d_HighlightStyle* - an entity that allows flexible customization of highlighting parameters (such as method, highlight color and transparency). Therefore, API of methods related to highlighting in the following core classes:
- *AIS_InteractiveContext* (methods HilightWithColor(), Hilight());
- *PrsMgr_PresentationManager* (method Color());
- *SelectMgr_EntityOwner* (method HilightWithColor())
was changed to process Graphic3d_HighlightStyle instead of Quantity_Color.
Method *AIS_InteractiveContext::Hilight* is now deprecated and highlights the interactive object with selection style.
Method AIS_InteractiveContext::Hilight is now deprecated and highlights interactive object with selection style.
A group of methods *AIS_InteractiveContext::IsHilighted* has changed its behavior - now they only check highlight flags of the object or the owner in the global status. If the highlight color is required on the application level, it is necessary to use overloaded methods *AIS_InteractiveContext::HighlightStyle* for the owner and the object.
Group of methods AIS_InteractiveContext::IsHilighted changed behavior - now they only check object's or owner's highlight flags in global status. If highlight color is required on application level, overloaded methods AIS_InteractiveContext::HighlightStyle for owner and object must be used instead.
The following methods have been replaced in *AIS_InteractiveContext* class:
- *HilightColor* and *SetHilightColor* by *HighlightStyle* and *SetHighlightStyle*;
- *SelectionColor* setter and getter by *SelectionStyle* and *SetSelectionStyle*.
The following methods were replaced in AIS_InteractiveContext API:
- *HilightColor*, *SetHilightColor* were replaced by *HighlightStyle*, *ChangeHighlightStyle*;
- *SelectionColor* setter and getter were replaced by *SelectionStyle*, *ChangeSelectionStyle*.
The API of *Prs3d_Drawer* has been extended to allow setting up styles for both dynamic selection and highlighting. Therefore, it is possible to change the highlight style of a particular object on the application level via *SelectMgr_SelectableObject::HilightAttributes()* and process it in the entity owner.
@subsection upgrade_occt710_correction_of_TObj_Model Correction in TObj_Model class
Methods *TObj_Model::SaveAs* and *TObj_Model::Load* now receive *TCollection_ExtendedString* filename arguments instead of char*. UTF-16 encoding can be used to pass file names containing Unicode symbols.
@subsection upgrade_710_env Redundant environment variables
The following environment variables have become redundant:
* *CSF_UnitsLexicon* and *CSF_UnitsDefinition* are no more used. Units definition (*UnitsAPI/Lexi_Expr.dat* and *UnitsAPI/Units.dat*) is now embedded into source code.
* *CSF_XSMessage* and *CSF_XHMessage* are now optional.
English messages (XSMessage/*XSTEP.us* and SHMessage/*SHAPE.us*) are now embedded into source code
and automatically loaded when environment variables are not set.
* *CSF_ShadersDirectory* is not required any more, though it still can be used to load custom shaders.
Mandatory GLSL resources are now embedded into source code.
* *CSF_PluginDefaults* and other variables pointing to OCAF plugin resources (*CSF_StandardDefaults*, *CSF_XCAFDefaults*, *CSF_StandardLiteDefaults* and *CSF_XmlOcafResource*) are not necessary if method *TDocStd_Application::DefineFormat()* is used to enable persistence of OCAF documents.
Other environment variables still can be used to customize behavior of relevant algorithms but are not necessary any more (all required resources are embedded).
API of Prs3d_Drawer was extended to allow setting up styles for both dynamic selection and highlighting. Therefore, on application level changing highlight style for particular object must be implemented via SelectMgr_SelectableObject::HilightAttributes() and processed in entity owner.
@subsection upgrade_710_removed Removed features
The following obsolete features have been removed:
* Anti-aliasing API *V3d_View::SetAntialiasingOn()*. This method was intended to activate deprecated OpenGL functionality *GL_POLYGON_SMOOTH, GL_LINE_SMOOTH* and *GL_POINT_SMOOTH*.
Instead of the old API, the application should request MSAA buffers for anti-aliasing by assigning *Graphic3d_RenderingParams::NbMsaaSamples* property of the structure returned by *V3d_View::ChangeRenderingParams()*.
* *Prs3d_Drawer::ShadingAspectGlobal()* flag has been removed as not used. The corresponding calls can be removed safely from the application code.
* The methods managing ZClipping planes and ZCueing: *V3d_View::SetZClippingType()*, *V3d_View::SetZCueingOn()*, etc. have been removed. ZClipping planes can be replaced by general-purpose clipping planes (the application should update plane definition manually).
* The 3D viewer printing API *V3d_View::Print()* has been removed. This functionality was available on Windows platforms only. The applications should use the general image dump API *V3d_View::ToPixMap()* and manage printing using a platform-specific API at the application level.
* Obsolete Antialiasing API *V3d_View::SetAntialiasingOn()*. This method was intended to activate deprecated OpenGL functionality (GL_POLYGON_SMOOTH, GL_LINE_SMOOTH, GL_POINT_SMOOTH).
Instead of old API, application should request MSAA buffers for antialiasing by assigning *Graphic3d_RenderingParams::NbMsaaSamples* property of structure returned by *V3d_View::ChangeRenderingParams()*.
* *Prs3d_Drawer::ShadingAspectGlobal()* flag has been removed as not used. Corresponding calls can be removed safely from the application code.
* ZClipping planes and ZCueing (methods *V3d_View::SetZClippingType()*, *::SetZCueingOn()* and V3d_View::others).
ZClipping planes can be replaced by general-purpose clipping planes (application should update plane definion manually).
* 3D viewer printing API *V3d_View::Print()* has been removed. This functionality was available on Windows platforms only.
Applications should use general image dump API *V3d_View::ToPixMap()* and manage printing using platform-specific API at application level.
Text resolution can be managed by rendering parameter *Graphic3d_RenderingParams::Resolution*, returned by *V3d_View::ChangeRenderingParams()*.
* Methods *PrsMgr_PresentationManager::BoundBox*, *PrsMgr_PresentationManager::Hilight* and *SelectMgr_EntityOwner::Hilight* have been removed as not used. The corresponding method in custom implementations of *SelectMgr_EntityOwner* can be removed safely. *PrsMgr_PresentationManager::Color* with the corresponding style must be used instead.
* Class *NCollection_QuickSort* has been removed. The code that used the tools provided by that class should be corrected manually. The recommended approach is to use sorting algorithms provided by STL (std::sort). See also @ref upgrade_occt700_sorttools above.
* Methods PrsMgr_PresentationManager::BoundBox, PrsMgr_PresentationManager::Hilight and SelectMgr_EntityOwner::Hilight were removed as not used.
Corresponding method in custom implementations of SelectMgr_EntityOwner can be removed safely. PrsMgr_PresentationManager::Color with corresponding style must be used instead of removed presentation manager's methods.
* Package *Dico*. The code that used the tools provided by that package should be corrected manually. The recommended approach is to use *NCollection_DataMap* and *NCollection_IndexedDataMap* classes.
@subsection upgrade_occt710_correction_of_TObj_Model Correction in TObj_Model class
@subsection upgrade_710_changed_methods Other changes
The following classes have been changed:
* *BVH_Sorter* class has become abstract. The list of arguments of both *Perform* methods has been changed and the methods became pure virtual.
* *Extrema_FuncExtPS* has been renamed to *Extrema_FuncPSNorm*.
* The default constructor and the constructor taking a point and a surface have been removed from class *Extrema_GenLocateExtPS*. Now the only constructor takes the surface and optional tolerances in U and V directions. The new method *Perform* takes the point with the start solution and processes it. The class has become not assignable and not copy-constructable.
* Constructors with arguments *(const gp_Ax22d& D, const gp_Pnt2d& F)* have been removed from *GCE2d_MakeParabola*, *gce_MakeParab2d* and *gp_Parab2d*. The objects created with some constructors of class *gp_Parab2d* may differ from the previous version (see the comments in *gp_Parab2d.hxx*). The result returned by *gp_Parab2d::Directrix()* method has an opposite direction in comparison with the previous OCCT versions.
* *BRepTools_Modifier* class now has two modes of work. They are defined by the boolean parameter *MutableInput*, which is turned off by default. This means that the algorithm always makes a copy of a sub-shape (e.g. vertex) if its tolerance is to be increased in the output shape. The old mode corresponds to *MutableInput* turned on. This change may impact an application if it implements a class derived from *BRepTools_Modifier*.
* The second parameter *theIsOuterWire* of method *ShapeAnalysis_Wire::CheckSmallArea* has been removed.
* In class *GeomPlate_CurveConstraint*, two constructors taking boundary curves of different types have been replaced with one constructor taking the curve of an abstract type.
* 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.
In addition, the API for immediate viewer update has been removed from V3d_View and Graphic3d_StructureManager classes
(enumerations *Aspect_TypeOfUpdate* and *V3d_TypeOfUpdate*):
V3d::SetUpdateMode(), V3d::UpdateMode(), Graphic3d_StructureManager::SetUpdateMode(), Graphic3d_StructureManager::UpdateMode().
The argument theUpdateMode has been removed from methods Graphic3d_CView::Display(), Erase(), Update().
Method Graphic3d_CView::Update() does not redraw the view and does not re-compute structures anymore.
The following Grid management methods within class V3d_Viewer do not implicitly redraw the viewer:
ActivateGrid, DeactivateGrid, SetRectangularGridValues, SetCircularGridValues,
RectangularGridGraphicValues, CircularGridGraphicValues, SetPrivilegedPlane, DisplayPrivilegedPlane.
@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).
* Enumeration *Image_PixMap::ImgFormat*, previously declared as nested enumeration within class *Image_PixMap*, has been moved to global namespace as *Image_Format* following OCCT coding rules.
The enumeration values have suffix Image_Format_ and preserve previous name scheme for easy renaming of old values - e.g. Image_PixMap::ImgGray become Image_Format_Gray.
Old definitions are preserved as depreacated aliases to the new ones.
@subsection upgrade_720_BOP_DataStructure BOP - Pairs of interfering indices
* The classes *BOPDS_PassKey* and *BOPDS_PassKeyBoolean* are too excessive and not used any more in Boolean Operations. To replace them the new *BOPDS_Pair* class has been implemented. Thus:
- The method *BOPDS_DS::Interferences()* now returns the *BOPDS_MapOfPair*;
- The method *BOPDS_Iterator::Value()* takes now only two parameters - the indices of interfering sub-shapes.
Methods *TObj_Model::SaveAs* and *TObj_Model::Load* receive *TCollection_ExtendedString* filename arguments instead of char*. This shows that the filename may be not-ASCII explicitly. Also it makes OCAF API related to this functionality more conform.

View File

@@ -175,14 +175,23 @@ Run this command without arguments to get help on supported options.
@section OCCT_OVW_SECTION_5 Requirements
Open CASCADE Technology is designed to be highly portable and is known to
work on wide range of platforms.
work on wide range of platforms (UNIX, Linux, Windows, Mac OS X, Android).
Current version is officially certified on Windows (IA-32 and x86-64),
Linux (x86-64), OS X / macOS (x86-64), Android (armv7 and x86), and
iOS (armv7, arm64) platforms.
Linux (x86-64), MAC OS X (x86-64) and Android (4.0.4 armv7) platforms.
The tables below describe the recommended software configurations
The tables below describe the recommended hardware and software configurations
for which OCCT is certified to work.
@subsection overview_req_os Operating System
| OS | Versions |
| --------- | ----------- |
| Windows | 10, 8.1, 7 SP1, Vista SP2 |
| Linux | Mandriva 2010, CentOS 6.3, Fedora 18, Ubuntu 14.10 - 15.10, Debian 6.0, Debian 7.0 |
| OS X | 10.10 Yosemite / 10.9 Mavericks / 10.8 Mountain Lion / 10.7 Lion |
| Android | 6.x, 5.x, 4.0.4+ |
| iOS | iOS 7 |
@subsection overview_req_cpp C++ Compiler / IDE
| OS | Compiler |
@@ -220,14 +229,19 @@ On desktop, 3D viewer for optimal performance requires graphics processing unit
Ray tracing requires OpenGL 4.0+ or OpenGL 3.3+ with *GL_ARB_texture_buffer_object_rgb32* extension.
Textures within ray tracing will be available only when *GL_ARB_bindless_texture extension* is provided by driver.
On mobile platforms, OpenGL ES 2.0+ is required for 3D viewer (OpenGL ES 3.1+ is recommended).
The ray tracing is not yet available on mobile platforms.
On mobile platforms, OpenGL ES 2.0+ is required for 3D viewer. The ray tracing is not yet available on mobile platforms.
Some old hardware might be unable to execute complex GLSL programs (e.g. with high number of light sources, clipping planes).
OCCT 3D Viewer, in general, supports wide range of graphics hardware - from very old to new.
Therefore, if you observe some unexpected visual issues - first check for OpenGL driver update (or firmware update in case of mobile platforms);
but beware that driver update might also come with new bugs.
Don't forget to report these bugs to vendors.
The following table lists graphic cards tested to work with OCCT.
| Graphic card | Driver | OS | OpenGL (fixed pipeline) | OpenGL (shaders) | OpenGL (ray tracing) |
| ---- | ---- | ---- | :----: | :----: | :----: |
| NVIDIA GeForce GTX 650 | Driver 340.52, OpenGL 4.4 | Windows 7 64 bit | OK | OK | OK |
| AMD/ATI RadeOn HD 7870 | Driver 14.100, OpenGL 4.4 | Windows 7 64-bit | OK | OK | OK |
| Intel(R) HD Graphics 2500 | Driver 10.18.10.3621, OpenGL 4.0 | Windows 7 64 bit | OK | OK | limited (no textures) |
| NVIDIA GeForce 320 | N/A | Mac OS X 10.6 / OS X 10.10 | OK | OK | not yet supported by OCCT |
| Apple software OpenGL | N/A | Mac OS X 10.6 / OS X 10.10 | OK | OK | N/A |
| Mesa 10.2.4 (software emulator) | "Gallium 0.4 on llvmpipe (LLVM 3.4, 256 bits)" OpenGL 3.0 | Windows 7 64 bit | OK | OK | unsupported by software |
@section OCCT_OVW_SECTION_4 Installation
@@ -332,9 +346,10 @@ The scripts are located in the OCCT root folder.
* **CSF_DEBUG** (optional, Windows only): if defined then a diagnostic message is displayed in case of an exception;
* **CSF_DEBUG_BOP** (optional): if defined then it should specify directory where diagnostic data on problems occured in Boolean operations will be saved;
* **CSF_MDTVTexturesDirectory** defines the directory for available textures when using texture mapping;
* **CSF_ShadersDirectory** (optional) defines the directory for GLSL programs for Ray Tracing renderer (embedded resources are used when variable is undefined);
* **CSF_SHMessage** (optional) defines the path to the messages file for *ShapeHealing*;
* **CSF_XSMessage** (optional) defines the path to the messages file for **STEP** and **IGES** translators;
* **CSF_ShadersDirectory** defines the directory for GLSL programs (required for 3D viewer to work);
* **CSF_UnitsDefinition** and **CSF_UnitsLexicon** should define paths to resource files Lexi_Expr.dat and Units.dat, respectively (required for support of measurement units);
* **CSF_SHMessage** defines the path to the messages file for *ShapeHealing*;
* **CSF_XSMessage** defines the path to the messages file for **STEP** and **IGES** translators;
* **CSF_StandardDefaults**, **CSF_StandardLiteDefaults*, **CSF_XCAFDefaults**, and **CSF_PluginDefaults** define paths to directory where configuration files for OCAF persistence are located (required for open/save operations with OCAF documents);
* **CSF_IGESDefaults** and **CSF_STEPDefaults** (optional) define paths to directory where resource files of **IGES** and **STEP** translators are located;
* **CSF_XmlOcafResource** is required in order to set the path to **XSD** resources, which defines XML grammar.

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

@@ -40,8 +40,6 @@ where:
**Note** There is an operation *Cut21*, which is an extension for forward Cut operation, i.e <i>Cut21=Cut(G2, G1)</i>.
For more details see @ref occt_algorithms_9 "Boolean Operations Algorithm" section.
@subsubsection occt_algorithms_2_1_2 General Fuse operator
The General fuse operator can be applied to an arbitrary number of arguments in terms of *TopoDS_Shape*.
@@ -73,8 +71,6 @@ This Figure shows that
The fact that *R<sub>GF</sub>* contains the components of *R<sub>B</sub>* allows considering GFA as the general case of BOA. So it is possible to implement BOA as a subclass of GFA.
For more details see @ref occt_algorithms_7 "General Fuse Algorithm" section.
@subsubsection occt_algorithms_2_1_3 Partition operator
The Partition operator can be applied to an arbitrary number of arguments in terms of *TopoDS_Shape*. The arguments are divided on two groups: Objects, Tools. The result of PA contains all parts belonging to the Objects but does not contain the parts that belongs to the Tools only.
@@ -103,7 +99,6 @@ For example, when *G<sub>1</sub>* consists of shapes *S<sub>1</sub>* and *S<sub>
The fact that the *R<sub>GF</sub>* contains the components of *R<sub>PA</sub>* allows considering GFA as the general case of PA. Thus, it is possible to implement PA as a subclass of GFA.
For more details see @ref occt_algorithms_8 "Partition Algorithm" section.
@subsubsection occt_algorithms_2_1_4 Section operator
@@ -114,8 +109,6 @@ The SA operator can be represented as follows:
* <i>S1, S2 ... Sn</i> -- the operation arguments;
* *n* -- the number of arguments.
For more details see @ref occt_algorithms_10a "Section Algorithm" section.
@subsection occt_algorithms_2_2 Parts of algorithms
GFA, BOA, PA and SA have the same Data Structure (DS). The main goal of the Data Structure is to store all necessary information for input data and intermediate results.
@@ -1049,158 +1042,6 @@ The input data for this step is a *BOPAlgo_Builder* object after building result
| 2 | Correct tolerances of edges on faces | *BOPTools_Tools::CorrectCurveOnSurface()* |
@section occt_algorithms_8 Partition Algorithm
The Partition algorithm is a General Fuse (GF) based algorithm. It provides means to split the group of an arbitrary number of shapes of an arbitrary dimension by the other group of an arbitrary number of shapes of an arbitrary dimension.
All the options of the GF algorithm, such as Fuzzy mode, safe mode, parallel mode, gluing mode and history support are also available in this algorithm.
@subsection occt_algorithms_8_1 Arguments
* The arguments of the Partition algorithms are divided on two groups - *Objects* and *Tools*;
* The requirements for the arguments (both for *Objects* and *Tools*) are the same as for General Fuse algorithm - there could be any number of arguments of any type, but each argument should be valid and not self-interfered.
@subsection occt_algorithms_8_2 Results
* The result of Partition algorithm is similar to the result of General Fuse algorithm, but it contains only the split parts of the shapes included into the group of *Objects*;
* Splits parts of the shapes included only into group of *Tools* are excluded from the result;
* If there are no shapes in the group of *Tools* the result of the operation will be equivalent to the result of General Fuse operation.
@subsection occt_algorithms_8_3 Usage
@subsubsection occt_algorithms_8_3_1 API
On the low level the Partition algorithm is implemented in the class *BOPAlgo_Splitter*. The usage of this algorithm looks as follows:
~~~~~
BOPAlgo_Splitter aSplitter;
BOPCol_ListOfShape aLSObjects = …; // Objects
BOPCol_ListOfShape aLSTools = …; // Tools
Standard_Boolean bRunParallel = Standard_False; /* parallel or single mode (the default value is FALSE)*/
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*/
// setting arguments
aSplitter.SetArguments(aLSObjects);
aSplitter.SetTools(aLSTools);
// setting options
aSplitter.SetRunParallel(bRunParallel);
aSplitter.SetFuzzyValue(aTol);
aSplitter.SetNonDestructive(bSafeMode);
aSplitter.SetGlue(aGlue);
//
aSplitter.Perform(); //perform the operation
if (aSplitter.ErrorStatus()) { //check error status
return;
}
//
const TopoDS_Shape& aResult = aSplitter.Shape(); // result of the operation
~~~~~
@subsubsection occt_algorithms_8_3_2 DRAW
For the usage of the Partition algorithm in DRAW the command *bsplit* is implemented. Similarly to the *bbuild* command (for the usage of the General Fuse algorithm) the *bsplit* command should be used after the Pave Filler is filled.
~~~~~
# s1 s2 s3 - objects
# t1 t2 t3 - tools
bclearobjects
bcleartools
baddobjects s1 s2 s3
baddtools t1 t2 t3
bfillds
bsplit result
~~~~~
@subsection occt_algorithms_8_4 Examples
@subsubsection occt_algorithms_8_4_1 Example 1
Splitting face by the set of edges:
~~~~
# draw script for reproducing
bclearobjects
bcleartools
set height 20
cylinder cyl 0 0 0 0 0 1 10
mkface f cyl 0 2*pi -$height $height
baddobjects f
# create tool edges
compound edges
set nb_uedges 10
set pi2 [dval 2*pi]
set ustep [expr $pi2/$nb_uedges]
for {set i 0} {$i <= $pi2} {set i [expr $i + $ustep]} {
uiso c cyl $i
mkedge e c -25 25
add e edges
}
set nb_vedges 10
set vstep [expr 2*$height/$nb_vedges]
for {set i -20} {$i <= 20} {set i [expr $i + $vstep]} {
viso c cyl $i
mkedge e c
add e edges
}
baddctools edges
bfillds
bsplit result
~~~~
<table align="center">
<tr>
<td>@figure{/user_guides/boolean_operations/images/bsplit_image001.png, "Arguments"}</td>
<td>@figure{/user_guides/boolean_operations/images/bsplit_image002.png, "Result"}</td>
</tr>
</table>
@subsubsection occt_algorithms_8_4_2 Example 2
Splitting plate by the set of cylinders:
~~~~
# draw script for reproducing:
bclearobjects
bcleartools
box plate 100 100 1
baddobjects plate
pcylinder p 1 11
compound cylinders
for {set i 0} {$i < 101} {incr i 5} {
for {set j 0} {$j < 101} {incr j 5} {
copy p p1;
ttranslate p1 $i $j -5;
add p1 cylinders
}
}
baddtools cylinders
bfillds
bsplit result
~~~~
<table align="center">
<tr>
<td>@figure{/user_guides/boolean_operations/images/bsplit_image003.png, "Arguments"}</td>
<td>@figure{/user_guides/boolean_operations/images/bsplit_image004.png, "Result"}</td>
</tr>
</table>
@subsubsection occt_algorithms_8_4_3 Example 3
Splitting shell hull by the planes:
<table align="center">
<tr>
<td>@figure{/user_guides/boolean_operations/images/bsplit_image005.png, "Arguments"}</td>
<td>@figure{/user_guides/boolean_operations/images/bsplit_image006.png, "Results"}</td>
</tr>
</table>
@section occt_algorithms_9 Boolean Operations Algorithm
@subsection occt_algorithms_9_1 Arguments
@@ -1239,11 +1080,9 @@ Splitting shell hull by the planes:
* 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
@@ -1716,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}
@@ -2023,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
@@ -2335,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>).
@@ -2352,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.
@@ -2366,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.
@@ -2380,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.
@@ -2394,106 +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, Partition, Boolean, Section, Maker Volume 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.
@subsection occt_algorithms_11a_3 Safe processing mode
The safe processing mode is the advanced option in Boolean Operation component. This mode can be applied to all Basic operations such as General Fuse, Partition, Boolean, Section, Maker Volume.
This option allows keeping the input arguments untouched. In other words, switching this option on prevents the input arguments from any modification such as tolerance increase, addition of the P-Curves on edges etc.
The option might be very useful for implementation of the Undo/Redo mechanism in the applications and allows performing the operation many times without changing the inputs.
By default the safe processing option is switched off for the algorithms. Enabling this option might slightly decrease the performance of the operation, because instead of the modification of some entitiy it will be necessary to create the copy of this entitiy and modify it. But this degradation should be very small because the copying is performed only in case of necessity.
The option is also availible in the Intersection algorithm - *BOPAlgo_PaveFiller*. Thus, if it is necessary to perform several different operations on the same arguemnts, it is possible to enable the safe processing mode in PaveFiller and prepare it only once and then use it in operations. It is enough to set the option to PaveFiller only and all algorithms taking this PaveFiller will also work in safe mode.
@subsubsection occt_algorithms_11a_3_1 Usage
#### API level
To enable/disable the safe processing mode for the algorithm it is necessary to call the SetNonDestructive() method with appropriate value:
~~~~
BOPAlgo_Builder aGF;
//
....
// enabling the safe processing mode to prevent modification of the input shapes
aGF.SetNonDestructive(Standard_True);
//
....
~~~~
#### TCL level
For enabling the safe processing mode for the operaton in DRAW it is necessary to call the <i>bnondestructive</i> command with appropriate value:
* 0 - default value, the safe mode is switched off;
* 1 - the safe mode will be switched on.
~~~~
bnondestructive 1
~~~~
@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.
@@ -2505,14 +2170,13 @@ The package *BRepAlgoAPI* provides the Application Programming Interface of the
The package consists of the following classes:
* *BRepAlgoAPI_Algo* -- the root class that provides the interface for algorithms.
* *BRepAlgoAPI_BuilderAlgo* -- the class API level of General Fuse algorithm.
* *BRepAlgoAPI_Splitter* -- the class API level of the Partition algorithm.
* *BRepAlgoAPI_BooleanOperation* -- the root class for the classes *BRepAlgoAPI_Fuse*. *BRepAlgoAPI_Common*, *BRepAlgoAPI_Cut* and *BRepAlgoAPI_Section*.
* *BRepAlgoAPI_Fuse* -- the class provides Boolean fusion operation.
* *BRepAlgoAPI_Common* -- the class provides Boolean common operation.
* *BRepAlgoAPI_Cut* -- the class provides Boolean cut operation.
* *BRepAlgoAPI_Section* -- the class provides Boolean section operation.
@figure{/user_guides/boolean_operations/images/operations_image065.png, "Diagram of BRepAlgoAPI package"}
@figure{/user_guides/boolean_operations/images/operations_image065.svg, "Diagram of BRepAlgoAPI package"}
The detailed description of the classes can be found in the corresponding .hxx files. The examples are below in this chapter.
@@ -2520,12 +2184,11 @@ The detailed description of the classes can be found in the corresponding .hxx f
The package *BOPTest* provides the usage of the Boolean Component on Tcl level. The method *BOPTest::APICommands* contains corresponding Tcl commands:
* *bapibuild* -- for General Fuse Operator;
* *bapisplit* -- for Partition Operator;
* *bapibop* -- for Boolean Operator and Section Operator.
The examples of how to use the commands are below in this chapter.
@subsubsection occt_algorithms_11b_2_1 Case 1. General Fuse operation
@subsubsection occt_algorithms_11b_2_1 Case 1 General Fuse operation
The following example illustrates how to use General Fuse operator:
@@ -2559,19 +2222,6 @@ The following example illustrates how to use General Fuse operator:
// if aFuzzyValue>0.: the Fuzzy option is on
aBuilder.SetFuzzyValue(aFuzzyValue);
//
// safe mode - avoid modification of the arguments
Standard_Boolean bSafeMode = Standard_True;
// if bSafeMode == Standard_True - the safe mode is switched on
// if bSafeMode == Standard_False - the safe mode is switched off
aBuilder.SetNonDestructive(bSafeMode);
//
// gluing options - for coinciding arguments
BOPAlgo_GlueEnum aGlueOpt = BOPAlgo_GlueFull;
// if aGlueOpt == BOPAlgo_GlueOff - the gluing mode is switched off
// if aGlueOpt == BOPAlgo_GlueShift - the gluing mode is switched on
// if aGlueOpt == BOPAlgo_GlueFull - the gluing mode is switched on
aBuilder.SetGlue(aGlueOpt);
//
// run the algorithm
aBuilder.Build();
iErr=aBuilder.ErrorStatus();
@@ -2603,137 +2253,17 @@ baddobjects b1 b2 b3
# 1: the parallel processing is switched on
# 0: the parallel processing is switched off
brunparallel 1
#
# set Fuzzy value
# 0. : the Fuzzy option is off
# >0. : the Fuzzy option is on
bfuzzyvalue 0.
#
# set safe processing mode
bnondestructive 1
# set safe mode
# 1 - the safe processing mode is switched on
# 0 - the safe processing mode is switched off
#
# set gluing mode
bglue 1
# set the gluing mode
# 1 or 2 - the gluing mode is switched on
# 0 - the gluing mode is switched off
#
# run the algorithm
# r is the result of the operation
bapibuild r
~~~~
@subsubsection occt_algorithms_11b_2_2 Case 2. Partition operation
The following example illustrates how to use the Partition operator:
#### C++ Level
~~~~
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepAlgoAPI_Splitter.hxx>
//
BRepAlgoAPI_BuilderAlgo aSplitter;
//
// prepare the arguments
// objects
TopTools_ListOfShape& aLSObjects = … ;
// tools
TopTools_ListOfShape& aLSTools = … ;
//
// set the arguments
aSplitter.SetArguments(aLSObjects);
aSplitter.SetTools(aLSTools);
//
// set options
// parallel processing mode
Standard_Boolean bRunParallel = Standard_True;
// bRunParallel == Standard_True - the parallel processing is switched on
// bRunParallel == Standard_False - the parallel processing is switched off
aSplitter.SetRunParallel();
//
// fuzzy value - additional tolerance for the operation
Standard_Real aFuzzyValue = 1.e-5;
// if aFuzzyValue == 0. - the Fuzzy option is off
// if aFuzzyValue > 0. - the Fuzzy option is on
aSplitter.SetFuzzyValue(aFuzzyValue);
//
// safe mode - avoid modification of the arguments
Standard_Boolean bSafeMode = Standard_True;
// if bSafeMode == Standard_True - the safe mode is switched on
// if bSafeMode == Standard_False - the safe mode is switched off
aSplitter.SetNonDestructive(bSafeMode);
//
// gluing options - for coinciding arguments
BOPAlgo_GlueEnum aGlueOpt = BOPAlgo_GlueFull;
// if aGlueOpt == BOPAlgo_GlueOff - the gluing mode is switched off
// if aGlueOpt == BOPAlgo_GlueShift - the gluing mode is switched on
// if aGlueOpt == BOPAlgo_GlueFull - the gluing mode is switched on
aSplitter.SetGlue(aGlueOpt);
//
// run the algorithm
aSplitter.Build();
// check error status
if (aSplitter.ErrorStatus()) {
return;
}
//
// result of the operation aResult
const TopoDS_Shape& aResult = aSplitter.Shape();
~~~~
#### Tcl Level
~~~~
# prepare the arguments
# objects
box b1 10 10 10
box b2 7 0 0 10 10 10
# tools
plane p 10 5 5 0 1 0
mkface f p -20 20 -20 20
#
# clear inner contents
bclearobjects; bcleartools;
#
# set the objects
baddobjects b1 b2
# set the tools
baddtools f
#
# set parallel processing mode
# 1: the parallel processing is switched on
# 0: the parallel processing is switched off
brunparallel 1
#
# set Fuzzy value
# 0. : the Fuzzy option is off
# >0. : the Fuzzy option is on
bfuzzyvalue 0.
#
# set safe processing mode
bnondestructive 1
# set safe mode
# 1 - the safe processing mode is switched on
# 0 - the safe processing mode is switched off
#
# set gluing mode
bglue 1
# set the gluing mode
# 1 or 2 - the gluing mode is switched on
# 0 - the gluing mode is switched off
#
# run the algorithm
# r is the result of the operation
bapisplit r
~~~~
@subsubsection occt_algorithms_11b_2_3 Case 3. Common operation
@subsubsection occt_algorithms_11b_2_2 Case 2. Common operation
The following example illustrates how to use Common operation:
@@ -2770,19 +2300,6 @@ The following example illustrates how to use Common operation:
// if aFuzzyValue>0.: the Fuzzy option is on
aBuilder.SetFuzzyValue(aFuzzyValue);
//
// safe mode - avoid modification of the arguments
Standard_Boolean bSafeMode = Standard_True;
// if bSafeMode == Standard_True - the safe mode is switched on
// if bSafeMode == Standard_False - the safe mode is switched off
aBuilder.SetNonDestructive(bSafeMode);
//
// gluing options - for coinciding arguments
BOPAlgo_GlueEnum aGlueOpt = BOPAlgo_GlueFull;
// if aGlueOpt == BOPAlgo_GlueOff - the gluing mode is switched off
// if aGlueOpt == BOPAlgo_GlueShift - the gluing mode is switched on
// if aGlueOpt == BOPAlgo_GlueFull - the gluing mode is switched on
aBuilder.SetGlue(aGlueOpt);
//
// run the algorithm
aBuilder.Build();
iErr=aBuilder.ErrorStatus();
@@ -2822,25 +2339,13 @@ brunparallel 1
# >0. : the Fuzzy option is on
bfuzzyvalue 0.
#
# set safe processing mode
bnondestructive 1
# set safe mode
# 1 - the safe processing mode is switched on
# 0 - the safe processing mode is switched off
#
# set gluing mode
bglue 1
# set the gluing mode
# 1 or 2 - the gluing mode is switched on
# 0 - the gluing mode is switched off
#
# run the algorithm
# r is the result of the operation
# 0 means Common operation
bapibop r 0
~~~~
@subsubsection occt_algorithms_11b_2_4 Case 4. Fuse operation
@subsubsection occt_algorithms_11b_2_3 Case 3. Fuse operation
The following example illustrates how to use Fuse operation:
@@ -2877,19 +2382,6 @@ The following example illustrates how to use Fuse operation:
// if aFuzzyValue>0.: the Fuzzy option is on
aBuilder.SetFuzzyValue(aFuzzyValue);
//
// safe mode - avoid modification of the arguments
Standard_Boolean bSafeMode = Standard_True;
// if bSafeMode == Standard_True - the safe mode is switched on
// if bSafeMode == Standard_False - the safe mode is switched off
aBuilder.SetNonDestructive(bSafeMode);
//
// gluing options - for coinciding arguments
BOPAlgo_GlueEnum aGlueOpt = BOPAlgo_GlueFull;
// if aGlueOpt == BOPAlgo_GlueOff - the gluing mode is switched off
// if aGlueOpt == BOPAlgo_GlueShift - the gluing mode is switched on
// if aGlueOpt == BOPAlgo_GlueFull - the gluing mode is switched on
aBuilder.SetGlue(aGlueOpt);
//
// run the algorithm
aBuilder.Build();
iErr=aBuilder.ErrorStatus();
@@ -2929,25 +2421,13 @@ brunparallel 1
# >0. : the Fuzzy option is on
bfuzzyvalue 0.
#
# set safe processing mode
bnondestructive 1
# set safe mode
# 1 - the safe processing mode is switched on
# 0 - the safe processing mode is switched off
#
# set gluing mode
bglue 1
# set the gluing mode
# 1 or 2 - the gluing mode is switched on
# 0 - the gluing mode is switched off
#
# run the algorithm
# r is the result of the operation
# 1 means Fuse operation
bapibop r 1
~~~~
@subsubsection occt_algorithms_11b_2_5 Case 5. Cut operation
@subsubsection occt_algorithms_11b_2_4 Case 4. Cut operation
The following example illustrates how to use Cut operation:
@@ -2984,19 +2464,6 @@ The following example illustrates how to use Cut operation:
// if aFuzzyValue>0.: the Fuzzy option is on
aBuilder.SetFuzzyValue(aFuzzyValue);
//
// safe mode - avoid modification of the arguments
Standard_Boolean bSafeMode = Standard_True;
// if bSafeMode == Standard_True - the safe mode is switched on
// if bSafeMode == Standard_False - the safe mode is switched off
aBuilder.SetNonDestructive(bSafeMode);
//
// gluing options - for coinciding arguments
BOPAlgo_GlueEnum aGlueOpt = BOPAlgo_GlueFull;
// if aGlueOpt == BOPAlgo_GlueOff - the gluing mode is switched off
// if aGlueOpt == BOPAlgo_GlueShift - the gluing mode is switched on
// if aGlueOpt == BOPAlgo_GlueFull - the gluing mode is switched on
aBuilder.SetGlue(aGlueOpt);
//
// run the algorithm
aBuilder.Build();
iErr=aBuilder.ErrorStatus();
@@ -3036,18 +2503,6 @@ brunparallel 1
# >0. : the Fuzzy option is on
bfuzzyvalue 0.
#
# set safe processing mode
bnondestructive 1
# set safe mode
# 1 - the safe processing mode is switched on
# 0 - the safe processing mode is switched off
# set gluing mode
#
bglue 1
# set the gluing mode
# 1 or 2 - the gluing mode is switched on
# 0 - the gluing mode is switched off
#
# run the algorithm
# r is the result of the operation
# 2 means Cut operation
@@ -3055,7 +2510,7 @@ bapibop r 2
~~~~
@subsubsection occt_algorithms_11b_2_6 Case 6. Section operation
@subsubsection occt_algorithms_11b_2_5 Case 5. Section operation
The following example illustrates how to use Section operation:
@@ -3092,19 +2547,6 @@ The following example illustrates how to use Section operation:
// if aFuzzyValue>0.: the Fuzzy option is on
aBuilder.SetFuzzyValue(aFuzzyValue);
//
// safe mode - avoid modification of the arguments
Standard_Boolean bSafeMode = Standard_True;
// if bSafeMode == Standard_True - the safe mode is switched on
// if bSafeMode == Standard_False - the safe mode is switched off
aBuilder.SetNonDestructive(bSafeMode);
//
// gluing options - for coinciding arguments
BOPAlgo_GlueEnum aGlueOpt = BOPAlgo_GlueFull;
// if aGlueOpt == BOPAlgo_GlueOff - the gluing mode is switched off
// if aGlueOpt == BOPAlgo_GlueShift - the gluing mode is switched on
// if aGlueOpt == BOPAlgo_GlueFull - the gluing mode is switched on
aBuilder.SetGlue(aGlueOpt);
//
// run the algorithm
aBuilder.Build();
iErr=aBuilder.ErrorStatus();
@@ -3144,18 +2586,6 @@ brunparallel 1
# >0. : the Fuzzy option is on
bfuzzyvalue 0.
#
# set safe processing mode
bnondestructive 1
# set safe mode
# 1 - the safe processing mode is switched on
# 0 - the safe processing mode is switched off
#
# set gluing mode
bglue 1
# set the gluing mode
# 1 or 2 - the gluing mode is switched on
# 0 - the gluing mode is switched off
#
# run the algorithm
# r is the result of the operation
# 4 means Section operation

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,407 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="500.70731"
height="257.98001"
id="svg3731"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="operations_image059.svg">
<defs
id="defs3733">
<marker
inkscape:stockid="Arrow2Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow2Mstart"
style="overflow:visible">
<path
id="path4673"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="scale(0.6,0.6)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Lstart"
style="overflow:visible">
<path
id="path4649"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
transform="matrix(0.8,0,0,0.8,10,0)"
inkscape:connector-curvature="0" />
</marker>
<clipPath
id="clipEmfPath1"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3744"
height="157.5"
width="566.85828"
y="0"
x="0" />
</clipPath>
<clipPath
id="clipEmfPath2"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3747"
height="15"
width="134.10196"
y="14.7"
x="215.55315" />
</clipPath>
<clipPath
id="clipEmfPath3"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3750"
height="13.95"
width="158.85233"
y="118.5"
x="53.850784" />
</clipPath>
<clipPath
id="clipEmfPath4"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3753"
height="15"
width="189.90277"
y="68.849998"
x="185.10271" />
</clipPath>
<clipPath
id="clipEmfPath5"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3756"
height="13.95"
width="180.15263"
y="118.2"
x="315.3046" />
</clipPath>
<marker
inkscape:stockid="Arrow2Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow2Mstart-1"
style="overflow:visible">
<path
id="path4673-7"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="scale(0.6,0.6)"
inkscape:connector-curvature="0" />
</marker>
<clipPath
id="clipEmfPath1-0"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3744-9"
height="157.5"
width="566.85828"
y="0"
x="0" />
</clipPath>
<marker
inkscape:stockid="Arrow2Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow2Mstart-7"
style="overflow:visible">
<path
id="path4673-1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="scale(0.6,0.6)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow2Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow2Mstart-2"
style="overflow:visible">
<path
id="path4673-76"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="scale(0.6,0.6)"
inkscape:connector-curvature="0" />
</marker>
<clipPath
id="clipEmfPath1-4"
clipPathUnits="userSpaceOnUse">
<rect
id="rect3744-2"
height="157.5"
width="566.85828"
y="0"
x="0" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.7435336"
inkscape:cx="250.35365"
inkscape:cy="166.25673"
inkscape:document-units="px"
inkscape:current-layer="g3758"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1195"
inkscape:window-height="615"
inkscape:window-x="10"
inkscape:window-y="129"
inkscape:window-maximized="0"
inkscape:snap-bbox="false"
inkscape:bbox-nodes="false"
inkscape:snap-nodes="false"
inkscape:snap-global="true" />
<metadata
id="metadata3736">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(204.63937,-240.29985)">
<g
id="g3758"
transform="translate(-261.51666,329.10596)">
<text
id="text3760"
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
y="142.64999"
x="558.15814"
xml:space="preserve"> </text>
<path
id="path3762"
d="m 214.87814,10.5 0,23.4375 135.43322,0 0,-23.4375 z"
clip-path="url(#clipEmfPath1)"
style="fill:none;stroke:#000000;stroke-width:1.25626838px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0"
transform="matrix(1.8268958,0,0,0.9818143,-213.2932,-1.3165801)" />
<text
id="text3764"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="23.035164"
x="220.98541"
xml:space="preserve">BRepAlgoAPI_BuilderAlgo</text>
<text
id="text3766"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="25.049999"
x="327.60477"
xml:space="preserve"> </text>
<path
id="path3768"
d="m 53.175776,114.3 0,22.37812 160.127334,0 0,-22.37812 z"
clip-path="url(#clipEmfPath2)"
style="fill:none;stroke:#000000;stroke-width:1.24689317px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3770"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="143.76225"
x="148.95631"
xml:space="preserve">BRepAlgoAPI_Fuse</text>
<text
id="text3772"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="128.85001"
x="204.603"
xml:space="preserve"> </text>
<text
id="text3774"
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
y="158.85001"
x="57.45084"
xml:space="preserve"> </text>
<path
id="path3776"
d="m 280.56035,62.94375 -0.59064,-22.621875 c -0.009,-0.346875 0.26251,-0.6375 0.60939,-0.646875 0.34688,-0.0094 0.62813,0.2625 0.63751,0.609375 l 0.59063,22.63125 c 0.009,0.346875 -0.2625,0.628125 -0.60938,0.6375 -0.34688,0.0094 -0.62814,-0.2625 -0.63751,-0.609375 z m -3.68443,-21.290625 3.55317,-7.603125 3.94694,7.40625 z"
clip-path="url(#clipEmfPath3)"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.1500022px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path3778"
d="m 177.37132,50.938071 0,23.25606 252.44098,0 0,-23.25606 z"
style="fill:none;stroke:#000000;stroke-width:1.43770862px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3780"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="64.861305"
x="203.64111"
xml:space="preserve">BRepAlgoAPI_BooleanOperation</text>
<text
id="text3782"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="79.199997"
x="351.30511"
xml:space="preserve"> </text>
<text
id="text3784"
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="108.3"
x="188.70276"
xml:space="preserve"> </text>
<path
id="path3786"
d="m 198.98728,113.10938 20.70968,-20.700005 c 0.24375,-0.24375 0.63751,-0.24375 0.88126,0 0.24375,0.24375 0.24375,0.6375 0,0.88125 L 199.87792,114 c -0.24376,0.24375 -0.64689,0.24375 -0.89064,0 -0.24375,-0.24375 -0.24375,-0.64688 0,-0.89062 z m 17.61588,-22.031255 7.95012,-2.653125 -2.64379,7.959375 z"
clip-path="url(#clipEmfPath4)"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.1500022px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path3790"
d="m 323.06859,130.86407 0,22.45692 161.49789,0 0,-22.45692 z"
style="fill:none;stroke:#000000;stroke-width:1.18685222px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<text
id="text3792"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="144.46437"
x="341.69354"
xml:space="preserve">BRepAlgoAPI_Cut</text>
<text
id="text3794"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="128.55"
x="480.30701"
xml:space="preserve"> </text>
<text
id="text3796"
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
y="158.39999"
x="318.75464"
xml:space="preserve"> </text>
<path
id="path3778-1"
d="m 136.65269,130.42418 0,23.58586 147.81153,0 0,-23.58586 z"
style="fill:none;stroke:#000000;stroke-width:1.10790598px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
style="fill:#916f6f;stroke:#000000;stroke-width:0.7965284px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Mstart)"
d="m 304.3563,32.239951 0,18.31124"
id="path3875"
inkscape:connector-curvature="0" />
<path
transform="matrix(1.1475795,0,0,0.99628756,-17.657381,-45.674459)"
id="path3762-4"
d="m 214.87814,10.5 0,23.4375 135.43322,0 0,-23.4375 z"
clip-path="url(#clipEmfPath1-0)"
style="fill:none;stroke:#000000;stroke-width:1.25626838px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path3778-1-8"
d="m 78.687273,88.627374 0,23.585856 147.811517,0 0,-23.585856 z"
style="fill:none;stroke:#000000;stroke-width:1.10790598px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.90858448px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
d="M 276.56388,74.263936 224.85315,129.41594"
id="path6825"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.91995925px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
d="m 325.68413,73.924924 51.41999,56.861286"
id="path6825-2"
inkscape:connector-type="polyline"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 179.52049,162.77106 c -59.64898,14.3387 -59.64898,14.3387 -59.64898,14.3387"
id="path6849"
inkscape:connector-curvature="0"
transform="translate(56.87729,-88.80611)" />
<text
id="text3792-4"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="103.56826"
x="83.965698"
xml:space="preserve">BRepAlgoAPI_Common</text>
<path
id="path3778-1-8-5"
d="m 373.01844,90.295386 0,23.546834 158.6699,0 0,-23.546834 z"
style="fill:none;stroke:#000000;stroke-width:1.14692891px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1.0304904px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 389.40321,74.26698 c 58.76558,15.4553 58.76558,15.4553 58.76558,15.4553"
id="path6849-5"
inkscape:connector-curvature="0" />
<text
id="text3792-4-1"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="104.71535"
x="382.07281"
xml:space="preserve">BRepAlgoAPI_Section</text>
<path
style="fill:#916f6f;stroke:#000000;stroke-width:0.7965284px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Mstart)"
d="m 305.51053,-9.9971206 0,18.31124"
id="path3875-1"
inkscape:connector-curvature="0" />
<text
id="text3764-5"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="-19.759373"
x="249.94737"
xml:space="preserve">BRepAlgoAPI_Algo</text>
<path
style="fill:#916f6f;stroke:#000000;stroke-width:0.7965284px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Mstart)"
d="m 306.65763,-54.160308 0,18.31124"
id="path3875-1-1"
inkscape:connector-curvature="0" />
<path
id="path3762-3"
d="m 214.87814,10.5 0,23.4375 135.43322,0 0,-23.4375 z"
clip-path="url(#clipEmfPath1-4)"
style="fill:none;stroke:#000000;stroke-width:1.25626838px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0"
transform="matrix(1.6833898,0,0,0.98459396,-169.65553,-88.430725)" />
<text
id="text3764-2"
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
y="-65.054825"
x="221.258"
xml:space="preserve">BRepBuilderAPI_MakeShape</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -43,9 +43,8 @@ This documentation describes:
* The graphical commands.
* The Geometry set of commands.
* The Topology set of commands.
* OCAF commands.
* Data Exchange commands
* Shape Healing commands
This document does not describe other sets of commands and does not explain how to extend Draw using C++.
This document is a reference manual. It contains a full description of each command. All descriptions have the format illustrated below for the exit command.
@@ -204,18 +203,18 @@ Braces *quoting* prevents all substitutions. Braces are also nested. The main us
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
set x 0
# this will loop for ever
# because while argument is ;0 < 3;
while ;$x < 3; {set x [expr $x+1]}
# because while argument is ;0 3;
while ;$x 3; {set x [expr $x+1]}
# this will terminate as expected because
# while argument is {$x < 3}
while {$x < 3} {set x [expr $x+1]}
# while argument is {$x 3}
while {$x 3} {set x [expr $x+1]}
# this can be written also
while {$x < 3} {
while {$x 3} {
set x [expr $x+1]
}
# the following cannot be written
# because while requires two arguments
while {$x < 3}
while {$x 3}
{
set x [expr $x+1]
}
@@ -326,17 +325,6 @@ puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)];
**Note,** that in TCL, parentheses are not considered to be special characters. Do not forget to quote an expression if it contains spaces in order to avoid parsing different words. <i>(a + b)</i> is parsed as three words: <i>"(a + b)"</i> or <i>(a+b)</i> are correct.
@subsubsection occt_draw_2_3_3 del, dall
Syntax:
~~~~~
del varname_pattern [varname_pattern ...]
dall
~~~~~
*del* command does the same thing as *unset*, but it deletes the variables matched by the pattern.
*dall* command deletes all variables in the session.
@subsection occt_draw_2_4 lists
@@ -377,7 +365,7 @@ if condition script [elseif script .... else script]
**Example:**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
if {$x > 0} {
if {$x 0} {
puts ;positive;
} elseif {$x == 0} {
puts ;null;
@@ -403,13 +391,13 @@ The three loop structures are similar to their C or csh equivalent. It is import
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# while example
dset x 1.1
while {[dval x] < 100} {
while {[dval x] 100} {
circle c 0 0 x
dset x x*x
}
# for example
# incr var d, increments a variable of d (default 1)
for {set i 0} {$i < 10} {incr i} {
for {set i 0} {$i 10} {incr i} {
dset angle $i*pi/10
point p$i cos(angle0 sin(angle) 0
}
@@ -433,7 +421,7 @@ Within loops, the **break** and **continue** commands have the same effect as in
**Example:**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# search the index for which t$i has value ;secret;
for {set i 1} {$i <= 100} {incr i} {
for {set i 1} {$i = 100} {incr i} {
if {[set t$i] == ;secret;} break;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -622,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.
@@ -631,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}
@@ -710,21 +696,21 @@ Radius :5
**Note** The behavior of *whatis* on other variables (not Draw) is not excellent.
@subsubsection occt_draw_3_2_3 renamevar, copy
@subsubsection occt_draw_3_2_3 rename, copy
Syntax:
~~~~~
renamevar varname tovarname [varname tovarname ...]
rename varname tovarname [varname tovarname ...]
copy varname tovarname [varname tovarname ...]
~~~~~
* **renamevar** changes the name of a Draw variable. The original variable will no longer exist. Note that the content is not modified. Only the name is changed.
* **rename** changes the name of a Draw variable. The original variable will no longer exist. Note that the content is not modified. Only the name is changed.
* **copy** creates a new variable with a copy of the content of an existing variable. The exact behavior of **copy** is type dependent; in the case of certain topological variables, the content may still be shared.
**Example:**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
circle c1 0 0 1 0 5
renamevar c1 c2
rename c1 c2
# curves are copied, c2 will not be modified
copy c2 c3
@@ -1178,7 +1164,7 @@ point . x y z
#Not OK. display points on a curve c
# with dot no variables are created
for {set i 0} {$i <= 10} {incr i} {
for {set i 0} {$i = 10} {incr i} {
cvalue c $i/10 x y z
point . x y z
}
@@ -1192,7 +1178,7 @@ point . x y z
# p0, p1, p2, ....
# give a name to a graphic object
renamevar . x
rename . x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1267,13 +1253,6 @@ foreach var [directory c_*] {erase $var}
2dclear
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@subsubsection occt_draw_4_1_14_1 disp, don, era
These commands have the same meaning as correspondingly display, donly and erase, but with the difference that they evaluate the arguments using glob pattern rules. For example, to display all objects with names d_1, d_2, d_3, etc. it is enouth to run the command:
~~~~~{.cpp}
disp d_*
~~~~~
@subsubsection occt_draw_4_1_15 repaint, dflush
@@ -1985,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:
@@ -2307,7 +2306,7 @@ Creates *AIS_ConnectedInteractive* object from the input object and location and
**Example:**
~~~~~
vinit
Vinitvinit
vpoint p1 0 0 0
vpoint p2 50 0 0
vsegment segment p1 p2
@@ -2426,10 +2425,9 @@ vdimension name {-angle|-length|-radius|-diameter} -shapes shape1 [shape2 [shape
[-label left|right|hcenter|hfit top|bottom|vcenter|vfit]
[-arrow external|internal|fit] [{-arrowlength|-arlen} RealArrowLength]
[{-arrowangle|-arangle} ArrowAngle(degrees)] [-plane xoy|yoz|zox]
[-flyout FloatValue -extension FloatValue]
[-autovalue] [-value CustomRealValue] [-textvalue CustomTextValue]
[-dispunits DisplayUnitsString]
[-modelunits ModelUnitsString] [-showunits | -hideunits]
[-flyout FloatValue -extension FloatValue] [-value CustomNumberValue]
[-dispunits DisplayUnitsString] [-modelunits ModelUnitsString]
[-showunits | -hideunits]
~~~~~
Builds angle, length, radius or diameter dimension interactive object **name**.
@@ -2438,7 +2436,6 @@ Builds angle, length, radius or diameter dimension interactive object **name**.
**Example:**
~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 50 50 0
vdimension dim1 -length -plane xoy -shapes p1 p2
@@ -2462,9 +2459,7 @@ vdimparam name [-text 3d|2d wf|sh|wireframe|shading IntegerSize]
[{-arrowangle|-arangle} ArrowAngle(degrees)]
[-plane xoy|yoz|zox]
[-flyout FloatValue -extension FloatValue]
[-autovalue]
[-value CustomRealValue]
[-textvalue CustomTextValue]
[-value CustomNumberValue]
[-dispunits DisplayUnitsString]
[-modelunits ModelUnitsString]
[-showunits | -hideunits]
@@ -2474,38 +2469,13 @@ Sets parameters for angle, length, radius and diameter dimension **name**.
**Example:**
~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 50 50 0
vdimension dim1 -length -plane xoy -shapes p1 p2
vdimparam dim1 -flyout -15 -arrowlength 4 -showunits -value 10
vfit
vdimparam dim1 -textvalue "w_1"
vdimparam dim1 -autovalue
~~~~~
@subsubsection occt_draw_4_4_22 vdimangleparam
Syntax:
~~~~~
vangleparam name [-type interior|exterior]
[-showarrow first|second|both|none]
~~~~~
Sets parameters for angle dimension **name**.
**Example:**
~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 10 0 0
vpoint p3 10 5 0
vdimension dim1 -angle -plane xoy -shapes p1 p2 p3
vfit
vangleparam dim1 -type exterior -showarrow first
~~~~~
@subsubsection occt_draw_4_4_23 vmovedim
@subsubsection occt_draw_4_4_22 vmovedim
Syntax:
~~~~~
@@ -2519,7 +2489,6 @@ are adjusted.
**Example:**
~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 50 50 0
vdimension dim1 -length -plane xoy -shapes p1 p2
@@ -4052,7 +4021,7 @@ Initializes the iteration on the tree of *TreeNode* attributes with tree *ID* (o
~~~~~
InitChildNodeIterate D 0:5 1
set aChildNumber 0
for {set i 1} {$i < 100} {incr i} {
for {set i 1} {$i 100} {incr i} {
if {[ChildNodeMore] == *TRUE*} {
puts *Tree node = [ChildNodeValue]*
incr aChildNumber
@@ -5272,10 +5241,10 @@ For a 2d rotation, you need only give the center point and the angle. In 2d or 3
**Example:**
~~~~~
# make a helix of circles. create a script file with
# make a helix of circles. create a scripte file with
this code and execute it using **source**.
circle c0 10 0 0 3
for {set i 1} {$i <= 10} {incr i} {
for {set i 1} {$i = 10} {incr i} {
copy c[expr $i-1] c$i
translate c$i 0 0 3
rotate c$i 0 0 0 0 0 1 36
@@ -5397,7 +5366,7 @@ Computes points and derivatives on a surface for a pair of parameter values. The
~~~~~
# display points on a sphere
sphere s 10
for {dset t 0} {[dval t] <= 1} {dset t t+0.01} {
for {dset t 0} {[dval t] = 1} {dset t t+0.01} {
svalue s t*2*pi t*pi-pi/2 x y z
point . x y z
}
@@ -5958,20 +5927,6 @@ Creates a vertex at either a 3d location x,y,z or the point at parameter p on an
vertex v1 10 20 30
~~~~~
@subsubsection occt_draw_7_2_1a mkpoint
Syntax:
~~~~~
mkpoint name vertex
~~~~~
Creates a point from the coordinates of a given vertex.
**Example:**
~~~~~
mkpoint p v1
~~~~~
@subsubsection occt_draw_7_2_2 edge, mkedge, uisoedge, visoedge
Syntax:
@@ -6679,7 +6634,7 @@ Locations are very economic in the data structure because multiple occurences of
# make rotated copies of a sphere in between two cylinders
# create a file source toto.tcl
# toto.tcl code:
for {set i 0} {$i < 360} {incr i 20} {
for {set i 0} {$i 360} {incr i 20} {
copy s s$i
trotate s$i 0 0 0 0 0 1 $i
}
@@ -7656,19 +7611,6 @@ nurbsconvert result name [result name]
Changes the NURBS curve definition of a shape to a Bspline curve definition. This conversion is required for assymetric deformation and prepares the arguments for other commands such as **deform**. The conversion can be necessary when transferring shape data to other applications.
@subsubsection occt_draw_7_11_6 edgestofaces
**edgestofaces** - The command allows building planar faces from the planar edges randomly located in 3D space.
It has the following syntax:
~~~~
edgestofaces r_faces edges [-a AngTol -s Shared(0/1)]
~~~~
Options:
* -a AngTol - angular tolerance used for distinguishing the planar faces;
* -s Shared(0/1) - boolean flag which defines whether the input edges are already shared or have to be intersected.
@subsection occt_draw_7_12 Texture Mapping to a Shape
Texture mapping allows you to map textures on a shape. Textures are texture image files and several are predefined. You can control the number of occurrences of the texture on a face, the position of a texture and the scale factor of the texture.
@@ -7763,9 +7705,7 @@ The following terms and definitions are used in this document:
* **baddobjects** *S1 S2...Sn* -- adds shapes *S1, S2, ... Sn* as Objects;
* **baddtools** *S1 S2...Sn* -- adds shapes *S1, S2, ... Sn* as Tools;
* **bfillds** -- performs the Intersection Part of the Algorithm;
* **bbuild** *r* -- performs the Building Part of the Algorithm (General Fuse operation); *r* is the resulting shape;
* **bsplit** *r* -- performs the Partition operation; *r* is the resulting shape;
* **bbop** *r* *iOp* -- performs the Boolean operation; *r* is the resulting shape; *iOp* - type of the operation (0 - COMMON; 1 - FUSE; 2 - CUT; 3 - CUT21; 4 - SECTION).
* **bbuild** *r* -- performs the Building Part of the Algorithm; *r* is the resulting shape.
@subsection occt_draw_20_3 Commands for Intersection Part
@@ -8960,19 +8900,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
@@ -9950,510 +9877,6 @@ vdrawsphere s 200 1 1 1 500 1
~~~~~
@section occt_draw_12 Simple vector algebra and measurements
This section contains description of auxiliary commands that can be useful for simple calculations and manipulations needed when analyzing complex models.
@subsection occt_draw_12_1 Vector algebra commands
This section describes commands providing simple calculations with 2D and 3D vectors. The vector is represented by a TCL list of double values (coordinates). The commands get input vector coordinates from the command line as distinct values. So, if you have a vector stored in a variable you need to use *eval* command as a prefix, for example, to compute the magnitude of cross products of two vectors given by 3 points the following commands can be used:
~~~~~{.cpp}
Draw[10]> set vec1 [vec 12 28 99 12 58 99]
0 30 0
Draw[13]> set vec2 [vec 12 28 99 16 21 89]
4 -7 -10
Draw[14]> set cross [eval cross $vec1 $vec2]
-300 0 -120
Draw[15]> eval module $cross
323.10988842807024
~~~~~
@subsubsection occt_draw_12_1_1 vec
Syntax:
~~~~~
vec <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~
Returns coordinates of vector between two 3D points.
Example:
~~~~~{.cpp}
vec 1 2 3 6 5 4
~~~~~
@subsubsection occt_draw_12_1_2 2dvec
Syntax:
~~~~~
2dvec <x1> <y1> <x2> <y2>
~~~~~
Returns coordinates of vector between two 2D points.
Example:
~~~~~{.cpp}
2dvec 1 2 4 3
~~~~~
@subsubsection occt_draw_12_1_3 pln
Syntax:
~~~~~
pln <x1> <y1> <z1> <x2> <y2> <z2> <x3> <y3> <z3>
~~~~~
Returns plane built on three points. A plane is represented by 6 double values: coordinates of the origin point and the normal directoin.
Example:
~~~~~{.cpp}
pln 1 2 3 6 5 4 9 8 7
~~~~~
@subsubsection occt_draw_12_1_4 module
Syntax:
~~~~~
module <x> <y> <z>
~~~~~
Returns module of a vector.
Example:
~~~~~{.cpp}
module 1 2 3
~~~~~
@subsubsection occt_draw_12_1_5 2dmodule
Syntax:
~~~~~
2dmodule <x> <y>
~~~~~
Returns module of a 2D vector.
Example:
~~~~~{.cpp}
2dmodule 1 2
~~~~~
@subsubsection occt_draw_12_1_6 norm
Syntax:
~~~~~
norm <x> <y> <z>
~~~~~
Returns unified vector from a given 3D vector.
Example:
~~~~~{.cpp}
norm 1 2 3
~~~~~
@subsubsection occt_draw_12_1_7 2dnorm
Syntax:
~~~~~
2dnorm <x> <y>
~~~~~
Returns unified vector from a given 2D vector.
Example:
~~~~~{.cpp}
2dnorm 1 2
~~~~~
@subsubsection occt_draw_12_1_8 inverse
Syntax:
~~~~~
inverse <x> <y> <z>
~~~~~
Returns inversed 3D vector.
Example:
~~~~~{.cpp}
inverse 1 2 3
~~~~~
@subsubsection occt_draw_12_1_9 2dinverse
Syntax:
~~~~~
2dinverse <x> <y>
~~~~~
Returns inversed 2D vector.
Example:
~~~~~{.cpp}
2dinverse 1 2
~~~~~
@subsubsection occt_draw_12_1_10 2dort
Syntax:
~~~~~
2dort <x> <y>
~~~~~
Returns 2D vector rotated on 90 degrees.
Example:
~~~~~{.cpp}
2dort 1 2
~~~~~
@subsubsection occt_draw_12_1_11 distpp
Syntax:
~~~~~
distpp <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~
Returns distance between two 3D points.
Example:
~~~~~{.cpp}
distpp 1 2 3 4 5 6
~~~~~
@subsubsection occt_draw_12_1_12 2ddistpp
Syntax:
~~~~~
2ddistpp <x1> <y1> <x2> <y2>
~~~~~
Returns distance between two 2D points.
Example:
~~~~~{.cpp}
2ddistpp 1 2 3 4
~~~~~
@subsubsection occt_draw_12_1_13 distplp
Syntax:
~~~~~
distplp <x0> <y0> <z0> <nx> <ny> <nz> <xp> <yp> <zp>
~~~~~
Returns distance between plane defined by point and normal direction and another point.
Example:
~~~~~{.cpp}
distplp 0 0 0 0 0 1 5 6 7
~~~~~
@subsubsection occt_draw_12_1_14 distlp
Syntax:
~~~~~
distlp <x0> <y0> <z0> <dx> <dy> <dz> <xp> <yp> <zp>
~~~~~
Returns distance between 3D line defined by point and direction and another point.
Example:
~~~~~{.cpp}
distlp 0 0 0 1 0 0 5 6 7
~~~~~
@subsubsection occt_draw_12_1_15 2ddistlp
Syntax:
~~~~~
2ddistlp <x0> <y0> <dx> <dy> <xp> <yp>
~~~~~
Returns distance between 2D line defined by point and direction and another point.
Example:
~~~~~{.cpp}
2ddistlp 0 0 1 0 5 6
~~~~~
@subsubsection occt_draw_12_1_16 distppp
Syntax:
~~~~~
distppp <x1> <y1> <z1> <x2> <y2> <z2> <x3> <y3> <z3>
~~~~~
Returns deviation of point (x2,y2,z2) from segment defined by points (x1,y1,z1) and (x3,y3,z3).
Example:
~~~~~{.cpp}
distppp 0 0 0 1 1 0 2 0 0
~~~~~
@subsubsection occt_draw_12_1_17 2ddistppp
Syntax:
~~~~~
2ddistppp <x1> <y1> <x2> <y2> <x3> <y3>
~~~~~
Returns deviation of point (x2,y2) from segment defined by points (x1,y1) and (x3,y3). The result is a signed value. It is positive if the point (x2,y2) is on the left side of the segment, and negative otherwise.
Example:
~~~~~{.cpp}
2ddistppp 0 0 1 -1 2 0
~~~~~
@subsubsection occt_draw_12_1_18 barycen
Syntax:
~~~~~
barycen <x1> <y1> <z1> <x2> <y2> <z2> <par>
~~~~~
Returns point of a given parameter between two 3D points.
Example:
~~~~~{.cpp}
barycen 0 0 0 1 1 1 0.3
~~~~~
@subsubsection occt_draw_12_1_19 2dbarycen
Syntax:
~~~~~
2dbarycen <x1> <y1> <x2> <y2> <par>
~~~~~
Returns point of a given parameter between two 2D points.
Example:
~~~~~{.cpp}
2dbarycen 0 0 1 1 0.3
~~~~~
@subsubsection occt_draw_12_1_20 cross
Syntax:
~~~~~
cross <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~
Returns cross product of two 3D vectors.
Example:
~~~~~{.cpp}
cross 1 0 0 0 1 0
~~~~~
@subsubsection occt_draw_12_1_21 2dcross
Syntax:
~~~~~
2dcross <x1> <y1> <x2> <y2>
~~~~~
Returns cross product of two 2D vectors.
Example:
~~~~~{.cpp}
2dcross 1 0 0 1
~~~~~
@subsubsection occt_draw_12_1_22 dot
Syntax:
~~~~~
dot <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~
Returns scalar product of two 3D vectors.
Example:
~~~~~{.cpp}
dot 1 0 0 0 1 0
~~~~~
@subsubsection occt_draw_12_1_23 2ddot
Syntax:
~~~~~
2ddot <x1> <y1> <x2> <y2>
~~~~~
Returns scalar product of two 2D vectors.
Example:
~~~~~{.cpp}
2ddot 1 0 0 1
~~~~~
@subsubsection occt_draw_12_1_24 scale
Syntax:
~~~~~
scale <x> <y> <z> <factor>
~~~~~
Returns 3D vector multiplied by scalar.
Example:
~~~~~{.cpp}
scale 1 0 0 5
~~~~~
@subsubsection occt_draw_12_1_25 2dscale
Syntax:
~~~~~
2dscale <x> <y> <factor>
~~~~~
Returns 2D vector multiplied by scalar.
Example:
~~~~~{.cpp}
2dscale 1 0 5
~~~~~
@subsection occt_draw_12_2 Measurements commands
This section describes commands that make possible to provide measurements on a model.
@subsubsection occt_draw_12_2_1 pnt
Syntax:
~~~~~
pnt <object>
~~~~~
Returns coordinates of point in the given Draw variable. Object can be of type point or vertex. Actually this command is built up from the commands @ref occt_draw_7_2_1a "mkpoint" and @ref occt_draw_6_6_1 "coord".
Example:
~~~~~{.cpp}
vertex v 0 1 0
pnt v
~~~~~
@subsubsection occt_draw_12_2_2 pntc
Syntax:
~~~~~
pntc <curv> <par>
~~~~~
Returns coordinates of point on 3D curve with given parameter. Actually this command is based on the command @ref occt_draw_6_6_2 "cvalue".
Example:
~~~~~{.cpp}
circle c 0 0 0 10
pntc c [dval pi/2]
~~~~~
@subsubsection occt_draw_12_2_3 2dpntc
Syntax:
~~~~~
2dpntc <curv2d> <par>
~~~~~
Returns coordinates of point on 2D curve with given parameter. Actually this command is based on the command @ref occt_draw_6_6_2 "2dcvalue".
Example:
~~~~~{.cpp}
circle c 0 0 10
2dpntc c [dval pi/2]
~~~~~
@subsubsection occt_draw_12_2_4 pntsu
Syntax:
~~~~~
pntsu <surf> <u> <v>
~~~~~
Returns coordinates of point on surface with given parameters. Actually this command is based on the command @ref occt_draw_6_6_3 "svalue".
Example:
~~~~~{.cpp}
cylinder s 10
pntsu s [dval pi/2] 5
~~~~~
@subsubsection occt_draw_12_2_5 pntcons
Syntax:
~~~~~
pntcons <curv2d> <surf> <par>
~~~~~
Returns coordinates of point on surface defined by point on 2D curve with given parameter. Actually this command is based on the commands @ref occt_draw_6_6_2 "2dcvalue" and @ref occt_draw_6_6_3 "svalue".
Example:
~~~~~{.cpp}
line c 0 0 1 0
cylinder s 10
pntcons c s [dval pi/2]
~~~~~
@subsubsection occt_draw_12_2_6 drseg
Syntax:
~~~~~
drseg <name> <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~
Creates a linear segment between two 3D points. The new object is given the *name*. The object is drawn in the axonometric view.
Example:
~~~~~{.cpp}
drseg s 0 0 0 1 0 0
~~~~~
@subsubsection occt_draw_12_2_7 2ddrseg
Syntax:
~~~~~
2ddrseg <name> <x1> <y1> <x2> <y2>
~~~~~
Creates a linear segment between two 2D points. The new object is given the *name*. The object is drawn in the 2D view.
Example:
~~~~~{.cpp}
2ddrseg s 0 0 1 0
~~~~~
@subsubsection occt_draw_12_2_8 mpick
Syntax:
~~~~~
mpick
~~~~~
Prints in the console the coordinates of a point clicked by mouse in a view (axonometric or 2D). This command will wait for mouse click event in a view.
Example:
~~~~~{.cpp}
mpick
~~~~~
@subsubsection occt_draw_12_2_9 mdist
Syntax:
~~~~~
mdist
~~~~~
Prints in the console the distance between two points clicked by mouse in a view (axonometric or 2D). This command will wait for two mouse click events in a view.
Example:
~~~~~{.cpp}
mdist
~~~~~
@section occt_draw_11 Extending Test Harness with custom commands

View File

@@ -752,7 +752,7 @@ In order to actually convert signals to exceptions, macro *OCC_CATCH_SIGNALS* ne
@subsubsection occt_fcug_2_4_4 Implementation on various platforms.
The exception handling mechanism in Open CASCADE Technology is implemented in different ways depending on the preprocessor macro *OCC_CONVERT_SIGNALS*, which shall be consistently defined by compilation procedures for both Open CASCADE Technology and user applications:
The exception handling mechanism in Open CASCADE Technology is implemented in different ways depending on the preprocessor macros *NO_CXX_EXCEPTIONS* and *OCC_CONVERT_SIGNALS*, which shall be consistently defined by compilation procedures for both Open CASCADE Technology and user applications:
1. On Windows, these macros are not defined by default, and normal C++ exceptions are used in all cases, including throwing from signal handler. Thus the behavior is as expected in C++.
@@ -763,7 +763,18 @@ The exception handling mechanism in Open CASCADE Technology is implemented in d
* macro *OCC_CATCH_SIGNALS* is necessary (besides call to *OSD::SetSignal()* described above) for conversion of signals into exceptions;
* the destructors for automatic C++ objects created in the code after that macro and till the place where signal is raised will not be called in case of signal, since no C++ stack unwinding is performed by long jump.
In general, for writing platform-independent code it is recommended to insert macros *OCC_CATCH_SIGNALS* in try {} blocks or other code where signals may happen.
3. On Linux Open CASCADE Technology can also be compiled in compatibility mode. In that case macro *NO_CXX_EXCEPTIONS* is defined and the C++ exceptions are simulated with C long jumps. As a consequence, the behavior is slightly different from that expected in the C++ standard.
While exception handling with *NO_CXX_EXCEPTIONS* is very similar to C++ by syntax, it has a number of peculiarities that should be taken into account:
* try and catch are actually macros defined in the file *Standard_ErrorHandler.hxx*. Therefore, including this file is necessary for handling OCCT exceptions;
* due to being a macro, catch cannot contain a declaration of the exception object after its type; only type is allowed in the catch statement. Use method *Standard_Failure::Caught()* to access an exception object;
* catch macro may conflict with some STL classes that might use catch(...) statements in their header files. So STL headers should not be included after *Standard_ErrorHandler.hxx*;
* Open CASCADE Technology try/catch block will not handle normal C++ exceptions; however this can be achieved using special workarounds;
* the try macro defines a C++ object that holds an entry point in the exception handler. Therefore if exception is raised by code located immediately after the try/catch block but on the same nesting level as *try*, it may be handled by that *catch*. This may lead to unexpected behavior, including infinite loop. To avoid that, always surround the try/catch block with curved brackets;
* the destructors of C++ objects allocated on the stack after handler initialization are not called by exception raising.
In general, for writing platform-independent code it is recommended to insert macros *OCC_CATCH_SIGNALS* in try {} blocks or other code where signals may happen. For compatibility with previous versions of Open CASCADE Technology the limitations described above for *NO_CXX_EXCEPTIONS* shall be assumed.
@subsection occt_fcug_2_5 Plug-In Management
@@ -799,7 +810,7 @@ The *Load* method looks for the library name in the resource file or registry t
a148e300-5740-11d1-a904-080036aaa103.Location: libFWOSPlugin.so
~~~~~
Then the *Load* method loads the library according to the rules of the operating system of the host machine (for example, by using environment variables such as *LD_LIBRARY_PATH* with Unix and *PATH* with Windows). After that it invokes the *PLUGINFACTORY* method to return the object, which supports the required service.
Then the *Load* method loads the library according to the rules of the operating system of the host machine (for example, by using environment variables such as *LD_LIBRARY_PATH* with Unix and *PATH* with Windows). After that it invokes the *PLUGINFACTORY* method to return the object which supports the required service.
The client may then call the functions supported by this object.
#### C++ Client Plug-In Implementation
@@ -874,7 +885,7 @@ Handle(Standard_Transient) FAFactory::Factory (const Standard_GUID& theGUID)
PLUGIN(FAFactory)
~~~~~
Application might also instantiate a factory by linking to the library and calling *FAFactory::Factory()* directly.
Application might also instantiate a factory by linking to the library and calling FAFactory::Factory() directly.
@section occt_fcug_3 Collections, Strings, Quantities and Unit Conversion

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

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);
~~~~~
@@ -1066,120 +1066,6 @@ Handle(Geom2d_Curve) C2d = GeomAPI::To2d(C3d, Pln);
Handle(Geom_Curve) C3d = GeomAPI::To3d(C2d, Pln);
~~~~~
@section occt_modalg_2_topo_tools Topological Tools
Open CASCADE Technology topological tools provide algorithms to
* Create wires from edges;
* Create faces from wires;
* Compute state of the shape relatively other shape;
* Orient shapes in container;
* Create new shapes from the existing ones;
* Build PCurves of edges on the faces;
* Check the validity of the shapes;
* Take the point in the face;
* Get the normal direction for the face.
@subsection occt_modalg_2_topo_tools_1 Creation of the faces from wireframe model
It is possible to create the planar faces from the arbitrary set of planar edges randomly located in 3D space.
This feature might be useful if you need for instance to restore the shape from the wireframe model:
<table align="center">
<tr>
<td>@figure{/user_guides/modeling_algos/images/modeling_algos_image062.png, "Wireframe model"}</td>
<td>@figure{/user_guides/modeling_algos/images/modeling_algos_image063.png, "Faces of the model"}</td>
</tr>
</table>
To make the faces from edges it is, firstly, necessary to create planar wires from the given edges and than create planar faces from each wire.
The static methods *BOPAlgo_Tools::EdgesToWires* and *BOPAlgo_Tools::WiresToFaces* can be used for that:
~~~~~
TopoDS_Shape anEdges = ...; /* The input edges */
Standard_Real anAngTol = 1.e-8; /* The angular tolerance for distinguishing the planes in which the wires are located */
Standard_Boolean bShared = Standard_False; /* Defines whether the edges are shared or not */
//
TopoDS_Shape aWires; /* resulting wires */
Standard_Integer iErr = BOPAlgo_Tools::EdgesToWires(anEdges, aWires, bShared, anAngTol);
if (iErr) {
cout << "Error: Unable to build wires from given edges\n";
return;
}
//
TopoDS_Shape aFaces; /* resulting faces */
Standard_Boolean bDone = BOPAlgo_Tools::WiresToFaces(aWires, aFaces, anAngTol);
if (!bDone) {
cout << "Error: Unable to build faces from wires\n";
return;
}
~~~~~
These methods can also be used separately:
* *BOPAlgo_Tools::EdgesToWires* allows creating planar wires from edges.
The input edges may be not shared, but the output wires will be sharing the coinciding vertices and edges. For this the intersection of the edges is performed.
Although, it is possible to skip the intersection stage (if the input edges are already shared) by passing the corresponding flag into the method.
The input edges are expected to be planar, but the method does not check it. Thus, if the input edges are not planar, the output wires will also be not planar.
In general, the output wires are non-manifold and may contain free vertices, as well as multi-connected vertices.
* *BOPAlgo_Tools::WiresToFaces* allows creating planar faces from the planar wires.
In general, the input wires are non-manifold and may be not closed, but should share the coinciding parts.
The wires located in the same plane and completely included into other wires will create holes in the faces built from outer wires:
<table align="center">
<tr>
<td>@figure{/user_guides/modeling_algos/images/modeling_algos_image064.png, "Wireframe model"}</td>
<td>@figure{/user_guides/modeling_algos/images/modeling_algos_image065.png, "Two faces (red face has a hole)"}</td>
</tr>
</table>
@subsection occt_modalg_2_topo_tools_2 Classification of the shapes
The following methods allow classifying the different shapes relatively other shapes:
* The variety of the *BOPTools_AlgoTools::ComputState* methods classify the vertex/edge/face relatively solid;
* *BOPTools_AlgoTools::IsHole* classifies wire relatively face;
* *IntTools_Tools::ClassifyPointByFace* classifies point relatively face.
@subsection occt_modalg_2_topo_tools_3 Orientation of the shapes in the container
The following methods allow reorienting shapes in the containers:
* *BOPTools_AlgoTools::OrientEdgesOnWire* correctly orients edges on the wire;
* *BOPTools_AlgoTools::OrientFacesOnShell* correctly orients faces on the shell.
@subsection occt_modalg_2_topo_tools_4 Making new shapes
The following methods allow creating new shapes from the existing ones:
* The variety of the *BOPTools_AlgoTools::MakeNewVertex* creates the new vertices from other vertices and edges;
* *BOPTools_AlgoTools::MakeSplitEdge* splits the edge by the given parameters.
@subsection occt_modalg_2_topo_tools_5 Building PCurves
The following methods allow building PCurves of edges on faces:
* *BOPTools_AlgoTools::BuildPCurveForEdgeOnFace* computes PCurve for the edge on the face;
* *BOPTools_AlgoTools::BuildPCurveForEdgeOnPlane* and *BOPTools_AlgoTools::BuildPCurveForEdgesOnPlane* allow building PCurves for edges on the planar face;
* *BOPTools_AlgoTools::AttachExistingPCurve* takes PCurve on the face from one edge and attach this PCurve to other edge coinciding with the first one.
@subsection occt_modalg_2_topo_tools_6 Checking the validity of the shapes
The following methods allow checking the validity of the shapes:
* *BOPTools_AlgoTools::IsMicroEdge* detects the small edges;
* *BOPTools_AlgoTools::ComputeTolerance* computs the correct tolerance for the edge on the face;
* *BOPTools_AlgoTools::CorrectShapeTolerances* and *BOPTools_AlgoTools::CorrectTolerances* allows correcting the tolerances of the sub-shapes.
@subsection occt_modalg_2_topo_tools_7 Taking a point inside the face
The following methods allow taking a point located inside the face:
* The variety of the *BOPTools_AlgoTools3D::PointNearEdge* allows getting a point inside the face located near the edge;
* *BOPTools_AlgoTools3D::PointInFace* allows getting a point inside the face.
@subsection occt_modalg_2_topo_tools_8 Getting normal for the face
The following methods allow getting the normal direction for the face/surface:
* *BOPTools_AlgoTools3D::GetNormalToSurface* computes the normal direction for the surface in the given point defined by UV parameters;
* *BOPTools_AlgoTools3D::GetNormalToFaceOnEdge* computes the normal direction for the face in the point located on the edge of the face;
* *BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge* computes the normal direction for the face in the point located near the edge of the face.
@section occt_modalg_3a The Topology API
The Topology API of Open CASCADE Technology (**OCCT**) includes the following six packages:
@@ -2214,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 = ...;
@@ -2266,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.
@@ -2340,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.
@@ -2355,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).
@@ -3051,7 +2893,7 @@ The algorithm of shape triangulation is provided by the functionality of *BRepMe
~~~~~
const Standard_Real aRadius = 10.0;
const Standard_Real aHeight = 25.0;
BRepPrimAPI_MakeCylinder aCylinder(aRadius, aHeight);
BRepBuilderAPI_MakeCylinder aCylinder(aRadius, aHeight);
TopoDS_Shape aShape = aCylinder.Shape();
const Standard_Real aLinearDeflection = 0.01;
@@ -3082,4 +2924,4 @@ However, an application that imports models created in other applications may no
Meshing covers a shape with a triangular mesh. Other than hidden line removal, you can use meshing to transfer the shape to another tool: a manufacturing tool, a shading algorithm, a finite element algorithm, or a collision algorithm.
You can obtain information on the shape by first exploring it. To access triangulation of a face in the shape later, use *BRepTool::Triangulation*. To access a polygon, which is the approximation of an edge of the face, use *BRepTool::PolygonOnTriangulation*.
You can obtain information on the shape by first exploring it. To access triangulation of a face in the shape later, use *BRepTool::Triangulation*. To access a polygon, which is the approximation of an edge of the face, use *BRepTool::PolygonOnTriangulation*.

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 104 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 1.7 MiB

View File

@@ -415,18 +415,18 @@ These classes use the "Projection" criteria for optimization.
### Extrema between Curves
The *Geom2dAPI_ExtremaCurveCurve* class allows calculation of all minimal distances between two 2D geometric curves.
The *GeomAPI_ExtremaCurveCurve* class allows calculation of all minimal distances between two 3D geometric curves.
The *GeomAPI_ExtremaCurveCurve* class allows calculation of all minimal distances two 3D geometric curves.
These classes use Euclidean distance as the criteria for optimization.
### Extrema between Curve and Surface
The *GeomAPI_ExtremaCurveSurface* class allows calculation of one extrema between a 3D curve and a surface. Extrema are the lengths of the segments orthogonal to the curve and the surface.
This class uses the "Projection" criteria for optimization.
This class use the "Projection" criteria for optimization.
### Extrema between Surfaces
The *GeomAPI_ExtremaSurfaceSurface* class allows calculation of one minimal and one maximal distance between two surfaces.
This class uses Euclidean distance to compute the minimum, and "Projection" criteria to compute the maximum.
This class use Euclidean distance to compute minimum and "Projection" criteria to compute maximum.
@section occt_modat_2 2D Geometry
@@ -602,50 +602,6 @@ To check the concavity of a surface, proceed as follows:
1. Sample the surface and compute at each point the Gaussian curvature.
2. If the value of the curvature changes of sign, the surface is concave or convex depending on the point of view.
3. To compute a Gaussian curvature, use the class <i> SLprops</i> from <i> GeomLProp</i>, which instantiates the generic class <i> SLProps </i>from <i> LProp</i> and use the method <i> GaussianCurvature</i>.
@subsection occt_modat_4_2a Continuity of Curves and Surfaces
Types of supported continuities for curves and surfaces are described in *GeomAbs_Shape* enumeration.
In respect of curves, the following types of continuity are supported (see the figure below):
* C0 (*GeomAbs_C0*) - parametric continuity. It is the same as G0 (geometric continuity), so the last one is not represented by separate variable.
* G1 (*GeomAbs_G1*) - tangent vectors on left and on right are parallel.
* C1 (*GeomAbs_C1*) - indicates the continuity of the first derivative.
* G2 (*GeomAbs_G2*) - in addition to G1 continuity, the centers of curvature on left and on right are the same.
* C2 (*GeomAbs_C2*) - continuity of all derivatives till the second order.
* C3 (*GeomAbs_C3*) - continuity of all derivatives till the third order.
* CN (*GeomAbs_CN*) - continuity of all derivatives till the N-th order (infinite order of continuity).
*Note:* Geometric continuity (G1, G2) means that the curve can be reparametrized to have parametric (C1, C2) continuity.
@image html /user_guides/modeling_data/images/modeling_data_continuity_curves.svg "Continuity of Curves"
@image latex /user_guides/modeling_data/images/modeling_data_continuity_curves.svg "Continuity of Curves" width=\\textwidth
The following types of surface continuity are supported:
* C0 (*GeomAbs_C0*) - parametric continuity (the surface has no points or curves of discontinuity).
* G1 (*GeomAbs_G1*) - surface has single tangent plane in each point.
* C1 (*GeomAbs_C1*) - indicates the continuity of the first derivatives.
* G2 (*GeomAbs_G2*) - in addition to G1 continuity, principal curvatures and directions are continuous.
* C2 (*GeomAbs_C2*) - continuity of all derivatives till the second order.
* C3 (*GeomAbs_C3*) - continuity of all derivatives till the third order.
* CN (*GeomAbs_CN*) - continuity of all derivatives till the N-th order (infinite order of continuity).
@image html /user_guides/modeling_data/images/modeling_data_continuity_surfaces.svg "Continuity of Surfaces"
@image latex /user_guides/modeling_data/images/modeling_data_continuity_surfaces.svg "Continuity of Surfaces" width=\\textwidth
Against single surface, the connection of two surfaces (see the figure above) defines its continuity in each intersection point only. Smoothness of connection is a minimal value of continuities on the intersection curve.
@subsection occt_modat_4_2b Regularity of Shared Edges
Regularity of an edge is a smoothness of connection of two faces sharing this edge. In other words, regularity is a minimal continuity between connected faces in each point on edge.
Edge's regularity can be set by *BRep_Builder::Continuity* method. To get the regularity use *BRep_Tool::Continuity* method.
Some algorithms like @ref occt_modalg_6 "Fillet" set regularity of produced edges by their own algorithms. On the other hand, some other algorithms (like @ref occt_user_guides__boolean_operations "Boolean Operations", @ref occt_user_guides__shape_healing "Shape Healing", etc.) do not set regularity. If the regularity is needed to be set correctly on a shape, the method *BRepLib::EncodeRegularity* can be used. It calculates and sets correct values for all edges of the shape.
The regularity flag is extensively used by the following high level algorithms: @ref occt_modalg_6_1_2 "Chamfer", @ref occt_modalg_7_3 "Draft Angle", @ref occt_modalg_10 "Hidden Line Removal", @ref occt_modalg_9_2_3 "Gluer".
@subsection occt_modat_4_3 Global Properties of Shapes
@@ -1277,7 +1233,7 @@ Below is the auxiliary function, which copies the element of rank *i* from the m
For example, in the wire in the image we want to recuperate the edges in the order {e1, e2, e3,e4, e5} :
@image html /user_guides/modeling_data/images/modeling_data_image014.png "A wire composed of 6 edges."
@image latex /user_guides/modeling_data/images/modeling_data_image014.png "A wire composed of 6 edges."
@image latex /user_guides/modeling_data/images/modeling_data_image014.png "A wire composed of 6 edges.
*TopExp_Explorer*, however, recuperates the lines in any order.
@@ -1293,8 +1249,8 @@ For example, in the wire in the image we want to recuperate the edges in the ord
@subsection occt_modat_5_6 Storage of shapes
*BRepTools* and *BinTools* packages contain methods *Read* and *Write* allowing to read and write a Shape to/from a stream or a file.
The methods provided by *BRepTools* package use ASCII storage format; *BinTools* package uses binary format.
**BRepTools** and **BinTools** packages contain methods *Read* and *Write* allowing to read and write a Shape to/from a stream or a file.
The methods provided by **BRepTools** package use ASCII storage format; **BinTools** package use binary format.
Each of these methods has two arguments:
- a *TopoDS_Shape* object to be read/written;
- a stream object or a file name to read from/write to.

View File

@@ -625,7 +625,7 @@ app->NewDocument("NewDocumentFormat", doc);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here "NewDocumentFormat" is identifier of the format of your document.
OCCT defines several standard formats, distinguishing by a set of supported OCAF attributes, and method of encoding (e.g. binary data or XML), described below.
OCCT defines several standard formats, distinguishing by a set of OCAF attributes supported, and method of encoding (e.g. binary data or XML), described below.
If your application defines specific OCAF attributes, you need to define your own format for it.
@subsubsection occt_ocaf_4_2_3 Retrieving the application to which the document belongs
@@ -655,7 +655,7 @@ doc = TDocStd_Document::Get(label);
@subsubsection occt_ocaf_4_3_format Defining storage format
OCAF uses a customizable mechanism for storage of the documents.
OCAF uses customizable mechanism for storage of the documents.
In order to use OCAF persistence to save and read your documents to / from the file, you need to define one or several formats in your application.
For that, use method TDocStd_Application::DefineFormat(), for instance:
@@ -665,8 +665,8 @@ app->DefineFormat ("NewDocumentFormat", "New format for OCAF documents", "ndf",
new NewDocumentFormat_StorageDriver());
~~~~~
This example defines format "NewDocumentFormat" with a default file extension "ndf", and instantiates drivers for reading and storing documents from and to that format.
Either of the drivers can be null, in this case the corresponding action will not be supported for that format.
Here format "NewDocumentFormat" is defined, with default file extension "ndf", and drivers for reading and storing documents from and to that format are instantiated.
Either of the drivers can be null, in this case corresponding action will not be supported for that format.
OCAF provides several standard formats, each covering some set of OCAF attributes:
@@ -687,29 +687,28 @@ OCAF provides several standard formats, each covering some set of OCAF attribute
<tr><td>TObjXml </td><td> TKXmlTObj </td><td> TKLCAF + TKTObj </td></tr>
</table>
For convenience, these toolkits provide static methods *DefineFormat()* accepting handle to application.
For convenience, these toolkits provide static methods DefineFormat() accepting handle to application.
These methods allow defining corresponding formats easily, e.g.:
~~~~~
BinDrivers::DefineFormat (app); // define format "BinOcaf"
~~~~~
Use these toolkits as an example for implementation of persistence drivers for custom attributes, or new persistence formats.
Use these toolkits as example for implementation of persistence drivers for custom attributes, or new persistence formats.
The application can define several storage formats.
On save, the format specified in the document (see *TDocStd_Document::StorageFormat()*) will be used (save will fail if that format is not defined in the application).
On reading, the format identifier stored in the file is used and recorded in the document.
On save, the format specified in the document (see TDocStd_Document::StorageFormat()) will be used (it will fail if that format is not defined in the application).
On reading, format identifier stored in the file is used, and recorded in the document.
@subsubsection occt_ocaf_4_3_plugins Defining storage format by resource files
The alternative method to define formats is via usage of resource files.
This method was used in earlier versions of OCCT and is considered as deprecated since version 7.1.0.
Alternative (legacy, used in earlier versions of OCCT) method to define formats is via usage of resource files.
This method allows loading persistence drivers on demand, using plugin mechanism.
To use this method, create your own application class inheriting from *TDocStd_Application*, and override method *ResourcesName()*.
That method should return a string with a name of resource file, e.g. "NewDocumentFormat", which will contain a description of the format.
To use this method, create your own application class inheriting from *TDocStd_Application*, and override method ResourcesName().
That method should return a string with a name of resource file, e.g. "NewDocumentFormat", which will contain description of the format.
Then create that resource file and define the parameters of your format:
Then create that resource file and define parameters of your format:
~~~~~
ndf.FileFormat: NewDocumentFormat
@@ -719,10 +718,10 @@ NewDocumentFormat.StoragePlugin: bb5aa176-c65c-4c84-862e-6b7c1fe16921
NewDocumentFormat.RetrievalPlugin: 76fb4c04-ea9a-46aa-88a2-25f6a228d902
~~~~~
The GUIDs should be unique and correspond to the GUIDs supported by relevant plugin.
You can use an existing plugins (see the table above) or create your own.
Here GUIDs should be unique and correspond to the GUIDs supported by relevant plugin.
You can use either one of existing plugins (see the table above) or create your own.
Finally, make a copy of the resource file "Plugin" from *$CASROOT/src/StdResource* and, if necessary, add the definition of your plugin in it, for instance:
Finally, make a copy of the resource file "Plugin" from $CASROOT/src/StdResource, and, if necessary, add definition of your plugin in it, for instance:
~~~~~
bb5aa176-c65c-4c84-862e-6b7c1fe16921.Location: TKNewFormat
@@ -739,7 +738,7 @@ setenv CSF_NewFormatDefaults MyApplicationPath/MyResources
@subsubsection occt_ocaf_4_3_3 Saving a document
To save the document, make sure that its parameter *StorageFormat()* corresponds to one of the formats defined in the application, and use method *TDocStd_Application::SaveAs*, for instance:
To save the document, make sure that its parameter StorageFormat() corresponds to one of formats defined in the application, and use method *TDocStd_Application::SaveAs*, for instance:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
app->SaveAs(doc, "/tmp/example.caf");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -614,7 +614,7 @@ The set of sensitive primitives, which correspond to a given mode, is stocked in
Each selection mode is identified by an index. By convention, the default selection mode that allows us to grasp the interactive object in its entirety is mode *0*. However, it can be modified in the custom interactive objects using method <i>SelectMgr_SelectableObject::setGlobalSelMode()</i>.
The calculation of selection primitives (or sensitive entities) is done in a virtual function *ComputeSelection*. It should be implemented for each type of interactive object that is assumed to have different selection modes using the function *AIS_InteractiveObject::ComputeSelection*.
The calculation of selection primitives (or sensitive entities) is done by the intermediary of a virtual function, *ComputeSelection*. It should be implemented for each type of interactive object that is assumed to have different selection modes using the function *AIS_ConnectedInteractive::ComputeSelection*.
A detailed explanation of the mechanism and the manner of implementing this function has been given in @ref occt_visu_2_2 "Selection" chapter.
@@ -746,95 +746,6 @@ Standard_Boolean AIS_InteractiveContext::HasPolygonOffsets
(const Handle(AIS_InteractiveObject) &anObj)
~~~~~
@subsubsection occt_visu_3_2_7 Object hierarchy
Each *PrsMgr_PresentableObject* has a list of objects called *myChildren*.
Any transformation of *PrsMgr_PresentableObject* is also applied to its children. This hierarchy does not propagate to *Graphic3d* level and below.
*PrsMgr_PresentableObject* sends its combined (according to the hierarchy) transformation down to *Graphic3d_Structure*.
The materials of structures are not affected by the hierarchy.
Object hierarchy can be controlled by the following API calls:
* *PrsMgr_PresentableObject::AddChild*;
* *PrsMgr_PresentableObject::RemoveChild*.
@subsubsection occt_visu_3_2_8 Instancing
The conception of instancing operates the object hierarchy as follows:
* Instances are represented by separated *AIS* objects.
* Instances do not compute any presentations.
Classes *AIS_ConnectedInteractive* and *AIS_MultipleConnectedInteractive* are used to implement this conception.
*AIS_ConnectedInteractive* is an object instance, which reuses the geometry of the connected object but has its own transformation, material, visibility flag, etc. This connection is propagated down to *OpenGl* level, namely to *OpenGl_Structure*. *OpenGl_Structure* can be connected only to a single other structure.
*AIS_ConnectedInteractive* can be referenced to any *AIS_Interactive* object in general. When it is referenced to another *AIS_ConnectedInteractive*, it just copies the reference.
*AIS_MultipleConnectedInteractive* represents an assembly, which does not have its own presentation. The assemblies are able to participate in the object hierarchy and are intended to handle a grouped set of instanced objects. It behaves as a single object in terms of selection. It applies high level transformation to all sub-elements since it is located above in the hierarchy.
All *AIS_MultipleConnectedInteractive* are able to have child assemblies. Deep copy of object instances tree is performed if one assembly is attached to another.
Note that *AIS_ConnectedInteractive* cannot reference *AIS_MultipleConnectedInteractive*. *AIS_ConnectedInteractive* copies sensitive entities of the origin object for selection, unlike *AIS_MultipleConnectedInteractive* that re-uses the entities of the origin object.
Instances can be controlled by the following DRAW commands:
* *vconnect* : Creates and displays *AIS_MultipleConnectedInteractive* object from input objects and location.
* *vconnectto* : Makes an instance of object with the given position.
* *vdisconnect* : Disconnects all objects from an assembly or disconnects an object by name or number.
* *vaddconnected* : Adds an object to the assembly.
* *vlistconnected* : Lists objects in the assembly.
Have a look at the examples below:
~~~~~
pload ALL
vinit
psphere s 1
vdisplay s
vconnectto s2 3 0 0 s # make instance
vfit
~~~~~
See how proxy *OpenGl_Structure* is used to represent instance:
@figure{/user_guides/visualization/images/visualization_image029.png}
The original object does not have to be displayed in order to make instance. Also selection handles transformations of instances correctly:
~~~~~
pload ALL
vinit
psphere s 1
psphere p 0.5
vdisplay s # p is not displayed
vsetloc s -2 0 0
vconnect x 3 0 0 s p # make assembly
vfit
~~~~~
@figure{/user_guides/visualization/images/visualization_image030.png}
Here is the example of a more complex hierarchy involving sub-assemblies:
~~~~~
pload ALL
vinit
box b 1 1 1
psphere s 0.5
vdisplay b s
vsetlocation s 0 2.5 0
box d 0.5 0.5 3
box d2 0.5 3 0.5
vdisplay d d2
vconnectto b1 -2 0 0 b
vconnect z 2 0 0 b s
vconnect z2 4 0 0 d d2
vconnect z3 6 0 0 z z2
vfit
~~~~~
@subsection occt_visu_3_3 Interactive Context
@subsubsection occt_visu_3_3_1 Rules
@@ -1363,7 +1274,7 @@ when you activate one of modes: 1 2 3 4, you pick AIS objects of type:
* mode 1 : selection of the origin of the trihedron;
* mode 2 : selection of the axes -- same remarks as for the Trihedron.
For the presentation of planes and trihedra, the default length unit is millimeter and the default value for the representation of axes is 10. To modify these dimensions, you must temporarily recover the object **Drawer**. From it, take the *DatumAspect()* and change the value *FirstAxisLength*. Finally, recalculate the presentation.
For the presentation of planes and trihedra, the default unit of length is millimeter, and the default value for the representation of axes is 100. If you modify these dimensions, you must temporarily recover the object **Drawer**. From it, take the *Aspects* in which the values for length are stored (*PlaneAspect* for the plane, *FirstAxisAspect* for trihedra), and change these values inside these Aspects. Finally, recalculate the presentation.
@subsubsection occt_visu_3_5_2 Object
@@ -1385,7 +1296,9 @@ And at maximum seven selection modes, depending on the shape complexity:
* *AIS_Triangulation* is a simple interactive object for displaying triangular mesh contained in *Poly_Triangulation* container.
* *AIS_ConnectedInteractive* is an Interactive Object connecting to another interactive object reference, and located elsewhere in the viewer makes it possible not to calculate presentation and selection, but to deduce them from your object reference.
* *AIS_ConnectedShape* is an object connected to interactive objects having a shape; this class has the same decompositions as *AIS_Shape*. Furthermore, it allows a presentation of hidden parts, which are calculated automatically from the shape of its reference.
* *AIS_MultipleConnectedInteractive* is an object connected to a list of interactive objects (which can also be Connected objects. It does not require memory hungry calculations of presentation)
* *AIS_MultipleConnectedShape* is an interactive Object connected to a list of interactive objects having a Shape <i>(AIS_Shape, AIS_ConnectedShape, AIS_MultipleConnectedShape)</i>. The presentation of hidden parts is calculated automatically.
* *AIS_TexturedShape* is an Interactive Object that supports texture mapping. It is constructed as a usual AIS_Shape, but has additional methods that allow to map a texture on it.
* *MeshVS_Mesh* is an Interactive Object that represents meshes, it has a data source that provides geometrical information (nodes, elements) and can be built up from the source data with a custom presentation builder.
@@ -1945,51 +1858,63 @@ The *V3d* package is basically a set of tools directed by commands from the vie
@subsubsection occt_visu_4_4_2 A programming example
This sample TEST program for the *V3d* Package uses primary packages *Xw* and *Graphic3d* and secondary packages *Visual3d, Aspect, Quantity* and *math*.
This sample TEST program for the *V3d* Package uses primary packages *Xw* and *Graphic3d* and secondary packages *Visual3d, Aspect, Quantity, Phigs* and *math*.
~~~~~
// Create a default display connection
Handle(Aspect_DisplayConnection) aDispConnection = new Aspect_DisplayConnection();
//Create a default display connection
Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection();
// Create a Graphic Driver from the default Aspect_DisplayConnection
Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver (aDispConnection);
//Create a Graphic Driver from the default Aspect_DisplayConnection
Handle(OpenGl_GraphicDriver) GD = new OpenGl_GraphicDriver (aDisplayConnection);
// Create a Viewer to this Driver
Handle(V3d_Viewer) VM = new V3d_Viewer (aGraphicDriver);
VM->SetDefaultBackgroundColor (Quantity_NOC_DARKVIOLET);
VM->SetDefaultViewProj (V3d_Xpos);
// Create a structure in this Viewer
Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (VM->Viewer());
//Create a Viewer to this Driver
Handle(V3d_Viewer) VM = new V3d_Viewer(GD, 400.,
// Space size
V3d_Xpos,
// Default projection
Quantity_NOC_DARKVIOLET,
// Default background
V3d_ZBUFFER,
// Type of visualization
V3d_GOURAUD,
// Shading model
V3d_WAIT);
// Update mode
// Create a structure in this Viewer
Handle(Graphic3d_Structure) S = new Graphic3d_Structure(VM->Viewer()) ;
// Type of structure
aStruct->SetVisual (Graphic3d_TOS_SHADING);
// Type of structure
S->SetVisual (Graphic3d_TOS_SHADING);
// Create a group of primitives in this structure
Handle(Graphic3d_Group) aPrsGroup = new Graphic3d_Group (aStruct);
Handle(Graphic3d_Group) G = new Graphic3d_Group(S) ;
// Fill this group with one quad of size 100
Handle(Graphic3d_ArrayOfTriangleStrips) aTriangles = new Graphic3d_ArrayOfTriangleStrips (4);
aTriangles->AddVertex (-100./2., -100./2., 0.0);
aTriangles->AddVertex (-100./2., 100./2., 0.0);
aTriangles->AddVertex ( 100./2., -100./2., 0.0);
aTriangles->AddVertex ( 100./2., 100./2., 0.0);
aPrsGroup->Polygon (aTriangles);
// Fill this group with one polygon of size 100
Graphic3d_Array1OfVertex Points(0,3) ;
Points(0).SetCoord(-100./2.,-100./2.,-100./2.) ;
Points(1).SetCoord(-100./2., 100./2.,-100./2.) ;
Points(2).SetCoord( 100./2., 100./2.,-100./2.) ;
Points(3).SetCoord( 100./2.,-100./2.,-100./2.) ;
Normal.SetCoord(0.,0.,1.) ;
G->Polygon(Points,Normal) ;
// Create Ambient and Infinite Lights in this Viewer
Handle(V3d_AmbientLight) aLight1 = new V3d_AmbientLight (VM, Quantity_NOC_GRAY50);
Handle(V3d_DirectionalLight) aLight2 = new V3d_DirectionalLight (VM, V3d_XnegYnegZneg, Quantity_NOC_WHITE);
Handle(V3d_AmbientLight) L1 = new V3d_AmbientLight
(VM,Quantity_NOC_GRAY50) ;
Handle(V3d_DirectionalLight) L2 = new V3d_DirectionalLight
(VM,V3d_XnegYnegZneg,Quantity_NOC_WHITE) ;
// Create a 3D quality Window with the same DisplayConnection
Handle(Xw_Window) aWindow = new Xw_Window (aDispConnection, "Test V3d", 0.5, 0.5, 0.5, 0.5);
Handle(Xw_Window) W = new Xw_Window(aDisplayConnection,"Test V3d",0.5,0.5,0.5,0.5) ;
// Map this Window to this screen
aWindow->Map();
// Map this Window to this screen
W->Map() ;
// Create a Perspective View in this Viewer
Handle(V3d_View) aView = new V3d_View (VM);
Handle(V3d_View) aView = new V3d_View(VM);
aView->Camera()->SetProjectionType (Graphic3d_Camera::Projection_Perspective);
// Associate this View with the Window
aView ->SetWindow (aWindow);
aView ->SetWindow(W);
// Display ALL structures in this View
VM->Viewer()->Display();
// Finally update the Visualization in this View
@@ -2479,58 +2404,19 @@ For each z-layer, it is allowed to:
* Enable / disable depth buffer clearing.
* Enable / disable polygon offset.
You can get the options using getter from *Visual3d_ViewManager* and *V3d_Viewer*. It returns *Graphic3d_ZLayerSettings* for a given *LayerId*.
The corresponding method *SetZLayerOption (...)* is available in *Graphic3d_GraphicDriver* interface. You can get the options using getter from *Visual3d_ViewManager* and *V3d_Viewer*. It returns *Graphic3d_ZLayerSettings* cached in *Visual3d_ViewManager* for a given *LayerId*.
Example:
~~~~~
// change z-layer settings
Graphic3d_ZLayerSettings aSettings = aViewer->ZLayerSettings (anId);
aSettings.SetEnableDepthTest (Standard_True);
aSettings.SetEnableDepthWrite(Standard_True);
aSettings.SetClearDepth (Standard_True);
aSettings.SetPolygonOffset (Graphic3d_PolygonOffset());
aSettings.EnableSetting (Graphic3d_ZLayerDepthTest);
aSettings.EnableSetting (Graphic3d_ZLayerDepthWrite);
aSettings.EnableSetting (Graphic3d_ZLayerDepthClear);
aSettings.EnableSetting (Graphic3d_ZLayerDepthOffset);
aViewer->SetZLayerSettings (anId, aSettings);
~~~~~
Another application for Z-Layer feature is treating visual precision issues when displaying objects far from the World Center.
The key problem with such objects is that visualization data is stored and manipulated with single precision floating-point numbers (32-bit).
Single precision 32-bit floating-point numbers give only 6-9 significant decimal digits precision,
while double precision 64-bit numbers give 15-17 significant decimal digits precision, which is sufficient enough for most applications.
When moving an Object far from the World Center, float number steadily eats precision.
The camera Eye position adds leading decimal digits to the overall Object transformation, which discards smaller digits due to floating point number nature.
For example, the object of size 0.0000123 moved to position 1000 has result transformation 1000.0000123,
which overflows single precision floating point - considering the most optimistic scenario of 9 significant digits (but it is really not this case), the result number will be 1000.00001.
This imprecision results in visual artifacts of two kinds in the 3D Viewer:
* Overall per-vertex Object distortion.
This happens when each vertex position has been defined within World Coordinate system.
* The object itself is not distorted, but its position in the World is unstable and imprecise - the object jumps during camera manipulations.
This happens when vertices have been defined within Local Coordinate system at the distance small enough to keep precision within single precision float,
however Local Transformation applied to the Object is corrupted due to single precision float.
The first issue cannot be handled without switching the entire presentation into double precision (for each vertex position).
However, visualization hardware is much faster using single precision float number rather than double precision - so this is not an option in most cases.
The second issue, however, can be negated by applying special rendering tricks.
So, to apply this feature in OCCT, the application :
* Defines Local Transformation for each object to fit the presentation data into single precision float without distortion.
* Spatially splits the world into smaller areas/cells where single precision float will be sufficient.
The size of such cell might vary and depends on the precision required by application (e.g. how much user is able to zoom in camera within application).
* Defines a Z-Layer for each spatial cell containing any object.
* Defines the Local Origin property of the Z-Layer according to the center of the cell.
~~~~~
Graphic3d_ZLayerSettings aSettings = aViewer->ZLayerSettings (anId);
aSettings.SetLocalOrigin (400.0, 0.0, 0.0);
~~~~~
* Assigns a presentable object to the nearest Z-Layer.
Note that Local Origin of the Layer is used only for rendering - everything outside will be still defined in the World Coordinate System,
including Local Transformation of the Object and Detection results.
E.g., while moving the presentation between Z-layers with different Local Origins, the Object will stay at the same place - only visualization quality will vary.
@subsubsection occt_visu_4_4_16 Clipping planes

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

@@ -32,7 +32,17 @@ $(ASSETDIR)/XSMessage: $(ASSETDIR)
-mkdir -p $(ASSETDIR)/XSMessage
cp -f -r $(OCCT_ROOT)/src/XSMessage/*.* $(ASSETDIR)/XSMessage
pre_all: $(ASSETDIR)/Shaders $(ASSETDIR)/SHMessage $(ASSETDIR)/XSMessage
$(ASSETDIR)/TObj: $(ASSETDIR)
-mkdir -p $(ASSETDIR)
-mkdir -p $(ASSETDIR)/TObj
cp -f -r $(OCCT_ROOT)/src/TObj/*.msg $(ASSETDIR)/TObj
$(ASSETDIR)/UnitsAPI: $(ASSETDIR)
-mkdir -p $(ASSETDIR)
-mkdir -p $(ASSETDIR)/UnitsAPI
cp -f -r $(OCCT_ROOT)/src/UnitsAPI/*.dat $(ASSETDIR)/UnitsAPI
pre_all: $(ASSETDIR)/Shaders $(ASSETDIR)/SHMessage $(ASSETDIR)/XSMessage $(ASSETDIR)/TObj $(ASSETDIR)/UnitsAPI
jniall: pre_all all

View File

@@ -110,6 +110,9 @@ OcctJni_Viewer::OcctJni_Viewer()
// prepare necessary environment
TCollection_AsciiString aResRoot = "/data/data/com.opencascade.jnisample/files";
setResourceEnv ("CSF_TObjMessage", aResRoot + "/TObj", "TObj.msg", Standard_False);
setResourceEnv ("CSF_UnitsLexicon", aResRoot + "/UnitsAPI", "Lexi_Expr.dat", Standard_True);
setResourceEnv ("CSF_UnitsDefinition", aResRoot + "/UnitsAPI", "Units.dat", Standard_True);
setResourceEnv ("CSF_ShadersDirectory", aResRoot + "/Shaders", "Declarations.glsl", Standard_False);
setResourceEnv ("CSF_XSMessage", aResRoot + "/XSMessage", "XSTEP.us", Standard_False);
setResourceEnv ("CSF_SHMessage", aResRoot + "/XSMessage", "SHAPE.us", Standard_False);
@@ -117,6 +120,9 @@ OcctJni_Viewer::OcctJni_Viewer()
// make sure OCCT loads the dictionary
//UnitsAPI::SetLocalSystem (UnitsAPI_SI);
// load messages for TObj
Message_MsgFile::LoadFromEnv ("CSF_TObjMessage", "TObj", "msg");
}
// =======================================================================

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

@@ -32,11 +32,13 @@ set (Geometry_ISESSION2D_HEADER_FILES ${Geometry_ISESSION2D_DIR}/ISession_Curve.
${Geometry_ISESSION2D_DIR}/ISession_Direction.h
${Geometry_ISESSION2D_DIR}/ISession_Point.h
${Geometry_ISESSION2D_DIR}/ISession_Surface.h
${Geometry_ISESSION2D_DIR}/ISession_Text.h
${Geometry_ISESSION2D_DIR}/ISession2D_Curve.h)
set (Geometry_ISESSION2D_SOURCE_FILES ${Geometry_ISESSION2D_DIR}/ISession_Curve.cpp
${Geometry_ISESSION2D_DIR}/ISession_Direction.cpp
${Geometry_ISESSION2D_DIR}/ISession_Point.cpp
${Geometry_ISESSION2D_DIR}/ISession_Surface.cpp
${Geometry_ISESSION2D_DIR}/ISession_Text.cpp
${Geometry_ISESSION2D_DIR}/ISession2D_Curve.cpp)
set (Geometry_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/01_Geometry/res)
@@ -68,14 +70,14 @@ add_executable (Geometry WIN32 ${Geometry_SOURCE_FILES}
set_property(TARGET Geometry PROPERTY FOLDER Samples)
if (SINGLE_GENERATOR)
install (TARGETS Geometry DESTINATION "${INSTALL_DIR_BIN}")
install (TARGETS Geometry DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
else()
install (TARGETS Geometry
CONFIGURATIONS Release RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
install (TARGETS Geometry
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}d")
endif()
include_directories (${CMAKE_BINARY_DIR}/inc

View File

@@ -529,6 +529,24 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\..\src\ISession2D\ISession_Text.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</BrowseInformation>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\res\Geometry.rc">
@@ -556,6 +574,7 @@
<ClInclude Include="..\..\..\src\ISession2D\ISession_Direction.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Point.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Surface.h" />
<ClInclude Include="..\..\..\src\ISession2D\ISession_Text.h" />
<ClInclude Include="..\..\..\src\MainFrm.h" />
<ClInclude Include="..\..\..\res\resource.h" />
<ClInclude Include="..\..\..\src\StdAfx.h" />

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