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

Compare commits

..

1 Commits

Author SHA1 Message Date
akaftasev
551d35ab93 0032839: BRepMesh_IncrementalMesh - The ability to pass progress indication to one of the constructors was not added
Added progress indication to the constructor of the BRepMesh_IncrementalMesh
2022-02-16 13:17:58 +03:00
6483 changed files with 23791 additions and 69892 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
@@ -6,26 +6,6 @@ set (CMAKE_SUPPRESS_REGENERATION TRUE)
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
# set using C++ standard
set (BUILD_CPP_STANDARD "C++11" CACHE STRING "Select using c++ standard.")
set_property(CACHE BUILD_CPP_STANDARD PROPERTY STRINGS "C++11" "C++14" "C++17" "C++20" "C++23")
# Set desired C++ standard
if ("${BUILD_CPP_STANDARD}" STREQUAL "C++11")
set (CMAKE_CXX_STANDARD 11)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++14")
set (CMAKE_CXX_STANDARD 14)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++17")
set (CMAKE_CXX_STANDARD 17)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++20")
set (CMAKE_CXX_STANDARD 20)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++23")
set (CMAKE_CXX_STANDARD 23)
else ()
message (FATAL_ERROR, "misprint in c++ standard name")
endif()
set (CMAKE_CXX_STANDARD_REQUIRED ON)
# macro: include patched file if it exists
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake")
@@ -76,20 +56,6 @@ set_property (GLOBAL PROPERTY OCC_VERSION_MAJOR ${OCC_VERSION_MAJOR})
set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR})
set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE})
# set soversion variable determining compatibility version on platforms with symlinks
# 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance
if (NOT BUILD_SOVERSION_NUMBERS)
set (BUILD_SOVERSION_NUMBERS "0" CACHE STRING "${BUILD_SOVERSION_NUMBERS_DESCR}" FORCE)
SET_PROPERTY(CACHE BUILD_SOVERSION_NUMBERS PROPERTY STRINGS 0 1 2 3)
# update default state of soversion on different platforms
if (WIN32 OR ANDROID OR EMSCRIPTEN)
set (BUILD_SOVERSION_NUMBERS 0)
else()
set (BUILD_SOVERSION_NUMBERS 2)
endif()
endif()
set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}")
# Regeneration of OCCT resource files
@@ -820,12 +786,6 @@ else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
endif()
# ExpToCasExe
if (EMSCRIPTEN)
list (REMOVE_ITEM BUILD_TOOLKITS TKExpress)
list (REMOVE_ITEM BUILD_TOOLKITS ExpToCasExe)
endif()
# bison
if (BUILD_YACCLEX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")
@@ -1265,7 +1225,7 @@ foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
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 "file(INSTALL FILES \"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" DESTINATION \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/\" TYPE FILE)")
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})

View File

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

View File

@@ -384,8 +384,6 @@ t TKSTEPBase
t TKSTL
t TKVRML
t TKXCAF
t TKXDE
t TKXDECascade
t TKXDEIGES
t TKXDESTEP
t TKXSBase
@@ -396,9 +394,6 @@ n DBRep
n DDF
n DDataStd
n DDocStd
n DE
n DEXCAFCascade
n DEBRepCascade
n DNaming
n DPrsStd
n Draw
@@ -480,6 +475,3 @@ n TreeModel
n View
n ViewControl
n VInspector
n Express
t TKExpress
x ExpToCasExe

View File

@@ -22,4 +22,6 @@ if (3RDPARTY_DIR)
endforeach()
endif()
find_package (BISON 3.7.4)
# bison 3.2 is required because it provides options to avoid generation of redundant header
# files and embedding of local paths in the generated code
find_package (BISON 3.2)

View File

@@ -32,13 +32,15 @@ if(__COTIRE_INCLUDED)
endif()
set(__COTIRE_INCLUDED TRUE)
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
# call cmake_minimum_required, but prevent modification of the CMake policy stack in include mode
# cmake_minimum_required also sets the policy version as a side effect, which we have to avoid
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(PUSH)
endif()
cmake_minimum_required(VERSION 2.8.12)
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(POP)
endif()
set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
set (COTIRE_CMAKE_MODULE_VERSION "1.7.9")

View File

@@ -1,96 +1,4 @@
# Draco - a library for a lossy vertex data compression, used as extension to glTF format.
# https://github.com/google/draco
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
if (NOT DEFINED INSTALL_DRACO)
set (INSTALL_DRACO OFF CACHE BOOL "${INSTALL_DRACO_DESCR}")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_DIR)
set (3RDPARTY_DRACO_DIR "" CACHE PATH "The directory containing Draco")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_INCLUDE_DIR)
set (3RDPARTY_DRACO_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the Draco")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY OR NOT 3RDPARTY_DRACO_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DIR}")
set (3RDPARTY_DRACO_LIBRARY "" CACHE FILEPATH "Draco library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY_DIR)
set (3RDPARTY_DRACO_LIBRARY_DIR "" CACHE PATH "The directory containing Draco library")
endif()
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_DRACO_DIR OR NOT EXISTS "${3RDPARTY_DRACO_DIR}")
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" draco DRACO_DIR_NAME)
if (DRACO_DIR_NAME)
set (3RDPARTY_DRACO_DIR "${3RDPARTY_DIR}/${DRACO_DIR_NAME}" CACHE PATH "The directory containing Draco" FORCE)
endif()
endif()
endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
set (DRACO_INCLUDE_PATH "${3RDPARTY_DRACO_DIR}/include")
set (DRACO_LIBRARY_PATH "${3RDPARTY_DRACO_DIR}/lib")
endif()
if (NOT 3RDPARTY_DRACO_INCLUDE_DIR)
if (DRACO_INCLUDE_PATH AND EXISTS "${DRACO_INCLUDE_PATH}")
set (3RDPARTY_DRACO_INCLUDE_DIR "${DRACO_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of DRACO" FORCE)
endif()
endif()
if (NOT 3RDPARTY_DRACO_LIBRARY_DIR)
if (DRACO_LIBRARY_PATH AND EXISTS "${DRACO_LIBRARY_PATH}")
set (3RDPARTY_DRACO_LIBRARY_DIR "${DRACO_LIBRARY_PATH}" CACHE FILEPATH "The directory containing DRACO library" FORCE)
endif()
endif()
if (3RDPARTY_DRACO_INCLUDE_DIR AND EXISTS "${3RDPARTY_DRACO_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_DRACO_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DRACO_INCLUDE_DIR)
endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
if (NOT 3RDPARTY_DRACO_LIBRARY OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (3RDPARTY_DRACO_LIBRARY "3RDPARTY_DRACO_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to Draco library" FORCE)
find_library (3RDPARTY_DRACO_LIBRARY NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_LIBRARY_DIR}"
PATH_SUFFIXES lib
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY AND EXISTS "${3RDPARTY_DRACO_LIBRARY}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
endif()
endif()
endif()
if (3RDPARTY_DRACO_LIBRARY_DIR AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_DRACO_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_DRACO_LIBRARY_DIR)
endif()
if (INSTALL_DRACO)
get_filename_component(3RDPARTY_DRACO_LIBRARY_REALPATH ${3RDPARTY_DRACO_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endif()
THIRDPARTY_PRODUCT("DRACO" "draco/compression/decode.h" "CSF_Draco" "")

View File

@@ -26,7 +26,9 @@ if (3RDPARTY_DIR)
endforeach()
endif()
find_package (FLEX 2.6.4)
# flex 2.5.37 is required because closest known lower version, 2.5.3 from WOK 6.8.0,
# generates code which is unusable on Windows (includes unistd.h without any way to avoid this)
find_package (FLEX 2.5.37)
if (NOT FLEX_FOUND OR NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_INCLUDE_DIR)

View File

@@ -25,9 +25,6 @@ if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
endif()
if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
@@ -116,9 +113,9 @@ if (MSVC)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]"))
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
endif()
if (BUILD_SHARED_LIBS)
@@ -130,10 +127,14 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
if ("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 "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
elseif(NOT WIN32)
# CLang for Windows (at least CLang 8.0 distributed with VS 2019)
# does not support option "-std=c++0x"
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
@@ -144,10 +145,14 @@ elseif(MINGW)
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
# Require C++11
set (CMAKE_CXX_FLAGS "-std=gnu++0x ${CMAKE_CXX_FLAGS}")
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
# Require C++11
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")

View File

@@ -80,9 +80,9 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
set (COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (COMPILER gxx)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set (COMPILER icc)
else()
set (COMPILER ${CMAKE_GENERATOR})
@@ -589,7 +589,9 @@ macro (OCCT_UPDATE_TARGET_FILE)
endif()
install (CODE
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
"cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
@@ -598,7 +600,8 @@ macro (OCCT_UPDATE_TARGET_FILE)
string (REGEX REPLACE \"[\\\\]?[\\\$]{OCCT_INSTALL_BIN_LETTER}\" \"\${OCCT_INSTALL_BIN_LETTER}\" line \"\${line}\")
file (APPEND \"\${TARGET_FILENAME}\" \"\${line}\\n\")
endforeach()
endforeach()")
endforeach()
cmake_policy(POP)")
endmacro()
macro (OCCT_INSERT_CODE_FOR_TARGET)
@@ -612,14 +615,17 @@ macro (OCCT_INSERT_CODE_FOR_TARGET)
endmacro()
macro (OCCT_UPDATE_DRAW_DEFAULT_FILE)
install(CODE "set (DRAW_DEFAULT_FILE_NAME \"${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/DrawResources/DrawPlugin\")
install(CODE "cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
set (DRAW_DEFAULT_FILE_NAME \"${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/DrawResources/DrawPlugin\")
file (STRINGS \"\${DRAW_DEFAULT_FILE_NAME}\" DRAW_DEFAULT_CONTENT)
file (REMOVE \"\${DRAW_DEFAULT_FILE_NAME}\")
foreach (line IN LISTS DRAW_DEFAULT_CONTENT)
string (REGEX MATCH \": TK\([a-zA-Z]+\)$\" IS_TK_LINE \"\${line}\")
string (REGEX REPLACE \": TK\([a-zA-Z]+\)$\" \": TK\${CMAKE_MATCH_1}${BUILD_SHARED_LIBRARY_NAME_POSTFIX}\" line \"\${line}\")
file (APPEND \"\${DRAW_DEFAULT_FILE_NAME}\" \"\${line}\\n\")
endforeach()")
endforeach()
cmake_policy(POP)")
endmacro()
macro (OCCT_CREATE_SYMLINK_TO_FILE LIBRARY_NAME LINK_NAME)

View File

@@ -106,12 +106,6 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${FLEX_BISON_TARGET_DIR}/FlexLexer.h")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/FlexLexer.h)
endif()
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
@@ -127,19 +121,6 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
message (STATUS "Info: remove old output FLEX file: ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
endif()
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
@@ -274,8 +255,7 @@ else()
EXPORT OpenCASCADE${CURRENT_MODULE}Targets
RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}"
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
INCLUDES DESTINATION ${INSTALL_DIR_INCLUDE})
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
if (NOT WIN32)
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
@@ -300,17 +280,14 @@ get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR)
get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR)
get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE)
set (OCC_SOVERSION "")
if (BUILD_SOVERSION_NUMBERS GREATER 2)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
elseif (BUILD_SOVERSION_NUMBERS GREATER 1)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}")
elseif (BUILD_SOVERSION_NUMBERS GREATER 0)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}")
if (ANDROID)
# do not append version to the filename
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
else()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_VERSION_MAJOR}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
endif()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_SOVERSION}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
@@ -339,10 +316,10 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}")
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlLibs")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlesLibs")
add_definitions (-DHAVE_GLES2)
endif()

View File

@@ -1,13 +1,5 @@
# tbb
if (NOT DEFINED 3RDPARTY_DIR)
message (FATAL_ERROR "3RDPARTY_DIR is not defined.")
endif()
if ((NOT EXISTS "${3RDPARTY_DIR}") OR ("${3RDPARTY_DIR}" STREQUAL ""))
message (FATAL_ERROR "Directory ${3RDPARTY_DIR} is not set.")
endif()
if (NOT DEFINED INSTALL_TBB AND BUILD_SHARED_LIBS)
set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}")
endif()
@@ -77,186 +69,226 @@ else()
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "the path to tbb.h" FORCE)
endif()
# Throw execution if 3RDPARTY_TBB_DIR is equal to void string.
if ("${3RDPARTY_TBB_DIR}" STREQUAL "")
message (FATAL_ERROR "Directory with one TBB have not found.")
endif()
# common steps for tbb and tbbmalloc
macro (TBB_PRODUCT_SEARCH PRODUCT_LIBRARY_NAME)
# Searching TBBConfig.cmake and TBBTargets-release.cmake in 3RDPARTY_TBB_DIR
# TBBConfig.cmake - is required, TBBTargets-release.cmake is optional.
file (GLOB_RECURSE TBB_CONFIG_CMAKE_FILE "${3RDPARTY_TBB_DIR}/*TBBConfig.cmake")
if (NOT EXISTS "${TBB_CONFIG_CMAKE_FILE}")
message (FATAL_ERROR "TBBConfig.cmake has not been found.")
endif()
include ("${TBB_CONFIG_CMAKE_FILE}")
string (TOUPPER ${PRODUCT_LIBRARY_NAME} upper_PRODUCT_LIBRARY_NAME)
file (GLOB_RECURSE TBB_TARGET_CMAKE_FILE "${3RDPARTY_TBB_DIR}/*TBBTargets-release.cmake")
if (EXISTS "${TBB_TARGET_CMAKE_FILE}")
include ("${TBB_TARGET_CMAKE_FILE}")
endif()
# define required tbb/tbbmalloc variables
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
# We do not know, full path to file is pointed, or local.
# So, we should check it and output FULL PATH to FILE.
macro (TBB_FILE_NAME_TO_FILEPATH FL_NAME FL_PATH)
if (EXISTS "${FL_NAME}")
# FL_NAME is full path.
set (${FL_PATH} "${FL_NAME}")
else()
# Here we deal with local path, so assign to var full path to file.
# Acquire full path.
set (${FL_PATH} "${3RDPARTY_TBB_DIR}${FL_NAME}")
if (NOT EXISTS "${${FL_PATH}}")
message (FATAL_ERROR "TBB: needed file not found (${FL_PATH}).")
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library")
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL OR NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
endif()
endif()
endmacro()
# TARGET_NAME - is target name from oneTBB cmake file
# it is either "TBB::tbb", or "TBB::tbbmalloc"
# LIB_NAME_UC - is library id (TBB or TBBMALLOC)
# PROPERTY_TO_SET - LIBRARY or DLL
macro (WIN_TBB_PARSE TARGET_NAME LIB_NAME PROPERTY_TO_SET)
set (FILE_NAME "")
set (FILE_PATH "")
set (FILE_DIR "")
if ("${PROPERTY_TO_SET}" STREQUAL "LIBRARY")
get_target_property (FILE_NAME "${TARGET_NAME}" IMPORTED_IMPLIB_RELEASE)
else()
get_target_property (FILE_NAME "${TARGET_NAME}" IMPORTED_LOCATION_RELEASE)
if (WIN32 AND NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library")
endif()
# acquire full path
TBB_FILE_NAME_TO_FILEPATH("${FILE_NAME}" FILE_PATH)
# check 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_ paths for consistency with specified 3RDPARTY_TBB_DIR
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY FILEPATH "the path to ${upper_PRODUCT_LIBRARY_NAME} library")
get_filename_component (FILE_NAME "${FILE_PATH}" NAME)
get_filename_component (FILE_DIR "${FILE_PATH}" DIRECTORY)
if (NOT EXISTS "${FILE_DIR}/${FILE_NAME}")
set (3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET} "" CACHE FILEPATH "${LIB_NAME} library" FORCE)
set (3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET}_DIR "" CACHE PATH "The directory containing ${LIB_NAME} shared library")
if ("${PROPERTY_TO_SET}" STREQUAL "LIBRARY")
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET}_DIR)
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET}_DIR)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library")
endif()
else()
set (3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET} "${FILE_DIR}/${FILE_NAME}" CACHE FILEPATH "${LIB_NAME} library" FORCE)
set (3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET}_DIR "${FILE_DIR}" CACHE PATH "The directory containing ${LIB_NAME} shared library")
if ("${PROPERTY_TO_SET}" STREQUAL "LIBRARY")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${FILE_DIR}")
else()
list (APPEND 3RDPARTY_DLL_DIRS "${FILE_DIR}")
if (WIN32)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL FILEPATH "the path to ${upper_PRODUCT_LIBRARY_NAME} shared library")
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library")
endif()
endif()
endif()
endmacro()
# TARGET_NAME - is target name from oneTBB cmake file
# it is either "TBB::tbb", or "TBB::tbbmalloc"
# LIB_NAME_UC - is library id (TBB or TBBMALLOC)
macro (LIN_TBB_PARSE TARGET_NAME LIB_NAME)
set (FILE_NAME "")
set (FILE_PATH "")
set (FILE_DIR "")
get_target_property (FILE_NAME "${TARGET_NAME}" IMPORTED_LOCATION_RELEASE)
# acquire full path
TBB_FILE_NAME_TO_FILEPATH("${FILE_NAME}" FILE_PATH)
get_filename_component (FILE_NAME "${FILE_PATH}" NAME)
get_filename_component (FILE_DIR "${FILE_PATH}" DIRECTORY)
if (NOT EXISTS "${FILE_DIR}/${FILE_NAME}")
set (3RDPARTY_${LIB_NAME}_LIBRARY "" CACHE FILEPATH "${LIB_NAME} library" FORCE)
set (3RDPARTY_${LIB_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${LIB_NAME} shared library")
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_NAME}_LIBRARY_DIR)
else()
set (3RDPARTY_${LIB_NAME}_LIBRARY "${FILE_DIR}/${FILE_NAME}" CACHE FILEPATH "${LIB_NAME} library" FORCE)
set (3RDPARTY_${LIB_NAME}_LIBRARY_DIR "${FILE_DIR}" CACHE PATH "The directory containing ${LIB_NAME} shared library")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIB_NAME}_LIBRARY_DIR}")
endif()
endmacro()
if (WIN32)
# Here we should set:
# - 3RDPARTY_*_LIBRARY
# - 3RDPARTY_*_LIBRARY_DIR
# - 3RDPARTY_*_DLL
# - 3RDPARTY_*_DLL_DIR
# where * - is TBB or TBBMALLOC
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
WIN_TBB_PARSE("TBB::${LIB_LOWER}" "${LIB_UPPER}" "LIBRARY")
WIN_TBB_PARSE("TBB::${LIB_LOWER}" "${LIB_UPPER}" "DLL")
endforeach()
else()
# Here we should set:
# - 3RDPARTY_*_LIBRARY
# - 3RDPARTY_*_LIBRARY_DIR
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
LIN_TBB_PARSE("TBB::${LIB_LOWER}" "${LIB_UPPER}")
endforeach()
endif()
# install tbb/tbbmalloc
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
if (WIN32)
if (SINGLE_GENERATOR)
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
endforeach()
else()
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS Release DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS RelWithDebInfo DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS Debug DESTINATION "${INSTALL_DIR_BIN}d")
endforeach()
endif()
if (${COMPILER_BITNESS} EQUAL 32)
set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME ia32)
else()
if (SINGLE_GENERATOR)
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} DESTINATION "${INSTALL_DIR_LIB}")
endforeach()
set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME intel64)
endif()
# tbb/tbbmalloc library
if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME})
# set 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}")
file (GLOB ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/*")
if (${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST)
list (GET ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else()
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
endif()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
PATHS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS Release DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS RelWithDebInfo DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS Debug DESTINATION "${INSTALL_DIR_LIB}d")
endforeach()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
endif()
endif()
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
mark_as_advanced (3RDPARTY_${LIB_UPPER}_LIBRARY 3RDPARTY_${LIB_UPPER}_DLL)
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
else()
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "The path to ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
endif()
# tbb/tbbmalloc shared library
if (WIN32)
if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
set (PRODUCT_PATH_SUFFIXES bin)
# set 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}")
file (GLOB ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/*")
if (${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST)
list (GET ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES bin bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else()
set (PRODUCT_PATH_SUFFIXES bin bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
endif()
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL ${PRODUCT_LIBRARY_NAME}
PATHS "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL ${PRODUCT_LIBRARY_NAME} PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES})
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
endif()
endif()
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR OR EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR)
endif()
endif()
# install tbb/tbbmalloc
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY} NAME)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
else()
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
endif()
endif()
endif()
mark_as_advanced (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL)
endmacro()
#if (BUILD_SHARED_LIBS)
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
TBB_PRODUCT_SEARCH (${LIB})
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
else()
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
endif()
endif()
#endif()

View File

@@ -28,9 +28,6 @@ Applies only for Debug configuration.")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
"Append the postfix to names of output libraries")
set (BUILD_SOVERSION_NUMBERS_DESCR
"Version numbers to put into SONAME: 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance")
set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR
"Disables exceptions like Standard_OutOfRange in Release builds.
Defines No_Exception macros for Release builds when enabled (default).

View File

@@ -780,14 +780,14 @@ proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aTbbDllPath [wokdep:SearchBin "tbb12.dll" "$anArchIter"]
set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter"]
if { "$aTbbDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] $aVcLib "$anArchIter" ]
set aTbbDllPath [wokdep:SearchBin "tbb12.dll" "$anArchIter" "$aPath/bin/$aSubDir/$aVcLib"]
set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter" "$aPath/bin/$aSubDir/$aVcLib"]
if { "$aTbbDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin/$aSubDir/$aVcLib"
} else {
lappend anErrBin$anArchIter "Error: 'tbb12.dll' not found (Intel TBB)"
lappend anErrBin$anArchIter "Error: 'tbb.dll' not found (Intel TBB)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}

View File

@@ -1233,11 +1233,28 @@ proc osutils:convertModules { theModules theSrcDir theSourceDirOther theProjects
lappend aProjectsInModule($aModule) $aToolKit
lappend aDependencies [LibToLink $aToolKit $theSrcDir $theSourceDirOther]
}
# executables
# executables, assume one project per cxx file...
foreach aUnit [OS:executable ${aModule}] {
lappend aProjects $aUnit
lappend aProjectsInModule($aModule) $aUnit
lappend aDependencies [LibToLink $aUnit $theSrcDir $theSourceDirOther]
set aUnitLoc $aUnit
set src_files [_get_used_files $aUnit $theSrcDir false]
set aSrcFiles {}
foreach s $src_files {
regexp {source ([^\s]+)} $s dummy name
lappend aSrcFiles $name
}
foreach aSrcFile $aSrcFiles {
set aFileExtension [file extension $aSrcFile]
if { $aFileExtension == ".cxx" } {
set aPrjName [file rootname $aSrcFile]
lappend aProjects $aPrjName
lappend aProjectsInModule($aModule) $aPrjName
if {[file isdirectory $path/$theSrcDir/$aUnitLoc]} {
lappend aDependencies [LibToLinkX $aUnitLoc [file rootname $aSrcFile] $theSrcDir $theSourceDirOther]
} else {
lappend aDependencies {}
}
}
}
}
}
}
@@ -2093,106 +2110,98 @@ proc osutils:tk:execfiles { theFiles theOutDir theCommand thePrefix theExtension
# Generate Visual Studio project file for executable
proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir theSourceDirOther } {
set aVcFiles {}
set aProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 1]
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
set aProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 1]
set aProjName $theToolKit
set l_compilable [osutils:compilable wnt]
regsub -all -- {__XQTNAM__} $aProjTmpl $aProjName aProjTmpl
set aProjName [file rootname [file tail $f]]
set l_compilable [osutils:compilable wnt]
regsub -all -- {__XQTNAM__} $aProjTmpl $aProjName aProjTmpl
upvar $theGuidsMap aGuidsMap
if { ! [info exists aGuidsMap($aProjName)] } {
set aGuidsMap($aProjName) [OS:genGUID]
}
regsub -all -- {__PROJECT_GUID__} $aProjTmpl $aGuidsMap($aProjName) aProjTmpl
upvar $theGuidsMap aGuidsMap
if { ! [info exists aGuidsMap($aProjName)] } {
set aGuidsMap($aProjName) [OS:genGUID]
}
regsub -all -- {__PROJECT_GUID__} $aProjTmpl $aGuidsMap($aProjName) aProjTmpl
set aUsedLibs [list]
foreach tkx [osutils:commonUsedTK $theToolKit $theSrcDir $theSourceDirOther] {
lappend aUsedLibs "${tkx}.lib"
}
set aUsedLibs [list]
foreach tkx [osutils:commonUsedTK $theToolKit $theSrcDir $theSourceDirOther] {
lappend aUsedLibs "${tkx}.lib"
}
set anOsReleaseLibs {}
set anOsDebugLibs {}
osutils:usedOsLibs $theToolKit "wnt" anOsReleaseLibs aFrameworks $theSrcDir true
osutils:usedOsLibs $theToolKit "wnt" anOsDebugLibs aFrameworks $theSrcDir false
set anOsReleaseLibs {}
set anOsDebugLibs {}
osutils:usedOsLibs $theToolKit "wnt" anOsReleaseLibs aFrameworks $theSrcDir true
osutils:usedOsLibs $theToolKit "wnt" anOsDebugLibs aFrameworks $theSrcDir false
set aVCRTVer [string range $theVcVer 0 3]
regsub -all -- {__TKDEP__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEFINES__} $aProjTmpl "" aProjTmpl
set aVCRTVer [string range $theVcVer 0 3]
regsub -all -- {__TKDEP__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEFINES__} $aProjTmpl "" aProjTmpl
set aFilesSection ""
set aVcFilesCxx(units) ""
set aVcFilesHxx(units) ""
set aFilesSection ""
set aVcFilesCxx(units) ""
set aVcFilesHxx(units) ""
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
if { ![info exists written([file tail $f])] } {
set written([file tail $f]) 1
if { ![info exists written([file tail $f])] } {
set written([file tail $f]) 1
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
append aFilesSection [osutils:vcxproj:cxxfile $f "" 3]
if { ! [info exists aVcFilesCxx($theToolKit)] } { lappend aVcFilesCxx(units) $theToolKit }
lappend aVcFilesCxx($theToolKit) $f
} else {
puts "Warning : in vcproj there are more than one occurrences for [file tail $f]"
}
}
} else {
append aFilesSection "\t\t\t<Filter\n"
append aFilesSection "\t\t\t\tName=\"$theToolKit\"\n"
append aFilesSection "\t\t\t\t>\n"
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
if { ![info exists written([file tail $f])] } {
set written([file tail $f]) 1
append aFilesSection "\t\t\t<Filter\n"
append aFilesSection "\t\t\t\tName=\"$theToolKit\"\n"
append aFilesSection "\t\t\t\t>\n"
append aFilesSection [osutils:vcproj:file $theVcVer $f ""]
} else {
puts "Warning : in vcproj there are more than one occurrences for [file tail $f]"
append aFilesSection "\t\t\t</Filter>"
}
} else {
puts "Warning : in vcproj there are more than one occurrences for [file tail $f]"
}
append aFilesSection "\t\t\t</Filter>"
}
#puts "$aProjTmpl $aFilesSection"
set anIncPaths "..\\..\\..\\inc"
regsub -all -- {__TKINC__} $aProjTmpl $anIncPaths aProjTmpl
regsub -all -- {__FILES__} $aProjTmpl $aFilesSection aProjTmpl
regsub -all -- {__CONF__} $aProjTmpl Application aProjTmpl
#puts "$aProjTmpl $aFilesSection"
set anIncPaths "..\\..\\..\\inc"
regsub -all -- {__TKINC__} $aProjTmpl $anIncPaths aProjTmpl
regsub -all -- {__FILES__} $aProjTmpl $aFilesSection aProjTmpl
regsub -all -- {__CONF__} $aProjTmpl Application aProjTmpl
regsub -all -- {__XQTEXT__} $aProjTmpl "exe" aProjTmpl
regsub -all -- {__XQTEXT__} $aProjTmpl "exe" aProjTmpl
set aFile [open [set aVcFilePath [file join $theOutDir ${aProjName}.[osutils:vcproj:ext $theVcVer]]] w]
fconfigure $aFile -translation crlf
puts $aFile $aProjTmpl
close $aFile
set aCommonSettingsFile "$aVcFilePath.user"
lappend aVcFiles $aVcFilePath
# write filters file for vc10
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
lappend aVcFiles [osutils:vcxproj:filters $theOutDir $aProjName aVcFilesCxx aVcFilesHxx]
}
# write resource file
lappend aVcFiles [osutils:readtemplate:rc $theOutDir $aProjName]
set aCommonSettingsFileTmpl ""
if { "$theVcVer" == "vc7" || "$theVcVer" == "vc8" } {
# nothing
} elseif { "$theVcVer" == "vc9" } {
set aCommonSettingsFileTmpl [wokUtils:FILES:FileToString "$::THE_CASROOT/adm/templates/vcproj.user.vc9x"]
} else {
set aCommonSettingsFileTmpl [wokUtils:FILES:FileToString "$::THE_CASROOT/adm/templates/vcxproj.user.vc10x"]
}
if { "$aCommonSettingsFileTmpl" != "" } {
regsub -all -- {__VCVER__} $aCommonSettingsFileTmpl $aVCRTVer aCommonSettingsFileTmpl
set aFile [open [set aVcFilePath "$aCommonSettingsFile"] w]
set aFile [open [set aVcFilePath [file join $theOutDir ${aProjName}.[osutils:vcproj:ext $theVcVer]]] w]
fconfigure $aFile -translation crlf
puts $aFile $aCommonSettingsFileTmpl
puts $aFile $aProjTmpl
close $aFile
lappend aVcFiles "$aCommonSettingsFile"
}
set aCommonSettingsFile "$aVcFilePath.user"
lappend aVcFiles $aVcFilePath
# write filters file for vc10
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
lappend aVcFiles [osutils:vcxproj:filters $theOutDir $aProjName aVcFilesCxx aVcFilesHxx]
}
# write resource file
lappend aVcFiles [osutils:readtemplate:rc $theOutDir $aProjName]
set aCommonSettingsFileTmpl ""
if { "$theVcVer" == "vc7" || "$theVcVer" == "vc8" } {
# nothing
} elseif { "$theVcVer" == "vc9" } {
set aCommonSettingsFileTmpl [wokUtils:FILES:FileToString "$::THE_CASROOT/adm/templates/vcproj.user.vc9x"]
} else {
set aCommonSettingsFileTmpl [wokUtils:FILES:FileToString "$::THE_CASROOT/adm/templates/vcxproj.user.vc10x"]
}
if { "$aCommonSettingsFileTmpl" != "" } {
regsub -all -- {__VCVER__} $aCommonSettingsFileTmpl $aVCRTVer aCommonSettingsFileTmpl
set aFile [open [set aVcFilePath "$aCommonSettingsFile"] w]
fconfigure $aFile -translation crlf
puts $aFile $aCommonSettingsFileTmpl
close $aFile
lappend aVcFiles "$aCommonSettingsFile"
}
}
return $aVcFiles
}

View File

@@ -119,8 +119,6 @@ android-g++ {
# VS2015, vc141
} else:equals(aMsvcVer, 16.0){
# VS2019, vc142
} else:equals(aMsvcVer, 17.0){
# VS2022, vc143
} else {
warning (Unknown msvc version. "$$MY_COMPILER" is used)
}

View File

@@ -132,31 +132,21 @@ for (aPackage, aPackages) {
}
}
# extend clean with versioned .so files
!win32 {
aVerList = $$split(VERSION, ".")
aVerMaj = $$member(aVerList, 0)
aVerMin = $$member(aVerList, 1)
aVerMic = $$member(aVerList, 2)
equals(TEMPLATE, app) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
} else {
mac {
# override qmake soname versionong logic
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.dylib.$${aVerMaj}.$${aVerMin}
# extend clean with versioned .dylib files
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
} else {
# override qmake soname versionong logic
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
# extend clean with versioned .so files
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}

View File

@@ -23,8 +23,6 @@ if "%VCVER%" == "vc8" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc143" (
call "%VS143COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B

View File

@@ -74,10 +74,6 @@ if not "%DevEnvDir%" == "" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -111,11 +107,6 @@ if /I "%VCFMT%" == "vc9" (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -135,7 +126,6 @@ if ["%ARCH%"] == ["64"] set VCARCH=amd64
if /I ["%1"] == ["vc141"] set "VCVER=vc14"
if /I ["%1"] == ["vc142"] set "VCVER=vc14"
if /I ["%1"] == ["vc143"] set "VCVER=vc14"
if exist "%CASROOT%\custom.bat" (
call "%CASROOT%\custom.bat" %VCVER% %ARCH% %CASDEB%

View File

@@ -7,7 +7,6 @@ if exist "%~dp0custom.bat" (
call "@INSTALL_DIR_ABSOLUTE@\@INSTALL_DIR_SCRIPT@\env.bat" %1 %2 %3
if /I ["%1"] == ["vc141"] set "VCVER=vc141"
if /I ["%1"] == ["vc142"] set "VCVER=vc142"
if /I ["%1"] == ["vc143"] set "VCVER=vc143"
set "BIN_DIR=win%ARCH%\%VCVER%\bind"
set "LIB_DIR=win%ARCH%\%VCVER%\libd"

View File

@@ -23,8 +23,6 @@ if "%VCVER%" == "vc8" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc143" (
call "%VS143COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B

View File

@@ -100,7 +100,7 @@
<ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL32__
@@ -148,7 +148,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@@ -196,7 +196,7 @@
<ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL64__
@@ -244,7 +244,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>

View File

@@ -95,7 +95,7 @@
<ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
<ResourceCompile>
@@ -140,7 +140,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
@@ -185,7 +185,7 @@
<ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>
<ResourceCompile>
@@ -229,7 +229,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>

View File

@@ -2,48 +2,60 @@
==============================================
@tableofcontents
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://dev.opencascade.org/resources/download/3rd-party-components.
On Linux and macOS, it is recommended to use the version installed in the system natively.
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://opencascade.com/content/3rd-party-components.
On Linux and OS X, it is recommended to use the version installed in the system natively.
@section dev_guides__building_3rdparty_win_1 Windows
This section presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform.
It is assumed that you are already familiar with MS Visual Studio / Visual C++.
This document presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform. It is assumed that you are already familiar with MS Visual Studio / Visual C++.
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of runtime binaries.
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of run-time binaries.
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, `c:/occ3rdparty`).
Further in this document, this folder is referred to as `3rdparty`.
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
There are two types of third-party products used by OCCT:
* Mandatory products:
* Tcl/Tk 8.5 -- 8.6;
* FreeType 2.4.10 -- 2.5.3.
* Optional products:
* TBB 3.x -- 4.x;
* FreeImage 3.14.1 -- 3.16.0;
* VTK 6.1.0.
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, *c:\\occ3rdparty*).
Further in this document, this folder is referred to as *3rdparty*.
@subsection dev_guides__building_3rdparty_win_2 Tcl/Tk
Tcl/Tk is required for DRAW test harness.
**Installation from sources: Tcl**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. In the `win` sub-directory, edit file `buildall.vc.bat`:
1. In the *win* sub-directory, edit file *buildall.vc.bat*:
* Edit the line `"call ... vcvars32.bat"` to have correct path to the version of Visual Studio to be used for building, for instance:
* Edit the line "call ... vcvars32.bat" to have correct path to the version of Visual Studio to be used for building, for instance:
call "%VS80COMNTOOLS%\vsvars32.bat"
If you are building 64-bit version, set environment accordingly, e.g.:
call "%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
* Define variable `INSTALLDIR` pointing to directory where Tcl/Tk will be installed, e.g.:
* Define variable *INSTALLDIR* pointing to directory where Tcl/Tk will be installed, e.g.:
set INSTALLDIR=D:\OCCT\3rdparty\tcltk-86-32
* Add option `install` to the first command line calling `nmake`:
* Add option *install* to the first command line calling *nmake*:
nmake -nologo -f makefile.vc release htmlhelp install %1
* Remove second call to `nmake` (building statically linked executable)
* Remove second call to *nmake* (building statically linked executable)
2. Edit file `rules.vc` replacing line
2. Edit file *rules.vc* replacing line
SUFX = tsgx
@@ -53,18 +65,21 @@ Download the necessary archive from https://www.tcl.tk/software/tcltk/download.h
This is to avoid extra prefix 't' in the library name, which is not recognized by default by OCCT build tools.
3. By default, Tcl uses dynamic version of run-time library (MSVCRT), which must be installed on the system where Tcl will be used.
You may wish to link Tcl library with static version of run-time to avoid this dependency.
For that:
* Edit file `makefile.vc` replacing strings `"crt = -MD"` by `"crt = -MT"`
* Edit file *makefile.vc* replacing strings "crt = -MD" by "crt = -MT"
* Edit source file `tclMain.c` (located in folder `generic`) commenting out forward declaration of function `isatty()`.
* Edit source file *tclMain.c* (located in folder *generic*) commenting out forward declaration of function *isatty()*.
4. In the command prompt, run `buildall.vc.bat`<br>
You might need to run this script twice to have `tclsh` executable installed; check subfolder `bin` of specified installation path to verify this.
5. For convenience of use, we recommend making a copy of `tclsh` executable created in subfolder `bin` of `INSTALLDIR` and named with Tcl version number suffix, as `tclsh.exe` (with no suffix)
4. In the command prompt, run *buildall.vc.bat*
You might need to run this script twice to have *tclsh* executable installed; check subfolder *bin* of specified installation path to verify this.
5. For convenience of use, we recommend making a copy of *tclsh* executable created in subfolder *bin* of *INSTALLDIR* and named with Tcl version number suffix, as *tclsh.exe* (with no suffix)
> cd D:\OCCT\3rdparty\tcltk-86-32\bin
> cp tclsh86.exe tclsh.exe
@@ -72,154 +87,190 @@ Download the necessary archive from https://www.tcl.tk/software/tcltk/download.h
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
Apply the same steps as described for building Tcl above, with the same `INSTALLDIR`.
Note that Tk produces its own executable, called `wish`.
You might need to edit default value of `TCLDIR` variable defined in `buildall.vc.bat` (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
Apply the same steps as described for building Tcl above, with the same INSTALLDIR.
Note that Tk produces its own executable, called *wish*.
You might need to edit default value of *TCLDIR* variable defined in *buildall.vc.bat* (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
@subsection dev_guides__building_3rdparty_win_2_2 FreeType
FreeType is required for text display in a 3D viewer.
You can download its sources from https://freetype.org/
FreeType is required for text display in a 3D viewer. You can download its sources from https://sourceforge.net/projects/freetype/files/
1. Unpack the downloaded archive of FreeType product into the `3rdparty` folder.
As a result, you will get a folder named, for example, `3rdparty/freetype-2.4.10`.
Further in this document, this folder is referred to as `freetype`.
### The building procedure
2. Open the solution file `freetype/builds/win32/vc20xx/freetype.sln` in Visual Studio.
Here `vc20xx` stands for your version of Visual Studio.
1. Unpack the downloaded archive of FreeType product into the *3rdparty* folder. As a result, you will get a folder named, for example, *3rdparty\\freetype-2.4.10*. Further in this document, this folder is referred to as *freetype*.
2. Open the solution file *freetype\\builds\\win32\\vc20xx\\freetype.sln* in Visual Studio. Here *vc20xx* stands for your version of Visual Studio.
3. Select the configuration to build: either `Debug` or `Release`.
3. Select the configuration to build: either Debug or Release.
4. Build the `freetype` project.<br>
As a result, you will get a `freetype` import library (`.lib`) in the `freetype/obj/win32/vc20xx` folder.
4. Build the *freetype* project.
5. If you build FreeType for a 64 bit platform, select in the main menu `Build - Configuration Manager`
and add `x64` platform to the solution configuration by copying the settings from `Win32` platform:
As a result, you will get a freetype import library (.lib) in the *freetype\\obj\\win32\\vc20xx* folder.
5. If you build FreeType for a 64 bit platform, select in the main menu **Build - Configuration Manager** and add *x64* platform to the solution configuration by copying the settings from Win32 platform:
@figure{/build/build_3rdparty/images/3rdparty_image001.png}
Update the value of the Output File for `x64` configuration:
Update the value of the Output File for x64 configuration:
@figure{/build/build_3rdparty/images/3rdparty_image003.png}
Build the `freetype` project.<br>
As a result, you will obtain a 64 bit import library (`.lib`) file in the `freetype/x64/vc20xx` folder.
To build FreeType as a dynamic library (`.dll`) follow steps 6, 7 and 8 of this procedure.
Build the *freetype* project.
6. Open menu Project-> Properties-> Configuration Properties-> General and change option `Configuration Type` to `Dynamic Library (.dll)`.
7. Edit file `freetype/include/freetype/config/ftoption.h`:<br>
in line 255, uncomment the definition of macro `FT_EXPORT` and change it as follows:
As a result, you will obtain a 64 bit import library (.lib) file in the *freetype\\x64\\vc20xx* folder.
#define FT_EXPORT(x) __declspec(dllexport) x
To build FreeType as a dynamic library (.dll) follow steps 6, 7 and 8 of this procedure.
8. Build the `freetype` project.<br>
As a result, you will obtain the files of the import library (`.lib`) and the dynamic library (`.dll`) in folders `freetype/objs/release` or `freetype/objs/debug`.
If you build for a 64 bit platform, follow step 5 of the procedure.
6. Open menu Project-> Properties-> Configuration Properties-> General and change option **Configuration Type** to *Dynamic Library (.dll)*.
7. Edit file *freetype\\include\\freetype\\config\\ftoption.h*:
in line 255, uncomment the definition of macro *FT_EXPORT* and change it as follows:
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures,
it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern `freetype-compiler-bitness-building mode`, where:
* `compiler` is `vc8` or `vc9` or `vc10` or `vc11`;
* `bitness` is `32` or `64`;
* `building mode` is `opt` (for `Release`) or `deb` (for `Debug`).
#define FT_EXPORT(x) __declspec(dllexport) x
8. Build the *freetype* project.
As a result, you will obtain the files of the import library (.lib) and the dynamic library (.dll) in folders <i>freetype \\objs\\release</i> or <i>\\objs\\debug </i>.
If you build for a 64 bit platform, follow step 5 of the procedure.
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures, it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern: *freetype-compiler-bitness-building mode*, where:
* **compiler** is *vc8* or *vc9* or *vc10* or *vc11*;
* **bitness** is *32* or *64*;
* **building mode** is *opt* (for Release) or *deb* (for Debug).
The *include* subfolder should be copied as is, while libraries should be renamed to *freetype.lib* and *freetype.dll* (suffixes removed) and placed to subdirectories *lib *and *bin*, respectively. If the Debug configuration is built, the Debug libraries should be put into subdirectories *libd* and *bind*.
The `include` subfolder should be copied as is, while libraries should be renamed to `freetype.lib` and `freetype.dll` (suffixes removed) and placed to subdirectories `lib` and `bin`, respectively.
If the `Debug` configuration is built, the Debug libraries should be put into subdirectories `libd` and `bind`.
@subsection dev_guides__building_3rdparty_win_3_1 TBB
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Windows platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-win.zip`)
This third-party product is installed with binaries
from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*) and pick the archive for Windows platform.
Unpack the downloaded archive of TBB product into the `3rdparty` folder.
Unpack the downloaded archive of TBB product into the *3rdparty* folder.
Further in this document, this folder is referred to as `tbb`.
Further in this document, this folder is referred to as *tbb*.
@subsection dev_guides__building_3rdparty_win_3_3 FreeImage
This third-party product should be built as a dynamically loadable library (`.dll` file).
You can download its sources from
This third-party product should be built as a dynamically loadable library (.dll file).
You can download its sources from
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
1. Unpack the downloaded archive of FreeImage product into `3rdparty` folder.<br>
As a result, you should have a folder named `3rdparty/FreeImage`.
Rename it according to the rule: `freeimage-platform-compiler-building mode`, where
### The building procedure:
* `platform` is `win32` or `win64`;
* `compiler` is `vc8` or `vc9` or `vc10` or `vc11`;
* `building mode` is *opt* (for release) or `deb` (for debug)
1. Unpack the downloaded archive of FreeImage product into *3rdparty* folder.
As a result, you should have a folder named *3rdparty\\FreeImage*.
Rename it according to the rule: *freeimage-platform-compiler-building mode*, where
* **platform** is *win32* or *win64*;
* **compiler** is *vc8* or *vc9* or *vc10* or *vc11*;
* **building mode** is *opt* (for release) or *deb* (for debug)
Further in this document, this folder is referred to as `freeimage`.
Further in this document, this folder is referred to as *freeimage*.
2. Open the solution file `freeimage/FreeImage.*.sln` in your Visual Studio.<br>
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace.
Such conversion should be suggested automatically by Visual Studio.
2. Open the solution file *freeimage\\FreeImage.*.sln* in your Visual Studio.
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace.
Such conversion should be suggested automatically by Visual Studio.
3. Select a configuration to build.
3. Select a configuration to build.
- Choose `Release` if you are building Release binaries.
- Choose `Debug` if you are building Debug binaries.
- Choose **Release** if you are building Release binaries.
- Choose **Debug** if you are building Debug binaries.
*Note:*
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage projects:
*Note:*
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage and FreeimagePlus projects:
Project -> Properties -> Configuration Properties -> Linker -> General -> Output File
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.dll to FreeImage.dll
FreeImagePlus*d*.dll to FreeImagePlus.dll
Project -> Properties -> Configuration Properties -> Linker -> Debugging-> Generate Program Database File
FreeImage*d*.pdb to FreeImage.pdb
FreeImage*d*.pdb to FreeImage.pdb
FreeImagePlus*d*.pdb to FreeImagePlus.pdb
Project -> Properties -> Configuration Properties -> Linker -> Advanced-Import Library
FreeImage*d*.lib to FreeImage.lib
FreeImage*d*.lib to FreeImage.lib
FreeImagePlus*d*.lib to FreeImagePlus.lib
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.lib to FreeImage.lib
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.lib to FreeImage.lib
FreeImagePlus*d*.dll to FreeImagePlus.dll
FreeImagePlus*d*.lib to FreeImagePlus.lib
Additionally, rename in project FreeImagePlus
Additionally, rename in project FreeImagePlus
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
from FreeImage*d*.lib to FreeImage.lib
from FreeImage*d*.lib to FreeImage.lib
4. Select a platform to build.
4. Select a platform to build.
- Choose `Win32` if you are building for a 32 bit platform.
- Choose `x64` if you are building for a 64 bit platform.
- Choose *Win32* if you are building for a 32 bit platform.
- Choose *x64* if you are building for a 64 bit platform.
5. Start the building process.<br>
As a result, you should have the library files of FreeImage product in `freeimage/Dist` folder (`FreeImage.dll` and `FreeImage.lib`).
5. Start the building process.
As a result, you should have the library files of FreeImage product in *freeimage\\Dist* folder (*FreeImage.dll* and *FreeImage.lib*) and in *freeimage\\Wrapper\\FreeImagePlus\\dist* folder (*FreeImagePlus.dll* and *FreeImagePlus.lib*).
@subsection dev_guides__building_3rdparty_win_3_4 VTK
VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
VTK is an open-source, freely available software system for 3D computer graphics, image processing and visualization. VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into `3rdparty` folder.<br>
As a result, you will get a folder named, for example, `3rdparty/VTK-6.1.0`.
Further in this document, this folder is referred to as `VTK`.
### The building procedure:
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into *3rdparty* folder.
As a result, you will get a folder named, for example, <i>3rdparty\VTK-6.1.0.</i>
Further in this document, this folder is referred to as *VTK*.
2. Use CMake to generate VS projects for building the library:
- Start CMake-GUI and select `VTK` folder as source path, and the folder of your choice for VS project and intermediate build data.
- Start CMake-GUI and select VTK folder as source path, and the folder of your choice for VS project and intermediate build data.
- Click **Configure**.
- Select the VS version to be used from the ones you have installed (we recommend using VS 2015) and the architecture (32 or 64-bit).
- Generate VS projects with default CMake options. The open solution `VTK.sln` will be generated in the build folder.
- Generate VS projects with default CMake options. The open solution *VTK.sln* will be generated in the build folder.
3. Build project VTK in Release mode.
@section build_3rdparty_linux Linux
This section presents additional guidelines for building third-party products used by Open CASCADE Technology and samples on Linux platform.
This document presents additional guidelines for building third-party
products used by Open CASCADE Technology and samples on Linux platform.
The links for downloading the third-party products are available on the web site at
https://opencascade.com/content/3rd-party-components.
There are two types of third-party products, which are necessary to build OCCT:
* Mandatory products:
* Tcl/Tk 8.5 - 8.6;  
* FreeType 2.4.10 - 2.5.3;
* Optional products:
* TBB 3.x - 4.x;
* FreeImage 3.14.1 - 3.16.0;
* VTK 6.1.0.
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
**Debian-based distributives**
All 3rd-party products required for building of OCCT could be installed from official repositories.
You may install them from console using apt-get utility:
All 3rd-party products required for building of OCCT could be installed
from official repositories. You may install them from console using apt-get utility:
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libx11-dev libgl1-mesa-dev libfreeimage-dev
sudo apt-get install rapidjson-dev libdraco-dev
@@ -228,148 +279,148 @@ Building is possible with C++ compliant compiler:
sudo apt-get install g++
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
Tcl/Tk is required for DRAW test harness.
Tcl/Tk is required for DRAW test harness.
**Installation from sources: Tcl**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `unix` sub-directory of the directory where the Tcl source files are located (`TCL_SRC_DIR`).
cd TCL_SRC_DIR/unix
2. Run the `configure` command:
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
3. If the configure command has finished successfully, start the building process:
make
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by `TCL_INSTALL_DIR`
make install
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `unix` sub-directory of the directory where the Tk source files are located (`TK_SRC_DIR`)
1. Enter the unix sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
cd TK_SRC_DIR/unix
cd TCL_SRC_DIR/unix
2. Run the `configure` command, where `TCL_LIB_DIR` is `TCL_INSTALL_DIR/lib`.
2. Run the *configure* command:
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the configure command has finished successfully, start the building process:
make
3. If the configure command has finished successfully, start the building process:
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*
make
make install
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied
to the directory defined by `TK_INSTALL_DIR` (usually it is `TCL_INSTALL_DIR`)
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the unix sub-directory of the directory where the Tk source files are located <i>(TK_SRC_DIR)</i>
make install
cd TK_SRC_DIR/unix
2. Run the configure command, where <i>TCL_LIB_DIR</i> is *TCL_INSTALL_DIR/lib*.
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the configure command has finished successfully, start the building process:
make
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied
to the directory defined by *TK_INSTALL_DIR* (usually it is *TCL_INSTALL_DIR*)
make install
@subsection dev_guides__building_3rdparty_linux_2_2 FreeType
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://freetype.org/ and unpack it.
1. Enter the directory where the source files of FreeType are located (`FREETYPE_SRC_DIR`).
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
cd FREETYPE_SRC_DIR
2. Run the `configure` command:
2. Run the *configure* command:
configure --prefix=FREETYPE_INSTALL_DIR
configure --prefix=FREETYPE_INSTALL_DIR
For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
3. If the *configure* command has finished successfully, start the building process:
For a 64 bit platform also add `CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'` option to the command line.
make
3. If the `configure` command has finished successfully, start the building process:
make
4. If the building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by `FREETYPE_INSTALL_DIR`
make install
4. If the building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*
make install
@subsection dev_guides__building_3rdparty_linux_3_1 TBB
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Linux platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-lin.tgz`).
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
To install, unpack the downloaded archive of TBB product.
@subsection dev_guides__building_3rdparty_linux_3_3 FreeImage
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/ and unpack it.
The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DIR`.
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
1. Modify *FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h*:
In line 60 insert the following:
1. Modify `FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h`:<br>
In line 60 insert the following:
#include string.h
#include string.h
2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
cd FREEIMAGE_SRC_DIR
2. Enter the directory where the source files of FreeImage are located (`FREEIMAGE_SRC_DIR`).
3. Run the building process
make
cd FREEIMAGE_SRC_DIR
4. Run the installation process
3. Run the building process
make
4. Run the installation process
a. If you have the permission to write into directories `/usr/include` and `/usr/lib`, run the following command:
make install
b. If you do not have this permission, you need to modify file `FREEIMAGE_SRC_DIR/Makefile.gnu`:
a. If you have the permission to write into directories <i>/usr/include</i> and <i>/usr/lib</i>, run the following command:
make install
b. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.gnu*:
Change lines 7-9 from:
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/lib
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/lib
to:
DESTDIR ?= $(DESTDIR)
INCDIR ?= $(DESTDIR)/include
INSTALLDIR ?= $(DESTDIR)/lib
Change lines 65-67 from:
install -m 644 -o root -g root $(HEADER) $(INCDIR)
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
DESTDIR ?= $(DESTDIR)
INCDIR ?= $(DESTDIR)/include
INSTALLDIR ?= $(DESTDIR)/lib
Change lines 65-67 from:
install -m 644 -o root -g root $(HEADER) $(INCDIR)
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
Change line 70 from:
Change line 70 from: 
ldconfig
to:
\#ldconfig
\#ldconfig
Then run the installation process by the following command:
Then run the installation process by the following command:
make DESTDIR=FREEIMAGE_INSTALL_DIR install
make DESTDIR=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
@@ -377,180 +428,201 @@ The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DI
@subsection dev_guides__building_3rdparty_linux_3_4 VTK
You can download VTK sources from https://www.vtk.org/VTK/resources/software.html
### The building procedure:
Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it.
1. Install or build `cmake` product from the source file.
2. Start `cmake` in GUI mode with the directory where the source files of *VTK* are located:
1. Install or build *cmake* product from the source file.
2. Start *cmake* in GUI mode with the directory where the source files of *VTK* are located:
ccmake VTK_SRC_DIR
* Press `[c]` to make the initial configuration
* Define the necessary options in `VTK_INSTALL_PREFIX`
* Press `[c]` to make the final configuration
* Press `[g]` to generate `Makefile` and exit
* Press <i>[c]</i> to make the initial configuration
* Define the necessary options in *VTK_INSTALL_PREFIX*
* Press <i>[c]</i> to make the final configuration
* Press <i>[g]</i> to generate Makefile and exit
3. Start the building of VTK:
make
4. Start the installation of VTK. Binaries will be installed according to the `VTK_INSTALL_PREFIX` option.
4. Start the installation of VTK. Binaries will be installed according to the *VTK_INSTALL_PREFIX* option.
make install
@section build_3rdparty_macos Mac OS X
This section presents additional guidelines for building third-party products
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
This document presents additional guidelines for building third-party products
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
Tcl/Tk is required for DRAW test harness.
There are two types of third-party products, which are necessary to build OCCT:
* Mandatory products:
* Tcl/Tk 8.5 - 8.6;
* FreeType 2.4.10 - 2.5.3.
* Optional products:
* TBB 3.x - 4.x;
* FreeImage 3.14.1 - 3.16.0
**Installation from sources: Tcl**
@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk 8.5
Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
**Installation from sources: Tcl 8.5**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `macosx` sub-directory of the directory where the Tcl source files are located (`TCL_SRC_DIR`).
1. Enter the *macosx* sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
cd TCL_SRC_DIR/macosx
cd TCL_SRC_DIR/macosx
2. Run the `configure` command
2. Run the *configure* command
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the `configure` command has finished successfully, start the building process
3. If the *configure* command has finished successfully, start the building process
make
make
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*.
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by `TCL_INSTALL_DIR`.
make install
make install
**Installation from sources: Tk**
**Installation from sources: Tk 8.5**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `macosx` sub-directory of the directory where the source files of Tk are located (`TK_SRC_DIR`).
1. Enter the *macosx* sub-directory of the directory where the source files of Tk are located <i>(TK_SRC_DIR)</i>.
cd TK_SRC_DIR/macosx
cd TK_SRC_DIR/macosx
2. Run the `configure` command, where `TCL_LIB_DIR` is `TCL_INSTALL_DIR/lib`
2. Run the *configure* command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the `configure` command has finished successfully, start the building process:
3. If the *configure* command has finished successfully, start the building process:
make
make
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied to the directory defined by `TK_INSTALL_DIR` (usually it is `TCL_INSTALL_DIR`).
4. If the building has finished successfully, start the installation of Tk. All binary and service files of the product will be copied to the directory defined by *TK_INSTALL_DIR* (usually it is TCL_INSTALL_DIR)
make install
make install
@subsection dev_guides__building_3rdparty_osx_2_2 FreeType
@subsection dev_guides__building_3rdparty_osx_2_2 FreeType 2.4.10
FreeType is required for text display in the 3D viewer.
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://freetype.org/ and unpack it.
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
1. Enter the directory where the source files of FreeType are located (`FREETYPE_SRC_DIR`).
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
cd FREETYPE_SRC_DIR
cd FREETYPE_SRC_DIR
2. Run the `configure` command
2. Run the *configure* command
configure --prefix=FREETYPE_INSTALL_DIR
configure --prefix=FREETYPE_INSTALL_DIR
For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
For a 64 bit platform also add `CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'` option to the command line.
3. If the *configure* command has finished successfully, start the building process
3. If the `configure` command has finished successfully, start the building process
make
make
4. If building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*.
4. If building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by `FREETYPE_INSTALL_DIR`.
make install
@subsection dev_guides__building_3rdparty_osx_3_1 TBB 3.x or 4.x
make install
This third-party product is installed with binaries from the archive
that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*)
and pick the archive for Mac OS X platform.
To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_osx.tgz*).
@subsection dev_guides__building_3rdparty_osx_3_1 TBB
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage 3.14.1 or 3.15.x
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Mac OS X platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-mac.tgz`).
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage
Download the necessary archive from
Download the necessary archive from
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
and unpack it. The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DIR`.
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
Note that for building FreeImage on Mac OS X 10.7 you should replace `Makefile.osx`
in `FREEIMAGE_SRC_DIR` by the corrected file, which you can find in attachment to issue [`#22811`](https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug) in OCCT Mantis bug tracker.
Note that for building FreeImage on Mac OS X 10.7 you should replace *Makefile.osx*
in *FREEIMAGE_SRC_DIR* by the corrected file, which you can find in attachment to issue #22811 in OCCT Mantis bug tracker
(https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug).
1. If you build FreeImage 3.15.x you can skip this step.
1. If you build FreeImage 3.15.x you can skip this step.
Modify <i>FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:</i>
In line 60 insert the following:
Modify `FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:`<br>
In line 60 insert the following:
#include string.h
#include string.h
Modify <i>FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp:</i>
In line 320 replace:
Modify `FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp`:<br>
In line 320 replace:
SwapShort(value);
SwapShort(value);
with:
with:
SwapShort(&value);
SwapShort(&value);
2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
2. Enter the directory where the source files of FreeImage are located (`FREEIMAGE_SRC_DIR`).
cd FREEIMAGE_SRC_DIR
cd FREEIMAGE_SRC_DIR
3. Run the building process
make
make
4. Run the installation process
4. Run the installation process
1. If you have the permission to write into <i>/usr/local/include</i> and <i>/usr/local/lib</i> directories, run the following command:
1. If you have the permission to write into `/usr/local/include` and `/usr/local/lib` directories, run the following command:
make install
make install
2. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.osx*:
2. If you do not have this permission, you need to modify file `FREEIMAGE_SRC_DIR/Makefile.osx`:<br>
Change line 49 from:
Change line 49 from:   
PREFIX ?= /usr/local
to:
PREFIX ?= $(PREFIX)
PREFIX ?= $(PREFIX)
  Change lines 65-69 from:
  Change lines 65-69 from:
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
ranlib -sf $(INSTALLDIR)/$(STATICLIB)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
to:
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
ranlib -sf $(INSTALLDIR)/$(STATICLIB)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
to:
install -d $(INCDIR) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
install -d $(INCDIR) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
Then run the installation process by the following command:
make PREFIX=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
Then run the installation process by the following command:
make PREFIX=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
make clean

View File

@@ -17,7 +17,7 @@ On Linux and macOS we recommend to use libraries maintained by distributive deve
@section build_occt_win_cmake Building with CMake tool
This chapter describes the [CMake](https://cmake.org/download/)-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 3.1 or later.
OCCT requires CMake version 2.8.12 or later.
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).
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
@@ -113,7 +113,6 @@ The following table gives the full list of environment variables used at the con
| 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 | 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 | 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_CPP_STANDARD | String | Employ corresponding c++ standard (C++11, C++14, ..C++23) for building OCCT |
| CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |
@@ -325,7 +324,6 @@ The environment is defined in the file *custom.sh* (on Linux and macOS) or *cust
| vc141-uwp | 2017 (15) | UWP (Universal Windows Platform) | vc14-uwp |
| vc142 | 2019 (16) | Desktop (Windows API) | vc14 |
| vc142-uwp | 2019 (16) | UWP (Universal Windows Platform) | vc14-uwp |
| vc143 | 2022 (17) | Desktop (Windows API) | vc14 |
Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
That tool will analyze your environment and propose you to choose available options:

View File

@@ -341,7 +341,7 @@ The tables below describe the recommended software configurations for which OCCT
| OS | Compiler |
| --------- | ----------- |
| Windows | Microsoft Visual Studio: 2015 Update 3, 2017 <sup>1</sup>, 2019, 2022 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
| Windows | Microsoft Visual Studio: 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019, 2022 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
| Linux | GNU gcc 4.3+ <br> LLVM CLang 3.6+ |
| OS X / macOS | XCode 6 or newer |
| Android | NDK r12, GNU gcc 4.9 or newer |
@@ -359,8 +359,8 @@ https://dev.opencascade.org/resources/download/3rd-party-components
| Component | Where to find | Used for | Purpose |
| --------- | ------------- | -------- | -------------------- |
| CMake 3.1+ | https://cmake.org/ | Configuration | Build from sources |
| Intel oneTBB 2021.5.0 | https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0 | All | Parallelization of algorithms (alternative to built-in thread pool) |
| CMake 2.8+ | https://cmake.org/ | Configuration | Build from sources |
| Intel TBB 4.x or later | https://oneapi-src.github.io/oneTBB/ | All | Parallelization of algorithms (alternative to built-in thread pool) |
| OpenGL 3.3+, OpenGL ES 2.0+ | System | Visualization | Required for using 3D Viewer |
| OpenVR 1.10+ | https://github.com/ValveSoftware/openvr | Visualization | VR (Virtual Reality) support in 3D Viewer |
| FreeType 2.4+ | https://www.freetype.org/download.html | Visualization | Text rendering in 3D Viewer |
@@ -462,7 +462,7 @@ To run any Open CASCADE Technology application you need to set the environment v
You can define the environment variables with env.bat script located in the
$CASROOT folder. This script accepts two arguments to be used:
the version of Visual Studio (vc12 -- vc143) and the architecture (win32 or win64).
the version of Visual Studio (vc12 -- vc142) and the architecture (win32 or win64).
The additional environment settings necessary for compiling OCCT libraries and samples
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.
@@ -572,7 +572,8 @@ FreeType 2 is released under two open-source licenses: BSD-like FreeType License
It is a library that helps you to take advantage of multi-core processor performance without having to be a threading expert.
Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that
abstracts platform details and threading mechanisms for scalability and performance.
Intel oneTBB 2021.5.0 is available under Apache 2.0 license (https://www.threadingbuildingblocks.org).
TBB version 2017 is available under Apache 2.0 license, while older versions
until 4.4 are available under GPLv2 license with the runtime exception (https://www.threadingbuildingblocks.org).
**OpenGL** is an industry standard API for 3D graphics used by OCCT for
implementation of 3D viewer. OpenGL specification is developed by the

View File

@@ -2333,13 +2333,3 @@ Applications extending OCCT 3D Viewer and calling OpenGL functions directly (lik
This header, as well as `OpenGl_GlCore20.hxx` and similar, no more include system OpenGL / OpenGL ES headers to define function table.
Application code calling OpenGL functions directly should be changed to either use `OpenGl_Context::core11fwd` (as designed)
or to include system OpenGL headers in advance (with help of `OpenGl_GlNative.hxx`).
@subsection upgrade_occt770_tooltriangulatedshape StdPrs_ToolTriangulatedShape
Method `StdPrs_ToolTriangulatedShape::Normal()` has been removed.
Please use `BRepLib_ToolTriangulatedShape::ComputeNormals()` to fill in normal attributes in triangulation and fetch them directly using `Poly_Triangulation::Normal()`.
@subsection upgrade_occt770_shapeproximity BRepExtrema_ShapeProximity
A new way of using the `BRepExtrema_ShapeProximity` class was provided for computing a proximity value between two shapes.
If at initialization of the `BRepExtrema_ShapeProximity` class the *theTolerance* parameter is not defined (Precision::Infinite() by default), the proximity value will be computed.

View File

@@ -2044,47 +2044,43 @@ Creates a *MeshVS_Mesh* object based on STL file data. The object will be displa
meshfromstl mesh myfile.stl
~~~~
@subsubsection occt_draw_4_5_2 vsetdispmode
@subsubsection occt_draw_4_5_2 meshdispmode
Syntax:
~~~~{.php}
vsetdispmode meshname displaymode
meshdispmode meshname displaymode
~~~~
Changes the display mode of object **meshname**. The **displaymode** is integer (`MeshVS_DisplayModeFlags`), which can be:
* *1* for *wireframe*,
Changes the display mode of object **meshname**. The **displaymode** is integer, which can be:
* *1* for *wireframe*,
* *2* for *shading* mode, or
* *3* for *shrink* mode.
* *3* for *shrink* mode.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vsetdispmode mesh 2
vinit
meshfromstl mesh myfile.stl
meshdispmode mesh 2
~~~~
@subsubsection occt_draw_4_5_3 vselmode
@subsubsection occt_draw_4_5_3 meshselmode
Syntax:
~~~~{.php}
vselmode meshname selectionmode {on|off}
meshselmode meshname selectionmode
~~~~
Changes the selection mode of object **meshname**.
The *selectionmode* is integer OR-combination of mode flags (`MeshVS_SelectionModeFlags`). The basic flags are the following:
* *0* -- selection of mesh as whole;
Changes the selection mode of object **meshname**. The *selectionmode* is integer OR-combination of mode flags. The basic flags are the following:
* *1* -- node selection;
* *2* -- 0D elements (not supported in STL);
* *4* -- links (not supported in STL);
* *8* -- faces;
* *16* -- volumes (not supported in STL);
* *256* -- groups (not supported in STL).
**Example:**
* *2* -- 0D elements (not supported in STL);
* *4* -- links (not supported in STL);
* *8* -- faces.
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vselmode mesh 1
vinit
meshfromstl mesh myfile.stl
meshselmode mesh 1
~~~~
@subsubsection occt_draw_4_5_4 meshshadcolor
@@ -2095,11 +2091,11 @@ meshshadcolor meshname red green blue
~~~~
Changes the face interior color of object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshshadcolormode mesh 0.5 0.5 0.5
~~~~
@@ -2111,11 +2107,11 @@ meshlinkcolor meshname red green blue
~~~~
Changes the color of face borders for object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshlinkcolormode mesh 0.5 0.5 0.5
~~~~
@@ -2123,37 +2119,39 @@ meshlinkcolormode mesh 0.5 0.5 0.5
Syntax:
~~~~{.php}
meshmat meshname material [transparency]
meshmat meshname material
~~~~
Changes the material of object **meshname**.
*material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*):
* *0 -- BRASS*,
* *1 -- BRONZE*,
* *2 -- COPPER*,
* *3 -- GOLD*,
* *4 -- PEWTER*,
* *5 -- PLASTER*,
* *6 -- PLASTIC*,
* *7 -- SILVER*,
* *8 -- STEEL*,
* *9 -- STONE*,
* *10 -- SHINY_PLASTIC*,
* *11 -- SATIN*,
* *12 -- METALIZED*,
* *13 -- NEON_GNC*,
* *14 -- CHROME*,
* *15 -- ALUMINIUM*,
* *16 -- OBSIDIAN*,
* *17 -- NEON_PHC*,
* *18 -- JADE*.
*material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*):
* *0 -- BRASS,*
* *1 -- BRONZE,*
* *2 -- COPPER,*
* *3 -- GOLD,*
* *4 -- PEWTER,*
* *5 -- PLASTER,*
* *6 -- PLASTIC,*
* *7 -- SILVER,*
* *8 -- STEEL,*
* *9 -- STONE,*
* *10 -- SHINY_PLASTIC,*
* *11 -- SATIN,*
* *12 -- METALIZED,*
* *13 -- NEON_GNC,*
* *14 -- CHROME,*
* *15 -- ALUMINIUM,*
* *16 -- OBSIDIAN,*
* *17 -- NEON_PHC,*
* *18 -- JADE,*
* *19 -- DEFAULT,*
* *20 -- UserDefined*
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
meshmat mesh 18
vinit
meshfromstl mesh myfile.stl
meshmat mesh JADE
~~~~
@subsubsection occt_draw_4_5_7 meshshrcoef
@@ -2163,14 +2161,12 @@ Syntax:
meshshrcoef meshname shrinkcoefficient
~~~~
Changes the value of shrink coefficient used in the shrink mode.
In the shrink mode the face is shown as a congruent part of a usual face, so that *shrinkcoefficient* controls the value of this part.
The *shrinkcoefficient* is a positive real number.
**Example:**
Changes the value of shrink coefficient used in the shrink mode. In the shrink mode the face is shown as a congruent part of a usual face, so that *shrinkcoefficient* controls the value of this part. The *shrinkcoefficient* is a positive real number.
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshshrcoef mesh 0.05
~~~~
@@ -2182,12 +2178,11 @@ meshshow meshname
~~~~
Displays **meshname** in the viewer (if it is erased).
The same as calling `vdisplay`.
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshshow mesh
~~~~
@@ -2198,13 +2193,12 @@ Syntax:
meshhide meshname
~~~~
Hides **meshname** in the viewer.
The same as calling `verase`.
Hides **meshname** in the viewer.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vinit
meshfromstl mesh myfile.stl
meshhide mesh
~~~~
@@ -2215,7 +2209,7 @@ Syntax:
meshhidesel meshname
~~~~
Hides only selected entities. The other part of **meshname** remains visible.
Hides only selected entities. The other part of **meshname** remains visible.
@subsubsection occt_draw_4_5_11 meshshowsel
@@ -2224,7 +2218,7 @@ Syntax:
meshshowsel meshname
~~~~
Shows only selected entities. The other part of **meshname** becomes invisible.
Shows only selected entities. The other part of **meshname** becomes invisible.
@subsubsection occt_draw_4_5_12 meshshowall
@@ -2233,22 +2227,22 @@ Syntax:
meshshowall meshname
~~~~
Changes the state of all entities to visible for **meshname**.
Changes the state of all entities to visible for **meshname**.
@subsubsection occt_draw_4_5_13 vremove
@subsubsection occt_draw_4_5_13 meshdelete
Syntax:
~~~~{.php}
vremove meshname
meshdelete meshname
~~~~
Deletes MeshVS_Mesh object **meshname**.
Deletes MeshVS_Mesh object **meshname**.
**Example:**
**Example:**
~~~~{.php}
vinit
meshfromstl mesh myfile.stl
vremove mesh
vinit
meshfromstl mesh myfile.stl
meshdelete mesh
~~~~
@subsection occt_draw_4_6 VIS Viewer commands

View File

@@ -326,8 +326,7 @@ The <i>Geom2dConvert</i> package provides the following:
* a global function which is used to construct a BSpline curve from a bounded curve based on a 2D curve from the Geom2d package,
* a splitting algorithm which computes the points at which a 2D BSpline curve should be cut in order to obtain arcs with the same degree of continuity,
* global functions used to construct the BSpline curves created by this splitting algorithm, or by other types of segmentation of the BSpline curve,
* an algorithm which converts a 2D BSpline curve into a series of adjacent Bezier curves,
* an algorithm which converts an arbitrary 2D curve into a series of adjacent 2D circular arcs and 2D linear segments.
* an algorithm which converts a 2D BSpline curve into a series of adjacent Bezier curves.
The <i>GeomConvert</i> package also provides the following:
@@ -339,8 +338,7 @@ The <i>GeomConvert</i> package also provides the following:
* a splitting algorithm, which determines the curves along which a BSpline surface should be cut in order to obtain patches with the same degree of continuity,
* global functions to construct BSpline surfaces created by this splitting algorithm, or by other types of BSpline surface segmentation,
* an algorithm, which converts a BSpline surface into a series of adjacent Bezier surfaces,
* an algorithm, which converts a grid of adjacent Bezier surfaces into a BSpline surface.
* algorithms that converts NURBS, Bezier and other general parametrized curves and surface into anaytical curves and surfaces.
* an algorithm, which converts a grid of adjacent Bezier surfaces into a BSpline surface.
@subsection occt_modat_1_4 Points on Curves

View File

@@ -1007,25 +1007,6 @@ Standard_Integer aNbOffsetSurfaces = aCheckContents.NbOffsetSurf();
Handle(TopTools_HSequenceOfShape) aSeqFaces = aCheckContents.OffsetSurfaceSec();
~~~~
@subsubsection occt_shg_3_2_4 Analysis of shape underlined geometry
Class *ShapeAnalysis_CanonicalRecognition* provides tools that analyze geometry of shape and explore the possibility of converting geometry into a canonical form.
Canonical forms for curves are lines, circles and ellipses.
Canonical forms for surfaces are planar, cylindrical, conical and spherical surfaces.
Recognition and converting into canonical form is performed according to maximal deviation criterium: maximal distance between initial and canonical geometrical objects must be less, than given value.
Analysis of curves is allowed for following shapes:
* edge - algorithm checks 3d curve of edge
* wire - algorithm checks 3d curves of all edges in order to convert them in the same analytical curve
Analysis of surfaces is allowed for following shapes:
* face - algorithm checks surface of face
* shell - algorithm checks surfaces of all faces in order to convert them in the same analytical surface
* edge - algorithm checks all surfaces that are shared by given edge in order convert one of them in analytical surface, which most close to the input sample surface.
* wire - the same as for edge, but algorithm checks all edges of wire in order to find analytical surface, which most close to the input sample surface.
@section occt_shg_4 Upgrading
Upgrading tools are intended for adaptation of shapes for better use by Open CASCADE Technology or for customization to particular needs, i.e. for export to another system.

View File

@@ -94,7 +94,6 @@ The types of STEP representation entities that are recognized are:
* geometrically_bounded_wireframe_shape_representation
* geometrically_bounded_surface_shape_representation
* hybrid representations (shape_representation containing models of different type)
* tessellated_shape_representation
@subsubsection occt_step_2_2_3 Topological entities
The types of STEP topological entities that can be translated are:
@@ -113,7 +112,6 @@ The types of STEP geometrical entities that can be translated are:
* directions
* curves
* surfaces
* triangulations
For further information see 2.4 Mapping STEP entities to Open CASCADE Technology shapes.
@@ -339,7 +337,7 @@ Specifies preferred type of representation of the shape of the product, in case
* 4 (GBSSR) -- Prefer GEOMETRICALLY_BOUNDED_SURFACE_SHAPE_REPRESENTATION
* 5 (FBSR) -- Prefer FACETTED_BREP_SHAPE_REPRESENTATION
* 6 (EBWSR) -- Prefer EDGE_BASED_WIREFRAME_SHAPE_REPRESENTATION
* 7 (GBWSR) -- Prefer GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION
* 7 (GBWSR) -- Prefer GEOMETRICALLY_BOUNDED_WIREFRAME _SHAPE_REPRESENTATION
When this option is not equal to 1, for products with multiple representations the representation having a type closest to the selected one in this list will be translated.
@@ -449,34 +447,6 @@ of for each of the two "AXIS2_PLACEMENT_3D" entities referenced by it. as follow
}
~~~~
<h4>read.step.tessellated:</h4>
Boolean flag regulating translation of entities that define tessellated geometry:
* TESSELLATED_SHAPE_REPRESENTATION
* TESSELLATED_SHELL
* TESSELLATED_SOLID
* TRIANGULATED_FACE
* COMPLEX_TRIANGULATED_FACE
Tesselated geometry is attached to shapes as objects of <i>Poly_Triangulation</i> type using STEP links.
* 0 (Off) -- do not translate
* 1 (On) -- translate
* 2 (OnNoBRep) - tessellation is read only for entities for which there is no BRep representation
Read this parameter with:
~~~~{.cpp}
Standard_Integer ic = Interface_Static::IVal("read.step.tessellated");
~~~~
Modify this parameter with:
~~~~{.cpp}
if(!Interface_Static::SetIVal("read.step.tessellated",1))
.. error ..
~~~~
Default value is 0 (On).
@subsubsection occt_step_2_3_4 Performing the STEP file translation
Perform the translation according to what you want to translate. You can choose either root entities (all or selected by the number of root), or select any entity by its number in the STEP file. There is a limited set of types of entities that can be used as starting entities for translation. Only the following entities are recognized as transferable:
@@ -494,11 +464,6 @@ Perform the translation according to what you want to translate. You can choose
* subtypes of face_surface (including advanced_face)
* subtypes of shape_representation_relationship
* context_dependent_shape_representation
* tessellated_shape_representation
* tessellated_shell
* tessellated_solid
* triangulated_face
* complex_triangulated_face
The following methods are used for translation:
@@ -718,10 +683,6 @@ Not all entities defining the assembly structure in the STEP file are translated
| | quasi_uniform_surface | Geom_BSplineSurface | |
| | rectangular_composite_surface | TopoDS_Compound | Contains *TopoDS_Faces* |
| | curve_bounded_surface | TopoDS_Face | |
| Tessellations | tessellated_shell | TopoDS_Shell | |
| | tessellated_solid | TopoDS_Solid | |
| | triangulated_face | TopoDS_Face | Contains *Poly_Triangulation* |
| | complex_triangulated_face | TopoDS_Face | Contains *Poly_Triangulation* |
@subsection occt_step_2_5 Tolerance management
@@ -784,7 +745,6 @@ The following default tolerances are used when creating shapes and how they are
* *StepToTopoDS_TranslatePolyLoop* constructs *TopoDS_Edges* in *TopoDS_Wire* with help of class *StepToTopoDS_TranslateEdge*. Their tolerances are not modified inside this method.
* *StepToTopoDS_TranslateFace* constructs *TopoDS_Face* with the initial value of tolerance. *TopoDS_Wire* on *TopoDS_Face* is constructed with the help of classes *StepToTopoDS_TranslatePolyLoop, StepToTopoDS_TranslateEdgeLoop* or *StepToTopoDS_TranslateVertexLoop*.
* *StepToTopoDS_TranslateShell* calls *StepToTopoDS_TranslateFace::Init* for each face. This class does not modify the tolerance value.
* *StepToTopoDS_TranslateSolid* calls *StepToTopoDS_TranslateFace::Init* for each face. This class does not modify the tolerance value.
* *StepToTopoDS_TranslateCompositeCurve* constructs *TopoDS_Edges* in *TopoDS_Wire* with help of class *BRepAPI_MakeEdge* and have a tolerance 10-7. Pcurves from a STEP file are translated if they are present and if *read.surfacecurve.mode* is not -3. The connection between segments of a composite curve (edges in the wire) is provided by calling method *ShapeFix_Wire::FixConnected()\** with a precision equal to the initial value of tolerance.
* *StepToTopoDS_TranslateCurveBoundedSurface* constructs *TopoDS_Face* with tolerance *Precision::Confusion()*. *TopoDS_Wire* on *TopoDS_Face* is constructed with the help of class *StepToTopoDS_TranslateCompositeCurve*. Missing pcurves are computed using projection algorithm with the help of method *ShapeFix_Face::FixPcurves()*. For resulting face method *ShapeFix::SameParameter()* is called. It calls standard *BRepLib::SameParameter* for each edge in each wire, which can either increase or decrease the tolerances of the edges and vertices. *SameParameter* writes the tolerance corresponding to the real deviation of pcurves from 3D curve which can be less or greater than the tolerance in a STEP file.
* *StepToTopoDS_Builder* a high level class. Its methods perform translation with the help of the classes listed above. If the value of *read.maxprecision.mode* is set to 1 then the tolerance of subshapes of the resulting shape is limited by 0 and *read.maxprecision.val*. Else this class does not change the tolerance value.
@@ -1011,34 +971,6 @@ if(!Interface_Static::SetIVal("write.step.vertex.mode",1))
~~~~
Default value is 0.
<h4>write.step.tessellated:</h4>
Boolean flag regulating writing of entities that define tessellated geometry:
* TESSELLATED_SHAPE_REPRESENTATION
* TESSELLATED_SHELL
* TESSELLATED_SOLID
* TRIANGULATED_FACE
Tesselated geometry is taken as objects of <i>Poly_Triangulation type</i> from the active <i>TopoDS_Face</i> triangulation.
* 0 (Off) -- do not write
* 1 (On) -- write
* 2 (OnNoBRep) - tessellation is written only for entities for which there is no BRep representation
Read this parameter with:
~~~~{.cpp}
Standard_Integer ic = Interface_Static::IVal("write.step.tessellated");
~~~~
Modify this parameter with:
~~~~{.cpp}
if(!Interface_Static::SetIVal("write.step.tessellated",1))
.. error ..
~~~~
Default value is 2 (OnNoBep).
@subsubsection occt_step_3_3_3 Performing the Open CASCADE Technology shape translation
An OCCT shape can be translated to STEP using one of the following models (shape_representations):
* manifold_solid_brep (advanced_brep_shape_representation)
@@ -1162,7 +1094,6 @@ The table below describes STEP entities, which are created when the assembly str
| | Geom_ToroidalSurface | toroidal_surface or degenerate_toroidal_surface | *degenerate_toroidal_surface* is produced if the minor radius is greater then the major one |
| | Geom_BezierSurface | b_spline_surface_with_knots | |
| | Geom_BsplineSurface | b_spline_surface_with_knots or rational_b_spline_surface | *rational_b_spline_surface* is produced if *Geom_BSplineSurface* is a rational Bspline |
| Triangulations | Poly_Triangulation | *triangulated_face* is produced for face active triangulation | |
@subsection occt_step_3_5 Tolerance management

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IE_WPF_D3D</RootNamespace>
<AssemblyName>IE_WPF_D3D</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IE_WPF_WinForms</RootNamespace>
<AssemblyName>IE_WPF_WinForms</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View File

@@ -27,7 +27,7 @@
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>

View File

@@ -35,4 +35,4 @@
</providers>
</roleManager>
</system.web>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View File

@@ -25,7 +25,6 @@
#include <AIS_InteractiveObject.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <TopoDS_Face.hxx>
#include <TColGeom_SequenceOfCurve.hxx>

View File

@@ -26,7 +26,9 @@
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_Texture2D.hxx>
#include <Graphic3d_Texture1D.hxx>
#include <Graphic3d_Texture1Dsegment.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Image_AlienPixMap.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <TopoDS_Edge.hxx>
@@ -79,7 +81,7 @@ void Sample2D_Image::SetContext (const Handle(AIS_InteractiveContext)& theContex
this->Set(TopoDS_Shape(myFace));
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
Handle(Graphic3d_Texture2D) aTexture = new Graphic3d_Texture2D (myFilename);
Handle(Graphic3d_Texture2Dmanual) aTexture = new Graphic3d_Texture2Dmanual(myFilename);
aTexture->DisableModulate();
myDrawer->ShadingAspect()->Aspect()->SetTextureMap (aTexture);
myDrawer->ShadingAspect()->Aspect()->SetTextureMapOn();

View File

@@ -24,7 +24,6 @@
#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
//! AIS AIS interactive object for sample 2D marker
class Sample2D_Markers : public AIS_InteractiveObject

View File

@@ -4,6 +4,7 @@ project(glfw-occt-demo)
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/adm/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 11)
set(APP_VERSION_MAJOR 1)
set(APP_VERSION_MINOR 0)
set(APP_TARGET glfwocct)

View File

@@ -39,9 +39,9 @@ elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
set (MY_COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (MY_COMPILER gcc)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (MY_COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set (MY_COMPILER icc)
else()
set (MY_COMPILER ${CMAKE_GENERATOR})

View File

@@ -37,7 +37,7 @@ list(APPEND aLibDeps lib_FreeType)
# system libraries
list(APPEND aLibDeps EGL GLESv2 log android)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -frtti -fexceptions -fpermissive")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -frtti -fexceptions -fpermissive")
add_library(TKJniSample SHARED ${SOURCE_FILES})
target_link_libraries(TKJniSample ${aLibDeps})

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (Geometry)

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (Modeling)

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (ImportExport)

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (HLR)

View File

@@ -1,10 +1,4 @@
# Caution! Be careful, when increase minimal cmake version:
# using of newer version may leads (by default) to applying
# of some new policies. It may break compilation.
# For canceling of applying new policies use:
# cmake_policy(PUSH) before `cmake_minimum_required`
# and cmake_policy(POP) after.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.6)
project (mfcsample)

View File

@@ -7,7 +7,6 @@ if exist "%~dp0custom.bat" (
call "%CASROOT%\env.bat" %1 %2 %3
if /I ["%1"] == ["vc141"] set "VCVER=vc141"
if /I ["%1"] == ["vc142"] set "VCVER=vc142"
if /I ["%1"] == ["vc143"] set "VCVER=vc143"
set "BIN_DIR=win%ARCH%\%VCVER%\bind"
set "LIB_DIR=win%ARCH%\%VCVER%\libd"

View File

@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.2)
project(occt-webgl-sample)
set(CMAKE_CXX_STANDARD 11)
set(APP_VERSION_MAJOR 1)
set(APP_VERSION_MINOR 0)
set(APP_TARGET occt-webgl-sample)

View File

@@ -251,9 +251,7 @@ void AIS_Animation::Stop()
myState = AnimationState_Stopped;
if (!myTimer.IsNull())
{
const Standard_Real anElapsedTime = ElapsedTime();
myTimer->Stop();
myTimer->Seek (Min (Duration(), anElapsedTime));
}
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())

View File

@@ -27,7 +27,6 @@
#include <Prs3d_Presentation.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <Select3D_SensitivePoly.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_Type.hxx>
@@ -42,9 +41,9 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_Circle,AIS_InteractiveObject)
AIS_Circle::AIS_Circle(const Handle(Geom_Circle)& aComponent):
AIS_InteractiveObject(PrsMgr_TOP_AllView),
myComponent(aComponent),
myUStart (0.0),
myUEnd (2.0 * M_PI),
myCircleIsArc (Standard_False),
myUStart(0.),
myUEnd(2*M_PI),
myCircleIsArc(Standard_False),
myIsFilledCircleSens (Standard_False)
{
}
@@ -61,7 +60,7 @@ AIS_Circle::AIS_Circle(const Handle(Geom_Circle)& theComponent,
myComponent (theComponent),
myUStart (theUStart),
myUEnd (theUEnd),
myCircleIsArc (Abs (Abs (theUEnd - theUStart) - 2.0 * M_PI) > gp::Resolution()),
myCircleIsArc (Standard_True),
myIsFilledCircleSens (theIsFilledCircleSens)
{
}
@@ -208,14 +207,14 @@ void AIS_Circle::UnsetWidth()
//function : ComputeCircle
//purpose :
//=======================================================================
void AIS_Circle::ComputeCircle (const Handle(Prs3d_Presentation)& thePresentation)
void AIS_Circle::ComputeCircle( const Handle(Prs3d_Presentation)& aPresentation)
{
GeomAdaptor_Curve curv(myComponent);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient (1.e-5);
StdPrs_DeflectionCurve::Add (thePresentation, curv, myDrawer);
myDrawer->SetDeviationCoefficient (prevdev);
myDrawer->SetDeviationCoefficient(1.e-5);
StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
myDrawer->SetDeviationCoefficient(prevdev);
}
@@ -224,13 +223,13 @@ void AIS_Circle::ComputeCircle (const Handle(Prs3d_Presentation)& thePresentatio
//purpose :
//=======================================================================
void AIS_Circle::ComputeArc (const Handle(Prs3d_Presentation)& thePresentation)
void AIS_Circle::ComputeArc( const Handle(Prs3d_Presentation)& aPresentation)
{
GeomAdaptor_Curve curv(myComponent, myUStart, myUEnd);
GeomAdaptor_Curve curv(myComponent,myUStart,myUEnd);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient (1.e-5);
StdPrs_DeflectionCurve::Add (thePresentation, curv, myDrawer);
myDrawer->SetDeviationCoefficient (prevdev);
myDrawer->SetDeviationCoefficient(1.e-5);
StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
myDrawer->SetDeviationCoefficient(prevdev);
}
//=======================================================================
@@ -238,25 +237,27 @@ void AIS_Circle::ComputeArc (const Handle(Prs3d_Presentation)& thePresentation)
//purpose :
//=======================================================================
void AIS_Circle::ComputeCircleSelection (const Handle(SelectMgr_Selection)& theSelection)
void AIS_Circle::ComputeCircleSelection(const Handle(SelectMgr_Selection)& aSelection)
{
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner(this);
Handle(Select3D_SensitiveCircle) aCirc = new Select3D_SensitiveCircle (anOwner,
myComponent->Circ(),
myIsFilledCircleSens);
theSelection->Add (aCirc);
Handle(SelectMgr_EntityOwner) eown = new SelectMgr_EntityOwner(this);
Handle(Select3D_SensitiveCircle) seg = new Select3D_SensitiveCircle (eown,
myComponent->Circ(),
myIsFilledCircleSens);
aSelection->Add(seg);
}
//=======================================================================
//function : ComputeArcSelection
//purpose :
//=======================================================================
void AIS_Circle::ComputeArcSelection (const Handle(SelectMgr_Selection)& theSelection)
void AIS_Circle::ComputeArcSelection(const Handle(SelectMgr_Selection)& aSelection)
{
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner(this);
Handle(Select3D_SensitivePoly) aSeg = new Select3D_SensitivePoly (anOwner,
myComponent->Circ(),
myUStart, myUEnd,
myIsFilledCircleSens);
theSelection->Add (aSeg);
Handle(SelectMgr_EntityOwner) eown = new SelectMgr_EntityOwner(this);
Handle(Select3D_SensitiveCircle) seg = new Select3D_SensitiveCircle (eown,
myComponent->Circ(),
myUStart, myUEnd,
myIsFilledCircleSens);
aSelection->Add(seg);
}

View File

@@ -1,4 +1,4 @@
// Created on: 1997-01-17
// Created on: 1997-01-17
// Created by: Robert COUBLANC
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
@@ -362,7 +362,7 @@ void AIS_InteractiveContext::ObjectsForView (AIS_ListOfInteractive& theListOfIO
continue;
}
Handle(Graphic3d_ViewAffinity) anAffinity = anObjIter.Key()->ViewAffinity();
Handle(Graphic3d_ViewAffinity) anAffinity = myMainVwr->StructureManager()->ObjectAffinity (anObjIter.Key());
const Standard_Boolean isVisible = anAffinity->IsVisible (aViewId);
if (isVisible == theIsVisibleInView)
{
@@ -402,9 +402,17 @@ void AIS_InteractiveContext::SetViewAffinity (const Handle(AIS_InteractiveObject
return;
}
Handle(Graphic3d_ViewAffinity) anAffinity = theIObj->ViewAffinity();
Handle(Graphic3d_ViewAffinity) anAffinity = myMainVwr->StructureManager()->ObjectAffinity (theIObj);
Handle(Graphic3d_CView) aViewImpl = theView->View();
anAffinity->SetVisible (aViewImpl->Identification(), theIsVisible == Standard_True);
if (theIsVisible)
{
theView->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
else
{
theView->View()->ChangeHiddenObjects()->Add (theIObj.get());
}
}
//=======================================================================
@@ -437,8 +445,7 @@ void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIO
if (!myObjects.IsBound (theIObj))
{
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Displayed, theDispMode, theSelectionMode);
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
myMainVwr->StructureManager()->RegisterObject (theIObj, theIObj->ViewAffinity());
myMainVwr->StructureManager()->RegisterObject (theIObj);
myMainPM->Display(theIObj, theDispMode);
if (theSelectionMode != -1)
{
@@ -514,8 +521,7 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
Standard_Integer aDispMode, aHiMod, aSelModeDef;
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
myMainVwr->StructureManager()->RegisterObject (theIObj, theIObj->ViewAffinity());
myMainVwr->StructureManager()->RegisterObject (theIObj);
}
// Register theIObj in the selection manager to prepare further activation of selection
@@ -1001,14 +1007,6 @@ void AIS_InteractiveContext::RecomputeSelectionOnly (const Handle(AIS_Interactiv
return;
}
TColStd_ListOfInteger aModes;
ActivatedModes (theIO, aModes);
for (TColStd_ListIteratorOfListOfInteger aModesIter (aModes); aModesIter.More(); aModesIter.Next())
{
mgrSelector->Deactivate (theIO, aModesIter.Value());
}
mgrSelector->RecomputeSelection (theIO);
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIO);
@@ -1018,7 +1016,10 @@ void AIS_InteractiveContext::RecomputeSelectionOnly (const Handle(AIS_Interactiv
return;
}
for (TColStd_ListIteratorOfListOfInteger aModesIter (aModes); aModesIter.More(); aModesIter.Next())
TColStd_ListOfInteger aModes;
ActivatedModes (theIO, aModes);
TColStd_ListIteratorOfListOfInteger aModesIter (aModes);
for (; aModesIter.More(); aModesIter.Next())
{
mgrSelector->Activate (theIO, aModesIter.Value());
}
@@ -1899,9 +1900,13 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
mgrSelector->Remove (anObj);
setObjectStatus (theIObj, PrsMgr_DisplayStatus_None, -1, -1);
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
myMainVwr->StructureManager()->UnregisterObject (theIObj);
for (V3d_ListOfViewIterator aDefViewIter (myMainVwr->DefinedViewIterator()); aDefViewIter.More(); aDefViewIter.Next())
{
aDefViewIter.Value()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
if (!myLastPicked.IsNull())
{
if (myLastPicked->IsSameSelectable (theIObj))
@@ -2209,11 +2214,10 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView)
//function : BoundingBoxOfSelection
//purpose :
//=======================================================================
Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection (const Handle(V3d_View)& theView) const
Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection() const
{
Bnd_Box aBndSelected;
AIS_MapOfObjectOwners anObjectOwnerMap;
const Standard_Integer aViewId = !theView.IsNull() ? theView->View()->Identification() : -1;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner)& anOwner = aSelIter.Value();
@@ -2223,13 +2227,6 @@ Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection (const Handle(V3d_View)&
continue;
}
Handle(Graphic3d_ViewAffinity) anAffinity = anObj->ViewAffinity();
const Standard_Boolean isVisible = aViewId == -1 || anAffinity->IsVisible (aViewId);
if (!isVisible)
{
continue;
}
if (anOwner == anObj->GlobalSelOwner())
{
Bnd_Box aTmpBnd;
@@ -2267,7 +2264,7 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
const Standard_Real theMargin,
const Standard_Boolean theToUpdate)
{
Bnd_Box aBndSelected = BoundingBoxOfSelection (theView);
Bnd_Box aBndSelected = BoundingBoxOfSelection();
if (!aBndSelected.IsVoid())
{
theView->FitAll (aBndSelected, theMargin, theToUpdate);
@@ -2677,10 +2674,12 @@ AIS_StatusOfDetection AIS_InteractiveContext::moveTo (const Handle(V3d_View)& th
myDetectedSeq.Clear();
myLastActiveView = theView.get();
// preliminaries
// preliminaires
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
Standard_Boolean toUpdateViewer = Standard_False;
myFilters->SetDisabledObjects (theView->View()->HiddenObjects());
// filling of myAISDetectedSeq sequence storing information about detected AIS objects
// (the objects must be AIS_Shapes)
const Standard_Integer aDetectedNb = MainSelector()->NbPicked();

View File

@@ -42,7 +42,6 @@
#include <TCollection_AsciiString.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <Quantity_Color.hxx>
class V3d_Viewer;
@@ -503,10 +502,7 @@ public: //! @name Selection management
Standard_EXPORT AIS_StatusOfPick SelectDetected (const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Returns bounding box of selected objects.
Standard_EXPORT Bnd_Box BoundingBoxOfSelection (const Handle(V3d_View)& theView) const;
Standard_DEPRECATED ("BoundingBoxOfSelection() should be called with View argument")
Bnd_Box BoundingBoxOfSelection() const { return BoundingBoxOfSelection (Handle(V3d_View)()); }
Standard_EXPORT Bnd_Box BoundingBoxOfSelection() const;
//! Sets list of owner selected/deselected using specified selection scheme.
//! @param theOwners owners to change selection state

View File

@@ -17,8 +17,6 @@
#define _AIS_LightSource_HeaderFile
#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <SelectMgr_EntityOwner.hxx>
class Select3D_SensitiveSphere;

View File

@@ -84,8 +84,9 @@ namespace
public:
//! Main constructor.
ManipSensCircle (const Handle(SelectMgr_EntityOwner)& theOwnerId,
const gp_Circ& theCircle)
: Select3D_SensitiveCircle (theOwnerId, theCircle, Standard_False),
const gp_Circ& theCircle,
const Standard_Integer theNbPnts)
: Select3D_SensitiveCircle (theOwnerId, theCircle, Standard_False, theNbPnts),
ManipSensRotation (theCircle.Position().Direction()) {}
//! Checks whether the circle overlaps current selecting volume
@@ -1070,7 +1071,7 @@ void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationMan
return;
}
aPresentation->CStructure()->ViewAffinity = myViewAffinity;
aPresentation->CStructure()->ViewAffinity = thePM->StructureManager()->ObjectAffinity (Handle(Standard_Transient) (this));
if (anOwner->Mode() == AIS_MM_TranslationPlane)
{
@@ -1167,7 +1168,7 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
}
// define sensitivity by circle
const gp_Circ aGeomCircle (gp_Ax2 (gp::Origin(), anAxis.ReferenceAxis().Direction()), anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle (anOwner, aGeomCircle);
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle (anOwner, aGeomCircle, anAxis.FacettesNumber());
aCircle->SetSensitivityFactor (15);
theSelection->Add (aCircle);
// enlarge sensitivity by triangulation

View File

@@ -34,8 +34,6 @@ enum AIS_MouseGesture
AIS_MouseGesture_Pan, //!< view panning gesture
AIS_MouseGesture_RotateOrbit, //!< orbit rotation gesture
AIS_MouseGesture_RotateView, //!< view rotation gesture
AIS_MouseGesture_Drag, //!< object dragging;
//! press button to start, move mouse to define rectangle, release to finish
};
//! Map defining mouse gestures.

View File

@@ -22,7 +22,7 @@
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_StructureManager.hxx>
#include <Graphic3d_Texture2D.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Prs3d_Drawer.hxx>
@@ -278,17 +278,17 @@ void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& theP
TCollection_AsciiString aTextureDesc;
if (!myTexturePixMap.IsNull())
{
myTexture = new Graphic3d_Texture2D (myTexturePixMap);
myTexture = new Graphic3d_Texture2Dmanual (myTexturePixMap);
aTextureDesc = " (custom image)";
}
else if (myPredefTexture != Graphic3d_NOT_2D_UNKNOWN)
{
myTexture = new Graphic3d_Texture2D (myPredefTexture);
myTexture = new Graphic3d_Texture2Dmanual (myPredefTexture);
aTextureDesc = TCollection_AsciiString(" (predefined texture ") + myTexture->GetId() + ")";
}
else
{
myTexture = new Graphic3d_Texture2D (myTextureFile.ToCString());
myTexture = new Graphic3d_Texture2Dmanual (myTextureFile.ToCString());
aTextureDesc = TCollection_AsciiString(" (") + myTextureFile + ")";
}

View File

@@ -18,7 +18,6 @@
#include <AIS_Shape.hxx>
#include <gp_Pnt2d.hxx>
#include <Graphic3d_NameOfTexture2D.hxx>
#include <Image_PixMap.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
@@ -27,7 +26,7 @@
#include <PrsMgr_PresentationManager.hxx>
class Graphic3d_AspectFillArea3d;
class Graphic3d_Texture2D;
class Graphic3d_Texture2Dmanual;
//! This class allows to map textures on shapes.
//! Presentations modes AIS_WireFrame (0) and AIS_Shaded (1) behave in the same manner as in AIS_Shape,
@@ -185,7 +184,7 @@ protected: //! @name overridden methods
protected: //! @name presentation fields
Handle(Graphic3d_Texture2D) myTexture;
Handle(Graphic3d_Texture2Dmanual) myTexture;
Handle(Graphic3d_AspectFillArea3d) myAspect;
protected: //! @name texture source fields

View File

@@ -92,7 +92,6 @@ AIS_ViewController::AIS_ViewController()
myTouchPanThresholdPx (4.0f),
myTouchZoomThresholdPx (6.0f),
myTouchZoomRatio (0.13f),
myTouchDraggingThresholdPx (6.0f),
//
myNbTouchesLast (0),
myUpdateStartPointPan (true),
@@ -117,37 +116,22 @@ AIS_ViewController::AIS_ViewController()
myRubberBand->SetDisplayMode (0);
myRubberBand->SetMutable (true);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton,
AIS_MouseGesture_RotateOrbit);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
AIS_MouseGesture_Zoom);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
AIS_MouseGesture_Pan);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT,
AIS_MouseGesture_SelectRectangle);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
AIS_MouseGesture_SelectRectangle);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_RotateOrbit);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_Zoom);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_SHIFT, AIS_MouseGesture_Pan);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT, AIS_MouseGesture_SelectRectangle);
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT | Aspect_VKeyFlags_SHIFT, AIS_MouseGesture_SelectRectangle);
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton,
AIS_SelectionScheme_Replace);
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT,
AIS_SelectionScheme_Replace);
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
AIS_SelectionScheme_XOR);
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
AIS_SelectionScheme_XOR);
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton, AIS_SelectionScheme_Replace);
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT, AIS_SelectionScheme_Replace);
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_SHIFT, AIS_SelectionScheme_XOR);
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT | Aspect_VKeyFlags_SHIFT, AIS_SelectionScheme_XOR);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_RightButton,
AIS_MouseGesture_Zoom);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_RightButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
AIS_MouseGesture_RotateOrbit);
myMouseGestureMap.Bind (Aspect_VKeyMouse_RightButton, AIS_MouseGesture_Zoom);
myMouseGestureMap.Bind (Aspect_VKeyMouse_RightButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_RotateOrbit);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_MiddleButton,
AIS_MouseGesture_Pan);
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_MiddleButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
AIS_MouseGesture_Pan);
myMouseGestureMapDrag.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Drag);
myMouseGestureMap.Bind (Aspect_VKeyMouse_MiddleButton, AIS_MouseGesture_Pan);
myMouseGestureMap.Bind (Aspect_VKeyMouse_MiddleButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_Pan);
myXRTeleportHaptic.Duration = 3600.0f;
myXRTeleportHaptic.Frequency = 0.1f;
@@ -197,53 +181,6 @@ void AIS_ViewController::FlushViewEvents (const Handle(AIS_InteractiveContext)&
{
flushBuffers (theCtx, theView);
flushGestures(theCtx, theView);
if (theView->IsSubview())
{
// move input coordinates inside the view
const Graphic3d_Vec2i aDelta = theView->View()->SubviewTopLeft();
if (myGL.MoveTo.ToHilight || myGL.Dragging.ToStart)
{
myGL.MoveTo.Point -= aDelta;
}
if (myGL.Panning.ToStart)
{
myGL.Panning.PointStart -= aDelta;
}
if (myGL.Dragging.ToStart)
{
myGL.Dragging.PointStart -= aDelta;
}
if (myGL.Dragging.ToMove)
{
myGL.Dragging.PointTo -= aDelta;
}
if (myGL.OrbitRotation.ToStart)
{
myGL.OrbitRotation.PointStart -= Graphic3d_Vec2d (aDelta);
}
if (myGL.OrbitRotation.ToRotate)
{
myGL.OrbitRotation.PointTo -= Graphic3d_Vec2d (aDelta);
}
if (myGL.ViewRotation.ToStart)
{
myGL.ViewRotation.PointStart -= Graphic3d_Vec2d (aDelta);
}
if (myGL.ViewRotation.ToRotate)
{
myGL.ViewRotation.PointTo -= Graphic3d_Vec2d (aDelta);
}
for (Graphic3d_Vec2i& aPntIter : myGL.Selection.Points)
{
aPntIter -= aDelta;
}
for (Aspect_ScrollDelta& aZoomIter : myGL.ZoomActions)
{
aZoomIter.Point -= aDelta;
}
}
if (theToHandle)
{
HandleViewEvents (theCtx, theView);
@@ -324,21 +261,12 @@ void AIS_ViewController::flushBuffers (const Handle(AIS_InteractiveContext)& ,
myUI.Dragging.ToStop = false;
myGL.Dragging.ToStop = true;
}
else
else if (myUI.Dragging.ToStart)
{
if (myUI.Dragging.ToStart)
{
myUI.Dragging.ToStart = false;
myGL.Dragging.ToStart = true;
myGL.Dragging.PointStart = myUI.Dragging.PointStart;
}
if (myUI.Dragging.ToMove)
{
myUI.Dragging.ToMove = false;
myGL.Dragging.ToMove = true;
}
myUI.Dragging.ToStart = false;
myGL.Dragging.ToStart = true;
myGL.Dragging.PointStart = myUI.Dragging.PointStart;
}
myGL.Dragging.PointTo = myUI.Dragging.PointTo;
if (myUI.OrbitRotation.ToStart)
@@ -423,7 +351,6 @@ void AIS_ViewController::flushGestures (const Handle(AIS_InteractiveContext)& ,
const Graphic3d_Vec2d aRotDelta = aTouch.To - myGL.OrbitRotation.PointStart;
myGL.OrbitRotation.ToRotate = true;
myGL.OrbitRotation.PointTo = myGL.OrbitRotation.PointStart + aRotDelta * aRotAccel;
myGL.Dragging.ToMove = true;
myGL.Dragging.PointTo.SetValues ((int )aTouch.To.x(), (int )aTouch.To.y());
}
else
@@ -431,7 +358,6 @@ void AIS_ViewController::flushGestures (const Handle(AIS_InteractiveContext)& ,
const Graphic3d_Vec2d aRotDelta = aTouch.To - myGL.ViewRotation.PointStart;
myGL.ViewRotation.ToRotate = true;
myGL.ViewRotation.PointTo = myGL.ViewRotation.PointStart + aRotDelta * aRotAccel;
myGL.Dragging.ToMove = true;
myGL.Dragging.PointTo.SetValues ((int )aTouch.To.x(), (int )aTouch.To.y());
}
@@ -854,19 +780,6 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
UpdatePolySelection (thePoint, true);
break;
}
case AIS_MouseGesture_Drag:
{
if (myToAllowDragging)
{
myUI.Dragging.ToStart = true;
myUI.Dragging.PointStart = thePoint;
}
else
{
myMouseActiveGesture = AIS_MouseGesture_NONE;
}
break;
}
case AIS_MouseGesture_NONE:
{
break;
@@ -874,19 +787,12 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
}
}
AIS_MouseGesture aSecGesture = AIS_MouseGesture_NONE;
if (myMouseGestureMapDrag.Find (theButtons | theModifiers, aSecGesture))
if (theButtons == Aspect_VKeyMouse_LeftButton
&& theModifiers == Aspect_VKeyFlags_NONE
&& myToAllowDragging)
{
if (aSecGesture == AIS_MouseGesture_Drag
&& myToAllowDragging)
{
myUI.Dragging.ToStart = true;
myUI.Dragging.PointStart = thePoint;
if (myMouseActiveGesture == AIS_MouseGesture_NONE)
{
myMouseActiveGesture = aSecGesture;
}
}
myUI.Dragging.ToStart = true;
myUI.Dragging.PointStart = thePoint;
}
}
@@ -1010,8 +916,7 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
const double aRotTol = theIsEmulated
? double(myTouchToleranceScale) * myTouchRotationThresholdPx
: 0.0;
const Graphic3d_Vec2d aDeltaF (aDelta);
if (Abs (aDeltaF.x()) + Abs (aDeltaF.y()) > aRotTol)
if (double (Abs (aDelta.x()) + Abs (aDelta.y())) > aRotTol)
{
const double aRotAccel = myNavigationMode == AIS_NavigationMode_FirstPersonWalk ? myMouseAccel : myOrbitAccel;
const Graphic3d_Vec2i aRotDelta = thePoint - myMousePressPoint;
@@ -1027,8 +932,6 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
myUI.ViewRotation.PointTo = Graphic3d_Vec2d (myMousePressPoint.x(), myMousePressPoint.y())
+ Graphic3d_Vec2d (aRotDelta.x(), aRotDelta.y()) * aRotAccel;
}
myUI.Dragging.ToMove = true;
myUI.Dragging.PointTo = thePoint;
myMouseProgressPoint = thePoint;
@@ -1064,8 +967,7 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
const double aPanTol = theIsEmulated
? double(myTouchToleranceScale) * myTouchPanThresholdPx
: 0.0;
const Graphic3d_Vec2d aDeltaF (aDelta);
if (Abs (aDeltaF.x()) + Abs (aDeltaF.y()) > aPanTol)
if (double (Abs (aDelta.x()) + Abs (aDelta.y())) > aPanTol)
{
if (myUpdateStartPointPan)
{
@@ -1089,31 +991,6 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
}
break;
}
case AIS_MouseGesture_Drag:
{
if (!myToAllowDragging)
{
break;
}
const double aDragTol = theIsEmulated
? double(myTouchToleranceScale) * myTouchDraggingThresholdPx
: 0.0;
if (double (Abs (aDelta.x()) + Abs (aDelta.y())) > aDragTol)
{
const double aRotAccel = myNavigationMode == AIS_NavigationMode_FirstPersonWalk ? myMouseAccel : myOrbitAccel;
const Graphic3d_Vec2i aRotDelta = thePoint - myMousePressPoint;
myUI.ViewRotation.ToRotate = true;
myUI.ViewRotation.PointTo = Graphic3d_Vec2d (myMousePressPoint.x(), myMousePressPoint.y())
+ Graphic3d_Vec2d (aRotDelta.x(), aRotDelta.y()) * aRotAccel;
myUI.Dragging.ToMove = true;
myUI.Dragging.PointTo = thePoint;
myMouseProgressPoint = thePoint;
toUpdateView = true;
}
break;
}
default:
{
break;
@@ -1631,11 +1508,10 @@ void AIS_ViewController::handleZoom (const Handle(V3d_View)& theView,
Graphic3d_Vec2i aWinSize;
theView->Window()->Size (aWinSize.x(), aWinSize.y());
const Graphic3d_Vec2d aWinSizeF (aWinSize);
const Graphic3d_Vec2d aPanFromCenterPx (double(theParams.Point.x()) - 0.5 * aWinSizeF.x(),
aWinSizeF.y() - double(theParams.Point.y()) - 1.0 - 0.5 * aWinSizeF.y());
aDxy.x() += -aViewDims1.X() * aPanFromCenterPx.x() / aWinSizeF.x();
aDxy.y() += -aViewDims1.Y() * aPanFromCenterPx.y() / aWinSizeF.y();
const Graphic3d_Vec2d aPanFromCenterPx (double(theParams.Point.x()) - 0.5 * double(aWinSize.x()),
double(aWinSize.y() - theParams.Point.y() - 1) - 0.5 * double(aWinSize.y()));
aDxy.x() += -aViewDims1.X() * aPanFromCenterPx.x() / double(aWinSize.x());
aDxy.y() += -aViewDims1.Y() * aPanFromCenterPx.y() / double(aWinSize.y());
}
//theView->Translate (aCam, aDxy.x(), aDxy.y());
@@ -1969,7 +1845,7 @@ gp_Pnt AIS_ViewController::GravityPoint (const Handle(AIS_InteractiveContext)& t
void AIS_ViewController::FitAllAuto (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
const Bnd_Box aBoxSel = theCtx->BoundingBoxOfSelection (theView);
const Bnd_Box aBoxSel = theCtx->BoundingBoxOfSelection();
const double aFitMargin = 0.01;
if (aBoxSel.IsVoid())
{
@@ -2690,17 +2566,6 @@ void AIS_ViewController::OnSelectionChanged (const Handle(AIS_InteractiveContext
//
}
// =======================================================================
// function : OnSubviewChanged
// purpose :
// =======================================================================
void AIS_ViewController::OnSubviewChanged (const Handle(AIS_InteractiveContext)& ,
const Handle(V3d_View)& ,
const Handle(V3d_View)& )
{
//
}
// =======================================================================
// function : OnObjectDragged
// purpose :
@@ -3048,7 +2913,8 @@ void AIS_ViewController::handleDynamicHighlight (const Handle(AIS_InteractiveCon
myGL.OrbitRotation.ToRotate = false;
myGL.ViewRotation .ToRotate = false;
}
else if (myGL.Dragging.ToMove)
else if (myGL.OrbitRotation.ToRotate
|| myGL.ViewRotation.ToRotate)
{
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
myGL.OrbitRotation.ToRotate = false;
@@ -3076,8 +2942,6 @@ void AIS_ViewController::handleMoveTo (const Handle(AIS_InteractiveContext)& the
void AIS_ViewController::handleViewRedraw (const Handle(AIS_InteractiveContext)& ,
const Handle(V3d_View)& theView)
{
Handle(V3d_View) aParentView = theView->IsSubview() ? theView->ParentView() : theView;
// manage animation state
if (!myViewAnimation.IsNull()
&& !myViewAnimation->IsStopped())
@@ -3105,82 +2969,31 @@ void AIS_ViewController::handleViewRedraw (const Handle(AIS_InteractiveContext)&
myToAskNextFrame = true;
}
for (int aSubViewPass = 0; aSubViewPass < 2; ++aSubViewPass)
for (V3d_ListOfViewIterator aViewIter (theView->Viewer()->ActiveViewIterator()); aViewIter.More(); aViewIter.Next())
{
const bool isSubViewPass = (aSubViewPass == 0);
for (V3d_ListOfViewIterator aViewIter (theView->Viewer()->ActiveViewIterator()); aViewIter.More(); aViewIter.Next())
const Handle(V3d_View)& aView = aViewIter.Value();
if (aView->IsInvalidated()
|| (myToAskNextFrame && aView == theView))
{
const Handle(V3d_View)& aView = aViewIter.Value();
if (isSubViewPass
&& !aView->IsSubview())
if (aView->ComputedMode())
{
for (const Handle(V3d_View)& aSubviewIter : aView->Subviews())
{
if (aSubviewIter->Viewer() != theView->Viewer())
{
if (aSubviewIter->IsInvalidated())
{
if (aSubviewIter->ComputedMode())
{
aSubviewIter->Update();
}
else
{
aSubviewIter->Redraw();
}
}
else if (aSubviewIter->IsInvalidatedImmediate())
{
aSubviewIter->RedrawImmediate();
}
}
}
continue;
aView->Update();
}
else if (!isSubViewPass
&& aView->IsSubview())
else
{
continue;
}
if (aView->IsInvalidated()
|| (myToAskNextFrame && aView == theView))
{
if (aView->ComputedMode())
{
aView->Update();
}
else
{
aView->Redraw();
}
if (aView->IsSubview())
{
aView->ParentView()->InvalidateImmediate();
}
}
else if (aView->IsInvalidatedImmediate())
{
if (aView->IsSubview())
{
aView->ParentView()->InvalidateImmediate();
}
aView->RedrawImmediate();
aView->Redraw();
}
}
}
if (theView->IsSubview()
&& theView->Viewer() != aParentView->Viewer())
{
aParentView->RedrawImmediate();
else if (aView->IsInvalidatedImmediate())
{
aView->RedrawImmediate();
}
}
if (myToAskNextFrame)
{
// ask more frames
aParentView->Window()->InvalidateContent (Handle(Aspect_DisplayConnection)());
theView->Window()->InvalidateContent (Handle(Aspect_DisplayConnection)());
}
}
@@ -3425,36 +3238,6 @@ void AIS_ViewController::HandleViewEvents (const Handle(AIS_InteractiveContext)&
{
const bool wasImmediateUpdate = theView->SetImmediateUpdate (false);
Handle(V3d_View) aPickedView;
if (theView->IsSubview()
|| !theView->Subviews().IsEmpty())
{
// activate another subview on mouse click
bool toPickSubview = false;
Graphic3d_Vec2i aClickPoint;
if (myGL.Selection.Tool == AIS_ViewSelectionTool_Picking
&& !myGL.Selection.Points.IsEmpty())
{
aClickPoint = myGL.Selection.Points.Last();
toPickSubview = true;
}
else if (!myGL.ZoomActions.IsEmpty())
{
//aClickPoint = myGL.ZoomActions.Last().Point;
//toPickSubview = true;
}
if (toPickSubview)
{
if (theView->IsSubview())
{
aClickPoint += theView->View()->SubviewTopLeft();
}
Handle(V3d_View) aParent = !theView->IsSubview() ? theView : theView->ParentView();
aPickedView = aParent->PickSubview (aClickPoint);
}
}
handleViewOrientationKeys (theCtx, theView);
const AIS_WalkDelta aWalk = handleNavigationKeys (theCtx, theView);
handleXRInput (theCtx, theView, aWalk);
@@ -3472,12 +3255,6 @@ void AIS_ViewController::HandleViewEvents (const Handle(AIS_InteractiveContext)&
theView->SetImmediateUpdate (wasImmediateUpdate);
if (!aPickedView.IsNull()
&& aPickedView != theView)
{
OnSubviewChanged (theCtx, theView, aPickedView);
}
// make sure to not process the same events twice
myGL.Reset();
myToAskNextFrame = false;

View File

@@ -492,12 +492,6 @@ public:
const Handle(V3d_View)& theView,
AIS_DragAction theAction);
//! Callback called by HandleViewEvents() on Selection of another (sub)view.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void OnSubviewChanged (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theOldView,
const Handle(V3d_View)& theNewView);
//! Pick closest point under mouse cursor.
//! This method is expected to be called from rendering thread.
//! @param thePnt [out] result point
@@ -763,7 +757,6 @@ protected: //! @name mouse input variables
Standard_ShortReal myScrollZoomRatio; //!< distance ratio for mapping mouse scroll event to zoom; 15.0 by default
AIS_MouseGestureMap myMouseGestureMap; //!< map defining mouse gestures
AIS_MouseGestureMap myMouseGestureMapDrag; //!< secondary map defining mouse gestures for dragging
AIS_MouseGesture myMouseActiveGesture; //!< initiated mouse gesture (by pressing mouse button)
AIS_MouseSelectionSchemeMap
myMouseSelectionSchemes; //!< map defining selection schemes bound to mouse + modifiers
@@ -784,7 +777,6 @@ protected: //! @name multi-touch input variables
Standard_ShortReal myTouchPanThresholdPx; //!< threshold for starting two-touch panning gesture in pixels; 4 by default
Standard_ShortReal myTouchZoomThresholdPx; //!< threshold for starting two-touch zoom (pitch) gesture in pixels; 6 by default
Standard_ShortReal myTouchZoomRatio; //!< distance ratio for mapping two-touch zoom (pitch) gesture from pixels to zoom; 0.13 by default
Standard_ShortReal myTouchDraggingThresholdPx; //!< distance for starting one-touch dragging gesture in pixels; 6 by default
Aspect_Touch myTouchClick; //!< single touch position for handling clicks
OSD_Timer myTouchDoubleTapTimer; //!< timer for handling double tap

View File

@@ -859,7 +859,7 @@ Standard_Boolean AIS_ViewCube::HasAnimation() const
void AIS_ViewCube::viewFitAll (const Handle(V3d_View)& theView,
const Handle(Graphic3d_Camera)& theCamera)
{
Bnd_Box aBndBox = myToFitSelected ? GetContext()->BoundingBoxOfSelection (theView) : theView->View()->MinMaxValues();
Bnd_Box aBndBox = myToFitSelected ? GetContext()->BoundingBoxOfSelection() : theView->View()->MinMaxValues();
if (aBndBox.IsVoid()
&& myToFitSelected)
{
@@ -1016,7 +1016,7 @@ void AIS_ViewCube::HilightOwnerWithColor (const Handle(PrsMgr_PresentationManage
Handle(Prs3d_Presentation) aHiPrs = GetHilightPresentation (thePrsMgr);
aHiPrs->Clear();
aHiPrs->CStructure()->ViewAffinity = myViewAffinity;
aHiPrs->CStructure()->ViewAffinity = thePrsMgr->StructureManager()->ObjectAffinity (Handle(Standard_Transient)(this));
aHiPrs->SetTransformPersistence (TransformPersistence());
aHiPrs->SetZLayer (aLayer);

View File

@@ -87,13 +87,12 @@ public:
struct _draggingParams
{
bool ToStart; //!< start dragging
bool ToMove; //!< perform dragging
bool ToStop; //!< stop dragging
bool ToAbort; //!< abort dragging (restore previous position)
Graphic3d_Vec2i PointStart; //!< drag start point
Graphic3d_Vec2i PointTo; //!< drag end point
_draggingParams() : ToStart (false), ToMove (false), ToStop (false), ToAbort (false) {}
_draggingParams() : ToStart (false), ToStop (false), ToAbort (false) {}
} Dragging;
struct _orbitRotation
@@ -142,7 +141,6 @@ public:
Panning.ToStart = false;
Panning.ToPan = false;
Dragging.ToStart = false;
Dragging.ToMove = false;
Dragging.ToStop = false;
Dragging.ToAbort = false;
OrbitRotation.ToStart = false;

View File

@@ -15,7 +15,6 @@
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Graphic3d_Group.hxx>
#include <Image_Texture.hxx>
#include <Prs3d_LineAspect.hxx>
@@ -24,14 +23,14 @@
#include <SelectMgr_EntityOwner.hxx>
//! Texture holder.
class AIS_XRTrackedDevice::XRTexture : public Graphic3d_Texture2D
class AIS_XRTrackedDevice::XRTexture : public Graphic3d_Texture2Dmanual
{
public:
//! Constructor.
XRTexture (const Handle(Image_Texture)& theImageSource,
const Graphic3d_TextureUnit theUnit = Graphic3d_TextureUnit_BaseColor)
: Graphic3d_Texture2D (""), myImageSource (theImageSource)
: Graphic3d_Texture2Dmanual (""), myImageSource (theImageSource)
{
if (!theImageSource->TextureId().IsEmpty())
{

View File

@@ -99,10 +99,10 @@ static gp_Parab to3d(const gp_Pln& Pl, const gp_Parab2d& P)
return gp_Parab(to3d(Pl,P.Axis()),P.Focal());
}
static gp_Vec SetLinearForm(const gp_Vec2d& DW, const gp_Vec2d& D2W, const gp_Vec2d& D3W,
const gp_Vec& D1U, const gp_Vec& D1V, const gp_Vec& D2U,
const gp_Vec& D2V, const gp_Vec& D2UV, const gp_Vec& D3U,
const gp_Vec& D3V, const gp_Vec& D3UUV,const gp_Vec& D3UVV)
static gp_Vec SetLinearForm(const gp_Vec2d DW, const gp_Vec2d D2W,const gp_Vec2d D3W,
const gp_Vec D1U, const gp_Vec D1V, const gp_Vec D2U,
const gp_Vec D2V, const gp_Vec D2UV, const gp_Vec D3U,
const gp_Vec D3V, const gp_Vec D3UUV,const gp_Vec D3UVV)
{gp_Vec V31, V32, V33, V34,V3 ;
V31.SetLinearForm(DW.X(),D1U,
D2W.X()*DW.X(),D2U,

View File

@@ -114,20 +114,19 @@ public:
Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const;
Standard_EXPORT virtual Standard_Real VPeriod() const;
//! Computes the point of parameters U,V on the surface.
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
Standard_EXPORT virtual gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;
//! Computes the point of parameters U,V on the surface.
Standard_EXPORT virtual void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const;
//! Computes the point and the first derivatives on the surface.
//! Raised if the continuity of the current intervals is not C1.
//!
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
//! Computes the point and the first derivatives on
//! the surface.
//! Raised if the continuity of the current
//! intervals is not C1.
Standard_EXPORT virtual void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
//! Computes the point, the first and second
//! derivatives on the surface.
//! Raised if the continuity of the current

View File

@@ -30,6 +30,34 @@ IMPLEMENT_STANDARD_RTTIEXT(Adaptor3d_TopolTool,Standard_Transient)
#define myInfinite Precision::Infinite()
static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real& V)
{
const gp_Ax3& Pos = C.Position();
Standard_Real Radius = C.RefRadius();
Standard_Real SAngle = C.SemiAngle();
const gp_Pnt& P = C.Apex();
gp_Trsf T;
T.SetTransformation (Pos);
gp_Pnt Ploc = P.Transformed (T);
if(Ploc.X() ==0.0 && Ploc.Y()==0.0 ) {
U = 0.0;
}
else if ( -Radius > Ploc.Z()* Tan(SAngle) ) {
// the point is at the `wrong` side of the apex
U = atan2(-Ploc.Y(), -Ploc.X());
}
else {
U = atan2(Ploc.Y(),Ploc.X());
}
if (U < -1.e-16) U += (M_PI+M_PI);
else if (U < 0) U = 0;
V = sin(SAngle) * ( Ploc.X() * cos(U) + Ploc.Y() * sin(U) - Radius)
+ cos(SAngle) * Ploc.Z();
}
Adaptor3d_TopolTool::Adaptor3d_TopolTool ()
: myNbSamplesU(-1),
@@ -1348,39 +1376,3 @@ Standard_Boolean Adaptor3d_TopolTool::IsUniformSampling() const
return Standard_False;
return Standard_True;
}
//=======================================================================
//function : GetConeApexParam
//purpose : Computes the cone's apex parameters
//=======================================================================
void Adaptor3d_TopolTool::GetConeApexParam (const gp_Cone& theC, Standard_Real& theU, Standard_Real& theV)
{
const gp_Ax3& Pos = theC.Position();
Standard_Real Radius = theC.RefRadius();
Standard_Real SAngle = theC.SemiAngle();
const gp_Pnt& P = theC.Apex();
gp_Trsf T;
T.SetTransformation(Pos);
gp_Pnt Ploc = P.Transformed(T);
if (Ploc.X() == 0.0 && Ploc.Y() == 0.0)
{
theU = 0.0;
}
else if (-Radius > Ploc.Z() * Tan(SAngle))
{
// the point is at the `wrong` side of the apex
theU = atan2(-Ploc.Y(), -Ploc.X());
}
else
{
theU = atan2(Ploc.Y(), Ploc.X());
}
if (theU < -1.e-16) theU += (M_PI + M_PI);
else if (theU < 0) theU = 0;
theV = sin(SAngle) * (Ploc.X() * cos(theU) + Ploc.Y() * sin(theU) - Radius)
+ cos(SAngle) * Ploc.Z();
}

View File

@@ -146,12 +146,6 @@ public:
//! Returns true if provide uniform sampling of points.
Standard_EXPORT virtual Standard_Boolean IsUniformSampling() const;
//! Computes the cone's apex parameters.
//! @param[in] theC conical surface
//! @param[in] theU U parameter of cone's apex
//! @param[in] theV V parameter of cone's apex
Standard_EXPORT static void GetConeApexParam (const gp_Cone& theC, Standard_Real& theU, Standard_Real& theV);
DEFINE_STANDARD_RTTIEXT(Adaptor3d_TopolTool,Standard_Transient)
protected:

View File

@@ -108,7 +108,7 @@ void Approx_SameParameter_Evaluator::Evaluate (Standard_Integer *,/*Dimension*/
//purpose :
//=======================================================================
static void ProjectPointOnCurve(const Standard_Real InitValue,
const gp_Pnt& APoint,
const gp_Pnt APoint,
const Standard_Real Tolerance,
const Standard_Integer NumIteration,
const Adaptor3d_Curve& Curve,
@@ -526,8 +526,6 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
}
myDone = Standard_True;
}
myCurveOnSurface = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS.ShallowCopy());
}
//=======================================================================

View File

@@ -81,21 +81,6 @@ public:
return myCurve2d;
}
//! Returns the 3D curve that has the same parameter as
//! the 3D curve once evaluated on the surface up to the
//! specified tolerance.
Handle(Adaptor3d_Curve) Curve3d() const
{
return myC3d;
}
//! Returns the 3D curve on surface that has the same parameter as
//! the 3D curve up to the specified tolerance.
Handle(Adaptor3d_CurveOnSurface) CurveOnSurface() const
{
return myCurveOnSurface;
}
private:
//! Internal data structure to unify access to the most actively used data.
@@ -191,7 +176,6 @@ private:
Handle(Adaptor2d_Curve2d) myHCurve2d;
Handle(Adaptor3d_Curve) myC3d;
Handle(Adaptor3d_Surface) mySurf;
Handle(Adaptor3d_CurveOnSurface) myCurveOnSurface;
};
#endif // _Approx_SameParameter_HeaderFile

View File

@@ -40,58 +40,18 @@ class Aspect_Window : public Standard_Transient
DEFINE_STANDARD_RTTIEXT(Aspect_Window, Standard_Transient)
public:
//! Returns True if the window <me> is virtual
Standard_EXPORT Standard_Boolean IsVirtual() const;
//! Setup the virtual state
Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
//! Returns window top-left corner.
Graphic3d_Vec2i TopLeft() const
{
Graphic3d_Vec2i aTopLeft, aBotRight;
Position (aTopLeft.x(), aTopLeft.y(), aBotRight.x(), aBotRight.y());
return aTopLeft;
}
//! Returns window dimensions.
Graphic3d_Vec2i Dimensions() const
{
Graphic3d_Vec2i aSize;
Size (aSize.x(), aSize.y());
return aSize;
}
//! Returns connection to Display or NULL.
const Handle(Aspect_DisplayConnection)& DisplayConnection() const { return myDisplay; }
//! Returns the window background.
Standard_EXPORT Aspect_Background Background() const;
//! Returns the current image background fill mode.
Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
//! Returns the window gradient background.
Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Aspect_Background& theBack);
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Quantity_Color& theColor);
Standard_EXPORT void SetBackground (const Quantity_Color& color);
//! Modifies the window gradient background.
Standard_EXPORT void SetBackground (const Aspect_GradientBackground& theBackground);
Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
//! Modifies the window gradient background.
Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
public:
//! Returns True if the window <me> is opened
//! and False if the window is closed.
Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
//! Opens the window <me>.
Standard_EXPORT virtual void Map() const = 0;
@@ -105,6 +65,25 @@ public:
//! and returns TRUE if the window is mapped at screen.
Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
//! Returns the window background.
Standard_EXPORT Aspect_Background Background() const;
//! Returns the current image background fill mode.
Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
//! Returns the window gradient background.
Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
//! Returns True if the window <me> is opened
//! and False if the window is closed.
Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
//! Returns True if the window <me> is virtual
Standard_EXPORT Standard_Boolean IsVirtual() const;
//! Setup the virtual state
Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
//! Returns The Window RATIO equal to the physical
//! WIDTH/HEIGHT dimensions
Standard_EXPORT virtual Standard_Real Ratio() const = 0;
@@ -124,6 +103,9 @@ public:
//! Returns native Window FB config (GLXFBConfig on Xlib)
Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
//! Returns connection to Display or NULL.
const Handle(Aspect_DisplayConnection)& DisplayConnection() const { return myDisplay; }
//! Sets window title.
virtual void SetTitle (const TCollection_AsciiString& theTitle) { (void )theTitle; }

View File

@@ -525,7 +525,7 @@ protected:
Standard_EXPORT void UpdateEdgeTolerance(const Standard_Integer nE,
const Standard_Real aTolNew);
Standard_EXPORT void RemovePaveBlocks(const TColStd_MapOfInteger& theEdges);
Standard_EXPORT void RemovePaveBlocks(const TColStd_MapOfInteger theEdges);
Standard_EXPORT void CorrectToleranceOfSE();

View File

@@ -3394,7 +3394,7 @@ void BOPAlgo_PaveFiller::UpdatePaveBlocks
//function : RemovePaveBlocks
//purpose :
//=======================================================================
void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger& theEdges)
void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger theEdges)
{
// Remove all pave blocks referring to input edges:
//

View File

@@ -141,18 +141,17 @@ public:
virtual Standard_Real VPeriod() const Standard_OVERRIDE { return mySurf.VPeriod(); }
//! Computes the point of parameters U,V on the surface.
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
Standard_EXPORT gp_Pnt Value (const Standard_Real U, const Standard_Real V) const Standard_OVERRIDE;
//! Computes the point of parameters U,V on the surface.
Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
//! Computes the point and the first derivatives on the surface.
//! Raised if the continuity of the current intervals is not C1.
//!
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
//! Computes the point and the first derivatives on
//! the surface.
//! Raised if the continuity of the current
//! intervals is not C1.
Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
//! Computes the point, the first and second
//! derivatives on the surface.
//! Raised if the continuity of the current

View File

@@ -15,13 +15,8 @@
// commercial license or contractual agreement.
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Curve2d.hxx>
#include <BRepAlgo.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeEdge.hxx>
@@ -30,13 +25,10 @@
#include <ElCLib.hxx>
#include <Geom_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dConvert_ApproxArcsSegments.hxx>
#include <GeomAbs_CurveType.hxx>
#include <GeomConvert.hxx>
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
#include <GeomLProp.hxx>
#include <NCollection_Vector.hxx>
#include <gp_Pnt.hxx>
#include <Precision.hxx>
#include <ShapeFix_Shape.hxx>
@@ -48,7 +40,6 @@
#include <TColStd_SequenceOfBoolean.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
@@ -56,166 +47,6 @@
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
// The minimal tolerance of approximation (edges can be defined with yet smaller tolerance)
static const Standard_Real MINIMAL_TOLERANCE = 0.0001;
namespace {
struct OrientedCurve
{
Handle(Geom2d_TrimmedCurve) Curve;
Standard_Boolean IsReverse;
inline gp_Pnt2d Point (const Standard_Boolean isEnd) const
{
if (isEnd == IsReverse)
return Curve->StartPoint();
return Curve->EndPoint();
}
};
}
//=======================================================================
//function : ConvertWire
//purpose :
//=======================================================================
TopoDS_Wire BRepAlgo::ConvertWire(const TopoDS_Wire& theWire,
const Standard_Real theAngleTol,
const TopoDS_Face& theFace)
{
TopoDS_Wire aResult;
Standard_Real aMaxTol(0.);
const Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace);
NCollection_Vector<OrientedCurve> vecCurve;
BRepTools_WireExplorer anExpE(theWire, theFace);
// Explore the edges in the current wire, in their connection order
for (; anExpE.More(); anExpE.Next()) {
const TopoDS_Edge& anEdge = anExpE.Current();
BRepAdaptor_Curve2d aCurve(anEdge, theFace);
Standard_Real aTol = BRep_Tool::Tolerance(anEdge);
if (aTol < MINIMAL_TOLERANCE)
aTol = MINIMAL_TOLERANCE;
if (aTol > aMaxTol)
aMaxTol = aTol;
Geom2dConvert_ApproxArcsSegments anAlgo(aCurve, aTol, theAngleTol);
const TColGeom2d_SequenceOfCurve& aResultApprox = anAlgo.GetResult();
// Form the array of approximated elementary curves
if (anEdge.Orientation() == TopAbs_REVERSED) {
for (Standard_Integer iCrv = aResultApprox.Length(); iCrv > 0 ; iCrv--) {
const Handle(Geom2d_Curve)& aCrv = aResultApprox(iCrv);
if (aCrv.IsNull() == Standard_False) {
OrientedCurve& anOCurve = vecCurve.Append(OrientedCurve());
anOCurve.Curve = Handle(Geom2d_TrimmedCurve)::DownCast(aCrv);
anOCurve.IsReverse = Standard_True;
}
}
} else {
for (Standard_Integer iCrv = 1; iCrv <= aResultApprox.Length(); iCrv++) {
const Handle(Geom2d_Curve)& aCrv = aResultApprox(iCrv);
if (aCrv.IsNull() == Standard_False) {
OrientedCurve& anOCurve = vecCurve.Append(OrientedCurve());
anOCurve.Curve = Handle(Geom2d_TrimmedCurve)::DownCast(aCrv);
anOCurve.IsReverse = Standard_False;
}
}
}
}
if (vecCurve.Length() > 0)
{
// Build the first vertex
BRep_Builder aVBuilder;
gp_Pnt2d aPnt[2] = {
vecCurve(0).Point(Standard_False),
vecCurve(vecCurve.Length() - 1).Point(Standard_True)
};
Standard_Real aDist = aPnt[0].Distance(aPnt[1]);
if (aDist > aMaxTol + Precision::Confusion())
aDist = Precision::Confusion();
else {
aDist = 0.5 * aDist + Precision::Confusion();
aPnt[0] = 0.5 * (aPnt[0].XY() + aPnt[1].XY());
}
gp_Pnt aPnt3d;
aSurf->D0(aPnt[0].X(), aPnt[0].Y(), aPnt3d);
TopoDS_Vertex aFirstVertex;
aVBuilder.MakeVertex(aFirstVertex, aPnt3d, aDist);
// Loop creating edges
BRepBuilderAPI_MakeWire aMkWire;
TopoDS_Edge anEdgeRes;
TopoDS_Vertex aVertex = aFirstVertex;
for (Standard_Integer iCrv = 0; iCrv < vecCurve.Length(); iCrv++) {
const OrientedCurve& anOCurve = vecCurve(iCrv);
TopoDS_Vertex aNextVertex;
aPnt[0] = anOCurve.Point(Standard_True);
if (iCrv == vecCurve.Length() - 1) {
aPnt[1] = vecCurve(0).Point(Standard_False);
aDist = aPnt[0].Distance(aPnt[1]);
if (aDist > aMaxTol + Precision::Confusion()) {
aSurf->D0(aPnt[0].X(), aPnt[0].Y(), aPnt3d);
aVBuilder.MakeVertex(aNextVertex, aPnt3d, Precision::Confusion());
} else {
aNextVertex = aFirstVertex;
}
} else {
aPnt[1] = vecCurve(iCrv + 1).Point(Standard_False);
aDist = 0.5 * (aPnt[0].Distance(aPnt[1])) + Precision::Confusion();
aPnt[0] = 0.5 * (aPnt[0].XY() + aPnt[1].XY());
aSurf->D0(aPnt[0].X(), aPnt[0].Y(), aPnt3d);
aVBuilder.MakeVertex(aNextVertex, aPnt3d, aDist);
}
const Standard_Real aParam[2] = {
anOCurve.Curve->FirstParameter(),
anOCurve.Curve->LastParameter()
};
if (anOCurve.IsReverse) {
BRepBuilderAPI_MakeEdge aMkEdge(anOCurve.Curve, aSurf, aNextVertex,
aVertex, aParam[0], aParam[1]);
anEdgeRes = aMkEdge.Edge();
anEdgeRes.Orientation(TopAbs_REVERSED);
} else {
BRepBuilderAPI_MakeEdge aMkEdge(anOCurve.Curve, aSurf, aVertex,
aNextVertex, aParam[0], aParam[1]);
anEdgeRes = aMkEdge.Edge();
}
aVertex = aNextVertex;
aMkWire.Add(anEdgeRes);
}
if (aMkWire.IsDone())
aResult = aMkWire.Wire();
}
return aResult;
}
//=======================================================================
//function : ConvertFace
//purpose :
//=======================================================================
TopoDS_Face BRepAlgo::ConvertFace (const TopoDS_Face& theFace,
const Standard_Real theAngleTolerance)
{
TopoDS_Face aResult;
const Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace);
BRepBuilderAPI_MakeFace aMkFace(aSurf,Precision::Confusion());
TopExp_Explorer anExp(theFace, TopAbs_WIRE);
for (; anExp.More(); anExp.Next()) {
const TopoDS_Wire& aWire = TopoDS::Wire(anExp.Current());
const TopoDS_Wire aNewWire = ConvertWire(aWire, theAngleTolerance, theFace);
aMkFace.Add(aNewWire);
}
if (aMkFace.IsDone()) {
aResult = aMkFace.Face();
}
return aResult;
}
//=======================================================================
//function : ConcatenateWire
//purpose :

View File

@@ -21,7 +21,6 @@
#include <TopTools_ListOfShape.hxx>
class TopoDS_Wire;
class TopoDS_Edge;
class TopoDS_Face;
class TopoDS_Shape;
@@ -44,28 +43,6 @@ public:
//! Junction points between edges of wire may be sharp,
//! resulting curve of the resulting edge may be C0.
Standard_EXPORT static TopoDS_Edge ConcatenateWireC0 (const TopoDS_Wire& Wire);
//! Method of wire conversion, calls BRepAlgo_Approx internally.
//! @param theWire
//! Input Wire object.
//! @param theAngleTolerance
//! Angle (in radians) defining the continuity of the wire: if two vectors
//! differ by less than this angle, the result will be smooth (zero angle of
//! tangent lines between curve elements).
//! @return
//! The new TopoDS_Wire object consisting of edges each representing an arc
//! of circle or a linear segment. The accuracy of conversion is defined
//! as the maximal tolerance of edges in theWire.
static Standard_EXPORT TopoDS_Wire ConvertWire
(const TopoDS_Wire& theWire,
const Standard_Real theAngleTolerance,
const TopoDS_Face& theFace);
//! Method of face conversion. The API corresponds to the method ConvertWire.
//! This is a shortcut for calling ConvertWire() for each wire in theFace.
static Standard_EXPORT TopoDS_Face ConvertFace
(const TopoDS_Face& theFace,
const Standard_Real theAngleTolerance);
//! Checks if the shape is "correct". If not, returns
//! <Standard_False>, else returns <Standard_True>.

View File

@@ -334,7 +334,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
if(Only2d && Only3d) {
BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()),
Udeb, Ufin);
Ufin, Udeb);
prj = MKed.Edge();
BB.UpdateEdge(TopoDS::Edge(prj),
PCur2d,

View File

@@ -15,8 +15,186 @@
// commercial license or contractual agreement.
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepTools_CopyModification.hxx>
#include <BRepTools_Modification.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <Poly_Triangulation.hxx>
namespace {
//! Tool class implementing necessary functionality for copying geometry
class BRepBuilderAPI_Copy_Modification : public BRepTools_Modification
{
public:
BRepBuilderAPI_Copy_Modification (const Standard_Boolean copyGeom,
const Standard_Boolean copyMesh)
: myCopyGeom(copyGeom),
myCopyMesh(copyMesh)
{
}
//! Returns true to indicate the need to copy face;
//! copies surface if requested
Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S,
TopLoc_Location& L, Standard_Real& Tol,
Standard_Boolean& RevWires, Standard_Boolean& RevFace) Standard_OVERRIDE
{
S = BRep_Tool::Surface(F,L);
Tol = BRep_Tool::Tolerance(F);
RevWires = RevFace = Standard_False;
if ( ! S.IsNull() && myCopyGeom )
S = Handle(Geom_Surface)::DownCast(S->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy triangulation;
//! copies it if required
Standard_Boolean NewTriangulation(const TopoDS_Face& F, Handle(Poly_Triangulation)& T) Standard_OVERRIDE
{
if (!myCopyMesh
&& BRep_Tool::IsGeometric (F))
{
return Standard_False;
}
TopLoc_Location L;
T = BRep_Tool::Triangulation(F, L);
if (T.IsNull())
return Standard_False;
// mesh is copied if and only if the geometry need to be copied too
if (myCopyGeom)
T = T->Copy();
return Standard_True;
}
//! Returns true to indicate the need to copy edge;
//! copies curves if requested
Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C,
TopLoc_Location& L, Standard_Real& Tol) Standard_OVERRIDE
{
Standard_Real f,l;
C = BRep_Tool::Curve (E, L, f, l);
Tol = BRep_Tool::Tolerance(E);
if ( ! C.IsNull() && myCopyGeom )
C = Handle(Geom_Curve)::DownCast(C->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy polygon;
//! copies it if required
Standard_Boolean NewPolygon(const TopoDS_Edge& E, Handle(Poly_Polygon3D)& P) Standard_OVERRIDE
{
if (!myCopyMesh
&& BRep_Tool::IsGeometric (E))
{
return Standard_False;
}
TopLoc_Location aLoc;
P = BRep_Tool::Polygon3D(E, aLoc);
if (P.IsNull())
return Standard_False;
// polygon is copied if and only if the geometry need to be copied too
if (myCopyGeom)
P = P->Copy();
return Standard_True;
}
//! Returns true to indicate the need to copy polygon;
//! copies it if required
Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& E, const TopoDS_Face& F,
Handle(Poly_PolygonOnTriangulation)& P) Standard_OVERRIDE
{
if (!myCopyMesh
&& BRep_Tool::IsGeometric (E))
{
return Standard_False;
}
TopLoc_Location aLoc;
Handle(Poly_Triangulation) aTria = BRep_Tool::Triangulation(F, aLoc);
P = BRep_Tool::PolygonOnTriangulation(E, aTria, aLoc);
if (P.IsNull())
return Standard_False;
// polygon is copied if and only if the geometry need to be copied too
if (myCopyGeom)
P = P->Copy();
return Standard_True;
}
//! Returns true to indicate the need to copy vertex
Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P,
Standard_Real& Tol) Standard_OVERRIDE
{
P = BRep_Tool::Pnt(V);
Tol = BRep_Tool::Tolerance(V);
return Standard_True;
}
//! Returns true to indicate the need to copy edge;
//! copies pcurve if requested
Standard_Boolean NewCurve2d (const TopoDS_Edge& E,
const TopoDS_Face& F,
const TopoDS_Edge& /*NewE*/,
const TopoDS_Face& /*NewF*/,
Handle(Geom2d_Curve)& C,
Standard_Real& Tol) Standard_OVERRIDE
{
Tol = BRep_Tool::Tolerance(E);
Standard_Real f, l;
C = BRep_Tool::CurveOnSurface (E, F, f, l);
if ( ! C.IsNull() && myCopyGeom )
C = Handle(Geom2d_Curve)::DownCast (C->Copy());
return Standard_True;
}
//! Returns true to indicate the need to copy vertex
Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E,
Standard_Real& P, Standard_Real& Tol) Standard_OVERRIDE
{
if (V.IsNull()) return Standard_False; // infinite edge may have Null vertex
Tol = BRep_Tool::Tolerance(V);
P = BRep_Tool::Parameter (V, E);
return Standard_True;
}
//! Returns the continuity of E between F1 and F2
GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1,
const TopoDS_Face& F2, const TopoDS_Edge&,
const TopoDS_Face&, const TopoDS_Face&) Standard_OVERRIDE
{
return BRep_Tool::Continuity (E, F1, F2);
}
public:
DEFINE_STANDARD_RTTI_INLINE(BRepBuilderAPI_Copy_Modification,BRepTools_Modification)
private:
Standard_Boolean myCopyGeom;
Standard_Boolean myCopyMesh;
};
} // anonymous namespace
//=======================================================================
//function : BRepBuilderAPI_Copy
@@ -25,7 +203,7 @@
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy ()
{
myModification = new BRepTools_CopyModification(Standard_True, Standard_False);
myModification = new BRepBuilderAPI_Copy_Modification(Standard_True, Standard_False);
}
@@ -36,7 +214,7 @@ BRepBuilderAPI_Copy::BRepBuilderAPI_Copy ()
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_Boolean copyGeom, const Standard_Boolean copyMesh)
{
myModification = new BRepTools_CopyModification(copyGeom, copyMesh);
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom, copyMesh);
DoModif(S);
}
@@ -48,7 +226,7 @@ BRepBuilderAPI_Copy::BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_B
void BRepBuilderAPI_Copy::Perform(const TopoDS_Shape& S, const Standard_Boolean copyGeom, const Standard_Boolean copyMesh)
{
myModification = new BRepTools_CopyModification(copyGeom, copyMesh);
myModification = new BRepBuilderAPI_Copy_Modification(copyGeom, copyMesh);
NotDone(); // on force la copie si on vient deja d`en faire une
DoModif(S);
}

View File

@@ -1,247 +0,0 @@
// Created on: 2022-06-30
// Created by: Alexander MALYSHEV
// Copyright (c) 2022-2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepBuilderAPI_MakeShapeOnMesh.hxx>
#include <BRep_Builder.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <NCollection_IndexedDataMap.hxx>
namespace
{
//! Structure representing mesh edge.
struct Edge
{
//! Constructor. Sets edge nodes.
Edge(const Standard_Integer TheIdx1,
const Standard_Integer TheIdx2)
: Idx1(Min(TheIdx1, TheIdx2)),
Idx2(Max(TheIdx1, TheIdx2))
{}
//! Comparison operator.
Standard_Boolean operator<(const Edge& other) const
{
if (Idx1 < other.Idx1 ||
(Idx1 == other.Idx1 && Idx2 < other.Idx2))
{
return Standard_True;
}
return Standard_False;
}
//! First index. It is lower or equal than the second.
Standard_Integer Idx1;
//! Second index.
Standard_Integer Idx2;
};
//! Hasher of Edge structure.
struct EdgeHasher
{
//! Returns hash code for the given edge.
static Standard_Integer HashCode(const Edge& theEdge,
const Standard_Integer theUpperBound)
{
// Circle-based collisions.
return ::HashCode(theEdge.Idx1 * theEdge.Idx1 + theEdge.Idx2 * theEdge.Idx2, theUpperBound);
}
//! Returns true if two edges are equal.
static Standard_Boolean IsEqual(const Edge& theEdge1,
const Edge& theEdge2)
{
return theEdge1.Idx1 == theEdge2.Idx1 && theEdge1.Idx2 == theEdge2.Idx2;
}
};
}
//=======================================================================
//function : Build
//purpose :
//=======================================================================
void BRepBuilderAPI_MakeShapeOnMesh::Build(const Message_ProgressRange& theRange)
{
// Generally, this method guarantees topology sharing by mapping mesh primitives
// into topological counterparts.
// mesh points -> topological vertices
// mesh edges -> topological edges
// Cannot reconstruct anything from null or empty mesh.
if (myMesh.IsNull() || myMesh->NbNodes() == 0 || myMesh->NbTriangles() == 0)
return;
const Standard_Integer aNbNodes = myMesh->NbNodes();
const Standard_Integer aNbTriangles = myMesh->NbTriangles();
// We are going to have three loops: iterate once over nodes and iterate twice
// over triangles of input mesh.
Message_ProgressScope aPS(theRange,
"Per-facet shape construction",
Standard_Real(aNbNodes + 2 * aNbTriangles));
// Build shared vertices.
NCollection_IndexedDataMap<Standard_Integer, TopoDS_Vertex> aPnt2VertexMap;
for (Standard_Integer i = 1; i <= aNbNodes; ++i)
{
aPS.Next();
if (aPS.UserBreak())
return;
const gp_Pnt aP = myMesh->Node(i);
const TopoDS_Vertex aV = BRepBuilderAPI_MakeVertex(aP);
aPnt2VertexMap.Add(i, aV);
}
// Build shared edges.
NCollection_IndexedDataMap<Edge, TopoDS_Edge, EdgeHasher> anEdgeToTEgeMap;
for (Standard_Integer i = 1; i <= aNbTriangles; ++i)
{
aPS.Next();
if (aPS.UserBreak())
return;
Standard_Integer anIdx[3];
const Poly_Triangle& aTriangle = myMesh->Triangle(i);
aTriangle.Get(anIdx[0], anIdx[1], anIdx[2]);
// Skip degenerated triangles.
if (anIdx[0] == anIdx[1] || anIdx[0] == anIdx[2] || anIdx[1] == anIdx[2])
continue;
const gp_Pnt aP1 = myMesh->Node(anIdx[0]);
const gp_Pnt aP2 = myMesh->Node(anIdx[1]);
const gp_Pnt aP3 = myMesh->Node(anIdx[2]);
const Standard_Real aD1 = aP1.SquareDistance(aP2);
const Standard_Real aD2 = aP1.SquareDistance(aP3);
const Standard_Real aD3 = aP2.SquareDistance(aP3);
if (aD1 < gp::Resolution() ||
aD2 < gp::Resolution() ||
aD3 < gp::Resolution())
{
continue;
}
// Edges are constructed in forward order for the existing normals orientation.
// In Poly_Triangulation, positive direction is defined as cross product:
// (aV1, aV2) x (aV1, aV3).
const TopoDS_Vertex& aV1 = aPnt2VertexMap.FindFromKey(anIdx[0]);
const TopoDS_Vertex& aV2 = aPnt2VertexMap.FindFromKey(anIdx[1]);
const TopoDS_Vertex& aV3 = aPnt2VertexMap.FindFromKey(anIdx[2]);
const Edge aMeshEdge1(anIdx[0], anIdx[1]);
const Edge aMeshEdge2(anIdx[1], anIdx[2]);
const Edge aMeshEdge3(anIdx[2], anIdx[0]);
BRepBuilderAPI_MakeEdge aMaker1(aV1, aV2);
BRepBuilderAPI_MakeEdge aMaker2(aV2, aV3);
BRepBuilderAPI_MakeEdge aMaker3(aV3, aV1);
TopoDS_Edge aTE1 = aMaker1.Edge();
if (anIdx[1] < anIdx[0])
aTE1.Reverse();
TopoDS_Edge aTE2 = aMaker2.Edge();
if (anIdx[2] < anIdx[1])
aTE2.Reverse();
TopoDS_Edge aTE3 = aMaker3.Edge();
if (anIdx[0] < anIdx[2])
aTE3.Reverse();
anEdgeToTEgeMap.Add(aMeshEdge1, aTE1);
anEdgeToTEgeMap.Add(aMeshEdge2, aTE2);
anEdgeToTEgeMap.Add(aMeshEdge3, aTE3);
}
// Construct planar faces using shared topology.
TopoDS_Compound aResult;
BRep_Builder aBB;
aBB.MakeCompound(aResult);
for (Standard_Integer i = 1; i <= aNbTriangles; ++i)
{
aPS.Next();
if (aPS.UserBreak())
return;
Standard_Integer anIdx[3];
const Poly_Triangle& aTriangle = myMesh->Triangle(i);
aTriangle.Get(anIdx[0], anIdx[1], anIdx[2]);
const Edge aMeshEdge1(anIdx[0], anIdx[1]);
const Edge aMeshEdge2(anIdx[1], anIdx[2]);
const Edge aMeshEdge3(anIdx[2], anIdx[0]);
const Standard_Boolean isReversed1 = anIdx[1] < anIdx[0];
const Standard_Boolean isReversed2 = anIdx[2] < anIdx[1];
const Standard_Boolean isReversed3 = anIdx[0] < anIdx[2];
// Edges can be skipped in case of mesh defects - topologically or geometrically
// degenerated triangles.
const Standard_Boolean aHasAllEdges = anEdgeToTEgeMap.Contains(aMeshEdge1) &&
anEdgeToTEgeMap.Contains(aMeshEdge2) &&
anEdgeToTEgeMap.Contains(aMeshEdge3) ;
if (!aHasAllEdges)
continue;
TopoDS_Edge aTEdge1 = anEdgeToTEgeMap.FindFromKey(aMeshEdge1);
if (isReversed1)
aTEdge1.Reverse();
TopoDS_Edge aTEdge2 = anEdgeToTEgeMap.FindFromKey(aMeshEdge2);
if (isReversed2)
aTEdge2.Reverse();
TopoDS_Edge aTEdge3 = anEdgeToTEgeMap.FindFromKey(aMeshEdge3);
if (isReversed3)
aTEdge3.Reverse();
BRepBuilderAPI_MakeWire aWireMaker;
aWireMaker.Add(aTEdge1);
aWireMaker.Add(aTEdge2);
aWireMaker.Add(aTEdge3);
const TopoDS_Wire aWire = aWireMaker.Wire();
// Construct plane explicitly since it is faster than automatic construction
// within BRepBuilderAPI_MakeFace.
BRepAdaptor_Curve aC1(aTEdge1);
BRepAdaptor_Curve aC2(aTEdge2);
const gp_Dir aD1 = aC1.Line().Direction();
const gp_Dir aD2 = aC2.Line().Direction();
gp_XYZ aN = aD1.XYZ().Crossed(aD2.XYZ());
if (aN.SquareModulus() < Precision::SquareConfusion())
continue;
if (aTEdge1.Orientation() == TopAbs_REVERSED)
aN.Reverse();
if (aTEdge2.Orientation() == TopAbs_REVERSED)
aN.Reverse();
const gp_Dir aNorm(aN);
gp_Pln aPln(myMesh->Node(anIdx[0]), aNorm);
BRepBuilderAPI_MakeFace aFaceMaker(aPln, aWire);
const TopoDS_Face aFace = aFaceMaker.Face();
aBB.Add(aResult, aFace);
}
this->Done();
myShape = aResult;
}

View File

@@ -1,46 +0,0 @@
// Created on: 2022-06-30
// Created by: Alexander MALYSHEV
// Copyright (c) 2022-2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepBuilderAPI_MakeShapeOnMesh_HeaderFile
#define _BRepBuilderAPI_MakeShapeOnMesh_HeaderFile
#include <BRepBuilderAPI_MakeShape.hxx>
#include <Poly_Triangulation.hxx>
//! Builds shape on per-facet basis on the input mesh. Resulting shape has shared
//! edges by construction, but no maximization (unify same domain) is applied.
//! No generation history is provided.
class BRepBuilderAPI_MakeShapeOnMesh : public BRepBuilderAPI_MakeShape
{
public:
DEFINE_STANDARD_ALLOC
//! Ctor. Sets mesh to process.
//! @param theMesh [in] - Mesh to construct shape for.
BRepBuilderAPI_MakeShapeOnMesh(const Handle(Poly_Triangulation)& theMesh)
: myMesh(theMesh)
{}
//! Builds shape on mesh.
Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
private:
Handle(Poly_Triangulation) myMesh;
};
#endif // _BRepBuilderAPI_MakeShapeOnMesh_HeaderFile

View File

@@ -36,14 +36,13 @@ BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const gp_Trsf& T) :
//purpose :
//=======================================================================
BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const TopoDS_Shape& theShape,
const gp_Trsf& theTrsf,
const Standard_Boolean theCopyGeom,
const Standard_Boolean theCopyMesh)
: myTrsf(theTrsf)
BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const TopoDS_Shape& S,
const gp_Trsf& T,
const Standard_Boolean Copy) :
myTrsf(T)
{
myModification = new BRepTools_TrsfModification(theTrsf);
Perform(theShape, theCopyGeom, theCopyMesh);
myModification = new BRepTools_TrsfModification(T);
Perform(S,Copy);
}
@@ -53,21 +52,19 @@ BRepBuilderAPI_Transform::BRepBuilderAPI_Transform (const TopoDS_Shape& theSh
//purpose :
//=======================================================================
void BRepBuilderAPI_Transform::Perform(const TopoDS_Shape& theShape,
const Standard_Boolean theCopyGeom,
const Standard_Boolean theCopyMesh)
void BRepBuilderAPI_Transform::Perform(const TopoDS_Shape& S,
const Standard_Boolean Copy)
{
myUseModif = theCopyGeom || myTrsf.IsNegative() || (Abs(Abs(myTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
myUseModif = Copy || myTrsf.IsNegative() || (Abs(Abs(myTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
if (myUseModif) {
Handle(BRepTools_TrsfModification) theModif =
Handle(BRepTools_TrsfModification)::DownCast(myModification);
theModif->Trsf() = myTrsf;
theModif->IsCopyMesh() = theCopyMesh;
DoModif(theShape, myModification);
DoModif(S,myModification);
}
else {
myLocation = myTrsf;
myShape = theShape.Moved(myLocation);
myShape = S.Moved(myLocation);
Done();
}

View File

@@ -50,37 +50,28 @@ public:
//! to define the shape to transform.
Standard_EXPORT BRepBuilderAPI_Transform(const gp_Trsf& T);
//! Creates a transformation from the gp_Trsf <theTrsf>, and
//! applies it to the shape <theShape>. If the transformation
//! Creates a transformation from the gp_Trsf <T>, and
//! applies it to the shape <S>. If the transformation
//! is direct and isometric (determinant = 1) and
//! <theCopyGeom> = Standard_False, the resulting shape is
//! <theShape> on which a new location has been set.
//! <Copy> = Standard_False, the resulting shape is
//! <S> on which a new location has been set.
//! Otherwise, the transformation is applied on a
//! duplication of <theShape>.
//! If <theCopyMesh> is true, the triangulation will be copied,
//! and the copy will be assigned to the result shape.
Standard_EXPORT BRepBuilderAPI_Transform(const TopoDS_Shape& theShape,
const gp_Trsf& theTrsf,
const Standard_Boolean theCopyGeom = Standard_False,
const Standard_Boolean theCopyMesh = Standard_False);
//! duplication of <S>.
Standard_EXPORT BRepBuilderAPI_Transform(const TopoDS_Shape& S, const gp_Trsf& T, const Standard_Boolean Copy = Standard_False);
//! Applies the geometric transformation defined at the
//! pplies the geometric transformation defined at the
//! time of construction of this framework to the shape S.
//! - If the transformation T is direct and isometric, in
//! other words, if the determinant of the vectorial part
//! of T is equal to 1., and if theCopyGeom equals false (the
//! of T is equal to 1., and if Copy equals false (the
//! default value), the resulting shape is the same as
//! the original but with a new location assigned to it.
//! - In all other cases, the transformation is applied to a duplicate of theShape.
//! - If theCopyMesh is true, the triangulation will be copied,
//! and the copy will be assigned to the result shape.
//! - In all other cases, the transformation is applied to a duplicate of S.
//! Use the function Shape to access the result.
//! Note: this framework can be reused to apply the same
//! geometric transformation to other shapes. You only
//! need to specify them by calling the function Perform again.
Standard_EXPORT void Perform (const TopoDS_Shape& theShape,
const Standard_Boolean theCopyGeom = Standard_False,
const Standard_Boolean theCopyMesh = Standard_False);
Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Boolean Copy = Standard_False);
//! Returns the modified shape corresponding to <S>.
Standard_EXPORT virtual TopoDS_Shape ModifiedShape (const TopoDS_Shape& S) const Standard_OVERRIDE;

View File

@@ -26,8 +26,6 @@ BRepBuilderAPI_MakePolygon.cxx
BRepBuilderAPI_MakePolygon.hxx
BRepBuilderAPI_MakeShape.cxx
BRepBuilderAPI_MakeShape.hxx
BRepBuilderAPI_MakeShapeOnMesh.cxx
BRepBuilderAPI_MakeShapeOnMesh.hxx
BRepBuilderAPI_MakeShell.cxx
BRepBuilderAPI_MakeShell.hxx
BRepBuilderAPI_MakeSolid.cxx

View File

@@ -197,12 +197,10 @@ Standard_Boolean CheckOn(IntRes2d_IntersectionPoint& thePntInter,
if (aMinDist <= theTolZ) {
IntRes2d_Transition aTrOnLin(IntRes2d_Head);
IntRes2d_Position aPosOnCurve = IntRes2d_Middle;
if ((Abs(aPar - theDeb) <= Precision::Confusion())
|| (aPar < theDeb)) {
if (Abs(aPar - theDeb) <= Precision::Confusion()) {
aPosOnCurve = IntRes2d_Head;
}
else if ((Abs(aPar - theFin) <= Precision::Confusion())
|| (aPar > theFin)) {
else if (Abs(aPar - theFin) <= Precision::Confusion()) {
aPosOnCurve = IntRes2d_End;
}
//
@@ -383,16 +381,8 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
{
Standard_Boolean aStatusOn = Standard_False;
IntRes2d_IntersectionPoint aPntInter;
Standard_Real aDebTol = deb;
Standard_Real aFinTol = fin;
if (aTolZ > Precision::Confusion())
{
aDebTol = deb - aTolZ;
aFinTol = fin + aTolZ;
}
Geom2dAdaptor_Curve aCurAdaptor(aC2D, aDebTol, aFinTol);
aStatusOn = CheckOn(aPntInter, F, L, aCurAdaptor, aTolZ, fin, deb);
aStatusOn = CheckOn(aPntInter, F, L, C, aTolZ, fin, deb);
if (aStatusOn)
{
Append(aPntInter);

View File

@@ -30,6 +30,7 @@
#include <TopoDS_Face.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <Precision.hxx>
#include <Bnd_SeqOfBox.hxx>
#include <BRepExtrema_UnCompatibleShape.hxx>
#include <BRep_Tool.hxx>
#include <BRepClass3d_SolidClassifier.hxx>

View File

@@ -81,7 +81,7 @@ void BRepExtrema_ExtCF::Perform(const TopoDS_Edge& E, const TopoDS_Face& F2)
BRepAdaptor_Curve Curv(E);
Handle(BRepAdaptor_Curve) HC = new BRepAdaptor_Curve(Curv);
myExtCS.Perform(*HC, U1, U2);
myExtCS.Perform(HC->Curve(), U1, U2);
if(!myExtCS.IsDone())
return;

View File

@@ -1,460 +0,0 @@
// Created on: 2022-08-08
// Created by: Kseniya NOSULKO
// Copyright (c) 2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepExtrema_ProximityDistTool.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pln.hxx>
#include <Precision.hxx>
#include <Poly_Connect.hxx>
#include <Standard_NullValue.hxx>
#include <TopoDS.hxx>
//=======================================================================
//function : BRepExtrema_ProximityDistTool
//purpose : Creates new unitialized tool
//=======================================================================
BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool()
: myMinDistance (std::numeric_limits<Standard_Real>::max()),
myProxDist (-1.),
myPntStatus1 (ProxPnt_Status_UNKNOWN),
myPntStatus2 (ProxPnt_Status_UNKNOWN),
myNbSamples1 (0),
myProxVtxIdx1 (-1)
{
}
//=======================================================================
//function : BRepExtrema_ProximityDistTool
//purpose : Creates new tool for the given element sets
//=======================================================================
BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Standard_Integer theNbSamples1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2)
: myMinDistance (std::numeric_limits<Standard_Real>::max()),
myProxDist (-1.),
myPntStatus1 (ProxPnt_Status_UNKNOWN),
myPntStatus2 (ProxPnt_Status_UNKNOWN),
myNbSamples1 (theNbSamples1),
myProxVtxIdx1 (-1)
{
LoadTriangleSets (theSet1, theSet2);
LoadShapeLists (theShapeList1, theShapeList2);
}
//=======================================================================
//function : LoadTriangleSets
//purpose : Loads the given element sets into the tool
//=======================================================================
void BRepExtrema_ProximityDistTool::LoadTriangleSets (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2)
{
mySet1 = theSet1;
mySet2 = theSet2;
}
//=======================================================================
//function : LoadTriangleSets
//purpose : Loads the given list of subshapes into the proximity tool
//=======================================================================
void BRepExtrema_ProximityDistTool::LoadShapeLists (const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2)
{
myShapeList1 = theShapeList1;
myShapeList2 = theShapeList2;
}
//=======================================================================
//function : Perform
//purpose : Performs searching of the proximity distance
//=======================================================================
void BRepExtrema_ProximityDistTool::Perform()
{
SetBVHSet (mySet2.get());
const BVH_Array3d& aVertices1 = mySet1->GetVertices();
Standard_Integer aVtxSize = (Standard_Integer)aVertices1.size();
Standard_Integer aVtxStep = Max (myNbSamples1 <= 0 ? 1 : aVtxSize / myNbSamples1, 1);
for (Standard_Integer aVtxIdx = 0; aVtxIdx < aVtxSize; aVtxIdx += aVtxStep)
{
myDistance = std::numeric_limits<Standard_Real>::max();
myMinDistance = std::numeric_limits<Standard_Real>::max();
myIsDone = Standard_False;
SetObject (aVertices1[aVtxIdx]);
ComputeDistance();
if (!IsDone() && myProxDist < 0.) return;
if (IsDone() && myDistance > myProxDist)
{
myPnt1 = aVertices1[aVtxIdx];
myPnt2 = myExtremaPoint;
myProxDist = myDistance;
myProxVtxIdx1 = aVtxIdx;
myProxPrjState = myExtPrjState;
}
}
myIsDone = myProxDist > -1.;
if (myIsDone)
{
DefineStatusProxPnt();
}
}
static Standard_Real pointBoxSquareMaxDistance (const BVH_Vec3d& thePoint,
const BVH_Vec3d& theCMin,
const BVH_Vec3d& theCMax)
{
Standard_Real aDist = 0;
for (int i = 0; i < 3; ++i)
{
if (thePoint[i] <= 0.5 * (theCMax[i] + theCMin[i])) { Standard_Real d = theCMax[i] - thePoint[i]; d *= d; aDist += d; }
else { Standard_Real d = thePoint[i] - theCMin[i]; d *= d; aDist += d; }
}
return aDist;
}
//=======================================================================
//function : Branch rejection
//purpose : Defines the rules for node rejection by bounding box
//=======================================================================
Standard_Boolean BRepExtrema_ProximityDistTool::RejectNode (const BVH_Vec3d& theCornerMin,
const BVH_Vec3d& theCornerMax,
Standard_Real& theMetric) const
{
theMetric = sqrt (BVH_Tools<Standard_Real, 3>::PointBoxSquareDistance (myObject,
theCornerMin,
theCornerMax));
Standard_Real aMaxMetric = sqrt (pointBoxSquareMaxDistance (myObject,
theCornerMin,
theCornerMax));
return theMetric > myDistance || aMaxMetric < myProxDist;
}
//=======================================================================
//function : Leaf acceptance
//purpose : Defines the rules for leaf acceptance
//=======================================================================
Standard_Boolean BRepExtrema_ProximityDistTool::Accept (const Standard_Integer theTrgIdx,
const Standard_Real&)
{
BVH_Vec3d aTrgVert1;
BVH_Vec3d aTrgVert2;
BVH_Vec3d aTrgVert3;
BVH_PrjState aBVH_PrjState;
Standard_Integer aNumberOfFirstNode = -1;
Standard_Integer aNumberOfLastNode = -1;
mySet2->GetVertices (theTrgIdx, aTrgVert1, aTrgVert2, aTrgVert3);
BVH_Vec3d aNearestPnt = BVH_Tools<Standard_Real, 3>::PointTriangleProjection (myObject,
aTrgVert1, aTrgVert2, aTrgVert3,
&aBVH_PrjState,
&aNumberOfFirstNode, &aNumberOfLastNode);
PrjState aPrjState (theTrgIdx, aBVH_PrjState, aNumberOfFirstNode, aNumberOfLastNode);
BVH_Vec3d aDirect = myObject - aNearestPnt;
Standard_Real aSqDistance = aDirect.Dot(aDirect);
if (aSqDistance > Precision::SquareConfusion()) // point belongs to triangle
{
const BVH_Vec3d aAB = aTrgVert2 - aTrgVert1;
BVH_Vec3d aNorm;
if (aTrgVert2.IsEqual (aTrgVert3)) // is this degenerate triangle (= segment)
{
const BVH_Vec3d aAP = myObject - aTrgVert1;
aNorm = BVH_Vec3d::Cross (BVH_Vec3d::Cross (aAP, aAB), aAB);
}
else
{
const BVH_Vec3d aAC = aTrgVert3 - aTrgVert1;
aNorm = BVH_Vec3d::Cross (aAB, aAC);
}
Standard_Real aNormSqLen = aNorm.Dot (aNorm);
// check if the distance is under perpendicular
const BVH_Vec3d aCrossCross = BVH_Vec3d::Cross (aDirect, aNorm);
Standard_Real aCrossCrossSqLen = aCrossCross.Dot (aCrossCross);
if (aCrossCrossSqLen > Precision::SquareConfusion() * aSqDistance * aNormSqLen)
{
// the distance is not under perpendicular
if (myMinDistance - sqrt (aSqDistance) > Precision::Confusion())
{
myMinDistance = sqrt (aSqDistance);
myMinDistPoint = aNearestPnt;
myMinPrjState = aPrjState;
}
return Standard_False;
}
}
// the distance is under perpendicular
if (myDistance - sqrt (aSqDistance) > Precision::Confusion())
{
myDistance = sqrt (aSqDistance);
myExtremaPoint = aNearestPnt;
myExtPrjState = aPrjState;
return Standard_True;
}
return Standard_False;
}
//=======================================================================
//function : ComputeDistance
//purpose : Computes the distance between object and BVH tree
//=======================================================================
Standard_Real BRepExtrema_ProximityDistTool::ComputeDistance()
{
myIsDone = this->Select() > 0;
if (!myIsDone)
{
if (myMinDistance < std::numeric_limits<Standard_Real>::max())
{
myExtremaPoint = myMinDistPoint;
myExtPrjState = myMinPrjState;
myIsDone = true;
}
myDistance = myMinDistance;
}
return myDistance;
}
static Standard_Boolean isNodeOnBorder (const Standard_Integer theNodeIdx, const Handle (Poly_Triangulation)& theTr)
{
Poly_Connect aPolyConnect (theTr);
Standard_Integer aContTrg; //index of triangle containing exploring node
for (aPolyConnect.Initialize (theNodeIdx); aPolyConnect.More(); aPolyConnect.Next())
{
aContTrg = aPolyConnect.Value();
Standard_Integer aContTrgNodes[3];
theTr->Triangle (aContTrg).Get (aContTrgNodes[0], aContTrgNodes[1], aContTrgNodes[2]); //indices of nodes of the triangle
Standard_Integer aAdjTrg[3];
aPolyConnect.Triangles (aContTrg, aAdjTrg[0], aAdjTrg[1], aAdjTrg[2]); //indices of adjacent triangles
for (Standard_Integer j = 0; j < 3; j++)
{
Standard_Integer k = (j + 1) % 3;
if (aAdjTrg[j] == 0) //free segment of triangle
{
//aContTrgNodes[j], aContTrgNodes[k] are ends of free segment and it is a part of border
if (aContTrgNodes[j] == theNodeIdx || aContTrgNodes[k] == theNodeIdx)
{
return Standard_True;
}
}
}
}
return Standard_False;
}
//=======================================================================
//function : defineStatusProxPnt1
//purpose : Defines the status of proximity point from 1st BVH
//=======================================================================
void BRepExtrema_ProximityDistTool::defineStatusProxPnt1()
{
Standard_Integer aFaceID1 = mySet1->GetShapeIDOfVtx (myProxVtxIdx1);
if (myShapeList1 (aFaceID1).ShapeType() == TopAbs_EDGE)
{
const BVH_Array3d& aVertices1 = mySet1->GetVertices();
Standard_Integer aVtxSize = (Standard_Integer)aVertices1.size();
Standard_Integer aLastIdx = aVtxSize - 1;
if ((aVertices1[0] - aVertices1[aLastIdx]).Modulus() < Precision::Confusion()) // if closed
{
myPntStatus1 = ProxPnt_Status_MIDDLE;
return;
}
if (myProxVtxIdx1 == 0 || myProxVtxIdx1 == aLastIdx)
{
myPntStatus1 = ProxPnt_Status_BORDER;
}
else
{
myPntStatus1 = ProxPnt_Status_MIDDLE;
}
}
else if (myShapeList1 (aFaceID1).ShapeType() == TopAbs_FACE)
{
Standard_Integer aNodeIdx = mySet1->GetVtxIdxInShape (myProxVtxIdx1) + 1;
TopLoc_Location aLocation;
const TopoDS_Face& aF = TopoDS::Face (myShapeList1 (aFaceID1));
Handle (Poly_Triangulation) aTr = BRep_Tool::Triangulation (aF, aLocation);
if (isNodeOnBorder (aNodeIdx, aTr))
{
myPntStatus1 = ProxPnt_Status_BORDER;
}
else
{
myPntStatus1 = ProxPnt_Status_MIDDLE;
}
}
}
//=======================================================================
//function : defineStatusProxPnt2
//purpose : Defines the status of proximity point from 2nd BVH
//=======================================================================
void BRepExtrema_ProximityDistTool::defineStatusProxPnt2()
{
Standard_Integer aTrgIdx = myProxPrjState.GetTrgIdx();
Standard_Integer aFaceID2 = mySet2->GetFaceID (aTrgIdx);
if (myShapeList2 (aFaceID2).ShapeType() == TopAbs_EDGE)
{
if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_INNER)
{
return;
}
else
{
const BVH_Array3d& aVertices2 = mySet2->GetVertices();
Standard_Integer aVtxSize = (Standard_Integer)aVertices2.size();
Standard_Integer aLastIdx = aVtxSize - 1;
if ((aVertices2[0] - aVertices2[aLastIdx]).Modulus() < Precision::Confusion()) // if closed
{
myPntStatus2 = ProxPnt_Status_MIDDLE;
return;
}
NCollection_Array1<Standard_Integer> aVtxIndicesOfTrg;
mySet2->GetVtxIndices (aTrgIdx, aVtxIndicesOfTrg);
Standard_Integer aFirstNodeNum = myProxPrjState.GetNumberOfFirstNode();
Standard_Integer aFirstVtxIdx = aVtxIndicesOfTrg[aFirstNodeNum];
if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_VERTEX)
{
if (aFirstVtxIdx == 0 || aFirstVtxIdx == aLastIdx)
{
myPntStatus2 = ProxPnt_Status_BORDER;
}
else
{
myPntStatus2 = ProxPnt_Status_MIDDLE;
}
}
else if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_EDGE)
{
Standard_Integer aLastNodeNum = myProxPrjState.GetNumberOfLastNode();
Standard_Integer aLastVtxIdx = aVtxIndicesOfTrg[aLastNodeNum];
// it could be border only in case projection is on a degenerated edge
if (aFirstVtxIdx == aLastVtxIdx && (aFirstVtxIdx == 0 || aFirstVtxIdx == aLastIdx))
{
myPntStatus2 = ProxPnt_Status_BORDER;
}
else
{
myPntStatus2 = ProxPnt_Status_MIDDLE;
}
}
}
}
else if (myShapeList2 (aFaceID2).ShapeType() == TopAbs_FACE)
{
if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_INNER)
{
myPntStatus2 = ProxPnt_Status_MIDDLE;
}
else
{
TopLoc_Location aLocation;
const TopoDS_Face& aF = TopoDS::Face (myShapeList2 (aFaceID2));
Handle (Poly_Triangulation) aTr = BRep_Tool::Triangulation (aF, aLocation);
NCollection_Array1<Standard_Integer> aVtxIndicesOfTrg;
mySet2->GetVtxIndices (aTrgIdx, aVtxIndicesOfTrg);
if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_VERTEX)
{
Standard_Integer aNodeNum = myProxPrjState.GetNumberOfFirstNode();
Standard_Integer aNodeIdx = mySet2->GetVtxIdxInShape (aVtxIndicesOfTrg[aNodeNum]) + 1;
if (isNodeOnBorder (aNodeIdx, aTr))
{
myPntStatus2 = ProxPnt_Status_BORDER;
}
else
{
myPntStatus2 = ProxPnt_Status_MIDDLE;
}
}
else if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_EDGE)
{
myPntStatus2 = ProxPnt_Status_MIDDLE;
Poly_Connect aPolyConnect (aTr);
Standard_Integer aTrgIdxInShape = mySet2->GetTrgIdxInShape (aTrgIdx) + 1;
Standard_Integer aAdjTrg[3];
aPolyConnect.Triangles (aTrgIdxInShape, aAdjTrg[0], aAdjTrg[1], aAdjTrg[2]); //indices of adjacent triangles
for (Standard_Integer j = 0; j < 3; j++)
{
Standard_Integer k = (j + 1) % 3;
if (aAdjTrg[j] == 0) //free segment of triangle
{
//aVtxIndicesOfTrg[j] and aVtxIndicesOfTrg[k] are ends of free segment and it is a part of border
if (j == myProxPrjState.GetNumberOfFirstNode() &&
k == myProxPrjState.GetNumberOfLastNode())
{
myPntStatus2 = ProxPnt_Status_BORDER;
break;
}
}
}
} //else if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_EDGE)
}
} //else if (myShapeList1 (aFaceID1).ShapeType() == TopAbs_FACE)
}
//=======================================================================
//function : DefineStatusProxPnt
//purpose : Defines the status of proximity points
//=======================================================================
void BRepExtrema_ProximityDistTool::DefineStatusProxPnt()
{
// define the status of proximity point from 1st BVH
defineStatusProxPnt1();
// define the status of proximity point from 2nd BVH
defineStatusProxPnt2();
}

View File

@@ -1,200 +0,0 @@
// Created on: 2022-08-08
// Created by: Kseniya NOSULKO
// Copyright (c) 2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepExtrema_ProximityDistTool_HeaderFile
#define _BRepExtrema_ProximityDistTool_HeaderFile
#include <BRepExtrema_ElementFilter.hxx>
#include <BRepExtrema_MapOfIntegerPackedMapOfInteger.hxx>
#include <BRepExtrema_TriangleSet.hxx>
#include <BVH_Distance.hxx>
#include <BVH_Tools.hxx>
//! Tool class for computation the proximity distance from first
//! primitive set to second one that is the maximal from minimum
//! perpendicular distances. If no perpendicular distance is found, the
//! minimum distance will be returned.
//! This tool is not intended to be used independently, and is integrated
//! in other classes, implementing algorithms based on shape tessellation
//! (BRepExtrema_ProximityValueTool).
//!
//! Please note that algorithm results are approximate and depend greatly
//! on the quality of input tessellation(s).
class BRepExtrema_ProximityDistTool : public BVH_Distance <Standard_Real, 3, BVH_Vec3d,
BRepExtrema_TriangleSet>
{
public:
typedef typename BVH_Tools<Standard_Real, 3>::BVH_PrjStateInTriangle BVH_PrjState;
enum ProxPnt_Status
{
ProxPnt_Status_BORDER,
ProxPnt_Status_MIDDLE,
ProxPnt_Status_UNKNOWN
};
public:
//! Struct with information about projection point state from 2nd BVH,
//! providing proximity point of 2nd shape
struct PrjState
{
PrjState()
: myTrgIdx (0),
myPrjState (BVH_PrjState::BVH_PrjStateInTriangle_INNER),
myNumberOfFirstNode (0),
myNumberOfLastNode (0)
{}
PrjState (const Standard_Integer theTrgIdx,
const BVH_PrjState thePrjState,
const Standard_Integer theNumberOfFirstNode,
const Standard_Integer theNumberOfLastNode)
: myTrgIdx (theTrgIdx),
myPrjState (thePrjState),
myNumberOfFirstNode (theNumberOfFirstNode),
myNumberOfLastNode (theNumberOfLastNode)
{}
Standard_Integer GetTrgIdx() const { return myTrgIdx; }
BVH_PrjState GetPrjState() const { return myPrjState; }
Standard_Integer GetNumberOfFirstNode() const { return myNumberOfFirstNode; }
Standard_Integer GetNumberOfLastNode() const { return myNumberOfLastNode; }
private:
Standard_Integer myTrgIdx; //!< Index of triangle on which the projection is located
BVH_PrjState myPrjState; //!< Position of a projection on the triangle (vertex, edge, inner)
Standard_Integer myNumberOfFirstNode; //!< The 1st vtx of the triangle edge on which the projection is located
Standard_Integer myNumberOfLastNode; //!< The 2nd vtx of the triangle edge on which the projection is located
};
public:
//! Creates new unitialized tool.
Standard_EXPORT BRepExtrema_ProximityDistTool();
//! Creates new tool for the given element sets.
Standard_EXPORT BRepExtrema_ProximityDistTool (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Standard_Integer theNbSamples1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2);
public:
//! Loads the given element sets into the tool.
Standard_EXPORT void LoadTriangleSets (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2);
//! Loads the given list of subshapes into the tool.
Standard_EXPORT void LoadShapeLists (const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2);
//! Performs searching of the proximity distance.
Standard_EXPORT void Perform();
public: //! @name Reject/Accept implementations
//! Defines the rules for node rejection by bounding box.
Standard_EXPORT virtual Standard_Boolean RejectNode (const BVH_Vec3d& theCornerMin,
const BVH_Vec3d& theCornerMax,
Standard_Real& theMetric) const Standard_OVERRIDE;
//! Defines the rules for leaf acceptance.
Standard_EXPORT virtual Standard_Boolean Accept (const Standard_Integer theSgmIdx,
const Standard_Real&) Standard_OVERRIDE;
//! Returns points on triangles sets, which provide the proximity distance.
void ProximityPoints (BVH_Vec3d& thePoint1, BVH_Vec3d& thePoint2) const
{
thePoint1 = myPnt1;
thePoint2 = myPnt2;
}
//! Returns status of points on triangles sets, which provide the proximity distance.
void ProximityPointsStatus (ProxPnt_Status& thePointStatus1, ProxPnt_Status& thePointStatus2) const
{
thePointStatus1 = myPntStatus1;
thePointStatus2 = myPntStatus2;
}
//! Returns the computed distance
Standard_Real ProximityDistance() const { return myProxDist; }
protected:
//! Computes the distance between object and BVH tree.
Standard_EXPORT Standard_Real ComputeDistance();
//! Defines the status of proximity points.
Standard_EXPORT void DefineStatusProxPnt();
private:
//! Defines the status of proximity point from 1st BVH.
void defineStatusProxPnt1();
//! Defines the status of proximity point from 2nd BVH.
void defineStatusProxPnt2();
protected:
Standard_Real myMinDistance; //!< Minimal distance from point to BVH, could be not equal to myDistance
BVH_Vec3d myMinDistPoint; //!< Point on BVH providing the minimal distance
BVH_Vec3d myExtremaPoint; //!< Point on BVH providing the extrema
Standard_Real myProxDist; //!< Proximity distance
//! Proximity points
BVH_Vec3d myPnt1, myPnt2;
//! Proximity points' status
ProxPnt_Status myPntStatus1, myPntStatus2;
private:
//! Set of all mesh elements (triangles) of the 1st shape.
Handle(BRepExtrema_TriangleSet) mySet1;
//! Set of all mesh elements (triangles) of the 2nd shape.
Handle(BRepExtrema_TriangleSet) mySet2;
//! List of subshapes of the 1st shape.
BRepExtrema_ShapeList myShapeList1;
//! List of subshapes of the 2nd shape.
BRepExtrema_ShapeList myShapeList2;
Standard_Integer myNbSamples1; //!< Number of samples points on the first shape
//! Vertex index from 1st BVH corresponding to proximity point of 1st shape
Standard_Integer myProxVtxIdx1;
//! Information of projection point state from 2nd BVH providing proximity point of 2nd shape
PrjState myProxPrjState;
//! Information of projection point state from 2nd BVH providing the extrema
PrjState myExtPrjState;
//! Information of projection point state from 2nd BVH providing the minimal distance
PrjState myMinPrjState;
};
#endif // _BRepExtrema_ProximityDistTool_HeaderFile

View File

@@ -1,161 +0,0 @@
// Created on: 2022-08-08
// Created by: Kseniya NOSULKO
// Copyright (c) 2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepExtrema_ProximityValueTool.hxx>
//=======================================================================
//function : BRepExtrema_ProximityValueTool
//purpose : Creates new unitialized proximity tool
//=======================================================================
BRepExtrema_ProximityValueTool::BRepExtrema_ProximityValueTool()
: myDistance (std::numeric_limits<Standard_Real>::max()),
myIsDone (Standard_False),
myNbSamples1(0),
myNbSamples2(0)
{}
//=======================================================================
//function : BRepExtrema_ProximityValueTool
//purpose : Creates new proximity tool for the given element sets
//=======================================================================
BRepExtrema_ProximityValueTool::BRepExtrema_ProximityValueTool (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2)
: myDistance (std::numeric_limits<Standard_Real>::max()),
myIsDone (Standard_False),
myNbSamples1(0),
myNbSamples2(0)
{
LoadTriangleSets (theSet1, theSet2);
LoadShapeLists (theShapeList1, theShapeList2);
}
//=======================================================================
//function : LoadTriangleSets
//purpose : Loads the given element sets into the proximity tool
//=======================================================================
void BRepExtrema_ProximityValueTool::LoadTriangleSets (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2)
{
mySet1 = theSet1;
mySet2 = theSet2;
myIsDone = Standard_False;
}
//=======================================================================
//function : LoadTriangleSets
//purpose : Loads the given list of subshapes into the proximity tool
//=======================================================================
void BRepExtrema_ProximityValueTool::LoadShapeLists (const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2)
{
myShapeList1 = theShapeList1;
myShapeList2 = theShapeList2;
myIsDone = Standard_False;
}
//=======================================================================
//function : SetNbSamplePoints
//purpose : Sets number of sample points used for proximity calculation for each shape
//=======================================================================
void BRepExtrema_ProximityValueTool::SetNbSamplePoints(const Standard_Integer theSamples1,
const Standard_Integer theSamples2)
{
myNbSamples1 = theSamples1;
myNbSamples2 = theSamples2;
myIsDone = Standard_False;
}
//=======================================================================
//function : computeProximityValue
//purpose : Returns the computed proximity value from first BVH to another one
//=======================================================================
Standard_Real BRepExtrema_ProximityValueTool::computeProximityDist (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Standard_Integer theNbSamples1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2,
BVH_Vec3d& thePoint1,
BVH_Vec3d& thePoint2,
ProxPnt_Status& thePointStatus1,
ProxPnt_Status& thePointStatus2) const
{
BRepExtrema_ProximityDistTool aProxDistTool (theSet1, theNbSamples1, theSet2, theShapeList1, theShapeList2);
aProxDistTool.Perform();
if (!aProxDistTool.IsDone())
return -1.;
aProxDistTool.ProximityPoints (thePoint1, thePoint2);
aProxDistTool.ProximityPointsStatus (thePointStatus1, thePointStatus2);
return aProxDistTool.ProximityDistance();
}
//=======================================================================
//function : Perform
//purpose : Performs the computation of the proximity value
//=======================================================================
void BRepExtrema_ProximityValueTool::Perform (Standard_Real& theTolerance)
{
myIsDone = Standard_False;
// max(min) dist from the 1st shape to the 2nd one
BVH_Vec3d aP1_1, aP1_2;
ProxPnt_Status aPointStatus1_1 = ProxPnt_Status::ProxPnt_Status_UNKNOWN;
ProxPnt_Status aPointStatus1_2 = ProxPnt_Status::ProxPnt_Status_UNKNOWN;
Standard_Real aProximityDist1 = computeProximityDist (mySet1, myNbSamples1, mySet2, myShapeList1, myShapeList2,
aP1_1, aP1_2, aPointStatus1_1, aPointStatus1_2);
if (aProximityDist1 < 0.)
return;
// max(min) dist from the 2nd shape to t he 1st one
BVH_Vec3d aP2_1, aP2_2;
ProxPnt_Status aPointStatus2_1 = ProxPnt_Status::ProxPnt_Status_UNKNOWN;
ProxPnt_Status aPointStatus2_2 = ProxPnt_Status::ProxPnt_Status_UNKNOWN;
Standard_Real aProximityDist2 = computeProximityDist (mySet2, myNbSamples2, mySet1, myShapeList2, myShapeList1,
aP2_2, aP2_1, aPointStatus2_2, aPointStatus2_1);
if (aProximityDist2 < 0.)
return;
// min dist of the two max(min) dists
if (aProximityDist1 < aProximityDist2)
{
myDistance = aProximityDist1;
myPnt1.SetCoord(aP1_1.x(), aP1_1.y(), aP1_1.z());
myPnt2.SetCoord(aP1_2.x(), aP1_2.y(), aP1_2.z());
myPntStatus1 = aPointStatus1_1;
myPntStatus2 = aPointStatus1_2;
}
else
{
myDistance = aProximityDist2;
myPnt1.SetCoord(aP2_1.x(), aP2_1.y(), aP2_1.z());
myPnt2.SetCoord(aP2_2.x(), aP2_2.y(), aP2_2.z());
myPntStatus1 = aPointStatus2_1;
myPntStatus2 = aPointStatus2_2;
}
myIsDone = Standard_True;
theTolerance = myDistance;
}

View File

@@ -1,126 +0,0 @@
// Created on: 2022-08-08
// Created by: Kseniya NOSULKO
// Copyright (c) 2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepExtrema_ProximityValueTool_HeaderFile
#define _BRepExtrema_ProximityValueTool_HeaderFile
#include <BRepExtrema_ProximityDistTool.hxx>
#include <BRepExtrema_TriangleSet.hxx>
//! Tool class for computation of the proximity value from one BVH
//! primitive set to another, solving max(min) problem.
//! This tool is not intended to be used independently, and is integrated
//! in other classes, implementing algorithms based on shape tessellation
//! (BRepExtrema_ShapeProximity and BRepExtrema_SelfIntersection).
//!
//! Please note that algorithm results are approximate and depend greatly
//! on the quality of input tessellation(s).
class BRepExtrema_ProximityValueTool
{
public:
typedef typename BRepExtrema_ProximityDistTool::ProxPnt_Status ProxPnt_Status;
public:
//! Creates new unitialized proximity tool.
Standard_EXPORT BRepExtrema_ProximityValueTool();
//! Creates new proximity tool for the given element sets.
Standard_EXPORT BRepExtrema_ProximityValueTool (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2);
public:
//! Loads the given element sets into the proximity tool.
Standard_EXPORT void LoadTriangleSets (const Handle (BRepExtrema_TriangleSet)& theSet1,
const Handle (BRepExtrema_TriangleSet)& theSet2);
//! Loads the given list of subshapes into the proximity tool.
Standard_EXPORT void LoadShapeLists (const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2);
//! Sets number of sample points used for proximity calculation for each shape.
//! If number is less or equal zero, all triangulation nodes are used.
Standard_EXPORT void SetNbSamplePoints (const Standard_Integer theSamples1 = 0,
const Standard_Integer theSamples2 = 0);
//! Performs the computation of the proximity value.
Standard_EXPORT void Perform (Standard_Real& theTolerance);
//! Is proximity test completed?
Standard_Boolean IsDone() const { return myIsDone; }
//! Marks test results as outdated.
void MarkDirty() { myIsDone = Standard_False; }
//! Returns the computed distance.
Standard_Real Distance() const { return myDistance; }
//! Returns points on triangles sets, which provide the proximity distance.
void ProximityPoints(gp_Pnt& thePoint1, gp_Pnt& thePoint2) const
{
thePoint1 = myPnt1;
thePoint2 = myPnt2;
}
//! Returns status of points on triangles sets, which provide the proximity distance.
void ProximityPointsStatus (ProxPnt_Status& thePointStatus1, ProxPnt_Status& thePointStatus2) const
{
thePointStatus1 = myPntStatus1;
thePointStatus2 = myPntStatus2;
}
private:
//! Returns the computed proximity value from first BVH to another one.
Standard_Real computeProximityDist (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Standard_Integer theNbSamples1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2,
BVH_Vec3d& thePoint1,
BVH_Vec3d& thePoint2,
ProxPnt_Status& thePointStatus1,
ProxPnt_Status& thePointStatus2) const;
private:
//! Set of all mesh primitives of the 1st shape.
Handle(BRepExtrema_TriangleSet) mySet1;
//! Set of all mesh primitives of the 2nd shape.
Handle(BRepExtrema_TriangleSet) mySet2;
//! List of subshapes of the 1st shape.
BRepExtrema_ShapeList myShapeList1;
//! List of subshapes of the 2nd shape.
BRepExtrema_ShapeList myShapeList2;
Standard_Real myDistance; //!< Distance
Standard_Boolean myIsDone; //!< State of the algorithm
Standard_Integer myNbSamples1; //!< Number of samples points on the first shape
Standard_Integer myNbSamples2; //!< Number of samples points on the second shape
//! Proximity points
gp_Pnt myPnt1, myPnt2;
//! Proximity points' status
ProxPnt_Status myPntStatus1, myPntStatus2;
};
#endif // _BRepExtrema_ProximityValueTool_HeaderFile

View File

@@ -18,8 +18,6 @@
#include <BRepExtrema_OverlapTool.hxx>
#include <TopoDS.hxx>
//! Tool class for detection of self-sections in the given shape.
//! This class is based on BRepExtrema_OverlapTool and thus uses
//! shape tessellation to detect incorrect mesh fragments (pairs
@@ -78,7 +76,7 @@ public:
//! Returns sub-shape from the shape for the given index (started from 0).
const TopoDS_Face& GetSubShape (const Standard_Integer theID) const
{
return TopoDS::Face(myFaceList.Value(theID));
return myFaceList.Value (theID);
}
//! Returns set of all the face triangles of the shape.

View File

@@ -18,28 +18,6 @@
#include <Precision.hxx>
#include <TopExp_Explorer.hxx>
// Assign a map of sub-shapes (edges/faces) of a given shape
static Standard_Boolean initSubShapes(const TopoDS_Shape& theShape,
BRepExtrema_ShapeList& theSubshapesList,
Handle(BRepExtrema_TriangleSet)& theTriangleSet)
{
theSubshapesList.Clear();
for (TopExp_Explorer anIter(theShape, TopAbs_FACE); anIter.More(); anIter.Next())
{
theSubshapesList.Append(anIter.Current());
}
for (TopExp_Explorer anIter(theShape, TopAbs_EDGE); anIter.More(); anIter.Next())
{
theSubshapesList.Append(anIter.Current());
}
if (theTriangleSet.IsNull())
theTriangleSet = new BRepExtrema_TriangleSet;
return theTriangleSet->Init(theSubshapesList);
}
//=======================================================================
//function : BRepExtrema_ShapeProximity
//purpose : Creates uninitialized proximity tool
@@ -47,9 +25,7 @@ static Standard_Boolean initSubShapes(const TopoDS_Shape& theShape,
BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity (const Standard_Real theTolerance)
: myTolerance (theTolerance),
myElementSet1 (new BRepExtrema_TriangleSet),
myElementSet2 (new BRepExtrema_TriangleSet),
myNbSamples1 (0),
myNbSamples2 (0)
myElementSet2 (new BRepExtrema_TriangleSet)
{
// Should be initialized later
myIsInitS1 = myIsInitS2 = Standard_False;
@@ -64,9 +40,7 @@ BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity (const TopoDS_Shape& theS
const Standard_Real theTolerance)
: myTolerance (theTolerance),
myElementSet1 (new BRepExtrema_TriangleSet),
myElementSet2 (new BRepExtrema_TriangleSet),
myNbSamples1 (0),
myNbSamples2 (0)
myElementSet2 (new BRepExtrema_TriangleSet)
{
LoadShape1 (theShape1);
LoadShape2 (theShape2);
@@ -78,18 +52,16 @@ BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity (const TopoDS_Shape& theS
//=======================================================================
Standard_Boolean BRepExtrema_ShapeProximity::LoadShape1 (const TopoDS_Shape& theShape1)
{
myIsInitS1 = initSubShapes(theShape1, myShapeList1, myElementSet1);
myFaceList1.Clear();
if (myTolerance == Precision::Infinite())
for (TopExp_Explorer anIter (theShape1, TopAbs_FACE); anIter.More(); anIter.Next())
{
myProxValTool.MarkDirty();
}
else
{
myOverlapTool.MarkDirty();
myFaceList1.Append (static_cast<const TopoDS_Face&> (anIter.Current()));
}
return myIsInitS1;
myOverlapTool.MarkDirty();
return myIsInitS1 = myElementSet1->Init (myFaceList1);
}
//=======================================================================
@@ -98,18 +70,16 @@ Standard_Boolean BRepExtrema_ShapeProximity::LoadShape1 (const TopoDS_Shape& the
//=======================================================================
Standard_Boolean BRepExtrema_ShapeProximity::LoadShape2 (const TopoDS_Shape& theShape2)
{
myIsInitS2 = initSubShapes(theShape2, myShapeList2, myElementSet2);
myFaceList2.Clear();
if (myTolerance == Precision::Infinite())
for (TopExp_Explorer anIter (theShape2, TopAbs_FACE); anIter.More(); anIter.Next())
{
myProxValTool.MarkDirty();
}
else
{
myOverlapTool.MarkDirty();
myFaceList2.Append (static_cast<const TopoDS_Face&> (anIter.Current()));
}
return myIsInitS2;
myOverlapTool.MarkDirty();
return myIsInitS2 = myElementSet2->Init (myFaceList2);
}
//=======================================================================
@@ -118,32 +88,13 @@ Standard_Boolean BRepExtrema_ShapeProximity::LoadShape2 (const TopoDS_Shape& the
//=======================================================================
void BRepExtrema_ShapeProximity::Perform()
{
if (myTolerance == Precision::Infinite())
if (!myIsInitS1 || !myIsInitS2 || myOverlapTool.IsDone())
{
if (!myIsInitS1 || !myIsInitS2 || myProxValTool.IsDone())
{
return;
}
myProxValTool.LoadTriangleSets (myElementSet1,
myElementSet2);
myProxValTool.LoadShapeLists (myShapeList1,
myShapeList2);
myProxValTool.Perform (myTolerance);
myProxValTool.ProximityPoints(myProxPoint1, myProxPoint2);
myProxValTool.ProximityPointsStatus (myProxPntStatus1, myProxPntStatus2);
return;
}
else
{
if (!myIsInitS1 || !myIsInitS2 || myOverlapTool.IsDone())
{
return;
}
myOverlapTool.LoadTriangleSets (myElementSet1,
myElementSet2);
myOverlapTool.LoadTriangleSets (myElementSet1,
myElementSet2);
myOverlapTool.Perform (myTolerance);
}
myOverlapTool.Perform (myTolerance);
}

View File

@@ -16,48 +16,31 @@
#ifndef _BRepExtrema_ShapeProximity_HeaderFile
#define _BRepExtrema_ShapeProximity_HeaderFile
#include <NCollection_DataMap.hxx>
#include <Precision.hxx>
#include <TColStd_PackedMapOfInteger.hxx>
#include <BRepExtrema_ProximityValueTool.hxx>
#include <BRepExtrema_TriangleSet.hxx>
#include <BRepExtrema_OverlapTool.hxx>
//! @brief Tool class for shape proximity detection.
//!
//! First approach:
//! Tool class for shape proximity detection.
//! For two given shapes and given tolerance (offset from the mesh) the algorithm allows
//! to determine whether or not they are overlapped. The algorithm input consists of any
//! shapes which can be decomposed into individual faces (used as basic shape elements).
//! High performance is achieved through the use of existing triangulation of faces. So
//! poly triangulation (with the desired deflection) should already be built. Note that
//! solution is approximate (and corresponds to the deflection used for triangulation).
//!
//! The algorithm can be run in two modes. If tolerance is set to zero, the algorithm
//! will detect only intersecting faces (containing triangles with common points). If
//! tolerance is set to positive value, the algorithm will also detect faces located
//! on distance less than the given tolerance from each other.
//!
//! Second approach:
//! Compute the proximity value between two shapes if the tolerance is not defined (Precision::Infinite()).
//! In this case the proximity value is a minimal thickness of a layer containing both shapes.
//!
//! For the both approaches the high performance is achieved through the use of existing
//! triangulation of faces. So, poly triangulation (with the desired deflection) should already
//! be built. Note that solution is approximate (and corresponds to the deflection used for
//! triangulation).
class BRepExtrema_ShapeProximity
{
public:
typedef typename BRepExtrema_ProximityValueTool::ProxPnt_Status ProxPnt_Status;
public:
//! Creates empty proximity tool.
Standard_EXPORT BRepExtrema_ShapeProximity (const Standard_Real theTolerance = Precision::Infinite());
Standard_EXPORT BRepExtrema_ShapeProximity (const Standard_Real theTolerance = 0.0);
//! Creates proximity tool for the given two shapes.
Standard_EXPORT BRepExtrema_ShapeProximity (const TopoDS_Shape& theShape1,
const TopoDS_Shape& theShape2,
const Standard_Real theTolerance = Precision::Infinite());
const Standard_Real theTolerance = 0.0);
public:
@@ -73,33 +56,19 @@ public:
myTolerance = theTolerance;
}
//! Returns proximity value calculated for the whole input shapes.
Standard_Real Proximity() const
{
return Tolerance();
}
//! Loads 1st shape into proximity tool.
Standard_EXPORT Standard_Boolean LoadShape1 (const TopoDS_Shape& theShape1);
//! Loads 2nd shape into proximity tool.
Standard_EXPORT Standard_Boolean LoadShape2 (const TopoDS_Shape& theShape2);
//! Set number of sample points on the 1st shape used to compute the proximity value.
//! In case of 0, all triangulation nodes will be used.
void SetNbSamples1(const Standard_Integer theNbSamples) { myNbSamples1 = theNbSamples; }
//! Set number of sample points on the 2nd shape used to compute the proximity value.
//! In case of 0, all triangulation nodes will be used.
void SetNbSamples2(const Standard_Integer theNbSamples) { myNbSamples2 = theNbSamples; }
//! Performs search of overlapped faces.
Standard_EXPORT void Perform();
//! True if the search is completed.
Standard_Boolean IsDone() const
{
return myOverlapTool.IsDone() || myProxValTool.IsDone();
return myOverlapTool.IsDone();
}
//! Returns set of IDs of overlapped faces of 1st shape (started from 0).
@@ -115,15 +84,15 @@ public:
}
//! Returns sub-shape from 1st shape with the given index (started from 0).
const TopoDS_Shape& GetSubShape1 (const Standard_Integer theID) const
const TopoDS_Face& GetSubShape1 (const Standard_Integer theID) const
{
return myShapeList1.Value (theID);
return myFaceList1.Value (theID);
}
//! Returns sub-shape from 1st shape with the given index (started from 0).
const TopoDS_Shape& GetSubShape2 (const Standard_Integer theID) const
const TopoDS_Face& GetSubShape2 (const Standard_Integer theID) const
{
return myShapeList2.Value (theID);
return myFaceList2.Value (theID);
}
//! Returns set of all the face triangles of the 1st shape.
@@ -138,34 +107,6 @@ public:
return myElementSet2;
}
//! Returns the point on the 1st shape, which could be used as a reference point
//! for the value of the proximity.
const gp_Pnt& ProximityPoint1() const
{
return myProxPoint1;
}
//! Returns the point on the 2nd shape, which could be used as a reference point
//! for the value of the proximity.
const gp_Pnt& ProximityPoint2() const
{
return myProxPoint2;
}
//! Returns the status of point on the 1st shape, which could be used as a reference point
//! for the value of the proximity.
const ProxPnt_Status& ProxPntStatus1() const
{
return myProxPntStatus1;
}
//! Returns the status of point on the 2nd shape, which could be used as a reference point
//! for the value of the proximity.
const ProxPnt_Status& ProxPntStatus2() const
{
return myProxPntStatus2;
}
private:
//! Maximum overlapping distance.
@@ -176,39 +117,19 @@ private:
//! Is the 2nd shape initialized?
Standard_Boolean myIsInitS2;
//! List of subshapes of the 1st shape.
BRepExtrema_ShapeList myShapeList1;
//! List of subshapes of the 2nd shape.
BRepExtrema_ShapeList myShapeList2;
//! List of faces of the 1st shape.
BRepExtrema_ShapeList myFaceList1;
//! List of faces of the 2nd shape.
BRepExtrema_ShapeList myFaceList2;
//! Set of all the face triangles of the 1st shape.
Handle(BRepExtrema_TriangleSet) myElementSet1;
//! Set of all the face triangles of the 2nd shape.
Handle(BRepExtrema_TriangleSet) myElementSet2;
//! Number of sample points on the 1st shape used to compute the proximity value
//! (if zero (default), all triangulation nodes will be used).
Standard_Integer myNbSamples1;
//! Number of sample points on the 2nd shape used to compute the proximity value
//! (if zero (default), all triangulation nodes will be used).
Standard_Integer myNbSamples2;
//! Reference point of the proximity value on the 1st shape.
gp_Pnt myProxPoint1;
//! Reference point of the proximity value on the 2st shape.
gp_Pnt myProxPoint2;
//! Status of reference points of the proximity value.
ProxPnt_Status myProxPntStatus1, myProxPntStatus2;
//! Overlap tool used for intersection/overlap test.
BRepExtrema_OverlapTool myOverlapTool;
//! Shape-shape proximity tool used for computation of
//! the minimal diameter of a tube containing both edges or
//! the minimal thickness of a shell containing both faces.
BRepExtrema_ProximityValueTool myProxValTool;
};
#endif // _BRepExtrema_ShapeProximity_HeaderFile

View File

@@ -18,7 +18,6 @@
#include <BRep_Tool.hxx>
#include <BVH_LinearBuilder.hxx>
#include <Poly_Triangulation.hxx>
#include <TopoDS.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BRepExtrema_TriangleSet, BVH_PrimitiveSet3d)
@@ -115,65 +114,17 @@ void BRepExtrema_TriangleSet::Swap (const Standard_Integer theIndex1, const Stan
{
std::swap (myTriangles[theIndex1],
myTriangles[theIndex2]);
std::swap (myTrgIdxMap (theIndex1),
myTrgIdxMap (theIndex2));
}
//=======================================================================
//function : GetFaceID
//purpose : Returns face ID of the given vertex
//purpose : Returns face ID of the given triangle
//=======================================================================
Standard_Integer BRepExtrema_TriangleSet::GetFaceID (const Standard_Integer theIndex) const
{
return myTriangles[theIndex].w();
}
//=======================================================================
//function : GetShapeIDOfVtx
//purpose : Returns shape ID of the given vertex index
//=======================================================================
Standard_Integer BRepExtrema_TriangleSet::GetShapeIDOfVtx (const Standard_Integer theIndex) const
{
return myShapeIdxOfVtxVec.Value (theIndex);
}
//=======================================================================
//function : GetVtxIdxInShape
//purpose : Returns vertex index in tringulation of the shape, which vertex belongs,
// with the given vtx ID in whole set
//=======================================================================
Standard_Integer BRepExtrema_TriangleSet::GetVtxIdxInShape (const Standard_Integer theIndex) const
{
Standard_Integer aShID = myShapeIdxOfVtxVec.Value (theIndex);
Standard_Integer aNumVertices = 0;
for (Standard_Integer aSIdx = 0; aSIdx < aShID; aSIdx++)
{
aNumVertices += myNumVtxInShapeVec.Value (aSIdx);
}
return theIndex - aNumVertices;
}
//=======================================================================
//function : GetTrgIdxInShape
//purpose : Returns triangle index (before swapping) in tringulation of the shape, which triangle belongs,
// with the given trg ID in whole set (after swapping)
//=======================================================================
Standard_Integer BRepExtrema_TriangleSet::GetTrgIdxInShape (const Standard_Integer theIndex) const
{
Standard_Integer aShID = GetFaceID (theIndex);
Standard_Integer aNumTriangles = 0;
for (Standard_Integer aSIdx = 0; aSIdx < aShID; aSIdx++)
{
aNumTriangles += myNumTrgInShapeVec.Value (aSIdx);
}
return myTrgIdxMap (theIndex) - aNumTriangles;
}
//=======================================================================
//function : GetVertices
//purpose : Returns vertices of the given triangle
@@ -190,21 +141,6 @@ void BRepExtrema_TriangleSet::GetVertices (const Standard_Integer theIndex,
theVertex3 = myVertexArray[aTriangle.z()];
}
//=======================================================================
//function : GetVertices
//purpose : Returns vertices of the given triangle
//=======================================================================
void BRepExtrema_TriangleSet::GetVtxIndices (const Standard_Integer theIndex,
NCollection_Array1<Standard_Integer>& theVtxIndices) const
{
BVH_Vec4i aTriangle = myTriangles[theIndex];
theVtxIndices = NCollection_Array1<Standard_Integer> (0, 2);
theVtxIndices.SetValue (0, aTriangle.x());
theVtxIndices.SetValue (1, aTriangle.y());
theVtxIndices.SetValue (2, aTriangle.z());
}
//=======================================================================
//function : Clear
//purpose : Clears triangle set data
@@ -222,26 +158,41 @@ void BRepExtrema_TriangleSet::Clear()
//function : Init
//purpose : Initializes triangle set
//=======================================================================
Standard_Boolean BRepExtrema_TriangleSet::Init (const BRepExtrema_ShapeList& theShapes)
Standard_Boolean BRepExtrema_TriangleSet::Init (const BRepExtrema_ShapeList& theFaces)
{
Clear();
Standard_Boolean isOK = Standard_True;
for (Standard_Integer aShapeIdx = 0; aShapeIdx < theShapes.Size() && isOK; ++aShapeIdx)
for (Standard_Integer aFaceIdx = 0; aFaceIdx < theFaces.Size(); ++aFaceIdx)
{
if (theShapes (aShapeIdx).ShapeType() == TopAbs_FACE)
isOK = initFace (TopoDS::Face (theShapes(aShapeIdx)), aShapeIdx);
else if (theShapes (aShapeIdx).ShapeType() == TopAbs_EDGE)
isOK = initEdge (TopoDS::Edge (theShapes(aShapeIdx)), aShapeIdx);
}
TopLoc_Location aLocation;
Standard_Integer aNumTrg = static_cast<Standard_Integer> (myTriangles.size());
myTrgIdxMap.Clear();
myTrgIdxMap.ReSize (aNumTrg);
Handle(Poly_Triangulation) aTriangulation =
BRep_Tool::Triangulation (theFaces (aFaceIdx), aLocation);
for (Standard_Integer aTrgIdx = 0; aTrgIdx < aNumTrg; ++aTrgIdx)
{
myTrgIdxMap.Bind (aTrgIdx, aTrgIdx);
if (aTriangulation.IsNull())
{
return Standard_False;
}
const Standard_Integer aVertOffset =
static_cast<Standard_Integer> (myVertexArray.size()) - 1;
for (Standard_Integer aVertIdx = 1; aVertIdx <= aTriangulation->NbNodes(); ++aVertIdx)
{
gp_Pnt aVertex = aTriangulation->Node (aVertIdx);
aVertex.Transform (aLocation.Transformation());
myVertexArray.push_back (BVH_Vec3d (aVertex.X(), aVertex.Y(), aVertex.Z()));
}
for (Standard_Integer aTriIdx = 1; aTriIdx <= aTriangulation->NbTriangles(); ++aTriIdx)
{
Standard_Integer aVertex1, aVertex2, aVertex3;
aTriangulation->Triangle (aTriIdx).Get (aVertex1, aVertex2, aVertex3);
myTriangles.push_back (BVH_Vec4i (aVertex1 + aVertOffset,
aVertex2 + aVertOffset,
aVertex3 + aVertOffset,
aFaceIdx));
}
}
MarkDirty(); // needs BVH rebuilding
@@ -252,95 +203,3 @@ Standard_Boolean BRepExtrema_TriangleSet::Init (const BRepExtrema_ShapeList& the
return Standard_True;
}
//=======================================================================
//function : initFace
//purpose : Initializes triangle set
//=======================================================================
Standard_Boolean BRepExtrema_TriangleSet::initFace (const TopoDS_Face& theFace, const Standard_Integer theIndex)
{
TopLoc_Location aLocation;
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation (theFace, aLocation);
if (aTriangulation.IsNull())
{
return Standard_False;
}
const Standard_Integer aVertOffset =
static_cast<Standard_Integer> (myVertexArray.size()) - 1;
initNodes (aTriangulation->MapNodeArray()->ChangeArray1(), aLocation.Transformation(), theIndex);
for (Standard_Integer aTriIdx = 1; aTriIdx <= aTriangulation->NbTriangles(); ++aTriIdx)
{
Standard_Integer aVertex1;
Standard_Integer aVertex2;
Standard_Integer aVertex3;
aTriangulation->Triangle (aTriIdx).Get (aVertex1,
aVertex2,
aVertex3);
myTriangles.push_back (BVH_Vec4i (aVertex1 + aVertOffset,
aVertex2 + aVertOffset,
aVertex3 + aVertOffset,
theIndex));
}
myNumTrgInShapeVec.SetValue (theIndex, aTriangulation->NbTriangles());
return Standard_True;
}
//=======================================================================
//function : initEdge
//purpose : Initializes triangle set
//=======================================================================
Standard_Boolean BRepExtrema_TriangleSet::initEdge (const TopoDS_Edge& theEdge, const Standard_Integer theIndex)
{
TopLoc_Location aLocation;
Handle(Poly_Polygon3D) aPolygon = BRep_Tool::Polygon3D (theEdge, aLocation);
if (aPolygon.IsNull())
{
return Standard_False;
}
const Standard_Integer aVertOffset =
static_cast<Standard_Integer> (myVertexArray.size()) - 1;
initNodes (aPolygon->Nodes(), aLocation.Transformation(), theIndex);
for (Standard_Integer aVertIdx = 1; aVertIdx < aPolygon->NbNodes(); ++aVertIdx)
{
// segment as degenerate triangle
myTriangles.push_back (BVH_Vec4i (aVertIdx + aVertOffset,
aVertIdx + aVertOffset + 1,
aVertIdx + aVertOffset + 1,
theIndex));
}
return Standard_True;
}
//=======================================================================
//function : initNodes
//purpose : Initializes nodes
//=======================================================================
void BRepExtrema_TriangleSet::initNodes (const TColgp_Array1OfPnt& theNodes,
const gp_Trsf& theTrsf,
const Standard_Integer theIndex)
{
for (Standard_Integer aVertIdx = 1; aVertIdx <= theNodes.Size(); ++aVertIdx)
{
gp_Pnt aVertex = theNodes.Value (aVertIdx);
aVertex.Transform (theTrsf);
myVertexArray.push_back (BVH_Vec3d (aVertex.X(),
aVertex.Y(),
aVertex.Z()));
myShapeIdxOfVtxVec.Append (theIndex);
}
myNumVtxInShapeVec.SetValue (theIndex, theNodes.Size());
}

View File

@@ -16,14 +16,11 @@
#ifndef _BRepExtrema_TriangleSet_HeaderFile
#define _BRepExtrema_TriangleSet_HeaderFile
#include <BVH_PrimitiveSet3d.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <BVH_PrimitiveSet3d.hxx>
//! List of shapes and their IDs for collision detection.
typedef NCollection_Vector<TopoDS_Shape> BRepExtrema_ShapeList;
typedef NCollection_Vector<TopoDS_Face> BRepExtrema_ShapeList;
//! Triangle set corresponding to specific face.
class BRepExtrema_TriangleSet : public BVH_PrimitiveSet3d
@@ -62,10 +59,7 @@ public:
Standard_EXPORT void Clear();
//! Initializes triangle set.
Standard_EXPORT Standard_Boolean Init (const BRepExtrema_ShapeList& theShapes);
//! Returns all vertices.
Standard_EXPORT const BVH_Array3d& GetVertices() const { return myVertexArray; }
Standard_EXPORT Standard_Boolean Init (const BRepExtrema_ShapeList& theFaces);
//! Returns vertices of the given triangle.
Standard_EXPORT void GetVertices (const Standard_Integer theIndex,
@@ -73,37 +67,9 @@ public:
BVH_Vec3d& theVertex2,
BVH_Vec3d& theVertex3) const;
//! Returns vertex indices of the given triangle.
Standard_EXPORT void GetVtxIndices (const Standard_Integer theIndex,
NCollection_Array1<Standard_Integer>& theVtxIndices) const;
//! Returns face ID of the given triangle.
Standard_EXPORT Standard_Integer GetFaceID (const Standard_Integer theIndex) const;
//! Returns shape ID of the given vertex index.
Standard_EXPORT Standard_Integer GetShapeIDOfVtx (const Standard_Integer theIndex) const;
//! Returns vertex index in tringulation of the shape, which vertex belongs,
//! with the given vtx ID in whole set.
Standard_EXPORT Standard_Integer GetVtxIdxInShape (const Standard_Integer theIndex) const;
//! Returns triangle index (before swapping) in tringulation of the shape, which triangle belongs,
//! with the given trg ID in whole set (after swapping).
Standard_EXPORT Standard_Integer GetTrgIdxInShape (const Standard_Integer theIndex) const;
private:
//! Initializes triangle set from the face
Standard_Boolean initFace (const TopoDS_Face& theFace, const Standard_Integer theIndex);
//! Initializes polygon from the edge
Standard_Boolean initEdge (const TopoDS_Edge& theEdge, const Standard_Integer theIndex);
//! Initializes nodes
void initNodes (const TColgp_Array1OfPnt& theNodes,
const gp_Trsf& theTrsf,
const Standard_Integer theIndex);
protected:
//! Array of vertex indices.
@@ -112,19 +78,6 @@ protected:
//! Array of vertex coordinates.
BVH_Array3d myVertexArray;
//! Vector of shapes' indices where index of item corresponds to index of vertex,
//! belonging to this shape.
NCollection_Vector<Standard_Integer> myShapeIdxOfVtxVec;
//! Vector of vertexes' number belonging to shape which index corresponds item's index.
NCollection_Vector<Standard_Integer> myNumVtxInShapeVec;
//! Vector of triangles' number belonging to shape which index corresponds item's index.
NCollection_Vector<Standard_Integer> myNumTrgInShapeVec;
//! Map of triangles' indices after (key) and before (value) swapping.
TColStd_DataMapOfIntegerInteger myTrgIdxMap;
public:
DEFINE_STANDARD_RTTIEXT(BRepExtrema_TriangleSet, BVH_PrimitiveSet3d)

View File

@@ -18,10 +18,6 @@ BRepExtrema_OverlapTool.cxx
BRepExtrema_OverlapTool.hxx
BRepExtrema_Poly.cxx
BRepExtrema_Poly.hxx
BRepExtrema_ProximityValueTool.cxx
BRepExtrema_ProximityValueTool.hxx
BRepExtrema_ProximityDistTool.cxx
BRepExtrema_ProximityDistTool.hxx
BRepExtrema_SelfIntersection.cxx
BRepExtrema_SelfIntersection.hxx
BRepExtrema_SeqOfSolution.hxx

View File

@@ -987,8 +987,8 @@ Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
ASI1.Perform(scur);
Standard_Integer sens = 1;
if(ASI1.IsDone() && ASI1.NbPoints(1) >= 1) {
if(ASI1.Point(1, 1).Parameter() + Precision::Confusion() < 0. &&
ASI1.Point(1, ASI1.NbPoints(1)).Parameter() + Precision::Confusion() < 0.) {
if(ASI1.Point(1, 1).Parameter() < 0. &&
ASI1.Point(1, ASI1.NbPoints(1)).Parameter() < 0.) {
sens = -1;
}
}

View File

@@ -1585,7 +1585,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
NbSamples = 4;
gp_Pln FirstPlane;
PlaneOfWire(TopoDS::Wire(myWork(ideb)), FirstPlane);
gp_Pnt PrevBary = FirstPlane.Location();
gp_Pnt FirstBary = FirstPlane.Location();
gp_Vec NormalOfFirstPlane = FirstPlane.Axis().Direction();
for (i = ideb+1; i <= ifin; i++)
{
@@ -1596,10 +1596,10 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
gp_Pln CurPlane;
PlaneOfWire(aWire, CurPlane);
gp_Pnt CurBary = CurPlane.Location();
gp_Vec aVec(PrevBary, CurBary);
gp_Vec aVec(FirstBary, CurBary);
gp_Vec anOffsetProj = (aVec * NormalOfFirstPlane) * NormalOfFirstPlane;
CurBary.Translate(-anOffsetProj); //projected current bary center
gp_Vec Offset(CurBary, PrevBary);
gp_Vec Offset(CurBary, FirstBary);
TopoDS_Wire newwire;
BRep_Builder BB;
@@ -1804,8 +1804,6 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
newwire.Closed( Standard_True );
newwire.Orientation( TopAbs_FORWARD );
myWork(i) = newwire;
PrevBary = CurBary;
}
#ifdef OCCT_DEBUG_EFV

View File

@@ -85,7 +85,6 @@
#include <TopTools_HArray2OfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <GeomLib_CheckCurveOnSurface.hxx>
#include <stdio.h>
//#include <BRepFill_TrimCorner.hxx>
@@ -290,34 +289,6 @@ static Standard_Boolean CheckSameParameter
return Standard_True;
}
//=======================================================================
//function : CheckSameParameterExact
//purpose : Check a posteriori that sameparameter has worked correctly
// with exact calculation method of edge tolerance
//=======================================================================
static Standard_Boolean CheckSameParameterExact
(const Handle(Adaptor3d_Curve)& C3d,
const Handle(Adaptor3d_CurveOnSurface)& curveOnSurface,
const Standard_Real tol3d,
Standard_Real& tolreached)
{
GeomLib_CheckCurveOnSurface aCheckCurveOnSurface(C3d);
aCheckCurveOnSurface.SetParallel(Standard_False);
aCheckCurveOnSurface.Perform(curveOnSurface);
tolreached = aCheckCurveOnSurface.MaxDistance();
if (tolreached > tol3d) {
return Standard_False;
}
else
{
tolreached = Max(tolreached, Precision::Confusion());
tolreached *= 1.05;
}
return Standard_True;
}
//=======================================================================
//function : SameParameter
//purpose : Encapsulation of Sameparameter
@@ -369,10 +340,8 @@ static Standard_Boolean SameParameter(TopoDS_Edge& E,
return Standard_False;
}
Handle(Adaptor3d_Curve) curve3d = sp.Curve3d();
Handle(Adaptor3d_CurveOnSurface) curveOnSurface = sp.CurveOnSurface();
if (!CheckSameParameterExact(curve3d, curveOnSurface, tol3d, ResTol) && ResTol > tolreached) {
ResTol = sp.TolReached();
if(ResTol > tolreached ){
#ifdef OCCT_DEBUG
std::cout<<"SameParameter : Tolerance not reached!"<<std::endl;
std::cout<<"tol visee : "<<tol3d<<" tol obtained : "<<ResTol<<std::endl;
@@ -892,8 +861,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
Prof2 = BRep_Tool::Curve(E2, f2, l2);
// Indeed, both Prof1 and Prof2 are the same curves but in different positions
// Prof1's param domain may equals to Prof2's param domain *(-1), which means EF.Orientation() == EL.Orientation()
Standard_Boolean bSameCurveDomain = EF.Orientation() != EL.Orientation();
gp_Pnt P1, P2, P;
// Choose the angle of opening
@@ -919,8 +887,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
}
}
const Standard_Real aPrm2[] = { f2, 0.5*(f2 + l2), l2 };
const gp_Pnt aP2 = Prof2->Value(aPrm2[bSameCurveDomain ? aMaxIdx : 2 - aMaxIdx]).Transformed(aTf);
const gp_Pnt aP2 = Prof2->Value(aPrm[aMaxIdx]).Transformed(aTf);
const gp_Vec2d aV1(aP1[aMaxIdx].Z(), aP1[aMaxIdx].X());
const gp_Vec2d aV2(aP2.Z(), aP2.X());
if (aV1.SquareMagnitude() <= gp::Resolution() ||
@@ -3284,7 +3251,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
Tang = T1 + T2; //Average direction
gp_Dir NormalOfBisPlane = Tang;
gp_Vec anIntersectPointCrossDirection = T1.Crossed(T2);
if (isTangent) {
Sortant -= Tang.Dot(Tang)*Tang;
}
@@ -3331,7 +3298,7 @@ TopoDS_Shape BRepFill_Sweep::Tape(const Standard_Integer Index) const
}
}
BRepFill_TrimShellCorner aTrim(aFaces, Transition, AxeOfBisPlane, anIntersectPointCrossDirection);
BRepFill_TrimShellCorner aTrim(aFaces, Transition, AxeOfBisPlane);
aTrim.AddBounds(Bounds);
aTrim.AddUEdges(aUEdges);
aTrim.AddVEdges(myVEdges, Index);

View File

@@ -76,14 +76,12 @@ static Standard_Boolean FindCommonVertex(const TopoDS_Edge& theFirstEdge,
static Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
const Standard_Integer theEIndex1,
const Standard_Integer theEIndex2,
const gp_Vec& theCrossDirection,
TopoDS_Vertex& theCommonVertex,
Standard_Real& theParamOnE1,
Standard_Real& theParamOnE2);
static Standard_Boolean SplitUEdges(const Handle(TopTools_HArray2OfShape)& theUEdges,
const BOPDS_PDS& theDS,
const gp_Vec& theCrossDirection,
TopTools_DataMapOfShapeListOfShape& theHistMap);
static void StoreVedgeInHistMap(const Handle(TopTools_HArray1OfShape)& theVEdges,
@@ -196,11 +194,9 @@ static void UpdateSectionEdge(TopoDS_Edge& theEdge,
// ===========================================================================================
BRepFill_TrimShellCorner::BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces,
const BRepFill_TransitionStyle theTransition,
const gp_Ax2& theAxeOfBisPlane,
const gp_Vec& theIntPointCrossDir) :
const gp_Ax2& theAxeOfBisPlane) :
myTransition(theTransition),
myAxeOfBisPlane(theAxeOfBisPlane),
myIntPointCrossDir(theIntPointCrossDir),
myDone(Standard_False),
myHasSection(Standard_False)
{
@@ -313,7 +309,7 @@ void BRepFill_TrimShellCorner::Perform()
BOPDS_VectorOfInterfFF& aFFs = theDS->InterfFF();
Standard_Integer aNbFFs = aFFs.Length();
if(!SplitUEdges(myUEdges, theDS, myIntPointCrossDir, myHistMap)) {
if(!SplitUEdges(myUEdges, theDS, myHistMap)) {
return;
}
@@ -429,7 +425,7 @@ BRepFill_TrimShellCorner::MakeFacesNonSec(const Standard_Integer
Standard_Real apar1 = 0., apar2 = 0.;
Standard_Boolean bvertexfound =
FindCommonVertex(theDS, anIndex1, anIndex2, myIntPointCrossDir, aCommonVertex, apar1, apar2);
FindCommonVertex(theDS, anIndex1, anIndex2, aCommonVertex, apar1, apar2);
// search common vertex between bounds. end
Handle(BRepTools_ReShape) aSubstitutor = new BRepTools_ReShape();
@@ -701,9 +697,9 @@ BRepFill_TrimShellCorner::MakeFacesSec(const Standard_Integer
TopoDS_Vertex FirstVertex, LastVertex;
Standard_Real ParamOnLeftE1, ParamOnLeftE2, ParamOnRightE1, ParamOnRightE2;
FindCommonVertex(theDS, IndexOfLeftE1, IndexOfLeftE2, myIntPointCrossDir,
FindCommonVertex(theDS, IndexOfLeftE1, IndexOfLeftE2,
FirstVertex, ParamOnLeftE1, ParamOnLeftE2);
FindCommonVertex(theDS, IndexOfRightE1, IndexOfRightE2, myIntPointCrossDir,
FindCommonVertex(theDS, IndexOfRightE1, IndexOfRightE2,
LastVertex, ParamOnRightE1, ParamOnRightE2);
TopoDS_Shape SecWire;
@@ -1083,8 +1079,7 @@ Standard_Boolean BRepFill_TrimShellCorner::ChooseSection(const TopoDS_Shape& Com
// purpose:
// ------------------------------------------------------------------------------------------
Standard_Boolean SplitUEdges(const Handle(TopTools_HArray2OfShape)& theUEdges,
const BOPDS_PDS& theDS,
const gp_Vec& theCrossDirection,
const BOPDS_PDS& theDS,
TopTools_DataMapOfShapeListOfShape& theHistMap) {
const BOPDS_VectorOfInterfVV& aVVs = theDS->InterfVV();
@@ -1110,7 +1105,7 @@ Standard_Boolean SplitUEdges(const Handle(TopTools_HArray2OfShape)& theUEdge
TopoDS_Vertex aCommonVertex;
Standard_Real apar1 = 0., apar2 = 0.;
Standard_Boolean bvertexfound =
FindCommonVertex(theDS, anEIndex1, anEIndex2, theCrossDirection, aCommonVertex, apar1, apar2);
FindCommonVertex(theDS, anEIndex1, anEIndex2, aCommonVertex, apar1, apar2);
//
if(!bvertexfound) {
TopoDS_Vertex V1 = TopExp::LastVertex(TopoDS::Edge(aE1));
@@ -1222,7 +1217,6 @@ void FindFreeVertices(const TopoDS_Shape& theShape,
Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
const Standard_Integer theEIndex1,
const Standard_Integer theEIndex2,
const gp_Vec& theCrossDirection,
TopoDS_Vertex& theCommonVertex,
Standard_Real& theParamOnE1,
Standard_Real& theParamOnE2) {
@@ -1233,10 +1227,6 @@ Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
TopoDS_Vertex aCommonVertex;
Standard_Integer eeit = 0;
TopoDS_Edge theE1 = TopoDS::Edge(theDS->Shape(theEIndex1));
TopoDS_Edge theE2 = TopoDS::Edge(theDS->Shape(theEIndex2));
BRepAdaptor_Curve aBC1(theE1), aBC2(theE2);
Standard_Integer aNbEEs;
aNbEEs = aEEs.Length();
for(eeit = 0; eeit < aNbEEs; ++eeit) {
@@ -1257,21 +1247,10 @@ Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
IntTools_Tools::VertexParameters(aCP, theParamOnE1, theParamOnE2);
else
IntTools_Tools::VertexParameters(aCP, theParamOnE2, theParamOnE1);
gp_Pnt aPt;
gp_Vec aDirOnE1, aDirOnE2;
gp_Dir aIntersectPointCrossDir;
// intersect point aDirOnE1.cross(aDirOnE2) should same direction with path theCrossDirection
aBC1.D1(theParamOnE1, aPt, aDirOnE1);
aBC2.D1(theParamOnE2, aPt, aDirOnE2);
aIntersectPointCrossDir = aDirOnE1.Crossed(aDirOnE2);
if (aIntersectPointCrossDir.Dot(theCrossDirection) > Precision::SquareConfusion())
{
bvertexfound = Standard_True;
break;
}
//
bvertexfound = Standard_True;
break;
}
}
}

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