1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

34 Commits

Author SHA1 Message Date
dpasukhi
36c80dbe7b Coding - Bump version to 7.9.1 2025-05-20 12:17:10 +01:00
Pasukhin Dmitry
4e8cf250ea Testing - Add a new compilation on Clang without PCH #540
Fixed PCH issue for mac os
2025-05-20 12:17:09 +01:00
dpasukhi
7e71e01dc4 Documentation - Enable server-based search and external search options in Doxyfile 2025-05-20 12:17:08 +01:00
Pasukhin Dmitry
f7dbf42d49 Coding - Small optimization of StepData_StepReaderData #543
Refactor SetEntityNumbers to use reusable memory pool.
Update SetRecord to avoid extra map searches.
2025-05-20 12:17:08 +01:00
Dmitrii Kulikov
86c72171bf Modeling - General Fuse (BOPAlgo_PaveFiller) optimization #514
Adding a null check for the triangulation in BRep_Tool::IsClosed.
Simplifying index lookup logic in BOPDS_DS.
Introducing helper functions (IsPlaneFF and IsClosedFF) and updating iteration loops in BOPAlgo_PaveFiller_6 for improved clarity and robustness.
2025-05-19 22:22:06 +01:00
Dmitrii Kulikov
bdad8f51b4 Modeling - BRepFilletAPI_MakeFillet Segfault with two curves and rim #532
Added null checks for TopoDS_Face in ChFi3d_Builder_2 and BRepAdaptor_Surface.
Added tests to check for crash.
2025-05-19 22:21:53 +01:00
ikochetkova
275a072169 Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots reference (#529)
Add processing of roots, which are transformed references of parts/assemblies.
2025-05-19 22:21:22 +01:00
ikochetkova
784bf6d4b9 Data Exchange, IGES Export - Missing Model Curves in transfer cache #483
Check if the curve was already created and use it. Works for shared edges cases.
2025-05-19 22:21:05 +01:00
Pasukhin Dmitry
f95594f475 Modeling - Periodic BSpline curve bounding #493
Enhance periodic curve handling in BndLib_Add3dCurve::Add method.
Checks the periodic BSpline on 3 directions of period for tolerance upgrade.
2025-05-19 22:19:51 +01:00
Pasukhin Dmitry
7e2c56ec46 Modeling - Bounding BSpline periodic tolerance issue #468
Update BndLib_Add3dCurve to check the periodic case u1-u2 matching with period
2025-05-19 22:19:38 +01:00
Pasukhin Dmitry
ead9d038fe Modeling - Handle void bounding box case in BRepBndLib::AddOptimal #470
In some cases face without natural bound can be not have edges on curve
2025-05-19 22:19:22 +01:00
Pasukhin Dmitry
8bbfddfacf Foundation Classes - Checking for MallInfo version #459
Fix memory usage reporting for GLIBC compatibility in OSD_MemInfo
2025-05-19 22:19:08 +01:00
Pasukhin Dmitry
442c58a2d1 Foundation Classes - Update signal handling for GLIBC compatibility on Linux #458
Simply disabling the code which enables floating point exceptions
  is probably wrong, but I don't have a replacement for the
    non-posix functions fegetexcept(3) and feenableexcept(3).
2025-05-19 22:19:04 +01:00
Pasukhin Dmitry
ff6f6ca8ff Foundation Classes - Host resolving by itself #457
Fixed issue  when gethostbyname returns a nullptr, because the host can't resolve itself
2025-05-19 22:18:56 +01:00
Pasukhin Dmitry
51b0bdc47c Data Exchange, Step - AP242 SchemaName Remove dot #448
Fix schema format for AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF in StepAP214_Protocol.cxx
2025-05-19 22:18:34 +01:00
Pasukhin Dmitry
0deb581ba2 Visualization - AIS_Shape bounding box re-computation is not working properly #422
Fixed issue with bounding box cleaning algorithm that was causing the bounding box to be only increased.
Now the bounding box is increased and decreased to fit the shape.
2025-05-19 22:18:10 +01:00
Pasukhin Dmitry
abd027bb57 Modeling - Improve handling of polygon parameters in NURBS conversion (#410) 2025-05-19 22:17:58 +01:00
Pasukhin Dmitry
b7858dc463 Data Exchange - Datum Axis extraction issue (#407)
Refactor axis handling with correct positioning and handling exceptions.
2025-05-19 22:17:48 +01:00
Markus Freilinger
5569f0ac07 Modeling - Degenerated curves were not handled by Arrange function (#396) 2025-05-19 22:17:39 +01:00
jboissy-mediasofts
b4ed551f13 Visualization - Refactor mouse click handling logic for improved double-click detection (#385) 2025-05-19 22:17:27 +01:00
Pasukhin Dmitry
882d7b580e Data Exchange - DE Wrapper invalidating parameters after 'Load' (#393)
Fix configuration loading to correctly use FileCS parameter
Add stability test for configuration changes
Update documentation's de wrapping names
2025-05-19 22:17:13 +01:00
Pasukhin Dmitry
6c179e9b63 Configuration - Fixed pathes to 3rd-party in cmake configuration (#523)
Update target_link_libraries to use PUBLIC and PRIVATE visibility for dependencies.
Now all 3rd-party is hidden for the external linking, no more issues to invalid path to 3rd-party
2025-05-19 22:15:38 +01:00
Pasukhin Dmitry
4c9aaf2300 Configuration - TBB configuration prioritization to release #496
Refactor TBB CMake configuration for checking configuration type.
The solution will be reorganized to math release/debug version.
Prepared only for the hot-fix reason.
2025-05-19 22:02:11 +01:00
Pasukhin Dmitry
556fb47854 Testing - Inspector build error on latest CMake #477
Add CMAKE_POLICY_VERSION_MINIMUM to TInspector configuration for Windows and Linux
2025-05-19 22:01:31 +01:00
Pasukhin Dmitry
653bb48aca Configuration - Remove -symbolic linker flag (#432)
Updated VCPKG workflow to follow the type of linking with the triplet.
Removed symbolic linker flag. As a result downgrade of performance.
The symbolic flag has high risk of instability, better to disable.
2025-05-19 21:59:07 +01:00
Pasukhin Dmitry
eab678df86 Configuration - Enhance Qt5 directory detection for Windows #419
Update the detection Qt5 folder to search for bin folder.
That will affected for the starting DRAW or samples as a part of env.
2025-05-19 21:59:01 +01:00
Pasukhin Dmitry
d521ba8eaa Configuration - Checking for FILES content #424
Added checking for file in package or toolkit.
Removed not-existed files from the list
2025-05-19 21:58:52 +01:00
Pasukhin Dmitry
73031c926f Configuration - Remove BUILD_PATCH option in CMake #418
Refactor CMake configuration to remove patch handling and simplify includes
2025-05-19 21:58:16 +01:00
Pasukhin Dmitry
2524448f0a Testing - Repeating failed tests in GH Action (#412) 2025-05-19 21:58:06 +01:00
Pasukhin Dmitry
7009880a14 Configuration - Update VTK optional components (#403)
Updated missed components leaded to the issue with VCPKG
2025-05-19 21:57:51 +01:00
Pasukhin Dmitry
39d0d1c65c Configuration - Modify VTK 9x handling (#401) 2025-05-19 21:57:48 +01:00
Pasukhin Dmitry
91d6f207ba Configuration - Extend CMake file filter regex (#400)
Fixed issue when folder name contains .c or .h as a part of the name.
2025-05-19 21:57:44 +01:00
Pasukhin Dmitry
fbe07bd763 Configuration - Update file globbing and condition checks for installation paths (#399) 2025-05-19 21:57:39 +01:00
Pasukhin Dmitry
ad110c5b01 Configuration - Update VTK configuration and enable optional components (#395) 2025-05-19 21:57:31 +01:00
69 changed files with 774 additions and 355 deletions

View File

@@ -48,6 +48,7 @@ runs:
-D 3RDPARTY_DIR=${{ github.workspace }}//3rdparty-vc14-64 `
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install `
-D INSTALL_DIR=${{ github.workspace }}/tools/install `
-D CMAKE_POLICY_VERSION_MINIMUM=3.5 `
..
- name: Configure TInspector - Linux
@@ -62,6 +63,7 @@ runs:
-D BUILD_SHARED_LIBS=ON \
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install \
-D INSTALL_DIR=${{ github.workspace }}/tools/install \
-D CMAKE_POLICY_VERSION_MINIMUM=3.5 \
..
- name: Build TInspector - Windows

View File

@@ -665,6 +665,22 @@ jobs:
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Repeating failed tests
if: steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20
run: |
cd install
call env.bat vc14 win64 release
# Repeat failed tests for 10 times
for /l %%i in (1,1,10) do (
DRAWEXE.exe -v -c testgrid -regress results/windows-x64-retest -outdir results/windows-x64-retest -parallel 0 -overwrite
DRAWEXE.exe -v -c "testsummarize results/windows-x64-retest"
)
shell: cmd
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload regression test results
if: steps.check_failures.outputs.failed_count > 0
uses: actions/upload-artifact@v4.4.3
@@ -893,6 +909,22 @@ jobs:
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Repeating failed tests
if: steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20
run: |
cd install
call env.bat clang win64 release
# Repeat failed tests for 10 times
for /l %%i in (1,1,10) do (
DRAWEXE.exe -v -c testgrid -regress results/windows-clang-x64-retest -outdir results/windows-clang-x64-retest -parallel 0 -overwrite
DRAWEXE.exe -v -c "testsummarize results/windows-clang-x64-retest"
)
shell: cmd
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload regression test results
if: steps.check_failures.outputs.failed_count > 0
uses: actions/upload-artifact@v4.4.3
@@ -1091,6 +1123,23 @@ jobs:
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Repeating failed tests
if: steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20
run: |
cd install
cd bin
source env.sh
# Repeat failed tests for 10 times
for i in {1..10}; do
./DRAWEXE -v -c testgrid -regress results/macos-x64-retest -outdir results/macos-x64-retest -parallel 0 -overwrite
./DRAWEXE -v -c "testsummarize results/macos-x64-retest"
done
shell: bash
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Copy retest results back to original location
if: steps.check_failures.outputs.failed_count > 0
run: |
@@ -1282,6 +1331,23 @@ jobs:
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Repeating failed tests
if: steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20
run: |
cd install
cd bin
source env.sh
# Repeat failed tests for 10 times
for i in {1..10}; do
./DRAWEXE -v -c testgrid -regress results/macos-gcc-x64-retest -outdir results/macos-gcc-x64-retest -parallel 0 -overwrite
./DRAWEXE -v -c "testsummarize results/macos-gcc-x64-retest"
done
shell: bash
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload regression test results
if: steps.check_failures.outputs.failed_count > 0
uses: actions/upload-artifact@v4.4.3
@@ -1468,6 +1534,24 @@ jobs:
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Repeating failed tests
if: steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20
run: |
cd install
cd bin
source env.sh
# Repeat failed tests for 10 times
for i in {1..10}; do
./DRAWEXE -v -c testgrid -regress results/linux-clang-x64-retest -outdir results/linux-clang-x64-retest -parallel 0 -overwrite
./DRAWEXE -v -c "testsummarize results/linux-clang-x64-retest"
done
shell: bash
env:
DISPLAY: :99
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload regression test results
if: steps.check_failures.outputs.failed_count > 0
uses: actions/upload-artifact@v4.4.3
@@ -1654,6 +1738,24 @@ jobs:
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Repeating failed tests
if: steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20
run: |
cd install
cd bin
source env.sh
# Repeat failed tests for 10 times
for i in {1..10}; do
./DRAWEXE -v -c testgrid -regress results/linux-gcc-x64-retest -outdir results/linux-gcc-x64-retest -parallel 0 -overwrite
./DRAWEXE -v -c "testsummarize results/linux-gcc-x64-retest"
done
shell: bash
env:
DISPLAY: :99
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload regression test results
if: steps.check_failures.outputs.failed_count > 0
uses: actions/upload-artifact@v4.4.3

View File

@@ -114,6 +114,7 @@ jobs:
-DUSE_TK=OFF \
-DBUILD_USE_PCH=ON \
-DBUILD_INCLUDE_SYMLINK=ON \
-DBUILD_LIBRARY_TYPE="Static" \
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-DUSE_DRACO=ON \
-DUSE_FFMPEG=ON \

View File

@@ -84,13 +84,9 @@ else ()
endif()
set (CMAKE_CXX_STANDARD_REQUIRED ON)
# macro: include patched file if it exists
# include cmake file
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake")
include (${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake)
else()
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
endif()
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
endmacro()
# set using memory manager option for TKernel
@@ -322,9 +318,6 @@ elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
set (BIN_LETTER "i")
endif()
# a directory recognized as a 'patch' for OCCT
set (BUILD_PATCH "" CACHE PATH "${BUILD_PATCH_DESCR}")
# the list of being built toolkits
set (BUILD_ADDITIONAL_TOOLKITS "" CACHE STRING "${BUILD_ADDITIONAL_TOOLKITS_DESCR}")
separate_arguments (BUILD_ADDITIONAL_TOOLKITS)
@@ -390,7 +383,7 @@ else()
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
# include the patched or original list of modules
# include original list of modules
# list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
# list <OCCT_MODULES> will contain all modules
OCCT_MODULES_AND_TOOLKITS (MODULES "TOOLKITS" OCCT_MODULES)
@@ -912,7 +905,7 @@ if(APPLE)
set (INSTALL_NAME_DIR "" CACHE STRING "install_name library suffix on OS X (e.g. @executable_path/../Frameworks)")
endif()
# include the patched or original list of definitions and flags
# include original list of definitions and flags
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
foreach (OCCT_3RDPARTY_LIST ${OCCT_3RDPARTY_CMAKE_LIST})
@@ -1029,7 +1022,7 @@ else()
endif()
# OCCT tools
# include the patched or original list of tools
# include original list of tools
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
# list <OCCT_TOOLS> will contain all tools
if (BUILD_Inspector)
@@ -1092,14 +1085,8 @@ if (${DRAWEXE_INDEX} GREATER -1)
OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR_DATA}")
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR_SAMPLES}")
# copy draw script to install script folder
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}")
install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
else()
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
# copy draw script to CMake binary folder
OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}")
@@ -1298,14 +1285,8 @@ if (BUILD_MODULE_UwpSample)
endif()
if (BUILD_TOOL_TOOLKITS)
# copy tinspector script to install script folder
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}")
install (FILES "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
else()
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
set (OpenCASCADE_BINARY_DIR "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
# patch TInspectorEXE

View File

@@ -82,6 +82,25 @@ else()
set (CSF_Draco)
endif()
# VTK
if (USE_VTK)
# the variable must to be empty, but keep there the list of libs
# that is used in the VTK component.
set (CSF_VTK
# vtkCommonCore
# vtkRenderingCore
# vtkRenderingFreeType
# vtkFiltersGeneral
# vtkIOImage
# vtkImagingCore
# vtkInteractionStyle
# vtkRenderingOpenGL
# vtkRenderingFreeTypeOpenGL
)
else()
set (CSF_VTK)
endif()
if (WIN32)
set (CSF_advapi32 "advapi32.lib")
set (CSF_gdi32 "gdi32.lib")

View File

@@ -151,15 +151,27 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
# /GL (whole program optimization) is similar to -flto (Link Time Optimization) in GCC/Clang.
# /GF (eliminate duplicate strings) doesn't have a direct equivalent in GCC/Clang, but the compilers do string pooling automatically.
# /Gy (enable function-level linking) is similar to -ffunction-sections in GCC/Clang.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
# Apply LTO optimization on all platforms
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
# Apply function sections only on non-macOS platforms
if (NOT APPLE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffunction-sections")
endif()
# Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL)
# Link-Time Code Generation (LTCG) is required for Whole Program Optimization
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto")
if (NOT WIN32)
# Add garbage collection sections only on Linux (not on macOS or Windows)
if (NOT WIN32 AND NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
@@ -172,7 +184,7 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
if (APPLE)
set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
elseif(NOT WIN32)
set (CMAKE_SHARED_LINKER_FLAGS "-lm -Wl,-Bsymbolic ${CMAKE_SHARED_LINKER_FLAGS}")
set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
endif()
endif()
endif()

View File

@@ -34,9 +34,7 @@ endmacro()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
@@ -44,9 +42,7 @@ function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
endfunction()
function(FIND_FOLDER_OR_FILE FILE_OR_FOLDER_NAME RESULT_PATH)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_OR_FOLDER_NAME}")
set (${RESULT_PATH} "${BUILD_PATCH}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}")
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}")
set (${RESULT_PATH} "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
else()
set (${RESULT_PATH} "" PARENT_SCOPE)
@@ -175,25 +171,8 @@ function (FIND_SUBDIRECTORY ROOT_DIRECTORY DIRECTORY_SUFFIX SUBDIRECTORY_NAME)
endfunction()
function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
file (GLOB FOUND_FILES "${BUILD_PATCH}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
endif()
file (GLOB ORIGIN_FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
foreach (ORIGIN_FILE ${ORIGIN_FILES})
# check for existence of patched version of current file
if (NOT BUILD_PATCH OR NOT EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
list (APPEND FOUND_FILES ${ORIGIN_FILE})
else()
get_filename_component (ORIGIN_FILE_NAME "${ORIGIN_FILE}" NAME)
if (NOT EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}/${ORIGIN_FILE_NAME}")
list (APPEND FOUND_FILES ${ORIGIN_FILE})
endif()
endif()
endforeach()
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
set (${RESULT} ${ORIGIN_FILES} PARENT_SCOPE)
endfunction()
function (FILLUP_PRODUCT_SEARCH_TEMPLATE PRODUCT_NAME COMPILER COMPILER_BITNESS SEARCH_TEMPLATES)
@@ -249,32 +228,15 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
endfunction()
macro (OCCT_INSTALL_FILE_OR_DIR BEING_INSTALLED_OBJECT DESTINATION_PATH)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}")
if (IS_DIRECTORY "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}")
# first of all, install original files
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
# secondly, rewrite original files with patched ones
install (DIRECTORY "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
else()
install (FILES "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
else()
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
else()
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
endmacro()
macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME DESTINATION_PATH)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}")
configure_file("${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
endif()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME})
endmacro()
@@ -314,10 +276,7 @@ function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_I
return()
endif()
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES" OCCT_PACKAGE_FILES)
set (OCCT_PACKAGE_INCLUDE_DIR "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
if (EXISTS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES" OCCT_PACKAGE_FILES)
set (OCCT_PACKAGE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
endif()
@@ -331,15 +290,13 @@ function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_I
FIND_FOLDER_OR_FILE ("${RELATIVE_PATH}/${OCCT_PACKAGE}/${OCCT_FILE}" CUSTOM_FILE_PATH)
if (CUSTOM_FILE_PATH)
list (APPEND FILE_PATH_LIST "${CUSTOM_FILE_PATH}")
else()
message(WARNING "File ${OCCT_FILE} has not been found in ${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
endif()
endforeach()
if (NOT FILE_PATH_LIST)
if(BUILD_PATH)
message (WARNING "FILES has not been found in ${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
else()
message (WARNING "FILES has not been found in ${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
endif()
message (WARNING "FILES has not been found in ${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
endif()
set (${RESULT_FILES} ${FILE_PATH_LIST} PARENT_SCOPE)
@@ -412,9 +369,7 @@ endfunction()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
@@ -426,9 +381,6 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
# consider patched header.in template
set (TEMPLATE_HEADER_PATH "${CMAKE_SOURCE_DIR}/adm/templates/header.in")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/header.in")
set (TEMPLATE_HEADER_PATH "${BUILD_PATCH}/adm/templates/header.in")
endif()
set (OCCT_HEADER_FILES_COMPLETE)
foreach(OCCT_TOOLKIT ${THE_OCCT_BUILD_TOOLKITS})
@@ -437,9 +389,14 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
foreach(OCCT_PACKAGE ${USED_PACKAGES})
EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_PACKAGE} ALL_FILES _)
set (HEADER_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx)")
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx|hxx|pxx|hpp|gxx)$")
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
endforeach()
# parse root of the toolkit file
EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_TOOLKIT} ALL_FILES _)
set (HEADER_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx|hxx|pxx|hpp|gxx)$")
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
endforeach()
# Check that copying is done and match the include installation type.
@@ -477,7 +434,7 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
endforeach()
set (OCCT_HEADER_FILES_INSTALLATION ${OCCT_HEADER_FILES_COMPLETE})
list (FILTER OCCT_HEADER_FILES_INSTALLATION INCLUDE REGEX ".*[.](h|lxx)")
list (FILTER OCCT_HEADER_FILES_INSTALLATION INCLUDE REGEX ".*[.](h|hxx|lxx)$")
install (FILES ${OCCT_HEADER_FILES_INSTALLATION} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
endfunction()
@@ -497,10 +454,12 @@ function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER THE_IS_PRIVATE)
if (NOT BUILD_USE_PCH)
return()
endif()
# Angular bracket syntax is achieved using $<ANGLE-R> for closing bracket
if (${THE_IS_PRIVATE})
target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:<${PRECOMPILED_HEADER}$<ANGLE-R>>")
else()
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:<${PRECOMPILED_HEADER}$<ANGLE-R>>")
endif()
endfunction()
@@ -509,25 +468,14 @@ macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH)
if (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}")
file (COPY "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_COPIED_OBJECT}")
# secondly, rewrite original files with patched ones
file (COPY "${BUILD_PATCH}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
endmacro()
macro (OCCT_CONFIGURE BEING_CONGIRUGED_FILE FINAL_NAME)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}")
configure_file("${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
endif()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
endmacro()
macro (OCCT_ADD_SUBDIRECTORY BEING_ADDED_DIRECTORY)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
add_subdirectory(${BUILD_PATCH}/${BEING_ADDED_DIRECTORY})
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
if (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
add_subdirectory (${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY})
else()
message (STATUS "${BEING_ADDED_DIRECTORY} directory is not included")
@@ -762,7 +710,7 @@ macro (OCCT_UPDATE_TARGET_FILE)
install (CODE
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
file (GLOB ALL_OCCT_TARGET_FILES \"\$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
file (REMOVE \"\${TARGET_FILENAME}\")
@@ -906,12 +854,12 @@ function (PROCESS_CSF_LIBRARIES CURRENT_CSF LIST_NAME TARGET_NAME)
foreach (RELEASE_DIR ${FOUND_RELEASE_DIRS})
get_filename_component(RELEASE_DIR_ABS "${RELEASE_DIR}" ABSOLUTE)
target_link_directories(${TARGET_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${RELEASE_DIR_ABS}>;$<$<CONFIG:RELWITHDEBINFO>:${RELEASE_DIR_ABS}>")
target_link_directories(${TARGET_NAME} PRIVATE "$<$<CONFIG:RELEASE>:${RELEASE_DIR_ABS}>;$<$<CONFIG:RELWITHDEBINFO>:${RELEASE_DIR_ABS}>")
endforeach()
foreach (DEBUG_DIR ${FOUND_DEBUG_DIRS})
get_filename_component(DEBUG_DIR_ABS "${DEBUG_DIR}" ABSOLUTE)
target_link_directories(${TARGET_NAME} PUBLIC "$<$<CONFIG:DEBUG>:${DEBUG_DIR_ABS}>")
target_link_directories(${TARGET_NAME} PRIVATE "$<$<CONFIG:DEBUG>:${DEBUG_DIR_ABS}>")
endforeach()
endfunction()
macro(OCCT_ADD_VCPKG_FEATURE THE_FEATURE)

View File

@@ -63,13 +63,13 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (HEADER_FILES_FILTERING ${ALL_FILES})
set (SOURCE_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|p|g|lxx)")
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|p|g|lxx|hxx|pxx|hpp|gxx)$")
if(APPLE)
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|mm)")
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|cxx|cpp|mm)$")
else()
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c)")
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|cpp|cxx)$")
endif()
list (APPEND HEADER_FILES ${HEADER_FILES_FILTERING})
@@ -96,12 +96,7 @@ string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
set (USED_RCFILE "")
if (MSVC)
set (USED_RCFILE "${CMAKE_BINARY_DIR}/resources/${PROJECT_NAME}.rc")
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in")
configure_file("${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
endif()
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
endif()
set (CURRENT_MODULE)
@@ -134,7 +129,7 @@ if (EXECUTABLE_PROJECT)
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (MSVC)
if (MSVC AND BUILD_SHARED_LIBS)
if (BUILD_FORCE_RelWithDebInfo)
set (aReleasePdbConf "Release")
else()
@@ -281,19 +276,18 @@ else()
endif()
endif()
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
target_link_libraries (${PROJECT_NAME} PUBLIC ${USED_TOOLKITS_BY_CURRENT_PROJECT} PRIVATE ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
if (USE_QT)
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG})
target_link_libraries (${PROJECT_NAME} PRIVATE debug ${PROJECT_LIBRARY_DEBUG})
endforeach()
foreach (PROJECT_LIBRARY_RELEASE ${PROJECT_LIBRARIES_RELEASE})
target_link_libraries (${PROJECT_NAME} optimized ${PROJECT_LIBRARY_RELEASE})
target_link_libraries (${PROJECT_NAME} PRIVATE optimized ${PROJECT_LIBRARY_RELEASE})
endforeach()
endif()

View File

@@ -31,13 +31,26 @@ if (NOT ${Qt5_FOUND})
# Now we can apply standard CMake finder for Qt. We do this mostly
# to have qt4_wrap_cpp() function available
find_package(Qt4)
else()
set (3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
elseif(NOT ${USE_QT_FROM_3RDPARTY_DIR} AND WIN32)
# Qt5_DIR typically points to lib/cmake/Qt5, need to go up to Qt root
get_filename_component(QT_CMAKE_DIR "${Qt5_DIR}" DIRECTORY)
get_filename_component(QT_LIB_DIR "${QT_CMAKE_DIR}" DIRECTORY)
get_filename_component(QT_ROOT_DIR "${QT_LIB_DIR}" DIRECTORY)
# Verify this is indeed the Qt root by checking for bin and packages directories
if(EXISTS "${QT_ROOT_DIR}/bin")
set(3RDPARTY_QT_DIR ${QT_ROOT_DIR} CACHE PATH "The directory containing Qt" FORCE)
else()
message(WARNING "Found Qt5 at ${Qt5_DIR} but could not determine Qt root directory with bin/ and plugins/ folders")
set(3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
endif()
elseif(NOT ${USE_QT_FROM_3RDPARTY_DIR})
set(3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
endif()
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}")
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}/bin")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_QT_DLL_DIR)

View File

@@ -71,7 +71,12 @@ if (WIN32)
# Get installed configuration of tbb
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
# Prioritize RELEASE configuration if available
if (";${TARGET_TBB_IMPORT_CONFS};" MATCHES ";RELEASE;")
set (CHOSEN_IMPORT_CONF "RELEASE")
else()
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
endif()
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
@@ -204,7 +209,12 @@ else ()
# Get installed configuration of tbb
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
# Prioritize RELEASE configuration if available
if (";${TARGET_TBB_IMPORT_CONFS};" MATCHES ";RELEASE;")
set (CHOSEN_IMPORT_CONF "RELEASE")
else()
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
endif()
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)

View File

@@ -1,13 +1,5 @@
# variable description
#
set (BUILD_PATCH_DESCR
"Points to the directory recognized as a 'patch' for OCCT. If specified,
the files from this directory take precedence over the corresponding native
OCCT sources. This way you are able to introduce patches to Open CASCADE
Technology not affecting the original source distribution")
set (BUILD_LIBRARY_TYPE_DESCR
"Specifies the type of library to be created. 'Shared' libraries
are linked dynamically and loaded at runtime. 'Static' libraries

View File

@@ -18,5 +18,4 @@
set (OCC_VERSION_MAJOR 7 )
set (OCC_VERSION_MINOR 9 )
set (OCC_VERSION_MAINTENANCE 0 )
set (OCC_VERSION_DEVELOPMENT )
set (OCC_VERSION_MAINTENANCE 1 )

View File

@@ -2,8 +2,20 @@
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package(VTK REQUIRED)
set(CSF_VTK VTK::CommonCore)
find_package(VTK REQUIRED
COMPONENTS
CommonCore
RenderingUI
RenderingOpenGL2
OPTIONAL_COMPONENTS
mpi
utf8
eigen
doubleconversion
lz4
lzma
expat
)
set(IS_VTK_9XX 1)
if (WIN32)
set (USED_3RDPARTY_VTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
@@ -74,7 +86,20 @@ if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (ENV{VTK_DIR} "${3RDPARTY_VTK_DIR}")
endif()
find_package(VTK QUIET)
find_package(VTK QUIET
COMPONENTS
CommonCore
RenderingUI
RenderingOpenGL2
OPTIONAL_COMPONENTS
mpi
utf8
eigen
doubleconversion
lz4
lzma
expat
)
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (ENV{VTK_DIR} ${CACHED_VTK_DIR})

View File

@@ -784,7 +784,7 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
puts $doxyFile "PROJECT_NUMBER = $occt_version"
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
puts $doxyFile "GENERATE_TAGFILE = $outDir/${name}.tag"
set searchMode "local"
if { [string tolower $searchMode] == "none" } {
puts $doxyFile "SEARCHENGINE = NO"
puts $doxyFile "SERVER_BASED_SEARCH = NO"
@@ -865,6 +865,7 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
puts $doxyFile "TAGFILES = $tagFileDir/OCCT.tag=../../refman/html"
}
}
set searchMode "local"
# HTML Search engine options
if { [string tolower $searchMode] == "none" } {
puts $doxyFile "SEARCHENGINE = NO"

View File

@@ -28,9 +28,6 @@ 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_DETools=OFF

View File

@@ -21,9 +21,6 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
# 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_DETools=OFF

View File

@@ -19,7 +19,6 @@ set BUILD_ADDITIONAL_TOOLKITS=
set BUILD_DOC_Overview=OFF
set BUILD_Inspector=OFF
set BUILD_LIBRARY_TYPE=Shared
set BUILD_PATCH=
set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
set BUILD_WITH_DEBUG=OFF
set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
@@ -69,7 +68,6 @@ cmake -G "%arch_compile%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^
-D BUILD_MODULE_ModelingData:BOOL=%BUILD_MODULE_ModelingData% ^
-D BUILD_MODULE_Visualization:BOOL=%BUILD_MODULE_Visualization% ^
-D BUILD_PATCH:PATH="%BUILD_PATCH%" ^
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=%BUILD_RELEASE_DISABLE_EXCEPTIONS% ^
-D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^

View File

@@ -24,7 +24,6 @@ BUILD_ADDITIONAL_TOOLKITS=
BUILD_DOC_Overview=OFF
BUILD_Inspector=OFF
BUILD_LIBRARY_TYPE=Shared
BUILD_PATCH=
BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
BUILD_WITH_DEBUG=OFF
BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
@@ -70,7 +69,6 @@ cmake -G "Unix Makefiles" \
-D BUILD_MODULE_ModelingAlgorithms:BOOL=$BUILD_MODULE_ModelingAlgorithms \
-D BUILD_MODULE_ModelingData:BOOL=$BUILD_MODULE_ModelingData \
-D BUILD_MODULE_Visualization:BOOL=$BUILD_MODULE_Visualization \
-D BUILD_PATCH:PATH="$BUILD_PATCH" \
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=$BUILD_RELEASE_DISABLE_EXCEPTIONS \
-D BUILD_WITH_DEBUG:BOOL=$BUILD_WITH_DEBUG \
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=$BUILD_ENABLE_FPE_SIGNAL_HANDLER \

View File

@@ -27,7 +27,7 @@ get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$")
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
endif()
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$")
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib(32|64)?$")
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
endif()
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_ANDROID_ARCH_ABI}$")

View File

@@ -47,6 +47,9 @@ ENUM_VALUES_PER_LINE = 8
TREEVIEW_WIDTH = 250
EXTERNAL_PAGES = NO
SEARCHDATA_FILE = searchdata.xml
SERVER_BASED_SEARCH = NO
SEARCHENGINE = YES
EXTERNAL_SEARCH = NO
SKIP_FUNCTION_MACROS = YES
FORMULA_FONTSIZE = 12
FORMULA_TRANSPARENT = YES

View File

@@ -24,15 +24,15 @@ This guide principally deals with the following OCCT classes:
| CAD format | Extensions | RW support | Thread Safety | Presentation | Package |
| :--------- | :--------- | :--------- | :----------- | :----------- | :------ |
| STEP | .stp, .step .stepz | RW | No | BRep, Mesh | STEPCAFControl |
| XCAF | .xbf | RW | Yes | BRep, Mesh | DEXCAFCascade |
| BREP | .brep | RW | Yes | BRep, Mesh | DEBRepCascade |
| IGES | .igs, .iges | RW | No | BRep | IGESCAFControl |
| OBJ | .obj | RW | Yes | Mesh | RWObj |
| STL | .stl | RW | Yes | Mesh | RWStl |
| PLY | .ply | W | Yes | Mesh | RWPly |
| GLTF | .glTF .glb | RW | Yes | Mesh | RWGltf |
| VRML | .wrl .vrml | RW | Yes | Mesh | Vrml |
| STEP | .stp, .step .stepz | RW | No | BRep, Mesh | DESTEP |
| XCAF | .xbf | RW | Yes | BRep, Mesh | DEXCAF |
| BREP | .brep | RW | Yes | BRep, Mesh | DEBREP |
| IGES | .igs, .iges | RW | No | BRep | DEIGES |
| OBJ | .obj | RW | Yes | Mesh | DEOBJ |
| STL | .stl | RW | Yes | Mesh | DESTL |
| PLY | .ply | W | Yes | Mesh | DEPLY |
| GLTF | .glTF .glb | RW | Yes | Mesh | DEGLTF |
| VRML | .wrl .vrml | RW | Yes | Mesh | DEVRML |
**Note** :
* The format names in the first column match the FormatName values used for configuration nodes.
@@ -41,7 +41,7 @@ This guide principally deals with the following OCCT classes:
@section occt_de_wrapper_3 DE Session Configuration
Any providers can have their own read/write parameters. The transfer process is set up using DE configuration nodes, which hold all relevant parameters. There are two ways to change the parameter values: directly from code or by an external resource file/string.
The session is a global or static DE_Wrapper object that stores registered DE configuration nodes and wraps DE commands to work with them. It has some configuration parameters of its own and also keeps track of loaded nodes and specilal global parameters.
The session is a global or static DE_Wrapper object that stores registered DE configuration nodes and wraps DE commands to work with them. It has some configuration parameters of its own and also keeps track of loaded nodes and special global parameters.
@subsection occt_de_wrapper_3_1 Getting a DE session. Code sample

View File

@@ -735,6 +735,8 @@ const Bnd_Box& AIS_Shape::BoundingBox()
if (myCompBB)
{
// Clear the bounding box to re-compute it.
myBB.SetVoid();
BRepBndLib::Add(myshape, myBB, false);
myCompBB = Standard_False;
}

View File

@@ -695,8 +695,21 @@ bool AIS_ViewController::UpdateMouseButtons(const Graphic3d_Vec2i& thePoint,
if (double(aDelta.cwiseAbs().maxComp()) < aTolClick)
{
++myMouseClickCounter;
const bool isDoubleClick = myMouseClickCounter == 2 && myMouseClickTimer.IsStarted()
&& myMouseClickTimer.ElapsedTime() <= myMouseDoubleClickInt;
const bool isCounterValid = myMouseClickCounter == 2;
const bool isTimerStarted = myMouseClickTimer.IsStarted();
const bool isTimerElapsed = myMouseClickTimer.ElapsedTime() > myMouseDoubleClickInt;
const bool isTimerValid = isTimerStarted && !isTimerElapsed;
const bool isDoubleClick = isCounterValid && isTimerValid;
if (!isTimerValid)
{
myMouseClickCounter = 1;
}
myMouseClickCounter %= 2;
myMouseClickTimer.Stop();
myMouseClickTimer.Reset();

View File

@@ -47,6 +47,9 @@
#include <BRepLib.hxx>
#include <BRepTools.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <Geom_OffsetSurface.hxx>
#include <Geom2d_Curve.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
@@ -76,11 +79,62 @@
#include <TopTools_DataMapOfShapeInteger.hxx>
#include <TopTools_ListOfShape.hxx>
//
static Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1,
const BRepAdaptor_Surface& aBAS2);
/////////////////////////////////////////////////////////////////////////
//=================================================================================================
static Standard_Boolean IsPlaneFF(const Handle(Geom_Surface)& theSurface)
{
if (theSurface->IsKind(STANDARD_TYPE(Geom_Plane)))
{
return Standard_True;
}
else if (const Handle(Geom_OffsetSurface) anOffsetSurface =
Handle(Geom_OffsetSurface)::DownCast(theSurface))
{
return anOffsetSurface->BasisSurface()->IsKind(STANDARD_TYPE(Geom_Plane));
}
else if (const Handle(Geom_RectangularTrimmedSurface) aTrimmedSurface =
Handle(Geom_RectangularTrimmedSurface)::DownCast(theSurface))
{
return aTrimmedSurface->BasisSurface()->IsKind(STANDARD_TYPE(Geom_Plane));
}
return Standard_False;
}
//=================================================================================================
static Standard_Boolean IsClosedFF(const TopoDS_Edge& theEdge,
const Handle(Geom_Surface)& theSurface,
const Handle(Poly_Triangulation)& theTriangulation,
const TopLoc_Location& theLocation,
Standard_Boolean theIsPlane)
{
if (!theIsPlane)
{
// Check surface
const TopLoc_Location aLocation = theLocation.Predivided(theEdge.Location());
// find the representation
const BRep_TEdge* aTEdge = static_cast<const BRep_TEdge*>(theEdge.TShape().get());
for (BRep_ListIteratorOfListOfCurveRepresentation anIter(aTEdge->Curves()); anIter.More();
anIter.Next())
{
const Handle(BRep_CurveRepresentation)& aCurveRepresentation = anIter.Value();
if (aCurveRepresentation->IsCurveOnSurface(theSurface, aLocation)
&& aCurveRepresentation->IsCurveOnClosedSurface())
{
return Standard_True;
}
}
}
// Check triangulation
return BRep_Tool::IsClosed(theEdge, theTriangulation, theLocation);
}
//=================================================================================================
class BOPAlgo_FaceFace : public IntTools_FaceFace, public BOPAlgo_ParallelAlgo
@@ -225,11 +279,10 @@ protected:
gp_Trsf myTrsf;
};
//
//=======================================================================
//=================================================================================================
typedef NCollection_Vector<BOPAlgo_FaceFace> BOPAlgo_VectorOfFaceFace;
/////////////////////////////////////////////////////////////////////////
//=================================================================================================
void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
@@ -354,59 +407,82 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
if (aBAS1.GetType() != GeomAbs_Plane || aBAS2.GetType() != GeomAbs_Plane)
{
TopLoc_Location aLocation1;
const Handle(Geom_Surface)& aSurface1 = BRep_Tool::Surface(aF1, aLocation1);
const Handle(Poly_Triangulation)& aTriangulation1 =
BRep_Tool::Triangulation(aF1, aLocation1);
const Standard_Boolean anIsPlane1 = IsPlaneFF(aSurface1);
Standard_Boolean isFound = Standard_False;
for (TopExp_Explorer aExp1(aF1, TopAbs_EDGE); !isFound && aExp1.More(); aExp1.Next())
TopLoc_Location aLocation2;
const Handle(Geom_Surface)& aSurface2 = BRep_Tool::Surface(aF2, aLocation2);
const Handle(Poly_Triangulation)& aTriangulation2 =
BRep_Tool::Triangulation(aF2, aLocation2);
const Standard_Boolean anIsPlane2 = IsPlaneFF(aSurface2);
Standard_Boolean anIsFound = Standard_False;
for (TopoDS_Iterator aItW1(aF1); !anIsFound && aItW1.More(); aItW1.Next())
{
const TopoDS_Edge& aE1 = TopoDS::Edge(aExp1.Current());
const Standard_Integer nE1 = myDS->Index(aE1);
for (TopExp_Explorer aExp2(aF2, TopAbs_EDGE); !isFound && aExp2.More(); aExp2.Next())
for (TopoDS_Iterator aItE1(aItW1.Value()); !anIsFound && aItE1.More(); aItE1.Next())
{
const TopoDS_Edge& aE2 = TopoDS::Edge(aExp2.Current());
const Standard_Integer nE2 = myDS->Index(aE2);
const TopoDS_Edge& anEdge1 = TopoDS::Edge(aItE1.Value());
const Standard_Integer anEdgeIndex1 = myDS->Index(anEdge1);
Standard_Boolean bIsClosed1 = BRep_Tool::IsClosed(aE1, aF1);
Standard_Boolean bIsClosed2 = BRep_Tool::IsClosed(aE2, aF2);
if (!bIsClosed1 && !bIsClosed2)
for (TopoDS_Iterator aItW2(aF2); !anIsFound && aItW2.More(); aItW2.Next())
{
continue;
}
const TColStd_ListOfInteger* pPoints = aEEMap.Seek(BOPDS_Pair(nE1, nE2));
if (!pPoints)
{
continue;
}
for (TColStd_ListOfInteger::Iterator itEEP(*pPoints); itEEP.More(); itEEP.Next())
{
const Standard_Integer& nVN = itEEP.Value();
const TopoDS_Vertex& aVN = TopoDS::Vertex(myDS->Shape(nVN));
const gp_Pnt& aPnt = BRep_Tool::Pnt(aVN);
// Compute points exactly on the edges
GeomAPI_ProjectPointOnCurve& aProjPC1 = myContext->ProjPC(aE1);
GeomAPI_ProjectPointOnCurve& aProjPC2 = myContext->ProjPC(aE2);
aProjPC1.Perform(aPnt);
aProjPC2.Perform(aPnt);
if (!aProjPC1.NbPoints() && !aProjPC2.NbPoints())
for (TopoDS_Iterator aItE2(aItW2.Value()); !anIsFound && aItE2.More(); aItE2.Next())
{
continue;
}
gp_Pnt aP1 = aProjPC1.NbPoints() > 0 ? aProjPC1.NearestPoint() : aPnt;
gp_Pnt aP2 = aProjPC2.NbPoints() > 0 ? aProjPC2.NearestPoint() : aPnt;
const TopoDS_Edge& anEdge2 = TopoDS::Edge(aItE2.Value());
const Standard_Integer anEdgeIndex2 = myDS->Index(anEdge2);
Standard_Real aShiftDist = aP1.Distance(aP2);
if (aShiftDist > BRep_Tool::Tolerance(aVN))
{
// Move one of the faces to the point of exact intersection of edges
gp_Trsf aTrsf;
aTrsf.SetTranslation(bIsClosed1 ? gp_Vec(aP1, aP2) : gp_Vec(aP2, aP1));
TopLoc_Location aLoc(aTrsf);
(bIsClosed1 ? &aFShifted1 : &aFShifted2)->Move(aLoc);
aShiftValue = aShiftDist;
isFound = Standard_True;
const Standard_Boolean anIsClosed1 =
IsClosedFF(anEdge1, aSurface1, aTriangulation1, aLocation1, anIsPlane1);
const Standard_Boolean anIsClosed2 =
IsClosedFF(anEdge2, aSurface2, aTriangulation2, aLocation2, anIsPlane2);
if (!anIsClosed1 && !anIsClosed2)
{
continue;
}
const TColStd_ListOfInteger* aVertexIndices =
aEEMap.Seek(BOPDS_Pair(anEdgeIndex1, anEdgeIndex2));
if (!aVertexIndices)
{
continue;
}
for (TColStd_ListOfInteger::Iterator itEEP(*aVertexIndices); itEEP.More();
itEEP.Next())
{
const Standard_Integer aVertexIndex = itEEP.Value();
const TopoDS_Vertex& aVertex = TopoDS::Vertex(myDS->Shape(aVertexIndex));
const gp_Pnt& aVertexPoint = BRep_Tool::Pnt(aVertex);
// Compute points exactly on the edges
GeomAPI_ProjectPointOnCurve& aProjPC1 = myContext->ProjPC(anEdge1);
GeomAPI_ProjectPointOnCurve& aProjPC2 = myContext->ProjPC(anEdge2);
aProjPC1.Perform(aVertexPoint);
aProjPC2.Perform(aVertexPoint);
if (!aProjPC1.NbPoints() && !aProjPC2.NbPoints())
{
continue;
}
const gp_Pnt aP1 =
aProjPC1.NbPoints() > 0 ? aProjPC1.NearestPoint() : aVertexPoint;
const gp_Pnt aP2 =
aProjPC2.NbPoints() > 0 ? aProjPC2.NearestPoint() : aVertexPoint;
const Standard_Real aShiftDist = aP1.Distance(aP2);
if (aShiftDist > BRep_Tool::Tolerance(aVertex))
{
// Move one of the faces to the point of exact intersection of edges
gp_Trsf aTrsf;
aTrsf.SetTranslation(anIsClosed1 ? gp_Vec(aP1, aP2) : gp_Vec(aP2, aP1));
TopLoc_Location aLoc(aTrsf);
(anIsClosed1 ? &aFShifted1 : &aFShifted2)->Move(aLoc);
aShiftValue = aShiftDist;
anIsFound = Standard_True;
}
}
}
}
}

View File

@@ -277,14 +277,9 @@ const TopoDS_Shape& BOPDS_DS::Shape(const Standard_Integer theI) const
Standard_Integer BOPDS_DS::Index(const TopoDS_Shape& theS) const
{
Standard_Integer iRet;
//
iRet = -1;
if (myMapShapeIndex.IsBound(theS))
{
iRet = myMapShapeIndex.Find(theS);
}
return iRet;
Standard_Integer anIndex = -1;
myMapShapeIndex.Find(theS, anIndex);
return anIndex;
}
//=================================================================================================

View File

@@ -795,6 +795,11 @@ Standard_Boolean BRep_Tool::IsClosed(const TopoDS_Edge& E,
const Handle(Poly_Triangulation)& T,
const TopLoc_Location& L)
{
if (T.IsNull())
{
return Standard_False;
}
TopLoc_Location l = L.Predivided(E.Location());
// find the representation

View File

@@ -70,6 +70,11 @@ Handle(Adaptor3d_Surface) BRepAdaptor_Surface::ShallowCopy() const
void BRepAdaptor_Surface::Initialize(const TopoDS_Face& F, const Standard_Boolean Restriction)
{
if (F.IsNull())
{
return;
}
myFace = F;
TopLoc_Location L;
const Handle(Geom_Surface)& aSurface = BRep_Tool::Surface(F, L);

View File

@@ -619,8 +619,13 @@ void FindExactUVBounds(const TopoDS_Face& FF,
BndLib_Add2dCurve::AddOptimal(aC2D, aT1, aT2, TolUV, aBox);
//
}
//
aBox.Get(umin, vmin, umax, vmax);
// In some cases no edges are found
if (!aBox.IsVoid())
{
aBox.Get(umin, vmin, umax, vmax);
}
//
TopLoc_Location aLoc;
Handle(Geom_Surface) aS = BRep_Tool::Surface(FF, aLoc);

View File

@@ -317,6 +317,13 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferShape(
Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferEdge(const TopoDS_Edge& myedge)
{
Standard_Integer anInd = IndexEdge(myedge);
if (anInd != 0)
{
Handle(IGESData_IGESEntity) ICurve3d = Handle(IGESData_IGESEntity)::DownCast(myCurves(anInd));
if (!ICurve3d.IsNull())
return ICurve3d;
}
BRepToIGES_BRWire BR(*this);
BR.SetModel(GetModel());
TopTools_DataMapOfShapeShape anEmptyMap;

View File

@@ -508,24 +508,25 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygon(const TopoDS_Edg
return Standard_False;
}
// update parameters of polygon
if (thePoly->HasParameters())
if (!thePoly->HasParameters())
{
Standard_Real aTol = BRep_Tool::Tolerance(theEdge);
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast);
Handle(Geom_Curve) aNewCurve = newCurve(myMap, theEdge, aFirst, aLast);
if (aCurve.IsNull() || aNewCurve.IsNull()) // skip processing degenerated edges
{
return Standard_False;
}
TColStd_Array1OfReal& aParams = thePoly->ChangeParameters();
for (Standard_Integer anInd = aParams.Lower(); anInd <= aParams.Upper(); ++anInd)
{
Standard_Real& aParam = aParams(anInd);
gp_Pnt aPoint = aCurve->Value(aParam);
newParameter(aPoint, aNewCurve, aFirst, aLast, aTol, aParam);
}
return Standard_False;
}
// update parameters of polygon
Standard_Real aTol = BRep_Tool::Tolerance(theEdge);
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast);
Handle(Geom_Curve) aNewCurve = newCurve(myMap, theEdge, aFirst, aLast);
if (aCurve.IsNull() || aNewCurve.IsNull()) // skip processing degenerated edges
{
return Standard_False;
}
TColStd_Array1OfReal& aParams = thePoly->ChangeParameters();
for (Standard_Integer anInd = aParams.Lower(); anInd <= aParams.Upper(); ++anInd)
{
Standard_Real& aParam = aParams(anInd);
gp_Pnt aPoint = aCurve->Value(aParam);
newParameter(aPoint, aNewCurve, aFirst, aLast, aTol, aParam);
}
return Standard_True;
}

View File

@@ -216,8 +216,33 @@ void BndLib_Add3dCurve::Add(const Adaptor3d_Curve& C,
// modified by NIZHNY-EAP Fri Dec 3 14:29:18 1999 ___END___
}
Standard_Real aSegmentTol = 2. * Precision::PConfusion();
if (Abs(u2 - u1) < aSegmentTol)
// For periodic curves, check if parameters are close in either direction
if (Bsaux->IsPeriodic())
{
const Standard_Real aPeriod = Bsaux->LastParameter() - Bsaux->FirstParameter();
// Check direct distance between parameters
const Standard_Real aDirectDiff = Abs(u2 - u1);
// Check distances across period boundary (in both directions)
const Standard_Real aCrossPeriodDiff1 = Abs(u2 - aPeriod - u1);
const Standard_Real aCrossPeriodDiff2 = Abs(u1 - aPeriod - u2);
// Find the minimum difference (closest approach)
const Standard_Real aMinDiff =
Min(aDirectDiff, Min(aCrossPeriodDiff1, aCrossPeriodDiff2));
if (aMinDiff < aSegmentTol)
{
aSegmentTol = aMinDiff * 0.01;
}
}
// For non-periodic curves, just check direct parameter difference
else if (Abs(u2 - u1) < aSegmentTol)
{
aSegmentTol = Abs(u2 - u1) * 0.01;
}
Bsaux->Segment(u1, u2, aSegmentTol);
Bs = Bsaux;
}

View File

@@ -1097,22 +1097,23 @@ static void ChFi3d_BuildPlane(TopOpeBRepDS_DataStructure& DStr,
const Standard_Boolean isfirst,
const Standard_Integer ons)
{
Handle(Geom2d_Curve) Hc;
TopoDS_Face F = TopoDS::Face(DStr.Shape(SD->Index(ons)));
Standard_Real u, v;
gp_Pnt P;
// gp_Vec V1,V2;
const TopoDS_Face F = TopoDS::Face(DStr.Shape(SD->Index(ons)));
if (F.IsNull())
{
return;
}
if (SD->Vertex(isfirst, ons).IsOnArc())
{
Hc = BRep_Tool::CurveOnSurface(SD->Vertex(isfirst, ons).Arc(), F, u, v);
Standard_Real u, v;
const Handle(Geom2d_Curve) Hc =
BRep_Tool::CurveOnSurface(SD->Vertex(isfirst, ons).Arc(), F, u, v);
Hc->Value(SD->Vertex(isfirst, ons).ParameterOnArc()).Coord(u, v);
BRepLProp_SLProps theProp(*HS, u, v, 1, 1.e-12);
if (theProp.IsNormalDefined())
{
P = theProp.Value();
Handle(Geom_Plane) Pln = new Geom_Plane(P, theProp.Normal());
TopoDS_Face NewF = BRepLib_MakeFace(Pln, Precision::Confusion());
const Handle(Geom_Plane) Pln = new Geom_Plane(theProp.Value(), theProp.Normal());
TopoDS_Face NewF = BRepLib_MakeFace(Pln, Precision::Confusion());
NewF.Orientation(F.Orientation());
pons.SetCoord(0., 0.);
HS->Initialize(NewF);

View File

@@ -8,6 +8,5 @@ DE_Provider.hxx
DE_ShapeFixConfigurationNode.cxx
DE_ShapeFixConfigurationNode.hxx
DE_ShapeFixParameters.hxx
DE_ShapeFixParameters.cxx
DE_Wrapper.cxx
DE_Wrapper.hxx

View File

@@ -62,7 +62,7 @@ bool DEGLTF_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theRe
% 2);
InternalParameters.FileCS =
(RWMesh_CoordinateSystem)(theResource->IntegerVal("file.cs",
(int)InternalParameters.SystemCS,
(int)InternalParameters.FileCS,
aScope)
% 2);

View File

@@ -61,7 +61,7 @@ bool DEOBJ_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theRes
% 2);
InternalParameters.FileCS =
(RWMesh_CoordinateSystem)(theResource->IntegerVal("file.cs",
(int)InternalParameters.SystemCS,
(int)InternalParameters.FileCS,
aScope)
% 2);

View File

@@ -62,7 +62,7 @@ bool DEPLY_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theRes
% 2);
InternalParameters.FileCS =
(RWMesh_CoordinateSystem)(theResource->IntegerVal("file.cs",
(int)InternalParameters.SystemCS,
(int)InternalParameters.FileCS,
aScope)
% 2);

View File

@@ -1,5 +1,5 @@
exptocas.lex
expltocas.yacc
exptocas.yacc
lex.exptocas.cxx
exptocas.tab.hxx
exptocas.tab.cxx

View File

@@ -34,8 +34,8 @@
//=======================================================================
// function : Arrange
// purpose : Internal Use Only
// This function is used to prepare the Filling: The Curves
// are arranged in this way:
// This function is used to prepare the Filling: The Curves
// are arranged in this way:
// CC3
// ----->-----
// | |
@@ -46,6 +46,10 @@
// | |
// ----->-----
// CC1 = C1
//
// In case a curve CCx is degenerated to start and end at
// the same point, it is inserted before the curvature leaves
// the point.
//=======================================================================
static Standard_Boolean Arrange(const Handle(Geom_BSplineCurve)& C1,
const Handle(Geom_BSplineCurve)& C2,
@@ -70,26 +74,51 @@ static Standard_Boolean Arrange(const Handle(Geom_BSplineCurve)& C1,
for (i = 1; i <= 3; i++)
{
Trouve = Standard_False;
// search for a degenerated curve = point, which would match first
for (j = i; j <= 3 && !Trouve; j++)
{
if (GC[j]->StartPoint().Distance(GC[i - 1]->EndPoint()) < Tol)
if (GC[j]->StartPoint().Distance(GC[j]->EndPoint()) < Tol)
{
Dummy = GC[i];
GC[i] = GC[j];
GC[j] = Dummy;
Trouve = Standard_True;
}
else if (GC[j]->EndPoint().Distance(GC[i - 1]->EndPoint()) < Tol)
{
GC[j] = Handle(Geom_BSplineCurve)::DownCast(GC[j]->Reversed());
Dummy = GC[i];
GC[i] = GC[j];
GC[j] = Dummy;
Trouve = Standard_True;
// this is a degenerated line, does it match the last endpoint?
if (GC[j]->StartPoint().Distance(GC[i - 1]->EndPoint()) < Tol)
{
Dummy = GC[i];
GC[i] = GC[j];
GC[j] = Dummy;
Trouve = Standard_True;
}
}
}
// if no degenerated curve matched, try an ordinary one as next curve
if (!Trouve)
{
for (j = i; j <= 3 && !Trouve; j++)
{
if (GC[j]->StartPoint().Distance(GC[i - 1]->EndPoint()) < Tol)
{
Dummy = GC[i];
GC[i] = GC[j];
GC[j] = Dummy;
Trouve = Standard_True;
}
else if (GC[j]->EndPoint().Distance(GC[i - 1]->EndPoint()) < Tol)
{
GC[j] = Handle(Geom_BSplineCurve)::DownCast(GC[j]->Reversed());
Dummy = GC[i];
GC[i] = GC[j];
GC[j] = Dummy;
Trouve = Standard_True;
}
}
}
// if still non matched -> error, the algorithm cannot finish
if (!Trouve)
{
return Standard_False;
}
}
CC1 = GC[0];

View File

@@ -139,8 +139,13 @@ TCollection_AsciiString OSD_Host::InternetAddress()
char buffer[16];
TCollection_AsciiString result, host;
host = HostName();
memcpy(&internet_address, gethostbyname(host.ToCString()), sizeof(struct hostent));
host = HostName();
const auto* aHostByName = gethostbyname(host.ToCString());
if (aHostByName == nullptr)
{
aHostByName = gethostbyname("localhost");
}
memcpy(&internet_address, aHostByName, sizeof(struct hostent));
// Gets each bytes into integers
a = (unsigned char)internet_address.h_addr_list[0][0];

View File

@@ -165,18 +165,23 @@ void OSD_MemInfo::Update()
#elif (defined(__linux__) || defined(__linux))
if (IsActive(MemHeapUsage))
{
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
#if __GLIBC_PREREQ(2, 33)
#if defined(__GLIBC__)
#define HAS_MALLINFO
#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 33)
#define HAS_MALLINFO2
#endif
#endif
#ifdef HAS_MALLINFO2
#ifdef HAS_MALLINFO
#ifdef HAS_MALLINFO2
const struct mallinfo2 aMI = mallinfo2();
#else
#else
const struct mallinfo aMI = mallinfo();
#endif
#endif
myCounters[MemHeapUsage] = aMI.uordblks;
#else
myCounters[MemHeapUsage] = 0;
#endif
}
if (!IsActive(MemVirtual) && !IsActive(MemWorkingSet) && !IsActive(MemWorkingSetPeak)

View File

@@ -769,7 +769,7 @@ typedef void (*SIG_PFV)(int);
#include <signal.h>
#if !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
#if !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__) && defined(__GLIBC__)
#include <sys/signal.h>
#endif
@@ -994,7 +994,7 @@ static void SegvHandler(const int theSignal,
void OSD::SetFloatingSignal(Standard_Boolean theFloatingSignal)
{
#if defined(__linux__)
#if defined(__linux__) && defined(__GLIBC__)
feclearexcept(FE_ALL_EXCEPT);
if (theFloatingSignal)
{
@@ -1025,7 +1025,7 @@ void OSD::SetFloatingSignal(Standard_Boolean theFloatingSignal)
Standard_Boolean OSD::ToCatchFloatingSignals()
{
#if defined(__linux__)
#if defined(__linux__) && defined(__GLIBC__)
return (fegetexcept() & _OSD_FPX) != 0;
#else
return Standard_False;

View File

@@ -3286,20 +3286,11 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
if (theGDTL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aTol))
{
Handle(XCAFDimTolObjects_GeomToleranceObject) anObj = aTol->GetObject();
Handle(TColStd_HArray1OfReal) aDirArr = anAx->Axis()->DirectionRatios();
Handle(TColStd_HArray1OfReal) aDirRArr = anAx->RefDirection()->DirectionRatios();
Handle(TColStd_HArray1OfReal) aLocArr = anAx->Location()->Coordinates();
gp_Dir aDir;
gp_Dir aDirR;
gp_Pnt aPnt;
if (!aDirArr.IsNull() && aDirArr->Length() > 2 && !aDirRArr.IsNull()
&& aDirRArr->Length() > 2 && !aLocArr.IsNull() && aLocArr->Length() > 2)
const Handle(Geom_Axis2Placement) aGeomAx2 =
StepToGeom::MakeAxis2Placement(anAx, theLocalFactors);
if (!aGeomAx2.IsNull())
{
aDir.SetCoord(aDirArr->Lower(), aDirArr->Lower() + 1, aDirArr->Lower() + 2);
aDirR.SetCoord(aDirRArr->Lower(), aDirRArr->Lower() + 1, aDirRArr->Lower() + 2);
aPnt.SetCoord(aLocArr->Lower(), aLocArr->Lower() + 1, aLocArr->Lower() + 2);
gp_Ax2 anA(aPnt, aDir, aDirR);
anObj->SetAxis(anA);
anObj->SetAxis(aGeomAx2->Ax2());
aTol->SetObject(anObj);
}
}

View File

@@ -24,7 +24,7 @@ static Standard_CString schemaAP214DIS = "AUTOMOTIVE_DESIGN { 1 2 10303 214 0 1
static Standard_CString schemaAP214IS = "AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }";
static Standard_CString schemaAP203 = "CONFIG_CONTROL_DESIGN";
static Standard_CString schemaAP242DIS =
"AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF. {1 0 10303 442 1 1 4 }";
"AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF {1 0 10303 442 1 1 4 }";
#include <HeaderSection_Protocol.hxx>
#include <StepData_StepModel.hxx>

View File

@@ -33,6 +33,7 @@
#include <StepData_SelectReal.hxx>
#include <StepData_SelectType.hxx>
#include <StepData_StepReaderData.hxx>
#include <NCollection_IncAllocator.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <NCollection_UtfIterator.hxx>
@@ -387,28 +388,11 @@ void StepData_StepReaderData::SetRecord(const Standard_Integer num,
const Standard_Integer /* nbpar */)
{
Standard_Integer numlst;
/*
if (strcmp(type,"/ * (SUB) * /") == 0) { // defini dans recfile.pc
thetypes.SetValue (num,sublist);
} else {
thenbents ++; // total de termes propres du fichier
thetypes.SetValue(num,TCollection_AsciiString(type));
// if (strcmp(ident,"SCOPE") != 0) thenbscop ++; // ?? a verifier
}
*/
if (type[0] != '(')
thenbents++; // total de termes propres du fichier
// thetypes.ChangeValue(num).SetValue(1,type); gka memory
//============================================
Standard_Integer index = 0;
TCollection_AsciiString strtype(type);
if (thenametypes.Contains(type))
index = thenametypes.FindIndex(strtype);
else
index = thenametypes.Add(strtype);
thetypes.ChangeValue(num) = index;
//===========================================
thetypes.ChangeValue(num) = thenametypes.Add(TCollection_AsciiString(type));
if (ident[0] == '$')
{
@@ -1998,12 +1982,14 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap)
// Passe initiale : Resolution directe par Map
// si tout passe (pas de collision), OK. Sinon, autres passes a prevoir
// On resoud du meme coup les sous-listes
Standard_Integer nbdirec = NbRecords();
Standard_Integer nbdirec = NbRecords();
Handle(NCollection_IncAllocator) anAlloc =
new NCollection_IncAllocator(NCollection_IncAllocator::THE_MINIMUM_BLOCK_SIZE);
TColStd_Array1OfInteger subn(0, thelastn);
Standard_Boolean pbmap = Standard_False; // au moins un conflit
Standard_Integer nbmap = 0;
TColStd_IndexedMapOfInteger imap(thenbents);
TColStd_IndexedMapOfInteger imap(thenbents, anAlloc);
TColStd_Array1OfInteger indm(0, nbdirec); // Index Map -> Record Number (seulement si map)
Standard_Integer num; // svv Jan11 2000 : porting on DEC
@@ -2099,10 +2085,11 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap)
Handle(TColStd_HArray1OfInteger) indx; // pour EXPORT (silya)
imap.Clear();
anAlloc->Reset();
Standard_Boolean iamap = withmap; // (par defaut True)
nbmap = 0;
TColStd_SequenceOfInteger scopile; // chainage des scopes note par pile
TColStd_SequenceOfInteger scopile(anAlloc); // chainage des scopes note par pile
Standard_Integer nr = 0;
for (num = 1; num <= nbdirec; num++)
{

View File

@@ -3,4 +3,4 @@ project(TKBRep)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKBRep "${CMAKE_CURRENT_SOURCE_DIR}/TKBRep_pch.hxx" FALSE)
ADD_PRECOMPILED_HEADER(TKBRep "TKBRep_pch.hxx" FALSE)

View File

@@ -1,2 +1,3 @@
EXTERNLIB
PACKAGES
TKBRep_pch.hxx

View File

@@ -3,4 +3,4 @@ project(TKDEIGES)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKDEIGES "${CMAKE_CURRENT_SOURCE_DIR}/TKDEIGES_pch.hxx" TRUE)
ADD_PRECOMPILED_HEADER(TKDEIGES "TKDEIGES_pch.hxx" TRUE)

View File

@@ -1,2 +1,3 @@
EXTERNLIB
PACKAGES
TKDEIGES_pch.hxx

View File

@@ -3,6 +3,6 @@ project(TKDESTEP)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKDESTEP "${CMAKE_CURRENT_SOURCE_DIR}/TKDESTEP_pch.hxx" TRUE)
ADD_PRECOMPILED_HEADER(TKDESTEP "TKDESTEP_pch.hxx" TRUE)
FLEX_AND_BISON_TARGET_APPLY ("StepFile" src)

View File

@@ -1,2 +1,3 @@
EXTERNLIB
PACKAGES
TKDESTEP_pch.hxx

View File

@@ -3,4 +3,4 @@ project(TKMath)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKMath "${CMAKE_CURRENT_SOURCE_DIR}/TKMath_pch.hxx" FALSE)
ADD_PRECOMPILED_HEADER(TKMath "TKMath_pch.hxx" FALSE)

View File

@@ -1,2 +1,3 @@
EXTERNLIB
PACKAGES
TKMath_pch.hxx

View File

@@ -3,4 +3,4 @@ project(TKMesh)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKMesh "${CMAKE_CURRENT_SOURCE_DIR}/TKMesh_pch.hxx" TRUE)
ADD_PRECOMPILED_HEADER(TKMesh "TKMesh_pch.hxx" TRUE)

View File

@@ -1,2 +1,3 @@
EXTERNLIB
PACKAGES
TKMesh_pch.hxx

View File

@@ -3,4 +3,4 @@ project(TKV3d)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKV3d "${CMAKE_CURRENT_SOURCE_DIR}/TKV3d_pch.hxx" TRUE)
ADD_PRECOMPILED_HEADER(TKV3d "TKV3d_pch.hxx" TRUE)

View File

@@ -1,2 +1,3 @@
EXTERNLIB
PACKAGES
TKV3d_pch.hxx

View File

@@ -3,4 +3,4 @@ project(TKXSBase)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKXSBase "${CMAKE_CURRENT_SOURCE_DIR}/TKXSBase_pch.hxx" TRUE)
ADD_PRECOMPILED_HEADER(TKXSBase "TKXSBase_pch.hxx" TRUE)

View File

@@ -1,2 +1,3 @@
EXTERNLIB
PACKAGES
TKXSBase_pch.hxx

View File

@@ -14,4 +14,4 @@ else ()
endif()
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKernel "${CMAKE_CURRENT_SOURCE_DIR}/TKernel_pch.hxx" FALSE)
ADD_PRECOMPILED_HEADER(TKernel "TKernel_pch.hxx" FALSE)

View File

@@ -1,2 +1,3 @@
EXTERNLIB
PACKAGES
TKernel_pch.hxx

View File

@@ -1,9 +1,4 @@
TopClass.cxx
TopClass_Classifier2d.gxx
TopClass_Classifier2d.lxx
TopClass_Classifier3d.gxx
TopClass_Classifier3d.lxx
TopClass_FaceClassifier.gxx
TopClass_FaceClassifier.lxx
TopClass_SolidExplorer.cxx
TopClass_SolidExplorer.hxx

View File

@@ -127,19 +127,30 @@ void XCAFDoc_AssemblyGraph::buildGraph(const TDF_Label& theLabel)
{
TDF_Label aLabel = it.Value();
TDF_Label anOriginal;
TDF_Label anOriginal;
Standard_Integer aRootId, anIdToProceed;
if (!myShapeTool->GetReferredShape(aLabel, anOriginal))
anOriginal = aLabel;
{
anOriginal = aLabel;
aRootId = addNode(anOriginal, 0);
anIdToProceed = aRootId;
}
else
{
aRootId = addNode(aLabel, 0);
if (aRootId == 0)
continue;
anIdToProceed = addNode(anOriginal, aRootId);
}
const Standard_Integer aRootId = addNode(anOriginal, 0);
if (aRootId == 0)
if (aRootId == 0 || anIdToProceed == 0)
continue;
myRoots.Add(aRootId);
// Add components (the objects nested into the current one).
if (myShapeTool->IsAssembly(anOriginal))
addComponents(anOriginal, aRootId);
addComponents(anOriginal, anIdToProceed);
}
}
@@ -208,7 +219,7 @@ Standard_Integer XCAFDoc_AssemblyGraph::addNode(const TDF_Label& theLabel,
else
aNodeType = NodeType_Subassembly;
}
else if (myShapeTool->IsComponent(theLabel))
else if (myShapeTool->IsReference(theLabel))
{
aNodeType = NodeType_Occurrence;
}

View File

@@ -0,0 +1,10 @@
puts "========================================================================="
puts "GH466: BRepBndLib::AddClose crashes"
puts "========================================================================="
puts ""
pload QAcommands
restore [locate_data_file bug_gh466.brep] result
OCC566 result

View File

@@ -0,0 +1,10 @@
puts "========================================================================="
puts "GH469: Bounding box is void when using BRepBndLib::AddOptimal"
puts "========================================================================="
puts ""
pload QAcommands
restore [locate_data_file bug_gh469.brep] result
bounding result -optimal

View File

@@ -0,0 +1,96 @@
# This test case is to reproduce the crash during blend operation
# Given a geometry with two curves and a "rim" at the end, performing
# a fillet with a radius that is too large leads to a segfault.
dset tolerance 0.0001
# back edge
dset xEdgeBackLeft -5
vertex vEdgeBackRight 0 0 0
vertex vEdgeBackLeft xEdgeBackLeft 0 0
edge edgeBack vEdgeBackLeft vEdgeBackRight
# edge circle at the back
dset radiusCircleBack 5.56
dset angleCircleBackStart -0.755726
dset xCircleBack xEdgeBackLeft-radiusCircleBack
circle circleBack xCircleBack 0 0 radiusCircleBack
mkedge edgeCircleBack circleBack angleCircleBackStart 0
settolerance edgeCircleBack tolerance
# edge circle at the front
dset radiusCircleFrontBottom 8.95
dset angleCircleFrontBottomStart 2.385867
dset angleCircleFrontBottomEnd -2.163565
dset yCircleFrontBottom -9.95121
circle circleFrontBottom 0 yCircleFrontBottom 0 radiusCircleFrontBottom
mkedge edgeCircleFrontBottom circleFrontBottom angleCircleFrontBottomStart angleCircleFrontBottomEnd
settolerance edgeCircleFrontBottom tolerance
# edge at the front and bottom
dset yEdgeFrontBottom -17.374312
dset xEdgeFrontBottomLeft xEdgeBackLeft
vertex vEdgeFrontBottomLeft xEdgeFrontBottomLeft yEdgeFrontBottom 0
vertex vEdgeFrontBottomRight 0 yEdgeFrontBottom 0
edge edgeFrontBottom vEdgeFrontBottomLeft vEdgeFrontBottomRight
# edge at the right bottom
edge edgeRightBottom vEdgeFrontBottomRight vEdgeBackRight
# the bottom wire
wire wireBottom edgeBack edgeCircleBack edgeCircleFrontBottom edgeFrontBottom edgeRightBottom
# the bottom face
mkplane planeBottom wireBottom
# the bottom solid
dset heightBottom 10.0
prism solidBottom planeBottom 0 0 heightBottom
# the top circle
dset yCircleTop yCircleFrontBottom
dset radiusCircleTop 8.57
dset angleCircleTopStart pi/2
dset angleCircleTop 2.618290
dset angleYAxis pi-angleCircleTop
dset angleCircleTopEnd angleCircleTopStart+angleCircleTop
circle circleTop 0 yCircleTop heightBottom radiusCircleTop
mkedge edgeCircleTop circleTop angleCircleTopStart angleCircleTopEnd
settolerance edgeCircleTop tolerance
# edge at the front at the top
dset yEdgeFrontTop yEdgeFrontBottom
dset xEdgeFrontTopLeft 0-radiusCircleTop*sin(angleYAxis)
vertex vEdgeFrontTopLeft xEdgeFrontTopLeft yEdgeFrontTop heightBottom
vertex vEdgeFrontTopRight 0 yEdgeFrontTop heightBottom
edge edgeFrontTop vEdgeFrontTopLeft vEdgeFrontTopRight
settolerance edgeFrontTop tolerance
# edge at the right at the top
dset yEdgeRightTopBack yCircleTop+radiusCircleTop
dset yEdgeRightTopFront yEdgeFrontBottom
vertex vEdgeRightTopBack 0 yEdgeRightTopBack heightBottom
vertex vEdgeRightTopFront 0 yEdgeRightTopFront heightBottom
edge edgeRightTop vEdgeRightTopBack vEdgeRightTopFront
# the top wire
wire wireTop edgeCircleTop edgeFrontTop edgeRightTop
# the top face
mkplane planeTop wireTop
# the top solid
dset heightTop 10.0
prism solidTop planeTop 0 0 heightTop
bop solidBottom solidTop
bopfuse fuse
explode fuse E
# Algorithm is expected to fail with a Tcl exception.
puts "TODO ALL: Tcl Exception: tolerance ang"
puts "TODO ALL: TEST INCOMPLETE"
blend b fuse 1 fuse_14

17
tests/bugs/xde/ar10850 Normal file
View File

@@ -0,0 +1,17 @@
puts "AR10850 - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots references"
pload OCAF
Close D -silent
XOpen [locate_data_file "ar10850_3D-EYE_chair_OCC_noscale.xbf"] D
XGetOneShape a D
set ref_diag [eval distpp [bounding a]]
XRescaleGeometry D 0.001
XGetOneShape a D
set diag [eval distpp [bounding a]]
checkreal "bounding box diagonal" $diag [expr $ref_diag * 0.001] 0 0.001
Close D

View File

@@ -0,0 +1,13 @@
puts "============"
puts "0032821: DEWrapper - Implementation of a common toolkit for importing and exporting CAD files"
puts "============"
puts ""
# Checking the stability of ability to change the configuration's values
set old_conf [DumpConfiguration]
LoadConfiguration ""
set new_conf [DumpConfiguration]
CompareConfiguration ${old_conf} ${new_conf}

20
tests/v3d/bugs/bug_gh421 Normal file
View File

@@ -0,0 +1,20 @@
puts "============"
puts "Visualization - Bounding box is not decreasing for mode 2 #421"
puts "============"
puts ""
pload MODELING VISUALIZATION
vclear
box b 100 200 300
vinit View1
vdisplay b -dispMode 2
# OK
box b 10 200 300
vdisplay b -dispMode 2
vfit
checkcolor 243 2 0 0 0
vdump $::imagedir/${::casename}.png

View File

@@ -32,13 +32,9 @@ set (CMAKE_SUPPRESS_REGENERATION TRUE)
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
# macro: include patched file if it exists
# include cmake file
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake")
include (${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake)
else()
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
endif()
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
endmacro()
macro (OCCT_INCLUDE_3RDPARTY_PRODUCT USE_PRODUCT PRODUCT_CONFIG_FILE)
@@ -247,7 +243,7 @@ if (NOT DEFINED INSTALL_DIR_DATA)
endif()
endif()
# include the patched or original list of definitions and flags
# include original list of definitions and flags
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
@@ -334,7 +330,7 @@ if (WIN32)
endif()
# OCCT tools
# include the patched or original list of tools
# include original list of tools
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
# list <OCCT_TOOLS> will contain all tools
OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)