mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-02 17:46:22 +03:00
0024331: CMake scripts improvements
prefix '3RDPARTY' from variables that trigger use of 3rd-party products removed help strings associated with CMake variables revised identification of Tcl8.6 libraries enables invariable cmake files moved from wok to adm/templates folder RELWITHDEBINFO build configuration added BUILD_TYPE variable was renamed in BUILD_CONFIGURATION copy just TObj/TObj.msg instead of TObj folder Option /fp:precise for Visual Studio projects set Update of documentation for building with CMake; three warnings appeared in VS projects built by CMake corrected
This commit is contained in:
parent
01eaf6549b
commit
ad211ad33b
1
.gitignore
vendored
1
.gitignore
vendored
@ -42,7 +42,6 @@ Release
|
||||
*~
|
||||
|
||||
#Generated files
|
||||
*.in
|
||||
/*.am
|
||||
/*.m4
|
||||
/*.ac
|
||||
|
203
CMakeLists.txt
203
CMakeLists.txt
@ -1,19 +1,19 @@
|
||||
cmake_minimum_required ( VERSION 2.6)
|
||||
|
||||
if (NOT BUILD_TYPE)
|
||||
set(BUILD_TYPE "Release" CACHE STRING "Build type of the OCCT" FORCE)
|
||||
SET_PROPERTY(CACHE BUILD_TYPE PROPERTY STRINGS Release Debug)
|
||||
if (NOT BUILD_CONFIGURATION)
|
||||
set(BUILD_CONFIGURATION "Release" CACHE STRING "Build type of OCCT" FORCE)
|
||||
SET_PROPERTY(CACHE BUILD_CONFIGURATION PROPERTY STRINGS Release Debug RelWithDebInfo)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES ${BUILD_TYPE} CACHE INTERNAL "" FORCE)
|
||||
set(CMAKE_CONFIGURATION_TYPES ${BUILD_CONFIGURATION} CACHE INTERNAL "" FORCE)
|
||||
|
||||
project(OCCT)
|
||||
|
||||
set_property(GLOBAL PROPERTY 3RDPARTY_USE_FOLDERS ON)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
|
||||
IF("${BUILD_TYPE}" STREQUAL "${CMAKE_BUILD_TYPE}")
|
||||
IF("${BUILD_CONFIGURATION}" STREQUAL "${CMAKE_BUILD_TYPE}")
|
||||
SET(CHANGES_ARE_NEEDED OFF)
|
||||
ELSE()
|
||||
SET(CHANGES_ARE_NEEDED ON)
|
||||
@ -21,12 +21,12 @@ ENDIF()
|
||||
|
||||
MATH(EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
|
||||
|
||||
SET( CMAKE_BUILD_TYPE ${BUILD_TYPE} CACHE INTERNAL "Build type of the OCCT" FORCE )
|
||||
SET( CMAKE_BUILD_TYPE ${BUILD_CONFIGURATION} CACHE INTERNAL "Build type of OCCT" FORCE )
|
||||
|
||||
SET( INSTALL_DIR "" CACHE PATH "Directory contains install files of the OCCT" )
|
||||
SET( INSTALL_DIR "" CACHE PATH "Directory that will contain install files of OCCT" )
|
||||
SET( CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
|
||||
|
||||
set (BUILD_TOOLKITS "" CACHE STRING "Toolkits are included in OCCT")
|
||||
set (BUILD_TOOLKITS "" CACHE STRING "Toolkits are also included in OCCT")
|
||||
separate_arguments(BUILD_TOOLKITS)
|
||||
|
||||
include(adm/cmake/CMakeModules.txt)
|
||||
@ -37,6 +37,10 @@ else()
|
||||
set(SCRIPT_EXT sh)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(/fp:precise)
|
||||
endif()
|
||||
|
||||
# set compiler short name and choose SSE2 option for appropriate MSVC compilers
|
||||
if (DEFINED MSVC70)
|
||||
SET(COMPILER vc7)
|
||||
@ -117,14 +121,14 @@ install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/SHMessage" DESTINATION "${INSTALL_DI
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/Textures" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/Shaders" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XSMessage" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/TObj" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XSTEPResource" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XmlOcafResource" DESTINATION "${INSTALL_DIR}/src" )
|
||||
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Lexi_Expr.dat" DESTINATION "${INSTALL_DIR}/src/UnitsAPI" )
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Units.dat" DESTINATION "${INSTALL_DIR}/src/UnitsAPI" )
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src/TObj/TObj.msg" DESTINATION "${INSTALL_DIR}/src/TObj" )
|
||||
|
||||
IF("${BUILD_TYPE}" STREQUAL "Release")
|
||||
IF("${BUILD_CONFIGURATION}" STREQUAL "Release")
|
||||
SET(BUILD_SUFFIX "")
|
||||
ELSE()
|
||||
SET(BUILD_SUFFIX "") # debug == release
|
||||
@ -195,13 +199,13 @@ SET(3RDPARTY_INCLUDE_DIRS "")
|
||||
SET(3RDPARTY_NOT_INCLUDED)
|
||||
|
||||
IF(APPLE)
|
||||
SET(3RDPARTY_USE_GLX OFF CACHE BOOL "whether use X11 OpenGL on OSX or not")
|
||||
SET(USE_GLX OFF CACHE BOOL "whether use X11 OpenGL on OSX or not")
|
||||
ENDIF()
|
||||
|
||||
SET(3RDPARTY_USE_GL2PS OFF CACHE BOOL "whether use gl2ps product or not")
|
||||
SET(3RDPARTY_USE_FREEIMAGE OFF CACHE BOOL "whether use freeimage product or not")
|
||||
SET(3RDPARTY_USE_TBB OFF CACHE BOOL "whether use tbb product or not")
|
||||
SET(3RDPARTY_USE_OPENCL OFF CACHE BOOL "whether use OpenCL or not")
|
||||
SET(USE_GL2PS OFF CACHE BOOL "whether use gl2ps product or not")
|
||||
SET(USE_FREEIMAGE OFF CACHE BOOL "whether use freeimage product or not")
|
||||
SET(USE_TBB OFF CACHE BOOL "whether use tbb product or not")
|
||||
SET(USE_OPENCL OFF CACHE BOOL "whether use OpenCL or not")
|
||||
|
||||
SET(INSTALL_TESTS OFF CACHE BOOL "Is tests copy to install directory")
|
||||
|
||||
@ -228,12 +232,12 @@ MACRO(THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME)
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Directory contains library of the ${PRODUCT_NAME} product" FORCE)
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of the ${PRODUCT_NAME} product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME} PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/lib" NO_DEFAULT_PATH)
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_${PRODUCT_NAME}_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_DLL}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Directory contains shared library of the ${PRODUCT_NAME} product" FORCE)
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of the ${PRODUCT_NAME} product" FORCE)
|
||||
FIND_FILE(3RDPARTY_${PRODUCT_NAME}_DLL "${DLL_SO_PREFIX}${LIBRARY_NAME}.${DLL_SO}" PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/${DLL_SO_FOLDER}" NO_DEFAULT_PATH)
|
||||
ENDIF()
|
||||
|
||||
@ -288,28 +292,37 @@ MACRO(THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME)
|
||||
ENDMACRO()
|
||||
|
||||
# TCL
|
||||
INCLUDE(adm/templates/tcl.cmake)
|
||||
|
||||
#tcl85 - win; tcl8.5 - lin
|
||||
IF(WIN32)
|
||||
SET(TCL_SEP "")
|
||||
ELSE()
|
||||
SET(TCL_SEP ".")
|
||||
ENDIF()
|
||||
|
||||
THIRDPARTY_PRODUCT("TCL" "tcl.h" "tcl8${TCL_SEP}5")
|
||||
|
||||
#install tk and libs
|
||||
#install tcltk
|
||||
IF(INSTALL_TCL)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TK_LIB_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TK_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_LIB_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
|
||||
|
||||
INSTALL(FILES "${3RDPARTY_TK_DLL_DIR}/${DLL_SO_PREFIX}tk8${TCL_SEP}5.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
|
||||
INSTALL(DIRECTORY "${3RDPARTY_TK_LIB_DIR}/tcl8.5" DESTINATION "${INSTALL_DIR}/lib")
|
||||
INSTALL(DIRECTORY "${3RDPARTY_TK_LIB_DIR}/tk8.5" DESTINATION "${INSTALL_DIR}/lib")
|
||||
IF (IS_TCL_VERSION_FOUND)
|
||||
SET (TCL_VERSION ${TCL_MAJOR_VERSION}${TCL_SEP}${TCL_MINOR_VERSION})
|
||||
SET (TCL_FOLDER_VERSION ${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION})
|
||||
ELSE()
|
||||
SET (TCL_VERSION "")
|
||||
|
||||
#TODO SEARCH tclX.X & tkX.X subdirs
|
||||
SET (TCL_FOLDER_VERSION "")
|
||||
ENDIF()
|
||||
|
||||
INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR}/${DLL_SO_PREFIX}tcl${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
|
||||
INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR}/${DLL_SO_PREFIX}tk${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
|
||||
|
||||
IF (IS_TCL_VERSION_FOUND)
|
||||
INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR}/tcl${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/lib")
|
||||
INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR}/tk${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/lib")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "\nWarning: tclX.X and tkX.X subdirs won't be copyied during the installation process.")
|
||||
MESSAGE(STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# GLX
|
||||
IF(3RDPARTY_USE_GLX)
|
||||
IF(USE_GLX)
|
||||
ADD_DEFINITIONS(-DMACOSX_USE_GLX)
|
||||
|
||||
IF(NOT DEFINED 3RDPARTY_GLX_DIR)
|
||||
@ -349,7 +362,7 @@ ELSEIF(EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR}/freetype2/")
|
||||
ENDIF()
|
||||
|
||||
# FREEIMAGE
|
||||
IF(3RDPARTY_USE_FREEIMAGE)
|
||||
IF(USE_FREEIMAGE)
|
||||
ADD_DEFINITIONS(-DHAVE_FREEIMAGE)
|
||||
|
||||
THIRDPARTY_PRODUCT("FREEIMAGE" "FreeImage.h" "freeimage${BUILD_SUFFIX}")
|
||||
@ -365,13 +378,13 @@ IF(3RDPARTY_USE_FREEIMAGE)
|
||||
ENDIF()
|
||||
|
||||
# GL2PS
|
||||
IF(3RDPARTY_USE_GL2PS)
|
||||
IF(USE_GL2PS)
|
||||
ADD_DEFINITIONS(-DHAVE_GL2PS)
|
||||
THIRDPARTY_PRODUCT("GL2PS" "gl2ps.h" "gl2ps${BUILD_SUFFIX}")
|
||||
ENDIF()
|
||||
|
||||
# OPENCL
|
||||
IF(3RDPARTY_USE_OPENCL)
|
||||
IF(USE_OPENCL)
|
||||
ADD_DEFINITIONS(-DHAVE_OPENCL)
|
||||
|
||||
SET (3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_HEADER $ENV{AMDAPPSDKROOT}/include
|
||||
@ -401,117 +414,11 @@ IF(3RDPARTY_USE_OPENCL)
|
||||
ENDIF()
|
||||
|
||||
# TBB
|
||||
IF (3RDPARTY_USE_TBB)
|
||||
IF (USE_TBB)
|
||||
ADD_DEFINITIONS(-DHAVE_TBB)
|
||||
|
||||
IF(${COMPILER_BITNESS} STREQUAL 32)
|
||||
SET (TBB_ARCH_NAME ia32)
|
||||
ELSE()
|
||||
SET (TBB_ARCH_NAME intel64)
|
||||
ENDIF()
|
||||
INCLUDE(adm/templates/tbb.cmake)
|
||||
|
||||
IF(NOT DEFINED 3RDPARTY_TBB_DIR)
|
||||
SET(3RDPARTY_TBB_DIR "" CACHE PATH "Directory contains tbb product")
|
||||
ENDIF()
|
||||
|
||||
SET(3RDPARTY_TBB_DIR_NAME "")
|
||||
IF(3RDPARTY_DIR AND ("${3RDPARTY_TBB_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED))
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" "TBB" 3RDPARTY_TBB_DIR_NAME)
|
||||
IF("${3RDPARTY_TBB_DIR_NAME}" STREQUAL "")
|
||||
MESSAGE(STATUS "TBB DON'T FIND")
|
||||
ELSE()
|
||||
SET(3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${3RDPARTY_TBB_DIR_NAME}" CACHE PATH "Directory contains tbb product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(INSTALL_TBB OFF CACHE BOOL "Is tbb lib copy to install directory")
|
||||
|
||||
IF(3RDPARTY_TBB_DIR)
|
||||
IF("${3RDPARTY_TBB_INCLUDE_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "Directory contains headers of the tbb product" FORCE)
|
||||
FIND_PATH(3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include")
|
||||
ENDIF()
|
||||
|
||||
SET(TBB_DEBUG_POSTFIX "")
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
SET(TBB_DEBUG_POSTFIX "") # _debug postfix removed
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_TBB_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TBB_LIBRARY}" STREQUAL "3RDPARTY_TBB_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_TBB_LIBRARY "3RDPARTY_TBB_LIBRARY-NOTFOUND" CACHE PATH "Directory contains library of the tbb product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_TBB_LIBRARY tbb${TBB_DEBUG_POSTFIX} PATHS "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_LIBRARY}" STREQUAL "3RDPARTY_TBB_LIBRARY-NOTFOUND")
|
||||
FIND_LIBRARY(3RDPARTY_TBB_LIBRARY tbb${TBB_DEBUG_POSTFIX})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_TBB_MALLOC_LIBRARY "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND" CACHE PATH "Directory contains library of the tbb malloc product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_TBB_MALLOC_LIBRARY tbbmalloc${TBB_DEBUG_POSTFIX} PATHS "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND")
|
||||
FIND_LIBRARY(3RDPARTY_TBB_MALLOC_LIBRARY tbbmalloc${TBB_DEBUG_POSTFIX})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
||||
IF("${3RDPARTY_TBB_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_DLL "3RDPARTY_TBB_DLL-NOTFOUND" CACHE PATH "Directory contains shared library of the tbb product" FORCE)
|
||||
FIND_FILE(3RDPARTY_TBB_DLL "${DLL_SO_PREFIX}tbb${TBB_DEBUG_POSTFIX}.${DLL_SO}" PATHS "${3RDPARTY_TBB_DIR}/${DLL_SO_FOLDER}/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_DLL}" STREQUAL "3RDPARTY_TBB_DLL-NOTFOUND")
|
||||
FIND_FILE(3RDPARTY_TBB_DLL "${DLL_SO_PREFIX}tbb${TBB_DEBUG_POSTFIX}.${DLL_SO}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_MALLOC_DLL "3RDPARTY_TBB_MALLOC_DLL-NOTFOUND" CACHE PATH "Directory contains shared library of the tbb malloc product" FORCE)
|
||||
FIND_FILE(3RDPARTY_TBB_MALLOC_DLL "${DLL_SO_PREFIX}tbbmalloc${TBB_DEBUG_POSTFIX}.${DLL_SO}" PATHS "${3RDPARTY_TBB_DIR}/${DLL_SO_FOLDER}/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_DLL}" STREQUAL "3RDPARTY_TBB_MALLOC_DLL-NOTFOUND")
|
||||
FIND_FILE(3RDPARTY_TBB_MALLOC_DLL "${DLL_SO_PREFIX}tbbmalloc${TBB_DEBUG_POSTFIX}.${DLL_SO}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(3RDPARTY_TBB_DIR_NAME)
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_DIR)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_INCLUDE_DIR)
|
||||
SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_LIBRARY_DIR "${3RDPARTY_TBB_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TBB_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_LIBRARY)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_MALLOC_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_LIBRARY_DIR "${3RDPARTY_TBB_MALLOC_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TBB_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_MALLOC_LIBRARY)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_DLL)
|
||||
#
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_DLL)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_MALLOC_DLL)
|
||||
#
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_MALLOC_DLL)
|
||||
ENDIF()
|
||||
|
||||
IF(INSTALL_TBB)
|
||||
INSTALL(FILES "${3RDPARTY_TBB_DLL}" "${3RDPARTY_TBB_MALLOC_DLL}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
|
||||
|
||||
@ -557,15 +464,15 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
# DRAW.BAT or DRAW.SH
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/adm/cmake/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_WRITE GROUP_EXECUTE
|
||||
WORLD_READ WORLD_WRITE WORLD_EXECUTE)
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/adm/cmake/env.${SCRIPT_EXT}.in" env.${SCRIPT_EXT} @ONLY)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/env.${SCRIPT_EXT}.in" env.${SCRIPT_EXT} @ONLY)
|
||||
install(FILES "${OCCT_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" )
|
||||
ENDIF()
|
||||
|
||||
IF(MSVC AND "${BUILD_TYPE}" STREQUAL "Debug")
|
||||
IF(MSVC AND "${BUILD_CONFIGURATION}" STREQUAL "Debug")
|
||||
SET(RUN_PROJECT "start OCCT.sln")
|
||||
SET(BIN_DIR_POSTFIX "out\\bin\\Debug")
|
||||
SET(RESOURCE_DIR_PREFIX "%CASROOT%\\src")
|
||||
|
7
adm/templates/draw.bat
Normal file
7
adm/templates/draw.bat
Normal file
@ -0,0 +1,7 @@
|
||||
@echo off
|
||||
|
||||
rem Setup environment and launch DRAWEXE
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
echo Hint: use "pload ALL" command to load standard commands
|
||||
DRAWEXE.exe
|
8
adm/templates/draw.sh
Normal file
8
adm/templates/draw.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
|
||||
source "${aScriptPath}/env.sh" "$1" "$2"
|
||||
|
||||
echo 'Hint: use "pload ALL" command to load standard commands'
|
||||
DRAWEXE
|
57
adm/templates/env.bat.in
Normal file
57
adm/templates/env.bat.in
Normal file
@ -0,0 +1,57 @@
|
||||
echo off
|
||||
|
||||
set "SCRIPTROOT=%~dp0"
|
||||
set "SCRIPTROOT=%SCRIPTROOT:~0,-1%"
|
||||
|
||||
@CASROOT_DEFINITION@
|
||||
|
||||
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
|
||||
set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@"
|
||||
|
||||
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
|
||||
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
|
||||
|
||||
set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
|
||||
|
||||
set "PATH=%FREETYPE_DIR%;%GL2PS_DIR%;%FREEIMAGE_DIR%;%TBB_DIR%;%TCL_DIR%;%PATH%"
|
||||
|
||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||
set "PATH=%SCRIPTROOT%\@BIN_DIR_POSTFIX@;%PATH%"
|
||||
|
||||
rem ----- Set envoronment variables used by OCCT -----
|
||||
set CSF_LANGUAGE=us
|
||||
set MMGT_CLEAR=1
|
||||
set CSF_EXCEPTION_PROMPT=1
|
||||
set "CSF_SHMessage=@RESOURCE_DIR_PREFIX@\SHMessage"
|
||||
set "CSF_MDTVTexturesDirectory=@RESOURCE_DIR_PREFIX@\Textures"
|
||||
set "CSF_ShadersDirectory=@RESOURCE_DIR_PREFIX@\Shaders"
|
||||
set "CSF_XSMessage=@RESOURCE_DIR_PREFIX@\XSMessage"
|
||||
set "CSF_TObjMessage=@RESOURCE_DIR_PREFIX@\TObj"
|
||||
set "CSF_StandardDefaults=@RESOURCE_DIR_PREFIX@\StdResource"
|
||||
set "CSF_PluginDefaults=@RESOURCE_DIR_PREFIX@\StdResource"
|
||||
set "CSF_XCAFDefaults=@RESOURCE_DIR_PREFIX@\StdResource"
|
||||
set "CSF_TObjDefaults=@RESOURCE_DIR_PREFIX@\StdResource"
|
||||
set "CSF_StandardLiteDefaults=@RESOURCE_DIR_PREFIX@\StdResource"
|
||||
set "CSF_GraphicShr=TKOpenGl.dll"
|
||||
set "CSF_UnitsLexicon=@RESOURCE_DIR_PREFIX@\UnitsAPI\Lexi_Expr.dat"
|
||||
set "CSF_UnitsDefinition=@RESOURCE_DIR_PREFIX@\UnitsAPI\Units.dat"
|
||||
set "CSF_IGESDefaults=@RESOURCE_DIR_PREFIX@\XSTEPResource"
|
||||
set "CSF_STEPDefaults=@RESOURCE_DIR_PREFIX@\XSTEPResource"
|
||||
set "CSF_XmlOcafResource=@RESOURCE_DIR_PREFIX@\XmlOcafResource"
|
||||
set "CSF_MIGRATION_TYPES=@RESOURCE_DIR_PREFIX@\StdResource\MigrationSheet.txt"
|
||||
|
||||
rem Draw Harness special stuff
|
||||
if exist "@RESOURCE_DIR_PREFIX@\DrawResources" (
|
||||
set "DRAWHOME=@RESOURCE_DIR_PREFIX@\DrawResources"
|
||||
set "CSF_DrawPluginDefaults=@RESOURCE_DIR_PREFIX@\DrawResources"
|
||||
|
||||
if exist "@RESOURCE_DIR_PREFIX@\DrawResources\DrawDefault" (
|
||||
set "DRAWDEFAULT=@RESOURCE_DIR_PREFIX@\DrawResources\DrawDefault"
|
||||
)
|
||||
)
|
||||
|
||||
if exist "@RESOURCE_DIR_PREFIX@\DrawResourcesProducts" (
|
||||
set "CSF_DrawPluginProductsDefaults=@RESOURCE_DIR_PREFIX@\DrawResourcesProducts"
|
||||
)
|
||||
|
||||
@RUN_PROJECT@
|
100
adm/templates/env.sh.in
Normal file
100
adm/templates/env.sh.in
Normal file
@ -0,0 +1,100 @@
|
||||
echo off
|
||||
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
|
||||
FREETYPE_DIR="@3RDPARTY_FREETYPE_DLL_DIR@"
|
||||
GL2PS_DIR="@3RDPARTY_GL2PS_DLL_DIR@"
|
||||
|
||||
TBB_DIR="@3RDPARTY_TBB_DLL_DIR@"
|
||||
FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_DLL_DIR@"
|
||||
|
||||
TCL_DIR="@3RDPARTY_TCL_DLL_DIR@"
|
||||
|
||||
aLibPath="$aScriptPath/lib"
|
||||
if [ "$TCL_DIR" != "" ]; then
|
||||
aLibPath="${TCL_DIR}:${aLibPath}"
|
||||
fi
|
||||
if [ "$TBB_DIR" != "" ]; then
|
||||
aLibPath="${TBB_DIR}:${aLibPath}"
|
||||
fi
|
||||
if [ "$FREEIMAGE_DIR" != "" ]; then
|
||||
aLibPath="${FREEIMAGE_DIR}:${aLibPath}"
|
||||
fi
|
||||
if [ "$GL2PS_DIR" != "" ]; then
|
||||
aLibPath="${GL2PS_DIR}:${aLibPath}"
|
||||
fi
|
||||
if [ "$FREETYPE_DIR" != "" ]; then
|
||||
aLibPath="${FREETYPE_DIR}:${aLibPath}"
|
||||
fi
|
||||
|
||||
# ----- Set path to 3rd party and OCCT libraries -----
|
||||
aSystem=`uname -s`
|
||||
if [ "$aSystem" == "Darwin" ]; then
|
||||
export WOKSTATION="mac";
|
||||
if [ "$DYLD_LIBRARY_PATH" != "" ]; then
|
||||
export DYLD_LIBRARY_PATH="${aLibPath}:${DYLD_LIBRARY_PATH}"
|
||||
else
|
||||
export DYLD_LIBRARY_PATH="${aLibPath}"
|
||||
fi
|
||||
else
|
||||
export WOKSTATION="lin";
|
||||
if [ "$LD_LIBRARY_PATH" != "" ]; then
|
||||
export LD_LIBRARY_PATH="${aLibPath}:${LD_LIBRARY_PATH}"
|
||||
else
|
||||
export LD_LIBRARY_PATH="${aLibPath}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ----- Set path to OCCT executables -----
|
||||
PATH="${PATH}:$aScriptPath/bin"
|
||||
|
||||
# ----- Setup Environment Variables -----
|
||||
anArch=`uname -m`
|
||||
if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
|
||||
export ARCH="32";
|
||||
else
|
||||
export ARCH="64";
|
||||
fi
|
||||
if [ "$aSystem" == "Darwin" ]; then
|
||||
export ARCH="64";
|
||||
fi
|
||||
|
||||
# ----- Set envoronment variables used by OCCT -----
|
||||
export CSF_LANGUAGE=us
|
||||
export MMGT_CLEAR=1
|
||||
export CSF_EXCEPTION_PROMPT=1
|
||||
export CSF_SHMessage="${aScriptPath}/res/SHMessage"
|
||||
export CSF_MDTVTexturesDirectory="${aScriptPath}/res/Textures"
|
||||
export CSF_ShadersDirectory="${aScriptPath}/res/Shaders"
|
||||
export CSF_XSMessage="SCRIPTROOT/res/XSMessage"
|
||||
export CSF_TObjMessage="SCRIPTROOT/res/TObj"
|
||||
export CSF_StandardDefaults="${aScriptPath}/res/StdResource"
|
||||
export CSF_PluginDefaults="${aScriptPath}/res/StdResource"
|
||||
export CSF_XCAFDefaults="${aScriptPath}/res/StdResource"
|
||||
export CSF_TObjDefaults="${aScriptPath}/res/StdResource"
|
||||
export CSF_StandardLiteDefaults="${aScriptPath}/res/StdResource"
|
||||
if [ "$WOKSTATION" == "mac" ]; then
|
||||
export CSF_GraphicShr="libTKOpenGl.dylib"
|
||||
else
|
||||
export CSF_GraphicShr="libTKOpenGl.so"
|
||||
fi
|
||||
export CSF_UnitsLexicon="${aScriptPath}/res/UnitsAPI/Lexi_Expr.dat"
|
||||
export CSF_UnitsDefinition="${aScriptPath}/res/UnitsAPI/Units.dat"
|
||||
export CSF_IGESDefaults="${aScriptPath}/res/XSTEPResource"
|
||||
export CSF_STEPDefaults="${aScriptPath}/res/XSTEPResource"
|
||||
export CSF_XmlOcafResource="${aScriptPath}/res/XmlOcafResource"
|
||||
export CSF_MIGRATION_TYPES="${aScriptPath}/res/StdResource/MigrationSheet.txt"
|
||||
|
||||
# Draw Harness special stuff
|
||||
if [ -e "${aScriptPath}/res/DrawResources" ]; then
|
||||
export DRAWHOME="${aScriptPath}/res/DrawResources"
|
||||
export CSF_DrawPluginDefaults="${aScriptPath}/res/DrawResources"
|
||||
|
||||
if [ -e "${aScriptPath}/res/DrawResources/DrawDefault" ]; then
|
||||
export DRAWDEFAULT="${aScriptPath}/res/DrawResources/DrawDefault"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e "${aScriptPath}/res/DrawResourcesProducts" ]; then
|
||||
export CSF_DrawPluginProductsDefaults="${aScriptPath}/res/DrawResourcesProducts"
|
||||
fi
|
109
adm/templates/tbb.cmake
Normal file
109
adm/templates/tbb.cmake
Normal file
@ -0,0 +1,109 @@
|
||||
# Find tbb includes and libraries
|
||||
|
||||
IF(${COMPILER_BITNESS} STREQUAL 32)
|
||||
SET (TBB_ARCH_NAME ia32)
|
||||
ELSE()
|
||||
SET (TBB_ARCH_NAME intel64)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT DEFINED 3RDPARTY_TBB_DIR)
|
||||
SET(3RDPARTY_TBB_DIR "" CACHE PATH "Directory contains tbb product")
|
||||
ENDIF()
|
||||
|
||||
SET(3RDPARTY_TBB_DIR_NAME "")
|
||||
IF(3RDPARTY_DIR AND ("${3RDPARTY_TBB_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED))
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" "TBB" 3RDPARTY_TBB_DIR_NAME)
|
||||
IF("${3RDPARTY_TBB_DIR_NAME}" STREQUAL "")
|
||||
MESSAGE(STATUS "TBB DON'T FIND")
|
||||
ELSE()
|
||||
SET(3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${3RDPARTY_TBB_DIR_NAME}" CACHE PATH "Directory contains tbb product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(INSTALL_TBB OFF CACHE BOOL "Is tbb lib copy to install directory")
|
||||
|
||||
IF(3RDPARTY_TBB_DIR)
|
||||
IF("${3RDPARTY_TBB_INCLUDE_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "Directory contains headers of the tbb product" FORCE)
|
||||
FIND_PATH(3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include")
|
||||
ENDIF()
|
||||
|
||||
SET(TBB_DEBUG_POSTFIX "")
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
SET(TBB_DEBUG_POSTFIX "") # _debug postfix removed
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_TBB_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TBB_LIBRARY}" STREQUAL "3RDPARTY_TBB_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_TBB_LIBRARY "3RDPARTY_TBB_LIBRARY-NOTFOUND" CACHE PATH "Directory contains library of the tbb product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_TBB_LIBRARY tbb${TBB_DEBUG_POSTFIX} PATHS "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_LIBRARY}" STREQUAL "3RDPARTY_TBB_LIBRARY-NOTFOUND")
|
||||
FIND_LIBRARY(3RDPARTY_TBB_LIBRARY tbb${TBB_DEBUG_POSTFIX})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_TBB_MALLOC_LIBRARY "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND" CACHE PATH "Directory contains library of the tbb malloc product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_TBB_MALLOC_LIBRARY tbbmalloc${TBB_DEBUG_POSTFIX} PATHS "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND")
|
||||
FIND_LIBRARY(3RDPARTY_TBB_MALLOC_LIBRARY tbbmalloc${TBB_DEBUG_POSTFIX})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
||||
IF("${3RDPARTY_TBB_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_DLL "3RDPARTY_TBB_DLL-NOTFOUND" CACHE PATH "Directory contains shared library of the tbb product" FORCE)
|
||||
FIND_FILE(3RDPARTY_TBB_DLL "${DLL_SO_PREFIX}tbb${TBB_DEBUG_POSTFIX}.${DLL_SO}" PATHS "${3RDPARTY_TBB_DIR}/${DLL_SO_FOLDER}/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_DLL}" STREQUAL "3RDPARTY_TBB_DLL-NOTFOUND")
|
||||
FIND_FILE(3RDPARTY_TBB_DLL "${DLL_SO_PREFIX}tbb${TBB_DEBUG_POSTFIX}.${DLL_SO}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_MALLOC_DLL "3RDPARTY_TBB_MALLOC_DLL-NOTFOUND" CACHE PATH "Directory contains shared library of the tbb malloc product" FORCE)
|
||||
FIND_FILE(3RDPARTY_TBB_MALLOC_DLL "${DLL_SO_PREFIX}tbbmalloc${TBB_DEBUG_POSTFIX}.${DLL_SO}" PATHS "${3RDPARTY_TBB_DIR}/${DLL_SO_FOLDER}/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_DLL}" STREQUAL "3RDPARTY_TBB_MALLOC_DLL-NOTFOUND")
|
||||
FIND_FILE(3RDPARTY_TBB_MALLOC_DLL "${DLL_SO_PREFIX}tbbmalloc${TBB_DEBUG_POSTFIX}.${DLL_SO}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(3RDPARTY_TBB_DIR_NAME)
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_DIR)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_INCLUDE_DIR)
|
||||
SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_LIBRARY_DIR "${3RDPARTY_TBB_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TBB_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_LIBRARY)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_MALLOC_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_LIBRARY_DIR "${3RDPARTY_TBB_MALLOC_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TBB_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_MALLOC_LIBRARY)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_DLL)
|
||||
#
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_DLL)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_MALLOC_DLL)
|
||||
#
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_MALLOC_DLL)
|
||||
ENDIF()
|
171
adm/templates/tcl.cmake
Normal file
171
adm/templates/tcl.cmake
Normal file
@ -0,0 +1,171 @@
|
||||
# - Find Tcl includes and libraries
|
||||
|
||||
IF(WIN32)
|
||||
SET(TCL_SEP "")
|
||||
|
||||
GET_FILENAME_COMPONENT(ActiveTcl_CurrentVersion
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]" NAME)
|
||||
|
||||
ELSE()
|
||||
SET(TCL_SEP ".")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT DEFINED 3RDPARTY_TCL_DIR)
|
||||
SET(3RDPARTY_TCL_DIR "" CACHE PATH "Directory contains TCL product")
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_DIR AND ("${3RDPARTY_TCL_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED))
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
|
||||
IF("${TCL_DIR_NAME}" STREQUAL "")
|
||||
MESSAGE(STATUS "\nInfo: tcl folder isn't found in ${3RDPARTY_DIR}. Start seeking in default folders")
|
||||
ELSE()
|
||||
SET(3RDPARTY_TCL_DIR "${3RDPARTY_DIR}/${TCL_DIR_NAME}" CACHE PATH "Directory contains TCL product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(INSTALL_TCL OFF CACHE BOOL "Is TCL lib copy to install directory")
|
||||
|
||||
# include dir search
|
||||
IF("${3RDPARTY_TCL_INCLUDE_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TCL_INCLUDE_DIR}" STREQUAL "3RDPARTY_TCL_INCLUDE_DIR-NOTFOUND")
|
||||
SET(3RDPARTY_TCL_INCLUDE_DIR "3RDPARTY_TCL_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "Directory contains headers of the TCL product" FORCE)
|
||||
|
||||
IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
|
||||
FIND_PATH(3RDPARTY_TCL_INCLUDE_DIR tcl.h PATHS "${3RDPARTY_TCL_DIR}/include" NO_DEFAULT_PATH)
|
||||
ELSE()
|
||||
SET(3RDPARTY_TCL_POSSIBLE_INCLUDE_DIRS /usr/include
|
||||
/usr/local/include
|
||||
/usr/include/tcl8${TCL_SEP}6
|
||||
/usr/include/tcl8${TCL_SEP}5)
|
||||
IF(WIN32)
|
||||
SET(3RDPARTY_TCL_POSSIBLE_INCLUDE_DIRS ${3RDPARTY_TCL_POSSIBLE_INCLUDE_DIRS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
|
||||
"$ENV{ProgramFiles}/Tcl/include"
|
||||
#"$ENV{ProgramFiles\(x86\)}/Tcl/include"
|
||||
"C:/Program Files/Tcl/include"
|
||||
"C:/Tcl/include")
|
||||
ENDIF(WIN32)
|
||||
|
||||
# check default path (with additions) for header search
|
||||
FIND_PATH(3RDPARTY_TCL_INCLUDE_DIR tcl.h PATHS ${3RDPARTY_TCL_POSSIBLE_INCLUDE_DIRS})
|
||||
|
||||
#if find_path found something - set 3RDPARTY_TCL_DIR
|
||||
IF(NOT "${3RDPARTY_TCL_INCLUDE_DIR}" STREQUAL "3RDPARTY_TCL_INCLUDE_DIR-NOTFOUND")
|
||||
GET_FILENAME_COMPONENT (3RDPARTY_TCL_DIR "${3RDPARTY_TCL_INCLUDE_DIR}/../" ABSOLUTE)
|
||||
SET(3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DIR} CACHE FILEPATH "Directory contains TCL product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#library dir search
|
||||
IF("${3RDPARTY_TCL_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TCL_LIBRARY}" STREQUAL "3RDPARTY_TCL_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of the TCL product" FORCE)
|
||||
|
||||
IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
|
||||
FIND_LIBRARY(3RDPARTY_TCL_LIBRARY
|
||||
NAMES tcl tcl8${TCL_SEP}6 tcl8${TCL_SEP}5
|
||||
PATHS "${3RDPARTY_TCL_DIR}/lib" NO_DEFAULT_PATH)
|
||||
ELSE()
|
||||
SET(3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS /usr/lib /usr/local/lib)
|
||||
|
||||
IF(WIN32)
|
||||
SET(3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS ${3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
|
||||
"$ENV{ProgramFiles}/Tcl/Lib"
|
||||
"C:/Program Files/Tcl/lib"
|
||||
"C:/Tcl/lib" )
|
||||
ENDIF()
|
||||
|
||||
# check default path (with additions) for library search
|
||||
FIND_LIBRARY(3RDPARTY_TCL_LIBRARY
|
||||
NAMES tcl tcl8${TCL_SEP}6 tcl8${TCL_SEP}5
|
||||
PATHS ${3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#search the version of found tcl library
|
||||
IF("${3RDPARTY_TCL_LIBRARY}" STREQUAL "" OR "${3RDPARTY_TCL_LIBRARY}" STREQUAL "3RDPARTY_TCL_LIBRARY-NOTFOUND")
|
||||
SET (TCL_DLL_SO_NAMES ${DLL_SO_PREFIX}tcl.${DLL_SO}
|
||||
${DLL_SO_PREFIX}tcl8${TCL_SEP}5.${DLL_SO}
|
||||
${DLL_SO_PREFIX}tcl8${TCL_SEP}6.${DLL_SO} )
|
||||
ELSE()
|
||||
GET_FILENAME_COMPONENT(TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
|
||||
|
||||
STRING(REGEX REPLACE "^.*tcl([0-9])[^0-9]*[0-9].*$" "\\1" TCL_MAJOR_VERSION "${TCL_LIBRARY_NAME}")
|
||||
STRING(REGEX REPLACE "^.*tcl[0-9][^0-9]*([0-9]).*$" "\\1" TCL_MINOR_VERSION "${TCL_LIBRARY_NAME}")
|
||||
|
||||
IF (NOT "${TCL_MAJOR_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
|
||||
SET (IS_TCL_VERSION_FOUND ON)
|
||||
ELSE()
|
||||
SET (IS_TCL_VERSION_FOUND OFF)
|
||||
ENDIF()
|
||||
|
||||
IF (IS_TCL_VERSION_FOUND)
|
||||
SET (TCL_DLL_SO_NAMES "${DLL_SO_PREFIX}tcl${TCL_MAJOR_VERSION}${TCL_SEP}${TCL_MINOR_VERSION}.${DLL_SO}")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "\nWarning: Tcl version isn't found. ${DLL_SO_PREFIX}tcl.${DLL_SO} is used")
|
||||
SET (TCL_DLL_SO_NAMES "${DLL_SO_PREFIX}tcl.${DLL_SO}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#dll_so search
|
||||
IF("${3RDPARTY_TCL_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TCL_DLL}" STREQUAL "3RDPARTY_TCL_DLL-NOTFOUND")
|
||||
SET(3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of the TCL product" FORCE)
|
||||
|
||||
IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
|
||||
FIND_FILE(3RDPARTY_TCL_DLL
|
||||
NAMES ${TCL_DLL_SO_NAMES}
|
||||
PATHS "${3RDPARTY_TCL_DIR}/${DLL_SO_FOLDER}" NO_DEFAULT_PATH)
|
||||
ELSE()
|
||||
SET(3RDPARTY_TCL_POSSIBLE_SO_DIRS /usr/lib /usr/local/lib)
|
||||
|
||||
IF(WIN32)
|
||||
SET(3RDPARTY_TCL_POSSIBLE_SO_DIRS ${3RDPARTY_TCL_POSSIBLE_SO_DIRS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
|
||||
"$ENV{ProgramFiles}/Tcl/Bin"
|
||||
"C:/Program Files/Tcl/bin"
|
||||
"C:/Tcl/b" )
|
||||
ENDIF()
|
||||
|
||||
# check default path (with additions) for dll_so search
|
||||
FIND_FILE(3RDPARTY_TCL_DLL
|
||||
NAMES ${TCL_DLL_SO_NAMES}
|
||||
PATHS ${3RDPARTY_TCL_POSSIBLE_SO_DIRS})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
|
||||
MARK_AS_ADVANCED(3RDPARTY_TCL_DIR)
|
||||
ENDIF()
|
||||
|
||||
# #includes found paths to common variables
|
||||
IF(3RDPARTY_TCL_INCLUDE_DIR)
|
||||
SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_TCL_INCLUDE_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TCL_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TCL_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_LIBRARY)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TCL_DLL)
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_DLL)
|
||||
ENDIF()
|
||||
|
||||
IF(INSTALL_TCL)
|
||||
SET(3RDPARTY_TCL_DLL_DIR "")
|
||||
SET(3RDPARTY_TCL_LIB_DIR "")
|
||||
ELSE()
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_LIB_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
ENDIF()
|
@ -12,15 +12,17 @@ If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See \ref dev_guides__building__wok for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see paragraph 1 of
|
||||
\ref dev_guides__building for instructions.
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
instructions for your platform in @ref dev_guides__building.
|
||||
|
||||
## Decide on location of build and install directories.
|
||||
|
||||
The build directory is the one where intermediate files will be created (projects / makefiles, objects, binaries).
|
||||
The install directory is the one where binaries will be installed after build, along with header files and resources required for OCCT use in applications.
|
||||
The install directory is the one where binaries will be installed after build,
|
||||
along with header files and resources required for OCCT use in applications.
|
||||
|
||||
OCCT CMake scripts assume use of separate build and one install directories for each configuration (Debug or Release).
|
||||
OCCT CMake scripts assume use of separate build and one install directories
|
||||
for each configuration (Debug or Release).
|
||||
|
||||
It is recommended to separate build and install directories from OCCT source directory, for example:
|
||||
|
||||
@ -30,9 +32,13 @@ It is recommended to separate build and install directories from OCCT source dir
|
||||
|
||||
## CMake usage
|
||||
|
||||
Run CMake indicating path to OCCT sources ($CASROOT; in previous example CASROOT equal to /user/home/occt in lin case, and d:/occt in win case) and selected build directory (in prev example build directory is /user/home/tmp/occt-build-release).
|
||||
Run CMake indicating path to OCCT sources ($CASROOT; in previous example
|
||||
CASROOT equal to /user/home/occt in lin case, and d:/occt in windows case)
|
||||
and selected build directory (in prev example build directory is
|
||||
/user/home/tmp/occt-build-release).
|
||||
|
||||
It is recommended to use GUI tools provided by CMake: cmake-gui on Windows and Mac, ccmake on Linux.
|
||||
It is recommended to use GUI tools provided by CMake: cmake-gui on Windows
|
||||
and Mac, ccmake on Linux.
|
||||
|
||||
### Windows:
|
||||
|
||||
@ -75,9 +81,10 @@ Note: In cmake-gui there is "grouped" option, which groups variables with a comm
|
||||
|
||||
* BUILD_TYPE - defines build configuration of the future project (Release by default)
|
||||
* BUILD_<MODULE> - allows including the toolkit set of the specified module to the future project or excluding it from the project.
|
||||
* BUILD_TOOLKITS - allows including additional specified toolkits (list of items separated by a space or a semicolon) to the common set of the future project.
|
||||
* BUILD_TOOLKITS - allows including specific OCCT toolkits (list of items separated by a space or a semicolon) to the common set of the future project.
|
||||
|
||||
Check USE_\<PRODUCT\> variable (USE_FREEIMAGE, USE_GL2PS, USE_TBB and USE_OPENCL) if you want to use this 3rd-party product in the future project.
|
||||
Check USE_\<PRODUCT\> variable (USE_FREEIMAGE, USE_GL2PS, USE_TBB and USE_OPENCL)
|
||||
if you want to use this 3rd-party product in the future project.
|
||||
|
||||
### 3rd-party configuration
|
||||
|
||||
@ -87,7 +94,9 @@ specify 3RDPARTY_DIR variable that points to the folders of 3rdparty products (s
|
||||
At the next configuration 3rd-party product paths stored in 3RDPARTY_\<PRODUCT\>_DIR variable
|
||||
will be searched for in 3RDPARTY_DIR directory. If the structure of 3RDPARTY_DIR directory
|
||||
is the same as adopted in the OCCT, the directory will contain product dir, lib and header files.
|
||||
|
||||
Press "Configure" ("c" key for ccmake)
|
||||
|
||||
Important: The names of searched libraries and header files are hardcoded.
|
||||
The result of the 3rdparty product search will be recorded in the corresponding variables:
|
||||
|
||||
@ -107,7 +116,7 @@ The search process is as follows:
|
||||
If a variable of any level is not defined (empty or \<variable name\>-NOTFOUND)
|
||||
and the upper level variable is defined, the content of the non-defined variable
|
||||
will be searched for at the next configuration step. If search process in level 3
|
||||
doesn't find the required files, it searches in default places also.
|
||||
does not find the required files, it searches in default places also.
|
||||
|
||||
*Note*: Freetype search process tries to find ft2build.h file in 3RDPARTY_FREETYPE INCLUDE dir
|
||||
and after that adds "3RDPARTY_FREETYPE_INCLUDE /freetype2" path to common includes if it exists.
|
||||
|
@ -247,8 +247,8 @@ Unregisters the name from the dictionary. Ther names of *TObj* model
|
||||
objects are removed from the dictionary when the objects are deleted from the model.
|
||||
|
||||
~~~~~{.cpp}
|
||||
Handle(TObj_TNameContainer) GetDictionary() const;
|
||||
~~~~~~
|
||||
Handle(TObj_TNameContainer) GetDictionary() const;
|
||||
~~~~~
|
||||
|
||||
Returns a default instance of the model dictionary (located at the model root label).
|
||||
The default implementation works only with one dictionary.
|
||||
@ -260,39 +260,39 @@ that returns the dictionary where names of objects should be registered.
|
||||
|
||||
Class *TObj_Model* provides the API for transaction mechanism (supported by OCAF):
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Standard_Boolean HasOpenCommand() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns True if a Command transaction is open
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void OpenCommand() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Opens a new command transaction.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void CommitCommand() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Commits the Command transaction. Does nothing If there is no open Command transaction.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void AbortCommand() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Aborts the Command transaction. Does nothing if there is no open Command transaction.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Standard_Boolean IsModified() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns True if the model document has a modified status (has changes after the last save)
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void SetModified( const Standard_Boolean );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Changes the modified status by force. For synchronization of transactions
|
||||
within several *TObj_Model* documents use class *TDocStd_MultiTransactionManager*.
|
||||
@ -302,9 +302,9 @@ within several *TObj_Model* documents use class *TDocStd_MultiTransactionManager
|
||||
Class *TObj_Model* provides the descendant classes with a means to control
|
||||
the format of the persistent file by choosing the schema used to store or retrieve operations.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual TCollection_ExtendedString GetFormat () const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the string *TObjBin* or *TObjXml* indicating
|
||||
the current persistent mechanism. The default value is *TObjBin*.
|
||||
@ -318,15 +318,15 @@ should be enumerated in increasing order, incremented with every change
|
||||
of the model format. The current version of the model
|
||||
format is stored in the model file and can be checked upon retrieval.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Standard_Integer GetFormatVersion() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the format version stored in the model file
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void SetFormatVersion(const Standard_Integer theVersion);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Defines the format version used for save.
|
||||
|
||||
@ -358,22 +358,22 @@ If the format of data files changes, a specific treatment on a case-by-case basi
|
||||
The following methods are used for model update to ensure its consistency
|
||||
with respect to the other models in case of cross-model dependencies:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean Update();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
This method is usually called after loading of the model.
|
||||
The default implementation does nothing and returns **True**.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean initNewModel( const Standard_Boolean IsNew);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
This method performs model initialization, check and updates (as described above).
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual void updateBackReferences( const Handle(TObj_Object)& theObj);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
This method is called from the previous method to update back references
|
||||
of the indicated object after the retrieval of the model from file
|
||||
@ -383,23 +383,23 @@ of the indicated object after the retrieval of the model from file
|
||||
|
||||
To copy the model between OCAF documents use the following methods:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean Paste (Handle(*TObj_Model*) theModel, Handle(TDF_RelocationTable) theRelocTable = 0 );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Pastes the current model to the new model. The relocation table
|
||||
ensures correct copying of the sub-data shared by several parts of the model.
|
||||
It stores a map of processed original objects of relevant types in their copies.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Handle(*TObj_Model*) NewEmpty() = 0;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Redefines a pure virtual method to create a new empty instance of the model.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void CopyReferences ( const Handle(*TObj_Model*)& theTarget, const Handle(TDF_RelocationTable)& theRelocTable);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Copies the references from the current model to the target model.
|
||||
|
||||
@ -409,10 +409,10 @@ The messaging is organised using Open CASCADE Messenger from the package Message
|
||||
The messenger is stored as the field of the model instance
|
||||
and can be set and retrieved by the following methods:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void SetMessenger( const Handle(Message_Messenger)& );
|
||||
Handle(Message_Messenger) Messenger() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
A developer should create his own instance of the Messenger
|
||||
bound to the application user interface, and attribute it to the model
|
||||
@ -479,15 +479,15 @@ The *TObj_Object* class provides some basic features that can be inherited (or,
|
||||
|
||||
An object can be received from the model by the following methods:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
static Standard_Boolean GetObj ( const TDF_Label& theLabel, Handle(TObj_Object)& theResObject, const Standard_Boolean isSuper = Standard_False );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns *True* if the object has been found in the indicated label (or in the upper level label if *isSuper* is *True*).
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Handle(TObj_Object) GetFatherObject ( const Handle(Standard_Type)& theType = NULL ) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the father object of the indicated type
|
||||
for the current object (the direct father object if the type is NULL).
|
||||
@ -513,10 +513,10 @@ See the declaration of the TObj_Partition class for the example.
|
||||
*TObj_Object* class provides a set of auxiliary methods for descendants
|
||||
to access the data stored in sub-labels by their tag numbers:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
TDF_Label getDataLabel (const Standard_Integer theRank1, const Standard_Integer theRank2 = 0) const;
|
||||
TDF_Label getReferenceLabel (const Standard_Integer theRank1, const Standard_Integer theRank2 = 0) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the label in *Data* or *References* sub-labels at a given tag number (theRank1).
|
||||
The second argument, theRank2, allows accessing the next level of hierarchy
|
||||
@ -529,23 +529,23 @@ for the most widely used data types (*Standard_Real*, *Standard_Integer*, *TColl
|
||||
*TColStd_HArray1OfReal*, *TColStd_HArray1OfInteger*, *TColStd_HArray1OfExtendedString*).
|
||||
For instance, methods provided for real numbers are:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Standard_Real getReal (const Standard_Integer theRank1, const Standard_Integer theRank2 = 0) const;
|
||||
Standard_Boolean setReal (const Standard_Real theValue, const Standard_Integer theRank1, const Standard_Integer theRank2 = 0, const Standard_Real theTolerance = 0.) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Similar methods are provided to access references to other objects:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Handle(TObj_Object) getReference (const Standard_Integer theRank1, const Standard_Integer theRank2 = 0) const;
|
||||
Standard_Boolean setReference (const Handle(TObj_Object) &theObject, const Standard_Integer theRank1, const Standard_Integer theRank2 = 0);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
The method *addReference* gives an easy way to store a sequence of homogeneous references in one label.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
TDF_Label addReference (const Standard_Integer theRank1, const Handle(TObj_Object) &theObject);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Note that while references to other objects should be defined by descendant classes
|
||||
individually according to the type of object, *TObj_Object* provides methods
|
||||
@ -569,18 +569,18 @@ The class *TObj_Persistence* provides basic means for that:
|
||||
Two macros defined in the file TObj_Persistence.hxx have to be included in the definition
|
||||
of each model object class inheriting TObj_Object to activate the persistence mechanism:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
DECLARE_TOBJOCAF_PERSISTENCE (classname, ancestorname)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Should be included in the private section of declaration of each class inheriting
|
||||
*TObj_Object* (hxx file). This macro adds an additional constructor to the object class,
|
||||
and declares an auxiliary (private) class inheriting *TObj_Persistence*
|
||||
that provides a tool to create a new object of the proper type.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
IMPLEMENT_TOBJOCAF_PERSISTENCE (classname)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Should be included in .cxx file of each object class that should be saved and restored.
|
||||
This is not needed for abstract types of objects. This macro implements the functions
|
||||
@ -607,26 +607,26 @@ If necessary, it is easy to redefine a couple of object methods
|
||||
|
||||
This functionality is provided by the following methods:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Handle(TObj_TNameContainer) GetDictionary() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the name container where the name of object should be registered.
|
||||
The default implementation returns the model name container.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Handle(TCollection_HExtendedString) GetName() const;
|
||||
Standard_Boolean GetName( TCollection_ExtendedString& theName ) const;
|
||||
Standard_Boolean GetName( TCollection_AsciiString& theName ) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the object name. The methods with in / out argument return False if the object name is not defined.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean SetName ( const Handle(TCollection_HExtendedString)& theName ) const;
|
||||
Standard_Boolean SetName ( const Handle(TCollection_HAsciiString)& theName ) const;
|
||||
Standard_Boolean SetName ( const Standard_CString theName ) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Attributes a new name to the object and returns **True** if the name has been attributed successfully.
|
||||
Returns False if the name has been already attributed to another object.
|
||||
@ -656,57 +656,57 @@ from different *TObj* models, facilitating the construction of complex relations
|
||||
|
||||
The most used methods for work with references are:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean HasReference( const Handle(TObj_Object)& theObject) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns True if the current object refers to the indicated object.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Handle(TObj_ObjectIterator) GetReferences ( const Handle(Standard_Type)& theType = NULL ) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns an iterator on the object references. The optional argument *theType*
|
||||
restricts the types of referred objects, or does not if it is NULL.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual void RemoveAllReferences();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Removes all references from the current object.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual void RemoveReference( const Handle(TObj_Object)& theObject );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Removes the reference to the indicated object.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Handle(TObj_ObjectIterator) GetBackReferences ( const Handle(Standard_Type)& theType = NULL ) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns an iterator on the object back references.
|
||||
The argument theType restricts the types of master objects, or does not if it is NULL.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual void ReplaceReference ( const Handle(TObj_Object)& theOldObject, const Handle(TObj_Object)& theNewObject );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Replaces the reference to theOldObject by the reference to *theNewObject*.
|
||||
The handle theNewObject may be NULL to remove the reference.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean RelocateReferences ( const TDF_Label& theFromRoot, const TDF_Label& theToRoot, const Standard_Boolean theUpdateackRefs = Standard_True );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Replaces all references to a descendant label of *theFromRoot*
|
||||
by the references to an equivalent label under *theToRoot*.
|
||||
Returns **False** if the resulting reference does not point at a *TObj_Object*.
|
||||
Updates back references if theUpdateackRefs is **True**.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean CanRemoveReference ( const Handle(TObj_Object)& theObj) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns **True** if the reference can be removed and the master object
|
||||
will remain valid (*weak* reference).
|
||||
@ -749,15 +749,15 @@ but the behavior depends on the deletion mode *TObj_DeletingMode*:
|
||||
|
||||
The most used methods for object removing are:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean CanDetachObject (const TObj_DeletingMode theMode = TObj_FreeOnly );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns **True** if the object can be deleted with the indicated deletion mode.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Boolean Detach ( const TObj_DeletingMode theMode = TObj_FreeOnly );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Removes the object from the document if possible
|
||||
(according to the indicated deletion mode).
|
||||
@ -768,32 +768,32 @@ Returns **True** if the objects have been successfully deleted.
|
||||
|
||||
*TObj_Object* provides a number of special virtual methods to support replications of objects. These methods should be redefined by descendants when necessary.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Handle(TObj_Object) Clone (const TDF_Label& theTargetLabel, Handle(TDF_RelocationTable) theRelocTable = 0);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Copies the object to theTargetLabel. The new object will have all references of its original.
|
||||
Returns a handle to the new object (null handle if fail). The data are copied directly,
|
||||
but the name is changed by adding the postfix *_copy*.
|
||||
To assign different names to the copies redefine the method:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Handle(TCollection_HExtendedString) GetNameForClone ( const Handle(TObj_Object)& ) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the name for a new object copy. It could be useful to return the same object name
|
||||
if the copy will be in the other model or in the other partition with its own dictionary.
|
||||
The method *Clone* uses the following public methods for object data replications:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual void CopyReferences (const const Handle(TObj_Object)& theTargetObject, const Handle(TDF_RelocationTable) theRelocTable);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Adds to the copy of the original object its references.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual void CopyChildren (TDF_Label& theTargetLabel, const Handle(TDF_RelocationTable) theRelocTable);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Copies the children of an object to the target child label.
|
||||
|
||||
@ -812,20 +812,20 @@ which facilitate the storage of auxiliary logical information assigned to the ob
|
||||
The user (developer) can define any new flags in descendant classes.
|
||||
To set/get an object, the flags use the following methods:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Standard_Integer GetFlags() const;
|
||||
void SetFlags( const Standard_Integer theMask );
|
||||
Stadnard_Boolean TestFlags( const Standard_Integer theMask ) const;
|
||||
void ClearFlags( const Standard_Integer theMask = 0 );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
In addition, the generic virtual interface stores the logical properties
|
||||
of the object class in the form of a set of bit flags.
|
||||
Type flags can be received by the method:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
virtual Standard_Integer GetTypeFlags() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
The default implementation returns the flag **Visible**
|
||||
defined in the enumeration *TypeFlags*. This flag is used to define visibility
|
||||
@ -843,39 +843,39 @@ A hidden partition is a simple partition with a predefined hidden flag.
|
||||
|
||||
The main partition object methods:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
TDF_Label NewLabel() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Allocates and returns a new label for creation of a new child object.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void SetNamePrefix ( const Handle(TCollection_HExtendedString)& thePrefix);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Defines the prefix for automatic generation of names of the newly created objects.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Handle(TCollection_HExtendedString) GetNamePrefix() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the current name prefix.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Handle(TCollection_HExtendedString) GetNewName ( const Standard_Boolean theIsToChangeCount) const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Generates the new name and increases the internal counter of child objects if theIsToChangeCount is **True**.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
Standard_Integer GetLastIndex() const;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Returns the last reserved child index.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~~~{.cpp}
|
||||
void SetLastIndex( const Standard_Integer theIndex );
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~
|
||||
|
||||
Sets the last reserved index.
|
||||
|
||||
|
@ -55,7 +55,7 @@ Standard_Integer TestTopOpeTools_Trace::SetVerbose
|
||||
Standard_Integer TestTopOpeTools_Trace::SetVerbose
|
||||
(const t_flag flag,const Standard_Boolean b)
|
||||
{
|
||||
Standard_Integer index;
|
||||
Standard_Integer index = 0;
|
||||
if ( !Exist(flag,index) ) return 1;
|
||||
if (b) cout<<"set "<<mygenre<<" "<<flag<<" verbose"<<endl;
|
||||
else cout<<"set "<<mygenre<<" "<<flag<<" not verbose"<<endl;
|
||||
@ -66,7 +66,7 @@ Standard_Integer TestTopOpeTools_Trace::SetVerbose
|
||||
Standard_Integer TestTopOpeTools_Trace::Set
|
||||
(const Standard_Integer mute,const t_flag flag,const t_value value)
|
||||
{
|
||||
Standard_Integer index;
|
||||
Standard_Integer index = 0;
|
||||
if ( !Exist(flag,index) ) return 1;
|
||||
if (mute==0) {
|
||||
if (value) cout<<"activation de "<<mygenre<<" "<<flag<<endl;
|
||||
@ -88,7 +88,7 @@ Standard_Integer TestTopOpeTools_Trace::Set
|
||||
(const Standard_Integer mute,const t_flag flag, const t_value value,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
Standard_Integer index;
|
||||
Standard_Integer index = 0;
|
||||
if ( !Exist(flag,index) ) return 1;
|
||||
if ( Getftyp(index) == te_intarg ) {
|
||||
(*((tf_intarg)Getfunc(index)))(value,n,a);
|
||||
|
Loading…
x
Reference in New Issue
Block a user