1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

Compare commits

..

1 Commits

Author SHA1 Message Date
ski
53f06757c2 0027571: Bad implementation of NCollection_Sequence::Iterator
Reverse iterator after creation points to the first iterated item now, i.e. last item of sequence.
Test case was created.
2022-10-20 14:27:46 +03:00
196 changed files with 1266 additions and 5607 deletions

View File

@@ -1,31 +0,0 @@
Instruction for building OCCT for ASRV
======================================
Build using regular native compiler
-----------------------------------
1. Make sure the directory 3rdparty is next to occt. It must contain the following products:
freetype
tcltk
2. Change current directory to adm/scripts.
3. On Windows run the script cmake_gen.bat.
On Linux run 'cmake_gen.sh' for release build and 'cmake_gen.sh -d' for debug build.
4. Go to build directory and build and install OCCT.
On Windows run:
build.bat
build.bat vc14 64 d
install.bat
install.bat vc14 64 d
On Linux run:
make -j4 install
Build using Emscripten to generate libs for Web assembly
--------------------------------------------------------
1. Make sure you have installed Emscripten. For that you can make sure occ-web3d directory
is next to occt. It must contain fips\fips-sdks\emsdk.
2. Make sure the directory 3rdparty is next to occt. It must contain the following products:
freetype wasm build
3. Change current directory to adm/scripts.
4. Run the script wasm_build.bat (wasm_build.sh on Linux).
5. Copy installed files from work/wasm to the 3rdparty under occt77-wasm.

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
@@ -32,18 +32,16 @@ if(__COTIRE_INCLUDED)
endif()
set(__COTIRE_INCLUDED TRUE)
# call cmake_minimum_required, but prevent modification of the CMake policy stack in include mode
# cmake_minimum_required also sets the policy version as a side effect, which we have to avoid
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(PUSH)
endif()
cmake_minimum_required(VERSION 2.8.12)
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(POP)
endif()
# 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)
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 +104,6 @@ if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
if (POLICY CMP0055)
# strict checking for break() command
cmake_policy(SET CMP0055 NEW)
endif()
include(CMakeParseArguments)
include(ProcessorCount)
@@ -239,13 +232,7 @@ function (cotire_filter_language_source_files _language _target _sourceFilesVar
# add to excluded sources, if file has custom compile flags
list (APPEND _excludedSourceFiles "${_sourceFile}")
else()
get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS)
if (_sourceCompileOptions)
# add to excluded sources, if file has list of custom compile options
list (APPEND _excludedSourceFiles "${_sourceFile}")
else()
list (APPEND _sourceFiles "${_sourceFile}")
endif()
list (APPEND _sourceFiles "${_sourceFile}")
endif()
endif()
endforeach()
@@ -304,7 +291,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 +307,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 +318,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 +439,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 +571,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 +625,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 +701,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 +709,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 +857,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 +874,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 +900,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 +1044,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 +1068,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 +1231,11 @@ function (cotire_scan_includes _includesVar)
set (${_includesVar} "" PARENT_SCOPE)
return()
endif()
# add source files to be scanned
if (WIN32)
foreach (_sourceFile ${_existingSourceFiles})
file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative)
list (APPEND _cmd "${_sourceFileNative}")
endforeach()
else()
list (APPEND _cmd ${_existingSourceFiles})
endif()
list (APPEND _cmd ${_existingSourceFiles})
if (COTIRE_VERBOSE)
message (STATUS "execute_process: ${_cmd}")
endif()
if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
if (_option_COMPILER_ID MATCHES "MSVC")
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT})
endif()
@@ -1502,16 +1471,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 +1505,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 +1515,16 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags
endif()
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -H print the name of each header file used
# -E invoke preprocessor
# -fno-color-diagnostics do not print diagnostics in color
# -Eonly just run preprocessor, no output
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
else()
# return as a flag string
set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly")
endif()
elseif (WIN32)
# Clang-cl.exe options used
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
# /EP preprocess to stdout without #line directives
# -H print the name of each header file used
# -fno-color-diagnostics do not print diagnostics in color
# -Eonly just run preprocessor, no output
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}" /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly)
else()
# return as a flag string
set (_flags "${_sourceFileType${_language}} /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly")
endif()
# Clang options used
# -H print the name of each header file used
# -E invoke preprocessor
# -fno-color-diagnostics don't prints diagnostics in color
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics)
else()
# return as a flag string
set (_flags "-H -E -fno-color-diagnostics")
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
@@ -1654,8 +1598,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 +1609,11 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
set (_xLanguage_CXX "c++-header")
if (_flags)
# append to list
list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
list (APPEND _flags "-x" "${_xLanguage_${_language}}" "-c" "${_prefixFile}" -o "${_pchFile}")
else()
# return as a flag string
set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -x specify the source language
# -c compile but do not link
# -o place output in file
# -fno-pch-timestamp disable inclusion of timestamp in precompiled headers (clang 4.0.0+)
set (_xLanguage_C "c-header")
set (_xLanguage_CXX "c++-header")
if (_flags)
# append to list
list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
list (APPEND _flags -Xclang -fno-pch-timestamp)
endif()
else()
# return as a flag string
set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
set (_flags "${_flags} -Xclang -fno-pch-timestamp")
endif()
endif()
elseif (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
# Clang-cl.exe options used
# /Yc creates a precompiled header file
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
# /Zs syntax check only
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}"
"/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
else()
# return as a flag string
set (_flags "/Yc\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
endif()
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
@@ -1755,28 +1655,20 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
get_filename_component(_pchName "${_pchFile}" NAME)
set (_xLanguage_C "c-header")
set (_xLanguage_CXX "c++-header")
set (_pchSuppressMessages FALSE)
if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
set(_pchSuppressMessages TRUE)
endif()
if (_flags)
# append to list
if ("${_language}" STREQUAL "CXX")
list (APPEND _flags -Kc++)
endif()
list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-create "${_pchName}" -fsyntax-only "${_hostFile}")
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
list (APPEND _flags -Wpch-messages)
endif()
list (APPEND _flags "-Wpch-messages")
endif()
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
set (_flags "${_flags} -Wpch-messages")
endif()
set (_flags "${_flags} -Wpch-messages")
endif()
endif()
endif()
@@ -1827,48 +1719,23 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags -Winvalid-pch -include "${_prefixFile}")
list (APPEND _flags "-Winvalid-pch" "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -include process include file as the first line of the primary source file
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}")
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\"")
endif()
elseif (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
# Clang-cl.exe options used
# /Yu uses a precompiled header file during build
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
if (_pchFile)
file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
if (_flags)
# append to list
list (APPEND _flags "/Yu${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
else()
# return as a flag string
set (_flags "/Yu\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
endif()
else()
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
list (APPEND _flags "/FI${_prefixFileNative}")
else()
# return as a flag string
set (_flags "/FI\"${_prefixFileNative}\"")
endif()
endif()
# Clang options used
# -include process include file as the first line of the primary source file
# -include-pch include precompiled header file
# -Qunused-arguments don't emit warning for unused driver arguments
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags "-Qunused-arguments" "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-Qunused-arguments -include \"${_prefixFile}\"")
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
@@ -1912,32 +1779,24 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
if (_pchFile)
get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
get_filename_component(_pchName "${_pchFile}" NAME)
set (_pchSuppressMessages FALSE)
if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
set(_pchSuppressMessages TRUE)
endif()
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-use "${_pchName}")
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
list (APPEND _flags -Wpch-messages)
endif()
list (APPEND _flags "-Wpch-messages")
endif()
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
set (_flags "${_flags} -Wpch-messages")
endif()
set (_flags "${_flags} -Wpch-messages")
endif()
endif()
else()
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}")
list (APPEND _flags "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\"")
@@ -1975,17 +1834,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 +1851,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 +1862,8 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
set (${_msgVar} "" PARENT_SCOPE)
endif()
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
if (UNIX)
# all Unix Clang versions have PCH support
set (${_msgVar} "" PARENT_SCOPE)
elseif (WIN32)
# only clang-cl is supported under Windows
get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE)
if (NOT _compilerName MATCHES "cl$")
set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE)
endif()
endif()
# all Clang versions have PCH support
set (${_msgVar} "" PARENT_SCOPE)
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
# Intel PCH support requires version >= 8.0.0
if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
@@ -2031,38 +1874,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 +2189,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 +2222,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 +2231,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 +2268,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 +2281,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 +2294,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 +2311,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 +2400,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 +2415,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 +2426,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 +2452,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 +2658,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 +2747,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 +2774,7 @@ function (cotire_compute_unity_max_number_of_includes _target _maxIncludesVar)
set (_sourceFiles ${ARGN})
get_target_property(_maxIncludes ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
if (_maxIncludes MATCHES "(-j|--parallel|--jobs) ?([0-9]*)")
if (DEFINED CMAKE_MATCH_2)
set (_numberOfThreads "${CMAKE_MATCH_2}")
else()
set (_numberOfThreads "")
endif()
set (_numberOfThreads "${CMAKE_MATCH_2}")
if (NOT _numberOfThreads)
# use all available cores
ProcessorCount(_numberOfThreads)
@@ -3093,9 +2887,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 +2936,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 +2980,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 +3008,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 +3034,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 +3055,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 +3067,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 +3079,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 +3092,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 +3101,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 +3126,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 +3148,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 +3306,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 +3338,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 +3602,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 +3701,7 @@ else()
FULL_DOCS
"The variable can be set to an integer > 0."
"If a target contains less than that number of source files, cotire will not enable the use of the precompiled header for the target."
"If not defined, defaults to 2."
"If not defined, defaults to 3."
)
define_property(

View File

@@ -3,6 +3,10 @@
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
if (NOT DEFINED INSTALL_DRACO)
set (INSTALL_DRACO OFF CACHE BOOL "${INSTALL_DRACO_DESCR}")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_DIR)
set (3RDPARTY_DRACO_DIR "" CACHE PATH "The directory containing Draco")
endif()
@@ -11,24 +15,14 @@ if (NOT DEFINED 3RDPARTY_DRACO_INCLUDE_DIR)
set (3RDPARTY_DRACO_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the Draco")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY)
set (3RDPARTY_DRACO_LIBRARY "" CACHE FILEPATH "Draco library")
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY OR NOT 3RDPARTY_DRACO_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DIR}")
set (3RDPARTY_DRACO_LIBRARY "" CACHE FILEPATH "Draco library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY_DIR)
set (3RDPARTY_DRACO_LIBRARY_DIR "" CACHE PATH "The directory containing Draco library")
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY_DEBUG)
set (3RDPARTY_DRACO_LIBRARY_DEBUG "" CACHE FILEPATH "Draco debug library")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY_DIR_DEBUG)
set (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "" CACHE PATH "The directory containing Draco debug library")
endif()
endif()
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_DRACO_DIR OR NOT EXISTS "${3RDPARTY_DRACO_DIR}")
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" draco DRACO_DIR_NAME)
@@ -38,19 +32,20 @@ if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
endif()
endif()
# header
if (NOT 3RDPARTY_DRACO_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_DRACO_INCLUDE_DIR}")
set (HEADER_NAMES draco)
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
set (DRACO_INCLUDE_PATH "${3RDPARTY_DRACO_DIR}/include")
set (DRACO_LIBRARY_PATH "${3RDPARTY_DRACO_DIR}/lib")
endif()
# set 3RDPARTY_DRACO_INCLUDE_DIR as notfound, otherwise find_path can't assign a new value to 3RDPARTY_DRACO_INCLUDE_DIR
set (3RDPARTY_DRACO_INCLUDE_DIR "3RDPARTY_DRACO_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "The directory containing headers of the Draco" FORCE)
if (NOT 3RDPARTY_DRACO_INCLUDE_DIR)
if (DRACO_INCLUDE_PATH AND EXISTS "${DRACO_INCLUDE_PATH}")
set (3RDPARTY_DRACO_INCLUDE_DIR "${DRACO_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of DRACO" FORCE)
endif()
endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
find_path (3RDPARTY_DRACO_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_DRACO_DIR}
PATH_SUFFIXES "include"
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_DRACO_LIBRARY_DIR)
if (DRACO_LIBRARY_PATH AND EXISTS "${DRACO_LIBRARY_PATH}")
set (3RDPARTY_DRACO_LIBRARY_DIR "${DRACO_LIBRARY_PATH}" CACHE FILEPATH "The directory containing DRACO library" FORCE)
endif()
endif()
@@ -62,11 +57,11 @@ endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
if (NOT 3RDPARTY_DRACO_LIBRARY OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (3RDPARTY_DRACO_LIBRARY "3RDPARTY_DRACO_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to Draco library" FORCE)
find_library (3RDPARTY_DRACO_LIBRARY NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_DIR}"
PATHS "${3RDPARTY_DRACO_LIBRARY_DIR}"
PATH_SUFFIXES lib
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
@@ -75,19 +70,27 @@ if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
endif()
endif()
endif()
if (WIN32 AND (NOT 3RDPARTY_DRACO_LIBRARY_DEBUG OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}"))
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
set (3RDPARTY_DRACO_LIBRARY_DEBUG "3RDPARTY_DRACO_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "The path to debug Draco library" FORCE)
if (3RDPARTY_DRACO_LIBRARY_DIR AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_DRACO_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_DRACO_LIBRARY_DIR)
endif()
find_library (3RDPARTY_DRACO_LIBRARY_DEBUG NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_DIR}"
PATH_SUFFIXES libd
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY_DEBUG AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DEBUG}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DIR_DEBUG}" CACHE FILEPATH "The directory containing debug Draco library" FORCE)
endif()
if (INSTALL_DRACO)
get_filename_component(3RDPARTY_DRACO_LIBRARY_REALPATH ${3RDPARTY_DRACO_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endif()

View File

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

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

View File

@@ -245,18 +245,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 +254,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")
@@ -370,10 +346,6 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
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 +373,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 +384,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,262 @@
# tbb
if (MSVC AND BUILD_SHARED_LIBS)
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
if (NOT DEFINED 3RDPARTY_DIR)
message (FATAL_ERROR "3RDPARTY_DIR is not defined.")
endif()
if ((NOT EXISTS "${3RDPARTY_DIR}") OR ("${3RDPARTY_DIR}" STREQUAL ""))
message (FATAL_ERROR "Directory ${3RDPARTY_DIR} is not set.")
endif()
if (NOT DEFINED INSTALL_TBB AND BUILD_SHARED_LIBS)
set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}")
endif()
# Initialize tbb directory.
# tbb directory
if (NOT DEFINED 3RDPARTY_TBB_DIR)
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
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()
if (MSVC AND BUILD_SHARED_LIBS)
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
endif()
# Below, we have correct 3RDPARTY_DIR.
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# Initialize TBB folder in connectin with 3RDPARTY_DIR.
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
# 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()
# Here we have full path name to installation directory of TBB.
# Employ it.
if (EXISTS "${3RDPARTY_TBB_DIR}")
find_package (
TBB 2021.5
PATHS "${3RDPARTY_TBB_DIR}" NO_DEFAULT_PATH
REQUIRED
CONFIG)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
endif()
# Achive include directory
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
# check 3RDPARTY_TBB_INCLUDE_DIR for consictency with specified 3RDPARTY_TBB_DIR
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_TBB_INCLUDE_DIR PATH "The directory containing headers of the TBB")
endif()
# tbb.h
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
set (HEADER_NAMES tbb.h tbb/tbb.h)
# set 3RDPARTY_TBB_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_TBB_INCLUDE_DIR
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "the path to tbb.h" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_TBB_DIR}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
if (3RDPARTY_TBB_INCLUDE_DIR AND EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "the path to tbb.h" FORCE)
endif()
# Throw execution if 3RDPARTY_TBB_DIR is equal to void string.
if ("${3RDPARTY_TBB_DIR}" STREQUAL "")
message (FATAL_ERROR "Directory with one TBB have not found.")
endif()
# Searching TBBConfig.cmake and TBBTargets-release.cmake in 3RDPARTY_TBB_DIR
# TBBConfig.cmake - is required, TBBTargets-release.cmake is optional.
file (GLOB_RECURSE TBB_CONFIG_CMAKE_FILE "${3RDPARTY_TBB_DIR}/*TBBConfig.cmake")
if (NOT EXISTS "${TBB_CONFIG_CMAKE_FILE}")
message (FATAL_ERROR "TBBConfig.cmake has not been found.")
endif()
include ("${TBB_CONFIG_CMAKE_FILE}")
file (GLOB_RECURSE TBB_TARGET_CMAKE_FILE "${3RDPARTY_TBB_DIR}/*TBBTargets-release.cmake")
if (EXISTS "${TBB_TARGET_CMAKE_FILE}")
include ("${TBB_TARGET_CMAKE_FILE}")
endif()
# We do not know, full path to file is pointed, or local.
# So, we should check it and output FULL PATH to FILE.
macro (TBB_FILE_NAME_TO_FILEPATH FL_NAME FL_PATH)
if (EXISTS "${FL_NAME}")
# FL_NAME is full path.
set (${FL_PATH} "${FL_NAME}")
else()
# Here we deal with local path, so assign to var full path to file.
# Acquire full path.
set (${FL_PATH} "${3RDPARTY_TBB_DIR}${FL_NAME}")
if (NOT EXISTS "${${FL_PATH}}")
message (FATAL_ERROR "TBB: needed file not found (${FL_PATH}).")
endif()
if (EXISTS "${TBB_INCLUDE_DIR}")
set (3RDPARTY_TBB_INCLUDE_DIR "${TBB_INCLUDE_DIR}" CACHE PATH "The directory containing headers of the TBB" FORCE)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
endif()
endmacro()
# TARGET_NAME - is target name from oneTBB cmake file
# it is either "TBB::tbb", or "TBB::tbbmalloc"
# LIB_NAME_UC - is library id (TBB or TBBMALLOC)
# PROPERTY_TO_SET - LIBRARY or DLL
macro (WIN_TBB_PARSE TARGET_NAME LIB_NAME PROPERTY_TO_SET)
set (FILE_NAME "")
set (FILE_PATH "")
set (FILE_DIR "")
if ("${PROPERTY_TO_SET}" STREQUAL "LIBRARY")
get_target_property (FILE_NAME "${TARGET_NAME}" IMPORTED_IMPLIB_RELEASE)
else()
get_target_property (FILE_NAME "${TARGET_NAME}" IMPORTED_LOCATION_RELEASE)
endif()
# acquire full path
TBB_FILE_NAME_TO_FILEPATH("${FILE_NAME}" FILE_PATH)
get_filename_component (FILE_NAME "${FILE_PATH}" NAME)
get_filename_component (FILE_DIR "${FILE_PATH}" DIRECTORY)
if (NOT EXISTS "${FILE_DIR}/${FILE_NAME}")
set (3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET} "" CACHE FILEPATH "${LIB_NAME} library" FORCE)
set (3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET}_DIR "" CACHE PATH "The directory containing ${LIB_NAME} shared library")
if ("${PROPERTY_TO_SET}" STREQUAL "LIBRARY")
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET}_DIR)
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 *.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}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# Achive *.dll files and directory containing it.
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Reserve cache variable for *.dll.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL)
set (3RDPARTY_${LIB_UPPER}_DLL "" CACHE FILEPATH "${LIB_UPPER} library (*.dll)")
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}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${LIB_UPPER}_DLL_DIR)
endif()
# install *.dll (tbb & tbbmalloc)
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${LIB_UPPER}_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")
endif()
endif()
mark_as_advanced (3RDPARTY_${LIB_UPPER}_LIBRARY 3RDPARTY_${LIB_UPPER}_DLL)
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the *.dll/*.so* directory for using by the executable
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET}_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).
set (3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET} "${FILE_DIR}/${FILE_NAME}" CACHE FILEPATH "${LIB_NAME} library" FORCE)
set (3RDPARTY_${LIB_NAME}_${PROPERTY_TO_SET}_DIR "${FILE_DIR}" CACHE PATH "The directory containing ${LIB_NAME} shared library")
# 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 ("${PROPERTY_TO_SET}" STREQUAL "LIBRARY")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${FILE_DIR}")
else()
list (APPEND 3RDPARTY_DLL_DIRS "${FILE_DIR}")
endif()
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}")
endmacro()
# TARGET_NAME - is target name from oneTBB cmake file
# it is either "TBB::tbb", or "TBB::tbbmalloc"
# LIB_NAME_UC - is library id (TBB or TBBMALLOC)
macro (LIN_TBB_PARSE TARGET_NAME LIB_NAME)
set (FILE_NAME "")
set (FILE_PATH "")
set (FILE_DIR "")
get_target_property (FILE_NAME "${TARGET_NAME}" IMPORTED_LOCATION_RELEASE)
# acquire full path
TBB_FILE_NAME_TO_FILEPATH("${FILE_NAME}" FILE_PATH)
get_filename_component (FILE_NAME "${FILE_PATH}" NAME)
get_filename_component (FILE_DIR "${FILE_PATH}" DIRECTORY)
if (NOT EXISTS "${FILE_DIR}/${FILE_NAME}")
set (3RDPARTY_${LIB_NAME}_LIBRARY "" CACHE FILEPATH "${LIB_NAME} library" FORCE)
set (3RDPARTY_${LIB_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${LIB_NAME} shared library")
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_NAME}_LIBRARY_DIR)
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_${LIB_NAME}_LIBRARY "${FILE_DIR}/${FILE_NAME}" CACHE FILEPATH "${LIB_NAME} library" FORCE)
set (3RDPARTY_${LIB_NAME}_LIBRARY_DIR "${FILE_DIR}" CACHE PATH "The directory containing ${LIB_NAME} shared library")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIB_NAME}_LIBRARY_DIR}")
endif()
endmacro()
if (WIN32)
# Here we should set:
# - 3RDPARTY_*_LIBRARY
# - 3RDPARTY_*_LIBRARY_DIR
# - 3RDPARTY_*_DLL
# - 3RDPARTY_*_DLL_DIR
# where * - is TBB or TBBMALLOC
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
WIN_TBB_PARSE("TBB::${LIB_LOWER}" "${LIB_UPPER}" "LIBRARY")
WIN_TBB_PARSE("TBB::${LIB_LOWER}" "${LIB_UPPER}" "DLL")
endforeach()
else()
# Here we should set:
# - 3RDPARTY_*_LIBRARY
# - 3RDPARTY_*_LIBRARY_DIR
# 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}")
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
LIN_TBB_PARSE("TBB::${LIB_LOWER}" "${LIB_UPPER}")
endforeach()
endif()
# install tbb/tbbmalloc
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
if (SINGLE_GENERATOR)
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
endforeach()
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS Release DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS RelWithDebInfo DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS Debug DESTINATION "${INSTALL_DIR_BIN}d")
endforeach()
endif()
# install *.so* (tbb & tbbmalloc)
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (SINGLE_GENERATOR)
else()
if (SINGLE_GENERATOR)
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} DESTINATION "${INSTALL_DIR_LIB}")
else()
endforeach()
else()
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS Release DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS RelWithDebInfo DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS Debug DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endforeach()
endif()
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
endif()
endif()
foreach (LIB IN LISTS CSF_TBB)
string(TOUPPER "${LIB}" LIB_UPPER)
mark_as_advanced (3RDPARTY_${LIB_UPPER}_LIBRARY 3RDPARTY_${LIB_UPPER}_DLL)
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
else()
# the *.so* directory for using by the executable
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
endif()
endif()

2
adm/scripts/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*custom.bat
*custom.sh

View File

@@ -1,50 +0,0 @@
rem Environment configuration template for cmake_gen.bat (to be renamed as cmake_gen_custom.bat)
set "OCCT3RDPARTY=%SrcRoot%\..\3rdparty"
set VS=14
set VSDATA=2015
rem Leave VSPLATFORM empty to build for x86 platform
set VSPLATFORM=Win64
rem ------------------------------------
rem Uncomment to customize building steps
rem ------------------------------------
rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
set "INSTALL_DIR=%SrcRoot%\..\3rdparty\occt77-vc14-64"
set BUILD_CPP_STANDARD=C++14
rem set BUILD_DOC_Overview=OFF
rem set BUILD_Inspector=OFF
rem set BUILD_LIBRARY_TYPE=Shared
rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
rem set BUILD_WITH_DEBUG=OFF
rem set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
rem set BUILD_USE_PCH=OFF
rem set BUILD_FORCE_RelWithDebInfo=OFF
rem Use semicolon-separated list of toolkits if you want to disable all modules
rem and build only some toolkits.
rem set BUILD_ADDITIONAL_TOOLKITS=
rem Set a directory recognized as a patch for OCCT.
rem set BUILD_PATCH=
rem set BUILD_MODULE_ApplicationFramework=ON
rem set BUILD_MODULE_DataExchange=ON
rem set BUILD_MODULE_Draw=ON
rem set BUILD_MODULE_ModelingAlgorithms=ON
rem set BUILD_MODULE_ModelingData=ON
rem set BUILD_MODULE_Visualization=ON
rem set USE_D3D=OFF
rem set USE_FFMPEG=OFF
set USE_FREEIMAGE=ON
rem set USE_GLES2=OFF
rem set USE_RAPIDJSON=OFF
rem set USE_DRACO=OFF
rem set USE_TBB=OFF
rem set USE_VTK=OFF

View File

@@ -1,45 +0,0 @@
# Environment configuration template for cmake_gen.sh (to be renamed as cmake_gen_custom.sh)
OCCT3RDPARTY="$SrcRoot/../3rdparty"
FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
# ------------------------------------
# Uncomment to customize building steps
# ------------------------------------
#BUILD_DIR=build
INSTALL_DIR="$SrcRoot/../3rdparty/occt77"
BUILD_CPP_STANDARD=C++14
#BUILD_DOC_Overview=OFF
#BUILD_Inspector=OFF
#BUILD_LIBRARY_TYPE=Shared
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
#BUILD_WITH_DEBUG=OFF
#BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
# Use semicolon-separated list of toolkits if you want to disable all modules
# and build only some toolkits.
#BUILD_ADDITIONAL_TOOLKITS=
# Set a directory recognized as a patch for OCCT.
#BUILD_PATCH=
#BUILD_MODULE_ApplicationFramework=ON
#BUILD_MODULE_DataExchange=ON
#BUILD_MODULE_Draw=ON
#BUILD_MODULE_ModelingAlgorithms=ON
#BUILD_MODULE_ModelingData=ON
#BUILD_MODULE_Visualization=ON
#USE_FFMPEG=OFF
USE_FREEIMAGE=ON
#USE_GLES2=OFF
#USE_RAPIDJSON=OFF
#USE_DRACO=OFF
#USE_TBB=OFF
#USE_VTK=OFF
# This is to add any additional arguments to cmake
#AUX_ARGS=

View File

@@ -15,8 +15,6 @@ set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
set "OCCT3RDPARTY="
set "INSTALL_DIR=%SrcRoot%\install"
set BUILD_CPP_STANDARD=C++11
set BUILD_ADDITIONAL_TOOLKITS=
set BUILD_DOC_Overview=OFF
set BUILD_Inspector=OFF
@@ -57,7 +55,6 @@ if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
pushd "%BUILD_DIR%"
cmake -G "%arch_compile%" ^
-D BUILD_CPP_STANDARD:STRING="%BUILD_CPP_STANDARD%" ^
-D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
-D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
-D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^

View File

@@ -14,13 +14,12 @@ DEB=
CMAKE_BUILD_TYPE=Release
if [ "$1" = "-d" ]; then
DEB=d
BUILD_DIR=${BUILD_DIR}-deb
CMAKE_BUILD_TYPE=Debug
fi
INSTALL_DIR_BIN=lin64/gcc/bin$DEB
INSTALL_DIR_LIB=lin64/gcc/lib$DEB
BUILD_CPP_STANDARD=C++11
BUILD_ADDITIONAL_TOOLKITS=
BUILD_DOC_Overview=OFF
BUILD_Inspector=OFF
@@ -55,7 +54,6 @@ if [ ! -d "$BUILD_DIR" ]; then mkdir -p "$BUILD_DIR"; fi
pushd "$BUILD_DIR"
cmake -G "Unix Makefiles" \
-D BUILD_CPP_STANDARD:STRING="$BUILD_CPP_STANDARD" \
-D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-D 3RDPARTY_DIR:PATH="$OCCT3RDPARTY" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \

View File

@@ -26,12 +26,6 @@ set "toDebug=0"
set "toBuildSample=0"
set "sourceMapBase="
set "aBuildType=Release"
if /I ["%1"] == ["-d"] (
set "toDebug=1"
set "aBuildType=Debug"
)
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
set "BUILD_ModelingAlgorithms=ON"
@@ -50,38 +44,9 @@ rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
set "aPlatformAndCompiler="
set "aWorkDir="
set "aDestDir="
set "aLogFile="
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl="
set "aDestDirSmpl="
set "aLogFileSmpl="
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
if ["%aPlatformAndCompiler%"] == [""] ( set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%" )
if ["%aWorkDir%"] == [""] ( set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make" )
if ["%aDestDir%"] == [""] ( set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%" )
if ["%aLogFile%"] == [""] ( set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log" )
if ["%aWorkDirSmpl%"] == [""] ( set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make" )
if ["%aDestDirSmpl%"] == [""] ( set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%" )
if ["%aLogFileSmpl%"] == [""] ( set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log" )
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
@@ -93,8 +58,23 @@ for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOP
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
@@ -135,6 +115,10 @@ if not ["%1"] == ["-nopause"] (
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
@@ -144,6 +128,10 @@ if ["%toCMake%"] == ["1"] (
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
if ["%toBuildSample%"] == ["1"] (
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (

View File

@@ -4,11 +4,6 @@
# wasm_custom.sh should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
# FreeType should be specified as mandatory dependency.
CMAKE_BUILD_TYPE=Release
if [ "$1" = "-d" ]; then
CMAKE_BUILD_TYPE=Debug
fi
export aScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export aSrcRoot="${aScriptDir}/../.."
export aBuildRoot=work
@@ -26,12 +21,6 @@ export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export aPlatformAndCompiler=wasm
export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
. "${aScriptDir}/wasm_custom.sh"
fi
@@ -44,14 +33,19 @@ export aGitBranch=`git symbolic-ref --short HEAD`
echo "Compilation OCCT branch : $aGitBranch"
export aPlatformAndCompiler=wasm
export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
if [ ! -d "${aWorkDir}" ]; then
mkdir -p "${aWorkDir}"
fi
export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
if [ ! -d "${aDestDir}" ]; then
mkdir -p "${aDestDir}"
fi
export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [ -f "${aLogFile}" ]; then
rm "${aLogFile}"
fi
@@ -66,14 +60,14 @@ if [ "${toCMake}" = "1" ]; then
echo "Configuring OCCT for WASM..."
echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DCMAKE_BUILD_TYPE:STRING="$CMAKE_BUILD_TYPE" \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DBUILD_LIBRARY_TYPE:STRING="Static" \
-DINSTALL_DIR:PATH="${aDestDir}" \
-DINSTALL_DIR_INCLUDE:STRING="inc" \
-DINSTALL_DIR_RESOURCE:STRING="src" \
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include/freetype2" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include/freetype2" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
@@ -84,14 +78,14 @@ echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DCMAKE_BUILD_TYPE:STRING="$CMAKE_BUILD_TYPE" \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DBUILD_LIBRARY_TYPE:STRING="Static" \
-DINSTALL_DIR:PATH="${aDestDir}" \
-DINSTALL_DIR_INCLUDE:STRING="inc" \
-DINSTALL_DIR_RESOURCE:STRING="src" \
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include/freetype2" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include/freetype2" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \

View File

@@ -1,30 +0,0 @@
rem Environment configuration template for wasm_build.bat (to be renamed as wasm_custom.bat)
set "aFreeType=%aCasSrc%\..\3rdparty\freetype-2.7.1-wasm"
set "EMSDK_ROOT=%aCasSrc%\..\emsdk"
rem set "aRapidJson=%aCasSrc%\..\3rdparty\rapidjson-1.1.0"
rem set "aDraco=%aCasSrc%\..\3rdparty\draco-1.4.1-wasm32"
rem set "aCmakeBin=%ProgramW6432%\CMake\bin"
set "aDestDir=%aCasSrc%\..\3rdparty\occt77-wasm"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=0"
rem set "toMake=1"
rem set "toInstall=1"
set "toPack=0"
set "toBuildSample=0"
rem Source map base (should point to server where C++ sources will be copied)
rem enables -g4 debug building option for WebGL sample and allows navigating C++ source code within JavaScript debugger.
rem set "sourceMapBase=http://localhost:9090/"
set "BUILD_ModelingData=OFF"
set "BUILD_ModelingAlgorithms=OFF"
rem set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=OFF"
set "BUILD_DataExchange=OFF"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_PTHREADS=OFF"

View File

@@ -1,20 +0,0 @@
# environment configuration template for occ_build_wasm.sh (to be renamed as wasm_custom_env.sh)
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.7.1-wasm"
export EMSDK_ROOT="$aSrcRoot/../emsdk"
export aDestDir="${aSrcRoot}/../3rdparty/occt77-wasm"
# Uncomment to customize building steps
#export aBuildRoot=work
#export toCMake=1
#export toClean=0
#export toMake=1
#export toInstall=1
export BUILD_ModelingData=OFF
export BUILD_ModelingAlgorithms=OFF
#export BUILD_Visualization=ON
export BUILD_ApplicationFramework=OFF
export BUILD_DataExchange=OFF
export aNbJobs=10

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

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

View File

@@ -3002,7 +3002,7 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
}
}
if ((NbTrous > 0) ? (aNbFaces < NbLaw) : (aNbFaces == 0))
if (aNbFaces == 0)
{
isDone = Standard_False;
return;

View File

@@ -35,13 +35,11 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_CurveTessellator, IMeshTools_CurveTessellato
//=======================================================================
BRepMesh_CurveTessellator::BRepMesh_CurveTessellator(
const IMeshData::IEdgeHandle& theEdge,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb)
const IMeshTools_Parameters& theParameters)
: myDEdge(theEdge),
myParameters(theParameters),
myEdge(theEdge->GetEdge()),
myCurve(myEdge),
myMinPointsNb (theMinPointsNb)
myCurve(myEdge)
{
init();
}
@@ -54,13 +52,11 @@ BRepMesh_CurveTessellator::BRepMesh_CurveTessellator (
const IMeshData::IEdgeHandle& theEdge,
const TopAbs_Orientation theOrientation,
const IMeshData::IFaceHandle& theFace,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb)
const IMeshTools_Parameters& theParameters)
: myDEdge(theEdge),
myParameters(theParameters),
myEdge(TopoDS::Edge(theEdge->GetEdge().Oriented(theOrientation))),
myCurve(myEdge, theFace->GetFace()),
myMinPointsNb (theMinPointsNb)
myCurve(myEdge, theFace->GetFace())
{
init();
}
@@ -101,8 +97,7 @@ void BRepMesh_CurveTessellator::init()
myEdgeSqTol = BRep_Tool::Tolerance (myEdge);
myEdgeSqTol *= myEdgeSqTol;
const Standard_Integer aMinPntNb = Max(myMinPointsNb,
(myCurve.GetType() == GeomAbs_Circle) ? 4 : 2); //OCC287
const Standard_Integer aMinPntNb = (myCurve.GetType() == GeomAbs_Circle) ? 4 : 2; //OCC287
myDiscretTool.Initialize (myCurve,
myCurve.FirstParameter(), myCurve.LastParameter(),

View File

@@ -34,16 +34,14 @@ public:
//! Constructor.
Standard_EXPORT BRepMesh_CurveTessellator(
const IMeshData::IEdgeHandle& theEdge,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb = 2);
const IMeshTools_Parameters& theParameters);
//! Constructor.
Standard_EXPORT BRepMesh_CurveTessellator (
const IMeshData::IEdgeHandle& theEdge,
const TopAbs_Orientation theOrientation,
const IMeshData::IFaceHandle& theFace,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb = 2);
const IMeshTools_Parameters& theParameters);
//! Destructor.
Standard_EXPORT virtual ~BRepMesh_CurveTessellator ();
@@ -98,7 +96,6 @@ private:
const IMeshTools_Parameters& myParameters;
TopoDS_Edge myEdge;
BRepAdaptor_Curve myCurve;
Standard_Integer myMinPointsNb;
GCPnts_TangentialDeflection myDiscretTool;
TopoDS_Vertex myFirstVertex;
TopoDS_Vertex myLastVertex;

View File

@@ -49,10 +49,9 @@ BRepMesh_EdgeDiscret::~BRepMesh_EdgeDiscret ()
//=======================================================================
Handle(IMeshTools_CurveTessellator) BRepMesh_EdgeDiscret::CreateEdgeTessellator(
const IMeshData::IEdgeHandle& theDEdge,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb)
const IMeshTools_Parameters& theParameters)
{
return new BRepMesh_CurveTessellator(theDEdge, theParameters, theMinPointsNb);
return new BRepMesh_CurveTessellator(theDEdge, theParameters);
}
//=======================================================================
@@ -63,12 +62,11 @@ Handle(IMeshTools_CurveTessellator) BRepMesh_EdgeDiscret::CreateEdgeTessellator(
const IMeshData::IEdgeHandle& theDEdge,
const TopAbs_Orientation theOrientation,
const IMeshData::IFaceHandle& theDFace,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb)
const IMeshTools_Parameters& theParameters)
{
return theDEdge->GetSameParam() ?
new BRepMesh_CurveTessellator(theDEdge, theParameters, theMinPointsNb) :
new BRepMesh_CurveTessellator(theDEdge, theOrientation, theDFace, theParameters, theMinPointsNb);
new BRepMesh_CurveTessellator(theDEdge, theParameters) :
new BRepMesh_CurveTessellator(theDEdge, theOrientation, theDFace, theParameters);
}
//=======================================================================

View File

@@ -38,16 +38,14 @@ public:
//! Creates instance of free edge tessellator.
Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellator(
const IMeshData::IEdgeHandle& theDEdge,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb = 2);
const IMeshTools_Parameters& theParameters);
//! Creates instance of edge tessellator.
Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellator(
const IMeshData::IEdgeHandle& theDEdge,
const TopAbs_Orientation theOrientation,
const IMeshData::IFaceHandle& theDFace,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb = 2);
const IMeshTools_Parameters& theParameters);
//! Creates instance of tessellation extractor.
Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellationExtractor(

View File

@@ -73,37 +73,27 @@ Handle(IMeshTools_MeshAlgo) BRepMesh_MeshAlgoFactory::GetAlgo(
switch (theSurfaceType)
{
case GeomAbs_Plane:
return theParameters.EnableControlSurfaceDeflectionAllSurfaces ?
new DeflectionControlMeshAlgo<BRepMesh_DefaultRangeSplitter>::Type :
(theParameters.InternalVerticesMode ?
new NodeInsertionMeshAlgo<BRepMesh_DefaultRangeSplitter>::Type :
new BaseMeshAlgo::Type);
return theParameters.InternalVerticesMode ?
new NodeInsertionMeshAlgo<BRepMesh_DefaultRangeSplitter>::Type :
new BaseMeshAlgo::Type;
break;
case GeomAbs_Sphere:
return theParameters.EnableControlSurfaceDeflectionAllSurfaces ?
new DeflectionControlMeshAlgo<BRepMesh_SphereRangeSplitter>::Type :
new NodeInsertionMeshAlgo<BRepMesh_SphereRangeSplitter>::Type;
return new NodeInsertionMeshAlgo<BRepMesh_SphereRangeSplitter>::Type;
break;
case GeomAbs_Cylinder:
return theParameters.EnableControlSurfaceDeflectionAllSurfaces ?
new DeflectionControlMeshAlgo<BRepMesh_CylinderRangeSplitter>::Type :
(theParameters.InternalVerticesMode ?
new NodeInsertionMeshAlgo<BRepMesh_CylinderRangeSplitter>::Type :
new BaseMeshAlgo::Type);
return theParameters.InternalVerticesMode ?
new NodeInsertionMeshAlgo<BRepMesh_CylinderRangeSplitter>::Type :
new BaseMeshAlgo::Type;
break;
case GeomAbs_Cone:
return theParameters.EnableControlSurfaceDeflectionAllSurfaces ?
new DeflectionControlMeshAlgo<BRepMesh_ConeRangeSplitter>::Type :
new NodeInsertionMeshAlgo<BRepMesh_ConeRangeSplitter>::Type;
return new NodeInsertionMeshAlgo<BRepMesh_ConeRangeSplitter>::Type;
break;
case GeomAbs_Torus:
return theParameters.EnableControlSurfaceDeflectionAllSurfaces ?
new DeflectionControlMeshAlgo<BRepMesh_TorusRangeSplitter>::Type :
new NodeInsertionMeshAlgo<BRepMesh_TorusRangeSplitter>::Type;
return new NodeInsertionMeshAlgo<BRepMesh_TorusRangeSplitter>::Type;
break;
case GeomAbs_SurfaceOfRevolution:

View File

@@ -50,32 +50,14 @@ namespace
void operator()(const IMeshData::IEdgePtr& theDEdge) const
{
const IMeshData::IEdgeHandle aDEdge = theDEdge;
Standard_Integer aPointsNb = aDEdge->GetCurve()->ParametersNb();
aDEdge->Clear(Standard_True);
aDEdge->SetDeflection(Max(aDEdge->GetDeflection() / 3., Precision::Confusion()));
for (Standard_Integer aPCurveIt = 0; aPCurveIt < aDEdge->PCurvesNb(); ++aPCurveIt)
{
const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve(aPCurveIt);
const IMeshData::IFaceHandle aDFace = aPCurve->GetFace();
// Check that outer wire contains 2 edges or less and add an additional point.
const IMeshData::IWireHandle& aDWire = aDFace->GetWire(0);
if (aDWire->EdgesNb() <= 2)
{
++aPointsNb;
break;
}
}
const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve(0);
const IMeshData::IFaceHandle aDFace = aPCurve->GetFace();
Handle(IMeshTools_CurveTessellator) aTessellator =
BRepMesh_EdgeDiscret::CreateEdgeTessellator(
aDEdge, aPCurve->GetOrientation(), aDFace,
myParameters, aPointsNb);
aDEdge, aPCurve->GetOrientation(), aDFace, myParameters);
BRepMesh_EdgeDiscret::Tessellate3d(aDEdge, aTessellator, Standard_False);
BRepMesh_EdgeDiscret::Tessellate2d(aDEdge, Standard_False);

View File

@@ -556,7 +556,7 @@ Handle(IMeshData::SequenceOfReal) BRepMesh_NURBSRangeSplitter::computeGrainAndFi
const Handle(BRepAdaptor_Surface)& aSurface = GetSurface();
const Standard_Real aMinSize2d = Max(
aSurface->UResolution(theParameters.MinSize),
aSurface->VResolution(theParameters.MinSize));
aSurface->UResolution(theParameters.MinSize));
aMinDiff = Max(aMinSize2d, aMinDiff);

View File

@@ -64,18 +64,19 @@ public:
//! given transformation to this box.
BVH_Box<T, 3> Transformed (const NCollection_Mat4<T>& theTransform) const
{
const BVH_Box<T, 3> *aThis = static_cast<const BVH_Box<T, 3>*>(this);
BVH_Box<T, 3> aResultBox;
if (theTransform.IsIdentity())
{
return *aThis;
return aResultBox;
}
const BVH_Box<T, 3> *aThis = static_cast<const BVH_Box<T, 3>*>(this);
if (!aThis->IsValid())
{
return *aThis;
return aResultBox;
}
BVH_Box<T, 3> aResultBox;
for (size_t aX = 0; aX <= 1; ++aX)
{
for (size_t aY = 0; aY <= 1; ++aY)

View File

@@ -88,11 +88,8 @@ bool DE_ConfigurationNode::Save(const TCollection_AsciiString& theResourcePath)
// function : UpdateLoad
// purpose :
//=======================================================================
bool DE_ConfigurationNode::UpdateLoad(const Standard_Boolean theToImport,
const Standard_Boolean theToKeep)
bool DE_ConfigurationNode::UpdateLoad()
{
(void)theToImport;
(void)theToKeep;
return true;
}

View File

@@ -85,12 +85,9 @@ public:
//! @return new object with the same field values
Standard_EXPORT virtual Handle(DE_ConfigurationNode) Copy() const = 0;
//! Update loading status. Checking for the ability to read and write.
//! @param[in] theToImport flag to updates for import. Standard_True-import, Standard_False-export
//! @param[in] theToKeep flag to save update result
//! Update loading status. Checking for the license.
//! @return Standard_True, if node can be used
Standard_EXPORT virtual bool UpdateLoad(const Standard_Boolean theToImport,
const Standard_Boolean theToKeep);
Standard_EXPORT virtual bool UpdateLoad();
public:

View File

@@ -34,9 +34,6 @@ namespace
static const TCollection_AsciiString aScope ("global");
return aScope;
}
//! Global configuration of current DE Session
static Handle(DE_Wrapper) THE_GLOBAL_CONFIGURATION;
}
//=======================================================================
@@ -44,7 +41,6 @@ namespace
// purpose :
//=======================================================================
DE_Wrapper::DE_Wrapper()
:myKeepUpdates(Standard_False)
{}
//=======================================================================
@@ -68,7 +64,6 @@ DE_Wrapper::DE_Wrapper(const Handle(DE_Wrapper)& theWrapper)
Bind(aVendorIter.Value());
}
}
theWrapper->myKeepUpdates = myKeepUpdates;
}
//=======================================================================
@@ -77,23 +72,8 @@ DE_Wrapper::DE_Wrapper(const Handle(DE_Wrapper)& theWrapper)
//=======================================================================
Handle(DE_Wrapper) DE_Wrapper::GlobalWrapper()
{
if (THE_GLOBAL_CONFIGURATION.IsNull())
{
THE_GLOBAL_CONFIGURATION = new DE_Wrapper();
}
return THE_GLOBAL_CONFIGURATION;
}
//=======================================================================
// function : SetGlobalWrapper
// purpose :
//=======================================================================
void DE_Wrapper::SetGlobalWrapper(const Handle(DE_Wrapper)& theWrapper)
{
if (!theWrapper.IsNull())
{
THE_GLOBAL_CONFIGURATION = theWrapper;
}
static const Handle(DE_Wrapper)& aConfiguration = new DE_Wrapper();
return aConfiguration;
}
//=======================================================================
@@ -101,7 +81,7 @@ void DE_Wrapper::SetGlobalWrapper(const Handle(DE_Wrapper)& theWrapper)
// purpose :
//=======================================================================
Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
const Handle(TDocStd_Document)& theDocument,
Handle(TDocStd_Document)& theDocument,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress)
{
@@ -114,7 +94,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
return Read(thePath, theDocument, theProgress);
}
Handle(DE_Provider) aProvider;
if (!FindProvider(thePath, Standard_True, aProvider))
if (!findProvider(thePath, Standard_True, aProvider))
{
return Standard_False;
}
@@ -139,7 +119,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
return Write(thePath, theDocument, theProgress);
}
Handle(DE_Provider) aProvider;
if (!FindProvider(thePath, Standard_False, aProvider))
if (!findProvider(thePath, Standard_False, aProvider))
{
return Standard_False;
}
@@ -151,7 +131,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
// purpose :
//=======================================================================
Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
const Handle(TDocStd_Document)& theDocument,
Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress)
{
if (theDocument.IsNull())
@@ -159,7 +139,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
return Standard_False;
}
Handle(DE_Provider) aProvider;
if (!FindProvider(thePath, Standard_True, aProvider))
if (!findProvider(thePath, Standard_True, aProvider))
{
return Standard_False;
}
@@ -179,7 +159,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
return Standard_False;
}
Handle(DE_Provider) aProvider;
if (!FindProvider(thePath, Standard_False, aProvider))
if (!findProvider(thePath, Standard_False, aProvider))
{
return Standard_False;
}
@@ -200,7 +180,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
return Read(thePath, theShape, theProgress);
}
Handle(DE_Provider) aProvider;
if (!FindProvider(thePath, Standard_True, aProvider))
if (!findProvider(thePath, Standard_True, aProvider))
{
return Standard_False;
}
@@ -221,7 +201,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
return Write(thePath, theShape, theProgress);
}
Handle(DE_Provider) aProvider;
if (!FindProvider(thePath, Standard_False, aProvider))
if (!findProvider(thePath, Standard_False, aProvider))
{
return Standard_False;
}
@@ -238,7 +218,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
{
Handle(DE_Provider) aProvider;
if (!FindProvider(thePath, Standard_True, aProvider))
if (!findProvider(thePath, Standard_True, aProvider))
{
return Standard_False;
}
@@ -254,7 +234,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
const Message_ProgressRange& theProgress)
{
Handle(DE_Provider) aProvider;
if (!FindProvider(thePath, Standard_False, aProvider))
if (!findProvider(thePath, Standard_False, aProvider))
{
return Standard_False;
}
@@ -447,6 +427,7 @@ void DE_Wrapper::ChangePriority(const TCollection_AsciiString& theFormat,
if (aVendorMap.FindFromKey(aVendorName, aNode))
{
aNode->SetEnabled(Standard_True);
aNode->UpdateLoad();
aNewVendorMap.Add(aVendorName, aNode);
}
}
@@ -501,10 +482,10 @@ Handle(DE_Wrapper) DE_Wrapper::Copy() const
}
//=======================================================================
// function : FindProvider
// function : findProvider
// purpose :
//=======================================================================
Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath,
Standard_Boolean DE_Wrapper::findProvider(const TCollection_AsciiString& thePath,
const Standard_Boolean theToImport,
Handle(DE_Provider)& theProvider) const
{
@@ -533,8 +514,7 @@ Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath
((theToImport && aNode->IsImportSupported()) ||
(!theToImport && aNode->IsExportSupported())) &&
(aNode->CheckExtension(anExtr) ||
(theToImport && aNode->CheckContent(aBuffer))) &&
aNode->UpdateLoad(theToImport, myKeepUpdates))
(theToImport && aNode->CheckContent(aBuffer))))
{
theProvider = aNode->BuildProvider();
aNode->GlobalParameters = GlobalParameters;
@@ -546,28 +526,6 @@ Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath
return Standard_False;
}
//=======================================================================
// function : ReLoadNodes
// purpose :
//=======================================================================
Standard_EXPORT void DE_Wrapper::UpdateLoad(const Standard_Boolean theToForceUpdate) const
{
for (DE_ConfigurationFormatMap::Iterator aFormatIter(myConfiguration);
aFormatIter.More(); aFormatIter.Next())
{
for (DE_ConfigurationVendorMap::Iterator aVendorIter(aFormatIter.Value());
aVendorIter.More(); aVendorIter.Next())
{
const Handle(DE_ConfigurationNode)& aNode = aVendorIter.Value();
aNode->UpdateLoad(Standard_True, Standard_True);
aNode->UpdateLoad(Standard_False, Standard_True);
if (!theToForceUpdate)
continue;
aNode->SetEnabled(aNode->IsExportSupported() || aNode->IsImportSupported());
}
}
}
//=======================================================================
// function : sort
// purpose :

View File

@@ -61,15 +61,10 @@ public:
//! @param[in] theWrapper object to copy
Standard_EXPORT DE_Wrapper(const Handle(DE_Wrapper)& theWrapper);
//! Gets global configuration singleton.
//! If wrapper is not set, create it by default as base class object.
//! Gets global configuration singleton
//! @return point to global configuration
Standard_EXPORT static Handle(DE_Wrapper) GlobalWrapper();
//! Sets global configuration singleton
//! @param[in] theWrapper object to set as global configuration
Standard_EXPORT static void SetGlobalWrapper(const Handle(DE_Wrapper)& theWrapper);
public:
//! Reads a CAD file, according internal configuration
@@ -79,7 +74,7 @@ public:
//! @param theProgress[in] progress indicator
//! @return true if Read operation has ended correctly
Standard_EXPORT Standard_Boolean Read(const TCollection_AsciiString& thePath,
const Handle(TDocStd_Document)& theDocument,
Handle(TDocStd_Document)& theDocument,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress = Message_ProgressRange());
@@ -100,7 +95,7 @@ public:
//! @param theProgress[in] progress indicator
//! @return true if Read operation has ended correctly
Standard_EXPORT Standard_Boolean Read(const TCollection_AsciiString& thePath,
const Handle(TDocStd_Document)& theDocument,
Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Writes a CAD file, according internal configuration
@@ -216,33 +211,13 @@ public:
Standard_EXPORT void ChangePriority(const TColStd_ListOfAsciiString& theVendorPriority,
const Standard_Boolean theToDisable = Standard_False);
//! Find available provider from the configuration.
//! If there are several providers, choose the one with the highest priority.
//! @param[in] thePath path to the CAD file
//! @param[in] theToImport flag to finds for import. Standard_True-import, Standard_False-export
//! @param[out] theProvider created new provider
//! @return Standard_True if provider found and created
Standard_EXPORT virtual Standard_Boolean FindProvider(const TCollection_AsciiString& thePath,
const Standard_Boolean theToImport,
Handle(DE_Provider)& theProvider) const;
//! Updates all registered nodes, save all result.
//! @param[in] theToForceUpdate flag to turn on/of nodes according opportunity to transfer
Standard_EXPORT void UpdateLoad(const Standard_Boolean theToForceUpdate = Standard_False) const;
//! Gets flag to save updates operation while transfer checks
Standard_Boolean KeepUpdates() const { return myKeepUpdates; }
//! Sets flag to save updates operation while transfer checks
void SetKeepUpdates(const Standard_Boolean theToKeepUpdates) { myKeepUpdates = theToKeepUpdates; }
//! Gets format map, contains vendor map with nodes
//! @return internal map of formats
Standard_EXPORT const DE_ConfigurationFormatMap& Nodes() const;
//! Copies values of all fields
//! @return new object with the same field values
Standard_EXPORT virtual Handle(DE_Wrapper) Copy() const;
Standard_EXPORT Handle(DE_Wrapper) Copy() const;
protected:
@@ -252,13 +227,22 @@ protected:
//! @param[in] theResource resource to get priority
void sort(const Handle(DE_ConfigurationContext)& theResource);
//! Find available provider from the configuration.
//! If there are several providers, choose the one with the highest priority.
//! @param[in] thePath path to the CAD file
//! @param[in] theToImport flag to finds for import. Standard_True-import, Standard_False-export
//! @param[out] theProvider created new provider
//! @return Standard_True if provider found and created
Standard_Boolean findProvider(const TCollection_AsciiString& thePath,
const Standard_Boolean theToImport,
Handle(DE_Provider)& theProvider) const;
public:
DE_ConfigurationNode::DE_SectionGlobal GlobalParameters; //!< Internal parameters for the all translators
private:
Standard_Boolean myKeepUpdates; //!< Flag to save updates operation while transfer checks
DE_ConfigurationFormatMap myConfiguration; //!< Internal map of formats
};

View File

@@ -34,7 +34,9 @@ namespace
//=======================================================================
DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : DEBRepCascade_ConfigurationNode
@@ -44,6 +46,7 @@ DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode(const Handle(DE
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -34,7 +34,9 @@ namespace
//=======================================================================
DEXCAFCascade_ConfigurationNode::DEXCAFCascade_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : DEXCAFCascade_ConfigurationNode
@@ -44,6 +46,7 @@ DEXCAFCascade_ConfigurationNode::DEXCAFCascade_ConfigurationNode(const Handle(DE
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -502,7 +502,16 @@ GeomAbs_SurfaceType GeomAdaptor_SurfaceOfRevolution::GetType() const
MajorRadius = aLin.Distance(aLC);
if(MajorRadius > aR)
{
return GeomAbs_Torus;
Standard_Real aT = 0., aDx, dX;
gp_Pnt aPx;
aPx = ElCLib::Value(aT, C);
aDx = aLin.Distance(aPx);
dX = aDx - MajorRadius - aR;
if (dX < 0.)
dX = -dX;
if (dX < TolConf)
return GeomAbs_Torus;
}
}
break;

View File

@@ -429,8 +429,6 @@ static Standard_Boolean ConicDefinition
term2 = -gdet/(cprim*pdet);
if (IsEllip) {
if (term1 <= eps || term2 <= eps)
return Standard_False;
Xax = cost;
Yax = sint;
Rmin = sqrt ( term1);
@@ -441,16 +439,12 @@ static Standard_Boolean ConicDefinition
}
}
else if (term1 <= eps){
if (-term1 <= eps || term2 <= eps)
return Standard_False;
Xax = -sint;
Yax = cost;
Rmin = sqrt (-term1);
Rmax = sqrt (term2);
}
else {
if (term1 <= eps || -term2 <= eps)
return Standard_False;
Xax = cost;
Yax = sint;
Rmin = sqrt (-term2);

View File

@@ -839,38 +839,14 @@ static IFSelect_ReturnStatus fun27
Standard_Integer argc = pilot->NbWords();
Handle(IFSelect_WorkSession) WS = pilot->Session();
const Standard_CString arg1 = pilot->Arg(1);
Standard_CString arg2 = pilot->Arg(2);
const Standard_CString anEmptyStr = "";
if (arg2 && strlen(arg2) == 2 && arg2[0] == '"' && arg2[1] == '"')
{
arg2 = anEmptyStr;
}
const Standard_CString arg2 = pilot->Arg(2);
// **** Param(Value) ****
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 2 || (argc == 3 && strcmp (arg1, "-p") == 0)) {
if (argc < 2) {
Handle(TColStd_HSequenceOfHAsciiString) li = Interface_Static::Items();
Standard_Integer i,nb = li->Length(), aPatternNb = 0;
size_t aPatternLen = strlen(arg2);
if (argc == 3)
{
for (i = 1; i <= nb; i ++)
{
if (strncmp(li->Value(i)->String().ToCString(), arg2, aPatternLen) == 0)
{
aPatternNb++;
}
}
}
else
{
aPatternNb = nb;
}
sout << " List of parameters : " << aPatternNb << " items : " << std::endl;
Standard_Integer i,nb = li->Length();
sout<<" List of parameters : "<<nb<<" items : "<<std::endl;
for (i = 1; i <= nb; i ++) {
if (argc == 3 && strncmp(li->Value(i)->String().ToCString(), arg2, aPatternLen) != 0)
{
continue;
}
sout<<li->Value(i)->String();
sout<<" : "<<Interface_Static::CVal(li->Value(i)->ToCString())<<std::endl;
}
@@ -888,14 +864,7 @@ static IFSelect_ReturnStatus fun27
if (argc == 2) sout<<"To modify, param name_param new_val"<<std::endl;
else {
if (strlen(arg2) != 0)
{
sout<<" New demanded value : "<<arg2;
}
else
{
sout<<" New demanded value : not valued";
}
sout<<" New demanded value : "<<arg2;
if (Interface_Static::SetCVal (arg1,arg2))
{ sout<<" OK"<<std::endl; return IFSelect_RetDone; }
else { sout <<" , refused"<<std::endl; return IFSelect_RetError; }
@@ -2468,9 +2437,7 @@ void IFSelect_Functions::Init()
IFSelect_Act::AddFunc("itemlabel","xxx xxx : liste items having this label",fun24);
IFSelect_Act::AddFunc("xsave","filename:string : sauve items-session",fun25);
IFSelect_Act::AddFunc("xrestore","filename:string : restaure items-session",fun26);
IFSelect_Act::AddFunc("param","[-p Pattern] - displays all parameters or filtered by pattern;\n"
"par_name - displays parameter;\n"
"par_name par_value - changes parameter's value", fun27);
IFSelect_Act::AddFunc("param","nompar:string : displays parameter value; + nompar val : changes it",fun27);
IFSelect_Act::AddFunc("sentfiles","Lists files sent from last Load",fun29);
IFSelect_Act::AddFunc("fileprefix","prefix:string : definit File Prefix",fun30);

View File

@@ -34,7 +34,9 @@ namespace
//=======================================================================
IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : IGESCAFControl_ConfigurationNode
@@ -44,6 +46,7 @@ IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode(const Handle(
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -90,64 +90,10 @@ static Handle(IGESData_DefaultSpecific) speci;
Interface_Static::SetIVal ("write.convertsurface.mode",0);
// abv 15.11.00: ShapeProcessing
Interface_Static::Init ("XSTEP", "write.iges.resource.name", 't', "IGES");
Interface_Static::Init ("XSTEP", "read.iges.resource.name", 't', "IGES");
Interface_Static::Init ("XSTEP", "write.iges.sequence", 't', "ToIGES");
Interface_Static::Init ("XSTEP", "read.iges.sequence", 't', "FromIGES");
Interface_Static::Init ("XSTEP", "ToIGES.exec.op", 't', "DirectFaces");
Interface_Static::Init ("XSTEP", "FromIGES.exec.op", 't', "FixShape");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.Tolerance3d", 't', "&Runtime.Tolerance");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.MaxTolerance3d", 't', "&Runtime.MaxTolerance");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.MinTolerance3d", 't', "1.e-7");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFreeShellMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFreeFaceMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFreeWireMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSameParameterMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSolidMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixShellOrientationMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.CreateOpenSolidMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixShellMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFaceOrientationMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixFaceMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixWireMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixOrientationMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixAddNaturalBoundMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixMissingSeamMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSmallAreaWireMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.RemoveSmallAreaFaceMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixIntersectingWiresMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixLoopWiresMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSplitFaceMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.AutoCorrectPrecisionMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.ModifyTopologyMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.ModifyGeometryMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.ClosedWireMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.PreferencePCurveMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixReorderMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSmallMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixConnectedMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixEdgeCurvesMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixDegeneratedMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixLackingMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSelfIntersectionMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.RemoveLoopMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixReversed2dMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixRemovePCurveMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixRemoveCurve3dMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixAddPCurveMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixAddCurve3dMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSeamMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixShiftedMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixEdgeSameParameterMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixNotchedEdgesMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixTailMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.MaxTailAngle", 't', "0.0");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.MaxTailWidth", 't', "-1.0");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixSelfIntersectingEdgeMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixIntersectingEdgesMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixNonAdjacentIntersectingEdgesMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixVertexPositionMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromIGES.FixShape.FixVertexToleranceMode", 't', "-1");
Interface_Static::Init ("XSTEP","write.iges.resource.name",'t',"IGES");
Interface_Static::Init ("XSTEP","read.iges.resource.name",'t',"IGES");
Interface_Static::Init ("XSTEP","write.iges.sequence",'t',"ToIGES");
Interface_Static::Init ("XSTEP","read.iges.sequence",'t',"FromIGES");
// sln 11.06.2002 OCC448 : Initialize "read.onlyvisible" parameter to control transferring
// invisible sub entities which logically depend on the grouping entities

View File

@@ -28,7 +28,7 @@ enum IMeshData_Status
IMeshData_TooFewPoints = 0x20, //!< Discrete model contains too few boundary points to generate mesh.
IMeshData_Outdated = 0x40, //!< Existing triangulation of some faces corresponds to greater deflection than specified by parameter.
IMeshData_Reused = 0x80, //!< Existing triangulation of some faces is reused as far as it fits specified deflection.
IMeshData_UserBreak = 0x100 //!< User break
IMeshData_UserBreak = 0x160 //!< User break
};
#endif

View File

@@ -35,7 +35,6 @@ struct IMeshTools_Parameters {
Relative (Standard_False),
InternalVerticesMode (Standard_True),
ControlSurfaceDeflection (Standard_True),
EnableControlSurfaceDeflectionAllSurfaces(Standard_False),
CleanModel (Standard_True),
AdjustMinSize (Standard_False),
ForceFaceDeflection (Standard_False),
@@ -86,10 +85,6 @@ struct IMeshTools_Parameters {
//! the face
Standard_Boolean ControlSurfaceDeflection;
// Enables/disables check triggered by ControlSurfaceDeflection flag
// for all types of surfaces including analytical.
Standard_Boolean EnableControlSurfaceDeflectionAllSurfaces;
//! Cleans temporary data model when algorithm is finished.
Standard_Boolean CleanModel;

View File

@@ -714,8 +714,7 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
}
IntPatch_Point aVtx = theALine->Vertex(aVertexNumber);
Standard_Real aNewVertexParam = aLinOn2S->NbPoints() + 1;
Standard_Integer aNbPointsPrev = aLinOn2S->NbPoints();
const Standard_Real aNewVertexParam = aLinOn2S->NbPoints() + 1;
//ATTENTION!!!
// IsPoleOrSeam inserts new point in aLinOn2S if aVtx respects
@@ -749,7 +748,6 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
aPrePointExist = IsPoleOrSeam(myS1, myS2, aPrefIso, aLinOn2S, aVtx,
anArrPeriods, aTol, aSingularSurfaceID);
if (aPrePointExist == IntPatch_SPntPole ||
aPrePointExist == IntPatch_SPntPoleSeamU)
{
@@ -763,11 +761,6 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
const Standard_Real aCurVertParam = aVtx.ParameterOnLine();
if(aPrePointExist != IntPatch_SPntNone)
{
if (aNbPointsPrev == aLinOn2S->NbPoints())
{
//Vertex coinsides any point of line and was not added into line
aNewVertexParam = aNbPointsPrev;
}
aPrevParam = aParameter = aCurVertParam;
}
else

View File

@@ -354,7 +354,6 @@ void BoundedArc (const TheArc& A,
{
const IntSurf_Quadric& aQuadric = Func.Quadric();
GeomAbs_SurfaceType TypeQuad = aQuadric.TypeQuadric();
GeomAbs_CurveType TypeConS = GeomAbs_OtherCurve;
IntCurveSurface_HInter IntCS;
Standard_Boolean IsIntCSdone = Standard_False;
@@ -388,7 +387,7 @@ void BoundedArc (const TheArc& A,
//Exact solution
Handle(Adaptor3d_Surface) aSurf = Func.Surface();
Adaptor3d_CurveOnSurface ConS(A, aSurf);
TypeConS = ConS.GetType();
GeomAbs_CurveType TypeConS = ConS.GetType();
#ifdef OCCT_DEBUG
Handle(Geom_Curve) CurveConS;
switch(TypeConS)
@@ -609,27 +608,13 @@ void BoundedArc (const TheArc& A,
para = aSI(i).Value();
Standard_Real param=(para+parap1)*0.5;
Standard_Real yf = 0.0;
Standard_Real ym = 0.0;
Standard_Real yl = 0.0;
if(Func.Value(param,ym) && Abs(ym) < maxdist) {
Standard_Real sm = Sign(1., ym);
Standard_Boolean aTang = Func.Value(para,yf) && Func.Value(parap1,yl);
if (aTang) {
//Line can be tangent surface if all distances less then maxdist
aTang = aTang && Abs(yf) < maxdist && Abs(yl) < maxdist;
}
if (aTang && IsIntCSdone && TypeConS == GeomAbs_Line) {
//Interval is got by exact intersection
//Line can be tangent if all points are on the same side of surface
//it means that signs of all distances are the same
Standard_Real sf = Sign(1., yf), sl = Sign(1., yl);
aTang = aTang && (sm == sf) && (sm == sl);
}
if(aTang) {
Standard_Real ym;
if(Func.Value(param,ym)) {
if(Abs(ym)<maxdist) {
// Modified by skv - Tue Aug 31 12:13:51 2004 OCC569 Begin
// Consider this interval as tangent one. Treat it to find
// parameter with the lowest function value.
// Compute the number of nodes.
Standard_Real aTol = TolBoundary*1000.0;
if(aTol > 0.001)
@@ -642,7 +627,6 @@ void BoundedArc (const TheArc& A,
Standard_Integer aNbNodes = RealToInt(Ceiling((parap1 - para)/aTol));
Standard_Real aVal = RealLast();
Standard_Real aValMax = 0.;
//Standard_Integer aNbNodes = 23;
Standard_Real aDelta = (parap1 - para)/(aNbNodes + 1.);
Standard_Integer ii;
@@ -653,29 +637,17 @@ void BoundedArc (const TheArc& A,
aCurPar = (ii < aNbNodes + 1) ? para + ii*aDelta : parap1;
if (Func.Value(aCurPar, aCurVal)) {
Standard_Real anAbsVal = Abs(aCurVal);
if (anAbsVal < aVal) {
aVal = anAbsVal;
//if (aCurVal < aVal) {
if (Abs(aCurVal) < aVal) {
//aVal = aCurVal;
aVal = Abs(aCurVal);
param = aCurPar;
}
if (anAbsVal > aValMax)
{
aValMax = anAbsVal;
}
}
}
// At last, interval got by exact intersection can be considered as tangent if
// minimal distance is inside interval and
// minimal and maximal values are almost the same
if (IsIntCSdone && aNbNodes > 1) {
aTang = Abs(param - para) > EpsX && Abs(parap1 - param) > EpsX &&
0.01*aValMax <= aVal;
}
if (aTang)
{
aSI(i).ChangeValue() = Pdeb - 1;
aSI(i + 1).ChangeValue() = param;
}
// Modified by skv - Tue Aug 31 12:13:51 2004 OCC569 End
aSI(i).ChangeValue() = Pdeb - 1;
aSI(i + 1).ChangeValue() = param;
}
}
}

View File

@@ -1694,20 +1694,6 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep,
Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsoparametric theChoixIso,
const Standard_Boolean theDirectionFlag)
{
// Caro1 and Caro2
const Handle(Adaptor3d_Surface)& Caro1 = myIntersectionOn2S.Function().AuxillarSurface1();
const Handle(Adaptor3d_Surface)& Caro2 = myIntersectionOn2S.Function().AuxillarSurface2();
//
const Standard_Real UFirst1 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro1);
const Standard_Real VFirst1 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro1);
const Standard_Real ULast1 = Adaptor3d_HSurfaceTool::LastUParameter(Caro1);
const Standard_Real VLast1 = Adaptor3d_HSurfaceTool::LastVParameter(Caro1);
const Standard_Real UFirst2 = Adaptor3d_HSurfaceTool::FirstUParameter(Caro2);
const Standard_Real VFirst2 = Adaptor3d_HSurfaceTool::FirstVParameter(Caro2);
const Standard_Real ULast2 = Adaptor3d_HSurfaceTool::LastUParameter(Caro2);
const Standard_Real VLast2 = Adaptor3d_HSurfaceTool::LastVParameter(Caro2);
Standard_Boolean bOutOfTangentZone = Standard_False;
Standard_Boolean bStop = !myIntersectionOn2S.IsTangent();
Standard_Integer dIncKey = 1;
@@ -1719,42 +1705,6 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop
Standard_Integer uvit = 0;
IntSurf_SequenceOfPntOn2S aSeqOfNewPoint;
previousPoint.Parameters(Param(1), Param(2), Param(3), Param(4));
if (Param(1) - UFirst1 < ResoU1)
{
return bOutOfTangentZone;
}
else if (Param(2) - VFirst1 < ResoV1)
{
return bOutOfTangentZone;
}
else if (Param(3) - UFirst2 < ResoU2)
{
return bOutOfTangentZone;
}
else if (Param(4) - VFirst2 < ResoV2)
{
return bOutOfTangentZone;
}
if (Param(1) - ULast1 > -ResoU1)
{
return bOutOfTangentZone;
}
else if (Param(2) - VLast1 > -ResoV1)
{
return bOutOfTangentZone;
}
else if (Param(3) - ULast2 > -ResoU2)
{
return bOutOfTangentZone;
}
else if (Param(4) - VLast2 > -ResoV2)
{
return bOutOfTangentZone;
}
while (!bStop) {
nbIterWithoutAppend++;

View File

@@ -407,29 +407,3 @@ Handle(TColStd_HSequenceOfHAsciiString) Interface_Static::Items
}
return list;
}
//=======================================================================
// function : FillMap
// purpose : Fills given string-to-string map with all static data
//=======================================================================
void Interface_Static::FillMap (NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString, TCollection_AsciiString>& theMap)
{
theMap.Clear();
NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>& aMap = MoniTool_TypedValue::Stats();
for (NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>::Iterator anIt(aMap); anIt.More(); anIt.Next())
{
Handle(Interface_Static) aValue = Handle(Interface_Static)::DownCast(anIt.Value());
if (aValue.IsNull())
{
continue;
}
if (aValue->HStringValue().IsNull())
{
continue;
}
theMap.Bind (anIt.Key(), aValue->HStringValue()->String());
}
}

View File

@@ -245,8 +245,8 @@ public:
//! must be defined around it
Standard_EXPORT static void Standards();
//! Fills given string-to-string map with all static data
Standard_EXPORT static void FillMap(NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString, TCollection_AsciiString>& theMap);
DEFINE_STANDARD_RTTIEXT(Interface_Static,Interface_TypedValue)

View File

@@ -116,10 +116,6 @@ static Standard_Integer incrementalmesh (Draw_Interpretor& theDI,
{
aMeshParams.ControlSurfaceDeflection = !Draw::ParseOnOffIterator (theNbArgs, theArgVec, anArgIter);
}
else if (aNameCase == "-surf_def_all")
{
aMeshParams.EnableControlSurfaceDeflectionAllSurfaces = Draw::ParseOnOffIterator(theNbArgs, theArgVec, anArgIter);
}
else if (aNameCase == "-adjust_min")
{
aMeshParams.AdjustMinSize = Draw::ParseOnOffNoIterator (theNbArgs, theArgVec, anArgIter);
@@ -1624,8 +1620,6 @@ void MeshTest::Commands(Draw_Interpretor& theCommands)
"\n\t\t: -ai angular deflection inside of faces in deg (~57.29 deg = 1 rad by default);"
"\n\t\t: -int_vert_off disables insertion of internal vertices into mesh (enabled by default);"
"\n\t\t: -surf_def_off disables control of deflection of mesh from real surface (enabled by default);"
"\n\t\t: -surf_def_all enables control of deflection of mesh from real surface for all types of surfaces"
"\n\t\t: (FALSE by default);"
"\n\t\t: -adjust_min enables local adjustment of min size depending on edge size (FALSE by default);"
"\n\t\t: -force_face_def disables usage of shape tolerances for computing face deflection (FALSE by default);"
"\n\t\t: -decrease enforces the meshing of the shape even if current mesh satisfies the new criteria"

View File

@@ -179,10 +179,10 @@ public:
Standard_Integer NbColumns() const { return myUpperCol - myLowerCol + 1; }
//! Returns length of the row, i.e. number of columns
Standard_Integer RowLength() const { return NbRows(); }
Standard_Integer RowLength() const { return NbColumns(); }
//! Returns length of the column, i.e. number of rows
Standard_Integer ColLength() const { return NbColumns(); }
Standard_Integer ColLength() const { return NbRows(); }
//! LowerRow
Standard_Integer LowerRow (void) const

View File

@@ -58,34 +58,40 @@ public:
{
public:
//! Empty constructor
Iterator (void) : myCurrent (NULL), myPrevious(NULL) {}
Iterator (void) : myCurrent (NULL), myPrevious(NULL), myIsReversed(Standard_False) {}
//! Constructor with initialisation
//! Constructor with initialization
Iterator (const NCollection_BaseSequence& theSeq,
const Standard_Boolean isStart)
{
Init (theSeq, isStart);
}
//! Initialisation
//! Initialization
void Init (const NCollection_BaseSequence& theSeq,
const Standard_Boolean isStart = Standard_True)
{
myCurrent = (isStart ? theSeq.myFirstItem : NULL);
myPrevious = (isStart ? NULL : theSeq.myLastItem);
myCurrent = (isStart ? theSeq.myFirstItem : theSeq.myLastItem);
myPrevious = NULL;
myIsReversed = !isStart;
}
//! Switch to previous element; note that it will reset
void Previous()
{
myCurrent = myPrevious;
if (myCurrent)
myPrevious = myCurrent->Previous();
if (myCurrent) {
if (!myIsReversed)
myPrevious = myCurrent->Previous();
else
myPrevious = myCurrent->Next();
}
}
protected:
NCollection_SeqNode* myCurrent; //!< Pointer to the current node
NCollection_SeqNode* myPrevious; //!< Pointer to the previous node
Standard_Boolean myIsReversed; //!< Flag to create reversed iterator
friend class NCollection_BaseSequence;
};

View File

@@ -33,12 +33,7 @@ class Standard_Mutex;
* type "aligned_t". To modify the size of memory blocks requested from the
* OS, use the parameter of the constructor (measured in bytes); if this
* parameter is smaller than 25 bytes on 32bit or 49 bytes on 64bit, the
* block size will be the default 12 kbytes.
*
* It is not recommended to use memory blocks larger than 16KB on Windows
* platform for the repeated operations because Low Fragmentation Heap is
* not going to be used for these allocations which may lead to memory
* fragmentation and the general performance slow down.
* block size will be the default 24 kbytes
*
* Note that this allocator is most suitable for single-threaded algorithms
* (consider creating dedicated allocators per working thread),
@@ -55,12 +50,6 @@ class NCollection_IncAllocator : public NCollection_BaseAllocator
//! Constructor.
//! Note that this constructor does NOT setup mutex for using allocator concurrently from different threads,
//! see SetThreadSafe() method.
//!
//! The default size of the memory blocks is 12KB.
//! It is not recommended to use memory blocks larger than 16KB on Windows
//! platform for the repeated operations (and thus multiple allocations)
//! because Low Fragmentation Heap is not going to be used for these allocations,
//! leading to memory fragmentation and eventual performance slow down.
Standard_EXPORT NCollection_IncAllocator (size_t theBlockSize = DefaultBlockSize);
//! Setup mutex for thread-safe allocations.
@@ -94,8 +83,7 @@ class NCollection_IncAllocator : public NCollection_BaseAllocator
Standard_EXPORT void Reset (const Standard_Boolean
doReleaseMem=Standard_True);
//! Default size for the memory blocks - 12KB
static const size_t DefaultBlockSize = 12300;
static const size_t DefaultBlockSize = 24600;
protected:
struct IBlock;

View File

@@ -71,7 +71,10 @@ public:
if (myCurrent)
{
myPrevious = myCurrent;
myCurrent = myCurrent->Next();
if (myIsReversed)
myCurrent = myCurrent->Previous();
else
myCurrent = myCurrent->Next();
}
}
//! Constant value access
@@ -93,19 +96,38 @@ public:
//! Shorthand for a constant iterator type.
typedef NCollection_StlIterator<std::bidirectional_iterator_tag, Iterator, TheItemType, true> const_iterator;
//! Shorthand for a reverse iterator type.
typedef NCollection_StlIterator<std::reverse_iterator<iterator>, Iterator, TheItemType, false> reverse_iterator;
//! Shorthand for a constant reverse iterator type.
typedef NCollection_StlIterator<std::reverse_iterator<const_iterator>, Iterator, TheItemType, true> const_reverse_iterator;
//! Returns an iterator pointing to the first element in the sequence.
iterator begin() const { return Iterator (*this, true); }
//! Returns an iterator referring to the past-the-end element in the sequence.
iterator end() const { Iterator anIter (*this, false); anIter.Next(); return anIter; }
iterator end() const { Iterator anIter (*this, false); anIter.Previous(); return anIter; }
//! Returns a const iterator pointing to the first element in the sequence.
const_iterator cbegin() const { return Iterator (*this, true); }
//! Returns a const iterator referring to the past-the-end element in the sequence.
const_iterator cend() const { Iterator anIter (*this, false); anIter.Next(); return anIter; }
const_iterator cend() const { Iterator anIter(*this, false); anIter.Previous(); return anIter; }
public:
//! Returns a reverse iterator pointing to the last element in the sequence.
reverse_iterator rbegin() const { return Iterator(*this, false); }
//! Returns a reverse iterator referring to the past-the-end element in the reversed sequence.
reverse_iterator rend() const { Iterator anIter(*this, true); anIter.Previous(); return anIter; }
//! Returns a const reverse iterator pointing to the last element in the sequence.
const_reverse_iterator crbegin() const { return Iterator(*this, false); }
//! Returns a const reverse iterator referring to the past-the-end element in the reversed sequence.
const_reverse_iterator crend() const { Iterator anIter(*this, true); anIter.Previous(); return anIter; }
public:
// ---------- PUBLIC METHODS ------------
//! Empty constructor.

View File

@@ -134,7 +134,9 @@ public: //! @name methods related to bidirectional STL iterator
NCollection_StlIterator& operator--()
{
Standard_STATIC_ASSERT((opencascade::std::is_same<std::bidirectional_iterator_tag,Category>::value ||
opencascade::std::is_same<std::random_access_iterator_tag,Category>::value));
opencascade::std::is_same<std::random_access_iterator_tag,Category>::value ||
opencascade::std::is_same<std::reverse_iterator<NCollection_StlIterator<std::bidirectional_iterator_tag, BaseIterator, ItemType, false>>, Category>::value ||
opencascade::std::is_same<std::reverse_iterator<NCollection_StlIterator<std::bidirectional_iterator_tag, BaseIterator, ItemType, true>>, Category>::value));
myIterator.Previous();
return *this;
}

View File

@@ -4359,7 +4359,74 @@ static Standard_Integer QACheckBends(Draw_Interpretor& theDI,
return 0;
}
#include <NCollection_Sequence.hxx>
static Standard_Integer OCC27571(Draw_Interpretor& di, Standard_Integer /*nb*/, const char ** /*a*/)
{
// Create NCollection_Sequence<TCollection_AsciiString>
NCollection_Sequence<TCollection_AsciiString> aSequence;
aSequence.Append("1");
aSequence.Append("2");
aSequence.Append("3");
aSequence.Append("4");
aSequence.Append("5");
// Create iterator
NCollection_Sequence<TCollection_AsciiString>::Iterator anIterator(aSequence);
// Create reverse iterator
NCollection_Sequence<TCollection_AsciiString>::Iterator aReverseIterator(aSequence, Standard_False);
// Display elements using iterator (with More/Next)
di << "Iterator (More/Next):";
for (; anIterator.More(); anIterator.Next())
di << " " << anIterator.Value();
anIterator.Previous();
di << "\nCurrent (last) element - Iterator: " << anIterator.Value();
anIterator.Previous();
di << "\nPrevious element - Iterator: " << anIterator.Value();
// Display elements using reverse iterator (with More/Next)
di << "\nReverse iterator (More/Next):";
for (; aReverseIterator.More(); aReverseIterator.Next())
di << " " << aReverseIterator.Value();
aReverseIterator.Previous();
di << "\nCurrent (last) element - Reverse iterator: " << aReverseIterator.Value();
aReverseIterator.Previous();
di << "\nPrevious element - Reverse iterator: " << aReverseIterator.Value();
// Display elements using iterator (with begin/end)
di << "\nIterator (begin/end):";
NCollection_Sequence<TCollection_AsciiString>::iterator anIteratorBeginEnd = aSequence.begin();
for (; anIteratorBeginEnd != aSequence.end(); ++anIteratorBeginEnd)
di << " " << *anIteratorBeginEnd;
--anIteratorBeginEnd;
di << "\nCurrent (last) element - Iterator (begin/end): " << *anIteratorBeginEnd;
// Display elements using const_iterator (with cbegin/cend)
di << "\nIterator (cbegin/cend) Const:";
NCollection_Sequence<TCollection_AsciiString>::const_iterator anIteratorBeginEndConst = aSequence.cbegin();
for (; anIteratorBeginEndConst != aSequence.cend(); ++anIteratorBeginEndConst)
di << " " << *anIteratorBeginEndConst;
--anIteratorBeginEndConst;
di << "\nCurrent (last) element - Iterator (cbegin/cend) Const: " << *anIteratorBeginEndConst;
// Display elements using reverse_iterator (with rbegin/rend)
di << "\nReverse iterator (rbegin/rend):";
NCollection_Sequence<TCollection_AsciiString>::reverse_iterator aReverseIteratorBeginEnd = aSequence.rbegin();
for (; aReverseIteratorBeginEnd != aSequence.rend(); ++aReverseIteratorBeginEnd)
di << " " << *aReverseIteratorBeginEnd;
--aReverseIteratorBeginEnd;
di << "\nCurrent (last) element - Reverse iterator (rbegin/rend): " << *aReverseIteratorBeginEnd;
// Display elements using const_reverse_iterator (with crbegin/crend)
di << "\nReverse iterator (crbegin/crend) Const:";
NCollection_Sequence<TCollection_AsciiString>::const_reverse_iterator aReverseIteratorBeginEndConst = aSequence.crbegin();
for (; aReverseIteratorBeginEndConst != aSequence.crend(); ++aReverseIteratorBeginEndConst)
di << " " << *aReverseIteratorBeginEndConst;
--aReverseIteratorBeginEndConst;
di << "\nCurrent (last) element - Reverse iterator (crbegin/crend) Const: " << *aReverseIteratorBeginEndConst;
return 0;
}
void QABugs::Commands_20(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
@@ -4467,5 +4534,7 @@ void QABugs::Commands_20(Draw_Interpretor& theCommands) {
__FILE__,
QACheckBends, group);
theCommands.Add("OCC27571", "OCC27571", __FILE__, OCC27571, group);
return;
}

View File

@@ -33,7 +33,9 @@ namespace
//=======================================================================
RWGltf_ConfigurationNode::RWGltf_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : RWGltf_ConfigurationNode
@@ -43,6 +45,7 @@ RWGltf_ConfigurationNode::RWGltf_ConfigurationNode(const Handle(RWGltf_Configura
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -33,7 +33,9 @@ namespace
//=======================================================================
RWObj_ConfigurationNode::RWObj_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : RWObj_ConfigurationNode
@@ -43,6 +45,7 @@ RWObj_ConfigurationNode::RWObj_ConfigurationNode(const Handle(RWObj_Configuratio
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -27,7 +27,9 @@ static const TCollection_AsciiString THE_CONFIGURATION_SCOPE = "provider";
//=======================================================================
RWPly_ConfigurationNode::RWPly_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : RWPly_ConfigurationNode
@@ -37,6 +39,7 @@ RWPly_ConfigurationNode::RWPly_ConfigurationNode(const Handle(RWPly_Configuratio
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -34,7 +34,9 @@ namespace
//=======================================================================
RWStl_ConfigurationNode::RWStl_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : STEPCAFControl_ConfigurationNode
@@ -44,6 +46,7 @@ RWStl_ConfigurationNode::RWStl_ConfigurationNode(const Handle(RWStl_Configuratio
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -128,16 +128,6 @@ Resource_Manager::Resource_Manager(const Standard_CString aName,
std::cout << "Resource Manager Warning: Environment variable \"CSF_" << aName << "UserDefaults\" not set." << std::endl;
}
// =======================================================================
// function : Resource_Manager
// purpose :
// =======================================================================
Resource_Manager::Resource_Manager()
: myName(""), myVerbose(Standard_False)
{
}
// =======================================================================
// function : Load
// purpose :
@@ -548,12 +538,3 @@ void Resource_Manager::GetResourcePath (TCollection_AsciiString& aPath, const St
anOSDPath.SystemName(aPath);
}
//=======================================================================
// function : GetMap
// purpose :
//=======================================================================
Resource_DataMapOfAsciiStringAsciiString& Resource_Manager::GetMap(Standard_Boolean theRefMap)
{
return theRefMap ? myRefMap : myUserMap;
}

View File

@@ -54,9 +54,6 @@ public:
//! syntax of an individual resource line is:
Standard_EXPORT Resource_Manager(const Standard_CString aName, const Standard_Boolean Verbose = Standard_False);
//! Create an empty Resource manager
Standard_EXPORT Resource_Manager();
//! Create a Resource manager.
//! @param theName [in] description file name
//! @param theDefaultsDirectory [in] default folder for looking description file
@@ -115,9 +112,6 @@ public:
//! or file doesn't exist returns empty string.
Standard_EXPORT static void GetResourcePath (TCollection_AsciiString& aPath, const Standard_CString aName, const Standard_Boolean isUserDefaults);
//! Returns internal Ref or User map with parameters
Standard_EXPORT Resource_DataMapOfAsciiStringAsciiString& GetMap(Standard_Boolean theRefMap = Standard_True);
private:
Standard_EXPORT void Load (const TCollection_AsciiString& thePath,

View File

@@ -34,7 +34,9 @@ namespace
//=======================================================================
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : STEPCAFControl_ConfigurationNode
@@ -43,7 +45,9 @@ STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode(const Handle(STEPCAFControl_ConfigurationNode)& theNode)
:DE_ConfigurationNode(theNode),
InternalParameters(theNode->InternalParameters)
{}
{
UpdateLoad();
}
//=======================================================================
// function : Load

View File

@@ -336,22 +336,14 @@ TCollection_ExtendedString STEPCAFControl_Reader::convertName (const TCollection
//=======================================================================
//function : ReadFile
//purpose :
//purpose :
//=======================================================================
IFSelect_ReturnStatus STEPCAFControl_Reader::ReadFile (const Standard_CString theFileName)
IFSelect_ReturnStatus STEPCAFControl_Reader::ReadFile(const Standard_CString filename)
{
return myReader.ReadFile (theFileName);
return myReader.ReadFile(filename);
}
//=======================================================================
//function : ReadStream
//purpose :
//=======================================================================
IFSelect_ReturnStatus STEPCAFControl_Reader::ReadStream (const Standard_CString theName,
std::istream& theIStream)
{
return myReader.ReadStream (theName, theIStream);
}
//=======================================================================
//function : NbRootsForTransfer

View File

@@ -73,20 +73,11 @@ public:
//! Clears the internal data structures and attaches to a new session
//! Clears the session if it was not yet set for STEP
Standard_EXPORT void Init (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
//! Loads a file and returns the read status
//! Provided for use like single-file reader.
//! @param theFileName [in] file to open
//! @return read status
Standard_EXPORT IFSelect_ReturnStatus ReadFile (const Standard_CString theFileName);
//! Loads a file from stream and returns the read status.
//! @param theName [in] auxiliary stream name
//! @param theIStream [in] stream to read from
//! @return read status
Standard_EXPORT IFSelect_ReturnStatus ReadStream (const Standard_CString theName,
std::istream& theIStream);
//! Provided for use like single-file reader
Standard_EXPORT IFSelect_ReturnStatus ReadFile (const Standard_CString filename);
//! Returns number of roots recognized for transfer
//! Shortcut for Reader().NbRootsForTransfer()
Standard_EXPORT Standard_Integer NbRootsForTransfer();

View File

@@ -302,51 +302,34 @@ void STEPCAFControl_Writer::Init (const Handle(XSControl_WorkSession)& WS,
//function : Write
//purpose :
//=======================================================================
IFSelect_ReturnStatus STEPCAFControl_Writer::Write (const Standard_CString theFileName)
IFSelect_ReturnStatus STEPCAFControl_Writer::Write (const Standard_CString filename)
{
IFSelect_ReturnStatus aStatus = myWriter.Write (theFileName);
if (aStatus != IFSelect_RetDone)
{
return aStatus;
}
IFSelect_ReturnStatus status = myWriter.Write ( filename );
// get directory name of the main file
TCollection_AsciiString aDirPath;
{
OSD_Path aMainFile (theFileName);
aMainFile.SetName ("");
aMainFile.SetExtension ("");
aMainFile.SystemName (aDirPath);
}
OSD_Path mainfile ( filename );
mainfile.SetName ( "" );
mainfile.SetExtension ( "" );
TCollection_AsciiString dpath;
mainfile.SystemName ( dpath );
for (NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>::Iterator anExtFileIter (myFiles);
anExtFileIter.More(); anExtFileIter.Next())
{
Handle(STEPCAFControl_ExternFile) anExtFile = anExtFileIter.Value();
if (anExtFile->GetWriteStatus() != IFSelect_RetVoid)
{
continue;
}
NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>::Iterator it(myFiles);
for ( ; it.More(); it.Next() ) {
Handle(STEPCAFControl_ExternFile) EF = it.Value();
if ( EF->GetWriteStatus() != IFSelect_RetVoid ) continue;
// construct extern file name
TCollection_AsciiString aFileName = OSD_Path::AbsolutePath (aDirPath, anExtFile->GetName()->String());
if (aFileName.Length() <= 0)
{
aFileName = anExtFile->GetName()->String();
}
TCollection_AsciiString fname = OSD_Path::AbsolutePath ( dpath, EF->GetName()->String() );
if ( fname.Length() <= 0 ) fname = EF->GetName()->String();
#ifdef OCCT_DEBUG
std::cout << "Writing external file: " << aFileName << std::endl;
std::cout << "Writing external file: " << fname.ToCString() << std::endl;
#endif
const IFSelect_ReturnStatus anExtStatus = anExtFile->GetWS()->SendAll (aFileName.ToCString());
anExtFile->SetWriteStatus (anExtStatus);
if (anExtStatus != IFSelect_RetDone)
{
aStatus = anExtStatus;
}
EF->SetWriteStatus ( EF->GetWS()->SendAll ( fname.ToCString() ) );
}
return aStatus;
return status;
}
//=======================================================================
@@ -369,21 +352,6 @@ void STEPCAFControl_Writer::prepareUnit(const TDF_Label& theLabel,
}
}
//=======================================================================
//function : WriteStream
//purpose :
//=======================================================================
IFSelect_ReturnStatus STEPCAFControl_Writer::WriteStream (std::ostream& theStream)
{
if (!myFiles.IsEmpty())
{
// writing external files is unsupported via stream interface
return IFSelect_RetError;
}
return myWriter.WriteStream (theStream);
}
//=======================================================================
//function : Transfer
//purpose :

View File

@@ -70,11 +70,7 @@ public:
//! filename will be a name of root file, all other files
//! have names of corresponding parts
//! Provided for use like single-file writer
Standard_EXPORT IFSelect_ReturnStatus Write (const Standard_CString theFileName);
//! Writes all the produced models into the stream.
//! Provided for use like single-file writer
Standard_EXPORT IFSelect_ReturnStatus WriteStream (std::ostream& theStream);
Standard_EXPORT IFSelect_ReturnStatus Write (const Standard_CString filename);
//! Transfers a document (or single label) to a STEP model
//! The mode of translation of shape is AsIs

View File

@@ -1595,10 +1595,8 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape
// SINON, la shape est prise et transferee telle quelle
TopoDS_Shape sh0 = shape;
gp_Trsf aLoc;
Standard_Boolean isShapeLocated = Standard_False;
if ( GroupMode() >0) {
TopLoc_Location shloc = shape.Location();
isShapeLocated = !shloc.IsIdentity();
aLoc = shloc.Transformation();
TopLoc_Location shident;
sh0.Location (shident);
@@ -1678,7 +1676,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape
myContext.NextIndex();
// abv 16.10.00: bind CDSR (et al) to located shape in order to be able to track instances
if (mapper != start && isShapeLocated) {
if (mapper != start && aLoc.Form() != gp_Identity) {
Handle(Transfer_Binder) bnd = FP->Find ( start );
for ( Standard_Integer j=1; j <= roots->Length(); j++ )
if ( bnd.IsNull() ) bnd = TransientResult ( roots->Value(j) );

View File

@@ -179,66 +179,12 @@ STEPControl_Controller::STEPControl_Controller ()
Interface_Static::Init ("step","write.step.vertex.mode",'&',"eval One Compound");
Interface_Static::Init ("step","write.step.vertex.mode",'&',"eval Single Vertex");
Interface_Static::SetIVal("write.step.vertex.mode",0);
// abv 15.11.00: ShapeProcessing
Interface_Static::Init ("XSTEP", "write.step.resource.name", 't', "STEP");
Interface_Static::Init ("XSTEP", "read.step.resource.name", 't', "STEP");
Interface_Static::Init ("XSTEP", "write.step.sequence", 't', "ToSTEP");
Interface_Static::Init ("XSTEP", "read.step.sequence", 't', "FromSTEP");
Interface_Static::Init ("XSTEP", "ToSTEP.exec.op", 't', "SplitCommonVertex,DirectFaces");
Interface_Static::Init ("XSTEP", "FromSTEP.exec.op", 't', "FixShape");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.Tolerance3d", 't', "&Runtime.Tolerance");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.MaxTolerance3d", 't', "&Runtime.MaxTolerance");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.MinTolerance3d", 't', "1.e-7");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFreeShellMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFreeFaceMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFreeWireMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSameParameterMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSolidMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixShellOrientationMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.CreateOpenSolidMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixShellMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFaceOrientationMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixFaceMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixWireMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixOrientationMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixAddNaturalBoundMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixMissingSeamMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSmallAreaWireMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.RemoveSmallAreaFaceMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixIntersectingWiresMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixLoopWiresMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSplitFaceMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.AutoCorrectPrecisionMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.ModifyTopologyMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.ModifyGeometryMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.ClosedWireMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.PreferencePCurveMode", 't', "1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixReorderMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSmallMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixConnectedMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixEdgeCurvesMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixDegeneratedMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixLackingMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSelfIntersectionMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.RemoveLoopMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixReversed2dMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixRemovePCurveMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixRemoveCurve3dMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixAddPCurveMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixAddCurve3dMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSeamMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixShiftedMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixEdgeSameParameterMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixNotchedEdgesMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixTailMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.MaxTailAngle", 't', "0.0");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.MaxTailWidth", 't', "-1.0");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixSelfIntersectingEdgeMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixIntersectingEdgesMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixNonAdjacentIntersectingEdgesMode", 't', "-1");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixVertexPositionMode", 't', "0");
Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixVertexToleranceMode", 't', "-1");
Interface_Static::Init ("XSTEP","write.step.resource.name",'t',"STEP");
Interface_Static::Init ("XSTEP","read.step.resource.name",'t',"STEP");
Interface_Static::Init ("XSTEP","write.step.sequence",'t',"ToSTEP");
Interface_Static::Init ("XSTEP","read.step.sequence",'t',"FromSTEP");
// ika 28.07.16: Parameter to read all top level solids and shells,
// should be used only in case of invalid shape_representation without links to shapes.

View File

@@ -18,9 +18,6 @@
#include <STEPControl_ActorWrite.hxx>
#include <STEPControl_Controller.hxx>
#include <StepData_StepModel.hxx>
#include <StepData_Protocol.hxx>
#include <StepData_StepWriter.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Shape.hxx>
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
@@ -150,37 +147,14 @@ IFSelect_ReturnStatus STEPControl_Writer::Transfer
//=======================================================================
//function : Write
//purpose :
//purpose :
//=======================================================================
IFSelect_ReturnStatus STEPControl_Writer::Write (const Standard_CString theFileName)
IFSelect_ReturnStatus STEPControl_Writer::Write (const Standard_CString filename)
{
return thesession->SendAll (theFileName);
return thesession->SendAll(filename);
}
//=======================================================================
//function : WriteStream
//purpose :
//=======================================================================
IFSelect_ReturnStatus STEPControl_Writer::WriteStream (std::ostream& theOStream)
{
Handle(StepData_StepModel) aModel = Model();
if (aModel.IsNull())
{
return IFSelect_RetFail;
}
Handle(StepData_Protocol) aProtocol = Handle(StepData_Protocol)::DownCast (aModel->Protocol());
if (aProtocol.IsNull())
{
return IFSelect_RetFail;
}
StepData_StepWriter aWriter (aModel);
aWriter.SendModel (aProtocol);
return aWriter.Print (theOStream)
? IFSelect_RetDone
: IFSelect_RetFail;
}
//=======================================================================
//function : PrintStatsTransfer

View File

@@ -88,13 +88,10 @@ public:
const STEPControl_StepModelType mode,
const Standard_Boolean compgraph = Standard_True,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Writes a STEP model in the file identified by filename.
Standard_EXPORT IFSelect_ReturnStatus Write (const Standard_CString theFileName);
//! Writes a STEP model in the std::ostream.
Standard_EXPORT IFSelect_ReturnStatus WriteStream (std::ostream& theOStream);
Standard_EXPORT IFSelect_ReturnStatus Write (const Standard_CString filename);
//! Displays the statistics for the
//! last translation. what defines the kind of statistics that are displayed:
//! - 0 gives general statistics (number of translated roots,

View File

@@ -229,31 +229,36 @@ Standard_Boolean ShapeAnalysis::IsOuterBound(const TopoDS_Face& face)
}
//=======================================================================
//function : OuterWire
//purpose : Returns positively oriented wire in the face.
// If there is no one - returns the last wire of the face.
//function : OuterBound
//purpose : replacement of bad BRepTools::OuterBound(), to be merged
// - skips internal vertices in face, if any, without exception
// - returns positively oriented wire rather than greater one
//=======================================================================
TopoDS_Wire ShapeAnalysis::OuterWire(const TopoDS_Face& theFace)
TopoDS_Wire ShapeAnalysis::OuterWire(const TopoDS_Face& face)
{
TopoDS_Face aF = theFace;
aF.Orientation (TopAbs_FORWARD);
TopoDS_Face F = face;
F.Orientation(TopAbs_FORWARD);
TopExp_Explorer anIt (aF, TopAbs_WIRE);
BRep_Builder B;
TopoDS_Iterator anIt (F, Standard_False);
while (anIt.More())
{
TopoDS_Wire aWire = TopoDS::Wire (anIt.Value());
TopoDS_Shape aWire = anIt.Value();
anIt.Next();
// if current wire is the last one, return it without analysis
if (!anIt.More())
return aWire;
// skip possible internal vertices in face
if (aWire.ShapeType() != TopAbs_WIRE)
continue;
// Check if the wire has positive area
Handle(ShapeExtend_WireData) aSEWD = new ShapeExtend_WireData (aWire);
Standard_Real anArea2d = ShapeAnalysis::TotCross2D (aSEWD, aF);
if (anArea2d >= 0.)
return aWire;
// if current wire is the last one, return it without analysis
if (! anIt.More())
return TopoDS::Wire (aWire);
TopoDS_Shape aTestFace = F.EmptyCopied();
B.Add (aTestFace, aWire);
if (ShapeAnalysis::IsOuterBound (TopoDS::Face (aTestFace)))
return TopoDS::Wire (aWire);
}
return TopoDS_Wire();
}

View File

@@ -51,9 +51,12 @@ public:
DEFINE_STANDARD_ALLOC
//! Returns positively oriented wire in the face.
//! If there is no such wire - returns the last wire of the face.
Standard_EXPORT static TopoDS_Wire OuterWire (const TopoDS_Face& theFace);
//! Returns the outer wire on the face <Face>.
//! This is replacement of the method BRepTools::OuterWire
//! until it works badly.
//! Returns the first wire oriented as outer according to
//! FClass2d_Classifier. If none, last wire is returned.
Standard_EXPORT static TopoDS_Wire OuterWire (const TopoDS_Face& face);
//! Returns a total area of 2d wire
Standard_EXPORT static Standard_Real TotCross2D (const Handle(ShapeExtend_WireData)& sewd, const TopoDS_Face& aFace);

View File

@@ -647,10 +647,11 @@ Standard_Boolean ShapeFix_Face::Perform()
// fix natural bounds
Standard_Boolean NeedSplit = Standard_True;
if (FixAddNaturalBound())
{
NeedSplit = Standard_False;
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
if ( NeedFix ( myFixAddNaturalBoundMode ) ) {
if ( FixAddNaturalBound() ) {
NeedSplit = Standard_False;
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE5 );
}
}
// split face
@@ -839,11 +840,9 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound()
return Standard_True;
}
// check if surface doesn't need natural bounds
if (!isNeedAddNaturalBound(ws))
{
// check if surface is double-closed and fix is needed
if ( !IsSurfaceUVPeriodic (mySurf->Adaptor3d()) || ShapeAnalysis::IsOuterBound (myFace) )
return Standard_False;
}
// Collect information on free intervals in U and V
TColgp_SequenceOfPnt2d intU, intV, centers;
@@ -1003,50 +1002,6 @@ Standard_Boolean ShapeFix_Face::FixOrientation()
return FixOrientation(MapWires);
}
//=======================================================================
// function : isNeedAddNaturalBound
// purpose :
//=======================================================================
Standard_Boolean ShapeFix_Face::isNeedAddNaturalBound(const TopTools_SequenceOfShape& theOrientedWires)
{
// if fix is not needed
if (!NeedFix (myFixAddNaturalBoundMode))
{
return Standard_False;
}
// if surface is not double-closed
if (!IsSurfaceUVPeriodic (mySurf->Adaptor3d()))
{
return Standard_False;
}
// if face has an OUTER bound
if (ShapeAnalysis::IsOuterBound (myFace))
{
return Standard_False;
}
// check that not any wire has a seam edge and not any edge is degenerated.
// because the presence of a seam or degenerated edge indicates that this wire should be an external one,
// and in case of its incorrect orientation, this will be corrected.
Standard_Integer aNbOriented = theOrientedWires.Length();
for (Standard_Integer i = 1; i <= aNbOriented; i++)
{
TopoDS_Wire aWire = TopoDS::Wire(theOrientedWires.Value(i));
for (TopoDS_Iterator anEdgeIt(aWire); anEdgeIt.More(); anEdgeIt.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(anEdgeIt.Value());
if (BRep_Tool::Degenerated(anEdge))
{
return Standard_False;
}
if (BRep_Tool::IsClosed(anEdge, myFace))
{
return Standard_False;
}
}
}
return Standard_True;
}
//=======================================================================
//function : FixOrientation
@@ -1116,8 +1071,9 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
// if no wires, just do nothing
if ( nb <= 0) return Standard_False;
Standard_Integer nbInternal=0;
Standard_Boolean isAddNaturalBounds = isNeedAddNaturalBound(ws);
Standard_Boolean isAddNaturalBounds = (NeedFix (myFixAddNaturalBoundMode) && IsSurfaceUVPeriodic(mySurf->Adaptor3d()));
TColStd_SequenceOfInteger aSeqReversed;
// if wire is only one, check its orientation
if ( nb == 1 ) {
@@ -1128,7 +1084,9 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
af.Orientation ( TopAbs_FORWARD );
B.Add (af,ws.Value(1));
if (!isAddNaturalBounds && !ShapeAnalysis::IsOuterBound(af))
if ((myFixAddNaturalBoundMode != 1 ||
!IsSurfaceUVPeriodic(mySurf->Adaptor3d())) &&
!ShapeAnalysis::IsOuterBound(af))
{
Handle(ShapeExtend_WireData) sbdw =
new ShapeExtend_WireData(TopoDS::Wire(ws.Value(1)));
@@ -1286,7 +1244,7 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
if(!(stb==ste)) {
sta = TopAbs_UNKNOWN;
SI.Bind(aw,0);
j=nbAll;
j=nb;
break;
}
}
@@ -1405,9 +1363,11 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
}
//done = (done && (nb ==1 || (isAddNaturalBounds || (!isAddNaturalBounds && nbInternal <nb))));
if(isAddNaturalBounds && nb == aSeqReversed.Length())
done = Standard_False;
else
done = (done && (nb ==1 || (isAddNaturalBounds || (!isAddNaturalBounds && nbInternal <nb))));
// Faut-il reconstruire ? si myRebil est mis
if ( done ) {
TopoDS_Shape S = myFace.EmptyCopied();

View File

@@ -261,9 +261,7 @@ protected:
private:
//! Returns True if the face needs to add natural bound and corresponded option of shape healing is ON
Standard_Boolean isNeedAddNaturalBound(const TopTools_SequenceOfShape& theOrientedWires);
Standard_EXPORT Standard_Boolean SplitEdge (const Handle(ShapeExtend_WireData)& sewd, const Standard_Integer num, const Standard_Real param, const TopoDS_Vertex& vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d& boxes);
Standard_EXPORT Standard_Boolean SplitEdge (const Handle(ShapeExtend_WireData)& sewd, const Standard_Integer num, const Standard_Real param1, const Standard_Real param2, const TopoDS_Vertex& vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d& boxes);

View File

@@ -62,14 +62,7 @@ Standard_Boolean ShapeProcess_Context::Init (const Standard_CString file,
const Standard_CString scope)
{
myScope.Nullify();
if (file != nullptr && strlen (file) != 0)
{
myRC = LoadResourceManager ( file );
}
else
{
myRC = new Resource_Manager();
}
myRC = LoadResourceManager ( file );
if ( scope && scope[0] ) {
SetScope ( scope );
}

View File

@@ -18,7 +18,6 @@
// paralleling with Intel TBB
#ifdef HAVE_TBB
#pragma comment (lib, "tbbmalloc.lib")
#include <tbb/scalable_allocator.h>
using namespace tbb;
#else

View File

@@ -9,7 +9,6 @@ TKShHealing
TKMesh
TKService
TKHLR
TKTopAlgo
CSF_TclLibs
CSF_TclTkLibs
CSF_XwLibs

View File

@@ -1,5 +1,3 @@
project(TKOpenGl)
set (TKOpenGl_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)

View File

@@ -1,6 +1,4 @@
project(TKOpenGles)
set (TKOpenGles_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
#add_definitions("-DOCCT_OPENGL")

View File

@@ -1,5 +1,3 @@
project(TKService)
set (TKService_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)

View File

@@ -1,5 +1,3 @@
project(TKXCAF)
set (TKXCAF_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)

View File

@@ -1,7 +1,6 @@
XCAFApp
XCAFAnimObjects
XCAFDimTolObjects
XCAFNoteObjects
XCAFDoc
XCAFPrs
XCAFView
XCAFView

View File

@@ -1,5 +1,3 @@
project(TKXDEDRAW)
set (TKXDEDRAW_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)

View File

@@ -21,7 +21,6 @@
#include <algorithm>
#include <iostream>
#include <limits>
namespace
{

View File

@@ -33,7 +33,9 @@ namespace
//=======================================================================
Vrml_ConfigurationNode::Vrml_ConfigurationNode() :
DE_ConfigurationNode()
{}
{
UpdateLoad();
}
//=======================================================================
// function : STEPCAFControl_ConfigurationNode
@@ -43,6 +45,7 @@ Vrml_ConfigurationNode::Vrml_ConfigurationNode(const Handle(Vrml_ConfigurationNo
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -1,20 +0,0 @@
XCAFAnimObjects_AnimObject.cxx
XCAFAnimObjects_AnimObject.hxx
XCAFAnimObjects_CustomOperation.cxx
XCAFAnimObjects_CustomOperation.hxx
XCAFAnimObjects_InterpolationType.hxx
XCAFAnimObjects_Operation.cxx
XCAFAnimObjects_Operation.hxx
XCAFAnimObjects_OperationType.hxx
XCAFAnimObjects_Orient.cxx
XCAFAnimObjects_Orient.hxx
XCAFAnimObjects_Rotate.cxx
XCAFAnimObjects_Rotate.hxx
XCAFAnimObjects_Scale.cxx
XCAFAnimObjects_Scale.hxx
XCAFAnimObjects_Skew.cxx
XCAFAnimObjects_Skew.hxx
XCAFAnimObjects_Transform.cxx
XCAFAnimObjects_Transform.hxx
XCAFAnimObjects_Translate.cxx
XCAFAnimObjects_Translate.hxx

View File

@@ -1,33 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XCAFAnimObjects_AnimObject.hxx>
IMPLEMENT_STANDARD_RTTIEXT(XCAFAnimObjects_AnimObject, Standard_Transient)
//=======================================================================
//function : XCAFAnimObjects_AnimObject
//purpose :
//=======================================================================
XCAFAnimObjects_AnimObject::XCAFAnimObjects_AnimObject() :
myInterpolationType(XCAFAnimObjects_InterpolationType_Step)
{}
//=======================================================================
//function : XCAFAnimObjects_AnimObject
//purpose :
//=======================================================================
XCAFAnimObjects_AnimObject::XCAFAnimObjects_AnimObject(const Handle(XCAFAnimObjects_AnimObject)& theObject) :
myInterpolationType(XCAFAnimObjects_InterpolationType_Step),
myOrderedOperations(theObject->myOrderedOperations)
{}

View File

@@ -1,59 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_AnimObject_HeaderFile
#define _XCAFAnimObjects_AnimObject_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
#include <NCollection_List.hxx>
#include <XCAFAnimObjects_InterpolationType.hxx>
class XCAFAnimObjects_Operation;
//!
class XCAFAnimObjects_AnimObject : public Standard_Transient
{
public:
DEFINE_STANDARD_RTTIEXT(XCAFAnimObjects_AnimObject, Standard_Transient)
public:
//!
Standard_EXPORT XCAFAnimObjects_AnimObject();
//!
Standard_EXPORT XCAFAnimObjects_AnimObject(const Handle(XCAFAnimObjects_AnimObject)& theObject);
//!
void AppendNewOperation(const Handle(XCAFAnimObjects_Operation)& theOperation) { myOrderedOperations.Append(theOperation); }
//!
XCAFAnimObjects_InterpolationType GetInterpolationType() const { return myInterpolationType; }
//!
void SetInterpolationType(const XCAFAnimObjects_InterpolationType theType) { myInterpolationType = theType; }
//!
const NCollection_List<Handle(XCAFAnimObjects_Operation)>& GetOrderedOperations() const { return myOrderedOperations; }
//!
NCollection_List<Handle(XCAFAnimObjects_Operation)>& ChangeOrderedOperations() { return myOrderedOperations; }
private:
XCAFAnimObjects_InterpolationType myInterpolationType;
NCollection_List<Handle(XCAFAnimObjects_Operation)> myOrderedOperations;
};
#endif // _XCAFAnimObjects_AnimObject_HeaderFile

View File

@@ -1,52 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include "XCAFAnimObjects_CustomOperation.hxx"
//=======================================================================
//function : XCAFAnimObjects_CustomOperation
//purpose :
//=======================================================================
XCAFAnimObjects_CustomOperation::XCAFAnimObjects_CustomOperation(const NCollection_Array1<double>& thePresentation,
const TCollection_AsciiString& theCustomTypeName) :
XCAFAnimObjects_Operation(false),
myTypeName(theCustomTypeName),
myPresentation(1, 1, thePresentation.Lower(), thePresentation.Upper())
{
for (int anInd = thePresentation.Lower(); anInd <= thePresentation.Upper(); anInd++)
{
myPresentation.SetValue(1, anInd, thePresentation.Value(anInd));
}
}
//=======================================================================
//function : XCAFAnimObjects_CustomOperation
//purpose :
//=======================================================================
XCAFAnimObjects_CustomOperation::XCAFAnimObjects_CustomOperation(const NCollection_Array2<double>& thePresentation,
const NCollection_Array1<double>& theTimeStamps,
const TCollection_AsciiString& theCustomTypeName) :
XCAFAnimObjects_Operation(theTimeStamps),
myTypeName(theCustomTypeName),
myPresentation(thePresentation)
{}
//=======================================================================
//function : XCAFAnimObjects_CustomOperation
//purpose :
//=======================================================================
XCAFAnimObjects_CustomOperation::XCAFAnimObjects_CustomOperation(const Handle(XCAFAnimObjects_CustomOperation)& theOperation) :
XCAFAnimObjects_Operation(theOperation),
myTypeName(theOperation->myTypeName),
myPresentation(theOperation->myPresentation)
{}

View File

@@ -1,56 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_CustomOperation_HeaderFile
#define _XCAFAnimObjects_CustomOperation_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <NCollection_Array2.hxx>
#include <TCollection_AsciiString.hxx>
//!
class XCAFAnimObjects_CustomOperation : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_CustomOperation(const NCollection_Array1<double>& thePresentation,
const TCollection_AsciiString& theCustomTypeName);
//!
Standard_EXPORT XCAFAnimObjects_CustomOperation(const NCollection_Array2<double>& thePresentation,
const NCollection_Array1<double>& theTimeStamps,
const TCollection_AsciiString& theCustomTypeName);
//!
Standard_EXPORT XCAFAnimObjects_CustomOperation(const Handle(XCAFAnimObjects_CustomOperation)& theOperation);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Custom; }
//!
NCollection_Array2<double> GeneralPresentation() const Standard_OVERRIDE { return myPresentation; }
//!
TCollection_AsciiString GetTypeName() const Standard_OVERRIDE { return myTypeName; }
//!
const NCollection_Array2<double>& CustomPresentation() const { return myPresentation; }
private:
TCollection_AsciiString myTypeName; //!<
NCollection_Array2<double> myPresentation; //!<
};
#endif // _XCAFAnimObjects_CustomOperation_HeaderFile

View File

@@ -1,27 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_InterpolationType_HeaderFile
#define _XCAFAnimObjects_InterpolationType_HeaderFile
//! Interpolation is a description of behavior between timestamps
enum XCAFAnimObjects_InterpolationType
{
XCAFAnimObjects_InterpolationType_Custom = 0, //!< User-defined interpolation
XCAFAnimObjects_InterpolationType_Step, //!< No interpolation, just apply timestamps step by step
XCAFAnimObjects_InterpolationType_Linear, //!< Linear dependency from t_(i) to t_(i+1)
XCAFAnimObjects_InterpolationType_CubicSpline, //!< Cubic dependency from t_(i) to t_(i+1)
XCAFAnimObjects_InterpolationType_Static //!< No animation in this time period, use the closest static value
};
#endif // _XCAFAnimObjects_InterpolationType_HeaderFile

View File

@@ -1,43 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XCAFAnimObjects_Operation.hxx>
IMPLEMENT_STANDARD_RTTIEXT(XCAFAnimObjects_Operation, Standard_Transient)
//=======================================================================
//function : XCAFAnimObjects_Operation
//purpose :
//=======================================================================
XCAFAnimObjects_Operation::XCAFAnimObjects_Operation(const bool theIsInverse) :
myIsInverse(theIsInverse)
{}
//=======================================================================
//function : XCAFAnimObjects_Operation
//purpose :
//=======================================================================
XCAFAnimObjects_Operation::XCAFAnimObjects_Operation(const NCollection_Array1<double>& theTimeStamps,
const bool theIsInverse) :
myIsInverse(theIsInverse),
myTimeStamps(theTimeStamps)
{}
//=======================================================================
//function : XCAFAnimObjects_Operation
//purpose :
//=======================================================================
XCAFAnimObjects_Operation::XCAFAnimObjects_Operation(const Handle(XCAFAnimObjects_Operation)& theOperation) :
myIsInverse(theOperation->myIsInverse),
myTimeStamps(theOperation->myTimeStamps)
{}

View File

@@ -1,67 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_Operation_HeaderFile
#define _XCAFAnimObjects_Operation_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
#include <NCollection_Array1.hxx>
#include <NCollection_Array2.hxx>
#include <TCollection_AsciiString.hxx>
#include <XCAFAnimObjects_OperationType.hxx>
//!
class XCAFAnimObjects_Operation : public Standard_Transient
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Operation(const bool theIsInverse = false);
//!
Standard_EXPORT XCAFAnimObjects_Operation(const NCollection_Array1<double>& theTimeStamps,
const bool theIsInverse = false);
//!
Standard_EXPORT XCAFAnimObjects_Operation(const Handle(XCAFAnimObjects_Operation)& theOperation);
//!
const NCollection_Array1<double>& TimeStamps() const { return myTimeStamps; }
//!
bool HasTimeStamps() const { return !myTimeStamps.IsEmpty(); }
//!
Standard_EXPORT virtual XCAFAnimObjects_OperationType GetType() const = 0;
//!
Standard_EXPORT virtual TCollection_AsciiString GetTypeName() const = 0;
//!
bool IsInverse() const { return myIsInverse; }
//!
void SetInverse(const bool theIsInverse) { myIsInverse = theIsInverse; }
//!
Standard_EXPORT virtual NCollection_Array2<double> GeneralPresentation() const = 0;
DEFINE_STANDARD_RTTIEXT(XCAFAnimObjects_Operation, Standard_Transient)
private:
bool myIsInverse; //!
NCollection_Array1<double> myTimeStamps; //!<
};
#endif // _XCAFAnimObjects_Operation_HeaderFile

View File

@@ -1,29 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_OperationType_HeaderFile
#define _XCAFAnimObjects_OperationType_HeaderFile
//!
enum XCAFAnimObjects_OperationType
{
XCAFAnimObjects_OperationType_Custom = 0, //!<
XCAFAnimObjects_OperationType_Orient, //!<
XCAFAnimObjects_OperationType_Rotate, //!<
XCAFAnimObjects_OperationType_Scale, //!<
XCAFAnimObjects_OperationType_Skew, //!<
XCAFAnimObjects_OperationType_Transform, //!<
XCAFAnimObjects_OperationType_Translate //!<
};
#endif // _XCAFAnimObjects_OperationType_HeaderFile

View File

@@ -1,90 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <XCAFAnimObjects_Orient.hxx>
#include <Message.hxx>
//=======================================================================
//function : XCAFAnimObjects_Orient
//purpose :
//=======================================================================
XCAFAnimObjects_Orient::XCAFAnimObjects_Orient(const gp_Quaternion& theOrient) :
XCAFAnimObjects_Operation(false),
myOrientPresentation(1, 1)
{
myOrientPresentation.SetValue(1, theOrient);
}
//=======================================================================
//function : XCAFAnimObjects_Orient
//purpose :
//=======================================================================
XCAFAnimObjects_Orient::XCAFAnimObjects_Orient(const NCollection_Array1<gp_Quaternion>& theOrient,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myOrientPresentation(theOrient)
{}
//=======================================================================
//function : XCAFAnimObjects_Orient
//purpose :
//=======================================================================
XCAFAnimObjects_Orient::XCAFAnimObjects_Orient(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myOrientPresentation(1, theGeneralPresentation.NbRows())
{
if (theGeneralPresentation.NbColumns() != 4)
{
Message::SendWarning() << "Warning: XCAFAnimObjects_Orient: Incorrect Quaternion general presentation";
return;
}
for (int aRowInd = 1; aRowInd <= theGeneralPresentation.NbRows(); aRowInd++)
{
gp_Quaternion aQuat(theGeneralPresentation.Value(aRowInd, 1),
theGeneralPresentation.Value(aRowInd, 2),
theGeneralPresentation.Value(aRowInd, 3),
theGeneralPresentation.Value(aRowInd, 4));
myOrientPresentation.SetValue(aRowInd, aQuat);
}
}
//=======================================================================
//function : XCAFAnimObjects_Orient
//purpose :
//=======================================================================
XCAFAnimObjects_Orient::XCAFAnimObjects_Orient(const Handle(XCAFAnimObjects_Orient)& theOperation) :
XCAFAnimObjects_Operation(theOperation),
myOrientPresentation(theOperation->myOrientPresentation)
{}
//=======================================================================
//function : GeneralPresentation
//purpose :
//=======================================================================
NCollection_Array2<double> XCAFAnimObjects_Orient::GeneralPresentation() const
{
NCollection_Array2<double> aRes(1, myOrientPresentation.Length(), 1, 4);
for (int aRowInd = 1; aRowInd <= myOrientPresentation.Length(); aRowInd++)
{
const gp_Quaternion& aQuat = myOrientPresentation.Value(aRowInd);
aRes.SetValue(aRowInd, 1, aQuat.X());
aRes.SetValue(aRowInd, 2, aQuat.Y());
aRes.SetValue(aRowInd, 3, aQuat.Z());
aRes.SetValue(aRowInd, 4, aQuat.W());
}
return aRes;
}

View File

@@ -1,56 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_Orient_HeaderFile
#define _XCAFAnimObjects_Orient_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_Quaternion.hxx>
//!
class XCAFAnimObjects_Orient : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Orient(const gp_Quaternion& theOrient);
//!
Standard_EXPORT XCAFAnimObjects_Orient(const NCollection_Array1<gp_Quaternion>& theOrient,
const NCollection_Array1<double>& theTimeStamps);
//!
Standard_EXPORT XCAFAnimObjects_Orient(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps);
//!
Standard_EXPORT XCAFAnimObjects_Orient(const Handle(XCAFAnimObjects_Orient)& theOperation);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Orient; }
//!
TCollection_AsciiString GetTypeName() const Standard_OVERRIDE { return "Orient"; }
//!
Standard_EXPORT NCollection_Array2<double> GeneralPresentation() const Standard_OVERRIDE;
//!
const NCollection_Array1<gp_Quaternion>& OrientPresentation() const { return myOrientPresentation; }
private:
NCollection_Array1<gp_Quaternion> myOrientPresentation; //!<
};
#endif // _XCAFAnimObjects_Orient_HeaderFile

View File

@@ -1,86 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include "XCAFAnimObjects_Rotate.hxx"
#include <Message.hxx>
//=======================================================================
//function : XCAFAnimObjects_Rotate
//purpose :
//=======================================================================
XCAFAnimObjects_Rotate::XCAFAnimObjects_Rotate(const NCollection_Array1<double>& theRotate,
const NCollection_Array1<double>& theTimeStamps,
const XCAFAnimObjects_Rotate_Type theRotateType) :
XCAFAnimObjects_Operation(theTimeStamps),
myRotateType(theRotateType),
myRotatePresentation(1, 1, theRotate.Lower(), theRotate.Upper())
{
for (int anInd = theRotate.Lower(); anInd <= theRotate.Upper(); anInd++)
{
myRotatePresentation.SetValue(1, anInd, theRotate.Value(anInd));
}
Standard_Integer aNbDouble = 3;
if (theRotateType >= XCAFAnimObjects_Rotate_Type_XY &&
theRotateType <= XCAFAnimObjects_Rotate_Type_ZY)
{
aNbDouble = 2;
}
if (theRotateType >= XCAFAnimObjects_Rotate_Type_X &&
theRotateType <= XCAFAnimObjects_Rotate_Type_Z)
{
aNbDouble = 1;
}
if (theRotate.Length() != aNbDouble)
{
Message::SendWarning() << "Warning: XCAFAnimObjects_Rotate: Incorrect Rotate presentation";
}
}
//=======================================================================
//function : XCAFAnimObjects_Rotate
//purpose :
//=======================================================================
XCAFAnimObjects_Rotate::XCAFAnimObjects_Rotate(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps,
const XCAFAnimObjects_Rotate_Type theRotateType) :
XCAFAnimObjects_Operation(theTimeStamps),
myRotateType(theRotateType),
myRotatePresentation(theGeneralPresentation)
{
Standard_Integer aNbDouble = 3;
if (theRotateType >= XCAFAnimObjects_Rotate_Type_XY &&
theRotateType <= XCAFAnimObjects_Rotate_Type_ZY)
{
aNbDouble = 2;
}
if (theRotateType >= XCAFAnimObjects_Rotate_Type_X &&
theRotateType <= XCAFAnimObjects_Rotate_Type_Z)
{
aNbDouble = 1;
}
if (theGeneralPresentation.NbColumns() != aNbDouble)
{
Message::SendWarning() << "Warning: XCAFAnimObjects_Rotate: Incorrect Rotate presentation";
}
}
//=======================================================================
//function : XCAFAnimObjects_Rotate
//purpose :
//=======================================================================
XCAFAnimObjects_Rotate::XCAFAnimObjects_Rotate(const Handle(XCAFAnimObjects_Rotate)& theOperation) :
XCAFAnimObjects_Operation(theOperation),
myRotateType(theOperation->myRotateType),
myRotatePresentation(theOperation->myRotatePresentation)
{}

View File

@@ -1,84 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_Rotate_HeaderFile
#define _XCAFAnimObjects_Rotate_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_Quaternion.hxx>
//!
class XCAFAnimObjects_Rotate : public XCAFAnimObjects_Operation
{
public:
//!
enum XCAFAnimObjects_Rotate_Type
{
XCAFAnimObjects_Rotate_Type_XYZ = 0,
XCAFAnimObjects_Rotate_Type_XZY,
XCAFAnimObjects_Rotate_Type_YZX,
XCAFAnimObjects_Rotate_Type_YXZ,
XCAFAnimObjects_Rotate_Type_ZXY,
XCAFAnimObjects_Rotate_Type_ZYX,
XCAFAnimObjects_Rotate_Type_XY,
XCAFAnimObjects_Rotate_Type_XZ,
XCAFAnimObjects_Rotate_Type_YX,
XCAFAnimObjects_Rotate_Type_YZ,
XCAFAnimObjects_Rotate_Type_ZX,
XCAFAnimObjects_Rotate_Type_ZY,
XCAFAnimObjects_Rotate_Type_X,
XCAFAnimObjects_Rotate_Type_Y,
XCAFAnimObjects_Rotate_Type_Z
};
public:
//!
Standard_EXPORT XCAFAnimObjects_Rotate(const NCollection_Array1<double>& theRotate,
const NCollection_Array1<double>& theTimeStamps,
const XCAFAnimObjects_Rotate_Type theRotateType = XCAFAnimObjects_Rotate_Type_XYZ);
//!
Standard_EXPORT XCAFAnimObjects_Rotate(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps,
const XCAFAnimObjects_Rotate_Type theRotateType = XCAFAnimObjects_Rotate_Type_XYZ);
//!
Standard_EXPORT XCAFAnimObjects_Rotate(const Handle(XCAFAnimObjects_Rotate)& theOperation);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Rotate; }
//!
XCAFAnimObjects_Rotate_Type GetRotateType() const { return myRotateType; }
//!
void SetRotateType(const XCAFAnimObjects_Rotate_Type theRotateType) { myRotateType = theRotateType; }
//!
TCollection_AsciiString GetTypeName() const Standard_OVERRIDE { return "Rotate"; }
//!
NCollection_Array2<double> GeneralPresentation() const { return myRotatePresentation; }
//!
const NCollection_Array2<double>& RotatePresentation() const { return myRotatePresentation; }
private:
XCAFAnimObjects_Rotate_Type myRotateType; //!<
NCollection_Array2<double> myRotatePresentation; //!<
};
#endif // _XCAFAnimObjects_Rotate_HeaderFile

View File

@@ -1,87 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include "XCAFAnimObjects_Scale.hxx"
#include <Message.hxx>
//=======================================================================
//function : XCAFAnimObjects_Scale
//purpose :
//=======================================================================
XCAFAnimObjects_Scale::XCAFAnimObjects_Scale(const gp_XYZ& theScale) :
XCAFAnimObjects_Operation(false),
myScalePresentation(1, 1)
{
myScalePresentation.SetValue(1, theScale);
}
//=======================================================================
//function : XCAFAnimObjects_Scale
//purpose :
//=======================================================================
XCAFAnimObjects_Scale::XCAFAnimObjects_Scale(const NCollection_Array1<gp_XYZ>& theScale,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myScalePresentation(theScale)
{}
//=======================================================================
//function : XCAFAnimObjects_Scale
//purpose :
//=======================================================================
XCAFAnimObjects_Scale::XCAFAnimObjects_Scale(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myScalePresentation(1, theGeneralPresentation.NbRows())
{
if (theGeneralPresentation.NbColumns() != 3)
{
Message::SendWarning() << "Warning: XCAFAnimObjects_Scale: Incorrect XYZ general presentation";
return;
}
for (int aRowInd = 1; aRowInd <= theGeneralPresentation.NbRows(); aRowInd++)
{
gp_XYZ aXYZ(theGeneralPresentation.Value(aRowInd, 1),
theGeneralPresentation.Value(aRowInd, 2),
theGeneralPresentation.Value(aRowInd, 3));
myScalePresentation.SetValue(aRowInd, aXYZ);
}
}
//=======================================================================
//function : XCAFAnimObjects_Scale
//purpose :
//=======================================================================
XCAFAnimObjects_Scale::XCAFAnimObjects_Scale(const Handle(XCAFAnimObjects_Scale)& theOperation) :
XCAFAnimObjects_Operation(theOperation),
myScalePresentation(theOperation->myScalePresentation)
{}
//=======================================================================
//function : GeneralPresentation
//purpose :
//=======================================================================
NCollection_Array2<double> XCAFAnimObjects_Scale::GeneralPresentation() const
{
NCollection_Array2<double> aRes(1, myScalePresentation.Length(), 1, 3);
for (int aRowInd = 1; aRowInd <= myScalePresentation.Length(); aRowInd++)
{
const gp_XYZ& aXYZ = myScalePresentation.Value(aRowInd);
aRes.SetValue(aRowInd, 1, aXYZ.X());
aRes.SetValue(aRowInd, 2, aXYZ.Y());
aRes.SetValue(aRowInd, 3, aXYZ.Z());
}
return aRes;
}

View File

@@ -1,56 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_Scale_HeaderFile
#define _XCAFAnimObjects_Scale_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_XYZ.hxx>
//!
class XCAFAnimObjects_Scale : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Scale(const gp_XYZ& theScale);
//!
Standard_EXPORT XCAFAnimObjects_Scale(const NCollection_Array1<gp_XYZ>& theScale,
const NCollection_Array1<double>& theTimeStamps);
//!
Standard_EXPORT XCAFAnimObjects_Scale(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps);
//!
Standard_EXPORT XCAFAnimObjects_Scale(const Handle(XCAFAnimObjects_Scale)& theOperation);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Scale; }
//!
TCollection_AsciiString GetTypeName() const Standard_OVERRIDE { return "Scale"; }
//!
Standard_EXPORT NCollection_Array2<double> GeneralPresentation() const Standard_OVERRIDE;
//!
const NCollection_Array1<gp_XYZ>& ScalePresentation() const { return myScalePresentation; }
private:
NCollection_Array1<gp_XYZ> myScalePresentation; //!<
};
#endif // _XCAFAnimObjects_Scale_HeaderFile

View File

@@ -1,87 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include "XCAFAnimObjects_Skew.hxx"
#include <Message.hxx>
//=======================================================================
//function : XCAFAnimObjects_Skew
//purpose :
//=======================================================================
XCAFAnimObjects_Skew::XCAFAnimObjects_Skew(const gp_XYZ& theSkew) :
XCAFAnimObjects_Operation(false),
mySkewPresentation(1, 1)
{
mySkewPresentation.SetValue(1, theSkew);
}
//=======================================================================
//function : XCAFAnimObjects_Skew
//purpose :
//=======================================================================
XCAFAnimObjects_Skew::XCAFAnimObjects_Skew(const NCollection_Array1<gp_XYZ>& theSkew,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
mySkewPresentation(theSkew)
{}
//=======================================================================
//function : XCAFAnimObjects_Skew
//purpose :
//=======================================================================
XCAFAnimObjects_Skew::XCAFAnimObjects_Skew(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
mySkewPresentation(1, theGeneralPresentation.NbRows())
{
if (theGeneralPresentation.NbColumns() != 3)
{
Message::SendWarning() << "Warning: XCAFAnimObjects_Skew: Incorrect Skew general presentation";
return;
}
for (int aRowInd = 1; aRowInd <= theGeneralPresentation.NbRows(); aRowInd++)
{
gp_XYZ aSkew(theGeneralPresentation.Value(aRowInd, 1),
theGeneralPresentation.Value(aRowInd, 2),
theGeneralPresentation.Value(aRowInd, 3));
mySkewPresentation.SetValue(aRowInd, aSkew);
}
}
//=======================================================================
//function : XCAFAnimObjects_Skew
//purpose :
//=======================================================================
XCAFAnimObjects_Skew::XCAFAnimObjects_Skew(const Handle(XCAFAnimObjects_Skew)& theOperation) :
XCAFAnimObjects_Operation(theOperation),
mySkewPresentation(theOperation->mySkewPresentation)
{}
//=======================================================================
//function : GeneralPresentation
//purpose :
//=======================================================================
NCollection_Array2<double> XCAFAnimObjects_Skew::GeneralPresentation() const
{
NCollection_Array2<double> aRes(1, mySkewPresentation.Length(), 1, 3);
for (int aRowInd = 1; aRowInd <= mySkewPresentation.Length(); aRowInd++)
{
const gp_XYZ& aSkew = mySkewPresentation.Value(aRowInd);
aRes.SetValue(aRowInd, 1, aSkew.X());
aRes.SetValue(aRowInd, 2, aSkew.Y());
aRes.SetValue(aRowInd, 3, aSkew.Z());
}
return aRes;
}

View File

@@ -1,57 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _XCAFAnimObjects_Skew_HeaderFile
#define _XCAFAnimObjects_Skew_HeaderFile
#include <XCAFAnimObjects_Operation.hxx>
#include <gp_XYZ.hxx>
//!
class XCAFAnimObjects_Skew : public XCAFAnimObjects_Operation
{
public:
//!
Standard_EXPORT XCAFAnimObjects_Skew(const gp_XYZ& theSkew);
//!
Standard_EXPORT XCAFAnimObjects_Skew(const NCollection_Array1<gp_XYZ>& theSkew,
const NCollection_Array1<double>& theTimeStamps);
//!
Standard_EXPORT XCAFAnimObjects_Skew(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps);
//!
Standard_EXPORT XCAFAnimObjects_Skew(const Handle(XCAFAnimObjects_Skew)& theOperation);
//!
XCAFAnimObjects_OperationType GetType() const Standard_OVERRIDE { return XCAFAnimObjects_OperationType_Skew; }
//!
TCollection_AsciiString GetTypeName() const Standard_OVERRIDE { return "Skew"; }
//!
Standard_EXPORT NCollection_Array2<double> GeneralPresentation() const Standard_OVERRIDE;
//!
const NCollection_Array1<gp_XYZ>& SkewPresentation() const { return mySkewPresentation; }
private:
NCollection_Array1<gp_XYZ> mySkewPresentation; //!<
};
#endif // _XCAFAnimObjects_Skew_HeaderFile

View File

@@ -1,114 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include "XCAFAnimObjects_Transform.hxx"
#include <Message.hxx>
//=======================================================================
//function : XCAFAnimObjects_Transform
//purpose :
//=======================================================================
XCAFAnimObjects_Transform::XCAFAnimObjects_Transform(const NCollection_Mat4<double>& theTransform) :
XCAFAnimObjects_Operation(false),
myTransformPresentation(1, 1)
{
myTransformPresentation.SetValue(1, theTransform);
}
//=======================================================================
//function : XCAFAnimObjects_Transform
//purpose :
//=======================================================================
XCAFAnimObjects_Transform::XCAFAnimObjects_Transform(const NCollection_Array1<NCollection_Mat4<double>>& theTransform,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myTransformPresentation(theTransform)
{}
//=======================================================================
//function : XCAFAnimObjects_Transform
//purpose :
//=======================================================================
XCAFAnimObjects_Transform::XCAFAnimObjects_Transform(const NCollection_Array2<double>& theGeneralPresentation,
const NCollection_Array1<double>& theTimeStamps) :
XCAFAnimObjects_Operation(theTimeStamps),
myTransformPresentation(1, theGeneralPresentation.NbRows())
{
if (theGeneralPresentation.NbColumns() != 16)
{
Message::SendWarning() << "Warning: XCAFAnimObjects_Transform: Incorrect Mat4x4 general presentation";
return;
}
for (int aRowInd = 1; aRowInd <= theGeneralPresentation.NbRows(); aRowInd++)
{
NCollection_Mat4<double> aTransform;
aTransform.SetRow(0, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 1),
theGeneralPresentation.Value(aRowInd, 2),
theGeneralPresentation.Value(aRowInd, 3),
theGeneralPresentation.Value(aRowInd, 4)));
aTransform.SetRow(1, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 5),
theGeneralPresentation.Value(aRowInd, 6),
theGeneralPresentation.Value(aRowInd, 7),
theGeneralPresentation.Value(aRowInd, 8)));
aTransform.SetRow(2, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 9),
theGeneralPresentation.Value(aRowInd, 10),
theGeneralPresentation.Value(aRowInd, 11),
theGeneralPresentation.Value(aRowInd, 12)));
aTransform.SetRow(3, NCollection_Vec4<double>(theGeneralPresentation.Value(aRowInd, 13),
theGeneralPresentation.Value(aRowInd, 14),
theGeneralPresentation.Value(aRowInd, 15),
theGeneralPresentation.Value(aRowInd, 16)));
myTransformPresentation.SetValue(aRowInd, aTransform);
}
}
//=======================================================================
//function : XCAFAnimObjects_Transform
//purpose :
//=======================================================================
XCAFAnimObjects_Transform::XCAFAnimObjects_Transform(const Handle(XCAFAnimObjects_Transform)& theOperation) :
XCAFAnimObjects_Operation(theOperation),
myTransformPresentation(theOperation->myTransformPresentation)
{}
//=======================================================================
//function : GeneralPresentation
//purpose :
//=======================================================================
NCollection_Array2<double> XCAFAnimObjects_Transform::GeneralPresentation() const
{
NCollection_Array2<double> aRes(1, myTransformPresentation.Length(), 1, 16);
for (int aRowInd = 1; aRowInd <= myTransformPresentation.Length(); aRowInd++)
{
const NCollection_Mat4<double>& aTransform = myTransformPresentation.Value(aRowInd);
aRes.SetValue(aRowInd, 1, aTransform.GetValue(0, 0));
aRes.SetValue(aRowInd, 2, aTransform.GetValue(0, 1));
aRes.SetValue(aRowInd, 3, aTransform.GetValue(0, 2));
aRes.SetValue(aRowInd, 4, aTransform.GetValue(0, 3));
aRes.SetValue(aRowInd, 5, aTransform.GetValue(1, 0));
aRes.SetValue(aRowInd, 6, aTransform.GetValue(1, 1));
aRes.SetValue(aRowInd, 7, aTransform.GetValue(1, 2));
aRes.SetValue(aRowInd, 8, aTransform.GetValue(1, 3));
aRes.SetValue(aRowInd, 9, aTransform.GetValue(2, 0));
aRes.SetValue(aRowInd, 10, aTransform.GetValue(2, 1));
aRes.SetValue(aRowInd, 11, aTransform.GetValue(2, 2));
aRes.SetValue(aRowInd, 12, aTransform.GetValue(2, 3));
aRes.SetValue(aRowInd, 13, aTransform.GetValue(3, 0));
aRes.SetValue(aRowInd, 14, aTransform.GetValue(3, 1));
aRes.SetValue(aRowInd, 15, aTransform.GetValue(3, 2));
aRes.SetValue(aRowInd, 16, aTransform.GetValue(3, 3));
}
return aRes;
}

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