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

Compare commits

..

1 Commits

Author SHA1 Message Date
anv
7358493768 0033108: Coding - Updating geometric adaptors to work via Handles
Updated most interfaces to work with adaptors by handles
2022-09-06 14:09:47 +03:00
968 changed files with 7038 additions and 27007 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")
@@ -820,12 +800,6 @@ else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
endif()
# ExpToCasExe
if (EMSCRIPTEN)
list (REMOVE_ITEM BUILD_TOOLKITS TKExpress)
list (REMOVE_ITEM BUILD_TOOLKITS ExpToCasExe)
endif()
# bison
if (BUILD_YACCLEX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")

View File

@@ -3,5 +3,5 @@ ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXDE TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh TKXDECascade TKExpress ExpToCasExe
DataExchange 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

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)
@@ -238,16 +233,10 @@ function (cotire_filter_language_source_files _language _target _sourceFilesVar
if (_sourceCompileFlags)
# 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()
endif()
endif()
endforeach()
if (COTIRE_DEBUG)
if (_sourceFiles)
@@ -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()
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
# -fno-color-diagnostics don't prints diagnostics in color
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
list (APPEND _flags -H -E -fno-color-diagnostics)
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()
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,31 +1657,23 @@ 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()
endif()
endif()
endif()
else()
message (FATAL_ERROR "cotire: unsupported ${_language} compiler ${_compilerID} version ${_compilerVersion}.")
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
# -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 -include "${_prefixFile}")
list (APPEND _flags "-Qunused-arguments" "-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()
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()
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
# all 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()
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()
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)
# 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 (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)
set (DRACO_INCLUDE_PATH "${3RDPARTY_DRACO_DIR}/include")
set (DRACO_LIBRARY_PATH "${3RDPARTY_DRACO_DIR}/lib")
endif()
if (NOT 3RDPARTY_DRACO_INCLUDE_DIR)
if (DRACO_INCLUDE_PATH AND EXISTS "${DRACO_INCLUDE_PATH}")
set (3RDPARTY_DRACO_INCLUDE_DIR "${DRACO_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of DRACO" FORCE)
endif()
endif()
if (NOT 3RDPARTY_DRACO_LIBRARY_DIR)
if (DRACO_LIBRARY_PATH AND EXISTS "${DRACO_LIBRARY_PATH}")
set (3RDPARTY_DRACO_LIBRARY_DIR "${DRACO_LIBRARY_PATH}" CACHE FILEPATH "The directory containing DRACO library" FORCE)
endif()
endif()
@@ -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

@@ -106,12 +106,6 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${FLEX_BISON_TARGET_DIR}/FlexLexer.h")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/FlexLexer.h)
endif()
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
@@ -127,19 +121,6 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
message (STATUS "Info: remove old output FLEX file: ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
endif()
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
@@ -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,18 +235,6 @@ 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")
@@ -363,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})
@@ -401,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})
@@ -412,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}")
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# 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 (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()
# Initialize tbb directory.
if (NOT DEFINED 3RDPARTY_TBB_DIR)
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
endif()
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_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}"))
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)
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL OR NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
endif()
endif()
# 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)
# 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 (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()
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}")
# 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)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library")
endif()
endif()
endif()
# 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)")
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}")
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
if (${COMPILER_BITNESS} EQUAL 32)
set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME ia32)
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${LIB_UPPER}_DLL_DIR)
set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME intel64)
endif()
# install *.dll (tbb & tbbmalloc)
# tbb/tbbmalloc library
if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME})
# set 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}")
file (GLOB ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/*")
if (${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST)
list (GET ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else()
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
endif()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
PATHS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
endif()
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()
set (PRODUCT_PATH_SUFFIXES bin bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
endif()
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL ${PRODUCT_LIBRARY_NAME}
PATHS "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL ${PRODUCT_LIBRARY_NAME} PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES})
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
endif()
endif()
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR OR EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR)
endif()
endif()
# install tbb/tbbmalloc
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
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")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY} NAME)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
else()
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
endif()
endif()
mark_as_advanced (3RDPARTY_${LIB_UPPER}_LIBRARY 3RDPARTY_${LIB_UPPER}_DLL)
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 *.dll/*.so* directory for using by the executable
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
endif()
else()
message (FATAL_ERROR "Installation directory with TBB is not exist.")
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)
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()
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} DESTINATION "${INSTALL_DIR_LIB}")
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")
endif()
endif()
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})
endif()
endif()
#endif()

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,9 +2110,10 @@ 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 {}
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
set aProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 1]
set aProjName $theToolKit
set aProjName [file rootname [file tail $f]]
set l_compilable [osutils:compilable wnt]
regsub -all -- {__XQTNAM__} $aProjTmpl $aProjName aProjTmpl
@@ -2124,32 +2142,23 @@ proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
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 { "$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 [osutils:vcproj:file $theVcVer $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
@@ -2192,7 +2201,7 @@ proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
lappend aVcFiles "$aCommonSettingsFile"
}
}
return $aVcFiles
}

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

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

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

@@ -55,7 +55,7 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
return;
}
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
Handle(Geom2dAdaptor_Curve) anAdaptor = new Geom2dAdaptor_Curve(myGeom2dCurve);
GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor, 1.e-2);
if (anEdgeDistrib.IsDone())
{
@@ -72,9 +72,9 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
if (myDisplayPole)
{
if (anAdaptor.GetType() == GeomAbs_BezierCurve)
if (anAdaptor->GetType() == GeomAbs_BezierCurve)
{
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Handle(Geom2d_BezierCurve) aBezier = anAdaptor->Bezier();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
for (int i = 1; i <= aBezier->NbPoles(); i++)
{
@@ -87,9 +87,9 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
aPrsGroup->AddPrimitiveArray(anArrayOfVertex);
}
if (anAdaptor.GetType() == GeomAbs_BSplineCurve)
if (anAdaptor->GetType() == GeomAbs_BSplineCurve)
{
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor->BSpline();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
for (int i = 1; i <= aBSpline->NbPoles(); i++)
{
@@ -103,11 +103,11 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
}
}
if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line))
if (myDisplayCurbure && (anAdaptor->GetType() != GeomAbs_Line))
{
const Standard_Integer nbintv = anAdaptor.NbIntervals(GeomAbs_CN);
const Standard_Integer nbintv = anAdaptor->NbIntervals(GeomAbs_CN);
TColStd_Array1OfReal TI(1, nbintv + 1);
anAdaptor.Intervals(TI, GeomAbs_CN);
anAdaptor->Intervals(TI, GeomAbs_CN);
Standard_Real Resolution = 1.0e-9, Curvature;
Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution);
gp_Pnt2d P1, P2;

View File

@@ -30,7 +30,7 @@ void AdaptorCurve_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Curve anAdaptorCurve(myCurve);
Handle(GeomAdaptor_Curve) anAdaptorCurve = new GeomAdaptor_Curve(myCurve);
switch (theMode)
{
case 1:

View File

@@ -1840,7 +1840,7 @@ void GeometrySamples::BoundingBoxOfSurface3dSample()
// Compute BSpline surface bounding box.
Bnd_Box aBndBox;
BndLib_AddSurface::AddOptimal(GeomAdaptor_Surface(aBSplineSurf), Precision::Confusion(), aBndBox);
BndLib_AddSurface::AddOptimal(new GeomAdaptor_Surface(aBSplineSurf), Precision::Confusion(), aBndBox);
myResult << "Bounding box:" << std::endl;
myResult << " Min corner = [ "
<< aBndBox.CornerMin().X() << ", "
@@ -1881,7 +1881,7 @@ void GeometrySamples::BoundingBoxOfCurves3dSample()
// Compute BSpline curve bounding box.
Bnd_Box aBndBox;
BndLib_Add3dCurve::AddOptimal(GeomAdaptor_Curve(aBSplineCurve), Precision::Confusion(), aBndBox);
BndLib_Add3dCurve::AddOptimal(new GeomAdaptor_Curve(aBSplineCurve), Precision::Confusion(), aBndBox);
myResult << "Bounding box:" << std::endl;
myResult << " Min corner = [ "
<< aBndBox.CornerMin().X() << ", "

View File

@@ -102,7 +102,7 @@ void Sample2D_Face::FillData(Standard_Boolean isSizesRecompute)
for (TopExp_Explorer anEdgeIter (myshape, TopAbs_EDGE); anEdgeIter.More(); anEdgeIter.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeIter.Current());
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib(aCurveOnEdge, 1.e-2);
if (!anEdgeDistrib.IsDone())
{
@@ -153,7 +153,7 @@ void Sample2D_Face::FillData(Standard_Boolean isSizesRecompute)
if (!aTrimmedCurve.IsNull())
{
Handle(Geom_Curve) aCurve3d = GeomLib::To3d(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), aTrimmedCurve);
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib (aCurveOnEdge, 1.e-2);
if (!anEdgeDistrib.IsDone())
{
@@ -253,7 +253,7 @@ void Sample2D_Face::Compute (const Handle(PrsMgr_PresentationManager)& ,
// make a 3D curve from 2D trimmed curve to display it
Handle(Geom_Curve) aCurve3d = GeomLib::To3d(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), aTrimmedCurve);
// make distribution of points
BRepAdaptor_Curve2d aCurveOnEdge (anEdge, aFace);
Handle(BRepAdaptor_Curve2d) aCurveOnEdge = new BRepAdaptor_Curve2d(anEdge, aFace);
GCPnts_QuasiUniformDeflection anEdgeDistrib(aCurveOnEdge, 1.e-2);
if (anEdgeDistrib.IsDone())
{

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

@@ -655,7 +655,7 @@ void GeomSources::gpTest9(CGeometryDoc* aDoc)
Standard_Real radius = 5;
Handle(Geom2d_Circle) C =
new Geom2d_Circle(gp::OX2d(),radius);
Geom2dAdaptor_Curve GAC (C);
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C);
Standard_Real startparam = 10*M_PI/180;
Standard_Real abscissa = 45*M_PI/180;
gp_Pnt2d P1;
@@ -673,7 +673,7 @@ void GeomSources::gpTest9(CGeometryDoc* aDoc)
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Geom2dAdaptor_Curve GAC (C); \n\
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C); \n\
Standard_Real startparam = 10*PI180; \n\
Standard_Real abscissa = 45*PI180; \n\
gp_Pnt2d P1; \n\
@@ -723,7 +723,7 @@ void GeomSources::gpTest10(CGeometryDoc* aDoc)
Standard_Real radius = 5;
Handle(Geom2d_Circle) C =
new Geom2d_Circle(gp::OX2d(),radius);
Geom2dAdaptor_Curve GAC (C);
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C);
Standard_Real abscissa = 3;
GCPnts_UniformAbscissa UA (GAC,abscissa);
TColgp_SequenceOfPnt2d aSequence;
@@ -748,7 +748,7 @@ gp_Pnt2d P; \n\
Standard_Real radius = 5; \n\
Handle(Geom2d_Circle) C = \n\
new Geom2d_Circle(gp::OX2d(),radius); \n\
Geom2dAdaptor_Curve GAC (C); \n\
Handle(Geom2dAdaptor_Curve) GAC = new Geom2dAdaptor_Curve(C); \n\
Standard_Real abscissa = 3; \n\
GCPnts_UniformAbscissa UA (GAC,abscissa); \n\
TColgp_SequenceOfPnt2d aSequence; \n\
@@ -3895,21 +3895,21 @@ void GeomSources::gpTest48(CGeometryDoc* aDoc)
Handle(Geom2d_BSplineCurve) SPL2 = anInterpolation.Curve();
Bnd_Box2d aCBox;
Geom2dAdaptor_Curve GACC (C);
Handle(Geom2dAdaptor_Curve) GACC = new Geom2dAdaptor_Curve(C);
BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox);
Standard_Real aCXmin, aCYmin, aCXmax, aCYmax;
aCBox.Get( aCXmin, aCYmin, aCXmax,aCYmax);
Bnd_Box2d aSPL1Box;
Geom2dAdaptor_Curve GAC1 (SPL1);
Handle(Geom2dAdaptor_Curve) GAC1 = new Geom2dAdaptor_Curve(SPL1);
BndLib_Add2dCurve::Add (GAC1,Precision::Approximation(),aSPL1Box);
Standard_Real aSPL1Xmin,aSPL1Ymin,aSPL1Xmax,aSPL1Ymax;
aSPL1Box.Get( aSPL1Xmin, aSPL1Ymin, aSPL1Xmax,aSPL1Ymax);
Bnd_Box2d aSPL2Box;
Geom2dAdaptor_Curve GAC2 (SPL2);
Handle(Geom2dAdaptor_Curve) GAC2 = new Geom2dAdaptor_Curve(SPL2);
BndLib_Add2dCurve::Add (GAC2,Precision::Approximation(),aSPL2Box);
Standard_Real aSPL2Xmin,aSPL2Ymin,aSPL2Xmax,aSPL2Ymax;
@@ -3930,14 +3930,14 @@ Handle(Geom2d_BSplineCurve) SPL1 ; // SPL1 = ... \n\
Handle(Geom2d_BSplineCurve) SPL2 ; // SPL2 = ... \n\
\n\
Bnd_Box2d aCBox; \n\
Geom2dAdaptor_Curve GACC (C); \n\
Handle(Geom2dAdaptor_Curve) GACC = new Geom2dAdaptor_Curve(C); \n\
BndLib_Add2dCurve::Add (GACC,Precision::Approximation(),aCBox); \n\
\n\
Standard_Real aCXmin, aCYmin, aCXmax, aCYmax; \n\
aCBox.Get( aCXmin, aCYmin, aCXmax,aCYmax); \n\
\n\
Bnd_Box2d aSPL1Box; \n\
Geom2dAdaptor_Curve GAC1 (SPL1); \n\
Handle(Geom2dAdaptor_Curve) GAC1 = new Geom2dAdaptor_Curve(SPL1); \n\
BndLib_Add2dCurve::Add (GAC1,Precision::Approximation(),aSPL1Box); \n\
\n\
Standard_Real aSPL1Xmin,aSPL1Ymin,aSPL1Xmax,aSPL1Ymax; \n\
@@ -3945,7 +3945,7 @@ aSPL1Box.Get( aSPL1Xmin, aSPL1Ymin, aSPL1Xmax,aSPL1Ymax); \n");
Message += "\
\n\
Bnd_Box2d aSPL2Box; \n\
Geom2dAdaptor_Curve GAC2 (SPL2); \n\
Handle(Geom2dAdaptor_Curve) GAC2 = new Geom2dAdaptor_Curve(SPL2); \n\
BndLib_Add2dCurve::Add (GAC2,Precision::Approximation(),aSPL2Box); \n\
\n\
Standard_Real aSPL2Xmin,aSPL2Ymin,aSPL2Xmax,aSPL2Ymax; \n\
@@ -4005,7 +4005,7 @@ void GeomSources::gpTest49(CGeometryDoc* aDoc)
Handle(Geom_Circle) C =
new Geom_Circle(anAxis,radius);
GeomAdaptor_Curve GAC (C);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(C);
BndLib_Add3dCurve::Add (GAC,Precision::Approximation(),aBox);
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ;
@@ -4021,7 +4021,7 @@ gp_Ax2 anAxis(gp_Pnt(0,0,0),gp_Dir(1,2,-5)); \n\
\n\
Handle(Geom_Circle) C = \n\
new Geom_Circle(anAxis,radius); \n\
GeomAdaptor_Curve GAC (C); \n\
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(C); \n\
BndLib_Add3dCurve::Add (GAC,Precision::Approximation(),aBox); \n\
\n\
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ; \n\
@@ -4097,7 +4097,7 @@ void GeomSources::gpTest50(CGeometryDoc* aDoc)
GeomFill_FillingStyle Type = GeomFill_StretchStyle;
GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type);
Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface();
GeomAdaptor_Surface GAS (aSurf);
Handle(GeomAdaptor_Surface) GAS = new GeomAdaptor_Surface(aSurf);
Bnd_Box aBox;
BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox);
@@ -4128,7 +4128,7 @@ Handle(Geom_BSplineCurve) SPL2 = \n\
GeomFill_FillingStyle Type = GeomFill_StretchStyle; \n\
GeomFill_BSplineCurves aGeomFill1(SPL1,SPL2,Type); \n\
Handle(Geom_BSplineSurface) aSurf = aGeomFill1.Surface(); \n\
GeomAdaptor_Surface GAS (aSurf); \n\
Handle(GeomAdaptor_Surface) GAS = new GeomAdaptor_Surface(aSurf); \n\
Bnd_Box aBox; \n\
BndLib_AddSurface::Add (GAS,Precision::Approximation(),aBox); \n\
\n\

View File

@@ -34,7 +34,7 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
Handle(Geom2dAdaptor_Curve) anAdaptor = new Geom2dAdaptor_Curve(myGeom2dCurve);
GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor,1.e-2);
if(anEdgeDistrib.IsDone())
{
@@ -48,9 +48,9 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
if (myDisplayPole)
{
if (anAdaptor.GetType() == GeomAbs_BezierCurve )
if (anAdaptor->GetType() == GeomAbs_BezierCurve )
{
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Handle(Geom2d_BezierCurve) aBezier = anAdaptor->Bezier();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
for(int i=1;i<=aBezier->NbPoles();i++)
{
@@ -60,9 +60,9 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
aPrsGroup->AddPrimitiveArray (anArrayOfVertex);
}
if (anAdaptor.GetType() == GeomAbs_BSplineCurve )
if (anAdaptor->GetType() == GeomAbs_BSplineCurve )
{
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor->BSpline();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex =
new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
@@ -76,12 +76,12 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager)& ,
}
}
if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line))
if (myDisplayCurbure && (anAdaptor->GetType() != GeomAbs_Line))
{
Standard_Integer ii;
Standard_Integer intrv, nbintv = anAdaptor.NbIntervals(GeomAbs_CN);
Standard_Integer intrv, nbintv = anAdaptor->NbIntervals(GeomAbs_CN);
TColStd_Array1OfReal TI(1,nbintv+1);
anAdaptor.Intervals(TI,GeomAbs_CN);
anAdaptor->Intervals(TI,GeomAbs_CN);
Standard_Real Resolution = 1.0e-9, Curvature;
Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution);
gp_Pnt2d P1, P2;

View File

@@ -18,7 +18,7 @@ void ISession_Curve::Compute (const Handle(PrsMgr_PresentationManager)& ,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Curve anAdaptorCurve (myCurve);
Handle(GeomAdaptor_Curve) anAdaptorCurve = new GeomAdaptor_Curve(myCurve);
switch (theMode)
{
case 1:

View File

@@ -22,8 +22,7 @@ void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& ,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
GeomAdaptor_Surface anAdaptorSurface (mySurface);
Handle(GeomAdaptor_Surface) anAdaptorHSurface = new GeomAdaptor_Surface (mySurface);
Handle(GeomAdaptor_Surface) anAdaptorSurface = new GeomAdaptor_Surface (mySurface);
Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer();
aPoleDrawer->SetOwnLineAspects();
@@ -41,7 +40,7 @@ void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& ,
}
case 0:
{
StdPrs_WFSurface::Add (thePrs, anAdaptorHSurface, myDrawer);
StdPrs_WFSurface::Add (thePrs, anAdaptorSurface, myDrawer);
break;
}
}

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;

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

@@ -188,7 +188,7 @@ void AIS_Axis::Compute (const Handle(PrsMgr_PresentationManager)& ,
thePrs->SetInfiniteState (myInfiniteState);
if (!myIsXYZAxis)
{
GeomAdaptor_Curve curv (myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
StdPrs_Curve::Add (thePrs, curv, myDrawer);
}
else

View File

@@ -211,7 +211,7 @@ void AIS_Circle::UnsetWidth()
void AIS_Circle::ComputeCircle (const Handle(Prs3d_Presentation)& thePresentation)
{
GeomAdaptor_Curve curv(myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient (1.e-5);
StdPrs_DeflectionCurve::Add (thePresentation, curv, myDrawer);
@@ -226,7 +226,7 @@ void AIS_Circle::ComputeCircle (const Handle(Prs3d_Presentation)& thePresentatio
//=======================================================================
void AIS_Circle::ComputeArc (const Handle(Prs3d_Presentation)& thePresentation)
{
GeomAdaptor_Curve curv(myComponent, myUStart, myUEnd);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent, myUStart, myUEnd);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient (1.e-5);
StdPrs_DeflectionCurve::Add (thePresentation, curv, myDrawer);

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
@@ -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());
}

View File

@@ -211,7 +211,7 @@ void AIS_Line::UnsetWidth()
//=======================================================================
void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentation)
{
GeomAdaptor_Curve curv(myComponent);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent);
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
//pas de prise en compte lors du FITALL
@@ -230,7 +230,7 @@ void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentati
myComponent = new Geom_Line(P1,gp_Dir(P2.XYZ()-P1.XYZ()));
Standard_Real dist = P1.Distance(P2);
GeomAdaptor_Curve curv(myComponent,0.,dist);
Handle(GeomAdaptor_Curve) curv = new GeomAdaptor_Curve(myComponent,0.,dist);
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
}

View File

@@ -222,7 +222,7 @@ void AIS_Plane::Compute (const Handle(PrsMgr_PresentationManager)& ,
ComputeFrame();
const Handle(Geom_Plane)& pl = myComponent;
Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
GeomAdaptor_Surface surf(thegoodpl);
Handle(GeomAdaptor_Surface) surf = new GeomAdaptor_Surface(thegoodpl);
StdPrs_Plane::Add (thePrs, surf, myDrawer);
}
else

View File

@@ -93,7 +93,7 @@ static void findfourpoints(const Standard_Real ,
}
}
/*static Standard_Real curvature(const Standard_Real U, const Adaptor3d_Curve& C)
/*static Standard_Real curvature(const Standard_Real U, const Handle(Adaptor3d_Curve)& C)
{
Standard_Real k, tau, mod1, mod2, OMEGA;
gp_Pnt P;
@@ -151,34 +151,40 @@ Approx_CurvlinFunc::Approx_CurvlinFunc(const Handle(Adaptor2d_Curve2d)& C2D1, co
void Approx_CurvlinFunc::Init()
{
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
switch(myCase) {
case 1:
Init (*myC3D, mySi_1, myUi_1);
{
Init(myC3D, mySi_1, myUi_1);
myFirstU1 = myC3D->FirstParameter();
myLastU1 = myC3D->LastParameter();
myFirstU2 = myLastU2 = 0;
break;
}
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
{
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
CurOnSur->Load(myC2D1);
CurOnSur->Load(mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur.FirstParameter();
myLastU1 = CurOnSur.LastParameter();
myFirstU1 = CurOnSur->FirstParameter();
myLastU1 = CurOnSur->LastParameter();
myFirstU2 = myLastU2 = 0;
break;
}
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
{
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
Init(CurOnSur, mySi_1, myUi_1);
myFirstU1 = CurOnSur.FirstParameter();
myLastU1 = CurOnSur.LastParameter();
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
myFirstU1 = CurOnSur->FirstParameter();
myLastU1 = CurOnSur->LastParameter();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
Init(CurOnSur, mySi_2, myUi_2);
myFirstU2 = CurOnSur.FirstParameter();
myLastU2 = CurOnSur.LastParameter();
myFirstU2 = CurOnSur->FirstParameter();
myLastU2 = CurOnSur->LastParameter();
}
}
Length();
@@ -190,20 +196,20 @@ void Approx_CurvlinFunc::Init()
//purpose : Init the values
//history : 23/10/1998 PMN : Cut at curve's discontinuities
//=======================================================================
void Approx_CurvlinFunc::Init(Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si,
void Approx_CurvlinFunc::Init (const Handle(Adaptor3d_Curve)& C, Handle(TColStd_HArray1OfReal)& Si,
Handle(TColStd_HArray1OfReal)& Ui) const
{
Standard_Real Step, FirstU, LastU;
Standard_Integer i, j, k, NbInt, NbIntC3;
FirstU = C.FirstParameter();
LastU = C.LastParameter();
FirstU = C->FirstParameter();
LastU = C->LastParameter();
NbInt = 10;
NbIntC3 = C.NbIntervals(GeomAbs_C3);
NbIntC3 = C->NbIntervals(GeomAbs_C3);
TColStd_Array1OfReal Disc(1, NbIntC3+1);
if (NbIntC3 >1) {
C.Intervals(Disc, GeomAbs_C3);
C->Intervals(Disc, GeomAbs_C3);
}
else {
Disc(1) = FirstU;
@@ -325,46 +331,44 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
if ((Last - First) < Tol) return;
Standard_Real FirstU, LastU;
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) HCurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
Handle(Adaptor3d_CurveOnSurface) TCurOnSur;
switch(myCase) {
case 1:
myC3D = myC3D->Trim(myFirstU1, myLastU1, Tol);
FirstU = GetUParameter(*myC3D, First, 1);
LastU = GetUParameter (*myC3D, Last, 1);
FirstU = GetUParameter(myC3D, First, 1);
LastU = GetUParameter (myC3D, Last, 1);
myC3D = myC3D->Trim(FirstU, LastU, Tol);
break;
case 3:
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(myFirstU2, myLastU2, Tol));
myC2D2 = HCurOnSur->GetCurve();
mySurf2 = HCurOnSur->GetSurface();
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D2, mySurf2);
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(myFirstU2, myLastU2, Tol));
myC2D2 = TCurOnSur->GetCurve();
mySurf2 = TCurOnSur->GetSurface();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
FirstU = GetUParameter(CurOnSur, First, 1);
LastU = GetUParameter(CurOnSur, Last, 1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(FirstU, LastU, Tol));
myC2D2 = HCurOnSur->GetCurve();
mySurf2 = HCurOnSur->GetSurface();
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(FirstU, LastU, Tol));
myC2D2 = TCurOnSur->GetCurve();
mySurf2 = TCurOnSur->GetSurface();
Standard_FALLTHROUGH
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(myFirstU1, myLastU1, Tol));
myC2D1 = HCurOnSur->GetCurve();
mySurf1 = HCurOnSur->GetSurface();
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(myFirstU1, myLastU1, Tol));
myC2D1 = TCurOnSur->GetCurve();
mySurf1 = TCurOnSur->GetSurface();
CurOnSur->Load(myC2D1);
CurOnSur->Load(mySurf1);
FirstU = GetUParameter(CurOnSur, First, 1);
LastU = GetUParameter(CurOnSur, Last, 1);
HCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur.Trim(FirstU, LastU, Tol));
myC2D1 = HCurOnSur->GetCurve();
mySurf1 = HCurOnSur->GetSurface();
TCurOnSur = Handle(Adaptor3d_CurveOnSurface)::DownCast (CurOnSur->Trim(FirstU, LastU, Tol));
myC2D1 = TCurOnSur->GetCurve();
mySurf1 = TCurOnSur->GetSurface();
}
myFirstS = First;
myLastS = Last;
@@ -372,41 +376,39 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
void Approx_CurvlinFunc::Length()
{
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
Standard_Real FirstU, LastU;
switch(myCase){
case 1:
FirstU = myC3D->FirstParameter();
LastU = myC3D->LastParameter();
myLength = Length (*myC3D, FirstU, LastU);
myLength = Length (myC3D, FirstU, LastU);
myLength1 = myLength2 = 0;
break;
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength = Length(CurOnSur, FirstU, LastU);
myLength1 = myLength2 = 0;
break;
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength1 = Length(CurOnSur, FirstU, LastU);
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
FirstU = CurOnSur.FirstParameter();
LastU = CurOnSur.LastParameter();
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
FirstU = CurOnSur->FirstParameter();
LastU = CurOnSur->LastParameter();
myLength2 = Length(CurOnSur, FirstU, LastU);
myLength = (myLength1 + myLength2)/2;
}
}
Standard_Real Approx_CurvlinFunc::Length(Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LastU) const
Standard_Real Approx_CurvlinFunc::Length(const Handle(Adaptor3d_Curve)& C, const Standard_Real FirstU, const Standard_Real LastU) const
{
Standard_Real Length;
@@ -423,23 +425,21 @@ Standard_Real Approx_CurvlinFunc::GetLength() const
Standard_Real Approx_CurvlinFunc::GetSParameter(const Standard_Real U) const
{
Standard_Real S=0, S1, S2;
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) CurOnSur;
switch (myCase) {
case 1:
S = GetSParameter (*myC3D, U, myLength);
S = GetSParameter (myC3D, U, myLength);
break;
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
S = GetSParameter(CurOnSur, U, myLength);
break;
case 3:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
S1 = GetSParameter(CurOnSur, U, myLength1);
CurOnSur.Load(myC2D2);
CurOnSur.Load(mySurf2);
CurOnSur->Load(myC2D2);
CurOnSur->Load(mySurf2);
S2 = GetSParameter(CurOnSur, U, myLength2);
S = (S1 + S2)/2;
}
@@ -448,7 +448,7 @@ Standard_Real Approx_CurvlinFunc::GetSParameter(const Standard_Real U) const
Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
Standard_Real Approx_CurvlinFunc::GetUParameter (const Handle(Adaptor3d_Curve)& C,
const Standard_Real S,
const Standard_Integer NumberOfCurve) const
{
@@ -513,11 +513,11 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
return U;
}
Standard_Real Approx_CurvlinFunc::GetSParameter(Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Len) const
Standard_Real Approx_CurvlinFunc::GetSParameter(const Handle(Adaptor3d_Curve)& C, const Standard_Real U, const Standard_Real Len) const
{
Standard_Real S, Origin;
Origin = C.FirstParameter();
Origin = C->FirstParameter();
S = myFirstS + Length(C, Origin, U)/Len;
return S;
}
@@ -530,7 +530,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase1(const Standard_Real S, const Stan
gp_Vec dC_dU, dC_dS, d2C_dU2, d2C_dS2;
Standard_Real U, Mag, dU_dS, d2U_dS2;
U = GetUParameter (*myC3D, S, 1);
U = GetUParameter (myC3D, S, 1);
switch(Order) {
@@ -613,7 +613,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCurOnSur(const Standard_Real S, const S
if (NumberOfCurve == 1) {
Cur2D = myC2D1;
Surf = mySurf1;
Adaptor3d_CurveOnSurface CurOnSur(myC2D1, mySurf1);
Handle(Adaptor3d_CurveOnSurface) CurOnSur = new Adaptor3d_CurveOnSurface(myC2D1, mySurf1);
U = GetUParameter(CurOnSur, S, 1);
if(myCase == 3) Length = myLength1;
else Length = myLength;
@@ -621,7 +621,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCurOnSur(const Standard_Real S, const S
else if (NumberOfCurve == 2) {
Cur2D = myC2D2;
Surf = mySurf2;
Adaptor3d_CurveOnSurface CurOnSur(myC2D2, mySurf2);
Handle(Adaptor3d_CurveOnSurface) CurOnSur = new Adaptor3d_CurveOnSurface(myC2D2, mySurf2);
U = GetUParameter(CurOnSur, S, 2);
Length = myLength2;
}

View File

@@ -64,14 +64,14 @@ public:
Standard_EXPORT void Length();
//! Computes length of the curve segment.
Standard_EXPORT Standard_Real Length (Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LasrU) const;
Standard_EXPORT Standard_Real Length (const Handle(Adaptor3d_Curve)& C, const Standard_Real FirstU, const Standard_Real LasrU) const;
Standard_EXPORT Standard_Real GetLength() const;
//! returns original parameter corresponding S. if
//! Case == 1 computation is performed on myC2D1 and mySurf1,
//! otherwise it is done on myC2D2 and mySurf2.
Standard_EXPORT Standard_Real GetUParameter (Adaptor3d_Curve& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const;
Standard_EXPORT Standard_Real GetUParameter (const Handle(Adaptor3d_Curve)& C, const Standard_Real S, const Standard_Integer NumberOfCurve) const;
//! returns original parameter corresponding S.
Standard_EXPORT Standard_Real GetSParameter (const Standard_Real U) const;
@@ -100,10 +100,10 @@ private:
Standard_EXPORT void Init();
Standard_EXPORT void Init (Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const;
Standard_EXPORT void Init (const Handle(Adaptor3d_Curve)& C, Handle(TColStd_HArray1OfReal)& Si, Handle(TColStd_HArray1OfReal)& Ui) const;
//! returns curvilinear parameter corresponding U.
Standard_EXPORT Standard_Real GetSParameter (Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Length) const;
Standard_EXPORT Standard_Real GetSParameter (const Handle(Adaptor3d_Curve)& C, const Standard_Real U, const Standard_Real Length) const;
Standard_EXPORT Standard_Boolean EvalCurOnSur (const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result, const Standard_Integer NumberOfCurve) const;

View File

@@ -111,7 +111,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
const gp_Pnt& APoint,
const Standard_Real Tolerance,
const Standard_Integer NumIteration,
const Adaptor3d_Curve& Curve,
const Handle(Adaptor3d_Curve)& Curve,
Standard_Boolean& Status,
Standard_Real& Result)
{
@@ -125,7 +125,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
do
{
num_iter++;
Curve.D2(param, a_point, d1, d2);
Curve->D2(param, a_point, d1, d2);
vector = gp_Vec(a_point,APoint);
func = vector.Dot(d1);
@@ -143,8 +143,8 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
if( Abs(func_derivative) > Toler )
param -= func / func_derivative;
param = Max(param,Curve.FirstParameter());
param = Min(param,Curve.LastParameter());
param = Max(param,Curve->FirstParameter());
param = Min(param,Curve->LastParameter());
}
} while (not_done && num_iter <= NumIteration);
@@ -156,7 +156,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
//purpose :
//=======================================================================
static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
const Adaptor3d_CurveOnSurface& cons,
const Handle(Adaptor3d_CurveOnSurface)& cons,
const Standard_Integer nbp)
{
Standard_Real d2 = 0.0; // Square max discrete deviation.
@@ -170,7 +170,7 @@ static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d,
try
{
Pc3d = c3d->Value(u);
Pcons = cons.Value(u);
Pcons = cons->Value(u);
}
catch (Standard_Failure const&)
{
@@ -202,7 +202,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
const Standard_Integer nbp,
const Standard_Real *pc3d,
const Handle(Adaptor3d_Curve)& c3d,
const Adaptor3d_CurveOnSurface& cons,
const Handle(Adaptor3d_CurveOnSurface)& cons,
Standard_Real& tol,
const Standard_Real oldtol)
{
@@ -217,8 +217,8 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
Standard_Real aParamFirst = 3.0 * pc3d[0] - 2.0 * pc3d[nbp - 1];
Standard_Real aParamLast = 3.0 * pc3d[nbp - 1] - 2.0 * pc3d[0];
Standard_Real FirstPar = cons.FirstParameter();
Standard_Real LastPar = cons.LastParameter();
Standard_Real FirstPar = cons->FirstParameter();
Standard_Real LastPar = cons->LastParameter();
if (aParamFirst < FirstPar)
aParamFirst = FirstPar;
if (aParamLast > LastPar)
@@ -247,7 +247,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
return Standard_False;
}
tprev = tcons;
gp_Pnt Pcons = cons.Value(tcons);
gp_Pnt Pcons = cons->Value(tcons);
Standard_Real temp = Pc3d.SquareDistance(Pcons);
if(temp > d2) d2 = temp;
}
@@ -337,9 +337,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
// Create and fill data structure.
Approx_SameParameter_Data aData;
aData.myCOnS = Adaptor3d_CurveOnSurface(myHCurve2d,mySurf);
aData.myC2dPF = aData.myCOnS.FirstParameter();
aData.myC2dPL = aData.myCOnS.LastParameter();
aData.myCOnS = new Adaptor3d_CurveOnSurface(myHCurve2d,mySurf);
aData.myC2dPF = aData.myCOnS->FirstParameter();
aData.myC2dPL = aData.myCOnS->LastParameter();
aData.myC3dPF = myC3d->FirstParameter();
aData.myC3dPL = myC3d->LastParameter();
aData.myNbPnt = 0; // No points initially.
@@ -376,7 +376,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if(aData.myNbPnt < aNbPnt )
{
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
myCurve2d = Geom2dAdaptor::MakeCurve (*myHCurve2d);
myCurve2d = Geom2dAdaptor::MakeCurve (myHCurve2d);
myDone = Standard_False;
return;
}
@@ -444,11 +444,11 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if (anApproximator.IsDone() || anApproximator.HasResult())
{
Adaptor3d_CurveOnSurface ACS = aData.myCOnS;
Handle(Adaptor3d_CurveOnSurface) ACS = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS->ShallowCopy());
GeomLib_MakeCurvefromApprox aCurveBuilder(anApproximator);
Handle(Geom2d_BSplineCurve) aC2d = aCurveBuilder.Curve2dFromTwo1d(1,2);
Handle(Adaptor2d_Curve2d) aHCurve2d = new Geom2dAdaptor_Curve(aC2d);
aData.myCOnS.Load(aHCurve2d);
aData.myCOnS->Load(aHCurve2d);
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
const Standard_Real aMult = 250.0; // To be tolerant with discrete tolerance.
@@ -482,9 +482,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
// using data from the last loop iteration or initial data. Use data set with minimal deflection.
// Original 2d curve.
aData.myCOnS.Load(myHCurve2d);
aData.myCOnS->Load(myHCurve2d);
myTolReached = ComputeTolReached(myC3d,aData.myCOnS, 2 * myNbSamples);
myCurve2d = Geom2dAdaptor::MakeCurve (*myHCurve2d);
myCurve2d = Geom2dAdaptor::MakeCurve (myHCurve2d);
// Approximation curve.
Standard_Integer num_knots = aData.myNbPnt + 7;
@@ -515,7 +515,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
GeomLib_MakeCurvefromApprox aCurveBuilder(anApproximator);
Handle(Geom2d_BSplineCurve) aC2d = aCurveBuilder.Curve2dFromTwo1d(1,2);
Handle(Adaptor2d_Curve2d) aHCurve2d = new Geom2dAdaptor_Curve(aC2d);
aData.myCOnS.Load(aHCurve2d);
aData.myCOnS->Load(aHCurve2d);
Standard_Real anApproxTol = ComputeTolReached(myC3d,aData.myCOnS,2 * myNbSamples);
if (anApproxTol < myTolReached)
@@ -527,7 +527,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
myDone = Standard_True;
}
myCurveOnSurface = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS.ShallowCopy());
myCurveOnSurface = Handle(Adaptor3d_CurveOnSurface)::DownCast(aData.myCOnS->ShallowCopy());
}
//=======================================================================
@@ -643,18 +643,18 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
// Compute initial distance on boundary points.
gp_Pnt Pcons, Pc3d;
theData.myCOnS.D0(theData.myC2dPF, Pcons);
theData.myCOnS->D0(theData.myC2dPF, Pcons);
myC3d->D0(theData.myC3dPF, Pc3d);
Standard_Real dist2 = Pcons.SquareDistance(Pc3d);
Standard_Real dmax2 = dist2;
theData.myCOnS.D0(theData.myC2dPL, Pcons);
theData.myCOnS->D0(theData.myC2dPL, Pcons);
myC3d->D0(theData.myC3dPL, Pc3d);
dist2 = Pcons.SquareDistance(Pc3d);
dmax2 = Max(dmax2, dist2);
Extrema_LocateExtPC Projector;
Projector.Initialize (*myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Projector.Initialize (myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Standard_Integer count = 1;
Standard_Real previousp = theData.myC3dPF, initp=0, curp;
@@ -662,7 +662,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
Standard_Boolean isProjOk = Standard_False;
for (Standard_Integer ii = 1; ii < theData.myNbPnt; ii++)
{
theData.myCOnS.D0(theData.myPC2d[ii],Pcons);
theData.myCOnS->D0(theData.myPC2d[ii],Pcons);
myC3d->D0(theData.myPC3d[ii],Pc3d);
dist2 = Pcons.SquareDistance(Pc3d);
@@ -692,7 +692,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
}
else
{
ProjectPointOnCurve(initp,Pcons,theData.myTol,30, *myC3d,isProjOk,curp);
ProjectPointOnCurve(initp,Pcons,theData.myTol,30, myC3d,isProjOk,curp);
}
isProjOk = isProjOk && // Good projection.
curp > previousp + myDeltaMin && // Point is separated from previous.
@@ -706,7 +706,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
}
// Whole parameter space search using general extrema.
Extrema_ExtPC PR(Pcons, *myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Extrema_ExtPC PR(Pcons, myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
if (!PR.IsDone() || PR.NbExt() == 0) // Lazy evaluation is used.
continue;
@@ -747,7 +747,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
//function : ComputeTangents
//purpose : Sub-method in Build.
//=======================================================================
Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSurface & theCOnS,
Standard_Boolean Approx_SameParameter::ComputeTangents(const Handle(Adaptor3d_CurveOnSurface) & theCOnS,
Standard_Real &theFirstTangent,
Standard_Real &theLastTangent) const
{
@@ -758,7 +758,7 @@ Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSu
// First point.
const Standard_Real aParamFirst = myC3d->FirstParameter();
theCOnS.D1(aParamFirst, aPntCOnS, aVecConS);
theCOnS->D1(aParamFirst, aPntCOnS, aVecConS);
myC3d->D1(aParamFirst, aPnt, aVec);
Standard_Real aMagnitude = aVecConS.Magnitude();
if (aMagnitude > aSmallMagnitude)
@@ -768,7 +768,7 @@ Standard_Boolean Approx_SameParameter::ComputeTangents(const Adaptor3d_CurveOnSu
// Last point.
const Standard_Real aParamLast = myC3d->LastParameter();
theCOnS.D1(aParamLast,aPntCOnS,aVecConS);
theCOnS->D1(aParamLast,aPntCOnS,aVecConS);
myC3d->D1(aParamLast, aPnt, aVec);
aMagnitude = aVecConS.Magnitude();
@@ -834,7 +834,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real &theBestSqTol) const
{
Extrema_LocateExtPC Projector;
Projector.Initialize (*myC3d, myC3d->FirstParameter(), myC3d->LastParameter(), theData.myTol);
Projector.Initialize (myC3d, myC3d->FirstParameter(), myC3d->LastParameter(), theData.myTol);
Standard_Real curp = 0.0;
Standard_Boolean projok = Standard_False;
@@ -862,7 +862,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real uc3d = 0.5*(theData.myPC3d[ii]+theData.myPC3d[ii+1]);
gp_Pnt Pcons;
theData.myCOnS.D0(ucons,Pcons);
theData.myCOnS->D0(ucons,Pcons);
Projector.Perform(Pcons, uc3d);
if (Projector.IsDone())
{
@@ -873,7 +873,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
}
else
{
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, *myC3d,projok,curp);
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, myC3d,projok,curp);
}
if(projok)
{
@@ -910,7 +910,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
Standard_Real uc3d = 0.5*(theData.myPC3d[n]+theData.myPC3d[n+1]);
gp_Pnt Pcons;
theData.myCOnS.D0(ucons,Pcons);
theData.myCOnS->D0(ucons,Pcons);
Projector.Perform(Pcons, uc3d);
if (Projector.IsDone())
{
@@ -921,7 +921,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
}
else
{
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, *myC3d,projok,curp);
ProjectPointOnCurve(uc3d,Pcons,theData.myTol,30, myC3d,projok,curp);
}
if(projok)
{

View File

@@ -103,7 +103,7 @@ private:
//! a lot of memory is used in intermediate computations.
struct Approx_SameParameter_Data
{
Adaptor3d_CurveOnSurface myCOnS; // Curve on surface.
Handle(Adaptor3d_CurveOnSurface) myCOnS; // Curve on surface.
Standard_Integer myNbPnt; // Number of points.
Standard_Real *myPC3d; // Parameters on 3d curve.
Standard_Real *myPC2d; // Parameters on 2d curve.
@@ -155,7 +155,7 @@ private:
//! Computes tangents on boundary points.
//@return true if tangents are not null and false otherwise.
Standard_Boolean ComputeTangents(const Adaptor3d_CurveOnSurface & theCOnS,
Standard_Boolean ComputeTangents(const Handle(Adaptor3d_CurveOnSurface) & theCOnS,
Standard_Real &theFirstTangent,
Standard_Real &theLastTangent) const;

View File

@@ -640,7 +640,7 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange)
{
// At this stage, context should contain adaptor for all intersected faces,
// so getting a type of the underlying surface should be done at no cost.
if (myContext->SurfaceAdaptor(TopoDS::Face(aF)).GetType() == GeomAbs_Plane)
if (myContext->SurfaceAdaptor(TopoDS::Face(aF))->GetType() == GeomAbs_Plane)
{
// Check bounding box of the face - it should not be open in any side
const Bnd_Box& aBox = aSI.Box();

View File

@@ -889,7 +889,7 @@ Standard_Boolean BOPAlgo_PaveFiller::GetPBBox(const TopoDS_Edge& theE,
}
else {
// build bounding box
BRepAdaptor_Curve aBAC(theE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(theE);
Standard_Real aTol = BRep_Tool::Tolerance(theE) + Precision::Confusion();
BndLib_Add3dCurve::Add(aBAC, theSFirst, theSLast, aTol, theBox);
thePBBox.Bind(thePB, theBox);

View File

@@ -373,9 +373,9 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange)
//
Standard_Boolean bLinePlane = Standard_False;
if (aNbCPrts) {
BRepAdaptor_Curve aBAC(aE);
bLinePlane = (aBAC.GetType() == GeomAbs_Line &&
myContext->SurfaceAdaptor(aF).GetType() == GeomAbs_Plane);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
bLinePlane = (aBAC->GetType() == GeomAbs_Line &&
myContext->SurfaceAdaptor(aF)->GetType() == GeomAbs_Plane);
}
//
for (i=1; i<=aNbCPrts; ++i) {
@@ -916,7 +916,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
// Projection tool
GeomAPI_ProjectPointOnSurf& aProjPS = myContext->ProjPS(aF);
BRepAdaptor_Surface& aSurfAdaptor = myContext->SurfaceAdaptor (aF);
const Handle(BRepAdaptor_Surface)& aSurfAdaptor = myContext->SurfaceAdaptor (aF);
// Iterate on pave blocks and combine pairs containing
// the same vertices
@@ -996,7 +996,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
if (!myContext->IsPointInFace(aF, gp_Pnt2d(U, V)))
continue;
if (aSurfAdaptor.GetType() != GeomAbs_Plane ||
if (aSurfAdaptor->GetType() != GeomAbs_Plane ||
aBAC.GetType() != GeomAbs_Line)
{
gp_Pnt aPOnS = aProjPS.NearestPoint();

View File

@@ -76,8 +76,8 @@
#include <TopTools_ListOfShape.hxx>
//
static Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1,
const BRepAdaptor_Surface& aBAS2);
static Standard_Real ToleranceFF(const Handle(BRepAdaptor_Surface)& aBAS1,
const Handle(BRepAdaptor_Surface)& aBAS2);
/////////////////////////////////////////////////////////////////////////
//=======================================================================
@@ -322,10 +322,10 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
const TopoDS_Face& aF1 = (*(TopoDS_Face *)(&myDS->Shape(nF1)));
const TopoDS_Face& aF2 = (*(TopoDS_Face *)(&myDS->Shape(nF2)));
//
const BRepAdaptor_Surface& aBAS1 = myContext->SurfaceAdaptor(aF1);
const BRepAdaptor_Surface& aBAS2 = myContext->SurfaceAdaptor(aF2);
if (aBAS1.GetType() == GeomAbs_Plane &&
aBAS2.GetType() == GeomAbs_Plane) {
const Handle(BRepAdaptor_Surface)& aBAS1 = myContext->SurfaceAdaptor(aF1);
const Handle(BRepAdaptor_Surface)& aBAS2 = myContext->SurfaceAdaptor(aF2);
if (aBAS1->GetType() == GeomAbs_Plane &&
aBAS2->GetType() == GeomAbs_Plane) {
// Check if the planes are really interfering
Standard_Boolean bToIntersect = CheckPlanes(nF1, nF2);
if (!bToIntersect) {
@@ -347,8 +347,8 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
// Keep shift value to use it as the tolerance for intersection curves
Standard_Real aShiftValue = 0.;
if (aBAS1.GetType() != GeomAbs_Plane ||
aBAS2.GetType() != GeomAbs_Plane) {
if (aBAS1->GetType() != GeomAbs_Plane ||
aBAS2->GetType() != GeomAbs_Plane) {
Standard_Boolean isFound = Standard_False;
for (TopExp_Explorer aExp1(aF1, TopAbs_EDGE); !isFound && aExp1.More(); aExp1.Next())
@@ -785,7 +785,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
//
// check if the pave block has a valid range
Standard_Real aFirst, aLast;
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aTolR3D,
if (!BRepLib::FindValidRange(new GeomAdaptor_Curve(aIC.Curve()), aTolR3D,
aT1, BRep_Tool::Pnt(aV1), Max (aTolR3D, BRep_Tool::Tolerance(aV1)),
aT2, BRep_Tool::Pnt(aV2), Max (aTolR3D, BRep_Tool::Tolerance(aV2)),
aFirst, aLast))
@@ -3176,7 +3176,7 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC)
// Check if there will be valid range on the curve
Standard_Real aFirst, aLast;
Standard_Real aNewTolV = Max(aTolV, aDistVP + BOPTools_AlgoTools::DTolerance());
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(),
if (!BRepLib::FindValidRange(new GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(),
aT[0], aP[0], aNewTolV,
aT[1], aP[1], aNewTolV,
aFirst, aLast))
@@ -3479,25 +3479,25 @@ void BOPAlgo_PaveFiller::RemovePaveBlocks(const TColStd_MapOfInteger& theEdges)
//purpose : Computes the TolFF according to the tolerance value and
// types of the faces.
//=======================================================================
Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1,
const BRepAdaptor_Surface& aBAS2)
Standard_Real ToleranceFF(const Handle(BRepAdaptor_Surface)& aBAS1,
const Handle(BRepAdaptor_Surface)& aBAS2)
{
Standard_Real aTol1 = aBAS1.Tolerance();
Standard_Real aTol2 = aBAS2.Tolerance();
Standard_Real aTol1 = aBAS1->Tolerance();
Standard_Real aTol2 = aBAS2->Tolerance();
Standard_Real aTolFF = Max(aTol1, aTol2);
//
Standard_Boolean isAna1, isAna2;
isAna1 = (aBAS1.GetType() == GeomAbs_Plane ||
aBAS1.GetType() == GeomAbs_Cylinder ||
aBAS1.GetType() == GeomAbs_Cone ||
aBAS1.GetType() == GeomAbs_Sphere ||
aBAS1.GetType() == GeomAbs_Torus);
isAna1 = (aBAS1->GetType() == GeomAbs_Plane ||
aBAS1->GetType() == GeomAbs_Cylinder ||
aBAS1->GetType() == GeomAbs_Cone ||
aBAS1->GetType() == GeomAbs_Sphere ||
aBAS1->GetType() == GeomAbs_Torus);
//
isAna2 = (aBAS2.GetType() == GeomAbs_Plane ||
aBAS2.GetType() == GeomAbs_Cylinder ||
aBAS2.GetType() == GeomAbs_Cone ||
aBAS2.GetType() == GeomAbs_Sphere ||
aBAS2.GetType() == GeomAbs_Torus);
isAna2 = (aBAS2->GetType() == GeomAbs_Plane ||
aBAS2->GetType() == GeomAbs_Cylinder ||
aBAS2->GetType() == GeomAbs_Cone ||
aBAS2->GetType() == GeomAbs_Sphere ||
aBAS2->GetType() == GeomAbs_Torus);
//
if (!isAna1 || !isAna2) {
aTolFF = Max(aTolFF, 5.e-6);

View File

@@ -277,8 +277,8 @@ class BOPAlgo_MPC : public BOPAlgo_ParallelAlgo {
}
else
{
const BRepAdaptor_Surface& aBAS = myContext->SurfaceAdaptor(myF);
if (aBAS.IsUPeriodic() || aBAS.IsVPeriodic())
const Handle(BRepAdaptor_Surface)& aBAS = myContext->SurfaceAdaptor(myF);
if (aBAS->IsUPeriodic() || aBAS->IsVPeriodic())
{
// The curve already exists. Adjust it for periodic cases.
BOPTools_AlgoTools2D::AdjustPCurveOnSurf

View File

@@ -254,15 +254,15 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
const TopoDS_Face& aDF = (*(TopoDS_Face *)(&myDS->Shape(nFD)));
//
Standard_Real aTolV = BRep_Tool::Tolerance(aDV);
const BRepAdaptor_Surface& aBAS = myContext->SurfaceAdaptor(aDF);
const Handle(BRepAdaptor_Surface)& aBAS = myContext->SurfaceAdaptor(aDF);
//
// 2D intersection tolerance should be computed as a resolution
// from the tolerance of vertex to resolve the touching cases
Standard_Real aTolInt = Precision::PConfusion();
// UResolution from the tolerance of the vertex
Standard_Real aURes = aBAS.UResolution(aTolV);
Standard_Real aURes = aBAS->UResolution(aTolV);
// VResolution from the tolerance of the vertex
Standard_Real aVRes = aBAS.VResolution(aTolV);
Standard_Real aVRes = aBAS->VResolution(aTolV);
//
aTolInt = Max(aTolInt, Max(aURes, aVRes));
//
@@ -279,8 +279,7 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
aTolCmp = Max(aTolCmp, (bUDir ? aURes : aVRes));
//
// Prepare adaptor for the degenerated edge for intersection
Geom2dAdaptor_Curve aGAC1;
aGAC1.Load(aC2DDE, aTD1, aTD2);
Handle(Geom2dAdaptor_Curve) aGAC1 = new Geom2dAdaptor_Curve(aC2DDE, aTD1, aTD2);
//
BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPBOut);
for (; aItLPB.More(); aItLPB.Next()) {
@@ -297,14 +296,14 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
}
//
// Prepare adaptor for the passing edge for intersection
Geom2dAdaptor_Curve aGAC2;
Handle(Geom2dAdaptor_Curve) aGAC2 = new Geom2dAdaptor_Curve();
//
Handle(Geom2d_Line) aL2D = Handle(Geom2d_Line)::DownCast(aC2D);
if (!aL2D.IsNull()) {
aGAC2.Load(aC2D);
aGAC2->Load(aC2D);
}
else {
aGAC2.Load(aC2D, aT1, aT2);
aGAC2->Load(aC2D, aT1, aT2);
}
// Intersection
Geom2dInt_GInter aGInter(aGAC1, aGAC2, aTolInt, aTolInt);

View File

@@ -69,7 +69,7 @@ static
TopTools_MapOfShape& theMEdgesNoUniquePlane);
static
Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindPlane(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Pln& thePlane);
static
@@ -84,7 +84,7 @@ static
gp_Dir& theTgt);
static
Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindEdgeTangent(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Vec& theTangent);
//=======================================================================
@@ -410,7 +410,7 @@ Standard_Integer BOPAlgo_Tools::EdgesToWires(const TopoDS_Shape& theEdges,
aExp.Init(aSEdges, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE = TopoDS::Edge(aExp.Current());
BRepAdaptor_Curve aBAC(aE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
//
gp_Pln aPln;
if (FindPlane(aBAC, aPln)) {
@@ -773,7 +773,7 @@ Standard_Boolean FindEdgeTangent(const TopoDS_Edge& theEdge,
gp_Dir *pDTE = theDMEdgeTgt.ChangeSeek(theEdge);
if (!pDTE) {
gp_Vec aVTE;
BRepAdaptor_Curve aBAC(theEdge);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(theEdge);
if (!FindEdgeTangent(aBAC, aVTE)) {
return Standard_False;
}
@@ -787,26 +787,26 @@ Standard_Boolean FindEdgeTangent(const TopoDS_Edge& theEdge,
//function : FindEdgeTangent
//purpose : Finds the tangent for the edge
//=======================================================================
Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindEdgeTangent(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Vec& theTangent)
{
if (!theCurve.Is3DCurve()) {
if (!theCurve->Is3DCurve()) {
return Standard_False;
}
// for the line the tangent is defined by the direction
if (theCurve.GetType() == GeomAbs_Line) {
theTangent = theCurve.Line().Position().Direction();
if (theCurve->GetType() == GeomAbs_Line) {
theTangent = theCurve->Line().Position().Direction();
return Standard_True;
}
//
// for other curves take D1 and check for its length
Standard_Real aT, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter());
Standard_Real aT, aT1(theCurve->FirstParameter()), aT2(theCurve->LastParameter());
const Standard_Integer aNbP = 11;
const Standard_Real aDt = (aT2 - aT1) / aNbP;
//
for (aT = aT1 + aDt; aT <= aT2; aT += aDt) {
gp_Pnt aP;
theCurve.D1(aT, aP, theTangent);
theCurve->D1(aT, aP, theTangent);
if (theTangent.Magnitude() > Precision::Confusion()) {
return Standard_True;
}
@@ -819,47 +819,47 @@ Standard_Boolean FindEdgeTangent(const BRepAdaptor_Curve& theCurve,
//function : FindPlane
//purpose : Finds the plane in which the edge is located
//=======================================================================
Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
Standard_Boolean FindPlane(const Handle(BRepAdaptor_Curve)& theCurve,
gp_Pln& thePlane)
{
if (!theCurve.Is3DCurve()) {
if (!theCurve->Is3DCurve()) {
return Standard_False;
}
//
Standard_Boolean bFound = Standard_True;
gp_Vec aVN;
switch (theCurve.GetType()) {
switch (theCurve->GetType()) {
case GeomAbs_Line:
return Standard_False;
case GeomAbs_Circle:
aVN = theCurve.Circle().Position().Direction();
aVN = theCurve->Circle().Position().Direction();
break;
case GeomAbs_Ellipse:
aVN = theCurve.Ellipse().Position().Direction();
aVN = theCurve->Ellipse().Position().Direction();
break;
case GeomAbs_Hyperbola:
aVN = theCurve.Hyperbola().Position().Direction();
aVN = theCurve->Hyperbola().Position().Direction();
break;
case GeomAbs_Parabola:
aVN = theCurve.Parabola().Position().Direction();
aVN = theCurve->Parabola().Position().Direction();
break;
default: {
// for all other types of curve compute two tangent vectors
// on the curve and cross them
bFound = Standard_False;
Standard_Real aT, aT1(theCurve.FirstParameter()), aT2(theCurve.LastParameter());
Standard_Real aT, aT1(theCurve->FirstParameter()), aT2(theCurve->LastParameter());
const Standard_Integer aNbP = 11;
const Standard_Real aDt = (aT2 - aT1) / aNbP;
//
aT = aT1;
gp_Pnt aP1;
gp_Vec aV1;
theCurve.D1(aT, aP1, aV1);
theCurve->D1(aT, aP1, aV1);
//
for (aT = aT1 + aDt; aT <= aT2; aT += aDt) {
gp_Pnt aP2;
gp_Vec aV2;
theCurve.D1(aT, aP2, aV2);
theCurve->D1(aT, aP2, aV2);
//
aVN = aV1^aV2;
if (aVN.Magnitude() > Precision::Confusion()) {
@@ -872,7 +872,7 @@ Standard_Boolean FindPlane(const BRepAdaptor_Curve& theCurve,
}
//
if (bFound) {
thePlane = gp_Pln(theCurve.Value(theCurve.FirstParameter()), gp_Dir(aVN));
thePlane = gp_Pln(theCurve->Value(theCurve->FirstParameter()), gp_Dir(aVN));
}
return bFound;
}
@@ -935,7 +935,7 @@ Standard_Boolean FindPlane(const TopoDS_Shape& theWire,
if (theMEdgesNoUniquePlane.Contains(aE)) {
continue;
}
BRepAdaptor_Curve aBAC(aE);
Handle(BRepAdaptor_Curve) aBAC = new BRepAdaptor_Curve(aE);
if (FindPlane(aBAC, thePlane)) {
return Standard_True;
}

View File

@@ -56,7 +56,7 @@ static
Standard_Real Angle2D (const TopoDS_Vertex& aV,
const TopoDS_Edge& anEdge,
const TopoDS_Face& myFace,
const GeomAdaptor_Surface& aGAS,
const Handle(GeomAdaptor_Surface)& aGAS,
const Standard_Boolean aFlag,
const Handle(IntTools_Context)& theContext);
@@ -86,7 +86,7 @@ static
const Standard_Real aAngleOut);
static
void Path (const GeomAdaptor_Surface& aGAS,
void Path (const Handle(GeomAdaptor_Surface)& aGAS,
const TopoDS_Face& myFace,
const MyDataMapOfShapeBoolean& aVertMap,
const TopoDS_Vertex& aVa,
@@ -103,16 +103,16 @@ static
static
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
Standard_Real VTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
const Handle(GeomAdaptor_Surface)& aGAS);
static
void RefineAngles(const TopoDS_Face& myFace,
@@ -293,8 +293,8 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
}
//
// 3. Angles in mySmartMap
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(myFace);
const GeomAdaptor_Surface& aGAS=aBAS.Surface();
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(myFace);
const Handle(GeomAdaptor_Surface)& aGAS = aBAS->Surface();
//
for (i=1; i<=aNb; i++) {
const TopoDS_Vertex& aV = (*(TopoDS_Vertex *)(&mySmartMap.FindKey(i)));
@@ -351,7 +351,7 @@ void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
// function: Path
// purpose:
//=======================================================================
void Path (const GeomAdaptor_Surface& aGAS,
void Path (const Handle(GeomAdaptor_Surface)& aGAS,
const TopoDS_Face& myFace,
const MyDataMapOfShapeBoolean& aVertMap,
const TopoDS_Vertex& aVFirst,
@@ -740,7 +740,7 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
Standard_Real Angle2D (const TopoDS_Vertex& aV,
const TopoDS_Edge& anEdge,
const TopoDS_Face& myFace,
const GeomAdaptor_Surface& aGAS,
const Handle(GeomAdaptor_Surface)& aGAS,
const Standard_Boolean bIsIN,
const Handle(IntTools_Context)& theContext)
{
@@ -825,16 +825,16 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
// purpose:
//=======================================================================
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
Standard_Real aTol2D, anUr, aVr, aTolV3D;
GeomAbs_SurfaceType aType;
//
aType=aGAS.GetType();
aType=aGAS->GetType();
aTolV3D=BRep_Tool::Tolerance(aV);
anUr=aGAS.UResolution(aTolV3D);
aVr =aGAS.VResolution(aTolV3D);
anUr=aGAS->UResolution(aTolV3D);
aVr =aGAS->VResolution(aTolV3D);
aTol2D=(aVr>anUr) ? aVr : anUr;
//
if (aTol2D < aTolV3D) {
@@ -852,10 +852,10 @@ Standard_Real Angle (const gp_Dir2d& aDir2D)
//purpose :
//=======================================================================
Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
const Standard_Real aTolV3D = BRep_Tool::Tolerance(aV);
const Standard_Real anUr = aGAS.UResolution(aTolV3D);
const Standard_Real anUr = aGAS->UResolution(aTolV3D);
//
return anUr;
}
@@ -865,10 +865,10 @@ Standard_Real UTolerance2D (const TopoDS_Vertex& aV,
//purpose :
//=======================================================================
Standard_Real VTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS)
const Handle(GeomAdaptor_Surface)& aGAS)
{
const Standard_Real aTolV3D = BRep_Tool::Tolerance(aV);
const Standard_Real anVr = aGAS.VResolution(aTolV3D);
const Standard_Real anVr = aGAS->VResolution(aTolV3D);
//
return anVr;
}
@@ -1011,7 +1011,8 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
gp_Pnt2d aPV, aP, aP1, aP2;
Handle(Geom2d_Curve) aC2D;
Handle(Geom2d_Line) aLi;
Geom2dAdaptor_Curve aGAC1, aGAC2;
Handle(Geom2dAdaptor_Curve) aGAC1 = new Geom2dAdaptor_Curve();
Handle(Geom2dAdaptor_Curve) aGAC2 = new Geom2dAdaptor_Curve();
Geom2dInt_GInter aGInter;
IntRes2d_Domain aDomain1, aDomain2;
//
@@ -1020,16 +1021,16 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
aTolInt=1.e-10;
//
BOPTools_AlgoTools2D::CurveOnSurface(aE, myFace, aC2D, aT1, aT2, aTol, theContext);
aGAC1.Load(aC2D, aT1, aT2);
aGAC1->Load(aC2D, aT1, aT2);
//
aTV=BRep_Tool::Parameter (aV, aE, myFace);
aGAC1.D0(aTV, aPV);
aGAC1->D0(aTV, aPV);
//
aTOp = (fabs(aTV-aT1) < fabs(aTV-aT2)) ? aT2 : aT1;
//
const Standard_Real MaxDT = 0.3 * (aT2 - aT1);
aGAC1.D0(aT1, aP1);
aGAC1.D0(aT2, aP2);
aGAC1->D0(aT1, aP1);
aGAC1->D0(aT2, aP2);
aDomain1.SetValues(aP1, aT1, aTolInt, aP2, aT2, aTolInt);
//
for (i=0; i<2; ++i) {
@@ -1039,7 +1040,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
gp_Dir2d aDiri(aXi, aYi);
aLi=new Geom2d_Line(aPV, aDiri);
//
aGAC2.Load(aLi);
aGAC2->Load(aLi);
//
aGInter.Perform(aGAC1, aDomain1, aGAC2, aDomain2, aTolInt, aTolInt);
if (!aGInter.IsDone()) {
@@ -1067,7 +1068,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
}
//
aT = aT1max + aCf*dT;
aGAC1.D0(aT, aP);
aGAC1->D0(aT, aP);
gp_Vec2d aV2D(aPV, aP);
gp_Dir2d aDir2D(aV2D);
//

View File

@@ -1472,7 +1472,7 @@ Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW,
break; //xx
}
//
BRepAdaptor_Curve2d aBAC2D(aE, aFF);
Handle(BRepAdaptor_Curve2d) aBAC2D = new BRepAdaptor_Curve2d(aE, aFF);
aNbS=Geom2dInt_Geom2dCurveTool::NbSamples(aBAC2D);
if (aNbS>2) {
aNbS*=4;
@@ -1487,10 +1487,10 @@ Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW,
dU=-dU;
}
//
aBAC2D.D0(aU, aP2D0);
aBAC2D->D0(aU, aP2D0);
for(i=2; i<=aNbS; i++) {
aU=aU1+(i-1)*dU;
aBAC2D.D0(aU, aP2D1);
aBAC2D->D0(aU, aP2D1);
aP2D0.Coord(aX0, aY0);
aP2D1.Coord(aX1, aY1);
//
@@ -2152,26 +2152,26 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
}
//
// try to compute the minimal 3D step
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(aF);
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(aF);
Standard_Real aR = 0.;
GeomAbs_SurfaceType aSType = aBAS.GetType();
GeomAbs_SurfaceType aSType = aBAS->GetType();
switch (aSType) {
case GeomAbs_Cylinder: {
aR = aBAS.Cylinder().Radius();
aR = aBAS->Cylinder().Radius();
break;
}
case GeomAbs_Cone: {
gp_Lin aL(aBAS.Cone().Axis());
gp_Lin aL(aBAS->Cone().Axis());
aR = aL.Distance(aP);
break;
}
case GeomAbs_Sphere: {
aDtMin = Max(aDtMin, 5.e-4);
aR = aBAS.Sphere().Radius();
aR = aBAS->Sphere().Radius();
break;
}
case GeomAbs_Torus: {
aR = aBAS.Torus().MajorRadius();
aR = aBAS->Torus().MajorRadius();
break;
}
default:
@@ -2195,14 +2195,14 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
const BOPTools_CoupleOfShape& aCS = aIt.Value();
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aCS.Shape2()));
//
const BRepAdaptor_Surface& aBAS = theContext->SurfaceAdaptor(aF);
const Handle(BRepAdaptor_Surface)& aBAS = theContext->SurfaceAdaptor(aF);
//
Standard_Real aUMin, aUMax, aVMin, aVMax;
theContext->UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
//
Standard_Real aDU = aUMax - aUMin;
if (aDU > 0.) {
Standard_Real aURes = aBAS.UResolution(aDtMax);
Standard_Real aURes = aBAS->UResolution(aDtMax);
if (2*aURes > aDU) {
break;
}
@@ -2210,7 +2210,7 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
//
Standard_Real aDV = aVMax - aVMin;
if (aDV > 0.) {
Standard_Real aVRes = aBAS.VResolution(aDtMax);
Standard_Real aVRes = aBAS->VResolution(aDtMax);
if (2*aVRes > aDV) {
break;
}

View File

@@ -251,24 +251,24 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnFace
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext)
{
BRepAdaptor_Surface aBASTmp;
const BRepAdaptor_Surface* pBAS;
Handle(BRepAdaptor_Surface) aBASTmp = new BRepAdaptor_Surface();
Handle(BRepAdaptor_Surface) pBAS;
if (!theContext.IsNull()) {
pBAS = &theContext->SurfaceAdaptor(theF);
pBAS = theContext->SurfaceAdaptor(theF);
}
else {
aBASTmp.Initialize(theF, Standard_True);
pBAS = &aBASTmp;
aBASTmp->Initialize(theF, Standard_True);
pBAS = aBASTmp;
}
//
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(*pBAS, theFirst, theLast, theC2D, theC2DA);
BOPTools_AlgoTools2D::AdjustPCurveOnSurf(pBAS, theFirst, theLast, theC2D, theC2DA);
}
//=======================================================================
//function : AdjustPCurveOnFace
//purpose :
//=======================================================================
void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
(const BRepAdaptor_Surface& aBAS,
(const Handle(BRepAdaptor_Surface)& aBAS,
const Standard_Real aFirst,
const Standard_Real aLast,
const Handle(Geom2d_Curve)& aC2D,
@@ -278,11 +278,11 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
Standard_Real UMin, UMax, VMin, VMax, aT, u2, v2, du, dv, aDelta;
Standard_Real aUPeriod;
//
const TopoDS_Face& aF=aBAS.Face();
UMin=aBAS.FirstUParameter();
UMax=aBAS.LastUParameter();
VMin=aBAS.FirstVParameter();
VMax=aBAS.LastVParameter();
const TopoDS_Face& aF=aBAS->Face();
UMin=aBAS->FirstUParameter();
UMax=aBAS->LastUParameter();
VMin=aBAS->FirstVParameter();
VMax=aBAS->LastVParameter();
//
aDelta=Precision::PConfusion();
@@ -296,8 +296,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
//
// du
du = 0.;
if (aBAS.IsUPeriodic()) {
aUPeriod = aBAS.UPeriod();
if (aBAS->IsUPeriodic()) {
aUPeriod = aBAS->UPeriod();
//
// a. try to clarify u2 using the precision (aDelta)
@@ -311,10 +311,10 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
GeomInt::AdjustPeriodic(u2, UMin, UMax, aUPeriod, u2, du, 0.);
//
if (du==0.) {
if (aBAS.GetType()==GeomAbs_Cylinder) {
if (aBAS->GetType()==GeomAbs_Cylinder) {
Standard_Real aR, dFi, aTol;
//
gp_Cylinder aCylinder=aBAS.Cylinder();
gp_Cylinder aCylinder=aBAS->Cylinder();
aR=aCylinder.Radius();
aTol=MaxToleranceEdge(aF);
dFi=aTol/aR;
@@ -333,10 +333,10 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
// dv
dv = 0.;
if (aBAS.IsVPeriodic()) {
if (aBAS->IsVPeriodic()) {
Standard_Real aVPeriod, aVm, aVr, aVmid, dVm, dVr;
//
aVPeriod = aBAS.VPeriod();
aVPeriod = aBAS->VPeriod();
mincond = (VMin - v2 > aDelta);
maxcond = (v2 - VMax > aDelta);
//
@@ -361,8 +361,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
Standard_Real u,v;
u = u2 + du;
v = v2 + dv;
if (aBAS.IsUPeriodic()) {
aUPeriod = aBAS.UPeriod();
if (aBAS->IsUPeriodic()) {
aUPeriod = aBAS->UPeriod();
if ((UMax - UMin - 2*aDelta) > aUPeriod) {
if ((u > (UMin + aDelta + aUPeriod)) ||
(u < (UMax - aDelta - aUPeriod))) {
@@ -377,8 +377,8 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
}
//
u = u2 + du;
if (aBAS.IsVPeriodic()) {
Standard_Real aVPeriod = aBAS.VPeriod();
if (aBAS->IsVPeriodic()) {
Standard_Real aVPeriod = aBAS->VPeriod();
if ((VMax - VMin - 2*aDelta) > aVPeriod) {
if ((v > (VMin + aDelta + aVPeriod)) ||
(v < (VMax - aDelta - aVPeriod))) {
@@ -521,14 +521,14 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
Standard_Real& TolReached2d,
const Handle(IntTools_Context)& theContext)
{
BRepAdaptor_Surface aBASTmp;
const BRepAdaptor_Surface* pBAS;
Handle(BRepAdaptor_Surface) aBASTmp = new BRepAdaptor_Surface();
Handle(BRepAdaptor_Surface) pBAS;
if (!theContext.IsNull()) {
pBAS = &theContext->SurfaceAdaptor(aF);
pBAS = theContext->SurfaceAdaptor(aF);
}
else {
aBASTmp.Initialize(aF, Standard_True);
pBAS = &aBASTmp;
aBASTmp->Initialize(aF, Standard_True);
pBAS = aBASTmp;
}
//
Handle(BRepAdaptor_Surface) aBAHS = new BRepAdaptor_Surface(*pBAS);
@@ -622,7 +622,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
// Adjust curve for periodic surface
Handle(Geom2d_Curve) aC2DA;
BOPTools_AlgoTools2D::AdjustPCurveOnSurf (*pBAS, aT1, aT2, aC2D, aC2DA);
BOPTools_AlgoTools2D::AdjustPCurveOnSurf (pBAS, aT1, aT2, aC2D, aC2DA);
aC2D = aC2DA;
// Make sure that the range of the 2D curve is sufficient for representation of the 3D curve.
@@ -639,7 +639,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
}
// compute the appropriate tolerance for the edge
Handle(Geom_Surface) aS = pBAS->Surface().Surface();
Handle(Geom_Surface) aS = pBAS->Surface()->Surface();
aS = Handle(Geom_Surface)::DownCast(aS->Transformed(pBAS->Trsf()));
//
Standard_Real aT;

View File

@@ -129,7 +129,7 @@ public:
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
//! [aT1, aT2] - range to adjust
Standard_EXPORT static void AdjustPCurveOnSurf(const BRepAdaptor_Surface& aF,
Standard_EXPORT static void AdjustPCurveOnSurf(const Handle(BRepAdaptor_Surface)& aF,
const Standard_Real aT1,
const Standard_Real aT2,
const Handle(Geom2d_Curve)& aC2D,

View File

@@ -961,7 +961,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
//
Geom2dHatch_Hatcher& aHatcher = theContext->Hatcher(theF);
//
Geom2dAdaptor_Curve aHCur(theL2D);
Handle(Geom2dAdaptor_Curve) aHCur = new Geom2dAdaptor_Curve(theL2D);
//
aHatcher.ClrHatchings();
aIH = aHatcher.AddHatching(aHCur);

View File

@@ -488,7 +488,7 @@ static Standard_Real MapEdgeLength(const TopoDS_Edge& theEdge,
Standard_Real aLen = 0.;
if (!BRep_Tool::Degenerated(theEdge))
{
BRepAdaptor_Curve aCurve(theEdge);
Handle(BRepAdaptor_Curve) aCurve = new BRepAdaptor_Curve(theEdge);
aLen = GCPnts_AbscissaPoint::Length(aCurve);
}
pLen = theMapEdgeLen.Bound(theEdge, aLen);
@@ -505,7 +505,7 @@ namespace {
const TopoDS_Edge* Edge; // Edge
Standard_Real VParameter; // Parameter of the vertex on the edge
Standard_Boolean IsClosed; // Closed flag of the edge
Geom2dAdaptor_Curve GAdaptor; // 2D adaptor for PCurve of the edge on the face
Handle(Geom2dAdaptor_Curve) GAdaptor; // 2D adaptor for PCurve of the edge on the face
Standard_Real First; // First parameter in the range
Standard_Real Last; // Last parameter in the rage
};
@@ -532,10 +532,10 @@ static
Standard_Real aMaxDist = 0.;
Standard_Real aTol2d = 1.e-10;
//
IntRes2d_Domain aDom1(theEData1.GAdaptor.Value(aT11), aT11, aTol2d,
theEData1.GAdaptor.Value(aT12), aT12, aTol2d);
IntRes2d_Domain aDom2(theEData2.GAdaptor.Value(aT21), aT21, aTol2d,
theEData2.GAdaptor.Value(aT22), aT22, aTol2d);
IntRes2d_Domain aDom1(theEData1.GAdaptor->Value(aT11), aT11, aTol2d,
theEData1.GAdaptor->Value(aT12), aT12, aTol2d);
IntRes2d_Domain aDom2(theEData2.GAdaptor->Value(aT21), aT21, aTol2d,
theEData2.GAdaptor->Value(aT22), aT22, aTol2d);
//
anInter.Perform(theEData1.GAdaptor, aDom1, theEData2.GAdaptor, aDom2, aTol2d, aTol2d);
if (!anInter.IsDone() || (!anInter.NbSegments() && !anInter.NbPoints())) {
@@ -658,7 +658,7 @@ void CorrectWires(const TopoDS_Face& aFx,
if (aD2>aD2max) {
aD2max=aD2;
}
EdgeData anEData = {&aE, aT, isClosed, Geom2dAdaptor_Curve(aC2D), aT1, aT2};
EdgeData anEData = {&aE, aT, isClosed, new Geom2dAdaptor_Curve(aC2D), aT1, aT2};
aLEPars.Append(anEData);
}
//
@@ -894,7 +894,7 @@ void CorrectEdgeTolerance (const TopoDS_Edge& myShape,
Handle(GeomAdaptor_Curve) aHCurve =
new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(ProjLib_ProjectedCurve) proj = new ProjLib_ProjectedCurve(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_Curve) GHPC =
new Geom2dAdaptor_Curve(PC,

View File

@@ -398,7 +398,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnPlane(const TopoDS_Edge& E,
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface(GP);
Handle(GeomAdaptor_Curve) HC = new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve Proj(HS, HC);
Handle(ProjLib_ProjectedCurve) Proj = new ProjLib_ProjectedCurve(HS, HC);
Handle(Geom2d_Curve) pc = Geom2dAdaptor::MakeCurve(Proj);
if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve)) {

View File

@@ -20,7 +20,7 @@
#include <BRepAdaptor_Curve.hxx>
#include <NCollection_Array1.hxx>
typedef NCollection_Array1<BRepAdaptor_Curve> BRepAdaptor_Array1OfCurve;
typedef NCollection_Array1<Handle(BRepAdaptor_Curve)> BRepAdaptor_Array1OfCurve;
#endif

View File

@@ -90,8 +90,8 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
aCopy->myCurves = new (BRepAdaptor_HArray1OfCurve) (1, myCurves->Size());
for (Standard_Integer anI = 1; anI <= myCurves->Size(); ++anI)
{
const Handle(Adaptor3d_Curve) aCurve = myCurves->Value(anI).ShallowCopy();
const BRepAdaptor_Curve& aBrepCurve = *(Handle(BRepAdaptor_Curve)::DownCast(aCurve));
const Handle(Adaptor3d_Curve) aCurve = myCurves->Value(anI)->ShallowCopy();
const Handle(BRepAdaptor_Curve) aBrepCurve = Handle(BRepAdaptor_Curve)::DownCast(aCurve);
aCopy->myCurves->SetValue(anI, aBrepCurve);
}
aCopy->myKnots = myKnots;
@@ -129,7 +129,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
E = wexp.Current();
if (! BRep_Tool::Degenerated(E)) {
ii++;
myCurves->ChangeValue(ii).Initialize(E);
myCurves->ChangeValue(ii) = new BRepAdaptor_Curve(E);
if (AC) {
myKnots->SetValue(ii+1, myKnots->Value(ii));
myKnots->ChangeValue(ii+1) +=
@@ -141,12 +141,12 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
Forward = Standard_True; // Default ; The Reverse Edges are parsed.
if((NbEdge > 2) || ((NbEdge==2) && (!myWire.Closed())) ) {
TopAbs_Orientation Or = myCurves->Value(1).Edge().Orientation();
TopAbs_Orientation Or = myCurves->Value(1)->Edge().Orientation();
TopoDS_Vertex VI, VL;
TopExp::CommonVertex(myCurves->Value(1).Edge(),
myCurves->Value(2).Edge(),
TopExp::CommonVertex(myCurves->Value(1)->Edge(),
myCurves->Value(2)->Edge(),
VI);
VL = TopExp::LastVertex(myCurves->Value(1).Edge());
VL = TopExp::LastVertex(myCurves->Value(1)->Edge());
if (VI.IsSame(VL)) { // The direction of parsing is always preserved
if (Or == TopAbs_REVERSED)
Forward = Standard_False;
@@ -182,29 +182,29 @@ Handle(Adaptor3d_Curve) BRepAdaptor_CompCurve::ShallowCopy() const
CurIndex = (i1+i2)/2; // Small optimization
if (i1==i2) {
if (l > f)
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1).Trim(f, l, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1)->Trim(f, l, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1).Trim(l, f, PTol));
myCurves->SetValue(i1, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(myCurves->Value(i1)->Trim(l, f, PTol));
myCurves->SetValue(i1, HC);
}
else {
const BRepAdaptor_Curve& c1 = myCurves->Value(i1);
const BRepAdaptor_Curve& c2 = myCurves->Value(i2);
const Handle(BRepAdaptor_Curve)& c1 = myCurves->Value(i1);
const Handle(BRepAdaptor_Curve)& c2 = myCurves->Value(i2);
Standard_Real k;
k = c1.LastParameter();
k = c1->LastParameter();
if (k>f)
HC = Handle(BRepAdaptor_Curve)::DownCast(c1.Trim(f, k, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(c1->Trim(f, k, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(c1.Trim(k, f, PTol));
myCurves->SetValue(i1, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(c1->Trim(k, f, PTol));
myCurves->SetValue(i1, HC);
k = c2.FirstParameter();
k = c2->FirstParameter();
if (k<=l)
HC = Handle(BRepAdaptor_Curve)::DownCast(c2.Trim(k, l, PTol));
HC = Handle(BRepAdaptor_Curve)::DownCast(c2->Trim(k, l, PTol));
else
HC = Handle(BRepAdaptor_Curve)::DownCast(c2.Trim(l, k, PTol));
myCurves->SetValue(i2, *HC);
HC = Handle(BRepAdaptor_Curve)::DownCast(c2->Trim(l, k, PTol));
myCurves->SetValue(i2, HC);
}
}
@@ -221,7 +221,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Integer index = CurIndex;
UonE = U;
Prepare(UonE, d, index);
E = myCurves->Value(index).Edge();
E = myCurves->Value(index)->Edge();
}
Standard_Real BRepAdaptor_CompCurve::FirstParameter() const
@@ -237,14 +237,14 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
GeomAbs_Shape BRepAdaptor_CompCurve::Continuity() const
{
if ( myCurves->Length() > 1) return GeomAbs_C0;
return myCurves->Value(1).Continuity();
return myCurves->Value(1)->Continuity();
}
Standard_Integer BRepAdaptor_CompCurve::NbIntervals(const GeomAbs_Shape S) const
{
Standard_Integer NbInt, ii;
for (ii=1, NbInt=0; ii<=myCurves->Length(); ii++)
NbInt += myCurves->ChangeValue(ii).NbIntervals(S);
NbInt += myCurves->ChangeValue(ii)->NbIntervals(S);
return NbInt;
}
@@ -256,9 +256,9 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real f, F, delta;
// First curve (direction of parsing of the edge)
n = myCurves->ChangeValue(1).NbIntervals(S);
n = myCurves->ChangeValue(1)->NbIntervals(S);
Handle(TColStd_HArray1OfReal) Ti = new (TColStd_HArray1OfReal) (1, n+1);
myCurves->ChangeValue(1).Intervals(Ti->ChangeArray1(), S);
myCurves->ChangeValue(1)->Intervals(Ti->ChangeArray1(), S);
InvPrepare(1, f, delta);
F = myKnots->Value(1);
if (delta < 0) {
@@ -273,9 +273,9 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
// and the next
for (ii=2; ii<=myCurves->Length(); ii++) {
n = myCurves->ChangeValue(ii).NbIntervals(S);
n = myCurves->ChangeValue(ii)->NbIntervals(S);
if (n != Ti->Length()-1) Ti = new (TColStd_HArray1OfReal) (1, n+1);
myCurves->ChangeValue(ii).Intervals(Ti->ChangeArray1(), S);
myCurves->ChangeValue(ii)->Intervals(Ti->ChangeArray1(), S);
InvPrepare(ii, f, delta);
F = myKnots->Value(ii);
if (delta < 0) {
@@ -321,7 +321,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
return myCurves->Value(index).Value(u);
return myCurves->Value(index)->Value(u);
}
void BRepAdaptor_CompCurve::D0(const Standard_Real U,
@@ -330,7 +330,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D0(u, P);
myCurves->Value(index)->D0(u, P);
}
void BRepAdaptor_CompCurve::D1(const Standard_Real U,
@@ -340,7 +340,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D1(u, P, V);
myCurves->Value(index)->D1(u, P, V);
V*=d;
}
@@ -352,7 +352,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D2(u, P, V1, V2);
myCurves->Value(index)->D2(u, P, V1, V2);
V1*=d;
V2 *= d*d;
}
@@ -365,7 +365,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real u = U, d;
Standard_Integer index = CurIndex;
Prepare(u, d, index);
myCurves->Value(index).D3(u, P, V1, V2, V3);
myCurves->Value(index)->D3(u, P, V1, V2, V3);
V1*=d;
V2 *= d*d;
V3 *= d*d*d;
@@ -378,7 +378,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Integer index = CurIndex;
Prepare(u, d, index);
return (myCurves->Value(index).DN(u, N) * Pow(d, N));
return (myCurves->Value(index)->DN(u, N) * Pow(d, N));
}
Standard_Real BRepAdaptor_CompCurve::Resolution(const Standard_Real R3d) const
@@ -386,7 +386,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Real Res = 1.e200, r;
Standard_Integer ii, L = myCurves->Length();
for (ii=1; ii<=L; ii++) {
r = myCurves->Value(ii).Resolution(R3d);
r = myCurves->Value(ii)->Resolution(R3d);
if (r < Res) Res = r;
}
return Res;
@@ -401,57 +401,57 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
gp_Lin BRepAdaptor_CompCurve::Line() const
{
return myCurves->Value(1).Line();
return myCurves->Value(1)->Line();
}
gp_Circ BRepAdaptor_CompCurve::Circle() const
{
return myCurves->Value(1).Circle();
return myCurves->Value(1)->Circle();
}
gp_Elips BRepAdaptor_CompCurve::Ellipse() const
{
return myCurves->Value(1).Ellipse();
return myCurves->Value(1)->Ellipse();
}
gp_Hypr BRepAdaptor_CompCurve::Hyperbola() const
{
return myCurves->Value(1).Hyperbola();
return myCurves->Value(1)->Hyperbola();
}
gp_Parab BRepAdaptor_CompCurve::Parabola() const
{
return myCurves->Value(1).Parabola();
return myCurves->Value(1)->Parabola();
}
Standard_Integer BRepAdaptor_CompCurve::Degree() const
{
return myCurves->Value(1).Degree();
return myCurves->Value(1)->Degree();
}
Standard_Boolean BRepAdaptor_CompCurve::IsRational() const
{
return myCurves->Value(1).IsRational();
return myCurves->Value(1)->IsRational();
}
Standard_Integer BRepAdaptor_CompCurve::NbPoles() const
{
return myCurves->Value(1).NbPoles();
return myCurves->Value(1)->NbPoles();
}
Standard_Integer BRepAdaptor_CompCurve::NbKnots() const
{
return myCurves->Value(1).NbKnots();
return myCurves->Value(1)->NbKnots();
}
Handle(Geom_BezierCurve) BRepAdaptor_CompCurve::Bezier() const
{
return myCurves->Value(1).Bezier();
return myCurves->Value(1)->Bezier();
}
Handle(Geom_BSplineCurve) BRepAdaptor_CompCurve::BSpline() const
{
return myCurves->Value(1).BSpline();
return myCurves->Value(1)->BSpline();
}
//=======================================================================
@@ -496,7 +496,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
}
// Invert ?
const TopoDS_Edge& E = myCurves->Value(theCurIndex).Edge();
const TopoDS_Edge& E = myCurves->Value(theCurIndex)->Edge();
TopAbs_Orientation Or = E.Orientation();
Standard_Boolean Reverse;
Reverse = (Forward && (Or == TopAbs_REVERSED)) ||
@@ -521,7 +521,7 @@ void BRepAdaptor_CompCurve::InvPrepare(const Standard_Integer index,
Standard_Real& Delta) const
{
// Invert?
const TopoDS_Edge& E = myCurves->Value(index).Edge();
const TopoDS_Edge& E = myCurves->Value(index)->Edge();
TopAbs_Orientation Or = E.Orientation();
Standard_Boolean Reverse;
Reverse = (Forward && (Or == TopAbs_REVERSED)) ||

View File

@@ -80,8 +80,8 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::ShallowCopy() const
aCopy->myTrsf = myTrsf;
const Handle(Adaptor3d_Curve) aCurve = myCurve.ShallowCopy();
const GeomAdaptor_Curve& aGeomCurve = *(Handle(GeomAdaptor_Curve)::DownCast(aCurve));
const Handle(Adaptor3d_Curve) aCurve = myCurve->ShallowCopy();
const Handle(GeomAdaptor_Curve) aGeomCurve = Handle(GeomAdaptor_Curve)::DownCast(aCurve);
aCopy->myCurve = aGeomCurve;
if (!myConSurf.IsNull())
@@ -99,7 +99,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::ShallowCopy() const
//=======================================================================
void BRepAdaptor_Curve::Reset()
{
myCurve.Reset();
myCurve->Reset();
myConSurf.Nullify();
myEdge.Nullify();
myTrsf = gp_Trsf();
@@ -120,7 +120,8 @@ void BRepAdaptor_Curve::Initialize(const TopoDS_Edge& E)
Handle(Geom_Curve) C = BRep_Tool::Curve(E,L,pf,pl);
if (!C.IsNull()) {
myCurve.Load(C,pf,pl);
myCurve = new GeomAdaptor_Curve();
myCurve->Load(C,pf,pl);
}
else {
Handle(Geom2d_Curve) PC;
@@ -202,7 +203,7 @@ Standard_Boolean BRepAdaptor_Curve::IsCurveOnSurface() const
//purpose :
//=======================================================================
const GeomAdaptor_Curve& BRepAdaptor_Curve::Curve() const
const Handle(GeomAdaptor_Curve)& BRepAdaptor_Curve::Curve() const
{
return myCurve;
}
@@ -212,9 +213,9 @@ const GeomAdaptor_Curve& BRepAdaptor_Curve::Curve() const
//purpose :
//=======================================================================
const Adaptor3d_CurveOnSurface& BRepAdaptor_Curve::CurveOnSurface() const
const Handle(Adaptor3d_CurveOnSurface)& BRepAdaptor_Curve::CurveOnSurface() const
{
return *myConSurf;
return myConSurf;
}
//=======================================================================
@@ -245,7 +246,7 @@ Standard_Real BRepAdaptor_Curve::Tolerance() const
Standard_Real BRepAdaptor_Curve::FirstParameter() const
{
if (myConSurf.IsNull()) {
return myCurve.FirstParameter();
return myCurve->FirstParameter();
}
else {
return myConSurf->FirstParameter();
@@ -260,7 +261,7 @@ Standard_Real BRepAdaptor_Curve::FirstParameter() const
Standard_Real BRepAdaptor_Curve::LastParameter() const
{
if (myConSurf.IsNull()) {
return myCurve.LastParameter();
return myCurve->LastParameter();
}
else {
return myConSurf->LastParameter();
@@ -275,7 +276,7 @@ Standard_Real BRepAdaptor_Curve::LastParameter() const
GeomAbs_Shape BRepAdaptor_Curve::Continuity() const
{
if (myConSurf.IsNull()) {
return myCurve.Continuity();
return myCurve->Continuity();
}
else {
return myConSurf->Continuity();
@@ -290,7 +291,7 @@ GeomAbs_Shape BRepAdaptor_Curve::Continuity() const
Standard_Integer BRepAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const
{
if (myConSurf.IsNull()) {
return myCurve.NbIntervals(S);
return myCurve->NbIntervals(S);
}
else {
return myConSurf->NbIntervals(S);
@@ -306,7 +307,7 @@ void BRepAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
if (myConSurf.IsNull()) {
myCurve.Intervals(T, S);
myCurve->Intervals(T, S);
}
else {
myConSurf->Intervals(T, S);
@@ -326,11 +327,10 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
// On fait une copie de this pour garder la trsf.
Handle(BRepAdaptor_Curve) res;
if (myConSurf.IsNull()){
Standard_Real pf = FirstParameter(), pl = LastParameter();
Handle(Geom_Curve) C = myCurve.Curve();
const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,First,Last);
Handle(GeomAdaptor_Curve) aGAC = myCurve;
const_cast<Handle(GeomAdaptor_Curve)&>(myCurve) = Handle(GeomAdaptor_Curve)::DownCast(myCurve->Trim(First, Last, Tol));
res = new BRepAdaptor_Curve(*this);
const_cast<GeomAdaptor_Curve*>(&myCurve)->Load(C,pf,pl);
const_cast<Handle(GeomAdaptor_Curve)&>(myCurve) = aGAC;
}
else {
Handle(Adaptor3d_CurveOnSurface) sav = myConSurf;
@@ -350,7 +350,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Curve::Trim(const Standard_Real First,
Standard_Boolean BRepAdaptor_Curve::IsClosed() const
{
if (myConSurf.IsNull()) {
return myCurve.IsClosed();
return myCurve->IsClosed();
}
else {
return myConSurf->IsClosed();
@@ -365,7 +365,7 @@ Standard_Boolean BRepAdaptor_Curve::IsClosed() const
Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const
{
if (myConSurf.IsNull()) {
return myCurve.IsPeriodic();
return myCurve->IsPeriodic();
}
else {
return myConSurf->IsPeriodic();
@@ -380,7 +380,7 @@ Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const
Standard_Real BRepAdaptor_Curve::Period() const
{
if (myConSurf.IsNull()) {
return myCurve.Period();
return myCurve->Period();
}
else {
return myConSurf->Period();
@@ -396,7 +396,7 @@ gp_Pnt BRepAdaptor_Curve::Value(const Standard_Real U) const
{
gp_Pnt P;
if (myConSurf.IsNull())
P = myCurve.Value(U);
P = myCurve->Value(U);
else
P = myConSurf->Value(U);
P.Transform(myTrsf);
@@ -411,7 +411,7 @@ gp_Pnt BRepAdaptor_Curve::Value(const Standard_Real U) const
void BRepAdaptor_Curve::D0(const Standard_Real U, gp_Pnt& P) const
{
if (myConSurf.IsNull())
myCurve.D0(U,P);
myCurve->D0(U,P);
else
myConSurf->D0(U,P);
P.Transform(myTrsf);
@@ -426,7 +426,7 @@ void BRepAdaptor_Curve::D1(const Standard_Real U,
gp_Pnt& P, gp_Vec& V) const
{
if (myConSurf.IsNull())
myCurve.D1(U,P,V);
myCurve->D1(U,P,V);
else
myConSurf->D1(U,P,V);
P.Transform(myTrsf);
@@ -442,7 +442,7 @@ void BRepAdaptor_Curve::D2(const Standard_Real U,
gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
{
if (myConSurf.IsNull())
myCurve.D2(U,P,V1,V2);
myCurve->D2(U,P,V1,V2);
else
myConSurf->D2(U,P,V1,V2);
P.Transform(myTrsf);
@@ -460,7 +460,7 @@ void BRepAdaptor_Curve::D3(const Standard_Real U,
gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
{
if (myConSurf.IsNull())
myCurve.D3(U,P,V1,V2,V3);
myCurve->D3(U,P,V1,V2,V3);
else
myConSurf->D3(U,P,V1,V2,V3);
P.Transform(myTrsf);
@@ -479,7 +479,7 @@ gp_Vec BRepAdaptor_Curve::DN(const Standard_Real U,
{
gp_Vec V;
if (myConSurf.IsNull())
V = myCurve.DN(U,N);
V = myCurve->DN(U,N);
else
V = myConSurf->DN(U,N);
V.Transform(myTrsf);
@@ -494,7 +494,7 @@ gp_Vec BRepAdaptor_Curve::DN(const Standard_Real U,
Standard_Real BRepAdaptor_Curve::Resolution(const Standard_Real R) const
{
if (myConSurf.IsNull()) {
return myCurve.Resolution(R);
return myCurve->Resolution(R);
}
else {
return myConSurf->Resolution(R);
@@ -509,7 +509,7 @@ Standard_Real BRepAdaptor_Curve::Resolution(const Standard_Real R) const
GeomAbs_CurveType BRepAdaptor_Curve::GetType() const
{
if (myConSurf.IsNull()) {
return myCurve.GetType();
return myCurve->GetType();
}
else {
return myConSurf->GetType();
@@ -525,7 +525,7 @@ gp_Lin BRepAdaptor_Curve::Line() const
{
gp_Lin L;
if (myConSurf.IsNull())
L = myCurve.Line();
L = myCurve->Line();
else
L = myConSurf->Line();
L.Transform(myTrsf);
@@ -541,7 +541,7 @@ gp_Circ BRepAdaptor_Curve::Circle() const
{
gp_Circ C;
if (myConSurf.IsNull())
C = myCurve.Circle();
C = myCurve->Circle();
else
C = myConSurf->Circle();
C.Transform(myTrsf);
@@ -557,7 +557,7 @@ gp_Elips BRepAdaptor_Curve::Ellipse() const
{
gp_Elips E;
if (myConSurf.IsNull())
E = myCurve.Ellipse();
E = myCurve->Ellipse();
else
E = myConSurf->Ellipse();
E.Transform(myTrsf);
@@ -573,7 +573,7 @@ gp_Hypr BRepAdaptor_Curve::Hyperbola() const
{
gp_Hypr H;
if (myConSurf.IsNull())
H = myCurve.Hyperbola();
H = myCurve->Hyperbola();
else
H = myConSurf->Hyperbola();
H.Transform(myTrsf);
@@ -589,7 +589,7 @@ gp_Parab BRepAdaptor_Curve::Parabola() const
{
gp_Parab P;
if (myConSurf.IsNull())
P = myCurve.Parabola();
P = myCurve->Parabola();
else
P = myConSurf->Parabola();
P.Transform(myTrsf);
@@ -604,7 +604,7 @@ gp_Parab BRepAdaptor_Curve::Parabola() const
Standard_Integer BRepAdaptor_Curve::Degree() const
{
if (myConSurf.IsNull())
return myCurve.Degree();
return myCurve->Degree();
else
return myConSurf->Degree();
}
@@ -617,7 +617,7 @@ Standard_Integer BRepAdaptor_Curve::Degree() const
Standard_Boolean BRepAdaptor_Curve::IsRational() const
{
if (myConSurf.IsNull())
return myCurve.IsRational();
return myCurve->IsRational();
else
return myConSurf->IsRational();
}
@@ -629,7 +629,7 @@ Standard_Boolean BRepAdaptor_Curve::IsRational() const
Standard_Integer BRepAdaptor_Curve::NbPoles() const
{
if (myConSurf.IsNull())
return myCurve.NbPoles();
return myCurve->NbPoles();
else
return myConSurf->NbPoles();
}
@@ -641,7 +641,7 @@ Standard_Integer BRepAdaptor_Curve::NbPoles() const
Standard_Integer BRepAdaptor_Curve::NbKnots() const
{
if (myConSurf.IsNull())
return myCurve.NbKnots();
return myCurve->NbKnots();
else
return myConSurf->NbKnots();
}
@@ -655,7 +655,7 @@ Handle(Geom_BezierCurve) BRepAdaptor_Curve::Bezier() const
{
Handle(Geom_BezierCurve) BC;
if (myConSurf.IsNull()) {
BC = myCurve.Bezier();
BC = myCurve->Bezier();
}
else {
BC = myConSurf->Bezier();
@@ -674,7 +674,7 @@ Handle(Geom_BSplineCurve) BRepAdaptor_Curve::BSpline() const
{
Handle(Geom_BSplineCurve) BS;
if (myConSurf.IsNull()) {
BS = myCurve.BSpline();
BS = myCurve->BSpline();
}
else {
BS = myConSurf->BSpline();
@@ -690,10 +690,10 @@ Handle(Geom_BSplineCurve) BRepAdaptor_Curve::BSpline() const
Handle(Geom_OffsetCurve) BRepAdaptor_Curve::OffsetCurve() const
{
if ( !Is3DCurve() || myCurve.GetType() != GeomAbs_OffsetCurve)
if ( !Is3DCurve() || myCurve->GetType() != GeomAbs_OffsetCurve)
throw Standard_NoSuchObject("BRepAdaptor_Curve::OffsetCurve");
Handle(Geom_OffsetCurve) anOffC = myCurve.OffsetCurve();
Handle(Geom_OffsetCurve) anOffC = myCurve->OffsetCurve();
return myTrsf.Form() == gp_Identity
? anOffC : Handle(Geom_OffsetCurve)::DownCast(anOffC->Transformed(myTrsf));
}

View File

@@ -103,10 +103,10 @@ public:
Standard_EXPORT Standard_Boolean IsCurveOnSurface() const;
//! Returns the Curve of the edge.
Standard_EXPORT const GeomAdaptor_Curve& Curve() const;
Standard_EXPORT const Handle(GeomAdaptor_Curve)& Curve() const;
//! Returns the CurveOnSurface of the edge.
Standard_EXPORT const Adaptor3d_CurveOnSurface& CurveOnSurface() const;
Standard_EXPORT const Handle(Adaptor3d_CurveOnSurface)& CurveOnSurface() const;
//! Returns the edge.
Standard_EXPORT const TopoDS_Edge& Edge() const;
@@ -217,7 +217,7 @@ public:
private:
gp_Trsf myTrsf;
GeomAdaptor_Curve myCurve;
Handle(GeomAdaptor_Curve) myCurve;
Handle(Adaptor3d_CurveOnSurface) myConSurf;
TopoDS_Edge myEdge;

View File

@@ -45,6 +45,7 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepAdaptor_Surface, Adaptor3d_Surface)
//=======================================================================
BRepAdaptor_Surface::BRepAdaptor_Surface()
{
mySurf = new GeomAdaptor_Surface();
}
@@ -56,6 +57,7 @@ BRepAdaptor_Surface::BRepAdaptor_Surface()
BRepAdaptor_Surface::BRepAdaptor_Surface(const TopoDS_Face& F,
const Standard_Boolean R)
{
mySurf = new GeomAdaptor_Surface();
Initialize(F,R);
}
@@ -69,9 +71,8 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::ShallowCopy() const
{
Handle(BRepAdaptor_Surface) aCopy = new BRepAdaptor_Surface();
const Handle(Adaptor3d_Surface) aSurface = mySurf.ShallowCopy();
const GeomAdaptor_Surface& aGeomSurface = *(Handle(GeomAdaptor_Surface)::DownCast(aSurface));
aCopy->mySurf = aGeomSurface;
const Handle(Adaptor3d_Surface) aSurface = mySurf->ShallowCopy();
aCopy->mySurf = Handle(GeomAdaptor_Surface)::DownCast(aSurface);
aCopy->myTrsf = myTrsf;
aCopy->myFace = myFace;
@@ -95,10 +96,10 @@ void BRepAdaptor_Surface::Initialize(const TopoDS_Face& F,
if (Restriction) {
Standard_Real umin,umax,vmin,vmax;
BRepTools::UVBounds(F,umin,umax,vmin,vmax);
mySurf.Load(aSurface,umin,umax,vmin,vmax);
mySurf->Load(aSurface,umin,umax,vmin,vmax);
}
else
mySurf.Load(aSurface);
mySurf->Load(aSurface);
myTrsf = L.Transformation();
}
@@ -108,23 +109,11 @@ void BRepAdaptor_Surface::Initialize(const TopoDS_Face& F,
//purpose :
//=======================================================================
const GeomAdaptor_Surface& BRepAdaptor_Surface::Surface() const
const Handle(GeomAdaptor_Surface)& BRepAdaptor_Surface::Surface() const
{
return mySurf;
}
//=======================================================================
//function : ChangeSurface
//purpose :
//=======================================================================
GeomAdaptor_Surface& BRepAdaptor_Surface::ChangeSurface()
{
return mySurf;
}
//=======================================================================
//function : Trsf
//purpose :
@@ -165,7 +154,7 @@ Standard_Real BRepAdaptor_Surface::Tolerance() const
void BRepAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
mySurf.UIntervals(T,S);
mySurf->UIntervals(T,S);
}
@@ -177,7 +166,7 @@ void BRepAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T,
void BRepAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const
{
mySurf.VIntervals(T,S);
mySurf->VIntervals(T,S);
}
@@ -192,7 +181,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::UTrim
const Standard_Real Tol ) const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->UTrim(First,Last,Tol);
}
@@ -208,7 +197,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::VTrim
const Standard_Real Tol) const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->VTrim(First,Last,Tol);
}
@@ -221,7 +210,7 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::VTrim
gp_Pnt BRepAdaptor_Surface::Value(const Standard_Real U,
const Standard_Real V) const
{
return mySurf.Value(U,V).Transformed(myTrsf);
return mySurf->Value(U,V).Transformed(myTrsf);
}
//=======================================================================
@@ -233,7 +222,7 @@ void BRepAdaptor_Surface::D0(const Standard_Real U,
const Standard_Real V,
gp_Pnt& P) const
{
mySurf.D0(U,V,P);
mySurf->D0(U,V,P);
P.Transform(myTrsf);
}
@@ -248,7 +237,7 @@ void BRepAdaptor_Surface::D1(const Standard_Real U,
gp_Vec& D1U,
gp_Vec& D1V)const
{
mySurf.D1(U,V,P,D1U,D1V);
mySurf->D1(U,V,P,D1U,D1V);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -268,7 +257,7 @@ void BRepAdaptor_Surface::D2(const Standard_Real U,
gp_Vec& D2V,
gp_Vec& D2UV)const
{
mySurf.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
mySurf->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -291,7 +280,7 @@ void BRepAdaptor_Surface::D3(const Standard_Real U,
gp_Vec& D3U, gp_Vec& D3V,
gp_Vec& D3UUV, gp_Vec& D3UVV)const
{
mySurf.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
mySurf->D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
P.Transform(myTrsf);
D1U.Transform(myTrsf);
D1V.Transform(myTrsf);
@@ -315,7 +304,7 @@ gp_Vec BRepAdaptor_Surface::DN(const Standard_Real U,
const Standard_Integer Nu,
const Standard_Integer Nv) const
{
return mySurf.DN(U,V,Nu,Nv).Transformed(myTrsf);
return mySurf->DN(U,V,Nu,Nv).Transformed(myTrsf);
}
//=======================================================================
@@ -325,7 +314,7 @@ gp_Vec BRepAdaptor_Surface::DN(const Standard_Real U,
gp_Pln BRepAdaptor_Surface::Plane()const
{
return mySurf.Plane().Transformed(myTrsf);
return mySurf->Plane().Transformed(myTrsf);
}
@@ -336,7 +325,7 @@ gp_Pln BRepAdaptor_Surface::Plane()const
gp_Cylinder BRepAdaptor_Surface::Cylinder()const
{
return mySurf.Cylinder().Transformed(myTrsf);
return mySurf->Cylinder().Transformed(myTrsf);
}
@@ -347,7 +336,7 @@ gp_Cylinder BRepAdaptor_Surface::Cylinder()const
gp_Sphere BRepAdaptor_Surface::Sphere()const
{
return mySurf.Sphere().Transformed(myTrsf);
return mySurf->Sphere().Transformed(myTrsf);
}
@@ -358,7 +347,7 @@ gp_Sphere BRepAdaptor_Surface::Sphere()const
gp_Cone BRepAdaptor_Surface::Cone()const
{
return mySurf.Cone().Transformed(myTrsf);
return mySurf->Cone().Transformed(myTrsf);
}
//=======================================================================
@@ -368,7 +357,7 @@ gp_Cone BRepAdaptor_Surface::Cone()const
gp_Torus BRepAdaptor_Surface::Torus()const
{
return mySurf.Torus().Transformed(myTrsf);
return mySurf->Torus().Transformed(myTrsf);
}
//=======================================================================
@@ -379,7 +368,7 @@ gp_Torus BRepAdaptor_Surface::Torus()const
Handle(Geom_BezierSurface) BRepAdaptor_Surface::Bezier() const
{
return Handle(Geom_BezierSurface)::DownCast
(mySurf.Bezier()->Transformed(myTrsf));
(mySurf->Bezier()->Transformed(myTrsf));
}
@@ -391,7 +380,7 @@ Handle(Geom_BezierSurface) BRepAdaptor_Surface::Bezier() const
Handle(Geom_BSplineSurface) BRepAdaptor_Surface::BSpline() const
{
return Handle(Geom_BSplineSurface)::DownCast
(mySurf.BSpline()->Transformed(myTrsf));
(mySurf->BSpline()->Transformed(myTrsf));
}
@@ -402,7 +391,7 @@ Handle(Geom_BSplineSurface) BRepAdaptor_Surface::BSpline() const
gp_Ax1 BRepAdaptor_Surface::AxeOfRevolution() const
{
return mySurf.AxeOfRevolution().Transformed(myTrsf);
return mySurf->AxeOfRevolution().Transformed(myTrsf);
}
@@ -413,7 +402,7 @@ gp_Ax1 BRepAdaptor_Surface::AxeOfRevolution() const
gp_Dir BRepAdaptor_Surface::Direction() const
{
return mySurf.Direction().Transformed(myTrsf);
return mySurf->Direction().Transformed(myTrsf);
}
@@ -425,7 +414,7 @@ gp_Dir BRepAdaptor_Surface::Direction() const
Handle(Adaptor3d_Curve) BRepAdaptor_Surface::BasisCurve() const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->BasisCurve();
}
@@ -439,7 +428,7 @@ Handle(Adaptor3d_Curve) BRepAdaptor_Surface::BasisCurve() const
Handle(Adaptor3d_Surface) BRepAdaptor_Surface::BasisSurface() const
{
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
HS->Load (Handle(Geom_Surface)::DownCast(mySurf.Surface()->Transformed(myTrsf)));
HS->Load (Handle(Geom_Surface)::DownCast(mySurf->Surface()->Transformed(myTrsf)));
return HS->BasisSurface();
}
@@ -451,6 +440,6 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::BasisSurface() const
Standard_Real BRepAdaptor_Surface::OffsetValue() const
{
return mySurf.OffsetValue();
return mySurf->OffsetValue();
}

View File

@@ -71,10 +71,7 @@ public:
Standard_EXPORT void Initialize (const TopoDS_Face& F, const Standard_Boolean Restriction = Standard_True);
//! Returns the surface.
Standard_EXPORT const GeomAdaptor_Surface& Surface() const;
//! Returns the surface.
Standard_EXPORT GeomAdaptor_Surface& ChangeSurface();
Standard_EXPORT const Handle(GeomAdaptor_Surface)& Surface() const;
//! Returns the surface coordinate system.
Standard_EXPORT const gp_Trsf& Trsf() const;
@@ -85,27 +82,27 @@ public:
//! Returns the face tolerance.
Standard_EXPORT Standard_Real Tolerance() const;
virtual Standard_Real FirstUParameter() const Standard_OVERRIDE { return mySurf.FirstUParameter(); }
virtual Standard_Real FirstUParameter() const Standard_OVERRIDE { return mySurf->FirstUParameter(); }
virtual Standard_Real LastUParameter() const Standard_OVERRIDE { return mySurf.LastUParameter(); }
virtual Standard_Real LastUParameter() const Standard_OVERRIDE { return mySurf->LastUParameter(); }
virtual Standard_Real FirstVParameter() const Standard_OVERRIDE { return mySurf.FirstVParameter(); }
virtual Standard_Real FirstVParameter() const Standard_OVERRIDE { return mySurf->FirstVParameter(); }
virtual Standard_Real LastVParameter() const Standard_OVERRIDE { return mySurf.LastVParameter(); }
virtual Standard_Real LastVParameter() const Standard_OVERRIDE { return mySurf->LastVParameter(); }
virtual GeomAbs_Shape UContinuity() const Standard_OVERRIDE { return mySurf.UContinuity(); }
virtual GeomAbs_Shape UContinuity() const Standard_OVERRIDE { return mySurf->UContinuity(); }
virtual GeomAbs_Shape VContinuity() const Standard_OVERRIDE { return mySurf.VContinuity(); }
virtual GeomAbs_Shape VContinuity() const Standard_OVERRIDE { return mySurf->VContinuity(); }
//! If necessary, breaks the surface in U intervals of
//! continuity <S>. And returns the number of
//! intervals.
virtual Standard_Integer NbUIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf.NbUIntervals (theSh); }
virtual Standard_Integer NbUIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf->NbUIntervals (theSh); }
//! If necessary, breaks the surface in V intervals of
//! continuity <S>. And returns the number of
//! intervals.
virtual Standard_Integer NbVIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf.NbVIntervals (theSh); }
virtual Standard_Integer NbVIntervals (const GeomAbs_Shape theSh) const Standard_OVERRIDE { return mySurf->NbVIntervals (theSh); }
//! Returns the intervals with the requested continuity
//! in the U direction.
@@ -128,17 +125,17 @@ public:
//! If <First> >= <Last>
Standard_EXPORT Handle(Adaptor3d_Surface) VTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const Standard_OVERRIDE;
virtual Standard_Boolean IsUClosed() const Standard_OVERRIDE { return mySurf.IsUClosed(); }
virtual Standard_Boolean IsUClosed() const Standard_OVERRIDE { return mySurf->IsUClosed(); }
virtual Standard_Boolean IsVClosed() const Standard_OVERRIDE { return mySurf.IsVClosed(); }
virtual Standard_Boolean IsVClosed() const Standard_OVERRIDE { return mySurf->IsVClosed(); }
virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE { return mySurf.IsUPeriodic(); }
virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE { return mySurf->IsUPeriodic(); }
virtual Standard_Real UPeriod() const Standard_OVERRIDE { return mySurf.UPeriod(); }
virtual Standard_Real UPeriod() const Standard_OVERRIDE { return mySurf->UPeriod(); }
virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE { return mySurf.IsVPeriodic(); }
virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE { return mySurf->IsVPeriodic(); }
virtual Standard_Real VPeriod() const Standard_OVERRIDE { return mySurf.VPeriod(); }
virtual Standard_Real VPeriod() const Standard_OVERRIDE { return mySurf->VPeriod(); }
//! Computes the point of parameters U,V on the surface.
//! Tip: use GeomLib::NormEstim() to calculate surface normal at specified (U, V) point.
@@ -174,17 +171,17 @@ public:
//! Returns the parametric U resolution corresponding
//! to the real space resolution <R3d>.
virtual Standard_Real UResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf.UResolution (theR3d); }
virtual Standard_Real UResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf->UResolution (theR3d); }
//! Returns the parametric V resolution corresponding
//! to the real space resolution <R3d>.
virtual Standard_Real VResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf.VResolution (theR3d); }
virtual Standard_Real VResolution (const Standard_Real theR3d) const Standard_OVERRIDE { return mySurf->VResolution (theR3d); }
//! Returns the type of the surface : Plane, Cylinder,
//! Cone, Sphere, Torus, BezierSurface,
//! BSplineSurface, SurfaceOfRevolution,
//! SurfaceOfExtrusion, OtherSurface
virtual GeomAbs_SurfaceType GetType() const Standard_OVERRIDE { return mySurf.GetType(); }
virtual GeomAbs_SurfaceType GetType() const Standard_OVERRIDE { return mySurf->GetType(); }
Standard_EXPORT gp_Pln Plane() const Standard_OVERRIDE;
@@ -196,21 +193,21 @@ public:
Standard_EXPORT gp_Torus Torus() const Standard_OVERRIDE;
virtual Standard_Integer UDegree() const Standard_OVERRIDE { return mySurf.UDegree(); }
virtual Standard_Integer UDegree() const Standard_OVERRIDE { return mySurf->UDegree(); }
virtual Standard_Integer NbUPoles() const Standard_OVERRIDE { return mySurf.NbUPoles(); }
virtual Standard_Integer NbUPoles() const Standard_OVERRIDE { return mySurf->NbUPoles(); }
virtual Standard_Integer VDegree() const Standard_OVERRIDE { return mySurf.VDegree(); }
virtual Standard_Integer VDegree() const Standard_OVERRIDE { return mySurf->VDegree(); }
virtual Standard_Integer NbVPoles() const Standard_OVERRIDE { return mySurf.NbVPoles(); }
virtual Standard_Integer NbVPoles() const Standard_OVERRIDE { return mySurf->NbVPoles(); }
virtual Standard_Integer NbUKnots() const Standard_OVERRIDE { return mySurf.NbUKnots(); }
virtual Standard_Integer NbUKnots() const Standard_OVERRIDE { return mySurf->NbUKnots(); }
virtual Standard_Integer NbVKnots() const Standard_OVERRIDE { return mySurf.NbVKnots(); }
virtual Standard_Integer NbVKnots() const Standard_OVERRIDE { return mySurf->NbVKnots(); }
virtual Standard_Boolean IsURational() const Standard_OVERRIDE { return mySurf.IsURational(); }
virtual Standard_Boolean IsURational() const Standard_OVERRIDE { return mySurf->IsURational(); }
virtual Standard_Boolean IsVRational() const Standard_OVERRIDE { return mySurf.IsVRational(); }
virtual Standard_Boolean IsVRational() const Standard_OVERRIDE { return mySurf->IsVRational(); }
Standard_EXPORT Handle(Geom_BezierSurface) Bezier() const Standard_OVERRIDE;
@@ -236,7 +233,7 @@ public:
private:
GeomAdaptor_Surface mySurf;
Handle(GeomAdaptor_Surface) mySurf;
gp_Trsf myTrsf;
TopoDS_Face myFace;

View File

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

View File

@@ -21,7 +21,6 @@
#include <TopTools_ListOfShape.hxx>
class TopoDS_Wire;
class TopoDS_Edge;
class TopoDS_Face;
class TopoDS_Shape;
@@ -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

@@ -244,7 +244,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
for(i = 1; i <= NbEdges; i++){
DescenList.Clear();
Handle(BRepAdaptor_Curve) hcur = new BRepAdaptor_Curve (TopoDS::Edge(Edges->Value(i)));
Elementary = IsElementary(*hcur);
Elementary = IsElementary(hcur);
for(j = 1; j <= NbFaces; j++){
Handle(BRepAdaptor_Surface) hsur = new BRepAdaptor_Surface (TopoDS::Face(Faces->Value(j)));
@@ -627,10 +627,10 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
//purpose :
//=======================================================================
Standard_Boolean BRepAlgo_NormalProjection::IsElementary(const Adaptor3d_Curve& C) const
Standard_Boolean BRepAlgo_NormalProjection::IsElementary(const Handle(Adaptor3d_Curve)& C) const
{
GeomAbs_CurveType type;
type = C.GetType();
type = C->GetType();
switch(type) {
case GeomAbs_Line:
case GeomAbs_Circle:

View File

@@ -92,7 +92,7 @@ public:
//! shape <S>.
Standard_EXPORT const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
Standard_EXPORT Standard_Boolean IsElementary (const Adaptor3d_Curve& C) const;
Standard_EXPORT Standard_Boolean IsElementary (const Handle(Adaptor3d_Curve)& C) const;
//! build the result as a list of wire if possible in --
//! a first returns a wire only if there is only a wire.

View File

@@ -79,7 +79,7 @@ public:
Standard_EXPORT BRepApprox_Approx();
Standard_EXPORT void Perform (const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
Standard_EXPORT void Perform (const Handle(BRepAdaptor_Surface)& Surf1, const Handle(BRepAdaptor_Surface)& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
Standard_EXPORT void Perform (const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
@@ -120,7 +120,7 @@ protected:
private:
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax, const Standard_Boolean isTheQuadFirst);
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const Handle(BRepAdaptor_Surface)& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax, const Standard_Boolean isTheQuadFirst);
Standard_EXPORT void UpdateTolReached();

View File

@@ -37,7 +37,7 @@
#include <AppParCurves_MultiBSpCurve.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -19,24 +19,24 @@
#include <BRepAdaptor_Surface.hxx>
#include <Geom_BezierSurface.hxx>
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const BRepAdaptor_Surface&)
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const Handle(BRepAdaptor_Surface)&)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const BRepAdaptor_Surface&)
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const Handle(BRepAdaptor_Surface)&)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const BRepAdaptor_Surface&,
Standard_Integer BRepApprox_SurfaceTool::NbSamplesU (const Handle(BRepAdaptor_Surface)&,
const Standard_Real,
const Standard_Real)
{
return(10);
}
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const BRepAdaptor_Surface&,
Standard_Integer BRepApprox_SurfaceTool::NbSamplesV (const Handle(BRepAdaptor_Surface)&,
const Standard_Real,
const Standard_Real)
{

View File

@@ -41,85 +41,85 @@ public:
DEFINE_STANDARD_ALLOC
static Standard_Real FirstUParameter (const BRepAdaptor_Surface& S);
static Standard_Real FirstUParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real FirstVParameter (const BRepAdaptor_Surface& S);
static Standard_Real FirstVParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real LastUParameter (const BRepAdaptor_Surface& S);
static Standard_Real LastUParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real LastVParameter (const BRepAdaptor_Surface& S);
static Standard_Real LastVParameter (const Handle(BRepAdaptor_Surface)& S);
static Standard_Integer NbUIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbUIntervals (const Handle(BRepAdaptor_Surface)& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh);
static Standard_Integer NbVIntervals (const Handle(BRepAdaptor_Surface)& S, const GeomAbs_Shape Sh);
static void UIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void UIntervals (const Handle(BRepAdaptor_Surface)& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
static void VIntervals (const Handle(BRepAdaptor_Surface)& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) UTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Handle(Adaptor3d_Surface) UTrim (const Handle(BRepAdaptor_Surface)& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
//! If <First> >= <Last>
static Handle(Adaptor3d_Surface) VTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Handle(Adaptor3d_Surface) VTrim (const Handle(BRepAdaptor_Surface)& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
static Standard_Boolean IsUClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUClosed (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsVClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVClosed (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsUPeriodic (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUPeriodic (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real UPeriod (const BRepAdaptor_Surface& S);
static Standard_Real UPeriod (const Handle(BRepAdaptor_Surface)& S);
static Standard_Boolean IsVPeriodic (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVPeriodic (const Handle(BRepAdaptor_Surface)& S);
static Standard_Real VPeriod (const BRepAdaptor_Surface& S);
static Standard_Real VPeriod (const Handle(BRepAdaptor_Surface)& S);
static gp_Pnt Value (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v);
static gp_Pnt Value (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v);
static void D0 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D0 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P);
static void D1 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
static void D1 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v);
static void D2 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV);
static void D2 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV);
static void D3 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV);
static void D3 (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV);
static gp_Vec DN (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
static gp_Vec DN (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv);
static Standard_Real UResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real UResolution (const Handle(BRepAdaptor_Surface)& S, const Standard_Real R3d);
static Standard_Real VResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d);
static Standard_Real VResolution (const Handle(BRepAdaptor_Surface)& S, const Standard_Real R3d);
static GeomAbs_SurfaceType GetType (const BRepAdaptor_Surface& S);
static GeomAbs_SurfaceType GetType (const Handle(BRepAdaptor_Surface)& S);
static gp_Pln Plane (const BRepAdaptor_Surface& S);
static gp_Pln Plane (const Handle(BRepAdaptor_Surface)& S);
static gp_Cylinder Cylinder (const BRepAdaptor_Surface& S);
static gp_Cylinder Cylinder (const Handle(BRepAdaptor_Surface)& S);
static gp_Cone Cone (const BRepAdaptor_Surface& S);
static gp_Cone Cone (const Handle(BRepAdaptor_Surface)& S);
static gp_Torus Torus (const BRepAdaptor_Surface& S);
static gp_Torus Torus (const Handle(BRepAdaptor_Surface)& S);
static gp_Sphere Sphere (const BRepAdaptor_Surface& S);
static gp_Sphere Sphere (const Handle(BRepAdaptor_Surface)& S);
static Handle(Geom_BezierSurface) Bezier (const BRepAdaptor_Surface& S);
static Handle(Geom_BezierSurface) Bezier (const Handle(BRepAdaptor_Surface)& S);
static Handle(Geom_BSplineSurface) BSpline (const BRepAdaptor_Surface& S);
static Handle(Geom_BSplineSurface) BSpline (const Handle(BRepAdaptor_Surface)& S);
static gp_Ax1 AxeOfRevolution (const BRepAdaptor_Surface& S);
static gp_Ax1 AxeOfRevolution (const Handle(BRepAdaptor_Surface)& S);
static gp_Dir Direction (const BRepAdaptor_Surface& S);
static gp_Dir Direction (const Handle(BRepAdaptor_Surface)& S);
static Handle(Adaptor3d_Curve) BasisCurve (const BRepAdaptor_Surface& S);
static Handle(Adaptor3d_Curve) BasisCurve (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S);
Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(BRepAdaptor_Surface)& S);
Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S, const Standard_Real u1, const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(BRepAdaptor_Surface)& S, const Standard_Real u1, const Standard_Real u2);
Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S, const Standard_Real v1, const Standard_Real v2);
Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(BRepAdaptor_Surface)& S, const Standard_Real v1, const Standard_Real v2);

View File

@@ -28,107 +28,107 @@
#include <Adaptor3d_Surface.hxx>
#include <Adaptor3d_Curve.hxx>
inline Standard_Real BRepApprox_SurfaceTool::FirstUParameter(const BRepAdaptor_Surface& Surf){ return Surf.FirstUParameter(); }
inline Standard_Real BRepApprox_SurfaceTool::FirstVParameter(const BRepAdaptor_Surface& Surf){ return Surf.FirstVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastUParameter(const BRepAdaptor_Surface& Surf){ return Surf.LastUParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastVParameter(const BRepAdaptor_Surface& Surf){ return Surf.LastVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::FirstUParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->FirstUParameter(); }
inline Standard_Real BRepApprox_SurfaceTool::FirstVParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->FirstVParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastUParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->LastUParameter();}
inline Standard_Real BRepApprox_SurfaceTool::LastVParameter(const Handle(BRepAdaptor_Surface)& Surf){ return Surf->LastVParameter();}
inline Standard_Integer BRepApprox_SurfaceTool::NbUIntervals(const BRepAdaptor_Surface& Surf,
inline Standard_Integer BRepApprox_SurfaceTool::NbUIntervals(const Handle(BRepAdaptor_Surface)& Surf,
const GeomAbs_Shape S){
return Surf.NbUIntervals(S);
return Surf->NbUIntervals(S);
}
inline Standard_Integer BRepApprox_SurfaceTool::NbVIntervals(const BRepAdaptor_Surface& Surf,
inline Standard_Integer BRepApprox_SurfaceTool::NbVIntervals(const Handle(BRepAdaptor_Surface)& Surf,
const GeomAbs_Shape S){
return Surf.NbVIntervals(S);
return Surf->NbVIntervals(S);
}
inline void BRepApprox_SurfaceTool::UIntervals(const BRepAdaptor_Surface& Surf,
inline void BRepApprox_SurfaceTool::UIntervals(const Handle(BRepAdaptor_Surface)& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){
Surf.UIntervals(Tab,S);
Surf->UIntervals(Tab,S);
}
inline void BRepApprox_SurfaceTool::VIntervals(const BRepAdaptor_Surface& Surf,
inline void BRepApprox_SurfaceTool::VIntervals(const Handle(BRepAdaptor_Surface)& Surf,
TColStd_Array1OfReal& Tab,
const GeomAbs_Shape S){
Surf.VIntervals(Tab,S);
Surf->VIntervals(Tab,S);
}
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::UTrim(const BRepAdaptor_Surface& Surf,
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::UTrim(const Handle(BRepAdaptor_Surface)& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol) {
return Surf.UTrim(F,L,Tol);
return Surf->UTrim(F,L,Tol);
}
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::VTrim(const BRepAdaptor_Surface& Surf,
inline Handle(Adaptor3d_Surface) BRepApprox_SurfaceTool::VTrim(const Handle(BRepAdaptor_Surface)& Surf,
const Standard_Real F,
const Standard_Real L,
const Standard_Real Tol) {
return Surf.VTrim(F,L,Tol);
return Surf->VTrim(F,L,Tol);
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUClosed(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsUClosed(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsUClosed();
return S->IsUClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsVClosed();
return S->IsVClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsUPeriodic();
return S->IsUPeriodic();
}
inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface& S)
inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const Handle(BRepAdaptor_Surface)& S)
{
return S.UPeriod();
return S->UPeriod();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const Handle(BRepAdaptor_Surface)& S)
{
return S.IsVPeriodic();
return S->IsVPeriodic();
}
inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const BRepAdaptor_Surface& S)
inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const Handle(BRepAdaptor_Surface)& S)
{
return S.VPeriod();
return S->VPeriod();
}
inline gp_Pnt BRepApprox_SurfaceTool::Value(const BRepAdaptor_Surface& S,
inline gp_Pnt BRepApprox_SurfaceTool::Value(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V )
{
return S.Value(U,V);
return S->Value(U,V);
}
inline void BRepApprox_SurfaceTool::D0(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D0(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P)
{
S.D0(U,V,P);
S->D0(U,V,P);
}
inline void BRepApprox_SurfaceTool::D1(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D1(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
gp_Vec& D1U,
gp_Vec& D1V)
{
S.D1(U,V,P,D1U,D1V);
S->D1(U,V,P,D1U,D1V);
}
inline void BRepApprox_SurfaceTool::D2(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D2(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
@@ -138,10 +138,10 @@ inline void BRepApprox_SurfaceTool::D2(const BRepAdaptor_Surface& S,
gp_Vec& D2V,
gp_Vec& D2UV)
{
S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
S->D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
}
inline void BRepApprox_SurfaceTool::D3(const BRepAdaptor_Surface& S,
inline void BRepApprox_SurfaceTool::D3(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
gp_Pnt& P,
@@ -155,78 +155,78 @@ inline void BRepApprox_SurfaceTool::D3(const BRepAdaptor_Surface& S,
gp_Vec& D3UUV,
gp_Vec& D3UVV)
{
S.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
S->D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
}
inline gp_Vec BRepApprox_SurfaceTool::DN(const BRepAdaptor_Surface& S,
inline gp_Vec BRepApprox_SurfaceTool::DN(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real U,
const Standard_Real V,
const Standard_Integer Nu,
const Standard_Integer Nv)
{
return S.DN(U,V,Nu,Nv);
return S->DN(U,V,Nu,Nv);
}
inline Standard_Real BRepApprox_SurfaceTool::UResolution(const BRepAdaptor_Surface& S,
inline Standard_Real BRepApprox_SurfaceTool::UResolution(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real R3d)
{
return S.UResolution(R3d);
return S->UResolution(R3d);
}
inline Standard_Real BRepApprox_SurfaceTool::VResolution(const BRepAdaptor_Surface& S,
inline Standard_Real BRepApprox_SurfaceTool::VResolution(const Handle(BRepAdaptor_Surface)& S,
const Standard_Real R3d)
{
return S.VResolution(R3d);
return S->VResolution(R3d);
}
inline GeomAbs_SurfaceType BRepApprox_SurfaceTool::GetType(const BRepAdaptor_Surface& S )
inline GeomAbs_SurfaceType BRepApprox_SurfaceTool::GetType(const Handle(BRepAdaptor_Surface)& S )
{
return S.GetType();
return S->GetType();
}
inline gp_Pln BRepApprox_SurfaceTool::Plane(const BRepAdaptor_Surface& S)
inline gp_Pln BRepApprox_SurfaceTool::Plane(const Handle(BRepAdaptor_Surface)& S)
{
return S.Plane();
return S->Plane();
}
inline gp_Cylinder BRepApprox_SurfaceTool::Cylinder(const BRepAdaptor_Surface& S)
inline gp_Cylinder BRepApprox_SurfaceTool::Cylinder(const Handle(BRepAdaptor_Surface)& S)
{
return S.Cylinder();
return S->Cylinder();
}
inline gp_Cone BRepApprox_SurfaceTool::Cone(const BRepAdaptor_Surface& S)
inline gp_Cone BRepApprox_SurfaceTool::Cone(const Handle(BRepAdaptor_Surface)& S)
{
return S.Cone();
return S->Cone();
}
inline gp_Sphere BRepApprox_SurfaceTool::Sphere(const BRepAdaptor_Surface& S)
inline gp_Sphere BRepApprox_SurfaceTool::Sphere(const Handle(BRepAdaptor_Surface)& S)
{
return S.Sphere();
return S->Sphere();
}
inline gp_Torus BRepApprox_SurfaceTool::Torus(const BRepAdaptor_Surface& S)
inline gp_Torus BRepApprox_SurfaceTool::Torus(const Handle(BRepAdaptor_Surface)& S)
{
return S.Torus();
return S->Torus();
}
inline Handle(Geom_BezierSurface) BRepApprox_SurfaceTool::Bezier(const BRepAdaptor_Surface& S) {
return(S.Bezier());
inline Handle(Geom_BezierSurface) BRepApprox_SurfaceTool::Bezier(const Handle(BRepAdaptor_Surface)& S) {
return(S->Bezier());
}
inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceTool::BSpline(const BRepAdaptor_Surface& S) {
return(S.BSpline());
inline Handle(Geom_BSplineSurface) BRepApprox_SurfaceTool::BSpline(const Handle(BRepAdaptor_Surface)& S) {
return(S->BSpline());
}
inline gp_Ax1 BRepApprox_SurfaceTool::AxeOfRevolution(const BRepAdaptor_Surface& S) {
return(S.AxeOfRevolution());
inline gp_Ax1 BRepApprox_SurfaceTool::AxeOfRevolution(const Handle(BRepAdaptor_Surface)& S) {
return(S->AxeOfRevolution());
}
inline gp_Dir BRepApprox_SurfaceTool::Direction(const BRepAdaptor_Surface& S) {
return(S.Direction());
inline gp_Dir BRepApprox_SurfaceTool::Direction(const Handle(BRepAdaptor_Surface)& S) {
return(S->Direction());
}
inline Handle(Adaptor3d_Curve) BRepApprox_SurfaceTool::BasisCurve(const BRepAdaptor_Surface& S) {
return(S.BasisCurve());
inline Handle(Adaptor3d_Curve) BRepApprox_SurfaceTool::BasisCurve(const Handle(BRepAdaptor_Surface)& S) {
return(S->BasisCurve());
}

View File

@@ -42,7 +42,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2);
Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2);
Standard_EXPORT Standard_Integer NbVariables() const;
@@ -69,9 +69,9 @@ public:
gp_Dir2d DirectionOnS2() const;
const BRepAdaptor_Surface& AuxillarSurface1() const;
const Handle(BRepAdaptor_Surface) AuxillarSurface1() const;
const BRepAdaptor_Surface& AuxillarSurface2() const;
const Handle(BRepAdaptor_Surface) AuxillarSurface2() const;
@@ -113,7 +113,7 @@ private:
};
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -23,7 +23,7 @@
#include <math_Matrix.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -47,9 +47,9 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& Surf1, const IntSurf_Quadric& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& Surf1, const IntSurf_Quadric& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2);
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& Surf1, const Handle(BRepAdaptor_Surface)& Surf2);
//! returns True if Tg,Tguv1 Tguv2 can be computed.
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2,

View File

@@ -27,7 +27,7 @@
#include <gp_Vec2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -47,7 +47,7 @@ public:
DEFINE_STANDARD_ALLOC
//! compute the solution point with the close point
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const TColStd_Array1OfReal& Param, const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency);
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const TColStd_Array1OfReal& Param, const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2, const Standard_Real TolTangency);
//! initialize the parameters to compute the solution point
//! it 's possible to write to optimize:
@@ -59,7 +59,7 @@ public:
//! param(3)=...
//! inter.Perform(Param,rsnld);
//! }
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency);
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& S1, const Handle(BRepAdaptor_Surface)& S2, const Standard_Real TolTangency);
//! returns the best constant isoparametric to find
//! the next intersection's point +stores the solution

View File

@@ -29,7 +29,7 @@
#include <gp_Dir2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -46,7 +46,7 @@ public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepApprox_ThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2);
Standard_EXPORT BRepApprox_ThePrmPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& Surf1, const Handle(BRepAdaptor_Surface)& Surf2);
//! returns True if Tg,Tguv1 Tguv2 can be computed.
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2,

View File

@@ -26,7 +26,7 @@
#include <gp_Vec2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -46,11 +46,11 @@ public:
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox();
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& PS, const IntSurf_Quadric& IS);
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const Handle(BRepAdaptor_Surface)& PS, const IntSurf_Quadric& IS);
Standard_EXPORT BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& IS);
void Set (const BRepAdaptor_Surface& PS);
void Set (const Handle(BRepAdaptor_Surface)& PS);
void SetImplicitSurface (const IntSurf_Quadric& IS);
@@ -80,7 +80,7 @@ public:
const gp_Dir2d& Direction2d();
const BRepAdaptor_Surface& PSurface() const;
const Handle(BRepAdaptor_Surface) PSurface() const;
const IntSurf_Quadric& ISurface() const;
@@ -118,7 +118,7 @@ private:
};
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -27,7 +27,7 @@
#include <gp_Dir2d.hxx>
#define ThePSurface BRepAdaptor_Surface
#define ThePSurface Handle(BRepAdaptor_Surface)
#define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
#define ThePSurfaceTool BRepApprox_SurfaceTool
#define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>

View File

@@ -56,7 +56,7 @@ Standard_Boolean BRepBlend_BlendTool::Project(const gp_Pnt2d& P,
const Standard_Real epsX = 1.e-8;
const Standard_Integer Nbu = 20;
const Standard_Real Tol = 1.e-5;
Extrema_EPCOfExtPC2d extrema(P, *C, Nbu, epsX, Tol);
Extrema_EPCOfExtPC2d extrema(P, C, Nbu, epsX, Tol);
if (!extrema.IsDone())
return Standard_True;
@@ -91,9 +91,9 @@ Standard_Boolean BRepBlend_BlendTool::Inters(const gp_Pnt2d& P1,
gp_Dir2d d(v);
Handle(Geom2d_Line) bid = new Geom2d_Line(P1,d);
Geom2dAdaptor_Curve seg(bid,-0.01*mag,1.01*mag);
Handle(Geom2dAdaptor_Curve) seg = new Geom2dAdaptor_Curve(bid,-0.01*mag,1.01*mag);
Geom2dInt_GInter inter (seg, *C, Tol, Tol);
Geom2dInt_GInter inter (seg, C, Tol, Tol);
if (!inter.IsDone())
return Standard_False;

View File

@@ -45,7 +45,7 @@
#include <Extrema_ExtSS.hxx>
#include <GeomAdaptor_Surface.hxx>
//
static Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS);
static Standard_Boolean CanUseEdges(const Handle(Adaptor3d_Surface)& BS);
//
static void FindExactUVBounds(const TopoDS_Face F,
Standard_Real& umin, Standard_Real& umax,
@@ -53,13 +53,13 @@ static void FindExactUVBounds(const TopoDS_Face F,
const Standard_Real Tol,
Standard_Boolean& isNaturalRestriction);
//
static void AdjustFaceBox(const BRepAdaptor_Surface& BS,
static void AdjustFaceBox(const Handle(BRepAdaptor_Surface)& BS,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
Bnd_Box& FaceBox,
const Bnd_Box& EdgeBox, const Standard_Real Tol);
//
static Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
static Standard_Boolean IsModifySize(const Handle(BRepAdaptor_Surface)& theBS,
const gp_Pln& thePln, const gp_Pnt& theP,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
@@ -76,10 +76,10 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
TopExp_Explorer ex;
// Add the faces
BRepAdaptor_Surface BS;
Handle(BRepAdaptor_Surface) BS = new BRepAdaptor_Surface();
TopLoc_Location l, aDummyLoc;
Standard_Integer i, nbNodes;
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) {
const TopoDS_Face& F = TopoDS::Face(ex.Current());
@@ -92,16 +92,16 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
} else
{
if (!GS.IsNull()) {
BS.Initialize(F, Standard_False);
if (BS.GetType() != GeomAbs_Plane) {
BS.Initialize(F);
BS->Initialize(F, Standard_False);
if (BS->GetType() != GeomAbs_Plane) {
BS->Initialize(F);
BndLib_AddSurface::Add(BS, BRep_Tool::Tolerance(F), B);
}
else {
// on travaille directement sur les courbes 3d.
TopExp_Explorer ex2(F, TopAbs_EDGE);
if (!ex2.More()) {
BS.Initialize(F);
BS->Initialize(F);
BndLib_AddSurface::Add(BS, BRep_Tool::Tolerance(F), B);
}
else {
@@ -109,7 +109,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
const TopoDS_Edge& anEdge = TopoDS::Edge(ex2.Current());
if (BRep_Tool::IsGeometric (anEdge))
{
BC.Initialize (anEdge);
BC->Initialize (anEdge);
BndLib_Add3dCurve::Add (BC, BRep_Tool::Tolerance (anEdge), B);
}
}
@@ -167,7 +167,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
else {
if (BRep_Tool::IsGeometric(E))
{
BC.Initialize(E);
BC->Initialize(E);
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B);
}
}
@@ -197,13 +197,13 @@ void BRepBndLib::AddClose(const TopoDS_Shape& S, Bnd_Box& B)
// Add the edges
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
const TopoDS_Edge& anEdge = TopoDS::Edge (ex.Current());
if (BRep_Tool::IsGeometric (anEdge))
{
BC.Initialize (anEdge);
BC->Initialize (anEdge);
BndLib_Add3dCurve::Add(BC,0.,B);
}
}
@@ -226,11 +226,11 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
TopExp_Explorer ex;
// Add the faces
BRepAdaptor_Surface BS;
Handle(BRepAdaptor_Surface) BS = new BRepAdaptor_Surface();
Handle(Poly_Triangulation) T;
TopLoc_Location l;
Standard_Integer i, nbNodes;
BRepAdaptor_Curve BC;
Handle(BRepAdaptor_Curve) BC = new BRepAdaptor_Curve();
for (ex.Init(S,TopAbs_FACE); ex.More(); ex.Next()) {
const TopoDS_Face& F = TopoDS::Face(ex.Current());
@@ -248,11 +248,11 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
const Handle(Geom_Surface)& GS = BRep_Tool::Surface(F, l);
if (!GS.IsNull()) {
BS.Initialize(F, Standard_False);
BS->Initialize(F, Standard_False);
if (CanUseEdges(BS)) {
TopExp_Explorer ex2(F, TopAbs_EDGE);
if (!ex2.More()) {
BS.Initialize(F);
BS->Initialize(F);
Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(F) : 0.;
BndLib_AddSurface::AddOptimal(BS, Tol, aLocBox);
}
@@ -266,7 +266,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
continue;
}
BC.Initialize(anE);
BC->Initialize(anE);
Tol = useShapeTolerance? BRep_Tool::Tolerance(anE) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, anEBox);
aLocBox.Add(anEBox);
@@ -293,7 +293,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
{
continue;
}
BC.Initialize(anE);
BC->Initialize(anE);
Tol = useShapeTolerance? BRep_Tool::Tolerance(anE) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, anEBox);
EBox.Add(anEBox);
@@ -359,7 +359,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
else {
if (BRep_Tool::IsGeometric(E))
{
BC.Initialize(E);
BC->Initialize(E);
Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(E) : 0.;
BndLib_Add3dCurve::AddOptimal(BC, Tol, aLocBox);
}
@@ -392,9 +392,9 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
//purpose : Define is it possible using only edges bnd boxes
// to get face bnd box
//=======================================================================
Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
Standard_Boolean CanUseEdges(const Handle(Adaptor3d_Surface)& BS)
{
GeomAbs_SurfaceType aST = BS.GetType();
GeomAbs_SurfaceType aST = BS->GetType();
if(aST == GeomAbs_Plane ||
aST == GeomAbs_Cylinder ||
aST == GeomAbs_Cone ||
@@ -404,7 +404,7 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_SurfaceOfRevolution)
{
const Handle(Adaptor3d_Curve)& aBC = BS.BasisCurve();
const Handle(Adaptor3d_Curve)& aBC = BS->BasisCurve();
if(aBC->GetType() == GeomAbs_Line)
{
return Standard_True;
@@ -416,12 +416,12 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_OffsetSurface)
{
const Handle(Adaptor3d_Surface)& aS = BS.BasisSurface();
return CanUseEdges (*aS);
const Handle(Adaptor3d_Surface)& aS = BS->BasisSurface();
return CanUseEdges (aS);
}
else if(aST == GeomAbs_BSplineSurface)
{
Handle(Geom_BSplineSurface) aBSpl = BS.BSpline();
Handle(Geom_BSplineSurface) aBSpl = BS->BSpline();
if((aBSpl->UDegree() == 1 && aBSpl->NbUKnots() == 2) ||
(aBSpl->VDegree() == 1 && aBSpl->NbVKnots() == 2))
{
@@ -434,7 +434,7 @@ Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS)
}
else if(aST == GeomAbs_BezierSurface)
{
Handle(Geom_BezierSurface) aBz = BS.Bezier();
Handle(Geom_BezierSurface) aBz = BS->Bezier();
if((aBz->UDegree() == 1 ) ||
(aBz->VDegree() == 1 ))
{
@@ -637,7 +637,7 @@ inline void Reorder(Standard_Real& a, Standard_Real& b)
//function : IsModifySize
//purpose :
//=======================================================================
Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
Standard_Boolean IsModifySize(const Handle(BRepAdaptor_Surface)& theBS,
const gp_Pln& thePln, const gp_Pnt& theP,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
@@ -649,7 +649,7 @@ Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
Reorder(pu1, pu2);
Reorder(pv1, pv2);
Handle(Geom_Plane) aPlane = new Geom_Plane(thePln);
GeomAdaptor_Surface aGAPln(aPlane, pu1, pu2, pv1, pv2);
Handle(GeomAdaptor_Surface) aGAPln = new GeomAdaptor_Surface(aPlane, pu1, pu2, pv1, pv2);
Extrema_ExtSS anExtr(aGAPln, theBS, pu1, pu2, pv1, pv2, umin, umax, vmin, vmax, theTolU, theTolV);
if(anExtr.IsDone())
{
@@ -698,7 +698,7 @@ Standard_Boolean IsModifySize(const BRepAdaptor_Surface& theBS,
//function : AdjustFaceBox
//purpose :
//=======================================================================
void AdjustFaceBox(const BRepAdaptor_Surface& BS,
void AdjustFaceBox(const Handle(BRepAdaptor_Surface)& BS,
const Standard_Real umin, const Standard_Real umax,
const Standard_Real vmin, const Standard_Real vmax,
Bnd_Box& FaceBox,
@@ -720,9 +720,9 @@ void AdjustFaceBox(const BRepAdaptor_Surface& BS,
FaceBox.Get(fxmin, fymin, fzmin, fxmax, fymax, fzmax);
EdgeBox.Get(exmin, eymin, ezmin, exmax, eymax, ezmax);
//
Standard_Real TolU = Max(BS.UResolution(Tol), Precision::PConfusion());
Standard_Real TolV = Max(BS.VResolution(Tol), Precision::PConfusion());
BRepTopAdaptor_FClass2d FClass(BS.Face(), Max(TolU, TolV));
Standard_Real TolU = Max(BS->UResolution(Tol), Precision::PConfusion());
Standard_Real TolV = Max(BS->VResolution(Tol), Precision::PConfusion());
BRepTopAdaptor_FClass2d FClass(BS->Face(), Max(TolU, TolV));
//
Standard_Boolean isModified = Standard_False;
if(exmin > fxmin)

View File

@@ -35,12 +35,12 @@
// Function : IsLinear
// purpose : Returns TRUE if theC is line-like.
//=======================================================================
static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
static Standard_Boolean IsLinear(const Handle(Adaptor3d_Curve)& theC)
{
const GeomAbs_CurveType aCT = theC.GetType();
const GeomAbs_CurveType aCT = theC->GetType();
if(aCT == GeomAbs_OffsetCurve)
{
return IsLinear(GeomAdaptor_Curve(theC.OffsetCurve()->BasisCurve()));
return IsLinear(new GeomAdaptor_Curve(theC->OffsetCurve()->BasisCurve()));
}
if((aCT == GeomAbs_BSplineCurve) || (aCT == GeomAbs_BezierCurve))
@@ -49,8 +49,8 @@ static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
// represented with set of points. It will be possible made
// in the future.
return ((theC.Degree() == 1) &&
(theC.Continuity() != GeomAbs_C0));
return ((theC->Degree() == 1) &&
(theC->Continuity() != GeomAbs_C0));
}
if(aCT == GeomAbs_Line)
@@ -65,29 +65,29 @@ static Standard_Boolean IsLinear(const Adaptor3d_Curve& theC)
// Function : IsPlanar
// purpose : Returns TRUE if theS is plane-like.
//=======================================================================
static Standard_Boolean IsPlanar(const Adaptor3d_Surface& theS)
static Standard_Boolean IsPlanar(const Handle(Adaptor3d_Surface)& theS)
{
const GeomAbs_SurfaceType aST = theS.GetType();
const GeomAbs_SurfaceType aST = theS->GetType();
if(aST == GeomAbs_OffsetSurface)
{
return IsPlanar (*theS.BasisSurface());
return IsPlanar (theS->BasisSurface());
}
if(aST == GeomAbs_SurfaceOfExtrusion)
{
return IsLinear (*theS.BasisCurve());
return IsLinear (theS->BasisCurve());
}
if((aST == GeomAbs_BSplineSurface) || (aST == GeomAbs_BezierSurface))
{
if((theS.UDegree() != 1) || (theS.VDegree() != 1))
if((theS->UDegree() != 1) || (theS->VDegree() != 1))
return Standard_False;
// Indeed, surfaces with C0-continuity and degree==1, may be
// represented with set of points. It will be possible made
// in the future.
return ((theS.UContinuity() != GeomAbs_C0) && (theS.VContinuity() != GeomAbs_C0));
return ((theS->UContinuity() != GeomAbs_C0) && (theS->VContinuity() != GeomAbs_C0));
}
if(aST == GeomAbs_Plane)
@@ -157,7 +157,7 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
if (BRep_Tool::IsGeometric (anE))
{
const BRepAdaptor_Curve anAC(anE);
Handle(BRepAdaptor_Curve) anAC = new BRepAdaptor_Curve(anE);
if (!IsLinear(anAC))
{
if (!theIsTriangulationUsed)
@@ -210,7 +210,7 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
if (BRep_Tool::IsGeometric (anE))
{
const BRepAdaptor_Curve anAC(anE);
Handle(BRepAdaptor_Curve) anAC = new BRepAdaptor_Curve(anE);
if (IsLinear(anAC))
{
// skip linear edge as its vertices have already been added

View File

@@ -174,7 +174,7 @@ static Standard_Boolean IsClosedShape(const TopoDS_Shape& theshape,
Standard_Real first,last;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(aedge), first, last);
if (!c3d.IsNull()) {
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
Standard_Real length = GCPnts_AbscissaPoint::Length(cAdapt, first, last);
TotLength += length;
if (ve2.IsSame(v1) || ve2.IsSame(v2)) break;
@@ -444,10 +444,10 @@ static Standard_Boolean findNMVertices(const TopoDS_Edge& theEdge,
return Standard_False;
Standard_Real first, last;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(theEdge,first, last);
GeomAdaptor_Curve GAC(c3d);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(c3d);
Extrema_ExtPC locProj;
locProj.Initialize(GAC, first, last);
gp_Pnt pfirst = GAC.Value(first), plast = GAC.Value(last);
gp_Pnt pfirst = GAC->Value(first), plast = GAC->Value(last);
for (Standard_Integer i = 1; i <= nbV; i++) {
@@ -574,10 +574,10 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
// Take the longest edge as first
Standard_Real f, l;
Handle(Geom_Curve) c3d1 = BRep_Tool::Curve(TopoDS::Edge(edgeFirst), f, l);
GeomAdaptor_Curve cAdapt1(c3d1);
Handle(GeomAdaptor_Curve) cAdapt1 = new GeomAdaptor_Curve(c3d1);
Standard_Real len1 = GCPnts_AbscissaPoint::Length(cAdapt1, f, l);
Handle(Geom_Curve) c3d2 = BRep_Tool::Curve(TopoDS::Edge(edgeLast), f, l);
GeomAdaptor_Curve cAdapt2(c3d2);
Handle(GeomAdaptor_Curve) cAdapt2 = new GeomAdaptor_Curve(c3d2);
Standard_Real len2 = GCPnts_AbscissaPoint::Length(cAdapt2, f, l);
if (len1 < len2) {
edge1 = edgeLast;
@@ -1017,7 +1017,7 @@ void BRepBuilderAPI_Sewing::EvaluateAngulars(TopTools_SequenceOfShape& sequenceS
c3d->Transform(loc.Transformation());
}
GeomAdaptor_Curve adapt(c3d);
Handle(GeomAdaptor_Curve) adapt = new GeomAdaptor_Curve(c3d);
GCPnts_UniformAbscissa uniAbs(adapt, npt, first, last);
Standard_Real cumulateAngular = 0.0;
@@ -1283,7 +1283,8 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1,
Standard_Real C2Umin, C2Vmin, C2Umax, C2Vmax;
{ //szv: Use brackets to destroy local variables
Bnd_Box2d B1, B2;
Geom2dAdaptor_Curve aC2d1(C2d1), aC2d2(C2d2);
Handle(Geom2dAdaptor_Curve) aC2d1 = new Geom2dAdaptor_Curve(C2d1);
Handle(Geom2dAdaptor_Curve) aC2d2 = new Geom2dAdaptor_Curve(C2d2);
BndLib_Add2dCurve::Add(aC2d1,first2d1,last2d1,Precision::PConfusion(),B1);
BndLib_Add2dCurve::Add(aC2d2,first2d2,last2d2,Precision::PConfusion(),B2);
B1.Get(C1Umin,C1Vmin,C1Umax,C1Vmax);
@@ -3559,7 +3560,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
for (i = 1; i <= nbSection; i++) {
Standard_Real f, l;
Handle(Geom_Curve) c3d = BRep_Tool::Curve(TopoDS::Edge(seqEdges(i)), f, l);
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
Standard_Real len = GCPnts_AbscissaPoint::Length(cAdapt, f, l);
if (len > lenRef) { indRef = i; lenRef = len; }
}
@@ -3646,7 +3647,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Message_ProgressRange& theProgress)
{ //szv: Use brackets to destroy local variables
// Create bounding box around curve
Bnd_Box aGlobalBox;
GeomAdaptor_Curve adptC(c3d,first,last);
Handle(GeomAdaptor_Curve) adptC = new GeomAdaptor_Curve(c3d,first,last);
BndLib_Add3dCurve::Add(adptC,myTolerance,aGlobalBox);
// Sort vertices to find candidates
aSelector.SetCurrent (aGlobalBox);
@@ -3848,7 +3849,7 @@ static Standard_Boolean IsDegeneratedWire(const TopoDS_Shape& wire)
length = pfirst.Distance(plast);
}
else {
GeomAdaptor_Curve cAdapt(c3d);
Handle(GeomAdaptor_Curve) cAdapt = new GeomAdaptor_Curve(c3d);
length = GCPnts_AbscissaPoint::Length(cAdapt, first, last);
}
Standard_Real tole = BRep_Tool::Tolerance(Ve1)+BRep_Tool::Tolerance(Ve2);
@@ -4288,10 +4289,10 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
{
arrDist.Init(-1.0);
GeomAdaptor_Curve GAC(c3d);
Handle(GeomAdaptor_Curve) GAC = new GeomAdaptor_Curve(c3d);
Extrema_ExtPC locProj;
locProj.Initialize(GAC, first, last);
gp_Pnt pfirst = GAC.Value(first), plast = GAC.Value(last);
gp_Pnt pfirst = GAC->Value(first), plast = GAC->Value(last);
Standard_Integer find = 1;//(isConsiderEnds ? 1 : 2);
Standard_Integer lind = arrPnt.Length();//(isConsiderEnds ? arrPnt.Length() : arrPnt.Length() -1);
@@ -4316,7 +4317,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
isProjected = Standard_True;
Extrema_POnCurv pOnC = locProj.Point(indMin);
Standard_Real paramProj = pOnC.Parameter();
gp_Pnt ptProj = GAC.Value(paramProj);
gp_Pnt ptProj = GAC->Value(paramProj);
Standard_Real distProj2 = ptProj.SquareDistance(pt);
if (!locProj.IsMin(indMin)) {
if (Min(distF2,distL2) < dist2Min) {

View File

@@ -67,15 +67,15 @@ Standard_Boolean BRepCheck::SelfIntersection(const TopoDS_Wire& W,
//function : PrecCurve
//purpose :
//=======================================================================
Standard_Real BRepCheck::PrecCurve(const Adaptor3d_Curve& aAC3D)
Standard_Real BRepCheck::PrecCurve(const Handle(Adaptor3d_Curve)& aAC3D)
{
Standard_Real aXEmax = RealEpsilon();
//
GeomAbs_CurveType aCT = aAC3D.GetType();
GeomAbs_CurveType aCT = aAC3D->GetType();
if (aCT==GeomAbs_Ellipse) {
Standard_Real aX[5];
//
gp_Elips aEL3D=aAC3D.Ellipse();
gp_Elips aEL3D=aAC3D->Ellipse();
aEL3D.Location().Coord(aX[0], aX[1], aX[2]);
aX[3]=aEL3D.MajorRadius();
aX[4]=aEL3D.MinorRadius();

View File

@@ -44,7 +44,7 @@ public:
Standard_EXPORT static Standard_Boolean SelfIntersection (const TopoDS_Wire& W, const TopoDS_Face& F, TopoDS_Edge& E1, TopoDS_Edge& E2);
//! Returns the resolution on the 3d curve
Standard_EXPORT static Standard_Real PrecCurve(const Adaptor3d_Curve& aAC3D);
Standard_EXPORT static Standard_Real PrecCurve(const Handle(Adaptor3d_Curve)& aAC3D);
//! Returns the resolution on the surface
Standard_EXPORT static Standard_Real PrecSurface(const Handle(Adaptor3d_Surface)& aAHSurf);

View File

@@ -454,7 +454,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
Handle(GeomAdaptor_Curve) aHCurve =
new GeomAdaptor_Curve(ProjOnPlane);
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
Handle(ProjLib_ProjectedCurve) proj = new ProjLib_ProjectedCurve(GAHS,aHCurve);
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
Handle(Geom2dAdaptor_Curve) GHPC =
new Geom2dAdaptor_Curve(PC,

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