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

Compare commits

..

2 Commits

Author SHA1 Message Date
mgerus
6acb227333 33150 fix(?) for wrong translate of 2dCurve 2022-09-30 10:58:48 +03:00
mgerus
5d0249c145 26920 fix exception call in fillet(wrong choice of face) 2022-09-30 10:57:43 +03:00
1022 changed files with 10998 additions and 34047 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")

View File

@@ -5,4 +5,3 @@ 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
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
DETools TKExpress ExpToCasExe

View File

@@ -480,6 +480,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

@@ -3,7 +3,7 @@
# See the cotire manual for usage hints.
#
#=============================================================================
# Copyright 2012-2018 Sascha Kratky
# Copyright 2012-2016 Sascha Kratky
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
@@ -43,7 +43,7 @@ if (NOT CMAKE_SCRIPT_MODE_FILE)
endif()
set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
set (COTIRE_CMAKE_MODULE_VERSION "1.8.1")
set (COTIRE_CMAKE_MODULE_VERSION "1.7.9")
# activate select policies
if (POLICY CMP0025)
@@ -106,11 +106,6 @@ if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
if (POLICY CMP0055)
# strict checking for break() command
cmake_policy(SET CMP0055 NEW)
endif()
include(CMakeParseArguments)
include(ProcessorCount)
@@ -239,13 +234,7 @@ function (cotire_filter_language_source_files _language _target _sourceFilesVar
# add to excluded sources, if file has custom compile flags
list (APPEND _excludedSourceFiles "${_sourceFile}")
else()
get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS)
if (_sourceCompileOptions)
# add to excluded sources, if file has list of custom compile options
list (APPEND _excludedSourceFiles "${_sourceFile}")
else()
list (APPEND _sourceFiles "${_sourceFile}")
endif()
list (APPEND _sourceFiles "${_sourceFile}")
endif()
endif()
endforeach()
@@ -304,7 +293,7 @@ function (cotire_get_source_file_property_values _valuesVar _property)
set (${_valuesVar} ${_values} PARENT_SCOPE)
endfunction()
function (cotire_resolve_config_properties _configurations _propertiesVar)
function (cotire_resolve_config_properites _configurations _propertiesVar)
set (_properties "")
foreach (_property ${ARGN})
if ("${_property}" MATCHES "<CONFIG>")
@@ -320,8 +309,8 @@ function (cotire_resolve_config_properties _configurations _propertiesVar)
set (${_propertiesVar} ${_properties} PARENT_SCOPE)
endfunction()
function (cotire_copy_set_properties _configurations _type _source _target)
cotire_resolve_config_properties("${_configurations}" _properties ${ARGN})
function (cotire_copy_set_properites _configurations _type _source _target)
cotire_resolve_config_properites("${_configurations}" _properties ${ARGN})
foreach (_property ${_properties})
get_property(_isSet ${_type} ${_source} PROPERTY ${_property} SET)
if (_isSet)
@@ -331,18 +320,13 @@ function (cotire_copy_set_properties _configurations _type _source _target)
endforeach()
endfunction()
function (cotire_get_target_usage_requirements _target _config _targetRequirementsVar)
function (cotire_get_target_usage_requirements _target _targetRequirementsVar)
set (_targetRequirements "")
get_target_property(_librariesToProcess ${_target} LINK_LIBRARIES)
while (_librariesToProcess)
# remove from head
list (GET _librariesToProcess 0 _library)
list (REMOVE_AT _librariesToProcess 0)
if (_library MATCHES "^\\$<\\$<CONFIG:${_config}>:([A-Za-z0-9_:-]+)>$")
set (_library "${CMAKE_MATCH_1}")
elseif (_config STREQUAL "None" AND _library MATCHES "^\\$<\\$<CONFIG:>:([A-Za-z0-9_:-]+)>$")
set (_library "${CMAKE_MATCH_1}")
endif()
if (TARGET ${_library})
list (FIND _targetRequirements ${_library} _index)
if (_index LESS 0)
@@ -457,7 +441,7 @@ function (cotire_get_target_compile_flags _config _language _target _flagsVar)
# interface compile options from linked library targets
if (_target)
set (_linkedTargets "")
cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
cotire_get_target_usage_requirements(${_target} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_targetOptions ${_linkedTarget} INTERFACE_COMPILE_OPTIONS)
if (_targetOptions)
@@ -589,7 +573,7 @@ function (cotire_get_target_include_directories _config _language _target _inclu
# interface include directories from linked library targets
if (_target)
set (_linkedTargets "")
cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
cotire_get_target_usage_requirements(${_target} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_linkedTargetType ${_linkedTarget} TYPE)
if (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE AND NOT CMAKE_VERSION VERSION_LESS "3.4.0" AND
@@ -643,7 +627,7 @@ function (cotire_get_target_include_directories _config _language _target _inclu
if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
endif()
if (WIN32 AND NOT MINGW)
if (WIN32)
# convert Windows paths in include directories to CMake paths
if (_includeDirs)
set (_paths "")
@@ -719,7 +703,7 @@ function (cotire_get_target_compile_definitions _config _language _target _defin
endif()
# interface compile definitions from linked library targets
set (_linkedTargets "")
cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
cotire_get_target_usage_requirements(${_target} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_definitions ${_linkedTarget} INTERFACE_COMPILE_DEFINITIONS)
if (_definitions)
@@ -727,7 +711,7 @@ function (cotire_get_target_compile_definitions _config _language _target _defin
endif()
endforeach()
# parse additional compile definitions from target compile flags
# and do not look at directory compile definitions, which we already handled
# and don't look at directory compile definitions, which we already handled
set (_targetFlags "")
cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
cotire_filter_compile_flags("${_language}" "D" _definitions _ignore ${_targetFlags})
@@ -875,9 +859,6 @@ macro (cotire_set_cmd_to_prologue _cmdVar)
list (APPEND ${_cmdVar} "--warn-uninitialized")
endif()
list (APPEND ${_cmdVar} "-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>")
if (XCODE)
list (APPEND ${_cmdVar} "-DXCODE:BOOL=TRUE")
endif()
if (COTIRE_VERBOSE)
list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=ON")
elseif("${CMAKE_GENERATOR}" MATCHES "Makefiles")
@@ -895,9 +876,6 @@ function (cotire_init_compile_cmd _cmdVar _language _compilerLauncher _compilerE
if (NOT _compilerArg1)
set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
endif()
if (WIN32)
file (TO_NATIVE_PATH "${_compilerExe}" _compilerExe)
endif()
string (STRIP "${_compilerArg1}" _compilerArg1)
if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
# compiler launcher is only supported for Makefile and Ninja
@@ -924,16 +902,16 @@ function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemInclu
foreach (_include ${_includeDirs})
if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
file (TO_NATIVE_PATH "${_include}" _include)
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
else()
set (_index -1)
if ("${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" MATCHES ".+")
list (FIND ${_systemIncludesVar} "${_include}" _index)
endif()
if (_index GREATER -1)
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${_include}")
else()
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
endif()
endif()
endforeach()
@@ -1068,10 +1046,10 @@ macro (cotire_check_ignore_header_file_path _headerFile _headerIsIgnoredVar)
set (${_headerIsIgnoredVar} TRUE)
elseif (IS_DIRECTORY "${_headerFile}")
set (${_headerIsIgnoredVar} TRUE)
elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed")
# heuristic: ignore headers with embedded parent directory references or "-fixed" or "_fixed" in path
elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed" AND "${_headerFile}" MATCHES "\\.h$")
# heuristic: ignore C headers with embedded parent directory references or "-fixed" or "_fixed" in path
# these often stem from using GCC #include_next tricks, which may break the precompiled header compilation
# with the error message "error: no include path in which to search for header"
# with the error message "error: no include path in which to search for header.h"
set (${_headerIsIgnoredVar} TRUE)
else()
set (${_headerIsIgnoredVar} FALSE)
@@ -1092,11 +1070,12 @@ endmacro()
macro (cotire_parse_line _line _headerFileVar _headerDepthVar)
if (MSVC)
# cl.exe /showIncludes produces different output, depending on the language pack used, e.g.:
# cl.exe /showIncludes output looks different depending on the language pack used, e.g.:
# English: "Note: including file: C:\directory\file"
# German: "Hinweis: Einlesen der Datei: C:\directory\file"
# We use a very general regular expression, relying on the presence of the : characters
if (_line MATCHES "( +)([a-zA-Z]:[^:]+)$")
# Visual Studio compiler output
string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" ABSOLUTE)
else()
@@ -1254,19 +1233,11 @@ function (cotire_scan_includes _includesVar)
set (${_includesVar} "" PARENT_SCOPE)
return()
endif()
# add source files to be scanned
if (WIN32)
foreach (_sourceFile ${_existingSourceFiles})
file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative)
list (APPEND _cmd "${_sourceFileNative}")
endforeach()
else()
list (APPEND _cmd ${_existingSourceFiles})
endif()
list (APPEND _cmd ${_existingSourceFiles})
if (COTIRE_VERBOSE)
message (STATUS "execute_process: ${_cmd}")
endif()
if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
if (_option_COMPILER_ID MATCHES "MSVC")
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT})
endif()
@@ -1502,16 +1473,11 @@ function (cotire_generate_prefix_header _prefixFile)
if (_unparsedLines)
if (COTIRE_VERBOSE OR _scanResult OR NOT _selectedHeaders)
list (LENGTH _unparsedLines _skippedLineCount)
if (WIN32)
file (TO_NATIVE_PATH "${_unparsedLinesFile}" _unparsedLinesLogPath)
else()
set (_unparsedLinesLogPath "${_unparsedLinesFile}")
endif()
message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesLogPath}")
message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesFile}")
endif()
string (REPLACE ";" "\n" _unparsedLines "${_unparsedLines}")
endif()
file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}\n")
file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}")
endfunction()
function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flagsVar)
@@ -1541,7 +1507,7 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags
# append to list
list (APPEND _flags -H -E)
if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
list (APPEND _flags -fdirectives-only)
list (APPEND _flags "-fdirectives-only")
endif()
else()
# return as a flag string
@@ -1551,36 +1517,16 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags
endif()
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -H print the name of each header file used
# -E invoke preprocessor
# -fno-color-diagnostics do not print diagnostics in color
# -Eonly just run preprocessor, no output
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
else()
# return as a flag string
set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly")
endif()
elseif (WIN32)
# Clang-cl.exe options used
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
# /EP preprocess to stdout without #line directives
# -H print the name of each header file used
# -fno-color-diagnostics do not print diagnostics in color
# -Eonly just run preprocessor, no output
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}" /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly)
else()
# return as a flag string
set (_flags "${_sourceFileType${_language}} /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly")
endif()
# Clang options used
# -H print the name of each header file used
# -E invoke preprocessor
# -fno-color-diagnostics don't prints diagnostics in color
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics)
else()
# return as a flag string
set (_flags "-H -E -fno-color-diagnostics")
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
@@ -1654,8 +1600,8 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
endif()
endif()
elseif (_compilerID MATCHES "GNU")
# GCC options used
elseif (_compilerID MATCHES "GNU|Clang")
# GCC / Clang options used
# -x specify the source language
# -c compile but do not link
# -o place output in file
@@ -1665,55 +1611,11 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
set (_xLanguage_CXX "c++-header")
if (_flags)
# append to list
list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
list (APPEND _flags "-x" "${_xLanguage_${_language}}" "-c" "${_prefixFile}" -o "${_pchFile}")
else()
# return as a flag string
set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -x specify the source language
# -c compile but do not link
# -o place output in file
# -fno-pch-timestamp disable inclusion of timestamp in precompiled headers (clang 4.0.0+)
set (_xLanguage_C "c-header")
set (_xLanguage_CXX "c++-header")
if (_flags)
# append to list
list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
list (APPEND _flags -Xclang -fno-pch-timestamp)
endif()
else()
# return as a flag string
set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
set (_flags "${_flags} -Xclang -fno-pch-timestamp")
endif()
endif()
elseif (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
# Clang-cl.exe options used
# /Yc creates a precompiled header file
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
# /Zs syntax check only
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}"
"/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
else()
# return as a flag string
set (_flags "/Yc\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
endif()
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
@@ -1755,28 +1657,20 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
get_filename_component(_pchName "${_pchFile}" NAME)
set (_xLanguage_C "c-header")
set (_xLanguage_CXX "c++-header")
set (_pchSuppressMessages FALSE)
if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
set(_pchSuppressMessages TRUE)
endif()
if (_flags)
# append to list
if ("${_language}" STREQUAL "CXX")
list (APPEND _flags -Kc++)
endif()
list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-create "${_pchName}" -fsyntax-only "${_hostFile}")
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
list (APPEND _flags -Wpch-messages)
endif()
list (APPEND _flags "-Wpch-messages")
endif()
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
set (_flags "${_flags} -Wpch-messages")
endif()
set (_flags "${_flags} -Wpch-messages")
endif()
endif()
endif()
@@ -1827,48 +1721,23 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags -Winvalid-pch -include "${_prefixFile}")
list (APPEND _flags "-Winvalid-pch" "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -include process include file as the first line of the primary source file
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}")
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\"")
endif()
elseif (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
# Clang-cl.exe options used
# /Yu uses a precompiled header file during build
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
if (_pchFile)
file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
if (_flags)
# append to list
list (APPEND _flags "/Yu${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
else()
# return as a flag string
set (_flags "/Yu\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
endif()
else()
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
list (APPEND _flags "/FI${_prefixFileNative}")
else()
# return as a flag string
set (_flags "/FI\"${_prefixFileNative}\"")
endif()
endif()
# Clang options used
# -include process include file as the first line of the primary source file
# -include-pch include precompiled header file
# -Qunused-arguments don't emit warning for unused driver arguments
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags "-Qunused-arguments" "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-Qunused-arguments -include \"${_prefixFile}\"")
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
@@ -1912,32 +1781,24 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
if (_pchFile)
get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
get_filename_component(_pchName "${_pchFile}" NAME)
set (_pchSuppressMessages FALSE)
if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
set(_pchSuppressMessages TRUE)
endif()
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-use "${_pchName}")
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
list (APPEND _flags -Wpch-messages)
endif()
list (APPEND _flags "-Wpch-messages")
endif()
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
set (_flags "${_flags} -Wpch-messages")
endif()
set (_flags "${_flags} -Wpch-messages")
endif()
endif()
else()
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}")
list (APPEND _flags "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\"")
@@ -1975,17 +1836,9 @@ function (cotire_precompile_prefix_header _prefixFile _pchFile _hostFile)
if (COTIRE_VERBOSE)
message (STATUS "execute_process: ${_cmd}")
endif()
if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
if (_option_COMPILER_ID MATCHES "MSVC")
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT})
elseif (_option_COMPILER_ID MATCHES "Clang" AND _option_COMPILER_VERSION VERSION_LESS "4.0.0")
if (_option_COMPILER_LAUNCHER MATCHES "ccache" OR
_option_COMPILER_EXECUTABLE MATCHES "ccache")
# Newer versions of Clang embed a compilation timestamp into the precompiled header binary,
# which results in "file has been modified since the precompiled header was built" errors if ccache is used.
# We work around the problem by disabling ccache upon pre-compiling the prefix header.
set (ENV{CCACHE_DISABLE} "true")
endif()
endif()
execute_process(
COMMAND ${_cmd}
@@ -2000,7 +1853,7 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
set (_unsupportedCompiler
"Precompiled headers not supported for ${_language} compiler ${CMAKE_${_language}_COMPILER_ID}")
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
# PCH supported since Visual Studio C++ 6.0
# supported since Visual Studio C++ 6.0
# and CMake does not support an earlier version
set (${_msgVar} "" PARENT_SCOPE)
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
@@ -2011,16 +1864,8 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
set (${_msgVar} "" PARENT_SCOPE)
endif()
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
if (UNIX)
# all Unix Clang versions have PCH support
set (${_msgVar} "" PARENT_SCOPE)
elseif (WIN32)
# only clang-cl is supported under Windows
get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE)
if (NOT _compilerName MATCHES "cl$")
set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE)
endif()
endif()
# all Clang versions have PCH support
set (${_msgVar} "" PARENT_SCOPE)
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
# Intel PCH support requires version >= 8.0.0
if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
@@ -2031,38 +1876,29 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
else()
set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
endif()
# check if ccache is used as a compiler launcher
get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" REALPATH)
if (_realCompilerExe MATCHES "ccache" OR _launcher MATCHES "ccache")
# verify that ccache configuration is compatible with precompiled headers
# always check environment variable CCACHE_SLOPPINESS, because earlier versions of ccache
# do not report the "sloppiness" setting correctly upon printing ccache configuration
if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
if (DEFINED ENV{CCACHE_SLOPPINESS})
if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR
NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
set (${_msgVar}
"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
PARENT_SCOPE)
endif()
else()
if (_realCompilerExe MATCHES "ccache")
set (_ccacheExe "${_realCompilerExe}")
if (_launcher MATCHES "ccache")
get_filename_component(_ccacheExe "${_launcher}" REALPATH)
else()
set (_ccacheExe "${_launcher}")
get_filename_component(_ccacheExe "${CMAKE_${_language}_COMPILER}" REALPATH)
endif()
# ccache 3.7.0 replaced --print-config with --show-config
# use -p instead, which seems to work for all version for now, sigh
execute_process(
COMMAND "${_ccacheExe}" "-p"
COMMAND "${_ccacheExe}" "--print-config"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
RESULT_VARIABLE _result
OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if (_result)
set (${_msgVar} "ccache configuration cannot be determined." PARENT_SCOPE)
elseif (NOT _ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR
NOT _ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
if (_result OR NOT
_ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR NOT
_ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
set (${_msgVar}
"ccache requires configuration setting \"sloppiness\" to be set to \"pch_defines,time_macros\"."
PARENT_SCOPE)
@@ -2355,7 +2191,7 @@ function (cotire_generate_target_script _language _configurations _target _targe
XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
CMAKE_${_language}_COMPILER_LAUNCHER CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_SEP_${_language}
CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_${_language}_SEP
CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
@@ -2388,9 +2224,8 @@ endfunction()
function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
set (_sourceFiles ${ARGN})
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# for Visual Studio and Intel, we attach the precompiled header compilation to the host file
# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
if (_sourceFiles)
set (_flags "")
@@ -2398,9 +2233,6 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" "${_hostFile}" _flags)
set_property (SOURCE ${_hostFile} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
if (COTIRE_DEBUG)
message (STATUS "set_property: SOURCE ${_hostFile} APPEND_STRING COMPILE_FLAGS ${_flags}")
endif()
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_OUTPUTS "${_pchFile}")
# make object file generated from host file depend on prefix header
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
@@ -2438,9 +2270,8 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
endfunction()
function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# for Visual Studio and Intel, we include the precompiled header in all but the host file
# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
set (_sourceFiles ${ARGN})
list (LENGTH _sourceFiles _numberOfSourceFiles)
@@ -2452,9 +2283,6 @@ function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefix
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
if (COTIRE_DEBUG)
message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
endif()
# make object files generated from source files depend on precompiled header
set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_pchFile}")
endif()
@@ -2468,9 +2296,6 @@ function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefix
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
if (COTIRE_DEBUG)
message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
endif()
# mark sources as cotired to prevent them from being used in another cotired target
set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
endif()
@@ -2488,9 +2313,6 @@ function (cotire_setup_prefix_file_inclusion _language _target _prefixFile)
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
if (COTIRE_DEBUG)
message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
endif()
# mark sources as cotired to prevent them from being used in another cotired target
set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
# make object files generated from source files depend on prefix header
@@ -2580,7 +2402,7 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
message (STATUS "add_custom_command: TARGET ${_target} PRE_BUILD ${_cmds}")
endif()
# because CMake PRE_BUILD command does not support dependencies,
# we check dependencies explicity in cotire script mode when the pre-build action is run
# we check dependencies explicitly in cotire script mode when the pre-build action is run
add_custom_command(
TARGET "${_target}"
PRE_BUILD ${_cmds}
@@ -2595,10 +2417,9 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
# if this is a single-language target without any excluded files
if (_wholeTarget)
set (_language "${_languages}")
# for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
# for Visual Studio and Intel, precompiled header inclusion is always done on the source file level
# see cotire_setup_pch_file_inclusion
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
if (_prefixFile)
get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
@@ -2607,9 +2428,6 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _options)
set_property(TARGET ${_target} APPEND PROPERTY ${_options})
if (COTIRE_DEBUG)
message (STATUS "set_property: TARGET ${_target} APPEND PROPERTY ${_options}")
endif()
endif()
endif()
endif()
@@ -2636,8 +2454,7 @@ function (cotire_setup_unity_generation_commands _language _target _targetScript
set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_objectDependsPaths})
endif()
if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# unity file compilation results in potentially huge object file,
# thus use /bigobj by default unter cl.exe and Windows Intel
# unity file compilation results in potentially huge object file, thus use /bigobj by default unter MSVC and Windows Intel
set_property (SOURCE "${_unityFile}" APPEND_STRING PROPERTY COMPILE_FLAGS "/bigobj")
endif()
cotire_set_cmd_to_prologue(_unityCmd)
@@ -2843,9 +2660,6 @@ function (cotire_make_target_message _target _languages _disableMsg _targetMsgVa
else()
set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build.")
endif()
if (_disableMsg)
set (_targetMsg "${_targetMsg} ${_disableMsg}")
endif()
else()
if (_excludedStr)
set (_targetMsg "${_languagesStr} target ${_target} cotired ${_excludedStr}.")
@@ -2935,20 +2749,6 @@ function (cotire_choose_target_languages _target _targetLanguagesVar _wholeTarge
set (_targetUsePCH FALSE)
endif()
endif()
if (_targetAddSCU)
# disable unity builds if automatic Qt processing is used
get_target_property(_targetAutoMoc ${_target} AUTOMOC)
get_target_property(_targetAutoUic ${_target} AUTOUIC)
get_target_property(_targetAutoRcc ${_target} AUTORCC)
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
if (_disableMsg)
set (_disableMsg "${_disableMsg} Target uses automatic CMake Qt processing.")
else()
set (_disableMsg "Target uses automatic CMake Qt processing.")
endif()
set (_targetAddSCU FALSE)
endif()
endif()
set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER ${_targetUsePCH})
set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD ${_targetAddSCU})
cotire_make_target_message(${_target} "${_targetLanguages}" "${_disableMsg}" _targetMsg ${_allExcludedSourceFiles})
@@ -2976,11 +2776,7 @@ function (cotire_compute_unity_max_number_of_includes _target _maxIncludesVar)
set (_sourceFiles ${ARGN})
get_target_property(_maxIncludes ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
if (_maxIncludes MATCHES "(-j|--parallel|--jobs) ?([0-9]*)")
if (DEFINED CMAKE_MATCH_2)
set (_numberOfThreads "${CMAKE_MATCH_2}")
else()
set (_numberOfThreads "")
endif()
set (_numberOfThreads "${CMAKE_MATCH_2}")
if (NOT _numberOfThreads)
# use all available cores
ProcessorCount(_numberOfThreads)
@@ -3093,9 +2889,8 @@ function (cotire_setup_pch_target _languages _configurations _target)
set (_dependsFiles "")
foreach (_language ${_languages})
set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE)
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# MSVC, Intel and clang-cl only create precompiled header as a side effect
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# Visual Studio and Intel only create precompiled header as a side effect
list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER)
endif()
cotire_get_first_set_property_value(_dependsFile TARGET ${_target} ${_props})
@@ -3143,7 +2938,6 @@ function (cotire_collect_unity_target_sources _target _languages _unityTargetSou
list (APPEND _unityTargetSources ${_unityFiles})
endif()
endforeach()
# handle object libraries which are part of the target's sources
get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$")
cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles})
@@ -3188,6 +2982,21 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
# determine unity target sources
set (_unityTargetSources "")
cotire_collect_unity_target_sources(${_target} "${_languages}" _unityTargetSources)
# handle automatic Qt processing
get_target_property(_targetAutoMoc ${_target} AUTOMOC)
get_target_property(_targetAutoUic ${_target} AUTOUIC)
get_target_property(_targetAutoRcc ${_target} AUTORCC)
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# if the original target sources are subject to CMake's automatic Qt processing,
# also include implicitly generated <targetname>_automoc.cpp file
if (CMAKE_VERSION VERSION_LESS "3.8.0")
list (APPEND _unityTargetSources "${_target}_automoc.cpp")
set_property (SOURCE "${_target}_automoc.cpp" PROPERTY GENERATED TRUE)
else()
list (APPEND _unityTargetSources "${_target}_autogen/moc_compilation.cpp")
set_property (SOURCE "${_target}_autogen/moc_compilation.cpp" PROPERTY GENERATED TRUE)
endif()
endif()
# prevent AUTOMOC, AUTOUIC and AUTORCC properties from being set when the unity target is created
set (CMAKE_AUTOMOC OFF)
set (CMAKE_AUTOUIC OFF)
@@ -3201,6 +3010,21 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
else()
add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
endif()
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
# depend on original target's automoc target, if it exists
if (TARGET ${_target}_automoc)
add_dependencies(${_unityTargetName} ${_target}_automoc)
endif()
else()
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# depend on the original target's implicitly generated <targetname>_automoc target
if (CMAKE_VERSION VERSION_LESS "3.8.0")
add_dependencies(${_unityTargetName} ${_target}_automoc)
else()
add_dependencies(${_unityTargetName} ${_target}_autogen)
endif()
endif()
endif()
# copy output location properties
set (_outputDirProperties
ARCHIVE_OUTPUT_DIRECTORY ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
@@ -3212,8 +3036,8 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
set (_outputDir "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
else()
# append relative COTIRE_UNITY_OUTPUT_DIRECTORY to target's actual output directory
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
cotire_resolve_config_properties("${_configurations}" _properties ${_outputDirProperties})
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
cotire_resolve_config_properites("${_configurations}" _properties ${_outputDirProperties})
foreach (_property ${_properties})
get_property(_outputDir TARGET ${_target} PROPERTY ${_property})
if (_outputDir)
@@ -3233,11 +3057,11 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
RUNTIME_OUTPUT_DIRECTORY "${_outputDir}")
endif()
else()
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
${_outputDirProperties})
endif()
# copy output name
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_<CONFIG>
LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_<CONFIG>
OUTPUT_NAME OUTPUT_NAME_<CONFIG>
@@ -3245,7 +3069,7 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
PREFIX <CONFIG>_POSTFIX SUFFIX
IMPORT_PREFIX IMPORT_SUFFIX)
# copy compile stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
COMPILE_DEFINITIONS COMPILE_DEFINITIONS_<CONFIG>
COMPILE_FLAGS COMPILE_OPTIONS
Fortran_FORMAT Fortran_MODULE_DIRECTORY
@@ -3257,12 +3081,12 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN
C_CLANG_TIDY CXX_CLANG_TIDY)
# copy compile features
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED
CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED
COMPILE_FEATURES)
# copy interface stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN
COMPATIBLE_INTERFACE_STRING
INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS
@@ -3270,9 +3094,8 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
INTERFACE_AUTOUIC_OPTIONS NO_SYSTEM_FROM_IMPORTED)
# copy link stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUILD_WITH_INSTALL_RPATH BUILD_WITH_INSTALL_NAME_DIR
INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUILD_WITH_INSTALL_RPATH INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED
LINK_FLAGS LINK_FLAGS_<CONFIG>
LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_<CONFIG>
@@ -3280,18 +3103,18 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
NO_SONAME SOVERSION VERSION
LINK_WHAT_YOU_USE BUILD_RPATH)
LINK_WHAT_YOU_USE)
# copy cmake stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
# copy Apple platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST
IOS_INSTALL_COMBINED XCODE_EXPLICIT_FILE_TYPE XCODE_PRODUCT_TYPE)
IOS_INSTALL_COMBINED)
# copy Windows platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
GNUtoMS
COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
@@ -3305,19 +3128,15 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS
DEPLOYMENT_REMOTE_DIRECTORY VS_CONFIGURATION_TYPE
VS_SDK_REFERENCES VS_USER_PROPS VS_DEBUGGER_WORKING_DIRECTORY)
VS_SDK_REFERENCES)
# copy Android platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
ANDROID_API ANDROID_API_MIN ANDROID_GUI
ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES
ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR
ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES
ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH
ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE)
# copy CUDA platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
CUDA_PTX_COMPILATION CUDA_SEPARABLE_COMPILATION CUDA_RESOLVE_DEVICE_SYMBOLS
CUDA_EXTENSIONS CUDA_STANDARD CUDA_STANDARD_REQUIRED)
# use output name from original target
get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
if (NOT _targetOutputName)
@@ -3331,13 +3150,6 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
set_property(TARGET ${_unityTargetName} PROPERTY ENABLE_EXPORTS TRUE)
endif()
endif()
# enable parallel compilation for MSVC
if (MSVC AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
list (LENGTH _unityTargetSources _numberOfUnityTargetSources)
if (_numberOfUnityTargetSources GREATER 1)
set_property(TARGET ${_unityTargetName} APPEND PROPERTY COMPILE_OPTIONS "/MP")
endif()
endif()
cotire_init_target(${_unityTargetName})
cotire_add_to_unity_all_target(${_unityTargetName})
set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_TARGET_NAME "${_unityTargetName}")
@@ -3496,13 +3308,6 @@ function (cotire_target_link_libraries _target)
message (STATUS "unity target ${_unityTargetName} interface link libraries: ${_unityLinkInterfaceLibraries}")
endif()
endif()
get_target_property(_manualDependencies ${_target} MANUALLY_ADDED_DEPENDENCIES)
if (_manualDependencies)
cotire_map_libraries("${_linkLibrariesStrategy}" _unityManualDependencies ${_manualDependencies})
if (_unityManualDependencies)
add_dependencies("${_unityTargetName}" ${_unityManualDependencies})
endif()
endif()
endif()
endif()
endfunction(cotire_target_link_libraries)
@@ -3535,9 +3340,9 @@ function (cotire_init_target _targetName)
set_target_properties(${_targetName} PROPERTIES FOLDER "${COTIRE_TARGETS_FOLDER}")
endif()
set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# if (MSVC_IDE)
# set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
# endif()
if (MSVC_IDE)
set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
endif()
endfunction()
function (cotire_add_to_pch_all_target _pchTargetName)
@@ -3799,7 +3604,7 @@ else()
set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING
"Ignore sources with the listed file extensions from the generated unity source.")
set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "2" CACHE STRING
set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "3" CACHE STRING
"Minimum number of sources in target required to enable use of precompiled header.")
if (NOT DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT)
@@ -3898,7 +3703,7 @@ else()
FULL_DOCS
"The variable can be set to an integer > 0."
"If a target contains less than that number of source files, cotire will not enable the use of the precompiled header for the target."
"If not defined, defaults to 2."
"If not defined, defaults to 3."
)
define_property(

View File

@@ -3,6 +3,10 @@
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()
@@ -11,24 +15,14 @@ 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)
set (3RDPARTY_DRACO_LIBRARY "" CACHE FILEPATH "Draco library")
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 (WIN32)
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY_DEBUG)
set (3RDPARTY_DRACO_LIBRARY_DEBUG "" CACHE FILEPATH "Draco debug library")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY_DIR_DEBUG)
set (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "" CACHE PATH "The directory containing Draco debug library")
endif()
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)
@@ -38,19 +32,20 @@ if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
endif()
endif()
# header
if (NOT 3RDPARTY_DRACO_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_DRACO_INCLUDE_DIR}")
set (HEADER_NAMES draco)
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()
# set 3RDPARTY_DRACO_INCLUDE_DIR as notfound, otherwise find_path can't assign a new value to 3RDPARTY_DRACO_INCLUDE_DIR
set (3RDPARTY_DRACO_INCLUDE_DIR "3RDPARTY_DRACO_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "The directory containing headers of the Draco" FORCE)
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 (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
find_path (3RDPARTY_DRACO_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_DRACO_DIR}
PATH_SUFFIXES "include"
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
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()
@@ -62,11 +57,11 @@ 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 .a)
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_DIR}"
PATHS "${3RDPARTY_DRACO_LIBRARY_DIR}"
PATH_SUFFIXES lib
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
@@ -75,19 +70,27 @@ if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
endif()
endif()
endif()
if (WIN32 AND (NOT 3RDPARTY_DRACO_LIBRARY_DEBUG OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}"))
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
set (3RDPARTY_DRACO_LIBRARY_DEBUG "3RDPARTY_DRACO_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "The path to debug Draco library" FORCE)
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()
find_library (3RDPARTY_DRACO_LIBRARY_DEBUG NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_DIR}"
PATH_SUFFIXES libd
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY_DEBUG AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DEBUG}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DIR_DEBUG}" CACHE FILEPATH "The directory containing debug Draco library" FORCE)
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()

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

@@ -110,19 +110,8 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}")
endif()
unset (FREETYPE_LIBRARY_RELEASE)
find_package(Freetype)
# Only for UNIX (not APPLE)
if ((NOT WIN32) AND (NOT APPLE))
# To avoid linker error on Ubuntu 18.04 and others linux distributives we should
# link with freetype library, compiled as Position Independent Code (PIC),
# for example, with shared object.
if ((DEFINED FREETYPE_LIBRARY_RELEASE) AND (NOT "${FREETYPE_LIBRARY_RELEASE}" STREQUAL "") AND (EXISTS "${FREETYPE_LIBRARY_RELEASE}"))
string (REPLACE "\.a" "\.so" FREETYPE_LIBRARY_RELEASE "${FREETYPE_LIBRARY_RELEASE}")
endif()
endif()
# restore ENV{FREETYPE_DIR}
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
set (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR})
@@ -133,7 +122,7 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_ft2build FILEPATH "The directory containing ft2build.h header")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_freetype2 FILEPATH "The directory containing ftheader.h header")
if (BUILD_SHARED_LIBS)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_LIBRARY_RELEASE FILEPATH "freetype library")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_LIBRARY FILEPATH "freetype library")
endif()
endif()
@@ -152,8 +141,8 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
if (BUILD_SHARED_LIBS)
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
if (FREETYPE_LIBRARY_RELEASE AND EXISTS "${FREETYPE_LIBRARY_RELEASE}")
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY_RELEASE}" CACHE FILEPATH "The path to freetype library" FORCE)
if (FREETYPE_LIBRARY AND EXISTS "${FREETYPE_LIBRARY}")
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY}" CACHE FILEPATH "The path to freetype library" FORCE)
endif()
endif()
@@ -231,7 +220,7 @@ endif()
# freetype library
#if (BUILD_SHARED_LIBS)
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (FREETYPE_PATH_SUFFIXES lib)
if (ANDROID)
@@ -253,16 +242,6 @@ endif()
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
# Only for UNIX (not APPLE)
if ((NOT WIN32) AND (NOT APPLE))
# To avoid linker error on Ubuntu 18.04 and some others linux distributives we should
# link with freetype library, compiled as Position Independent Code (PIC),
# for example, with shared object.
if ((DEFINED 3RDPARTY_FREETYPE_LIBRARY) AND (NOT "${3RDPARTY_FREETYPE_LIBRARY}" STREQUAL "") AND (EXISTS "${3RDPARTY_FREETYPE_LIBRARY}"))
string (REPLACE "\.a" "\.so" 3RDPARTY_FREETYPE_LIBRARY "${3RDPARTY_FREETYPE_LIBRARY}")
endif()
endif()
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
@@ -371,7 +350,7 @@ endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY_RELEASE)
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY)
if (BUILD_SHARED_LIBS)
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)

View File

@@ -116,9 +116,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 +130,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 +148,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})
@@ -160,8 +160,6 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
if ("${lower_PRODUCT_NAME}" STREQUAL "egl")
string (SUBSTRING "${lower_PRODUCT_NAME}" 1 -1 lower_PRODUCT_NAME)
list (APPEND SEARCH_TEMPLATES "[^gl]+${lower_PRODUCT_NAME}.*")
elseif ("${lower_PRODUCT_NAME}" STREQUAL "tbb")
list (APPEND SEARCH_TEMPLATES "^.*${lower_PRODUCT_NAME}.*")
else()
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
@@ -591,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)
@@ -600,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)
@@ -614,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

@@ -70,16 +70,6 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
# remove old general version of FlexLexer
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h")
file(REMOVE ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
endif()
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
@@ -116,30 +106,21 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
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})
if (CXX_FLEX_LANGUAGE_FOUND)
set (FLEX_OUTPUT_FILE_EXT "cxx")
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${FLEX_BISON_TARGET_DIR}/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()
endif()
endforeach()
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}"
@@ -245,18 +226,6 @@ endif (USE_QT)
if (EXECUTABLE_PROJECT)
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (DEFINED ${PROJECT_NAME}_DISABLE_COTIRE AND ${PROJECT_NAME}_DISABLE_COTIRE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
else()
# To avoid excluding of PROJECT_NAME from cotire tool, we may use cotire
# COTIRE_PREFIX_HEADER_IGNORE_PATH instead. But, practically it causes many 'undefined symbols' error.
# So, we just exclude PROJECT_NAME from cotire list.
# if (DEFINED ${PROJECT_NAME}_COTIRE_IGNORE_PATH)
# set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH "${${PROJECT_NAME}_COTIRE_IGNORE_PATH}")
# endif()
endif()
install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
@@ -266,33 +235,15 @@ if (EXECUTABLE_PROJECT)
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (DEFINED ${PROJECT_NAME}_DISABLE_COTIRE AND ${PROJECT_NAME}_DISABLE_COTIRE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
else()
# To avoid excluding of PROJECT_NAME from cotire tool, we may use cotire
# COTIRE_PREFIX_HEADER_IGNORE_PATH instead. But, practically it causes many 'undefined symbols' error.
# So, we just exclude PROJECT_NAME from cotire list.
# if (DEFINED ${PROJECT_NAME}_COTIRE_IGNORE_PATH)
# set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH "${${PROJECT_NAME}_COTIRE_IGNORE_PATH}")
# endif()
endif()
if (MSVC)
if (BUILD_FORCE_RelWithDebInfo)
set (aReleasePdbConf "Release")
else()
set (aReleasePdbConf)
endif()
if (BUILD_SHARED_LIBS)
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
else()
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
endif()
endif()
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
@@ -369,17 +320,13 @@ 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()
if ("${CURRENT_CSF}" STREQUAL "${CSF_Draco}")
set (CURRENT_CSF "")
set (USED_DRACO 1)
endif()
set (LIBRARY_FROM_CACHE 0)
separate_arguments (CURRENT_CSF)
foreach (CSF_LIBRARY ${CURRENT_CSF})
@@ -407,7 +354,7 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
endforeach()
endforeach()
if (NOT ${LIBRARY_FROM_CACHE} AND NOT "${CURRENT_CSF}" STREQUAL "")
if (NOT ${LIBRARY_FROM_CACHE})
# prepare a list from a string with whitespaces
separate_arguments (CURRENT_CSF)
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
@@ -418,28 +365,6 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
endif()
endforeach()
if (USE_DRACO)
if (USED_DRACO)
set (USED_LIB_RELEASE ${3RDPARTY_DRACO_LIBRARY})
if (WIN32)
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY_DEBUG})
else()
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY})
endif()
set (USED_LIB_CONF)
if (EXISTS ${USED_LIB_DEBUG})
set (USED_LIB_CONF "$<$<CONFIG:DEBUG>:${USED_LIB_DEBUG}>;${USED_LIB_CONF}")
endif()
if (EXISTS ${USED_LIB_RELEASE})
set (USED_LIB_CONF "$<$<CONFIG:RELEASE>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
set (USED_LIB_CONF "$<$<CONFIG:RELWITHDEBINFO>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
endif()
if (DEFINED USED_LIB_CONF)
set_property (TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_LIBRARIES "${USED_LIB_CONF}")
endif()
endif()
endif()
if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1)

View File

@@ -1,240 +1,294 @@
# tbb
if (NOT DEFINED INSTALL_TBB AND BUILD_SHARED_LIBS)
set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}")
endif()
# tbb directory
if (NOT DEFINED 3RDPARTY_TBB_DIR)
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
endif()
if (MSVC AND BUILD_SHARED_LIBS)
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
endif()
if (NOT DEFINED INSTALL_TBB AND BUILD_SHARED_LIBS)
set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}")
endif()
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# Initialize tbb directory.
if (NOT DEFINED 3RDPARTY_TBB_DIR)
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
endif()
# specify TBB folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_TBB_DIR PATH "The directory containing tbb")
if (WIN32)
if (NOT DEFINED 3RDPARTY_DIR)
message (FATAL_ERROR "3RDPARTY_DIR is not defined.")
endif()
if ("${3RDPARTY_DIR}" STREQUAL "")
message (FATAL_ERROR "3RDPARTY_DIR is empty string.")
endif()
if (NOT EXISTS "${3RDPARTY_DIR}")
message (FATAL_ERROR "3RDPARTY_DIR is not exist.")
endif()
# Below, we have correct 3RDPARTY_DIR.
# Initialize TBB folder in connectin with 3RDPARTY_DIR.
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
if (NOT 3RDPARTY_TBB_DIR OR NOT EXISTS "${3RDPARTY_TBB_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
if (TBB_DIR_NAME)
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
endif()
endif()
else()
#set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing TBB" FORCE)
endif()
# Here we have full path name to installation directory of TBB.
# Employ it.
if (EXISTS "${3RDPARTY_TBB_DIR}")
find_package (
TBB 2021.5
PATHS "${3RDPARTY_TBB_DIR}" NO_DEFAULT_PATH
REQUIRED
CONFIG)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
endif()
# Achive include directory
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
# check 3RDPARTY_TBB_INCLUDE_DIR for consictency with specified 3RDPARTY_TBB_DIR
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_TBB_INCLUDE_DIR PATH "The directory containing headers of the TBB")
endif()
# tbb.h
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
set (HEADER_NAMES tbb.h tbb/tbb.h)
# set 3RDPARTY_TBB_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_TBB_INCLUDE_DIR
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "the path to tbb.h" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_TBB_DIR}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
if (3RDPARTY_TBB_INCLUDE_DIR AND EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "the path to tbb.h" FORCE)
endif()
# common steps for tbb and tbbmalloc
macro (TBB_PRODUCT_SEARCH PRODUCT_LIBRARY_NAME)
string (TOUPPER ${PRODUCT_LIBRARY_NAME} upper_PRODUCT_LIBRARY_NAME)
# 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()
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()
if (EXISTS "${TBB_INCLUDE_DIR}")
set (3RDPARTY_TBB_INCLUDE_DIR "${TBB_INCLUDE_DIR}" CACHE PATH "The directory containing headers of the TBB" FORCE)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
endif()
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()
# 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")
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_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_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()
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
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")
# Achive *.lib files and directory containing it.
get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_RELEASE)
# Reserve cache variable for *.lib.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.lib)")
endif()
# Reserve cache variable for directory containing *.lib file.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.lib)")
endif()
if (EXISTS "${TBB_LIB_FILE}")
set (3RDPARTY_${LIB_UPPER}_LIBRARY
"${TBB_LIB_FILE}"
CACHE FILEPATH
"${LIB_UPPER} library (*.lib)"
FORCE)
get_filename_component (TBB_LIB_FILE_DIRECTORY "${TBB_LIB_FILE}" DIRECTORY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR
"${TBB_LIB_FILE_DIRECTORY}"
CACHE PATH
"The directory containing ${LIB_UPPER} library (*.lib)"
FORCE)
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIB_UPPER}_LIBRARY_DIR}")
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()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# Achive *.dll files and directory containing it.
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Reserve cache variable for *.dll.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL)
set (3RDPARTY_${LIB_UPPER}_DLL "" CACHE FILEPATH "${LIB_UPPER} library (*.dll)")
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()
# Reserve cache variable for directory containing *.dll file.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL_DIR)
set (3RDPARTY_${LIB_UPPER}_DLL_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.dll)")
endif()
if (EXISTS "${TBB_DLL_FILE}")
set (3RDPARTY_${LIB_UPPER}_DLL
"${TBB_DLL_FILE}"
CACHE FILEPATH
"${LIB_UPPER} library (*.dll)"
FORCE)
get_filename_component (TBB_DLL_FILE_DIRECTORY "${TBB_DLL_FILE}" DIRECTORY)
set (3RDPARTY_${LIB_UPPER}_DLL_DIR
"${TBB_DLL_FILE_DIRECTORY}"
CACHE PATH
"The directory containing ${LIB_UPPER} library (*.dll)"
FORCE)
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${LIB_UPPER}_DLL_DIR}")
endif()
endif()
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
if (${COMPILER_BITNESS} EQUAL 32)
set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME ia32)
else()
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()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${LIB_UPPER}_DLL_DIR)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
endif()
# install *.dll (tbb & tbbmalloc)
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
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()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
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()
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()
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()
# 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()
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")
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()
mark_as_advanced (3RDPARTY_${LIB_UPPER}_LIBRARY 3RDPARTY_${LIB_UPPER}_DLL)
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the *.dll/*.so* directory for using by the executable
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
endif()
else()
message (FATAL_ERROR "Installation directory with TBB is not exist.")
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()
else ()
# NOT WIN32 branch
if ((DEFINED 3RDPARTY_DIR) AND (NOT "${3RDPARTY_DIR}" STREQUAL "") AND (EXISTS "${3RDPARTY_DIR}"))
# Here, we have correct 3RDPARTY_DIR.
# Trying to specify TBB folder in connection with 3RDPARTY_DIR
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
if (TBB_DIR_NAME)
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
# 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()
endif()
if ((NOT "${3RDPARTY_TBB_DIR}" STREQUAL "") AND (EXISTS "${3RDPARTY_TBB_DIR}"))
# Find TBB 2021.5 in existing directory.
find_package (
TBB 2021.5
PATHS "${3RDPARTY_TBB_DIR}" NO_DEFAULT_PATH
REQUIRED
CONFIG)
else()
# Find TBB 2021.5 in system directory.
find_package (
TBB 2021.5
REQUIRED
CONFIG)
endif()
else()
# Find TBB 2021.5 in system directory.
find_package (
TBB 2021.5
REQUIRED
CONFIG)
endif()
# TBB has been configured (in other case FATAL_ERROR occures).
# Achive include directory.
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
endif()
if (EXISTS "${TBB_INCLUDE_DIR}")
set (3RDPARTY_TBB_INCLUDE_DIR "${TBB_INCLUDE_DIR}" CACHE PATH "The directory containing headers of the TBB" FORCE)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
endif()
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
# Achive *.so files and directory containing it.
get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Reserve cache variable for *.so.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.so)")
endif()
# Reserve cache variable for directory containing *.so file.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.so)")
endif()
if (EXISTS "${TBB_SO_FILE}")
set (3RDPARTY_${LIB_UPPER}_LIBRARY
"${TBB_SO_FILE}"
CACHE FILEPATH
"${LIB_UPPER} library (*.so)"
FORCE)
get_filename_component (TBB_SO_FILE_DIRECTORY "${TBB_SO_FILE}" DIRECTORY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR
"${TBB_SO_FILE_DIRECTORY}"
CACHE PATH
"The directory containing ${LIB_UPPER} library (*.so)"
FORCE)
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIB_UPPER}_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# install *.so* (tbb & tbbmalloc)
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY} NAME)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
else()
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")
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 *.so* directory for using by the executable
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
# 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()
#endif()

View File

@@ -116,7 +116,6 @@ endmacro()
BUILD_MODULE_MESSAGE (BUILD_MODULE_ApplicationFramework "ApplicationFramework")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DataExchange "DataExchange")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DETools "DETools")
BUILD_MODULE_MESSAGE (BUILD_MODULE_Draw "Draw")
BUILD_MODULE_MESSAGE (BUILD_MODULE_FoundationClasses "FoundationClasses")
BUILD_MODULE_MESSAGE (BUILD_MODULE_ModelingAlgorithms "ModelingAlgorithms")

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

@@ -33,7 +33,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
@@ -167,7 +166,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="OFF" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^

View File

@@ -27,7 +27,6 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_MODULE_DETools=OFF"
rem Optional 3rd-party libraries to enable
rem set "USE_RAPIDJSON=ON"

View File

@@ -33,7 +33,6 @@ rem set BUILD_PATCH=
rem set BUILD_MODULE_ApplicationFramework=ON
rem set BUILD_MODULE_DataExchange=ON
rem set BUILD_MODULE_DETools=OFF
rem set BUILD_MODULE_Draw=ON
rem set BUILD_MODULE_ModelingAlgorithms=ON
rem set BUILD_MODULE_ModelingData=ON

View File

@@ -26,7 +26,6 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
#BUILD_MODULE_ApplicationFramework=ON
#BUILD_MODULE_DataExchange=ON
#BUILD_MODULE_DETools=OFF
#BUILD_MODULE_Draw=ON
#BUILD_MODULE_ModelingAlgorithms=ON
#BUILD_MODULE_ModelingData=ON

View File

@@ -28,7 +28,6 @@ set BUILD_FORCE_RelWithDebInfo=OFF
set BUILD_MODULE_ApplicationFramework=ON
set BUILD_MODULE_DataExchange=ON
set BUILD_MODULE_DETools=OFF
set BUILD_MODULE_Draw=ON
set BUILD_MODULE_ModelingAlgorithms=ON
set BUILD_MODULE_ModelingData=ON
@@ -63,7 +62,6 @@ cmake -G "%arch_compile%" ^
-D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
-D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
-D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
-D BUILD_MODULE_DETools:BOOL=%BUILD_MODULE_DETools% ^
-D BUILD_MODULE_Draw:BOOL=%BUILD_MODULE_Draw% ^
-D BUILD_MODULE_FoundationClasses:BOOL=ON ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^

View File

@@ -31,7 +31,6 @@ BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
BUILD_MODULE_ApplicationFramework=ON
BUILD_MODULE_DataExchange=ON
BUILD_MODULE_DETools=OFF
BUILD_MODULE_Draw=ON
BUILD_MODULE_ModelingAlgorithms=ON
BUILD_MODULE_ModelingData=ON
@@ -64,7 +63,6 @@ cmake -G "Unix Makefiles" \
-D BUILD_LIBRARY_TYPE:STRING=$BUILD_LIBRARY_TYPE \
-D BUILD_MODULE_ApplicationFramework:BOOL=$BUILD_MODULE_ApplicationFramework \
-D BUILD_MODULE_DataExchange:BOOL=$BUILD_MODULE_DataExchange \
-D BUILD_MODULE_DETools:BOOL=$BUILD_MODULE_DETools \
-D BUILD_MODULE_Draw:BOOL=$BUILD_MODULE_Draw \
-D BUILD_MODULE_FoundationClasses:BOOL=ON \
-D BUILD_MODULE_ModelingAlgorithms:BOOL=$BUILD_MODULE_ModelingAlgorithms \

View File

@@ -34,7 +34,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
export USE_FREETYPE=ON
export USE_FREEIMAGE=OFF
@@ -149,7 +148,6 @@ function buildArch {
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-D BUILD_MODULE_Draw:BOOL="OFF" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"

View File

@@ -20,7 +20,6 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON

View File

@@ -34,7 +34,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
export BUILD_Draw=ON
export USE_FREETYPE=ON
@@ -146,7 +145,6 @@ function buildArch {
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-D BUILD_MODULE_Draw:BOOL="${BUILD_Draw}" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"

View File

@@ -19,7 +19,6 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export BUILD_Draw=ON
#export USE_RAPIDJSON=ON

View File

@@ -32,7 +32,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
set "BUILD_Draw=ON"
rem Optional 3rd-party libraries to enable
@@ -156,7 +155,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^

View File

@@ -22,7 +22,6 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_DETools=OFF"
rem set "BUILD_Draw=ON"
rem set "USE_RAPIDJSON=ON"

View File

@@ -32,7 +32,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
set "BUILD_Draw=OFF"
rem Optional 3rd-party libraries to enable
@@ -176,7 +175,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^

View File

@@ -20,7 +20,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
. "${aScriptDir}/wasm_custom.sh"
@@ -75,7 +74,6 @@ echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
@@ -94,7 +92,6 @@ cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"

View File

@@ -23,7 +23,6 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_DETools=OFF"
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"

View File

@@ -14,4 +14,3 @@ export EMSDK_ROOT="$aSrcRoot/../emsdk"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF

View File

@@ -45,7 +45,6 @@ user_guides/visualization/visualization.md
user_guides/iges/iges.md
user_guides/step/step.md
user_guides/xde/xde.md
user_guides/de_wrapper/de_wrapper.md
user_guides/ocaf/ocaf.md
user_guides/draw_test_harness/draw_test_harness.md
user_guides/inspector/inspector.md

View File

@@ -20,7 +20,6 @@ user_guides/vis/vis.md
user_guides/iges/iges.md
user_guides/step/step.md
user_guides/xde/xde.md
user_guides/de_wrapper/de_wrapper.md
user_guides/inspector/inspector.md
user_guides/draw_test_harness/draw_test_harness.md

View File

@@ -128,9 +128,8 @@ You can download its sources from https://freetype.org/
@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.
@@ -305,9 +304,9 @@ Download the necessary archive from https://freetype.org/ and unpack it.
@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
@@ -478,9 +477,9 @@ Download the necessary archive from https://freetype.org/ and unpack it.
@subsection dev_guides__building_3rdparty_osx_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 Mac OS X platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-mac.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 (e.g. `tbb30_018oss`) and pick the archive for Mac OS X platform.
To install, unpack the downloaded archive of TBB product (`tbb30_018oss_osx.tgz`).
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage

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

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 |
@@ -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

@@ -2338,8 +2338,3 @@ or to include system OpenGL headers in advance (with help of `OpenGl_GlNative.hx
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

@@ -1,413 +0,0 @@
Data Exchange Wrapper (DE_Wrapper) {#occt_user_guides__de_wrapper}
============================
@tableofcontents
@section occt_de_wrapper_1 Introduction
This guide explains how to use the **Data Exchange Wrapper** (DE Wrapper).
It provides basic directions on setup, usage and file creation via DE_Wrapper.
The Data Exchange Wrapper (DE Wrapper) module allows reading and writing supported CAD formats to shape objects or special XDE documents, setting up the transfer process for all CAD files.
It is also possible to add support for new CAD formats by prototyping existing tools.
The DE Wrapper component requires @ref occt_user_guides__xde "XDE" toolkit for operation.
This guide mainly explains how to convert CAD files to Open CASCADE Technology (OCCT) shapes and vice versa.
This guide principally deals with the following OCCT classes:
* The Provider class, which loads CAD files and translates their contents to OCCT shapes or XDE documents, or translates OCCT shapes or XDE documents to CAD entities and then writes those entities to a CAD file.
* The Configuration class, which contains all information for the transfer process, such as the units, tolerance, and all internal information for the OCC readers or writers.
* The wrapper class, which contains all loaded configuration objects with own CAD format, reads or writes CAD files in the format derived from file extension or contents and saves or loads configuration settings for loaded configuration objects.
@section occt_de_wrapper_2 Supported CAD formats
| CAD format | Extensions | RW support | Thread Safety | Presentation | Package |
| :--------- | :--------- | :--------- | :----------- | :----------- | :------ |
| STEP | .stp, .step .stepz | RW | No | BRep, Mesh | STEPCAFControl |
| XCAF | .xbf | RW | Yes | BRep, Mesh | DEXCAFCascade |
| BREP | .brep | RW | Yes | BRep, Mesh | DEBRepCascade |
| IGES | .igs, .iges | RW | No | BRep | IGESCAFControl |
| OBJ | .obj | RW | Yes | Mesh | RWObj |
| STL | .stl | RW | Yes | Mesh | RWStl |
| PLY | .ply | W | Yes | Mesh | RWPly |
| GLTF | .glTF .glb | RW | Yes | Mesh | RWGltf |
| VRML | .wrl .vrml | RW | Yes | Mesh | Vrml |
**Note** :
* The format names in the first column match the FormatName values used for configuration nodes.
* The VendorName for all listed CAD formats is "OCC".
@section occt_de_wrapper_3 DE Session Configuration
Any providers can have their own read/write parameters. The transfer process is set up using DE configuration nodes, which hold all relevant parameters. There are two ways to change the parameter values: directly from code or by an external resource file/string.
The session is a global or static DE_Wrapper object that stores registered DE configuration nodes and wraps DE commands to work with them. It has some configuration parameters of its own and also keeps track of loaded nodes and specilal global parameters.
@subsection occt_de_wrapper_3_1 Getting a DE session. Code sample
Working with a DE session requires a DE_Wrapper object to be loaded or created first.
Getting the global DE_Wrapping object:
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
~~~~
Creating a local DE_Wrapper:
~~~~{.cpp}
Handle(DE_Wrapper) aSession = new DE_Wrapper();
~~~~
It is recommended to create a local one-time copy to work with the session, if no global changes are intended.
~~~~{.cpp}
Handle(DE_Wrapper) aOneTimeSession = aSession->Copy();
~~~~
@subsection occt_de_wrapper_3_2 Configuration resource
Configuration resource is an external file or string of the following format:
~~~~{.cpp}
global.priority.STEP : OCC DTK
global.general.length.unit : 1
provider.STEP.OCC.read.precision.val : 0.0001
~~~~
@subsubsection occt_de_wrapper_3_2_1 Configuration resource: graph of scopes
* **global.** is a scope of global parameters
* **priority.** is a scope of priority to use vendors with their providers.
* **general.** is a scope of global configuration parameter values
* <strong>"..."</strong> is an internal configuration with any internal scopes
* <strong>". : "</strong> is a separator of key-value
* __...__ parameter value, can't contain new line symbols.
* **provider.** is a scope of configuration providers
* **STEP.** is a scope of CAD format to configure
* **OCC.** is a scope of a vendor or provider
* <strong>"..."</strong> is an internal configuration with any internal scopes
* <strong>". : "</strong> is a separator of key-value
* <strong>"..."</strong> parameter value, can't contain new line symbols.
@subsubsection occt_de_wrapper_3_2_2 Loading configuration resources. Configuring DE Session
The resource should be loaded after the registration of all providers that should be configured. The resource only impacts registered parameters. To configure a new registered provider it is necessary to load the resource again. Parameters not present in the resource will remain unchanged.
There are two ways to check what parameters are available:
* C++: Open ConfigureNode file and check the InternalParameter field. Each parameter will be described with a comment. To check the global parameters, use the DE_Wrapper class public methods.
* Resource: Register all available Nodes to the session, then save the configuration and view all existing parameters.
There are two options for loading a resource: recursive and global parameters only. Recursive is the default option to configure all global parameters (units, priority, enable status) and all registered providers. Non-recursive configures only global parameters and ignores all provider settings. This option is the best for updating provider priority.
@subsubsection occt_de_wrapper_3_2_3 Loading configuration resources. Code sample
Configuring using a resource string:
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aString =
"global.priority.STEP : OCC DTK\n"
"global.general.length.unit : 1\n"
"provider.STEP.OCC.read.precision.val : 0.\n";
Standard_Boolean aIsRecursive = Standard_True;
if (!aSession->Load(aString, aIsRecursive))
{
Message::SendFail() << "Error: configuration is incorrect";
}
~~~~
Configuring using a resource file:
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "";
Standard_Boolean aIsRecursive = Standard_True;
if (!aSession->Load(aPathToFile, aIsRecursive))
{
Message::SendFail() << "Error: configuration is incorrect";
}
~~~~
@subsubsection occt_de_wrapper_3_2_4 Loading configuration resources. DRAW sample
Configuring using a resource string:
~~~~{.cpp}
set conf "
global.priority.STEP : OCC
global.general.length.unit : 1
provider.STEP.OCC.read.iges.bspline.continuity : 1
provider.STEP.OCC.read.precision.mode : 0
provider.STEP.OCC.read.precision.val : 0.0001
"
LoadConfiguration ${conf} -recursive on
~~~~
Configuring using a resource file:
~~~~{.cpp}
set pathToFile ""
LoadConfiguration ${pathToFile} -recursive on
~~~~
@subsubsection occt_de_wrapper_3_2_5 Saving configuration resources. Dump of configuration DE Session
Saving the configuration of a DE Session involves dumping all parameters of registered providers.
If a parameter did not change during the session, its value remains as default.
There are two ways to save a resource: recursive and global parameters only. Recursive is the way to dump all registered provider information. Non-recursive dumps only global parameters, for example, save priority of vendors or the length unit.
It is possible to filter what vendors or providers to save by providing the correct name of the vendor or provider.
@subsubsection occt_de_wrapper_3_2_6 Saving configuration resources. Code sample
Dump to resource string. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TColStd_ListOfAsciiString aFormats;
TColStd_ListOfAsciiString aVendors;
aFormats.Appends("STEP");
aVendors.Appends("OCC");
Standard_Boolean aIsRecursive = Standard_True;
TCollection_AsciiString aConf = aSession->aConf->Save(aIsRecursive, aFormats, aVendors);
~~~~
Configure using a resource file. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "";
TColStd_ListOfAsciiString aFormats;
TColStd_ListOfAsciiString aVendors;
aFormats.Appends("STEP");
aVendors.Appends("OCC");
Standard_Boolean aIsRecursive = Standard_True;
if (!aSession->Save(aPathToFile, aIsRecursive, aFormats,aVendors))
{
Message::SendFail() << "Error: configuration is not saved";
}
~~~~
@subsubsection occt_de_wrapper_3_2_7 Saving configuration resources. DRAW sample
Dump configuration to string. If no list of vendors is passed or it is empty, all vendors are saved. If no providers list is passed or it is empty, all providers of valid vendors are saved.
~~~~{.cpp}
set vendors "OCC"
set format "STEP"
set dump_conf [DumpConfiguration -recursive on -format ${format} -vendor ${vendors}]
~~~~
Dump configuration to file. If no vendors list are set as an argument or it is empty, saves all vendors. If no providers list as argument or it is empty, saves all providers of valid vendors:
~~~~{.cpp}
set vendors "OCC"
set format "STEP"
set pathToFile ""
DumpConfiguration -path ${pathToFile} -recursive on -format ${format} -vendor ${vendors}
~~~~
@subsection occt_de_wrapper_3_3 Registering providers
To transfer a CAD file using DE Wrapper, it is necessary to register a CAD provider.
The provider contains internal and global parameters that have default values in the creation stage.
All registered providers are set to the map with information about its vendor and kept as smart handles. Therefore, it is possible to change the values via handle from external code.
@subsubsection occt_de_wrapper_3_3_1 Registering providers. Code sample
It is nesessary to register only one ConfigurationNode for all needed formats.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
Handle(DE_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
aSession->Bind(aNode);
~~~~
@subsubsection occt_de_wrapper_3_3_2 Registering providers. DRAW Sample
Use DRAW with all providers registered by the following command:
~~~~{.cpp}
pload XDE
~~~~
@subsubsection occt_de_wrapper_3_3_3 Realtime initialization. Code sample
It is possible to change a paramater from code using a smart pointer.
~~~~{.cpp}
// global variable
static Handle(STEPCAFControl_ConfigurationNode) THE_STEP_NODE;
static Handle(DE_ConfigurationNode) RegisterStepNode()
{
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
if (!THE_STEP_NODE.IsNull())
{
return THE_STEP_NODE;
}
THE_STEP_NODE = new STEPCAFControl_ConfigurationNode();
aSession->Bind(THE_STEP_NODE);
return THE_STEP_NODE;
}
// Change parameter value
THE_STEP_NODE->InternalParameters.ReadRelationship = false;
THE_STEP_NODE->InternalParameters.ReadName = false;
THE_STEP_NODE->InternalParameters.ReadProps = false;
~~~~
@subsection occt_de_wrapper_3_4 Priority of Vendors
DE session is able to work with several vendors with the same supported CAD format. To choose the preffered vendor for each format, use a special priority list.
If the high priority vendor's provider is not supported, a transfer operation is needed (write/read), then the next vendor will be chosen.
@subsubsection occt_de_wrapper_3_4_1 Priority of Vendors. Code sample
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aFormat = "STEP";
TColStd_ListOfAsciiString aVendors;
aVendors.Appends("OCC"); // high priority
aVendors.Appends("DTK");
// Flag to disable not choosen vendors, in this case configuration is possible
// otherwise, lower their priority and continue to check ability to transfer
Standard_Boolean aToDisable = Standard_True;
aSession->ChangePriority(aFormat, aVendors, aToDisable);
~~~~
@subsubsection occt_de_wrapper_3_4_2 Priority of Vendors. DRAW Sample
It is recommended to disable recursion and update only global parameters.
~~~~{.cpp}
set conf "
global.priority.STEP : OCC DTK
"
LoadConfiguration ${conf} -recursive off
~~~~
@section occt_de_wrapper_4 Transfer of CAD files
To transfer from a CAD file to OCC or from OCC to a CAD file, it is necessary to use a configured DE_Wrapper object. It can be local, one-time or global. Global configuration of DE_Wrapper propagates to all nodes via transfer. There are two options for transferring: using OCC shape or XCAF document. It is possible to work only with real path to/from the file. Streaming is not supported (yet).
The format of input/output file is automatically determined by its extension or contents.
@subsection occt_de_wrapper_4_1 Transfer of CAD files. Code samples
Reading STEP file to Shape.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
TopoDS_Shape aShRes;
if (!aSession->Read(aPathToFile, aShRes))
{
Message::SendFail() << "Error: Can't read file";
}
~~~~
Writing Shape to STEP file.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
TopoDS_Shape aShFrom = ...;
if (!aSession->Write(aPathToFile, aShRes))
{
Message::SendFail() << "Error: Can't write file";
}
~~~~
Reading STEP file into XCAF document.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
Handle(TDocStd_Document) aDoc = ...;
if (!aSession->Read(aPathToFile, aDoc))
{
Message::SendFail() << "Error: Can't read file";
}
~~~~
Writing XCAF document into STEP.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
Handle(TDocStd_Document) aDoc = ...;
if (!aSession->Write(aPathToFile, aDoc))
{
Message::SendFail() << "Error: Can't write file";
}
~~~~
@subsection occt_de_wrapper_4_2 Transfer of CAD files. DRAW samples
Reading a STEP file into a Shape.
~~~~{.cpp}
set fileName "sample.stp"
readfile shape ${fileName}
~~~~
Writing a Shape into STEP.
~~~~{.cpp}
set fileName "sample.stp"
writefile shape ${fileName}
~~~~
Reading STEP into XCAF document.
~~~~{.cpp}
set fileName "sample.stp"
ReadFile D ${fileName}
~~~~
Writing XCAF document into STEP.
~~~~{.cpp}
set fileName "sample.stp"
WriteFile D ${fileName}
~~~~
@subsection occt_de_wrapper_4_3 Transfer using DE Provider. Code sample
It is possible to read and write CAD files directly from a special provider.
~~~~{.cpp}
// Creating or getting node
Handle(STEPCAFControl_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
// Creationg an one-time provider
Handle(DE_Provider) aProvider = aNode->BuildProvider();
// Setting configuration with all parameters
aProvider->SetNode(aNode);
if (!aProvider->Read(...))
{
Message::SendFail() << "Error: Can't read STEP file";
}
if (!aProvider->Write(...))
{
Message::SendFail() << "Error: Can't write STEP file";
}
~~~~
@subsection occt_de_wrapper_4_4 Temporary configuration via transfer
It is possible to change the configuration of only one transfer operation. To avoid changing parameters in a session, one-time clone of the session can be created and used for transfer. This way is recommended for use in multithreaded mode.
@subsubsection occt_de_wrapper_4_4_1 Temporary configuration via transfer. Code sample
Code sample to configure via transfer.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper()->Copy();
TCollection_AsciiString aString =
"global.priority.STEP : OCC DTK\n"
"global.general.length.unit : 1\n"
"provider.STEP.OCC.read.precision.val : 0.\n";
if (!aSession->Load(aString, aIsRecursive))
{
Message::SendFail() << "Error: configuration is incorrect";
}
TCollection_AsciiString aPathToFile = "example.stp";
TopoDS_Shape aShRes;
if (!aSession->Read(aPathToFile, aShRes))
{
Message::SendFail() << "Error: Can't read file";
}
~~~~
@subsubsection occt_de_wrapper_4_4_2 Temporary configuration via transfer. DRAW sample
Code sample to configure via transfer within DRAW command.
~~~~{.cpp}
set fileName "sample.stp"
readfile S5 $filename -conf "global.general.length.unit : 1000 "
~~~~
Code sample to configure via transfer as variable.
~~~~{.cpp}
set fileName "sample.stp"
set conf "
global.priority.STEP : OCC
global.general.length.unit : 1
provider.STEP.OCC.read.iges.bspline.continuity : 1
provider.STEP.OCC.read.precision.mode : 0
provider.STEP.OCC.read.precision.val : 0.0001
"
readfile S5 $filename -conf ${conf}
~~~~

View File

@@ -1331,7 +1331,7 @@ Therefore if the user of *NCollection* does not specify any allocator as a param
Nevertheless, it is possible to define a custom *Allocator* type to manage the memory in the most optimal or convenient way for this algorithm.
As one possible choice, the class *NCollection_IncAllocator* is included.
Unlike *NCollection_BaseAllocator*, the memory is allocated in big blocks (about 12kB) and the allocator keeps track of the amount of occupied memory.
Unlike *NCollection_BaseAllocator*, the memory is allocated in big blocks (about 20kB) and the allocator keeps track of the amount of occupied memory.
The method *Allocate* just increments the pointer to non-occupied memory and returns its previous value.
Memory is only released in the destructor of *NCollection_IncAllocator*, the method *Free* is empty.
If used properly, this Allocator can greatly improve the performance of specific algorithms.

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:

View File

@@ -13,7 +13,6 @@ OCCT User Guides are organized by OCCT modules:
* @subpage occt_user_guides__iges "IGES Translator"
* @subpage occt_user_guides__step "STEP Translator"
* @subpage occt_user_guides__xde "Extended Data Exchange (XDE)"
* @subpage occt_user_guides__de_wrapper "Data Exchange Wrapper (DE Wrapper)"
* @subpage occt_user_guides__ocaf "Open CASCADE Application Framework (OCAF)"
* @subpage occt_user_guides__test_harness "DRAW Test Harness"
* @subpage occt_user_guides__inspector "Inspector"

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

@@ -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

@@ -221,7 +221,7 @@ Handle(TopTools_HSequenceOfShape) Translate::importModel( const int format, cons
shapes = importSTEP( file );
break;
}
} catch ( const Standard_Failure& ) {
} catch ( Standard_Failure ) {
shapes.Nullify();
}
return shapes;
@@ -256,7 +256,7 @@ bool Translate::exportModel( const int format, const QString& file, const Handle
case FormatSTL: return exportSTL ( file, shapes );
case FormatVRML: return exportVRML( file, shapes );
}
} catch ( const Standard_Failure& ) {
} catch ( Standard_Failure ) {
//
}
return false;
@@ -528,26 +528,26 @@ bool Translate::exportSTL( const QString& file, const Handle(TopTools_HSequenceO
if ( shapes.IsNull() || shapes->IsEmpty() )
return false;
TopoDS_Compound res;
BRep_Builder builder;
builder.MakeCompound( res );
TopoDS_Compound res;
BRep_Builder builder;
builder.MakeCompound( res );
for ( int i = 1; i <= shapes->Length(); i++ )
{
TopoDS_Shape shape = shapes->Value( i );
if ( shape.IsNull() )
{
myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" );
return false;
for ( int i = 1; i <= shapes->Length(); i++ )
{
TopoDS_Shape shape = shapes->Value( i );
if ( shape.IsNull() )
{
myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" );
return false;
}
builder.Add( res, shape );
}
builder.Add( res, shape );
}
StlAPI_Writer writer;
StlAPI_Writer writer;
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
writer.Write( res, anUtf8Path.ToCString() );
writer.Write( res, anUtf8Path.ToCString() );
return true;
}
@@ -557,26 +557,26 @@ bool Translate::exportVRML( const QString& file, const Handle(TopTools_HSequence
if ( shapes.IsNull() || shapes->IsEmpty() )
return false;
TopoDS_Compound res;
BRep_Builder builder;
builder.MakeCompound( res );
TopoDS_Compound res;
BRep_Builder builder;
builder.MakeCompound( res );
for ( int i = 1; i <= shapes->Length(); i++ )
{
TopoDS_Shape shape = shapes->Value( i );
if ( shape.IsNull() )
{
myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" );
return false;
for ( int i = 1; i <= shapes->Length(); i++ )
{
TopoDS_Shape shape = shapes->Value( i );
if ( shape.IsNull() )
{
myInfo = QObject::tr( "INF_TRANSLATE_ERROR_INVALIDSHAPE" );
return false;
}
builder.Add( res, shape );
}
builder.Add( res, shape );
}
VrmlAPI_Writer writer;
VrmlAPI_Writer writer;
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
const TCollection_AsciiString anUtf8Path (file.toUtf8().data());
writer.Write( res, anUtf8Path.ToCString() );
writer.Write( res, anUtf8Path.ToCString() );
return true;
}

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

@@ -1,51 +0,0 @@
// Copyright (c) 2023 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 <AIS_AnimationAxisRotation.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
//=============================================================================
//function : Constructor
//purpose :
//=============================================================================
AIS_AnimationAxisRotation::AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
const gp_Ax1& theAxis,
const Standard_Real theAngleStart,
const Standard_Real theAngleEnd)
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
myRotAxis (theAxis),
myAngleStart (theAngleStart),
myAngleEnd (theAngleEnd)
{
//
}
//=============================================================================
//function : update
//purpose :
//=============================================================================
void AIS_AnimationAxisRotation::update (const AIS_AnimationProgress& theProgress)
{
if (myObject.IsNull())
{
return;
}
gp_Trsf aTrsf;
Standard_Real aCurrentAngle = (1.0 - theProgress.LocalNormalized) * myAngleStart + theProgress.LocalNormalized * myAngleEnd;
aTrsf.SetRotation (myRotAxis, aCurrentAngle);
updateTrsf (aTrsf);
}

View File

@@ -1,53 +0,0 @@
// Copyright (c) 2023 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 _AIS_AnimationAxisRotation_HeaderFile
#define _AIS_AnimationAxisRotation_HeaderFile
#include <AIS_BaseAnimationObject.hxx>
#include <gp_TrsfNLerp.hxx>
//! Animation defining object transformation.
class AIS_AnimationAxisRotation : public AIS_BaseAnimationObject
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
public:
//! Constructor with initialization.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply rotation
//! @param[in] theAxis rotation axis
//! @param[in] theAngleStart rotation angle at the start of animation
//! @param[in] theAngleEnd rotation angle at the end of animation
Standard_EXPORT AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
const gp_Ax1& theAxis,
const Standard_Real theAngleStart,
const Standard_Real theAngleEnd);
protected:
//! Update the progress.
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
private:
gp_Ax1 myRotAxis; //!< rotation axis
Standard_Real myAngleStart; //!< start angle for rotation
Standard_Real myAngleEnd; //!< end angle for rotation
};
#endif // _AIS_AnimationAxisRotation_HeaderFile

View File

@@ -14,7 +14,10 @@
#include <AIS_AnimationObject.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_BaseAnimationObject)
#include <AIS_InteractiveContext.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)
//=============================================================================
//function : Constructor
@@ -25,7 +28,9 @@ AIS_AnimationObject::AIS_AnimationObject (const TCollection_AsciiString& theAnim
const Handle(AIS_InteractiveObject)& theObject,
const gp_Trsf& theTrsfStart,
const gp_Trsf& theTrsfEnd)
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
: AIS_Animation (theAnimationName),
myContext (theContext),
myObject (theObject),
myTrsfLerp (theTrsfStart, theTrsfEnd)
{
//
@@ -44,5 +49,52 @@ void AIS_AnimationObject::update (const AIS_AnimationProgress& theProgress)
gp_Trsf aTrsf;
myTrsfLerp.Interpolate (theProgress.LocalNormalized, aTrsf);
updateTrsf (aTrsf);
if (!myContext.IsNull())
{
myContext->SetLocation (myObject, aTrsf);
invalidateViewer();
}
else
{
myObject->SetLocalTransformation (aTrsf);
}
}
//=============================================================================
//function : invalidateViewer
//purpose :
//=============================================================================
void AIS_AnimationObject::invalidateViewer()
{
if (myContext.IsNull())
{
return;
}
const Standard_Boolean isImmediate = myContext->CurrentViewer()->ZLayerSettings (myObject->ZLayer()).IsImmediate();
if (!isImmediate)
{
myContext->CurrentViewer()->Invalidate();
return;
}
// Invalidate immediate view only if it is going out of z-fit range.
// This might be sub-optimal performing this for each animated objects in case of many animated objects.
for (V3d_ListOfView::Iterator aDefViewIter = myContext->CurrentViewer()->DefinedViewIterator();
aDefViewIter.More(); aDefViewIter.Next())
{
const Handle(V3d_View)& aView = aDefViewIter.Value();
const Bnd_Box aMinMaxBox = aView->View()->MinMaxValues (Standard_False);
const Bnd_Box aGraphicBox = aView->View()->MinMaxValues (Standard_True);
Standard_Real aZNear = 0.0;
Standard_Real aZFar = 0.0;
if (aView->Camera()->ZFitAll (aDefViewIter.Value()->AutoZFitScaleFactor(), aMinMaxBox, aGraphicBox, aZNear, aZFar))
{
if (aZNear < aView->Camera()->ZNear()
|| aZFar > aView->Camera()->ZFar())
{
aDefViewIter.Value()->Invalidate();
}
}
}
}

View File

@@ -15,23 +15,24 @@
#ifndef _AIS_AnimationObject_HeaderFile
#define _AIS_AnimationObject_HeaderFile
#include <AIS_BaseAnimationObject.hxx>
#include <AIS_Animation.hxx>
#include <AIS_InteractiveContext.hxx>
#include <gp_TrsfNLerp.hxx>
//! Animation defining object transformation.
class AIS_AnimationObject : public AIS_BaseAnimationObject
class AIS_AnimationObject : public AIS_Animation
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_BaseAnimationObject)
DEFINE_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)
public:
//! Constructor with initialization.
//! Note that start/end transformations specify exactly local transformation of the object,
//! not the transformation to be applied to existing local transformation.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply local transformation
//! @param[in] theTrsfStart local transformation at the start of animation (e.g. theObject->LocalTransformation())
//! @param[in] theTrsfEnd local transformation at the end of animation
//! @param theAnimationName animation identifier
//! @param theContext interactive context where object have been displayed
//! @param theObject object to apply local transformation
//! @param theTrsfStart local transformation at the start of animation (e.g. theObject->LocalTransformation())
//! @param theTrsfEnd local transformation at the end of animation
Standard_EXPORT AIS_AnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
@@ -43,10 +44,17 @@ protected:
//! Update the progress.
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
private:
//! Invalidate the viewer for proper update.
Standard_EXPORT void invalidateViewer();
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
protected:
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
};
DEFINE_STANDARD_HANDLE(AIS_AnimationObject, AIS_Animation)
#endif // _AIS_AnimationObject_HeaderFile

View File

@@ -1,88 +0,0 @@
// Copyright (c) 2023 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 <AIS_BaseAnimationObject.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
//=============================================================================
//function : Constructor
//purpose :
//=============================================================================
AIS_BaseAnimationObject::AIS_BaseAnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject)
: AIS_Animation (theAnimationName),
myContext (theContext),
myObject (theObject)
{
//
}
//=============================================================================
//function : updateTrsf
//purpose :
//=============================================================================
void AIS_BaseAnimationObject::updateTrsf (const gp_Trsf& theTrsf)
{
if (!myContext.IsNull())
{
myContext->SetLocation (myObject, theTrsf);
invalidateViewer();
}
else
{
myObject->SetLocalTransformation (theTrsf);
}
}
//=============================================================================
//function : invalidateViewer
//purpose :
//=============================================================================
void AIS_BaseAnimationObject::invalidateViewer()
{
if (myContext.IsNull())
{
return;
}
const Standard_Boolean isImmediate = myContext->CurrentViewer()->ZLayerSettings (myObject->ZLayer()).IsImmediate();
if (!isImmediate)
{
myContext->CurrentViewer()->Invalidate();
return;
}
// Invalidate immediate view only if it is going out of z-fit range.
// This might be sub-optimal performing this for each animated objects in case of many animated objects.
for (V3d_ListOfView::Iterator aDefViewIter = myContext->CurrentViewer()->DefinedViewIterator();
aDefViewIter.More(); aDefViewIter.Next())
{
const Handle(V3d_View)& aView = aDefViewIter.Value();
const Bnd_Box aMinMaxBox = aView->View()->MinMaxValues (Standard_False);
const Bnd_Box aGraphicBox = aView->View()->MinMaxValues (Standard_True);
Standard_Real aZNear = 0.0;
Standard_Real aZFar = 0.0;
if (aView->Camera()->ZFitAll (aDefViewIter.Value()->AutoZFitScaleFactor(), aMinMaxBox, aGraphicBox, aZNear, aZFar))
{
if (aZNear < aView->Camera()->ZNear()
|| aZFar > aView->Camera()->ZFar())
{
aDefViewIter.Value()->Invalidate();
}
}
}
}

View File

@@ -1,49 +0,0 @@
// Copyright (c) 2023 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 _AIS_BaseAnimationObject_HeaderFile
#define _AIS_BaseAnimationObject_HeaderFile
#include <AIS_Animation.hxx>
#include <AIS_InteractiveContext.hxx>
//! Animation defining object transformation.
class AIS_BaseAnimationObject : public AIS_Animation
{
DEFINE_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
protected:
//! Constructor with initialization.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply local transformation
Standard_EXPORT AIS_BaseAnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject);
//! Update the transformation.
Standard_EXPORT void updateTrsf (const gp_Trsf& theTrsf);
private:
//! Invalidate the viewer for proper update.
Standard_EXPORT void invalidateViewer();
protected:
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
};
#endif // _AIS_BaseAnimationObject_HeaderFile

View File

@@ -56,7 +56,7 @@ AIS_C0RegularityFilter::AIS_C0RegularityFilter(const TopoDS_Shape& aShape)
}
}
if (Ok) {
const TopoDS_Shape& curEdge = SubShapes.FindKey( i );
TopoDS_Shape curEdge = SubShapes.FindKey( i );
myMapOfEdges.Add(curEdge);
}
}

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
@@ -945,7 +945,7 @@ void AIS_InteractiveContext::Redisplay (const AIS_KindOfInteractive theKOI,
Standard_Boolean isRedisplayed = Standard_False;
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
{
const Handle(AIS_InteractiveObject)& anObj = anObjIter.Key();
Handle(AIS_InteractiveObject) anObj = anObjIter.Key();
if (anObj->Type() != theKOI)
{
continue;
@@ -1001,14 +1001,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 +1010,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());
}
@@ -1155,7 +1150,7 @@ void AIS_InteractiveContext::SetDisplayMode(const Standard_Integer theMode,
continue;
}
const Handle(AIS_GlobalStatus)& aStatus = anObjIter.Value();
Handle(AIS_GlobalStatus) aStatus = anObjIter.Value();
aStatus->SetDisplayMode (theMode);
if (anObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
@@ -2251,7 +2246,7 @@ Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection (const Handle(V3d_View)&
for (AIS_MapIteratorOfMapOfObjectOwners anIter (anObjectOwnerMap); anIter.More(); anIter.Next())
{
const Handle(SelectMgr_SelectableObject)& anObject = anIter.Key();
const Handle(SelectMgr_SelectableObject) anObject = anIter.Key();
Bnd_Box aTmpBox = anObject->BndBoxOfSelected (anIter.ChangeValue());
aBndSelected.Add (aTmpBox);
}
@@ -3228,30 +3223,6 @@ void AIS_InteractiveContext::ClearSelected (const Standard_Boolean theToUpdateVi
}
}
//=======================================================================
//function : isDetected
//purpose :
//=======================================================================
Standard_Boolean AIS_InteractiveContext::isDetected (const Handle(AIS_InteractiveObject)& theObject)
{
for (Standard_Integer aDetIter = myDetectedSeq.Lower(); aDetIter <= myDetectedSeq.Upper(); aDetIter++)
{
Handle(SelectMgr_EntityOwner) aPicked = MainSelector()->Picked(myDetectedSeq(aDetIter));
Handle(AIS_InteractiveObject) anObj;
if (!aPicked.IsNull())
{
anObj = Handle(AIS_InteractiveObject)::DownCast(aPicked->Selectable());
}
if (!anObj.IsNull()
&& anObj == theObject)
{
return Standard_True;
}
}
return Standard_False;
}
//=======================================================================
//function : SetSelected
//purpose : Sets the whole object as selected and highlights it with selection color
@@ -3312,8 +3283,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
}
// added to avoid untimely viewer update...
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
mySelection->ClearAndSelect (anOwner, myFilters, isDetected (anObj));
mySelection->ClearAndSelect (anOwner);
if (myAutoHilight)
{
@@ -3375,7 +3345,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
unhighlightSelected();
}
mySelection->ClearAndSelect (theOwner, myFilters, isDetected (anObject));
mySelection->ClearAndSelect (theOwner);
if (myAutoHilight)
{
Handle(Prs3d_Drawer) aCustomStyle;
@@ -3426,17 +3396,16 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
return;
}
if (!myFilters->IsOk (theOwner) && !theOwner->IsSelected())
if (!myFilters->IsOk(theOwner) && !theOwner->IsSelected())
{
return;
}
AIS_SelectionScheme aSelScheme = theOwner->IsSelected() ? AIS_SelectionScheme_Remove : AIS_SelectionScheme_Add;
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
mySelection->Select (theOwner, myFilters, aSelScheme, isDetected (anObj));
mySelection->Select (theOwner);
if (myAutoHilight)
{
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
{
@@ -3495,8 +3464,7 @@ Standard_Boolean AIS_InteractiveContext::SetSelectedState (const Handle(SelectMg
}
else
{
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast(theEntity->Selectable());
const AIS_SelectStatus aSelStatus = mySelection->Select (theEntity, myFilters, AIS_SelectionScheme_Remove, isDetected (anObj));
const AIS_SelectStatus aSelStatus = mySelection->Select (theEntity);
theEntity->SetSelected (false);
return aSelStatus == AIS_SS_Removed;
}

View File

@@ -1302,9 +1302,6 @@ protected: //! @name internal methods
Standard_EXPORT AIS_StatusOfDetection moveTo (const Handle(V3d_View)& theView,
const Standard_Boolean theToRedrawOnUpdate);
//! Returns True if the object is detected.
Standard_EXPORT Standard_Boolean isDetected (const Handle(AIS_InteractiveObject)& theObject);
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
Standard_EXPORT void unselectOwners (const Handle(AIS_InteractiveObject)& theObject);

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
@@ -1116,23 +1117,18 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
const Standard_Integer theMode)
{
//Check mode
const AIS_ManipulatorMode aMode = (AIS_ManipulatorMode) theMode;
AIS_ManipulatorMode aMode = (AIS_ManipulatorMode) theMode;
if (aMode == AIS_MM_None)
{
return;
}
Handle(SelectMgr_EntityOwner) anOwner;
// Sensitivity calculation for manipulator parts allows to avoid
// overlapping of sensitive areas when size of manipulator is small.
// Sensitivity is calculated relative to the default size of the manipulator (100.0f).
const Standard_ShortReal aSensitivityCoef = myAxes[0].Size() / 100.0f;
const Standard_Integer aHighSensitivity = Max (Min (RealToInt (aSensitivityCoef * 15), 15), 3); // clamp sensitivity within range [3, 15]
const Standard_Integer aLowSensitivity = Max (Min (RealToInt (aSensitivityCoef * 10), 10), 2); // clamp sensitivity within range [2, 10]
switch (aMode)
if (aMode == AIS_MM_None)
{
case AIS_MM_Translation:
anOwner = new SelectMgr_EntityOwner (this, 5);
}
if (aMode == AIS_MM_Translation || aMode == AIS_MM_None)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1141,21 +1137,23 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
continue;
}
const Axis& anAxis = myAxes[anIt];
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Translation, 9);
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Translation, 9);
}
// define sensitivity by line
Handle(Select3D_SensitiveSegment) aLine = new Select3D_SensitiveSegment(anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor (aHighSensitivity);
Handle(Select3D_SensitiveSegment) aLine = new Select3D_SensitiveSegment (anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor (15);
theSelection->Add (aLine);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitivePrimitiveArray) aTri = new Select3D_SensitivePrimitiveArray(anOwner);
Handle(Select3D_SensitivePrimitiveArray) aTri = new Select3D_SensitivePrimitiveArray (anOwner);
aTri->InitTriangulation (anAxis.TriangleArray()->Attributes(), anAxis.TriangleArray()->Indices(), TopLoc_Location());
theSelection->Add (aTri);
}
break;
}
case AIS_MM_Rotation:
if (aMode == AIS_MM_Rotation || aMode == AIS_MM_None)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1164,20 +1162,22 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
continue;
}
const Axis& anAxis = myAxes[anIt];
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Rotation, 9);
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Rotation, 9);
}
// 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);
aCircle->SetSensitivityFactor (aLowSensitivity);
theSelection->Add(aCircle);
const gp_Circ aGeomCircle (gp_Ax2 (gp::Origin(), anAxis.ReferenceAxis().Direction()), anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle (anOwner, aGeomCircle, anAxis.FacettesNumber());
aCircle->SetSensitivityFactor (15);
theSelection->Add (aCircle);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new ManipSensTriangulation(anOwner, myAxes[anIt].RotatorDisk().Triangulation(), anAxis.ReferenceAxis().Direction());
Handle(Select3D_SensitiveTriangulation) aTri = new ManipSensTriangulation (anOwner, myAxes[anIt].RotatorDisk().Triangulation(), anAxis.ReferenceAxis().Direction());
theSelection->Add (aTri);
}
break;
}
case AIS_MM_Scaling:
if (aMode == AIS_MM_Scaling || aMode == AIS_MM_None)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1185,19 +1185,21 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
{
continue;
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Scaling, 9);
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Scaling, 9);
}
// define sensitivity by point
Handle(Select3D_SensitivePoint) aPnt = new Select3D_SensitivePoint(anOwner, myAxes[anIt].ScalerCubePosition());
aPnt->SetSensitivityFactor (aHighSensitivity);
Handle(Select3D_SensitivePoint) aPnt = new Select3D_SensitivePoint (anOwner, myAxes[anIt].ScalerCubePosition());
aPnt->SetSensitivityFactor (15);
theSelection->Add (aPnt);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].ScalerCube().Triangulation(), TopLoc_Location(), Standard_True);
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation (anOwner, myAxes[anIt].ScalerCube().Triangulation(), TopLoc_Location(), Standard_True);
theSelection->Add (aTri);
}
break;
}
case AIS_MM_TranslationPlane:
if (aMode == AIS_MM_TranslationPlane || aMode == AIS_MM_None)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1205,33 +1207,28 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
{
continue;
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
}
// define sensitivity by two crossed lines
Standard_Real aSensitivityOffset = ZoomPersistence() ? aHighSensitivity * (0.5 + M_SQRT2) : 0.0;
gp_Pnt aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition().Translated (myAxes[((anIt + 2) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_Pnt aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition().Translated (myAxes[((anIt + 1) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_Pnt aP1, aP2;
aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition();
aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition();
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
gp_XYZ anOrig = aMidP.Normalized().Multiplied (aSensitivityOffset);
Handle(Select3D_SensitiveSegment) aLine1 = new Select3D_SensitiveSegment(anOwner, aP1, aP2);
aLine1->SetSensitivityFactor(aLowSensitivity);
theSelection->Add (aLine1);
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, anOrig, aMidP);
aLine2->SetSensitivityFactor (aLowSensitivity);
theSelection->Add (aLine2);
aLine1->SetSensitivityFactor(10);
theSelection->Add(aLine1);
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, gp::Origin(), aMidP);
aLine2->SetSensitivityFactor(10);
theSelection->Add(aLine2);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].DraggerSector().Triangulation(), TopLoc_Location(), Standard_True);
theSelection->Add (aTri);
theSelection->Add(aTri);
}
break;
}
default:
{
anOwner = new SelectMgr_EntityOwner(this, 5);
break;
}
}
}

View File

@@ -55,38 +55,24 @@ void AIS_Selection::Clear()
//function : Select
//purpose :
//=======================================================================
AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(SelectMgr_Filter)& theFilter,
const AIS_SelectionScheme theSelScheme,
const Standard_Boolean theIsDetected)
AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& theObject)
{
if (theOwner.IsNull()
|| !theOwner->HasSelectable())
if (theObject.IsNull()
|| !theObject->HasSelectable())
{
return AIS_SS_NotDone;
}
const Standard_Boolean isDetected = theIsDetected
&& (theFilter.IsNull() || theFilter->IsOk (theOwner));
const Standard_Boolean wasSelected = theOwner->IsSelected();
const Standard_Boolean toSelect = theOwner->Select (theSelScheme, isDetected);
if (toSelect && !wasSelected)
if (!myResultMap.IsBound (theObject))
{
AIS_NListOfEntityOwner::Iterator aListIter;
myresult.Append (theOwner, aListIter);
myResultMap.Bind (theOwner, aListIter);
theOwner->SetSelected (Standard_True);
myresult.Append (theObject, aListIter);
myResultMap.Bind (theObject, aListIter);
theObject->SetSelected (Standard_True);
return AIS_SS_Added;
}
if (!toSelect && !wasSelected)
{
return AIS_SS_NotDone;
}
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theOwner);
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theObject);
if (myIterator == aListIter)
{
if (myIterator.More())
@@ -102,14 +88,14 @@ AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& the
// In the mode of advanced mesh selection only one owner is created for all selection modes.
// It is necessary to check the current detected entity
// and remove the owner from map only if the detected entity is the same as previous selected (IsForcedHilight call)
if (theOwner->IsForcedHilight())
if (theObject->IsForcedHilight())
{
return AIS_SS_Added;
}
myresult.Remove (aListIter);
myResultMap.UnBind (theOwner);
theOwner->SetSelected (Standard_False);
myResultMap.UnBind (theObject);
theObject->SetSelected (Standard_False);
// update list iterator for next object in <myresult> list if any
if (aListIter.More())
@@ -156,39 +142,86 @@ void AIS_Selection::SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwner
const Standard_Boolean theToAllowSelOverlap,
const Handle(SelectMgr_Filter)& theFilter)
{
(void)theToAllowSelOverlap;
if (theSelScheme == AIS_SelectionScheme_ReplaceExtra
&& thePickedOwners.Size() == myresult.Size())
(void )theToAllowSelOverlap;
switch (theSelScheme)
{
// If picked owners is equivalent to the selected then just clear selected.
Standard_Boolean isTheSame = Standard_True;
for (AIS_NArray1OfEntityOwner::Iterator aPickedIter (thePickedOwners); aPickedIter.More(); aPickedIter.Next())
case AIS_SelectionScheme_UNKNOWN:
{
if (!myResultMap.IsBound (aPickedIter.Value()))
return;
}
case AIS_SelectionScheme_ReplaceExtra:
{
// If picked owners is equivalent to the selected then just clear selected
// Else go to AIS_SelectionScheme_Replace
if (thePickedOwners.Size() == myresult.Size())
{
isTheSame = Standard_False;
break;
Standard_Boolean isTheSame = Standard_True;
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
if (!myResultMap.IsBound (aSelIter.Value()))
{
isTheSame = Standard_False;
break;
}
}
if (isTheSame)
{
Clear();
return;
}
}
}
if (isTheSame)
Standard_FALLTHROUGH
case AIS_SelectionScheme_Replace:
{
Clear();
return;
Clear();
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
appendOwner (aSelIter.Value(), theFilter);
}
return;
}
}
case AIS_SelectionScheme_Add:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
appendOwner (aSelIter.Value(), theFilter);
}
return;
}
case AIS_SelectionScheme_Remove:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
if (myResultMap.IsBound (aSelIter.Value()))
{
Select (aSelIter.Value());
}
}
return;
}
case AIS_SelectionScheme_XOR:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner)& anOwner = aSelIter.Value();
if (anOwner.IsNull()
|| !anOwner->HasSelectable()
|| !theFilter->IsOk (anOwner))
{
continue;
}
if (theSelScheme == AIS_SelectionScheme_Replace
|| theSelScheme == AIS_SelectionScheme_ReplaceExtra
|| theSelScheme == AIS_SelectionScheme_Clear)
{
Clear();
}
for (AIS_NArray1OfEntityOwner::Iterator aPickedIter (thePickedOwners); aPickedIter.More(); aPickedIter.Next())
{
const Handle(SelectMgr_EntityOwner)& anOwner = aPickedIter.Value();
Select (anOwner, theFilter, theSelScheme, true);
Select (anOwner);
}
return;
}
case AIS_SelectionScheme_Clear:
{
Clear();
return;
}
}
}

View File

@@ -40,30 +40,17 @@ public:
//! if the object is not yet in the selection, it will be added.
//! if the object is already in the selection, it will be removed.
//! @param[in] theOwner element to change selection state
//! @param[in] theFilter context filter
//! @param[in] theSelScheme selection scheme
//! @param[in] theIsDetected flag of object detection
//! @return result of selection
Standard_EXPORT virtual AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(SelectMgr_Filter)& theFilter,
const AIS_SelectionScheme theSelScheme,
const Standard_Boolean theIsDetected);
Standard_EXPORT virtual AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theObject);
//! the object is always add int the selection.
//! faster when the number of objects selected is great.
Standard_EXPORT virtual AIS_SelectStatus AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
//! clears the selection and adds the object in the selection.
//! @param[in] theObject element to change selection state
//! @param[in] theFilter context filter
//! @param[in] theIsDetected flag of object detection
virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject,
const Handle(SelectMgr_Filter)& theFilter,
const Standard_Boolean theIsDetected)
virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject)
{
Clear();
Select (theObject, theFilter, AIS_SelectionScheme_Add, theIsDetected);
Select (theObject);
}
//! checks if the object is in the selection.

View File

@@ -2,8 +2,6 @@ AIS.hxx
AIS_Animation.cxx
AIS_Animation.hxx
AIS_AnimationTimer.hxx
AIS_AnimationAxisRotation.cxx
AIS_AnimationAxisRotation.hxx
AIS_AnimationCamera.cxx
AIS_AnimationCamera.hxx
AIS_AnimationObject.cxx
@@ -14,8 +12,6 @@ AIS_Axis.cxx
AIS_Axis.hxx
AIS_BadEdgeFilter.cxx
AIS_BadEdgeFilter.hxx
AIS_BaseAnimationObject.cxx
AIS_BaseAnimationObject.hxx
AIS_C0RegularityFilter.cxx
AIS_C0RegularityFilter.hxx
AIS_CameraFrustum.cxx

View File

@@ -911,8 +911,9 @@ int macrmsg_(const char *,//crout,
/* Parameter adjustments */
ct -= ct_len;
(void )ct; // unused
(void )xt; // unused
(void )it; // unused
--xt;
--it;
/* Function Body */
mamdlng_(cln, 3L);
@@ -1788,7 +1789,7 @@ int maoverf_(integer *nbentr,
/* Loop. The upper limit is the integer value of the logarithm of base 2
*/
/* of NBENTR/NLONGR. */
i__1 = (integer) (std::log((real) (*nbentr) / (float)63.) / std::log((float)2.))
i__1 = (integer) (log((real) (*nbentr) / (float)63.) / log((float)2.))
;
for (ibid = 1; ibid <= i__1; ++ibid) {

View File

@@ -556,7 +556,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments,
//function : isIsoLine
//purpose :
//=============================================================================
Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D,
Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d) theC2D,
Standard_Boolean& theIsU,
Standard_Real& theParam,
Standard_Boolean& theIsForward) const
@@ -638,7 +638,7 @@ Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d
//function : buildC3dOnIsoLine
//purpose :
//=============================================================================
Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D,
Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d) theC2D,
const Standard_Boolean theIsU,
const Standard_Real theParam,
const Standard_Boolean theIsForward)

View File

@@ -85,7 +85,7 @@ protected:
//! @param theParam Line parameter.
//! @param theIsForward Flag indicating forward parameterization on a isoline.
//! @return Standard_True when 2d curve is a line and Standard_False otherwise.
Standard_Boolean isIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D,
Standard_Boolean isIsoLine(const Handle(Adaptor2d_Curve2d) theC2D,
Standard_Boolean& theIsU,
Standard_Real& theParam,
Standard_Boolean& theIsForward) const;
@@ -97,7 +97,7 @@ protected:
//! @param theParam Line parameter.
//! @param theIsForward Flag indicating forward parameterization on a isoline.
//! @return Standard_True when 3d curve is built and Standard_False otherwise.
Standard_Boolean buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D,
Standard_Boolean buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d) theC2D,
const Standard_Boolean theIsU,
const Standard_Real theParam,
const Standard_Boolean theIsForward);

View File

@@ -733,7 +733,7 @@ void MakeInternalShells(const TopTools_IndexedMapOfShape& theMF,
//
aNbF = theMF.Extent();
for (i = 1; i <= aNbF; ++i) {
const TopoDS_Shape& aF = theMF(i);
TopoDS_Shape aF = theMF(i);
TopExp::MapShapesAndAncestors(aF,
TopAbs_EDGE, TopAbs_FACE,
aMEF);

View File

@@ -62,7 +62,6 @@
#include <IntTools_SequenceOfCurves.hxx>
#include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_Tools.hxx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_Vector.hxx>
#include <Precision.hxx>
#include <TColStd_ListOfInteger.hxx>
@@ -579,12 +578,14 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
Standard_Integer i, nF1, nF2, aNbC, aNbP, j;
Standard_Integer nV1, nV2;
Standard_Real aT1, aT2;
Handle(NCollection_BaseAllocator) aAllocator = new NCollection_IncAllocator;
Handle(NCollection_BaseAllocator) aAllocator;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
TopoDS_Edge aES;
Handle(BOPDS_PaveBlock) aPBOut;
//
//-----------------------------------------------------scope f
aAllocator=
NCollection_BaseAllocator::CommonBaseAllocator();
//
TColStd_ListOfInteger aLSE(aAllocator), aLBV(aAllocator);
TColStd_MapOfInteger aMVOnIn(100, aAllocator), aMVCommon(100, aAllocator),
@@ -606,23 +607,13 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
// Map of PaveBlocks with the faces to which it has to be added
BOPAlgo_DataMapOfPaveBlockListOfInteger aPBFacesMap;
//
// The vector aFFToRecheck contains indices of potentially problematic Face-Face intersections
NCollection_Vector<Standard_Integer> aFFToRecheck;
// aNbFF may be increased while processing this loop, because it is necessary to recheck
// some of Face-Face intersections to avoid missing section edges
// aNbFF will be increased to the number of potentially problematic Face-Face intersections
const Standard_Integer aNbFFPrev = aNbFF;
for (i = 0; i < aNbFF; ++i, aPS.Next())
{
for (i=0; i<aNbFF; ++i, aPS.Next()) {
if (UserBreak(aPS))
{
return;
}
// after passing through all of Face-Face intersections it is necessary to return
// to potentially problematic Face-Face intersections and process them one more time
const Standard_Integer aCurInd = i < aNbFFPrev ? i : aFFToRecheck[i - aNbFFPrev];
//
BOPDS_InterfFF& aFF=aFFs(aCurInd);
BOPDS_InterfFF& aFF=aFFs(i);
aFF.Indices(nF1, nF2);
//
BOPDS_VectorOfPoint& aVP=aFF.ChangePoints();
@@ -745,9 +736,6 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
}
}
// Added additional check of Face-Face intersection to avoid missing section edges
// because of sequence of Face-Face interference processing
Standard_Boolean isToRecheck = aNbC > 0 && i < aNbFFPrev;
//
// 3. Make section edges
for (j=0; j<aNbC; ++j) {
@@ -761,11 +749,6 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
aLPB.Clear();
aPB1->Update(aLPB, Standard_False);
//
if (aLPB.Extent() != 0)
{
isToRecheck = false;
}
aItLPB.Initialize(aLPB);
for (; aItLPB.More(); aItLPB.Next()) {
Handle(BOPDS_PaveBlock)& aPB=aItLPB.ChangeValue();
@@ -867,7 +850,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
if (aMPBAdd.Add(aPBOut))
{
// Add edge for processing as the section edge
PreparePostTreatFF(aCurInd, j, aPBOut, aMSCPB, aMVI, aLPBC);
PreparePostTreatFF(i, j, aPBOut, aMSCPB, aMVI, aLPBC);
}
}
continue;
@@ -886,7 +869,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
//
// Keep info for post treatment
BOPDS_CoupleOfPaveBlocks aCPB;
aCPB.SetIndexInterf(aCurInd);
aCPB.SetIndexInterf(i);
aCPB.SetIndex(j);
aCPB.SetPaveBlock1(aPB);
//
@@ -898,17 +881,12 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
aMVTol.UnBind(nV2);
// Add existing pave blocks for post treatment
ProcessExistingPaveBlocks (aCurInd, j, nF1, nF2, aES, aMPBOnIn, aPBTree,
ProcessExistingPaveBlocks (i, j, nF1, nF2, aES, aMPBOnIn, aPBTree,
aMSCPB, aMVI, aLPBC, aPBFacesMap, aMPBAdd);
}
//
aLPBC.RemoveFirst();
}//for (j=0; j<aNbC; ++j) {
if (isToRecheck)
{
aFFToRecheck.Append(aCurInd);
++aNbFF;
}
//
//back to previous tolerance values for unused vertices
//and forget about SD groups of such vertices
@@ -932,7 +910,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
aDMVLV.UnBind(nV1);
}
//
ProcessExistingPaveBlocks(aCurInd, nF1, nF2, aMPBOnIn, aPBTree, aDMBV, aMSCPB, aMVI, aPBFacesMap, aMPBAdd);
ProcessExistingPaveBlocks(i, nF1, nF2, aMPBOnIn, aPBTree, aDMBV, aMSCPB, aMVI, aPBFacesMap, aMPBAdd);
}//for (i=0; i<aNbFF; ++i) {
// Remove "micro" section edges

View File

@@ -248,178 +248,167 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
//
// Build the shells
aItF.Initialize (aLFConnected);
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i)
{
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i) {
const TopoDS_Shape& aFF = aItF.Value();
if (!AddedFacesMap.Add(aFF)) {
continue;
}
//
// make a new shell
TopoDS_Shell aShell;
aBB.MakeShell(aShell);
aBB.Add(aShell, aFF);
aMEFP.Clear();
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
TopoDS_Shell aShellStart;
aBB.MakeShell(aShellStart);
aBB.Add(aShellStart, aFF);
//
// loop on faces added to Shell;
// add their neighbor faces to Shell and so on
aItS.Initialize(aShell);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
Standard_Boolean isBoundary = aBoundaryFaces.Contains (aF);
TopTools_ListOfShape aLShells;
aLShells.Append(aShellStart);
//
TopTools_ListIteratorOfListOfShape aItLShells(aLShells);
for (; aItLShells.More(); aItLShells.Next()) {
TopoDS_Shell& aShell = TopoDS::Shell(aItLShells.ChangeValue());
//
// loop on edges of aF; find a good neighbor face of aF by aE
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
aMEFP.Clear();
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
//
// loop on faces added to Shell;
// add their neighbor faces to Shell and so on
aItS.Initialize(aShell);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
Standard_Boolean isBoundary = aBoundaryFaces.Contains (aF);
//
// proceed only free edges in this shell
if (aMEFP.Contains(aE)) {
const TopTools_ListOfShape& aLFP = aMEFP.FindFromKey(aE);
aNbFP = aLFP.Extent();
if (aNbFP > 1) {
// loop on edges of aF; find a good neighbor face of aF by aE
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
//
// proceed only free edges in this shell
if (aMEFP.Contains(aE)) {
const TopTools_ListOfShape& aLFP = aMEFP.FindFromKey(aE);
aNbFP = aLFP.Extent();
if (aNbFP > 1) {
continue;
}
}
// avoid processing of internal edges
anOr = aE.Orientation();
if (anOr == TopAbs_INTERNAL) {
continue;
}
}
// avoid processing of internal edges
anOr = aE.Orientation();
if (anOr == TopAbs_INTERNAL) {
continue;
}
// avoid processing of degenerated edges
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
// candidate faces list
const TopTools_ListOfShape& aLF = aEFMap.FindFromKey(aE);
aNbLF = aLF.Extent();
if (!aNbLF) {
continue;
}
//
// prepare for selecting the next face
// take only not-processed faces as a candidates
BOPTools_ListOfCoupleOfShape aLCSOff;
//
Standard_Integer aNbWaysInside = 0;
TopoDS_Face aSelF;
TopTools_ListIteratorOfListOfShape aItLF(aLF);
for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Face& aFL = (*(TopoDS_Face*)(&aItLF.Value()));
if (aF.IsSame(aFL) || AddedFacesMap.Contains(aFL)) {
// avoid processing of degenerated edges
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
// find current edge in the face
if (!BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL)) {
// candidate faces list
const TopTools_ListOfShape& aLF = aEFMap.FindFromKey(aE);
aNbLF = aLF.Extent();
if (!aNbLF) {
continue;
}
//
if (isBoundary && !aBoundaryFaces.Contains (aFL))
// prepare for selecting the next face
// take only not-processed faces as a candidates
BOPTools_ListOfCoupleOfShape aLCSOff;
//
Standard_Integer aNbWaysInside = 0;
TopoDS_Face aSelF;
TopTools_ListIteratorOfListOfShape aItLF(aLF);
for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Face& aFL = (*(TopoDS_Face*)(&aItLF.Value()));
if (aF.IsSame(aFL) || AddedFacesMap.Contains(aFL)) {
continue;
}
//
// find current edge in the face
if (!BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL)) {
continue;
}
//
if (isBoundary && !aBoundaryFaces.Contains (aFL))
{
++aNbWaysInside;
aSelF = aFL;
}
aCSOff.SetShape1(aEL);
aCSOff.SetShape2(aFL);
aLCSOff.Append(aCSOff);
}//for (; aItLF.More(); aItLF.Next()) {
//
aNbOff = aLCSOff.Extent();
if (!aNbOff){
continue;
}
//
// among all the adjacent faces chose one with the minimal
// angle to the current one
if (!isBoundary || aNbWaysInside != 1)
{
++aNbWaysInside;
aSelF = aFL;
if (aNbOff == 1) {
aSelF = (*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
}
else if (aNbOff > 1) {
BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, aContext);
}
}
aCSOff.SetShape1(aEL);
aCSOff.SetShape2(aFL);
aLCSOff.Append(aCSOff);
}//for (; aItLF.More(); aItLF.Next()) {
//
aNbOff = aLCSOff.Extent();
if (!aNbOff){
continue;
}
//
// among all the adjacent faces chose one with the minimal
// angle to the current one
if (!isBoundary || aNbWaysInside != 1)
{
if (aNbOff == 1) {
aSelF = (*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
//
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
aBB.Add(aShell, aSelF);
TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
}
else if (aNbOff > 1) {
BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, aContext);
}
}
//
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
aBB.Add(aShell, aSelF);
TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
}
} // for (; aExp.More(); aExp.Next()) {
} // for (; aItS.More(); aItS.Next()) {
//
// split the shell on multi-connected edges
TopTools_ListOfShape aLShSp;
RefineShell(aShell, aMEFP, aLShSp);
//
// collect the not closed shells for further processing
TopTools_ListOfShape aLShNC;
//
TopTools_ListIteratorOfListOfShape aItLShSp(aLShSp);
for (; aItLShSp.More(); aItLShSp.Next()) {
TopoDS_Shell& aShSp = *((TopoDS_Shell*)&aItLShSp.Value());
} // for (; aExp.More(); aExp.Next()) {
} // for (; aItS.More(); aItS.Next()) {
//
if (BRep_Tool::IsClosed(aShSp)) {
aShSp.Closed(Standard_True);
myLoops.Append(aShSp);
// split the shell on multi-connected edges
TopTools_ListOfShape aLShSp;
RefineShell(aShell, aMEFP, aLShSp);
//
// collect the not closed shells for further processing
TopTools_ListOfShape aLShNC;
//
TopTools_ListIteratorOfListOfShape aItLShSp(aLShSp);
for (; aItLShSp.More(); aItLShSp.Next()) {
TopoDS_Shell& aShSp = *((TopoDS_Shell*)&aItLShSp.Value());
//
if (BRep_Tool::IsClosed(aShSp)) {
aShSp.Closed(Standard_True);
myLoops.Append(aShSp);
}
else {
aLShNC.Append(aShSp);
}
}
else {
aLShNC.Append(aShSp);
//
bAllFacesTaken = (AddedFacesMap.Extent() == aNbShapes);
if (bAllFacesTaken) {
break;
}
}
//
bAllFacesTaken = (AddedFacesMap.Extent() == aNbShapes);
if (bAllFacesTaken) {
break;
}
//
if (aLShSp.Extent() == 1) {
// not further processing of not closed shells is needed,
// as it will not bring any new results
continue;
}
//
// remove th faces of not closed shells from the map of processed faces
// and try to rebuild the shells using all not processed faces,
// because faces of one shell might be needed for building the other
TopTools_ListIteratorOfListOfShape aItLShNC(aLShNC);
for (; aItLShNC.More(); aItLShNC.Next())
{
TopoDS_Iterator aItNC(aItLShNC.Value());
for (; aItNC.More(); aItNC.Next())
{
AddedFacesMap.Remove(aItNC.Value());
//
if (aLShSp.Extent() == 1) {
// not further processing of not closed shells is needed,
// as it will not bring any new results
continue;
}
//
Standard_Integer aNbShNC = aLShNC.Extent();
if (aNbShNC == 1) {
// try to complete the shell with other faces
aLShells.Append(aLShNC);
}
else if (aNbShNC > 1) {
// remove th faces of not closed shells from the map of processed faces
// and try to rebuild the shells using all not processed faces,
// because faces of one shell might be needed for building the other
TopTools_ListIteratorOfListOfShape aItLShNC(aLShNC);
for (; aItLShNC.More(); aItLShNC.Next()) {
TopoDS_Iterator aItNC(aItLShNC.Value());
for (; aItNC.More(); aItNC.Next()) {
AddedFacesMap.Remove(aItNC.Value());
}
}
}
}
} // for (; aItF.More(); aItF.Next()) {
}
//=======================================================================
//function : FindShape
//purpose :
//=======================================================================
TopoDS_Shape FindShape (const TopoDS_Shape& theShapeToFind,
const TopoDS_Shape& theShape)
{
TopoDS_Shape aRes;
TopExp_Explorer anExp(theShape, theShapeToFind.ShapeType());
for (; anExp.More(); anExp.Next())
{
const TopoDS_Shape& aShape = anExp.Current();
if (aShape.IsSame(theShapeToFind))
{
aRes = aShape;
break;
}
}
return aRes;
}
//=======================================================================
//function : RefineShell
//purpose :
@@ -445,21 +434,6 @@ void RefineShell(TopoDS_Shell& theShell,
aMEStop.Add(aE);
continue;
}
if (aLF.Extent() == 2)
{
const TopoDS_Face& aF1 = TopoDS::Face(aLF.First());
const TopoDS_Face& aF2 = TopoDS::Face(aLF.Last());
TopoDS_Shape aE1 = FindShape(aE, aF1);
TopoDS_Shape aE2 = FindShape(aE, aF2);
if (aE1.Orientation() == aE2.Orientation())
{
aMEStop.Add(aE);
continue;
}
}
//
// check for internal edges - count faces, in which the edge
// is internal, twice

View File

@@ -512,6 +512,7 @@ void Path (const GeomAdaptor_Surface& aGAS,
Standard_Integer aNbWaysInside = 0;
BOPAlgo_EdgeInfo *pOnlyWayIn = NULL;
Standard_Integer aCurIndexE = 0;
anIt.Initialize(aLEInfo);
for (; anIt.More(); anIt.Next()) {
BOPAlgo_EdgeInfo& anEI=anIt.ChangeValue();
@@ -520,6 +521,7 @@ void Path (const GeomAdaptor_Surface& aGAS,
anIsNotPassed=!anEI.Passed();
//
if (anIsOut && anIsNotPassed) {
aCurIndexE++;
//
// Is there one way to go out of the vertex
// we have to use it only.

View File

@@ -667,7 +667,7 @@ Standard_Integer bopcurves (Draw_Interpretor& di,
for (Standard_Integer i=1; i<=aNbCurves; i++) {
const IntTools_Curve& anIC=aSCs(i);
const Handle (Geom_Curve)& aC3D = anIC.Curve();
Handle (Geom_Curve) aC3D = anIC.Curve();
if (aC3D.IsNull()) {
di << " has Null 3d curve# " << i << "\n";
@@ -682,8 +682,8 @@ Standard_Integer bopcurves (Draw_Interpretor& di,
DrawTrSurf::Set(nameC, aC3D);
di << nameC << " ";
//
const Handle(Geom2d_Curve)& aPC1 = anIC.FirstCurve2d();
const Handle(Geom2d_Curve)& aPC2 = anIC.SecondCurve2d();
Handle(Geom2d_Curve) aPC1 = anIC.FirstCurve2d();
Handle(Geom2d_Curve) aPC2 = anIC.SecondCurve2d();
//
if (!aPC1.IsNull() || !aPC2.IsNull()) {
di << "(";

View File

@@ -736,7 +736,7 @@ void Add(const TopoDS_Shape& aS,
return;
}
//
const TopoDS_Shape& aSx = aS;
TopoDS_Shape aSx = aS;
//
anIndex=myShapes.FindIndex(aSx);
if (!anIndex) {

View File

@@ -112,7 +112,7 @@ void BOPTools_AlgoTools::MakeSectEdge(const IntTools_Curve& aIC,
const Standard_Real aP2,
TopoDS_Edge& aNewEdge)
{
const Handle(Geom_Curve)& aC=aIC.Curve ();
Handle(Geom_Curve) aC=aIC.Curve ();
BRepBuilderAPI_MakeEdge aMakeEdge(aC, aV1, aV2, aP1, aP2);

View File

@@ -60,7 +60,7 @@ public: //! @name public interfaces
//! Clears the indices
void Clear()
{
myPairs.clear();
myPairs.Clear();
}
//! Sorts the indices

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 :
@@ -383,7 +214,7 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire)
BRepTools_WireExplorer wexp(theWire);
for (; wexp.More(); wexp.Next()) {
const TopoDS_Edge& anEdge = wexp.Current();
TopoDS_Edge anEdge = wexp.Current();
Standard_Real fpar, lpar;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
@@ -392,7 +223,7 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire)
GeomAdaptor_Curve aGACurve(aCurve);
GeomAbs_CurveType aType = aGACurve.GetType();
const Handle(Geom_Curve)& aBasisCurve = aGACurve.Curve();
Handle(Geom_Curve) aBasisCurve = aGACurve.Curve();
Standard_Boolean isFwd = (wexp.Orientation() != TopAbs_REVERSED);
if (aBasisCurve->IsPeriodic()) {

View File

@@ -21,7 +21,6 @@
#include <TopTools_ListOfShape.hxx>
class TopoDS_Wire;
class TopoDS_Edge;
class TopoDS_Face;
class TopoDS_Shape;
@@ -45,28 +44,6 @@ public:
//! 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>.
Standard_EXPORT static Standard_Boolean IsValid (const TopoDS_Shape& S);

View File

@@ -401,9 +401,12 @@ void BRepAlgo_FaceRestrictor::PerformWithCorrection()
//---------------------------------------------------------
// Classification of wires ones compared to the others.
//---------------------------------------------------------
Standard_Integer j,i = 1;
for (it.Initialize(wires) ; it.More(); it.Next()) {
TopoDS_Wire& W1 = TopoDS::Wire(it.Value());
TopTools_ListIteratorOfListOfShape it2(wires);
j = 1;
if (IsClosed(W1)) {
TopoDS_Shape aLocalShape = myFace.EmptyCopied();
@@ -419,8 +422,10 @@ void BRepAlgo_FaceRestrictor::PerformWithCorrection()
Store (W2,W1,keyIsIn,keyContains);
}
it2.Next();
j++;
}
}
i++;
}
TopTools_ListOfShape WireExt;

View File

@@ -42,14 +42,12 @@
#include <TopTools_SequenceOfShape.hxx>
#include <stdio.h>
//#define OCCT_DEBUG_ALGO
//#define DRAW
#ifdef DRAW
#include <DBRep.hxx>
#pragma comment(lib,"TKDraw")
#endif
#ifdef OCCT_DEBUG_ALGO
Standard_Boolean AffichLoop = Standard_True;
Standard_Boolean AffichLoop = Standard_False;
Standard_Integer NbLoops = 0;
Standard_Integer NbWires = 1;
static char* name = new char[100];
@@ -60,8 +58,7 @@ static char* name = new char[100];
//purpose :
//=======================================================================
BRepAlgo_Loop::BRepAlgo_Loop():
myTolConf (0.001)
BRepAlgo_Loop::BRepAlgo_Loop()
{
}
@@ -188,6 +185,7 @@ static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E,
Standard_Boolean OnStart = 0, OnEnd = 0;
//// modified by jgv, 13.04.04 for OCC5634 ////
TopExp::Vertices (E,V1,V2);
//Standard_Real Tol = Precision::Confusion();
Standard_Real Tol = BRep_Tool::Tolerance( V1 );
///////////////////////////////////////////////
@@ -284,7 +282,7 @@ static void RemovePendingEdges(TopTools_IndexedDataMapOfShapeListOfShape& MVE)
//purpose :
//=======================================================================
static Standard_Boolean SamePnt2d(const TopoDS_Vertex& V,
static Standard_Boolean SamePnt2d(TopoDS_Vertex V,
TopoDS_Edge& E1,
TopoDS_Edge& E2,
TopoDS_Face& F)
@@ -429,12 +427,13 @@ static void StoreInMVE (const TopoDS_Face& F,
TopoDS_Edge& E,
TopTools_IndexedDataMapOfShapeListOfShape& MVE,
Standard_Boolean& YaCouture,
TopTools_DataMapOfShapeShape& VerticesForSubstitute,
const Standard_Real theTolConf)
TopTools_DataMapOfShapeShape& VerticesForSubstitute )
{
TopoDS_Vertex V1, V2, V;
TopTools_ListOfShape Empty;
Standard_Real Tol = 0.001; //5.e-05; //5.e-07;
// gp_Pnt P1, P2, P;
gp_Pnt P1, P;
BRep_Builder BB;
for (Standard_Integer iV = 1; iV <= MVE.Extent(); iV++)
@@ -450,7 +449,7 @@ static void StoreInMVE (const TopoDS_Face& F,
{
V1 = TopoDS::Vertex( itl.Value() );
P1 = BRep_Tool::Pnt( V1 );
if (P.IsEqual( P1, theTolConf ) && !V.IsSame(V1))
if (P.IsEqual( P1, Tol ) && !V.IsSame(V1))
{
V.Orientation( V1.Orientation() );
if (VerticesForSubstitute.IsBound( V1 ))
@@ -575,7 +574,7 @@ void BRepAlgo_Loop::Perform()
TopoDS_Edge& E = TopoDS::Edge(itl1.Value());
if (!Emap.Add(E))
continue;
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute, myTolConf);
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute);
}
}
}
@@ -587,7 +586,7 @@ void BRepAlgo_Loop::Perform()
for (itl.Initialize(myConstEdges); itl.More(); itl.Next()) {
TopoDS_Edge& E = TopoDS::Edge(itl.Value());
if (DejaVu.Add(E))
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute, myTolConf);
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute);
}
#ifdef DRAW
@@ -632,37 +631,37 @@ void BRepAlgo_Loop::Perform()
// Start edge.
//--------------------------------
EF = CE = TopoDS::Edge(MVE(1).First());
TopExp::Vertices(CE, V1, V2);
TopExp::Vertices(CE,V1,V2);
//--------------------------------
// VF vertex start of new wire
//--------------------------------
if (CE.Orientation() == TopAbs_FORWARD) { CV = VF = V1; }
else { CV = VF = V2; }
if (CE.Orientation() == TopAbs_FORWARD) { CV = VF = V1;}
else { CV = VF = V2;}
if (!MVE.Contains(CV)) continue;
TopTools_ListOfShape& aListEdges = MVE.ChangeFromKey(CV);
for (itl.Initialize(aListEdges); itl.More(); itl.Next()) {
for ( itl.Initialize(aListEdges); itl.More(); itl.Next()) {
if (itl.Value().IsEqual(CE)) {
aListEdges.Remove(itl);
break;
aListEdges.Remove(itl);
break;
}
}
End = Standard_False;
End = Standard_False;
while (!End) {
//-------------------------------
// Construction of a wire.
//-------------------------------
TopExp::Vertices(CE, V1, V2);
TopExp::Vertices(CE,V1,V2);
if (!CV.IsSame(V1)) CV = V1; else CV = V2;
B.Add(NW, CE);
B.Add (NW,CE);
UsedEdges.Add(CE);
if (!MVE.Contains(CV) || MVE.FindFromKey(CV).IsEmpty()) {
End = Standard_True;
}
else {
End = !SelectEdge(myFace, CE, CV, NE, MVE.ChangeFromKey(CV));
End = !SelectEdge(myFace,CE,CV,NE,MVE.ChangeFromKey(CV));
if (!End) {
CE = NE;
if (MVE.FindFromKey(CV).IsEmpty())
@@ -673,41 +672,35 @@ void BRepAlgo_Loop::Perform()
//--------------------------------------------------
// Add new wire to the set of wires
//------------------------------------------------
Standard_Real Tol = 0.001; //5.e-05; //5.e-07;
TopExp_Explorer explo( NW, TopAbs_VERTEX );
for (; explo.More(); explo.Next())
{
const TopoDS_Vertex& aV = TopoDS::Vertex( explo.Current() );
Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*) &(aV).TShape());
TV->Tolerance( Tol );
TV->Modified( Standard_True );
}
for (explo.Init( NW, TopAbs_EDGE ); explo.More(); explo.Next())
{
const TopoDS_Edge& aE = TopoDS::Edge( explo.Current() );
Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &(aE).TShape());
TE->Tolerance( Tol );
TE->Modified( Standard_True );
}
if (VF.IsSame(CV))
if (VF.IsSame(CV) && SamePnt2d(VF,EF,CE,myFace))
{
if (SamePnt2d(VF, EF, CE, myFace))
{
NW.Closed(Standard_True);
myNewWires.Append(NW);
}
else if(BRep_Tool::Tolerance(VF) < myTolConf)
{
BRep_Builder aBB;
aBB.UpdateVertex(VF, myTolConf);
if (SamePnt2d(VF, EF, CE, myFace))
{
NW.Closed(Standard_True);
myNewWires.Append(NW);
}
#ifdef OCCT_DEBUG_ALGO
else
{
std::cout << "BRepAlgo_Loop: Open Wire" << std::endl;
if (AffichLoop)
std::cout << "OpenWire is : NW_" << NbLoops << "_" << NbWires << std::endl;
}
#endif
}
NW.Closed (Standard_True);
myNewWires.Append (NW);
}
#ifdef OCCT_DEBUG_ALGO
else {
std::cout << "BRepAlgo_Loop: Open Wire" << std::endl;
std::cout <<"BRepAlgo_Loop: Open Wire"<<std::endl;
if (AffichLoop)
std::cout << "OpenWire is : NW_" << NbLoops << "_" << NbWires << std::endl;
}
std::cout << "OpenWire is : NW_"<<NbLoops<<"_"<<NbWires<<std::endl;
}
#endif
#ifdef DRAW
if (AffichLoop) {
sprintf(name,"NW_%d_%d",NbLoops,NbWires++);
@@ -784,6 +777,8 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
VF = TopoDS::Vertex(aLocalV);
aLocalV = VCEI.Oriented(TopAbs_REVERSED);
VL = TopoDS::Vertex(aLocalV);
// VF = TopoDS::Vertex(VCEI.Oriented(TopAbs_FORWARD));
// VL = TopoDS::Vertex(VCEI.Oriented(TopAbs_REVERSED));
}
SV.Prepend(VF);
SV.Append(VL);
@@ -818,9 +813,13 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
B.Add (NewEdge,aLocalEdge);
aLocalEdge = V2.Oriented(TopAbs_REVERSED);
B.Add (TopoDS::Edge(NewEdge),aLocalEdge);
// B.Add (NewEdge,V1.Oriented(TopAbs_FORWARD));
// B.Add (NewEdge,V2.Oriented(TopAbs_REVERSED));
if (V1.IsSame(VF))
U1 = f;
else
// U1=BRep_Tool::Parameter
// (TopoDS::Vertex(V1.Oriented(TopAbs_INTERNAL)),WE);
{
TopoDS_Shape aLocalV = V1.Oriented(TopAbs_INTERNAL);
U1=BRep_Tool::Parameter(TopoDS::Vertex(aLocalV),WE);
@@ -831,6 +830,8 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
{
TopoDS_Shape aLocalV = V2.Oriented(TopAbs_INTERNAL);
U2=BRep_Tool::Parameter(TopoDS::Vertex(aLocalV),WE);
// U2=BRep_Tool::Parameter
// (TopoDS::Vertex(V2.Oriented(TopAbs_INTERNAL)),WE);
}
B.Range (TopoDS::Edge(NewEdge),U1,U2);
#ifdef DRAW

View File

@@ -86,17 +86,8 @@ public:
Standard_EXPORT void VerticesForSubstitute (TopTools_DataMapOfShapeShape& VerVerMap);
//! Set maximal tolerance used for comparing distaces between vertices.
void SetTolConf(const Standard_Real theTolConf)
{
myTolConf = theTolConf;
}
//! Get maximal tolerance used for comparing distaces between vertices.
Standard_Real GetTolConf() const
{
return myTolConf;
}
protected:
@@ -117,7 +108,6 @@ private:
TopTools_DataMapOfShapeListOfShape myCutEdges;
TopTools_DataMapOfShapeShape myVerticesForSubstitute;
BRepAlgo_Image myImageVV;
Standard_Real myTolConf;
};

View File

@@ -34,8 +34,6 @@ public:
DEFINE_STANDARD_ALLOC
//! Returns a shape built by the shape construction algorithm.
//! Does not check if the shape is built.
Standard_EXPORT virtual const TopoDS_Shape& Shape() Standard_OVERRIDE;
// Provide access to methods of protected base class BOPAlgo_Options

View File

@@ -51,7 +51,7 @@ public:
Standard_EXPORT BRepBlend_CSWalking(const Handle(Adaptor3d_Curve)& Curv, const Handle(Adaptor3d_Surface)& Surf, const Handle(Adaptor3d_TopolTool)& Domain);
Standard_EXPORT void Perform (Blend_CSFunction& F, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_CSFunction& F, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean Complete (Blend_CSFunction& F, const Standard_Real Pmin);
@@ -80,7 +80,7 @@ private:
Handle(Adaptor3d_Surface) surf;
Handle(Adaptor3d_Curve) curv;
Handle(Adaptor3d_TopolTool) domain;
Standard_Real tolpoint3d;
Standard_Real tolesp;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -173,7 +173,7 @@ BRepBlend_RstRstLineBuilder::BRepBlend_RstRstLineBuilder
done(Standard_False), sol(1, 2), surf1(Surf1),
domain1(Domain1), surf2(Surf2),
domain2(Domain2), rst1(Rst1), rst2(Rst2),
tolpoint3d(0.0), tolgui(0.0), pasmax(0.0),
tolesp(0.0), tolgui(0.0), pasmax(0.0),
fleche(0.0), param(0.0), rebrou(Standard_False),
iscomplete(Standard_False), comptra(Standard_False), sens(0.0),
decrochdeb(Blend_NoDecroch), decrochfin(Blend_NoDecroch)
@@ -193,9 +193,9 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -203,7 +203,7 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolpoint3d = Tol3d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -225,7 +225,7 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
TopAbs_State siturst1, siturst2;
Blend_DecrochStatus decroch;
math_Vector tolerance(1, 2), infbound(1, 2), supbound(1, 2);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -258,9 +258,9 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
U = previousP.ParameterOnC1();
V = previousP.ParameterOnC2();
BRepBlend_Extremity ptf1 (previousP.PointOnC1(),
U, previousP.Parameter(),tolpoint3d);
U, previousP.Parameter(),tolesp);
BRepBlend_Extremity ptf2 (previousP.PointOnC2(),
V, previousP.Parameter(),tolpoint3d);
V, previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint()) {
ptf1.SetTangent(previousP.TangentOnC1());
ptf2.SetTangent(previousP.TangentOnC2());
@@ -291,7 +291,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
const Standard_Real Pdep,
const Standard_Real Pmax,
const math_Vector& ParDep,
const Standard_Real Tol3d,
const Standard_Real Tolesp,
const Standard_Real TolGuide,
const Standard_Boolean RecRst1,
const Standard_Boolean RecP1,
@@ -304,7 +304,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolpoint3d = Tol3d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
rebrou = Standard_False;
@@ -327,7 +327,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
wp1 = wp2 = wrst1 = wrst2 = Pmax;
param = Pdep;
Func.Set(param);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -573,7 +573,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
//IntSurf_Transition Tline, Tarc;
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -595,14 +595,14 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp1;
if(BBPP(param, Func, sol, tolpoint3d, bp1)){
if(BBPP(param, Func, sol, tolesp, bp1)){
Standard_Real dw = 1.e-10;
Func.Set(param + dw);
rsnld.Perform(Func, parinit, infbound, supbound);
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp2;
if(BBPP(param + dw, Func, sol, tolpoint3d, bp2)){
if(BBPP(param + dw, Func, sol, tolesp, bp2)){
tracederiv(Func, bp1, bp2);
}
}
@@ -854,7 +854,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
Arrive = Standard_True;
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
MakeExtremity(Extrst2, Standard_False, rst2, sol(2), IsVtxrst2, Vtxrst2);
// Show that end is on Bound.
}
@@ -873,10 +873,10 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
if (Abs(stepw) < tolgui) {
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Extrst2.SetValue(previousP.PointOnC2(),
previousP.ParameterOnC2(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Arrive = Standard_True;
#ifdef OCCT_DEBUG
if (line->NbPoints()>=2) {
@@ -913,7 +913,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
Arrive = Standard_True;
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
MakeExtremity(Extrst2, Standard_False, rst2, sol(2), IsVtxrst2, Vtxrst2);
// Indicate that end is on Bound.
}
@@ -993,10 +993,10 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
#endif
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Extrst2.SetValue(previousP.PointOnC2(),
previousP.ParameterOnC2(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Arrive = Standard_True;
}
break;
@@ -1029,7 +1029,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1, 3), infb(1, 3), supb(1, 3);
Finv.GetTolerance(toler, tolpoint3d);
Finv.GetTolerance(toler, tolesp);
Finv.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(2);
@@ -1049,7 +1049,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
// It is necessary to check if the function value meets the
// second restriction
if (Finv.IsSolution(Solinv, tolpoint3d)) {
if (Finv.IsSolution(Solinv, tolesp)) {
Standard_Real w = Solinv(2);
if(w < rst2->FirstParameter() - toler(2)||
w > rst2->LastParameter() + toler(2)){
@@ -1079,7 +1079,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
math_Vector infbound(1, 2), supbound(1, 2);
math_Vector parinit(1, 2), tolerance(1, 2);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld2(Func, tolerance, 30);
@@ -1112,7 +1112,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1, 3), infb(1, 3), supb(1, 3);
Finv.GetTolerance(toler, tolpoint3d);
Finv.GetTolerance(toler, tolesp);
Finv.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1130,7 +1130,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
rsnld.Root(Solinv);
// It is necessary to check the value of the function
if (Finv.IsSolution(Solinv, tolpoint3d)) {
if (Finv.IsSolution(Solinv, tolesp)) {
Standard_Real w = Solinv(2);
if(w < rst1->FirstParameter() - toler(2)||
w > rst1->LastParameter() + toler(2)){
@@ -1159,7 +1159,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
math_Vector infbound(1, 2), supbound(1, 2);
math_Vector parinit(1,2), tolerance(1,2);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld2(Func, tolerance, 30);
@@ -1199,7 +1199,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,2), infb(1, 2), supb(1, 2);
FinvP.GetTolerance(toler, tolpoint3d);
FinvP.GetTolerance(toler, tolesp);
FinvP.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(2);
@@ -1214,7 +1214,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv, tolpoint3d)){
if(FinvP.IsSolution(Solinv, tolesp)){
gp_Pnt2d p2drst2 = rst2->Value(Solinv(2));
TopAbs_State situ = domain2->Classify(p2drst2, toler(2), 0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
@@ -1267,7 +1267,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,2), infb(1, 2), supb(1, 2);
FinvP.GetTolerance(toler, tolpoint3d);
FinvP.GetTolerance(toler, tolesp);
FinvP.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1282,7 +1282,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv, tolpoint3d)){
if(FinvP.IsSolution(Solinv, tolesp)){
gp_Pnt2d p2drst1 = rst1->Value(Solinv(2));
TopAbs_State situ = domain1->Classify(p2drst1, toler(2), 0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
@@ -1378,7 +1378,7 @@ void BRepBlend_RstRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
if (OnFirst) {
Extrem.SetValue(previousP.PointOnC1(),
sol(1),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC1());
Iter = domain1;
@@ -1386,7 +1386,7 @@ void BRepBlend_RstRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
else {
Extrem.SetValue(previousP.PointOnC2(),
sol(2),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC1());
Iter = domain2;
@@ -1453,13 +1453,12 @@ Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst1(const Blend_Poin
Norme = Corde.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d) {
if (Norme <= tolesp * tolesp) {
// it can be necessary to force the same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if (prevNorme <= toler3d * toler3d) {
if (prevNorme <= tolesp * tolesp) {
return Blend_SamePoints;
}
Cosi = sens * Corde * prevTg;
@@ -1531,13 +1530,12 @@ Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst2(const Blend_Poin
Norme = Corde.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
if (Norme <= tolesp * tolesp){
// it can be necessary to force the same point
return Blend_SamePoints;
}
if (!prevpointistangent) {
if (prevNorme <= toler3d * toler3d) {
if (prevNorme <= tolesp * tolesp) {
return Blend_SamePoints;
}
Cosi = sens * Corde * prevTg;
@@ -1599,7 +1597,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
IntSurf_TypeTrans trarst1 = IntSurf_Undecided, trarst2 = IntSurf_Undecided;
Blend_Point curpoint;
if (Func.IsSolution(sol, tolpoint3d)) {
if (Func.IsSolution(sol, tolesp)) {
Standard_Boolean curpointistangent = Func.IsTangencyPoint();
ptrst1 = Func.PointOnRst1();
ptrst2 = Func.PointOnRst2();
@@ -1646,7 +1644,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
Standard_Real testra = tg2drst1.Dot(tg2drstref);
TopAbs_Orientation Or = domain1->Orientation(rst1);
if (Abs(testra) > tolpoint3d) {
if (Abs(testra) > tolesp) {
if (testra < 0.) {
trarst1 = ConvOrToTra(TopAbs::Reverse(Or));
}
@@ -1658,7 +1656,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
testra = tg2drst2.Dot(tg2drstref);
Or = domain2->Orientation(rst2);
if (Abs(testra) > tolpoint3d) {
if (Abs(testra) > tolesp) {
if (testra < 0.) {
trarst2 = ConvOrToTra(TopAbs::Reverse(Or));
}
@@ -1707,7 +1705,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::CheckInside(Blend_RstRstFunction&
{
// Standard_Boolean inside = Standard_True;
math_Vector tolerance(1, 2);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
//face pcurve 1.
Standard_Real v = sol(1);

View File

@@ -72,9 +72,9 @@ public:
Standard_EXPORT BRepBlend_RstRstLineBuilder(const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor2d_Curve2d)& Rst1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_Surface)& Surf2, const Handle(Adaptor2d_Curve2d)& Rst2, const Handle(Adaptor3d_TopolTool)& Domain2);
Standard_EXPORT void Perform (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tol3d, const Standard_Real TolGuide, const Standard_Boolean RecRst1, const Standard_Boolean RecP1, const Standard_Boolean RecRst2, const Standard_Boolean RecP2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecRst1, const Standard_Boolean RecP1, const Standard_Boolean RecRst2, const Standard_Boolean RecP2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Complete (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pmin);
@@ -134,7 +134,7 @@ private:
Handle(Adaptor3d_TopolTool) domain2;
Handle(Adaptor2d_Curve2d) rst1;
Handle(Adaptor2d_Curve2d) rst2;
Standard_Real tolpoint3d;
Standard_Real tolesp;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -210,7 +210,7 @@ BRepBlend_SurfRstLineBuilder::BRepBlend_SurfRstLineBuilder
const Handle(Adaptor3d_TopolTool)& Domain2):
done(Standard_False), sol(1, 3), surf1(Surf1),
domain1(Domain1), surf2(Surf2), rst(Rst),
domain2(Domain2), tolpoint3d(0.0), tolpoint2d(0.0), tolgui(0.0),
domain2(Domain2), tolesp(0.0), tolgui(0.0),
pasmax(0.0), fleche(0.0), param(0.0),
rebrou(Standard_False), iscomplete(Standard_False),
comptra(Standard_False), sens(0.0),
@@ -230,10 +230,9 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -241,8 +240,7 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolpoint3d = Tol3d;
tolpoint2d = Tol2d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -264,7 +262,7 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
TopAbs_State siturst,situs;
Standard_Boolean decroch;
math_Vector tolerance(1,3),infbound(1,3),supbound(1,3);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -298,9 +296,9 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
// W = previousP.ParameterOnC();
BRepBlend_Extremity ptf1(previousP.PointOnS(),
U,V,previousP.Parameter(),tolpoint3d);
U,V,previousP.Parameter(),tolesp);
BRepBlend_Extremity ptf2(previousP.PointOnC(),
U,V,previousP.Parameter(),tolpoint3d);
U,V,previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint()) {
ptf1.SetTangent(previousP.TangentOnS());
ptf2.SetTangent(previousP.TangentOnC());
@@ -329,8 +327,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
const Standard_Real Pdep,
const Standard_Real Pmax,
const math_Vector& ParDep,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Real Tolesp,
const Standard_Real TolGuide,
const Standard_Boolean RecRst,
const Standard_Boolean RecP,
@@ -342,8 +339,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolpoint3d = Tol3d;
tolpoint2d = Tol2d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
rebrou = Standard_False;
@@ -366,7 +362,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
wp = wrst = ws = Pmax;
param = Pdep;
Func.Set(param);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -540,7 +536,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
//IntSurf_Transition Tline,Tarc;
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -562,14 +558,14 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp1;
if(BBPP(param,Func,sol,tolpoint3d,bp1)){
if(BBPP(param,Func,sol,tolesp,bp1)){
Standard_Real dw = 1.e-10;
Func.Set(param+dw);
rsnld.Perform(Func,parinit,infbound,supbound);
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp2;
if(BBPP(param+dw,Func,sol,tolpoint3d,bp2)){
if(BBPP(param+dw,Func,sol,tolesp,bp2)){
tracederiv(Func,bp1,bp2);
}
}
@@ -750,7 +746,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
Arrive = Standard_True;
Exts.SetValue(previousP.PointOnS(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
// Indicate end on Bound.
}
@@ -769,10 +765,10 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (Abs(stepw) < tolgui) {
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Extrst.SetValue(previousP.PointOnC(),
previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Arrive = Standard_True;
if (line->NbPoints()>=2) {
// Indicate that one stops during the processing
@@ -808,7 +804,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (param == Bound) {
Arrive = Standard_True;
Exts.SetValue(previousP.PointOnS(),sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
// Indicate end on Bound.
}
@@ -854,7 +850,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
line->Prepend(previousP);
}
Exts.SetValue(previousP.PointOnS(),sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
Arrive = Standard_True;
}
@@ -887,10 +883,10 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
#endif
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Extrst.SetValue(previousP.PointOnC(),
previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Arrive = Standard_True;
}
break;
@@ -945,10 +941,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
FinvC.Set(Arc);
math_Vector toler(1,3),infb(1,3),supb(1,3);
// use reduced Tol argument value to pass testcase
// blend complex A6 with scale factor of model 0.1 (base scale = 1000)
// So, here we using 1.0e-5 rather than 1.0e-4 of tolerance of point in 3d
FinvC.GetTolerance(toler,0.1 * tolpoint3d);
FinvC.GetTolerance(toler,tolesp);
FinvC.GetBounds(infb,supb);
Solinv(1) = param;
Solinv(2) = sol(3);
@@ -965,7 +958,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
else {
// It is necessary to check the value of the function
rsnld.Root(Solinv);
recadre = FinvC.IsSolution(Solinv,tolpoint3d);
recadre = FinvC.IsSolution(Solinv,tolesp);
}
// In case of fail, it is checked if another arc
@@ -988,7 +981,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
Arc = domain1->Value();
FinvC.Set(Arc);
FinvC.GetTolerance(toler,tolpoint3d);
FinvC.GetTolerance(toler,tolesp);
FinvC.GetBounds(infb,supb);
Solinv(3) = pmin;
@@ -1004,7 +997,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
else {
// It is necessary to check the value of the function
aRsnld.Root(Solinv);
recadre = FinvC.IsSolution(Solinv,tolpoint3d);
recadre = FinvC.IsSolution(Solinv,tolesp);
}
}
@@ -1048,7 +1041,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1,4),infb(1,4),supb(1,4);
Finv.GetTolerance(toler,tolpoint3d);
Finv.GetTolerance(toler,tolesp);
Finv.GetBounds(infb,supb);
Solinv(1) = sol(3);
Solinv(2) = param;
@@ -1065,9 +1058,9 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
}
rsnld.Root(Solinv);
if(Finv.IsSolution(Solinv,tolpoint3d)){
if(Finv.IsSolution(Solinv,tolesp)){
gp_Pnt2d p2d(Solinv(3),Solinv(4));
TopAbs_State situ = domain1->Classify(p2d,tolpoint2d,0);
TopAbs_State situ = domain1->Classify(p2d,Min(toler(3),toler(4)),0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
return Standard_False;
}
@@ -1093,7 +1086,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
math_Vector infbound(1,3),supbound(1,3);
math_Vector parinit(1,3),tolerance(1,3);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld2(Func,tolerance,30);
@@ -1133,7 +1126,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,3),infb(1,3),supb(1,3);
FinvP.GetTolerance(toler,tolpoint3d);
FinvP.GetTolerance(toler,tolesp);
FinvP.GetBounds(infb,supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1149,9 +1142,9 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv,tolpoint3d)){
if(FinvP.IsSolution(Solinv,tolesp)){
gp_Pnt2d p2d(Solinv(2),Solinv(3));
TopAbs_State situ = domain1->Classify(p2d,tolpoint2d,0);
TopAbs_State situ = domain1->Classify(p2d,Min(toler(2),toler(3)),0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
return Standard_False;
}
@@ -1244,7 +1237,7 @@ void BRepBlend_SurfRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
if (OnFirst) {
Extrem.SetValue(previousP.PointOnS(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnS());
Iter = domain1;
@@ -1252,7 +1245,7 @@ void BRepBlend_SurfRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
else {
Extrem.SetValue(previousP.PointOnC(),
sol(3),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC());
Iter = domain2;
@@ -1319,13 +1312,12 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
// if(!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
if (Norme <= tolesp*tolesp){
// it can be necessary to force same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if(prevNorme <= toler3d * toler3d) {
if(prevNorme <= tolesp*tolesp) {
return Blend_SamePoints;
}
Cosi = sens*Corde*prevTg;
@@ -1396,13 +1388,12 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Poin
// if(!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
if (Norme <= tolesp*tolesp){
// it can be necessary to force same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if(prevNorme <= toler3d * toler3d) {
if(prevNorme <= tolesp*tolesp) {
return Blend_SamePoints;
}
Cosi = sens*Corde*prevTg;
@@ -1464,7 +1455,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func
IntSurf_TypeTrans tras = IntSurf_Undecided, trarst = IntSurf_Undecided;
Blend_Point curpoint;
if (Func.IsSolution(sol,tolpoint3d)) {
if (Func.IsSolution(sol,tolesp)) {
Standard_Boolean curpointistangent = Func.IsTangencyPoint();
pts = Func.PointOnS();
ptrst = Func.PointOnRst();
@@ -1508,7 +1499,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func
Func.Decroch(sol,nors,tgsecs);
nors.Normalize();
Standard_Real testra = tgsecs.Dot(nors.Crossed(tgs));
if (Abs(testra) > tolpoint3d) {
if (Abs(testra) > tolesp) {
if (testra < 0.) {
tras = IntSurf_In;
}
@@ -1567,7 +1558,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::CheckInside(Blend_SurfRstFunction
Standard_Boolean& Decroch)
{
math_Vector tolerance(1,3);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
//face pcurve.
Standard_Real w = sol(3);
if(w < rst->FirstParameter() - tolerance(3)||
@@ -1582,7 +1573,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::CheckInside(Blend_SurfRstFunction
//face surface
gp_Pnt2d p2d(sol(1),sol(2));
SituOnS = domain1->Classify(p2d,tolpoint2d,0);
SituOnS = domain1->Classify(p2d,Min(tolerance(1),tolerance(2)),0);
//lost contact
gp_Vec tgs,nors;

View File

@@ -71,9 +71,9 @@ public:
Standard_EXPORT BRepBlend_SurfRstLineBuilder(const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_Surface)& Surf2, const Handle(Adaptor2d_Curve2d)& Rst, const Handle(Adaptor3d_TopolTool)& Domain2);
Standard_EXPORT void Perform (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolGuide, const Standard_Boolean RecRst, const Standard_Boolean RecP, const Standard_Boolean RecS, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecRst, const Standard_Boolean RecP, const Standard_Boolean RecS, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Complete (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pmin);
@@ -128,8 +128,7 @@ private:
Handle(Adaptor3d_Surface) surf2;
Handle(Adaptor2d_Curve2d) rst;
Handle(Adaptor3d_TopolTool) domain2;
Standard_Real tolpoint3d;
Standard_Real tolpoint2d;
Standard_Real tolesp;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -58,11 +58,11 @@ public:
//! To define singular points computed before walking.
Standard_EXPORT void AddSingularPoint (const Blend_Point& P);
Standard_EXPORT void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, const Standard_Real Pdep, math_Vector& ParDep, const Standard_Real Tol3d, const Standard_Real TolGuide, TopAbs_State& Pos1, TopAbs_State& Pos2);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, const Standard_Real Pdep, math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, TopAbs_State& Pos1, TopAbs_State& Pos2);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& ParDep, const Standard_Real Tol3d, const Standard_Real TolGuide, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Continu (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real P);
@@ -131,7 +131,7 @@ private:
Standard_Boolean ToCorrectOnRst1;
Standard_Boolean ToCorrectOnRst2;
Standard_Real CorrectedParam;
Standard_Real tolpoint3d;
Standard_Real tolesp;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -47,7 +47,7 @@
//
static Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS);
//
static void FindExactUVBounds(const TopoDS_Face& F,
static void FindExactUVBounds(const TopoDS_Face F,
Standard_Real& umin, Standard_Real& umax,
Standard_Real& vmin, Standard_Real& vmax,
const Standard_Real Tol,
@@ -127,14 +127,6 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
for (ex.Init(S,TopAbs_EDGE,TopAbs_FACE); ex.More(); ex.Next())
{
const TopoDS_Edge& E = TopoDS::Edge(ex.Current());
if (!useTriangulation && BRep_Tool::IsGeometric(E))
{
BC.Initialize(E);
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B);
continue;
}
Handle(Poly_Polygon3D) P3d = BRep_Tool::Polygon3D(E, l);
if (!P3d.IsNull() && P3d->NbNodes() > 0)
{
@@ -151,7 +143,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
else
{
BRep_Tool::PolygonOnTriangulation(E, Poly, T, l);
if (!Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
if (useTriangulation && !Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
{
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
nbNodes = Indices.Length();
@@ -460,7 +452,7 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
//function : FindExactUVBounds
//purpose :
//=======================================================================
void FindExactUVBounds(const TopoDS_Face& FF,
void FindExactUVBounds(const TopoDS_Face FF,
Standard_Real& umin, Standard_Real& umax,
Standard_Real& vmin, Standard_Real& vmax,
const Standard_Real Tol,

View File

@@ -58,7 +58,7 @@ static void BuildBack (const TopTools_DataMapOfShapeListOfShape& M1,
//=======================================================================
static void Replace ( TopTools_ListOfShape& L,
const TopoDS_Shape& Old,
const TopoDS_Shape Old,
const TopTools_ListOfShape& New)
{
//-----------------------------------
@@ -150,7 +150,7 @@ static void Update ( TopTools_DataMapOfShapeListOfShape& Mod,
if (!LIG.IsEmpty()) {
if (ModBack.IsBound(S)) {
// Generation de modif => generation du shape initial
const TopoDS_Shape& IS = ModBack(S);
TopoDS_Shape IS = ModBack(S);
StoreImage (Gen,IS,GenBack,LIG);
}
else {

View File

@@ -237,7 +237,7 @@ void BRepBuilderAPI_MakeShapeOnMesh::Build(const Message_ProgressRange& theRange
gp_Pln aPln(myMesh->Node(anIdx[0]), aNorm);
BRepBuilderAPI_MakeFace aFaceMaker(aPln, aWire);
const TopoDS_Face& aFace = aFaceMaker.Face();
const TopoDS_Face aFace = aFaceMaker.Face();
aBB.Add(aResult, aFace);
}

View File

@@ -374,7 +374,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Shape& edge,
for (Standard_Integer i = 1; i <= seqEdges.Length(); i++) {
// Retrieve candidate section
const TopoDS_Shape& oedge2 = seqEdges(i);
TopoDS_Shape oedge2 = seqEdges(i);
if (mySewing) {
@@ -1393,7 +1393,7 @@ void BRepBuilderAPI_Sewing::AnalysisNearestEdges(const TopTools_SequenceOfShape&
// (they have other nearest edges belonging to the work face)
for(Standard_Integer k = 1; k<= seqNotCandidate.Length(); k++) {
Standard_Integer index1 = seqNotCandidate.Value(k);
const TopoDS_Shape& edge = sequenceSec.Value(index1);
TopoDS_Shape edge = sequenceSec.Value(index1);
TopTools_SequenceOfShape tmpSeq;
tmpSeq.Append(edge);
for(Standard_Integer kk = 1; kk <= seqIndCandidate.Length();kk++)
@@ -2928,7 +2928,7 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Message_ProgressRange& theP
for (i = 1; i <= myBoundFaces.Extent(); i++) {
TopoDS_Shape bound = myBoundFaces.FindKey(i);
for (TopoDS_Iterator itv(bound,Standard_False); itv.More(); itv.Next()) {
const TopoDS_Shape& node = itv.Value();
TopoDS_Shape node = itv.Value();
if (myNodeSections.IsBound(node))
myNodeSections(node).Append(bound);
else {
@@ -2991,7 +2991,7 @@ static void replaceNMVertices(const TopoDS_Edge& theEdge,
theReShape->Replace(aSeqNMVert.Value(i),theV2);
continue;
}
const TopoDS_Shape& aV = aSeqNMVert.Value(i);
TopoDS_Shape aV = aSeqNMVert.Value(i);
Standard_Integer j =1;
for( ; j <= aEdParams.Length();j++) {
Standard_Real apar2 = aEdParams.Value(j);
@@ -3508,7 +3508,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
TopTools_MapOfShape mapEdges;
mapEdges.Add(edge);
for (Standard_Integer i = 1; i <= mapVert1.Extent(); i++) {
const TopoDS_Shape& node1 = mapVert1.FindKey(i);
TopoDS_Shape node1 = mapVert1.FindKey(i);
if (!myNodeSections.IsBound(node1)) continue;
TopTools_ListIteratorOfListOfShape ilsec(myNodeSections(node1));
for (; ilsec.More(); ilsec.Next()) {
@@ -4453,7 +4453,7 @@ void BRepBuilderAPI_Sewing::CreateCuttingNodes(const TopTools_IndexedMapOfShape&
if (jdist < 0.0) {
// Bind new cutting node (end vertex only)
seqDist.SetValue(indexMin,disProj);
const TopoDS_Shape& cvertex = seqVert.Value(indexMin);
TopoDS_Shape cvertex = seqVert.Value(indexMin);
NodeCuttingVertex.Add(node,cvertex);
}
else {

View File

@@ -625,7 +625,7 @@ static Standard_Boolean Intersect(const TopoDS_Wire& wir1,
MapW1.Add( exp1.Current() );
for (exp2.Init( wir2, TopAbs_VERTEX ); exp2.More(); exp2.Next())
{
const TopoDS_Shape& V = exp2.Current();
TopoDS_Shape V = exp2.Current();
if (MapW1.Contains( V ))
CommonVertices.Append( V );
}

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