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

Compare commits

..

1 Commits

Author SHA1 Message Date
myn
2c57ab72bc 0027558: Restore support for legacy XCAF persistence format 2016-06-08 14:10:23 +03:00
5097 changed files with 350097 additions and 179180 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)
@@ -73,7 +65,7 @@ if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration ge
endif()
# enable extended messages of many OCCT algorithms
if (((SINGLE_GENERATOR AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR NOT SINGLE_GENERATOR) AND (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore"))
if ((SINGLE_GENERATOR AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR NOT SINGLE_GENERATOR)
if (NOT BUILD_WITH_DEBUG)
set (BUILD_WITH_DEBUG OFF CACHE BOOL "${BUILD_WITH_DEBUG_DESCR}")
endif()
@@ -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)
@@ -320,15 +309,6 @@ if (MSVC)
set (BUILD_MODULE_MfcSamples OFF CACHE BOOL "${BUILD_MODULE_MfcSamples_DESCR}")
endif()
# uwp sample
if (MSVC)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (BUILD_MODULE_UwpSample OFF CACHE BOOL "${BUILD_MODULE_UwpSample_DESCR}")
else()
unset (BUILD_MODULE_UwpSample)
endif()
endif()
# whether use optional 3rdparty or not
if (APPLE)
set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
@@ -338,17 +318,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
@@ -362,10 +331,6 @@ if (ANDROID AND BUILD_MODULE_Draw)
message (STATUS "Info. Draw module is turned off due to it is not supported on Android")
set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
endif()
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND BUILD_MODULE_Draw)
message (STATUS "Info. Draw module is turned off due to it is not supported on UWP")
set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
endif()
# Overview
if (NOT DEFINED BUILD_DOC_Overview)
@@ -508,51 +473,29 @@ endif()
# FREEIMAGE
# search for CSF_FREEIMAGE variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
OCCT_IS_PRODUCT_REQUIRED (CSF_FREEIMAGE CAN_USE_FREEIMAGE)
OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGEPLUS)
if (CAN_USE_FREEIMAGE)
if (CAN_USE_FREEIMAGE OR CAN_USE_FREEIMAGEPLUS)
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
if (USE_FREEIMAGE)
add_definitions (-DHAVE_FREEIMAGE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimageplus")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS")
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_FREEIMAGE")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS")
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
endif()
# OpenGL ES 2.0
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
if (WIN32 AND CAN_USE_GLES2)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_GLES2 ON)
else()
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
if (USE_GLES2)
add_definitions (-DHAVE_GLES2)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_GLES2")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS")
endif()
# GL2PS
@@ -599,25 +542,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 +549,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()
@@ -718,8 +642,8 @@ 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}")
OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR}/${INSTALL_DIR_DATA}")
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
endif()
if (WIN32)
@@ -729,58 +653,41 @@ 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}")
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}")
# 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}"
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}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
endif()
# copy draw script to CMake binary folder
OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}")
# 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}/${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}/${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
endif()
# copy draw script to CMake binary folder
OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}")
set (SUB_CUSTOM_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}")
if (WIN32)
@@ -797,18 +704,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 +723,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 +736,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()
@@ -893,16 +800,10 @@ if (BUILD_MODULE_MfcSamples)
add_subdirectory(samples/mfc/standard/10_Convert)
endif()
if (BUILD_MODULE_UwpSample)
add_subdirectory(samples/xaml)
endif()
# Prepare variables for configuration of OpenCASCADE cmake config file
set (OCCT_MODULES_ENABLED)
set (OCCT_LIBRARIES)
set (SET_OpenCASCADE_MODULES_TOOLKITS "\n# List of available OpenCASCADE libraries for each module\n")
set (OCCT_COMPILE_DEFINITIONS)
foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
if (TARGET ${OCCT_TOOLKIT})
@@ -915,33 +816,10 @@ foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
get_target_property (${OCCT_TOOLKIT}_MODULE ${OCCT_TOOLKIT} "MODULE")
list (APPEND OCCT_MODULES_ENABLED ${${OCCT_TOOLKIT}_MODULE})
list (APPEND OpenCASCADE_${${OCCT_TOOLKIT}_MODULE}_TOOLKITS ${OCCT_TOOLKIT})
# get compile definitions of target directory
get_directory_property (COMPILE_DEFINITIONS DIRECTORY "${${OCCT_TOOLKIT}_SOURCE_DIR}" "COMPILE_DEFINITIONS")
list (APPEND OCCT_COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS})
endif()
endif()
endforeach()
list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED)
list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS)
# export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files
foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
set (SET_OpenCASCADE_COMPILE_DEFINITIONS)
string (TOUPPER "${OCCT_CONFIGURATION}" OCCT_CONFIGURATION_UPPER)
string (TOLOWER "${OCCT_CONFIGURATION}" OCCT_CONFIGURATION_LOWER)
foreach(COMPILE_DEFINITION ${OCCT_COMPILE_DEFINITIONS})
string(REPLACE "(" "\\(" COMPILE_DEFINITION "${COMPILE_DEFINITION}")
string(REPLACE ")" "\\)" COMPILE_DEFINITION "${COMPILE_DEFINITION}")
set (SET_OpenCASCADE_COMPILE_DEFINITIONS "${SET_OpenCASCADE_COMPILE_DEFINITIONS}set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:${OCCT_CONFIGURATION}>:${COMPILE_DEFINITION}>)\n")
endforeach()
set (SET_OpenCASCADE_CMAKE_C_FLAGS "${CMAKE_C_FLAGS_${OCCT_CONFIGURATION_UPPER}}")
set (SET_OpenCASCADE_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_${OCCT_CONFIGURATION_UPPER}}")
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADECompileDefinitionsAndFlags.cmake.in" "OpenCASCADECompileDefinitionsAndFlags-${OCCT_CONFIGURATION_LOWER}.cmake" @ONLY)
endforeach()
# install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
foreach (OCCT_MODULE ${OCCT_MODULES})
if (BUILD_MODULE_${OCCT_MODULE})
@@ -986,7 +864,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 +873,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

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

View File

@@ -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
@@ -240,6 +241,7 @@ n BinObjMgt
n BinTools
n CDF
n CDM
n FWOSDriver
n PCDM
n StdLDrivers
n StdLPersistent
@@ -267,6 +269,7 @@ n XmlMNaming
n XmlObjMgt
r StdResource
r XmlOcafResource
t FWOSPlugin
t TKBin
t TKBinL
@@ -360,6 +363,8 @@ n XCAFApp
n XCAFDimTolObjects
n XCAFDoc
n XCAFPrs
n XCAFDrivers
n XCAFPersistent
n XSAlgo
n XSControl
n XmlMXCAFDoc
@@ -437,4 +442,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,6 +0,0 @@
# EGL
if (WIN32)
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "libEGL" "libEGL")
else()
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "EGL" "EGL")
endif()

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

@@ -0,0 +1,9 @@
#freeimageplus
if (WIN32)
if (3RDPARTY_FREEIMAGE_DIR AND NOT 3RDPARTY_FREEIMAGEPLUS_DIR)
set (3RDPARTY_FREEIMAGEPLUS_DIR "${3RDPARTY_FREEIMAGE_DIR}" CACHE PATH "The directory containing freeimageplus" FORCE)
endif()
THIRDPARTY_PRODUCT("FREEIMAGEPLUS" "FreeImagePlus.h" "freeimageplus" "freeimageplusd")
endif()

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

@@ -1,6 +0,0 @@
# OpenGL ES 2.0
if (WIN32)
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "libGLESv2" "libGLESv2")
else()
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "GLESv2" "GLESv2")
endif()

View File

@@ -33,12 +33,10 @@ if (WIN32)
set (CSF_gdi32 "gdi32.lib")
set (CSF_user32 "user32.lib")
set (CSF_wsock32 "wsock32.lib")
set (CSF_winspool "Winspool.lib")
set (CSF_psapi "Psapi.lib")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
set (CSF_OpenGlLibs "libEGL.lib libGLESv2.lib")
else()
set (CSF_OpenGlLibs "opengl32.lib")
endif()
set (CSF_AviLibs "ws2_32.lib vfw32.lib")
set (CSF_OpenGlLibs "opengl32.lib glu32.lib")
if (USE_FREETYPE)
set (CSF_FREETYPE "freetype.lib")
@@ -53,7 +51,7 @@ if (WIN32)
endif()
if (USE_FREEIMAGE)
set (CSF_FreeImagePlus "freeimage.lib")
set (CSF_FreeImagePlus "freeimage.lib freeimageplus.lib")
else()
set (CSF_FreeImagePlus)
endif()
@@ -97,7 +95,7 @@ else()
set (CSF_OpenGlLibs "EGL GLESv2")
elseif (UNIX)
set (CSF_ThreadLibs "pthread rt stdc++")
set (CSF_OpenGlLibs "GL")
set (CSF_OpenGlLibs "GLU GL")
set (CSF_XwLibs "X11 Xext Xmu Xi")
set (CSF_dl "dl")

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

@@ -9,10 +9,6 @@ endif()
set (PRECOMPILED_DEFS)
if (NOT BUILD_SHARED_LIBS)
list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
endif()
# Get all used packages from toolkit
foreach (OCCT_PACKAGE ${USED_PACKAGES})
@@ -147,14 +143,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 +215,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

@@ -231,43 +231,43 @@ macro (TBB_PRODUCT_SEARCH PRODUCT_NAME)
endif()
# install tbb/tbbmalloc
if (INSTALL_TBB)
if (INSTALL_${PRODUCT_NAME})
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_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

@@ -55,7 +55,7 @@ endif()
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
# use default (CMake) TCL search
find_package(TCL QUIET)
find_package(TCL)
# tcl include dir
if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
@@ -80,7 +80,7 @@ if (BUILD_SHARED_LIBS)
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
@@ -147,7 +147,7 @@ if (BUILD_SHARED_LIBS)
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
@@ -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.")
@@ -291,4 +291,4 @@ if (NOT BUILD_SHARED_LIBS)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL_DIR)
OCCT_CHECK_AND_UNSET (INSTALL_TCL)
endif()
endif()

View File

@@ -59,7 +59,7 @@ endif()
COMPLIANCE_PRODUCT_CONSISTENCY(TK)
# use default (CMake) TCL search
find_package(TCL QUIET)
find_package(TCL)
# tk include dir
if (NOT 3RDPARTY_TK_INCLUDE_DIR)
@@ -84,7 +84,7 @@ if (BUILD_SHARED_LIBS)
if (WIN32)
if (NOT 3RDPARTY_TK_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll" ".a")
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TK_DLL_DIR)
@@ -151,7 +151,7 @@ if (BUILD_SHARED_LIBS)
if (WIN32)
if (NOT 3RDPARTY_TK_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll" ".a")
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TK_DLL_DIR)
@@ -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.")
@@ -283,4 +283,4 @@ if (NOT BUILD_SHARED_LIBS)
OCCT_CHECK_AND_UNSET (3RDPARTY_TK_DLL)
OCCT_CHECK_AND_UNSET (3RDPARTY_TK_DLL_DIR)
OCCT_CHECK_AND_UNSET (INSTALL_TK)
endif()
endif()

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),
@@ -79,8 +72,7 @@ INSTALL_MESSAGE (INSTALL_SAMPLES "OCCT samples")
INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)")
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
INSTALL_MESSAGE (INSTALL_EGL "EGL binaries")
INSTALL_MESSAGE (INSTALL_GLES2 "OpenGL ES 2.0 binaries")
INSTALL_MESSAGE (INSTALL_FREEIMAGEPLUS "FreeImagePlus binaries")
INSTALL_MESSAGE (INSTALL_FREETYPE "FreeType binaries")
INSTALL_MESSAGE (INSTALL_GL2PS "GL2PS binaries")
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
@@ -117,9 +109,6 @@ set (BUILD_MODULE_MfcSamples_DESCR
These samples show some possibilities of using OCCT and they can be executed
with script samples.bat from the installation directory (INSTALL_DIR)")
set (BUILD_MODULE_UwpSample_DESCR
"Indicates whether OCCT UWP sample should be built together with OCCT.")
set (BUILD_DOC_Overview_DESCR
"Indicates whether OCCT overview documentation project (Markdown format) should be
created together with OCCT. It is not built together with OCCT. Checking this options
@@ -136,14 +125,6 @@ set (USE_FREEIMAGE_DESCR
"Indicates whether Freeimage product should be used in OCCT visualization
module for support of popular graphics image formats (PNG, BMP etc)")
set (USE_EGL_DESCR
"Indicates whether EGL should be used in OCCT visualization
module instead of conventional OpenGL context creation APIs")
set (USE_GLES2_DESCR
"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization
module instead of desktop OpenGL")
set (USE_GL2PS_DESCR
"Indicates whether GL2PS product should be used in OCCT visualization
module for support of vector image formats (PS, EPS etc)")
@@ -164,6 +145,5 @@ set (USE_GLX_DESCR "Indicates whether X11 OpenGl on OSX is used or not")
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
macro (BUILD_MODULE MODULE_NAME)
set (ENABLE_MODULE TRUE)
set (BUILD_MODULE_${MODULE_NAME} ${ENABLE_MODULE} CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
set (BUILD_MODULE_${MODULE_NAME} ON CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
endmacro()

View File

@@ -127,24 +127,11 @@ proc wokdep:gui:UpdateList {} {
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchX11 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_GLES2" == "true" } {
if { "$::HAVE_GL2PS" == "true" } {
lappend anIncErrs "Error: gl2ps can not be used within OpenGL ES"
}
if { "$::HAVE_D3D" == "true" } {
lappend anIncErrs "Error: Direct3D can not be used within OpenGL ES"
}
wokdep:SearchEGL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchGLES anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
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 +142,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
}
@@ -409,28 +384,16 @@ checkbutton .myFrame.myChecks.myGl2psCheck -offvalue "false" -onvalue "true
ttk::label .myFrame.myChecks.myGl2psLbl -text "Use GL2PS"
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myTbbLbl -text "Use Intel TBB"
if { "$::tcl_platform(os)" != "Darwin" } {
checkbutton .myFrame.myChecks.myGlesCheck -offvalue "false" -onvalue "true" -variable HAVE_GLES2 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myGlesLbl -text "Use OpenGL ES"
}
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 +485,21 @@ 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
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myD3dLbl -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
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.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
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 5 -sticky w
incr aCheckRowIter
if { "$::tcl_platform(os)" == "Darwin" } {
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e

View File

@@ -43,6 +43,15 @@ 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_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 +65,48 @@ 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_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 +248,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
@@ -487,6 +430,7 @@ proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theEr
# binary distribution has another layout
set aFImageDist "Dist"
set aFImagePlusDist "Wrapper/FreeImagePlus/dist"
set isFound "true"
set aFImageHPath [wokdep:SearchHeader "FreeImage.h"]
@@ -496,12 +440,21 @@ proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theEr
lappend ::CSF_OPT_INC "$aPath/include"
} elseif { "$aPath" != "" && [file exists "$aPath/$aFImageDist/FreeImage.h"] } {
lappend ::CSF_OPT_INC "$aPath/$aFImageDist"
if { [file exists "$aPath/$aFImagePlusDist/FreeImagePlus.h"] } {
lappend ::CSF_OPT_INC "$aPath/$aFImagePlusDist"
}
} else {
lappend anErrInc "Error: 'FreeImage.h' not found (FreeImage)"
set isFound "false"
}
}
set aFImagePlusHPath [wokdep:SearchHeader "FreeImagePlus.h"]
if { "$::tcl_platform(platform)" == "windows" && "$aFImagePlusHPath" == "" } {
lappend anErrInc "Error: 'FreeImagePlus.h' not found (FreeImage)"
set isFound "false"
}
foreach anArchIter {64 32} {
set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter"]
if { "$aFImageLibPath" == "" } {
@@ -513,6 +466,10 @@ proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theEr
set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/$aFImageDist"]
if { "$aFImageLibPath" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/$aFImageDist"
set aFImagePlusLibPath [wokdep:SearchLib "freeimageplus" "$anArchIter" "$aPath/$aFImagePlusDist"]
if { "$aFImagePlusLibPath" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/$aFImagePlusDist"
}
} else {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freeimage.${::SYS_LIB_SUFFIX}' not found (FreeImage)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
@@ -520,18 +477,28 @@ proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theEr
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter"]
if { "$aFImageDllPath" == "" } {
set aFImagePlusLibPath [wokdep:SearchLib "freeimageplus" "$anArchIter"]
if { "$aFImagePlusLibPath" == "" } {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freeimageplus.${::SYS_LIB_SUFFIX}' not found (FreeImage)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter"]
set aFImagePlusDllPath [wokdep:SearchBin "freeimageplus.dll" "$anArchIter"]
if { "$aFImageDllPath" == "" || "$aFImagePlusDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$anArchIter" ]
set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/bin"]
if { "$aFImageDllPath" != "" } {
set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/bin"]
set aFImagePlusDllPath [wokdep:SearchBin "freeimageplus.dll" "$anArchIter" "$aPath/bin"]
if { "$aFImageDllPath" != "" && "$aFImagePlusDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/$aFImageDist"]
if { "$aFImageDllPath" != "" } {
set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/$aFImageDist"]
set aFImagePlusDllPath [wokdep:SearchBin "freeimageplus.dll" "$anArchIter" "$aPath/$aFImagePlusDist"]
if { "$aFImageDllPath" != "" && "$aFImagePlusDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/$aFImageDist"
lappend ::CSF_OPT_BIN$anArchIter "$aPath/$aFImagePlusDist"
} else {
lappend anErrBin$anArchIter "Error: 'freeimage.dll' is not found (FreeImage)"
lappend anErrBin$anArchIter "Error: 'freeimage.dll' or 'freeimageplus.dll' not found (FreeImage)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
@@ -542,8 +509,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 +518,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"
@@ -687,148 +671,6 @@ proc wokdep:SearchOpenCL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBi
return "$isFound"
}
# Search EGL library placement
proc wokdep:SearchEGL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
upvar $theErrLib32 anErrLib32
upvar $theErrLib64 anErrLib64
upvar $theErrBin32 anErrBin32
upvar $theErrBin64 anErrBin64
set isFound "true"
set aHeaderPath [wokdep:SearchHeader "EGL/egl.h"]
if { "$aHeaderPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" == "" || ![file exists "$aPath/include/EGL/egl.h"] } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
}
if { "$aPath" != "" && [file exists "$aPath/include/EGL/egl.h"] } {
lappend ::CSF_OPT_INC "$aPath/include"
} else {
lappend anErrInc "Error: 'EGL/egl.h' not found (EGL)"
set isFound "false"
}
}
set aLibName "EGL"
if { "$::tcl_platform(platform)" == "windows" } {
# awkward exception
set aLibName "libEGL"
}
foreach anArchIter {64 32} {
set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
if { "$aLibPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
if { "$aLibPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
}
if { "$aLibPath" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
} else {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (EGL)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter"]
if { "$aDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
if { "$aDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
}
if { "$aDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
lappend anErrBin$anArchIter "Error: 'libEGL.dll' not found (EGL)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
}
}
return "$isFound"
}
# Search OpenGL ES 2.0 library placement
proc wokdep:SearchGLES {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
upvar $theErrLib32 anErrLib32
upvar $theErrLib64 anErrLib64
upvar $theErrBin32 anErrBin32
upvar $theErrBin64 anErrBin64
set isFound "true"
set aHeaderPath [wokdep:SearchHeader "GLES2/gl2.h"]
if { "$aHeaderPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" == "" || ![file exists "$aPath/include/GLES2/gl2.h"] } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
}
if { "$aPath" != "" && [file exists "$aPath/include/GLES2/gl2.h"] } {
lappend ::CSF_OPT_INC "$aPath/include"
} else {
lappend anErrInc "Error: 'GLES2/gl2.h' not found (OpenGL ES 2.0)"
set isFound "false"
}
}
set aLibName "GLESv2"
if { "$::tcl_platform(platform)" == "windows" } {
# awkward exception
set aLibName "libGLESv2"
}
foreach anArchIter {64 32} {
set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
if { "$aLibPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$anArchIter" ]
set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
if { "$aLibPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
}
if { "$aLibPath" != "" } {
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
} else {
lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (OpenGL ES 2.0)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter"]
if { "$aDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
if { "$aDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
}
if { "$aDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
lappend anErrBin$anArchIter "Error: 'libGLESv2.dll' not found (OpenGL ES 2.0)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
}
}
return "$isFound"
}
# Auxiliary function, gets VTK version to set default search directory
proc wokdep:VtkVersion { thePath } {
set aResult "6.1"
@@ -1111,13 +953,14 @@ 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_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 +1003,16 @@ 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_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
}
@@ -1270,14 +1076,11 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_TclTkLibs) "tk8.6"
if { "$::HAVE_FREEIMAGE" == "true" } {
if { "$theOS" == "wnt" } {
set aLibsMap(CSF_FreeImagePlus) "FreeImage"
set aLibsMap(CSF_FreeImagePlus) "FreeImage FreeImagePlus"
} else {
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,10 +1104,9 @@ 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"
}
set aLibsMap(CSF_winspool) "Winspool"
set aLibsMap(CSF_psapi) "Psapi"
set aLibsMap(CSF_d3d9) "d3d9"
@@ -1343,10 +1139,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
set aLibsMap(CSF_MotifLibs) "X11"
}
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
}
}
}
}
@@ -1655,14 +1447,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"
}
@@ -2766,9 +2551,6 @@ proc osutils:xcdtk { theOutDir theToolKit theGuidsMap theIsStatic thePlatform {t
set anExecPrefix "\t\t\t\tEXECUTABLE_PREFIX = lib;"
set aWrapperExtension "\t\t\t\tWRAPPER_EXTENSION = dylib;"
set aTKDefines [list "OCC_CONVERT_SIGNALS"]
if { $theIsStatic == 1 } {
lappend aTKDefines "OCCT_NO_PLUGINS"
}
if { "$theTargetType" == "executable" } {
set aPBXBuildPhase "CopyFiles"
@@ -3061,12 +2843,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 +2886,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 +3071,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,14 +0,0 @@
#-----------------------------------------------------------------------------
#
# OpenCASCADECompileDefinitionsAndFlags-@OCCT_CONFIGURATION_LOWER@.cmake - OpenCASCADE CMake file
# with compile definitions and C/C++ flags for @OCCT_CONFIGURATION@ configuration.
#
# This file is configured by OpenCASCADE.
#
# The C and C++ flags added by OpenCASCADE to the cmake-configured flags.
set (OpenCASCADE_C_FLAGS_@OCCT_CONFIGURATION_UPPER@ "@SET_OpenCASCADE_CMAKE_C_FLAGS@")
set (OpenCASCADE_CXX_FLAGS_@OCCT_CONFIGURATION_UPPER@ "@SET_OpenCASCADE_CMAKE_CXX_FLAGS@")
# The compile definitions used by OpenCASCADE.
@SET_OpenCASCADE_COMPILE_DEFINITIONS@

View File

@@ -54,23 +54,16 @@ set (OpenCASCADE_BUILD_WITH_DEBUG @BUILD_WITH_DEBUG@)
set (OpenCASCADE_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
@SET_OpenCASCADE_BUILD_TYPE@
# Use of third-party libraries.
# Use of third-party libraries
set (OpenCASCADE_WITH_TCL @USE_TCL@)
set (OpenCASCADE_WITH_FREETYPE @USE_FREETYPE@)
set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
set (OpenCASCADE_WITH_GL2PS @USE_GL2PS@)
set (OpenCASCADE_WITH_TBB @USE_TBB@)
set (OpenCASCADE_WITH_VTK @USE_VTK@)
set (OpenCASCADE_WITH_GLES2 @USE_GLES2@)
@SET_OpenCASCADE_WITH_D3D@
@SET_OpenCASCADE_WITH_GLX@
# Import OpenCASCADE compile definitions, C and C++ flags for each installed configuration.
file(GLOB CONFIG_FILES "${CMAKE_CURRENT_LIST_DIR}/OpenCASCADECompileDefinitionsAndFlags-*.cmake")
foreach(f ${CONFIG_FILES})
include(${f})
endforeach()
if (NOT OpenCASCADE_FIND_COMPONENTS)
set (OpenCASCADE_FIND_COMPONENTS ${OpenCASCADE_MODULES})
endif ()

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,15 +2,11 @@ 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@"
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
set "EGL_DIR=@3RDPARTY_EGL_DLL_DIR@"
set "GLES2_DIR=@3RDPARTY_GLES2_DLL_DIR@"
set "FREEIMAGEPLUS_DIR=@3RDPARTY_FREEIMAGEPLUS_DLL_DIR@"
set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@"
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
set "VTK_DIR=@3RDPARTY_VTK_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,15 +4,11 @@ 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@"
set "FREEIMAGE_DIR=@USED_3RDPARTY_FREEIMAGE_DIR@"
set "EGL_DIR=@USED_3RDPARTY_EGL_DIR@"
set "GLES2_DIR=@USED_3RDPARTY_GLES2_DIR@"
set "FREEIMAGEPLUS_DIR=@USED_3RDPARTY_FREEIMAGEPLUS_DIR@"
set "GL2PS_DIR=@USED_3RDPARTY_GL2PS_DIR@"
set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
@@ -20,18 +16,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,9 @@ 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 +57,18 @@ 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_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_D3D%"] == ["true"] set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
rem Eliminate VS warning
if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"
@@ -136,6 +134,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

@@ -29,8 +29,7 @@ if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
if not ["%EGL_DIR%"] == [""] set "PATH=%EGL_DIR%;%PATH%"
if not ["%GLES2_DIR%"] == [""] set "PATH=%GLES2_DIR%;%PATH%"
if not ["%FREEIMAGEPLUS_DIR%"] == [""] set "PATH=%FREEIMAGEPLUS_DIR%;%PATH%"
if not ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%"
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
@@ -58,6 +57,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,8 @@ 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 +90,25 @@ 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_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 +213,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 glu32.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 glu32.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 glu32.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 glu32.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 glu32.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 glu32.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

@@ -1,5 +0,0 @@
# A toolchain file to configure a Visual Studio generator for a Windows 10 Universal Application (UWP)
# Specify the CMAKE_SYSTEM_VERSION variable to be 10.0 to build with the latest available Windows 10 SDK.
set (CMAKE_SYSTEM_NAME WindowsStore)
set (CMAKE_SYSTEM_VERSION 10.0)

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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

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")

521
dox/LICENSE.md Executable file
View File

@@ -0,0 +1,521 @@
License {#occt_public_license}
=======
Open CASCADE Technology is available under GNU Lesser General Public License
(LGPL) version 2.1 with additional exception.
@section license_lgpl_21 GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
### Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- 0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
1. The modified work must itself be a software library.
2. You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
3. You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
4. If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
1. Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
2. Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
3. Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
4. If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
5. Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
1. Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
2. Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
**NO** **WARRANTY**
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
### END OF TERMS AND CONDITIONS
### How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@section occt_lgpl_exception OPEN CASCADE EXCEPTION
### Open CASCADE Exception (version 1.0) to GNU LGPL version 2.1.
The object code (i.e. not a source) form of a "work that uses the Library"
can incorporate material from a header file that is part of the Library.
As a special exception to the GNU Lesser General Public License version 2.1,
you may distribute such object code incorporating material from header files
provided with the Open CASCADE Technology libraries (including code of CDL
generic classes) under terms of your choice, provided that you give
prominent notice in supporting documentation to this code that it makes use
of or is based on facilities provided by the Open CASCADE Technology software.

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,27 +5,27 @@ 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 **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 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 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 build 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.
Different configurations should be built in different build directories to avoid conflicts.
@@ -35,7 +35,7 @@ It is however possible to choose one installation directory for several configur
d:/tmp/occt-build-vc10-x64 -- the build directory with the generated
solution and other intermediate files created during a CMake tool working
d:/occt-install -- the installation directory that is
able to contain several OCCT configurations
able to contain several OCCT configuratoion
@section build_cmake_conf Configuration process
@@ -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,25 @@ Once the source and build directories are selected, "Configure" button should be
@figure{/dev_guides/building/cmake/images/cmake_image002.png}
To build OCCT for **Universal Windows Platform (UWP)** specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
Alternatively, if you are using CMake from the command line add options -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 .
**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 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 a new variable appearance. 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 +87,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 +114,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,14 +122,14 @@ 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 result 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>).
* *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* -- path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>)
* *3RDPARTY_\<PRODUCT\>_DLL_DIR* -- path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is only relevant to Windows platforms.
Note: each library and include directory should be children of the product directory if the last one is defined.
Note: each library and include directory should be the children of product directory if the last one is defined.
The search process is as follows:
@@ -148,7 +140,7 @@ The search process is as follows:
2. *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR*
3. *3RDPARTY_\<PRODUCT\>_DLL_DIR*
If a variable of any level is not defined (empty or <i> \<variable name\>-NOTFOUND </i>) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step. If the search process at level 3 does not find the required files, it seeks in default places.
If a variable of any level is not defined (empty or <i> \<variable name\>-NOTFOUND </i>) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step. If search process at level 3 does not find the required files, it seeks in default places.
If a search result (include path, or library path, or dll path) does not meet your expectations, you can change *3RDPARTY_\<PRODUCT\>_*_DIR variable*, clear (if they are not empty) *3RDPARTY_\<PRODUCT\>_DLL_DIR, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* and 3RDPARTY_\<PRODUCT\>_LIBRARY_DIR variables (or clear one of them) and run the configuration process again.
@@ -163,13 +155,13 @@ can be changed to
d:/3rdparty/freetype-2.5.3
During the configuration process the related variables (*3RDPARTY_FREETYPE_DLL_DIR*, *3RDPARTY_FREETYPE_INCLUDE_DIR* and *3RDPARTY_FREETYPE_LIBRARY_DIR*) will be filled with new found values.
During the configuration process the related variables (*3RDPARTY_FREETYPE_DLL_DIR*, *3RDPARTY_FREETYPE_INCLUDE_DIR* and *3RDPARTY_FREETYPE_LIBRARY_DIR*) will be filled with new found values
**Note**: The names of searched libraries and header files are hard-coded. If there is the need to change their names, change appropriate cmake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration: *3RDPARTY_\<PRODUCT\>_INCLUDE* for include, *3RDPARTY_\<PRODUCT\>_LIB* for library and *3RDPARTY_\<PRODUCT\>_DLL* for shared library.
@section build_cmake_gen Projects generation
Once the configuration process is done, the "Generate" button is used to prepare project files for the target IDE. In our exercise the Visual Studio solution will be automatically created in the buid directory.
Once the configuration process is done, "Generate" button is used to prepare project files for the target IDE. In our exercise the Visual Studio solution will be automatically created in the buid directory.
@section build_cmake_build Building
@@ -187,11 +179,11 @@ For this, right-click on the *Overview/INSTALL* project and select **Project Onl
@section build_cmake_install Installation
Installation is a process of extracting redistributable resources (binaries, include files etc) from the build directory into the installation one. The installation directory will be free of project files, intermediate object files and any other information related to the build routines.
Installation is a process of extracting redistributable resources (binaries,include files etc) from the build directory into the installation one. The installation directory will be free of project files, intermediate object files and any other information related to the build routines.
Normally you use the installation directory of OCCT to link against your specific application.
The directory structure is as follows:
the directory structure is follow:
data -- data files for OCCT (brep, iges, stp)
doc -- OCCT overview documentation in HTML format
@@ -210,6 +202,6 @@ follows:
\bin
\lib
If CMake installation flags are enabled for the 3rd party products (e.g. INSTALL_FREETYPE), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT. Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories).
If CMake installation flags are enabled for the 3rd party products (e.g. INSTALL_FREETYPE), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT. Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories)
The installation folder contains the scripts to run *DRAWEXE* (*draw.bat* or *draw.sh*), samples (if they were installed) and overview.html (short-cut for installed OCCT overview documentation).
The installation folder contains the scripts to run *DRAWEXE* (*draw.bat* or *draw.sh*), samples (if its were installed) and overview.html (short-cut for installed OCCT overview documentation).

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

@@ -35,8 +35,6 @@ This feature can be activated by defining environment variable *CSF_DEBUG_BOP*,
The diagnostic code checks validity of the input arguments and the result of each Boolean operation. When an invalid situation is detected, the report consisting of argument shapes and a DRAW script to reproduce the problematic operation is saved to the directory pointed by *CSF_DEBUG_BOP*.
Note that this feature does not applicable for UWP build.
@section occt_debug_call Functions for calling from debugger
Modern interactive debuggers provide the possibility to execute application code at a program break point. This feature can be used to analyse the temporary objects available only in the context of the debugged code. OCCT provides several global functions that can be used in this way.
@@ -116,17 +114,6 @@ Stores mesh produced in parametric space to BREP file.
- *theMeshHandlePtr* -- a pointer to *Handle(BRepMesh_DataStructureOfDelaun)* variable.
- *theFileNameStr* -- the name of the file where the mesh is stored.
The following functions are provided by *TKTopTest* toolkit:
~~~~~
const char* MeshTest_DrawLinks(const char* theNameStr, void* theFaceAttr)
const char* MeshTest_DrawTriangles(const char* theNameStr, void* theFaceAttr)
~~~~~
Sets the edges or triangles from mesh data structure of type *Handle(BRepMesh_FaceAttribute)* as DRAW interpreter variables, assigning a unique name in the form "<theNameStr>_<index>" to each object.
- *theNameStr* -- the prefix to use in names of objects.
- *theFaceAttr* -- a pointer to *Handle(BRepMesh_FaceAttribute)* variable.
The following additional function is provided by *TKGeomBase* toolkit:
~~~~~

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
@@ -329,13 +328,13 @@ Porting of user applications from an earlier OCCT version to version 7.0.0 requi
Legacy persistence for shapes and OCAF data based on *Storage_Schema* (toolkits *TKPShape*, *TKPLCAF*, *TKPCAF*, *TKShapeShcema, TLStdLSchema, TKStdSchema*, and *TKXCAFSchema*) has been removed in OCCT 7.0.0.
The applications that used these data persistence tools need to be updated to use other persistence mechanisms.
@note For compatibility with previous versions, the possibility to read standard OCAF data (*TKLCAF* and *TKCAF*) from files stored in the old format is preserved (toolkits *TKStdL* and *TKStd*).
@note For compatibility with previous versions, possibility to read standard OCAF data (TKLCAF, TKCAF) from the files stored in old format is preserved (toolkits *TKStdL*, *TKStd*).
The existing data files in standard formats can be converted using OCCT 6.9.1 or a previous version, as follows.
#### CSFDB files
Files in *CSFDB* format (usually with extension .csfdb) contain OCCT shape data that can be converted to BRep format.
Files in CSFDB format (usually with extension .csfdb) contain OCCT shape data that can be converted to BRep format.
The easiest way to do that is to use ImportExport sample provided with OCCT 6.9.0 (or earlier):
- Start ImportExport sample;
@@ -348,7 +347,7 @@ The easiest way to do that is to use ImportExport sample provided with OCCT 6.9.
Files containing OCAF data saved in the old format usually have extensions <i>.std, .sgd</i> or <i>.dxc</i> (XDE documents).
These files can be converted to XML or binary OCAF formats using DRAW Test Harness commands.
Note that if the file contains only attributes defined in *TKLCAF* and *TKCAF*, this action can be performed in OCCT 7.0; otherwise OCCT 6.9.1 or earlier should be used.
Note that if the file contains only attributes defined in TKLCAF and TKCAF, this action can be performed in OCCT 7.0; otherwise OCCT 6.9.1 or earlier should be used.
For that, start *DRAWEXE* and perform the following commands:
@@ -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 move 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:
@@ -551,7 +550,7 @@ For example:
Handle(Geom_Geometry) aC = GC_MakeLine (p, v); // compiler error
~~~~~
The problem is that the class *GC_MakeLine* has a user-defined conversion to <i>const Handle(Geom_TrimmedCurve)&,</i> which is not the same as the type of the local variable *aC*.
The problem is that the class *GCE2d_MakeSegment* has a user-defined conversion to <i>const Handle(Geom_TrimmedCurve)&,</i> which is not the same as the type of the local variable *aC*.
To resolve this, use method <i>Value()</i>:
@@ -565,7 +564,7 @@ or use variable of the appropriate type:
Handle(Geom_TrimmedCurve) aC = GC_MakeLine (p, v); // ok
~~~~~
A similar problem appears with GCC compiler, when *const* handle to derived type is used to construct handle to base type via assignment (and in some cases in return statement), for instance:
With GCC compiler, similar problem appears when const handle to derived type is used to construct handle to base type via assignment (and in some cases in return statement), for instance:
~~~~~
const Handle(Geom_Line) aLine;
@@ -625,7 +624,7 @@ Call method <i>get()</i> explicitly to output the address of the Handle.
#### Method DownCast for non-base types
Method *DownCast()* in OCCT 7.0 is made templated; if its argument is not a base class, "deprecated" compiler warning is generated.
Method *DownCast()* in OCCT 7.0 is made templated; if it is used with argument which is not a base class, "deprecated" compiler warning is generated.
This is done to prevent possible unintended errors like this:
~~~~~
@@ -636,7 +635,7 @@ Handle(Geom_Line) aLine =
The places where this cast has been used should be corrected manually.
If down casting is used in a template context where the argument can have the same or unrelated type so that *DownCast()* may be not available in all cases, use C++ *dynamic_cast<>* instead, e.g.:
If down casting is used in a template context where argument can have the same or unrelated type so that *DownCast()* may be not available in all cases, use C++ *dynamic_cast<>* instead, e.g.:
~~~~~
template <class T>
@@ -669,8 +668,8 @@ aBC->Transform (T); // access violation in OCCT 7.0
@subsubsection upgrade_occt700_cdl_nocast Option to avoid cast of handle to reference to base type
In OCCT 6.x and earlier versions the handle classes formed a hierarchy echoing the hierarchy of the corresponding object classes .
This automatically enabled the possibility to use the handle to a derived class in all contexts where the handle to a base class was needed, e.g. to pass it in a function by reference without copying:
In OCCT 6.x and earlier versions the handle classes formed a hierarchy echoing hierarchy of corresponding object classes.
This automatically enabled possibility to use handle to derived class in all contexts where handle to base class was needed, e.g. pass it in function by reference without copying:
~~~~
Standard_Boolean GetCurve (Handle(Geom_Curve)& theCurve);
@@ -682,16 +681,17 @@ if (GetCurve (aLine)) {
~~~~
This feature was used in multiple places in OCCT and dependent projects.
However it is potentially unsafe: in the above example no checks are done at compile time or at run time to ensure that the type assigned to the argument handle is compatible with the type of the handle passed as argument.
If an object of incompatible type (e.g. Geom_Circle) is assigned to *theCurve*, the behavior will be unpredictable.
However it is potentially unsafe: in the above example no checks are done at compile time or at run time to ensure that argument handle is assigned a type compatible with the type of handle passed as argument.
If object of incompatible type (e.g. Geom_Circle) is assigned to *theCurve*, the behavior will be unpredictable.
For compatibility with the existing code, OCCT 7.0 keeps this possibility by default, providing operators of type cast to the handle to a base type. However, this feature is unsafe and in specific situations it may cause compile-time or run-time errors as described above.
For compatibility with existing code, by default OCCT 7.0 keeps this possibility, providing operators of type cast to handle to base type.
Besides being unsafe, in specific situations this feature may cause compile-time or run-time errors as described above.
To provide a safer behavior, this feature can be disabled by a compile-time macro *OCCT_HANDLE_NOCAST*.
When it is used, constructors and assignment operators are defined (instead of type cast operators) to convert handles to a derived type into handles to a base type.
In order to provide safer behavior, this feature can be disabled by defining a compile-time macro *OCCT_HANDLE_NOCAST*.
When it is defined, constructors and assignment operators are defined (instead of type cast operators) to convert from handle to defived type to handle to base type.
This implies creation of temporary objects and hence may be more expensive at run time in some circumstances, however this way is more standard, safer, and in general recommended.
The code that relies on the possibility of casting to base should be amended to always use the handle of argument type in function call and to use *DownCast()* to safely convert the result to the desired type.
The code that relies on possibility of casting to base should be amended so that handle of argument type is always used in function call, and to use DownCast() to safely convert the result to desired type.
For instance, the code from the example below can be changed as follows:
~~~~~
@@ -731,7 +731,7 @@ The upgrade script and sources of a specialized WOK version used for OCCT code u
@subsection upgrade_occt700_bspline Separation of BSpline cache
Implementation of NURBS curves and surfaces has been revised: the cache of polynomial coefficients, which is used to accelerate the calculation of values of a B-spline, has been separated from data objects *Geom2d_BSplineCurve, Geom_BSplineCurve* and *Geom_BSplineSurface* into the dedicated classes *BSplCLib_Cache* and *BSplSLib_Cache*.
Implementation of NURBS curves and surfaces has been revised: the cache of polynomial coefficients, which is used to accelerate calculate values of B-spline, has been separated from data objects *Geom2d_BSplineCurve, Geom_BSplineCurve* and *Geom_BSplineSurface* into the dedicated classes *BSplCLib_Cache* and *BSplSLib_Cache*.
The benefits of this change are:
* Reduced memory footprint of OCCT shapes (up to 20% on some cases)
@@ -887,7 +887,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 +950,6 @@ The related classes, e.g. *AIS_LocalContext*, and methods ( <i>AIS_InteractiveCo
The main functionality provided by Local Context - selection of object subparts - can be now used within Neutral Point without opening any Local Context.
The property *SelectionMode()* has been removed from the class *AIS_InteractiveObject*.
This property contradicts to selection logic, since it is allowed to activate several Selection modes at once.
Therefore keeping one selection mode as object field makes no sense.
Applications that used this method should implement selection mode caching at application level, if it is necessary for some reason.
@subsection upgrade_occt700_separate_caf_visualisation Separation of visualization part from TKCAF
Visualization CAF attributes have been moved into a new toolkit *TKVCAF*.
@@ -969,262 +964,20 @@ When using documents loaded from a file, make sure to call method *TPrsStd_AISVi
Conversion of *gp_Quaternion* to and from intrinsic Tait-Bryan angles (including *gp_YawPitchRoll*) is fixed.
Before that fix the sequence of rotation axes was opposite to the intended; e.g. *gp_YawPitchRoll* (equivalent to *gp_Intrinsic_ZYX*) actually defined intrinsic rotations around X, then Y, then Z. Now the rotations are made in the correct order.
Before that fix the sequence of rotation axes was opposite to the intended; e.g. *gp_YawPitchRoll* (equivalent to *gp_Intrinsic_ZYX*) actually defined intrinsic rotations around X, then Y, then Z. Now the rotations are made in correct order.
The applications that use *gp_Quaternion* to convert Yaw-Pitch-Roll angles (or other intrinsic Tait-Bryan sequences) may need to be updated to take this change into account.
Applications that use *gp_Quaternion* to convert Yaw-Pitch-Roll angles (or other intrinsic Tait-Bryan sequences) may need to be updated to take this change into account.
@subsection upgrade_zoom_persistent_selection Zoom Persistent Selection
Zoom persistent selection introduces a new structure *Graphic3d_TransformPers* to transform persistence methods and parameters and a new class *Graphic3d_WorldViewProjState* to refer to the camera transformation state. You might need to update your code to deal with the new classes if you were using the related features. Please, keep in mind the following:
Zoom persistent selection introduces a new structure *Graphic3d_TransformPers* for transform persistence methods and parameters and a new class *Graphic3d_WorldViewProjState* for referring camera transformation state. You might need to update your code to deal with the new classes if you were using the related features. Please, keep in mind the following:
* *Graphic3d_Camera::ModelViewState* has been renamed to *Graphic3d_Camera::WorldViewState*.
* Transformation matrix utilities from *OpenGl_Utils* namespace have been moved to *Graphic3d_TransformUtils* and *Graphic3d_TransformUtils.hxx* header respectively.
* Matrix stack utilities from *OpenGl_Utils* namespace have been moved to *OpenGl_MatrixStack* class and *OpenGl_MatrixStack.hxx* header respectively.
* *OpenGl_View* methods *Begin/EndTransformPersistence* have been removed. Please, use *Graphic3d_TransformPers::Apply()* instead to apply persistence to perspective and world-view projection matrices.
@subsection upgrade_occt700_correction_of_texture Texture mapping of objects
@subsection Correction of texture mapping of objects
Textured objects now have the priority over the environment mapping.
Redundant enumerations *V3d_TypeOfSurface* and *Graphic3d_TypeOfSurface*, class *OpenGl_SurfaceDetailState*, the corresponding methods from *Graphic3d_CView, OpenGl_ShaderManager, OpenGl_View, V3d_View* and *V3d_Viewer* have been deleted.
Draw command *VSetTextureMode* has been deleted.
@subsection upgrade_occt700_wfshape Shape presentation builders
Presentation tools for building Wireframe presentation have been refactored to eliminate duplicated code and interfaces.
Therefore, the following classes have been modified:
* *StdPrs_WFDeflectionShape* and *Prs3d_WFShape* have been removed. *StdPrs_WFShape* should be used instead.
* *StdPrs_ToolShadedShape* has been renamed to *StdPrs_ToolTriangulatedShape*.
@section upgrade_occt710 Upgrade to OCCT 7.1.0
@subsection upgrade_710_aspects Presentation attributes
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.):
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()*.
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.
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.
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.
@subsection upgrade_710_types Typedefs
The following type definitions in OCCT has been modified to use C++11 types:
- *Standard_Boolean* is now *bool* (previously *unsigned int*).
- *Standard_ExtCharacter* is now *char16_t* (previously *short*).
- *Standard_ExtString;* is now *const char16_t* (previously *const short*).
- *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*.
@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.
@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.
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.
*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.
@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*.
Method *AIS_InteractiveContext::Hilight* is now deprecated and highlights the 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.
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 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).
@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.
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.
* 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_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.
Interaction of texture and environment texture is fixed. Textured objects have priority over the environment mapping.
Redundant enumerations V3d_TypeOfSurface and Graphic3d_TypeOfSurface, class OpenGl_SurfaceDetailState, corresponding methods from Graphic3d_CView, OpenGl_ShaderManager, OpenGl_View, V3d_View, V3d_Viewer are deleted.
Draw command VSetTextureMode is deleted.

0
dox/license.md Normal file → Executable file
View File

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
@@ -1482,6 +1461,14 @@ vnbselected
~~~~~
Returns the number of selected objects in the interactive context.
@subsubsection occt_draw_4_2_17 vantialiasing
Syntax:
~~~~~
vantialiasing 1|0
~~~~~
Sets antialiasing if the command is called with 1 or unsets otherwise.
@subsubsection occt_draw_4_2_18 vpurgedisplay
Syntax:
@@ -1985,6 +1972,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 +2314,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 +2433,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 +2444,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 +2467,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 +2477,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 +2497,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 +4029,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 +5249,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 +5374,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 +5935,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 +6642,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 +7619,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 +7713,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 +8908,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 +9885,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
@@ -788,7 +799,7 @@ Foundation classes provide in the package *Plugin* a method named *Load()*, whi
That method reads the information regarding available plug-ins and their locations from the resource file *Plugin* found by environment variable *CSF_PluginDefaults*:
~~~~~
$CSF_PluginDefaults/Plugin
$CSF_PluginDefaults/.Plugin
~~~~~
The *Load* method looks for the library name in the resource file or registry through its GUID, for example, on UNIX:
@@ -796,85 +807,132 @@ The *Load* method looks for the library name in the resource file or registry t
! METADATADRIVER whose value must be OS or DM.
! FW
a148e300-5740-11d1-a904-080036aaa103.Location: libFWOSPlugin.so
a148e300-5740-11d1-a904-080036aaa103.Location:
libFWOSPlugin.so
a148e300-5740-11d1-a904-080036aaa103.CCL:
/adv_44/CAS/BAG/FW-K4C/inc/FWOS.ccl
! FWDM
a148e301-5740-11d1-a904-080036aaa103.Location:
libFWDMPlugin.so
a148e301-5740-11d1-a904-080036aaa103.CCL:
/adv_44/CAS/BAG/DESIGNMANAGER-K4C/inc/DMAccess.ccl|/
adv_44/CAS/BAG/DATABASE-K4C/inc/FWDMCommands.ccl
a148e301-5740-11d1-a904-080036aaa103.Message: /adv_44/CAS/
BAG/DESIGNMANAGER-K4C/etc/locale/DMAccess
! Copy-Paste
5ff7dc00-8840-11d1-b5c2-00a0c9064368.Location:
libCDMShapeDriversPlugin.so
5ff7dc01-8840-11d1-b5c2-00a0c9064368.Location:
libCDMShapeDriversPlugin.so
5ff7dc02-8840-11d1-b5c2-00a0c9064368.Location:
libCDMShapeDriversPlugin.so
5ff7dc03-8840-11d1-b5c2-00a0c9064368.Location:
libCDMShapeDriversPlugin.so
5ff7dc04-8840-11d1-b5c2-00a0c9064368.Location:
libCDMShapeDriversPlugin.so
! Plugs 2d plotters:
d0d722a2-b4c9-11d1-b561-0000f87a4710.location: FWOSPlugin
d0d722a2-b4c9-11d1-b561-0000f87a4710.CCL: /adv_44/CAS/BAG/
VIEWERS-K4C/inc/CCLPlotters.ccl
d0d722a2-b4c9-11d1-b561-0000f87a4710.Message: /adv_44/CAS/
BAG/VIEWERS-K4C/etc/locale/CCLPlotters
!SHAPES
e3708f72-b1a8-11d0-91c2-080036424703.Location:
libBRepExchangerPlugin.so
e3708f72-b1a8-11d0-91c2-080036424703.CCL: /adv_44/CAS/BAG/
FW-K4C/inc/BRep.ccl
~~~~~
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 *Factory* 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
To invoke one of the services provided by the plug-in, you may call the *Plugin::Load()* global function with the *Standard_GUID* of the requested service as follows:
To invoke one of the services provided by the plug-in, you may call the *Plugin::ServiceFactory* global function with the *Standard_GUID* of the requested service as follows:
~~~~~{.cpp}
Handle(FADriver_PartStorer)::DownCast(PlugIn::Load (yourStandardGUID));
~~~~~
Handle(FADriver_PartStorer)::DownCast
(PlugIn::ServiceFactory
(PlugIn_ServiceId(yourStandardGUID)))
~~~~~
Let us take *FAFactory.hxx* and *FAFactory.cxx* as an example:
Let us take *FAFactory.cxx* as an example:
~~~~~{.cpp}
#include <Standard_Macro.hxx>
#include <Standard_GUID.hxx>
#include <Standard_Transient.hxx>
class FAFactory
{
public:
Standard_EXPORT static Handle(Standard_Transient) Factory (const Standard_GUID& theGUID);
};
~~~~~
~~~~~{.cpp}
#include <FAFactory.hxx>
#include <FAFactory.ixx>
#include <FADriver_PartRetriever.hxx>
#include <FADriver_PartStorer.hxx>
#include <FirstAppSchema.hxx>
#include <Standard_GUID.hxx>
#include <Standard_Failure.hxx>
#include <FACDM_Application.hxx>
#include <Plugin_Macro.hxx>
static Standard_GUID StorageDriver ("45b3c690-22f3-11d2-b09e-0000f8791463");
static Standard_GUID RetrievalDriver("45b3c69c-22f3-11d2-b09e-0000f8791463");
static Standard_GUID Schema ("45b3c6a2-22f3-11d2-b09e-0000f8791463");
PLUGIN(FAFactory)
static Standard_GUID
StorageDriver(“45b3c690-22f3-11d2-b09e-0000f8791463”);
static Standard_GUID
RetrievalDriver(“45b3c69c-22f3-11d2-b09e-0000f8791463”);
static Standard_GUID
Schema(“45b3c6a2-22f3-11d2-b09e-0000f8791463”);
//======================================================
// function : Factory
// purpose :
//======================================================
Handle(Standard_Transient) FAFactory::Factory (const Standard_GUID& theGUID)
Handle(Standard_Transient) FAFactory::Factory(const Standard_GUID& aGUID)
{
if (theGUID == StorageDriver)
{
std::cout << "FAFactory : Create store driver\n";
static Handle(FADriver_PartStorer) sd = new FADriver_PartStorer();
if(aGUID == StorageDriver) {
cout “FAFactory : Create store driver” endl;
static Handle(FADriver_PartStorer) sd = new FADriver_PartStorer();
return sd;
}
if (theGUID == RetrievalDriver)
{
std::cout << "FAFactory : Create retrieve driver\n";
static Handle(FADriver_PartRetriever) rd = new FADriver_PartRetriever();
if(aGUID == RetrievalDriver) {
cout “FAFactory : Create retrieve driver” endl;
static Handle(FADriver_PartRetriever)
rd = new FADriver_PartRetriever();
return rd;
}
if (theGUID == Schema)
{
std::cout << "FAFactory : Create schema\n";
static Handle(FirstAppSchema) s = new FirstAppSchema();
if(aGUID == Schema) {
cout “FAFactory : Create schema” endl;
static Handle(FirstAppSchema) s = new FirstAppSchema();
return s;
}
Standard_Failure::Raise ("FAFactory: unknown GUID");
return Handle(Standard_Transient)();
Standard_Failure::Raise(“FAFactory: unknown GUID);
Handle(Standard_Transient) t;
return t;
}
// export plugin function "PLUGINFACTORY"
PLUGIN(FAFactory)
~~~~~
Application might also instantiate a factory by linking to the library and calling *FAFactory::Factory()* directly.
#### Without using the Software Factory
To create a factory without using the Software Factory, define a *dll* project under Windows or a library under UNIX by using a source file as specified above. The *FAFactory* class is implemented as follows:
~~~~~
#include <Handle_Standard_Transient.hxx>
#include <Standard_Macro.hxx>
class Standard_Transient;
class Standard_GUID;
class FAFactory {
public:
Standard_EXPORT static Handle_Standard_Transient
Factory(const Standard_GUID& aGUID) ;
. . .
};
~~~~~
@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).
@@ -2882,6 +2724,7 @@ No smoothing algorithm is provided. Consequently, a polyhedron will be treated
However, there some restrictions in HLR use:
* Points are not processed;
* Z-clipping planes are not used;
* Infinite faces or lines are not processed.
@@ -3051,7 +2894,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 +2925,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.
@@ -1291,19 +1247,4 @@ 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.
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.
The following sample code reads a shape from ASCII file and writes it to a binary one:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
TopoDS_Shape aShape;
if (BRepTools::Read (aShape, "source_file.txt")) {
BinTools::Write (aShape, "result_file.bin");
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -592,7 +592,7 @@ The attribute *TDataStd_UAttribute* with the chosen unique GUID identifies the d
Standard documents offer ready-to-use documents containing a TDF-based data framework. Each document can contain only one framework.
The documents themselves are contained in the instantiation of a class *TDocStd_Application* (or its descendant). This application manages the creation, storage and retrieval of documents.
The documents themselves are contained in the instantiation of a class inheriting from *TDocStd_Application*. This application manages the creation, storage and retrieval of documents.
You can implement undo and redo in your document, and refer from the data framework of one document to that of another one. This is done by means of external link attributes, which store the path and the entry of external links.
@@ -605,15 +605,17 @@ To sum up, standard documents alone provide access to the data framework. They a
@subsection occt_ocaf_4_2 The Application
As a container for your data framework, you need a document, and your document must be contained in your application. This application will be a class *TDocStd_Application* or a class inheriting from it.
As a container for your data framework, you need a document, and your document must be contained in your application. This application will be a class inheriting from *TDocStd_Application*.
@subsubsection occt_ocaf_4_2_1 Creating an application
To create an application, use the following syntax.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
Handle(TDocStd_Application) app = new TDocStd_Application ();
Handle(TDocStd_Application) app
= new MyApplication_Application ();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note that *MyApplication_Application* is a class, which you have to create and which will inherit from *TDocStd_Application*.
@subsubsection occt_ocaf_4_2_2 Creating a new document
@@ -624,16 +626,13 @@ Handle(TDocStd_Document) doc;
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.
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
To retrieve the application containing your document, you use the syntax below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
app = Handle(TDocStd_Application)::DownCast (doc->Application());
app = Handle(TDocStd_Application)::DownCast
(doc->Application());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@subsection occt_ocaf_4_3 The Document
@@ -653,97 +652,36 @@ To retrieve the document from a label in its data framework, you use *TDocStd_Do
doc = TDocStd_Document::Get(label);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@subsubsection occt_ocaf_4_3_format Defining storage format
@subsubsection occt_ocaf_4_3_3 Saving the document
OCAF uses a 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.
If in your document you use only standard attributes (from the packages *TDF, TDataStd, TNaming, TFunction, TPrsStd* and *TDocStd*), you just do the following steps:
For that, use method TDocStd_Application::DefineFormat(), for instance:
~~~~~
app->DefineFormat ("NewDocumentFormat", "New format for OCAF documents", "ndf",
new NewDocumentFormat_RetrievalDriver(),
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.
OCAF provides several standard formats, each covering some set of OCAF attributes:
<table>
<tr><th>Format</th><th>Persistent toolkit</th><th>OCAF attributes covered</th></tr>
<tr><td colspan=3>Legacy formats (read only)</td></tr>
<tr><td>OCC-StdLite </td><td> TKStdL </td><td> TKLCAF </td></tr>
<tr><td>MDTV-Standard </td><td> TKStd </td><td> TKLCAF + TKCAF </td></tr>
<tr><td colspan=3>Binary formats</td></tr>
<tr><td>BinLOcaf </td><td> TKBinL </td><td> TKLCAF </td></tr>
<tr><td>BinOcaf </td><td> TKBin </td><td> TKLCAF + TKCAF </td></tr>
<tr><td>BinXCAF </td><td> TKBinXCAF </td><td> TKLCAF + TKCAF + TKXCAF </td></tr>
<tr><td>TObjBin </td><td> TKBinTObj </td><td> TKLCAF + TKTObj </td></tr>
<tr><td colspan=3>XML formats</td></tr>
<tr><td>XmlLOcaf </td><td> TKXmlL </td><td> TKLCAF </td></tr>
<tr><td>XmlOcaf </td><td> TKXml </td><td> TKLCAF + TKCAF </td></tr>
<tr><td>XmlXCAF </td><td> TKXmlXCAF </td><td> TKLCAF + TKCAF + TKXCAF </td></tr>
<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.
These methods allow defining corresponding formats easily, e.g.:
* In your application class (which inherits class *TDocStd_Application*) implement two methods:
+ Formats (TColStd_SequenceOfExtendedString& theFormats), which append to a given sequence <i>\<theFormats\></i> your document format string, for example, "NewDocumentFormat" -- this string is also set in the document creation command
+ ResourcesName(), which returns a string with a name of resources file (this file contains a description about the extension of the document, storage/retrieval drivers GUIDs...), for example, "NewFormat"
* Create the resource file (with name, for example, "NewFormat") with the following strings:
~~~~~
BinDrivers::DefineFormat (app); // define format "BinOcaf"
~~~~~
Use these toolkits as an 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.
@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.
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.
Then create that resource file and define the parameters of your format:
~~~~~
ndf.FileFormat: NewDocumentFormat
NewDocumentFormat.Description: New Document Format Version 1.0
formatlist:NewDocumentFormat
NewDocumentFormat: New Document Format Version 1.0
NewDocumentFormat.FileExtension: ndf
NewDocumentFormat.StoragePlugin: bb5aa176-c65c-4c84-862e-6b7c1fe16921
NewDocumentFormat.RetrievalPlugin: 76fb4c04-ea9a-46aa-88a2-25f6a228d902
NewDocumentFormat.StoragePlugin: bd696000-5b34-11d1-b5ba-00a0c9064368
NewDocumentFormat.RetrievalPlugin: bd696001-5b34-11d1-b5ba-00a0c9064368
NewDocumentFormatSchema: bd696002-5b34-11d1-b5ba-00a0c9064368
NewDocumentFormat.AttributeStoragePlugin:57b0b826-d931-11d1-b5da-00a0c9064368
NewDocumentFormat.AttributeRetrievalPlugin:57b0b827-d931-11d1-b5da-00a0c9064368
~~~~~
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.
* Copy the resource file "Plugin" from $CASROOT/src/StdResource
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:
~~~~~
bb5aa176-c65c-4c84-862e-6b7c1fe16921.Location: TKNewFormat
76fb4c04-ea9a-46aa-88a2-25f6a228d902.Location: TKNewFormat
~~~~~
In order to have these resource files loaded during the program execution, it is necessary to set two environment variables: *CSF_PluginDefaults* and *CSF_NewFormatDefaults*.
For example, set the files in the directory *MyApplicationPath/MyResources*:
In order to set the paths for these files it is necessary to set the environments: *CSF_PluginDefaults* and *CSF_NewFormatDefaults*. For example, set the files in the directory *MyApplicationPath/MyResources*:
~~~~~
setenv CSF_PluginDefaults MyApplicationPath/MyResources
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:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
app->SaveAs(doc, "/tmp/example.caf");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Once these steps are taken you may run your application, create documents and Save/Open them.
@subsubsection occt_ocaf_4_3_4 Opening the document from a file
@@ -1762,6 +1700,37 @@ Both the XML format and the XML OCAF persistence code are extensible in the sens
* Add (in the new *DocumentStorageDriver*) the *targetNamespace* accompanied with its prefix, using method *XmlDrivers_DocumentStorageDriver::AddNamespace*. The same is done for all namespaces objects which are used by the new persistence, with the exception of the "ocaf" namespace.
* Pass (in every OCAF attribute driver) the namespace prefix of the *targetNamespace* to the constructor of *XmlMDF_ADriver*.
@section occt_ocaf_9a Persistent Data Storage
@subsection occt_ocaf_9a_1 Introduction
In OCAF, persistence, that is, the mechanism used to save a document in a file, is based on an explicit formal description of the data saved.
When you open a document, the application reads the corresponding file and first creates a memory representation of it. This representation is then converted to the application data model — the OCAF-based data structure the application operates on. The file's memory representation consists of objects defined by classes known as persistent.
OCAF includes a ready-to-use schema suitable for most applications.
However, it can be extended if needed.
Applications using compound documents extensively (saving data in many files linked together) should implement data management services. It is out the scope of OCAF to provide functions such as:
* Version and configuration management of compound documents;
* Querying a referenced document for its referencing documents.
In order to ease the delegation of document management to a data management application, OCAF encapsulates the file management functions in a driver (the meta-data driver). You have to implement this driver for your application to communicate with the data management system of your choice.
@subsection occt_ocaf_9a_2 Schemes of Persistence
There are three schemes of persistence, which you can use to store and retrieve OCAF data (documents):
* <i> Standard</i> persistence schema, compatible with previous OCAF applications. This schema is deprecated and supports only reading of standard attributes (no writing).
* <i> XmlOcaf</i> persistence, allowing the storage of all OCAF data in XML form
* <i> BinOcaf</i> persistence, allowing the storage of all OCAF data in binary format form
In an OCAF application you can use any persistence schema or
even all three of them. The choice is made depending on the *Format* string of stored OCAF documents
or automatically by the file header data -- on retrieval.
@section occt_ocaf_10 GLOSSARY
* **Application** -- a document container holding all documents containing all application data.
@@ -1846,21 +1815,116 @@ In C++, the application behavior is implemented in virtual functions redefined i
You can also implement the user interface in the Java language using
the Swing-based Java Application Desktop component (JAD) provided with OCAF.
@subsection occt_ocaf_11_b An example of OCAF usage
To create a useful OCAF-based application, it is necessary to redefine two deferred methods: <i> Formats</i> and <i> ResourcesName</i>
In the <i> Formats </i> method, add the format of the documents, which need to be read by the application and may have been built in other applications.
For example:
~~~~
void myApplication::Formats(TColStd_SequenceOfExtendedString& Formats)
{
Formats.Append(TCollection_ExtendedString ("OCAF-myApplication"));
}
~~~~
In the <i> ResourcesName</i> method, you only define the name of the resource file. This
file contains several definitions for the saving and opening mechanisms associated
with each format and calling of the plug-in file.
~~~~
Standard_CString myApplication::ResourcesName()
{
return Standard_CString ("Resources");
}
~~~~
To obtain the saving and opening mechanisms, it is necessary to set two environment variables: <i> CSF_PluginDefaults</i>, which defines the path of the plug-in file, and <i> CSF_ResourcesDefault</i>, which defines the resource file:
~~~~
SetEnvironmentVariable ( "CSF_ResourcesDefaults",myDirectory);
SetEnvironmentVariable ( "CSF_PluginDefaults",myDirectory);
~~~~
The plugin and the resource files of the application will be located in <i> myDirector</i>.
The name of the plugin file must be <i>Plugin</i>.
### Resource File
The resource file describes the documents (type and extension) and
the type of data that the application can manipulate
by identifying the storage and retrieval drivers appropriate for this data.
Each driver is unique and identified by a GUID generated, for example, with the <i> uuidgen </i> tool in Windows.
Five drivers are required to use all standard attributes provided within OCAF:
* the schema driver (ad696002-5b34-11d1-b5ba-00a0c9064368)
* the document storage driver (ad696000-5b34-11d1-b5ba-00a0c9064368)
* the document retrieval driver (ad696001-5b34-11d1-b5ba-00a0c9064368)
* the attribute storage driver (47b0b826-d931-11d1-b5da-00a0c9064368)
* the attribute retrieval driver (47b0b827-d931-11d1-b5da-00a0c9064368)
These drivers are provided as plug-ins and are located in the <i> PappStdPlugin</i> library.
For example, this is a resource file, which declares a new model document OCAF-MyApplication:
~~~~
formatlist:OCAF-MyApplication
OCAF-MyApplication.Description: MyApplication Document Version 1.0
OCAF-MyApplication.FileExtension: sta
OCAF-MyApplication.StoragePlugin: ad696000-5b34-11d1-b5ba-00a0c9064368
OCAF-MyApplication.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368
OCAF-MyApplicationSchema: ad696002-5b34-11d1-b5ba-00a0c9064368
OCAF-MyApplication.AttributeStoragePlugin: 47b0b826-d931-11d1-b5da-00a0c9064368
OCAF-MyApplication.AttributeRetrievalPlugin: 47b0b827-d931-11d1-b5da-00a0c9064368
~~~~
### Plugin File
The plugin file describes the list of required plug-ins to run the application and the
libraries in which plug-ins are located.
You need at least the <i> FWOSPlugin</i> and the plug-in drivers to run an OCAF application.
The syntax of each item is <i> Identification.Location Library_Name, </i> where:
* Identification is GUID.
* Location defines the location of the Identification (where its definition is found).
* Library_Name is the name (and path to) the library, where the plug-in is located.
For example, this is a Plugin file:
~~~~
a148e300-5740-11d1-a904-080036aaa103.Location: FWOSPlugin
! base document drivers plugin
ad696000-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
ad696001-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
ad696002-5b34-11d1-b5ba-00a0c9064368.Location: PAppStdPlugin
47b0b826-d931-11d1-b5da-00a0c9064368.Location: PAppStdPlugin
47b0b827-d931-11d1-b5da-00a0c9064368.Location: PAppStdPlugin
~~~~
@subsection occt_ocaf_11_1 Implementation of Attribute Transformation in a HXX file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
#include <TDF_Attribute.hxx>
\#include <TDF_Attribute.hxx>
#include <gp_Ax3.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Trsf.hxx>
\#include <gp_Ax3.hxx>
\#include <gp_Pnt.hxx>
\#include <gp_Vec.hxx>
\#include <gp_Trsf.hxx>
// This attribute implements a transformation data container
//! This attribute implements a transformation data container
class MyPackage_Transformation : public TDF_Attribute
{
public:
//!@ name Static methods
//!@name Static methods
//! The method returns a unique GUID of this attribute.
//! By means of this GUID this attribute may be identified
@@ -1871,12 +1935,12 @@ public:
//! The found or created attribute is returned.
Standard_EXPORT static Handle(MyPackage_Transformation) Set (const TDF_Label theLabel);
//!@ name Methods for access to the attribute data
//!@name Methods for access to the attribute data
//! The method returns the transformation.
Standard_EXPORT gp_Trsf Get () const;
//!@ name Methods for setting the data of transformation
//!@name Methods for setting the data of transformation
//! The method defines a rotation type of transformation.
Standard_EXPORT void SetRotation (const gp_Ax1& theAxis, Standard_Real theAngle);
@@ -1899,7 +1963,7 @@ public:
//! The method defines a complex type of transformation from one co-ordinate system to another.
Standard_EXPORT void SetTransformation (const gp_Ax3& theCoordinateSystem1, const gp_Ax3& theCoordinateSystem2);
//!@ name Overridden methods from TDF_Attribute
//!@name Overridden methods from TDF_Attribute
//! The method returns a unique GUID of the attribute.
//! By means of this GUID this attribute may be identified among other attributes attached to the same label.
@@ -1920,7 +1984,7 @@ public:
//! Prints the content of this attribute into the stream.
Standard_EXPORT Standard_OStream& Dump(Standard_OStream& theOS);
//!@ name Constructor
//!@name Constructor
//! The C++ constructor of this atribute class.
//! Usually it is never called outside this class.
@@ -1948,7 +2012,7 @@ private:
@subsection occt_ocaf_11_2 Implementation of Attribute Transformation in a CPP file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
#include <MyPackage_Transformation.hxx>
\#include <MyPackage_Transformation.hxx>
//=======================================================================
//function : GetID

View File

@@ -121,7 +121,7 @@ IVtkTools::InitShapeMapper(Mapper);
It is possible to get an instance of *vtkLookupTable class* with a default OCCT color scheme by means of the following method:
~~~~
vtkSmartPointer<vtkLookupTable> Table = IVtkTools::InitLookupTable();
vtkLookupTable* Table = IVtkTools::InitLookupTable();
~~~~
@subsubsection occt_vis_3_2_2 Custom color scheme

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

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