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

Compare commits

...

101 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
Pasukhin Dmitry
858dd02fed Coding - Bump version to 7.9.0 stable release #380 2025-02-17 22:00:23 +00:00
Pasukhin Dmitry
7f7e7df782 Documentation - Update coding rules and formatting guidelines #379 2025-02-17 22:00:07 +00:00
dpasukhi
20c7202089 Testing - Remove unstable test cases 2025-02-17 18:15:58 +00:00
Zernova Marina
8fb662b0aa Visualization - NCollection_DataMap::Find() exception from AIS_Selection::Select() #375
Problem with NCollection_DataMap::Find() exception during multiple selection in OCC viewer.
Incorrect call is made from AIS_Selection::Select() method at line:
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theOwner);
Original issue: 0033742
2025-02-17 15:52:24 +00:00
jfa
e375bd7c3e Modeling Algorithms - UnifySameDomain improvement #371
Extend ShapeUpgrade_UnifySameDomain algorithm working on cases,
  where SurfaceOfRevolution or SurfaceOfLinearExtrusion was made on basis of TrimmedCurve.
Original issue: 0033328
2025-02-17 14:12:49 +00:00
astromko
4c5f9c77cb Modeling - Removing surface after transformation #374
Old surface is not removed after translation or rotation with geometry copying
Removed unnecessary condition that was added by an earlier fix.
Added a test case.
Original issue: 0033591
2025-02-17 14:12:43 +00:00
Pasukhin Dmitry
ed6005b75a Testing - Summarize only with success reference #377
Fix GitHub Actions workflow to filter completed runs by success status
2025-02-17 14:11:03 +00:00
Pasukhin Dmitry
04a15e36f7 Testing - Remove installation of Visual C++ 2010 #376 2025-02-17 14:10:48 +00:00
jfa
0a73cac759 Configuration - CMake symbol isolation issue on Windows #373
Fixed Salome compilation problem on Windows by M.Bernhard
2025-02-17 12:52:41 +00:00
jfa
6f42ada2e6 Modeling - SIGSEGV BRepAdaptor_Curve2d and UnifySameDomain #372
SIGSEGV with MakeVertexInsideFace.
Fixed exceptions with loading null curve and using out of range index.
By K.Leontev. [bos #37951]
2025-02-17 11:12:21 +00:00
Pasukhin Dmitry
5b574af01f Testing - WebAssembly build validation #256
Add WebAssembly build workflow for Ubuntu and update CMake warnings for OpenGL usage
Add workaround for platform-specific macros setup before project command
Update CMake configuration for Emscripten and Android toolchains;
Disable default features for vcpkg manifest
Update GitHub workflows to support multiple build types and improve compiler flag handling
Disabled DETools module for Emscripten support in CMake configuration
2025-02-14 16:08:45 +00:00
Pasukhin Dmitry
67bd61d4d3 Data Exchange - IGES Import Degenerated BSpline crash #368
Degenerated bspline leads to null dereference
Fix BSpline curve check and improve exception handling in TransferBSplineCurve
2025-02-14 13:13:53 +00:00
Pasukhin Dmitry
425f88e63a CMake - Disable building Overview by default #369
Updated default behavior to not build documentation
  when find doxygen (in case of windows it ofter exist in env variables).
Fixed issue when not defined BUILD_DOC_Overview, but found doxygen cmake issue.
2025-02-14 10:47:45 +00:00
Pasukhin Dmitry
5a186c7b1a Testing - Update GH testing to filter completed reference branch testing #365 2025-02-13 10:24:12 +00:00
Pasukhin Dmitry
fb73c3b712 Coding - Initialize member variables with default values #362
Clang-tidy applying rule for cppcoreguidelines-pro-type-member-init.
Updated: TKernel and TKMath
Update constructor in some classes instead of direct initialization
Refactor Bnd_BoundSortBox and Bnd_Box constructors to initialize member variables directly
2025-02-12 14:26:00 +00:00
Pasukhin Dmitry
a8950426b5 Data Exchange - Step Import metadata crash protecting #357
Fix null checks and improve attribute handling in STEPCAFControl_Reader
2025-02-12 14:25:19 +00:00
luzpaz
f423143109 Documentation - Fix various typos found in codebase #361
Found via `codespell -q 3 -S "*.fr" -L aadd,abnd,abord,acount,adn,afile,aline,alo,alocation,alog,als,anc,ane,anid,anormal,anout,ans,anumber,aother,aparent,apoints,aprogram,asender,asign,asnd,ba,bbuild,bloc,bord,bu,caf,cas,childrens,childs,classe,clen,commun,cylindre,don,dout,dum,ede,entites,fo,fonction,guid,hist,identic,ii,indx,inout,invalide,ist,iterm,llength,lod,mape,modeling,methode,mye,myu,nam,nd,nin,normale,normales,ons,parametre,parametres,periode,pres,reste,resul,secont,serie,shs,slin,som,somme,syntaxe,sur,te,thei,theis,ther,theres,thes,thev,thex,thet,tol,transfert,va,vas,verifie,vertexes,weight`
2025-02-11 12:38:56 +00:00
dpasukhi
87c04f1833 Coding - Bump version to 7.9.0.beta2 #359 2025-02-10 20:27:33 +00:00
Pasukhin Dmitry
49ae0d106f Data Exchange, Step Import - Disable Product Metadata mode by default #358
Add default initialization for myProductMetaMode in STEPCAFControl_Reader
2025-02-10 19:39:41 +00:00
Pasukhin Dmitry
fd03c58d3b Data Exchange - STEP Export ignore write schema #355
Refactor StepData_StepModel constructor and initialization logic for write unit
2025-02-10 15:26:39 +00:00
Pasukhin Dmitry
a5aa7bcd91 Testing - Samples build on GH #331
Add GitHub Action to build CSharp sample on Windows
Add MFC and Qt sample build actions
Improve CASROOT assignment logic in env.build.sh and env.install.sh for better compatibility with binary directories
2025-02-09 23:00:37 +00:00
Pasukhin Dmitry
9d727d09f4 Testing - Update GH Action for 7.9.0 #340
Update CAD files with new public data
Update 3rd-party archives with new versions of dependencies
Disable signal catching in bug28054_2
2025-02-09 21:20:05 +00:00
Pasukhin Dmitry
bd77f8af4a Coding - Refactor ShapeHealingMap to NCollection #346
Update container type to OCCT to avoid allocation on creating.
Refactor shape processing parameter handling to use XSAlgo_ShapeProcessor for consistency.
2025-02-08 21:01:14 +00:00
luzpaz
7e3d063cae Documentation - Fix various typos found in codebase #350 2025-02-08 09:44:51 +00:00
Zernova Marina
a1d887e0c4 Data Exchange - Fix GLTF Export for vertices and edges #348
Only free vertices and edges are exported now
2025-02-07 16:06:47 +00:00
Zernova Marina
85b40aba2a Data Exchange, GLTF Import - Fix visualization of colors #347
Fixed issue with material color space
2025-02-07 10:13:54 +00:00
oan
62e085c5ed Configuration - regression in wasm build #342
Quick fix absent definitions
2025-02-04 16:30:14 +00:00
Pasukhin Dmitry
10d1902820 Data Exchange - Schema missed during export #343
Refactor model creating to apply schema based on DE parameters.
New model creating stage no more inject header info.
2025-02-04 16:27:16 +00:00
Zernova Marina
6c77143364 Data Exchange - Fix GLTF Export Materials for edges #341
Fixed issue with edge colors
2025-02-04 09:22:45 +00:00
Zernova Marina
4b318b8bf6 Data Exchange - RWMesh_CafReader deferred loading issue for no faces #339
Fixed issue when trying to apply deferred loading for edges or vertexes.
2025-02-03 22:29:33 +00:00
Pasukhin Dmitry
bfb00b243e Configuration - TCL OCCT version extraction issue #337
Enhance version detection in OCCDoc_DetectCasVersion
Refactor documentation build workflow and integrate into multiplatform CI
2025-02-03 22:25:29 +00:00
dpasukhi
cc30b93700 Coding - Bump version to 7.9.0.beta1 #335 2025-02-03 13:35:09 +00:00
Pasukhin Dmitry
1f386af59f Coding - Update method guards for consistency #333
Apply new regex replacement with method's guards in .cxx
Update GH workflow with style checking
2025-02-03 11:16:00 +00:00
Pasukhin Dmitry
3ce9ec7651 Testing - Marking failed code formatting #332 2025-02-03 09:26:58 +00:00
mzernova
b9429d0708 GLTF Import - Edge and Vertex support #242
Added functionality to import Points and Lines from GLTF format
2025-02-02 21:30:21 +00:00
mzernova
174b985fd5 GLTF Export - Edge and Vertex support #243
Added functionality to export TopoDS_Vertex and TopoDS_Edge to GLTF format
2025-02-02 21:25:53 +00:00
Pasukhin Dmitry
053e01ec68 Testing - Inspector building on GH #329
Add GitHub Actions for TInspector build and clang-format check
Reorganize QT search to work with native Linux packages
Reorganize build-and-test workflow to have actions
2025-02-02 15:35:20 +00:00
Pasukhin Dmitry
16d36a47fc Testing - Disable summarization on cancellation #330 2025-02-02 10:34:32 +00:00
Pasukhin Dmitry
68a9da9f37 Testing - Summary image diff keeping #326
Add script to clean unused test images and update workflow to include it
2025-02-01 19:57:50 +00:00
Zernova Marina
fda875b293 Visualization - Add test for flipped view #328
Test case for #312
2025-02-01 19:56:25 +00:00
Zernova Marina
98a28c41a8 Visualization - flat skin for AIS_Manipulator presentation #321
Created flat skin for AIS_Manipulator presentation
Added "-flat" option to vmanipulator command
Added functionality to transform the manipulator depending on the camera rotation.
Added local transformation for Graphic3d_Group.
Added RecomputeTransformation method to PrsMgr_PresentableObject.
When overloading this method, you can set a transformation for an object depending on the rotation of the camera.
v3d/manipulator/flat: test case added
2025-02-01 17:20:22 +00:00
Pasukhin Dmitry
159f5b82aa Data Exchange - StepExport non-manifold missed parameter #324
Added missed configuration for non-manifold topology writing
2025-02-01 17:17:46 +00:00
Pasukhin Dmitry
afb0a7e4c4 Testing - GH Summary disabling for cancellation #325 2025-02-01 17:17:21 +00:00
Pasukhin Dmitry
45a52dfce7 Configuration - Git commit info missed #323
Fixed issue with missed git info as a part of dev version.
Add option to enable/disable git hash extraction in version string.
2025-02-01 17:16:58 +00:00
Dmitrii Kulikov
4b608f0bf8 Data Exchange, Step Import - Adding product attributes to metadata #315
Product attributes metadata for step files is now handled during import.
Attribute ReadProductMetadata is added to DESTEP_Parameters.
Method STEPCAFControl_Reader::ReadMetadata() is partially refactored.
Metadata tests for STEP are updated with new data.
Metadata tests for GLTF are updated with new data (since original
metadata in those tests is acquired from STEP files).
2025-02-01 17:16:21 +00:00
oan
60360e3204 Foundation Classes - BVH surface area calculation for transformed boxes #322
BVH::SurfaceCalculator::Area() fails to calculate area of transformed box.
Use absolute values of intermediate calculations to
  compute surface area of a box, so they do not diminish each other.
2025-02-01 00:22:19 +00:00
Pasukhin Dmitry
4012dc463e Testing - Marking Win retesting failed #314 2025-01-31 23:04:55 +00:00
Pasukhin Dmitry
8a067c43b7 Configuration - Version detection on MacOS #313
Improve version extraction and add error handling for missing version file
2025-01-31 23:04:27 +00:00
Pasukhin Dmitry
2027acc3de Configuration - Message about compiler limitation #311
Build System - Add compiler version checks for C++17 support
2025-01-31 23:04:01 +00:00
Kirill Gavrilov
73fcf4b4ed Coding, Emscripten - fix runtime crashes on WASM64 (-sMEMORY64=1) #320
by explicitly casting between BigInt and Number within EM_JS() blocks.
2025-01-31 21:06:18 +00:00
Kirill Gavrilov
69281b1bac Configuration, TKV3d - remove redundant dependency from OpenGL #319 2025-01-31 15:43:10 +00:00
Kirill Gavrilov
fb3c2c739c Visualization, OpenGl_GraduatedTrihedron - fix misprint in drawing line within OOZ_XOZ orientation #318 2025-01-31 15:41:02 +00:00
Kirill Gavrilov
104c5f4261 Data Exchange, XCAFDoc_ColorTool::AddColor() - fix generated HEX name of a color #317
Quantity_ColorRGBA::ColorToHex() is now used for consistent HEX formatting of RGBA colors.
2025-01-31 15:38:07 +00:00
Kirill Gavrilov
2d4070bed7 Visualization, Aspect_OpenVRSession - fix JSON file path when it is located relative to executable #316 2025-01-31 15:33:13 +00:00
Zernova Marina
c8c36fda1c Visualization - Implement interface to change myToFlipOutput of OpenGl_View #312 2025-01-31 13:44:31 +00:00
Pasukhin Dmitry
fbee65efd6 Configuration - Static library warning #310
Add warning message about LGPL 2.1 licensing limitations for static linking
2025-01-31 13:37:12 +00:00
Pasukhin Dmitry
d65feb6928 Configuration - Version information update #308
Refactor version handling to use version.cmake and update related scripts.
Created new symbols to extract information by C function
2025-01-31 13:17:38 +00:00
Zernova Marina
491e742d67 Visualization - AIS_Manipulator is unusable when attaching to objects with Graphic3d_TMF_ZoomPers #309
Recalculation of manipulator position if attached object has zoom transform persistence
  as well as set its anchor point in Transformation.
2025-01-31 11:26:31 +00:00
Dmitrii Kulikov
870d891898 Data Exchange - Step thread safety improvement #307
Mutex is added to XSControl_WorkSession to prevent data races
  during reading and writing.
Tests are added to check the behavior of STEP readers/writers in
  multithreading environment.
2025-01-30 17:42:07 +00:00
dpasukhi
2889518f7a Modeling - Degenerated curve on offset #301
Skip degenerated curves in BRepOffset_Tool::TryProject to improve robustness
2025-01-28 16:37:58 +00:00
dpasukhi
22126df210 Modeling - Add boundary check in BRepFill_Filling to handle empty boundaries #300 2025-01-28 16:29:56 +00:00
dpasukhi
d409a3642d Modeling - Add warning for incomplete wire detection in WireFromList #299 2025-01-28 15:49:11 +00:00
dpasukhi
8caf5157dd Modeling - Enhance intersection handling for closed curves in IntPatch_Intersection #298 2025-01-28 12:21:26 +00:00
dpasukhi
cde7baba0d Modeling - Add closed state handling in BRepLib_MakeEdge #297 2025-01-28 12:17:02 +00:00
dpasukhi
16ed3b4ced Modeling - Resetting Plane YVector #296
Fix calculation of myOY in GeomPlate_BuildAveragePlane to use cross product with OZ
2025-01-28 12:11:53 +00:00
dpasukhi
78fb1869fe Modeling - NURB Convert fix for degenerated #295
Fix logic for processing degenerated edges in NewPolygon function
2025-01-28 10:41:23 +00:00
dpasukhi
16d112481e Documentation - Update links in README #293 2025-01-27 12:37:08 +00:00
670 changed files with 11279 additions and 12724 deletions

View File

@@ -1,27 +1,14 @@
# This workflow builds the OCCT reference manual and overview documentations.
# It is triggered on pushes to the 'master' branch.
# The workflow includes steps to checkout the repository, install dependencies, build the documentation, and upload the generated documentation and logs as artifacts.
name: Build Documentation
description: 'Build OCCT documentation using doxygen'
on:
push:
branches:
- 'master'
jobs:
build:
name: Build Refman Documentation
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.1
runs:
using: composite
steps:
- name: Install dependencies
run: |
choco install -y graphviz
choco install -y doxygen.install
shell: pwsh
- name: Build refman documentation
run: |

View File

@@ -0,0 +1,57 @@
name: 'Build CSharp Sample'
description: 'Build CSharp sample using OCCT installation'
inputs:
platform:
description: 'Build platform (windows)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Build CSharp Sample
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
cd ${{ github.workspace }}/samples/CSharp
REM First upgrade solutions to VS2022
echo "Upgrading solution files to VS2022..."
devenv.exe CSharp.sln /upgrade
devenv.exe CSharp_D3D.sln /upgrade
REM Update project platform toolset
powershell -Command "(Get-Content OCCTProxy\OCCTProxy.vcxproj) -replace '<PlatformToolset>v100</PlatformToolset>', '<PlatformToolset>v143</PlatformToolset>' | Set-Content OCCTProxy\OCCTProxy.vcxproj"
powershell -Command "(Get-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj) -replace '<PlatformToolset>v100</PlatformToolset>', '<PlatformToolset>v143</PlatformToolset>' | Set-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj"
REM Restore NuGet packages
echo "Upgrading solution files..."
msbuild.exe CSharp.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_csharp.log;Verbosity=detailed
msbuild.exe CSharp_D3D.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_d3d.log;Verbosity=detailed
REM Build solutions with real-time console output
echo "Building CSharp.sln..."
msbuild.exe CSharp.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_csharp.log;Verbosity=detailed /m
echo "Building CSharp_D3D.sln..."
msbuild.exe CSharp_D3D.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_d3d.log;Verbosity=detailed /m
- name: Upload CSharp Sample
uses: actions/upload-artifact@v4.4.3
with:
name: csharp-sample-${{ inputs.platform }}-x64
path: samples/CSharp
retention-days: 7

View File

@@ -0,0 +1,54 @@
name: 'Build MFC Sample'
description: 'Build MFC sample using OCCT installation'
inputs:
platform:
description: 'Build platform (windows)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Build MFC Sample
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
cd ${{ github.workspace }}/samples/mfc/standard
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
REM First restore the solution
echo "Restoring solution..."
msbuild.exe ALL-vc14.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore.log;Verbosity=detailed
REM Build solution with detailed logging
echo "Building solution..."
msbuild.exe ALL-vc14.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build.log;Verbosity=detailed /m
REM Display logs if build fails
if errorlevel 1 (
echo "Build failed. Contents of restore.log:"
type restore.log
echo "Contents of build.log:"
type build.log
exit /b 1
)
- name: Upload MFC Sample
uses: actions/upload-artifact@v4.4.3
with:
name: mfc-sample-${{ inputs.platform }}-x64
path: samples/mfc/
retention-days: 7

View File

@@ -0,0 +1,108 @@
name: 'Build Qt Sample'
description: 'Build Qt samples using OCCT installation'
inputs:
platform:
description: 'Build platform (windows/linux)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
thirdparty_url:
description: 'URL to download 3rdparty dependencies'
required: false
default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip'
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install Linux dependencies
if: inputs.platform == 'linux'
shell: bash
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools
- name: Setup MSBuild
if: inputs.platform == 'windows'
uses: microsoft/setup-msbuild@v2
- name: Build Qt Samples - Windows
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
cd ${{ github.workspace }}/occt-install/
call env.bat vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
REM Setup Qt environment
set "QTDIR=${{ github.workspace }}\3rdparty-vc14-64\qt5.11.2-vc14-64"
set "PATH=%QTDIR%\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
cd ${{ github.workspace }}/samples/qt
for %%s in (IESample Tutorial FuncDemo) do (
cd %%s
echo "Generating project for %%s..."
qmake -tp vc -r -o %%s.sln %%s0.pro
echo "Restoring %%s..."
msbuild.exe %%s.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_restore.log;Verbosity=detailed
echo "Building %%s..."
msbuild.exe %%s.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_build.log;Verbosity=detailed /m
REM Display logs if build fails
if errorlevel 1 (
echo "Build failed for %%s. Contents of restore log:"
type %%s_restore.log
echo "Contents of build log:"
type %%s_build.log
exit /b 1
)
cd ..
)
- name: Build Qt Samples - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
cd ${{ github.workspace }}/occt-install/bin
source env.sh
cd ${{ github.workspace }}/samples/qt
for sample in IESample Tutorial FuncDemo; do
cd $sample
aQMakePath=`which qmake`
host=`uname -s`
export STATION=$host
export RES_DIR="${{ github.workspace }}/samples/qt/${sample}/result"
qmake $sample.pro
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
make -j$aNbJobs release
cd ..
done
- name: Upload Qt Samples
uses: actions/upload-artifact@v4.4.3
with:
name: qt-samples-${{ inputs.platform }}-x64
path: |
samples/qt/
samples/qt/
retention-days: 7

View File

@@ -0,0 +1,88 @@
name: 'Build TInspector'
description: 'Build TInspector using OCCT installation as a separate job'
inputs:
platform:
description: 'Build platform (windows/linux)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
thirdparty_url:
description: 'URL to download 3rdparty dependencies'
required: false
default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip'
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install Linux dependencies
if: inputs.platform == 'linux'
shell: bash
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools
- name: Configure TInspector - Windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
cd tools
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 `
-D CMAKE_BUILD_TYPE=Release `
-D BUILD_SHARED_LIBS=ON `
-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
if: inputs.platform == 'linux'
shell: bash
run: |
cd tools
mkdir build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE=Release \
-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
if: inputs.platform == 'windows'
shell: pwsh
run: |
cd tools/build
cmake --build . --config Release --target install
- name: Build TInspector - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
cd tools/build
make install -j$(nproc)
- name: Upload TInspector installation
uses: actions/upload-artifact@v4.4.3
with:
name: inspector-${{ inputs.platform }}-x64
path: tools/install
retention-days: 7

View File

@@ -1,73 +1,68 @@
# This workflow checks the code formatting of changed files in a pull request using clang-format.
# It is triggered on pull requests to the master branch.
# The workflow verifies that the clang-format version matches 18.1.8,
# checks formatting of modified files, and if formatting issues are found,
# creates a patch file that can be applied to fix the formatting.
name: 'Clang-Format Code Check'
description: 'Check code formatting of changed files using clang-format'
inputs:
base-ref:
description: 'Base reference to compare changes against'
required: true
default: 'master'
file-pattern:
description: 'Pattern to match files for formatting check'
required: false
default: '^(src|tools)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
clang-format-version:
description: 'Required clang-format version'
required: false
default: '18.1.8'
name: Clang-Format Check
on:
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
format-check:
name: Check code formatting
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
with:
fetch-depth: 0
outputs:
has-changes:
description: 'Whether any files needed formatting'
value: ${{ steps.git-check.outputs.has_changes }}
runs:
using: "composite"
steps:
- name: Check clang-format version
shell: pwsh
run: |
$version = clang-format --version
Write-Output "Detected clang-format version: $version"
$version | Select-String "18.1.8" >$null
$version | Select-String "${{ inputs.clang-format-version }}" >$null
if ($LASTEXITCODE -ne 0) {
echo "::error::Wrong clang-format version. Expected 18.1.8"
Write-Output "Error: Version mismatch - expected 18.1.8"
echo "::error::Wrong clang-format version. Expected ${{ inputs.clang-format-version }}"
Write-Output "Error: Version mismatch - expected ${{ inputs.clang-format-version }}"
exit 1
}
shell: pwsh
- name: Get changed files
id: changed-files
shell: pwsh
run: |
$changedFiles = git diff --name-only origin/${{ github.base_ref }} HEAD |
Where-Object { $_ -match '^(src|tools)/' -and $_ -match '\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$' }
$changedFiles = git diff --name-only origin/${{ inputs.base-ref }} HEAD |
Where-Object { $_ -match '${{ inputs.file-pattern }}' }
$changedFiles | Set-Content "changed_files.txt"
if ($changedFiles.Count -gt 0) {
echo "has_files=true" >> $env:GITHUB_OUTPUT
}
shell: pwsh
- name: Check formatting
id: check
if: steps.changed-files.outputs.has_files == 'true'
shell: pwsh
run: |
$files = Get-Content "changed_files.txt"
$files | ForEach-Object -ThrottleLimit 8 -Parallel {
clang-format -i -style=file $_
}
shell: pwsh
- name: Check git status
id: git-check
if: steps.changed-files.outputs.has_files == 'true'
shell: pwsh
run: |
git diff > format.patch
if ((Get-Item format.patch).length -gt 0) {
echo "has_changes=true" >> $env:GITHUB_OUTPUT
}
shell: pwsh
- name: Upload patch
if: steps.git-check.outputs.has_changes == 'true'
@@ -76,9 +71,13 @@ jobs:
name: format-patch
path: format.patch
- name: Fail with instructions
- name: Failing step for formatting issues
if: steps.git-check.outputs.has_changes == 'true'
run: |
echo "::error::Files need formatting. To fix: 1. Download format.patch 2. "git apply format.patch" 3. Commit and push"
exit 1
shell: pwsh
run: |
echo "::error::Files need formatting. To fix: 1. Download format.patch 2. \"git apply format.patch\" 3. Commit and push"
exit 1
branding:
icon: 'check-square'
color: 'green'

View File

@@ -0,0 +1,90 @@
import os
import re
from bs4 import BeautifulSoup
from pathlib import Path
import glob
import os.path
def get_referenced_images(html_file):
# Get the directory containing the HTML file
html_dir = os.path.dirname(os.path.abspath(html_file))
with open(html_file, 'r', encoding='utf-8') as f:
soup = BeautifulSoup(f.read(), 'html.parser')
images = set()
# Extract direct image references
for img in soup.find_all('img'):
if src := img.get('src'):
# Convert relative path to absolute
abs_path = os.path.normpath(os.path.join(html_dir, src))
images.add(abs_path)
# Extract toggle references
for elem in soup.find_all(attrs={'onclick': True}):
onclick = elem['onclick']
paths = re.findall(r'diffimage_toggle\(this,"([^"]+)","([^"]+)"\)', onclick)
for src1, src2 in paths:
# Convert relative paths to absolute
abs_path1 = os.path.normpath(os.path.join(html_dir, src1))
abs_path2 = os.path.normpath(os.path.join(html_dir, src2))
images.add(abs_path1)
images.add(abs_path2)
return images
def cleanup_platform_images(results_dir, platform):
html_file = f"{results_dir}/current/{platform}/diff-*.html"
html_files = glob.glob(html_file)
if not html_files:
print(f"No diff HTML found for {platform}")
return
# Get referenced images from HTML
referenced = set()
for html in html_files:
images = get_referenced_images(html)
referenced.update(images)
# Convert relative paths to absolute
base_dir = Path(results_dir)
current_dir = base_dir / "current" / platform
master_dir = base_dir / "master" / platform
# Find all PNGs
png_files = set()
for directory in [current_dir, master_dir]:
for root, _, files in os.walk(directory):
for file in files:
if file.lower().endswith('.png'):
png_files.add(Path(root) / file)
# Remove unreferenced PNGs
for png in png_files:
if str(png) not in referenced:
try:
png.unlink()
except OSError as e:
print(f"Error removing {png}: {e}")
def main():
platforms = [
"windows-x64",
"windows-clang-x64",
"macos-x64",
"macos-gcc-x64",
"linux-clang-x64",
"linux-gcc-x64"
]
results_dir = Path("./").resolve()
for platform in platforms:
print(f"\nProcessing {platform}...")
cleanup_platform_images(results_dir, platform)
if __name__ == "__main__":
main()

View File

@@ -18,6 +18,32 @@ concurrency:
cancel-in-progress: true
jobs:
clang-format:
name: Check code formatting
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
with:
fetch-depth: 0
- name: Run clang-format check
uses: ./.github/actions/clang-format-check
with:
base-ref: ${{ github.event.pull_request.base.ref || 'master' }}
documentation:
name: Build Documentation
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.1
- name: Build documentation
uses: ./.github/actions/build-docs
prepare-and-build-windows-x64:
name: Prepare and Build on Windows with MSVC (x64)
runs-on: windows-2022
@@ -29,7 +55,7 @@ jobs:
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
@@ -59,6 +85,7 @@ jobs:
-D CMAKE_BUILD_TYPE=Release `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D USE_D3D=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
@@ -95,7 +122,7 @@ jobs:
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
@@ -133,6 +160,7 @@ jobs:
-D CMAKE_BUILD_TYPE=Release `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D USE_D3D=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
@@ -374,6 +402,96 @@ jobs:
path: install
retention-days: 7
build-inspector-windows:
name: Build TInspector on Windows
needs: prepare-and-build-windows-x64
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Build TInspector
uses: ./.github/actions/build-tinspector
with:
platform: windows
install-artifact-name: install-windows-x64
build-inspector-linux:
name: Build TInspector on Linux
needs: prepare-and-build-linux-clang-x64
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Build TInspector
uses: ./.github/actions/build-tinspector
with:
platform: linux
install-artifact-name: install-linux-clang-x64
build-csharp-windows:
name: Build CSharp Sample on Windows
needs: prepare-and-build-windows-x64
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Build CSharp Sample
uses: ./.github/actions/build-sample-csharp
with:
platform: windows
install-artifact-name: install-windows-x64
build-mfc-windows:
name: Build MFC Sample on Windows
needs: prepare-and-build-windows-x64
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Build MFC Sample
uses: ./.github/actions/build-sample-mfc
with:
platform: windows
install-artifact-name: install-windows-x64
build-qt-windows:
name: Build Qt Sample on Windows
needs: prepare-and-build-windows-x64
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Build Qt Sample
uses: ./.github/actions/build-sample-qt
with:
platform: windows
install-artifact-name: install-windows-x64
build-qt-linux:
name: Build Qt Sample on Linux
needs: prepare-and-build-linux-clang-x64
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Build Qt Sample
uses: ./.github/actions/build-sample-qt
with:
platform: linux
install-artifact-name: install-linux-clang-x64
test-windows-x64:
name: Test on Windows (x64)
runs-on: windows-2022
@@ -385,7 +503,7 @@ jobs:
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
@@ -393,9 +511,9 @@ jobs:
- name: Download and extract test data
run: |
cd data
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.zip -OutFile opencascade-dataset-7.8.0.zip
Expand-Archive -Path opencascade-dataset-7.8.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.8.0.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.zip -OutFile opencascade-dataset-7.9.0.zip
Expand-Archive -Path opencascade-dataset-7.9.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.9.0.zip
shell: pwsh
- name: Download and extract install directory
@@ -416,12 +534,6 @@ jobs:
.\systemwidedeploy.cmd 5
shell: cmd
- name: Install Visual C++ 2010 Redistributable
run: |
choco install -y vcredist2010
refreshenv
shell: cmd
- name: Install CJK Fonts
run: |
Invoke-WebRequest -Uri https://noto-website-2.storage.googleapis.com/pkgs/Noto-hinted.zip -OutFile Noto-hinted.zip
@@ -498,7 +610,7 @@ jobs:
- name: Download and extract 3rdparty dependencies
if: steps.check_failures.outputs.failed_count > 0
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
@@ -507,9 +619,9 @@ jobs:
if: steps.check_failures.outputs.failed_count > 0
run: |
cd data
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.zip -OutFile opencascade-dataset-7.8.0.zip
Expand-Archive -Path opencascade-dataset-7.8.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.8.0.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.zip -OutFile opencascade-dataset-7.9.0.zip
Expand-Archive -Path opencascade-dataset-7.9.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.9.0.zip
shell: pwsh
- name: Download and extract install directory
@@ -533,13 +645,6 @@ jobs:
.\systemwidedeploy.cmd 5
shell: cmd
- name: Install Visual C++ 2010 Redistributable
if: steps.check_failures.outputs.failed_count > 0
run: |
choco install -y vcredist2010
refreshenv
shell: cmd
- name: Install CJK Fonts
if: steps.check_failures.outputs.failed_count > 0
run: |
@@ -560,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
@@ -596,8 +717,15 @@ jobs:
if: steps.check_failures.outputs.failed_count > 0
run: |
cd install/results/windows-x64-retest
$failedCount = 0
if (Test-Path tests.log) {
$failedCount = (Select-String -Path tests.log -Pattern "Total cases:.*FAILED" | ForEach-Object { $_.Matches } | ForEach-Object { $_.Groups[1].Value }) -as [int]
$content = Get-Content tests.log
$totalLine = $content | Select-String "Total cases:"
if ($totalLine) {
if ($totalLine -match "FAILED") {
$failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int]
}
}
if ($failedCount -gt 0) {
Write-Error "Number of FAILED tests ($failedCount) exceeds threshold of 0"
echo "FAILED_COUNT=$failedCount" >> $env:GITHUB_ENV
@@ -619,7 +747,7 @@ jobs:
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
@@ -627,9 +755,9 @@ jobs:
- name: Download and extract test data
run: |
cd data
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.zip -OutFile opencascade-dataset-7.8.0.zip
Expand-Archive -Path opencascade-dataset-7.8.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.8.0.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.zip -OutFile opencascade-dataset-7.9.0.zip
Expand-Archive -Path opencascade-dataset-7.9.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.9.0.zip
shell: pwsh
- name: Download and extract install directory
@@ -650,12 +778,6 @@ jobs:
.\systemwidedeploy.cmd 5
shell: cmd
- name: Install Visual C++ 2010 Redistributable
run: |
choco install -y vcredist2010
refreshenv
shell: cmd
- name: Install CJK Fonts
run: |
Invoke-WebRequest -Uri https://noto-website-2.storage.googleapis.com/pkgs/Noto-hinted.zip -OutFile Noto-hinted.zip
@@ -732,7 +854,7 @@ jobs:
- name: Download and extract 3rdparty dependencies
if: steps.check_failures.outputs.failed_count > 0
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
@@ -741,9 +863,9 @@ jobs:
if: steps.check_failures.outputs.failed_count > 0
run: |
cd data
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.zip -OutFile opencascade-dataset-7.8.0.zip
Expand-Archive -Path opencascade-dataset-7.8.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.8.0.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.zip -OutFile opencascade-dataset-7.9.0.zip
Expand-Archive -Path opencascade-dataset-7.9.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.9.0.zip
shell: pwsh
- name: Download and extract install directory
@@ -767,13 +889,6 @@ jobs:
.\systemwidedeploy.cmd 5
shell: cmd
- name: Install Visual C++ 2010 Redistributable
if: steps.check_failures.outputs.failed_count > 0
run: |
choco install -y vcredist2010
refreshenv
shell: cmd
- name: Install CJK Fonts
if: steps.check_failures.outputs.failed_count > 0
run: |
@@ -794,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
@@ -830,8 +961,15 @@ jobs:
if: steps.check_failures.outputs.failed_count > 0
run: |
cd install/results/windows-clang-x64-retest
$failedCount = 0
if (Test-Path tests.log) {
$failedCount = (Select-String -Path tests.log -Pattern "Total cases:.*FAILED" | ForEach-Object { $_.Matches } | ForEach-Object { $_.Groups[1].Value }) -as [int]
$content = Get-Content tests.log
$totalLine = $content | Select-String "Total cases:"
if ($totalLine) {
if ($totalLine -match "FAILED") {
$failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int]
}
}
if ($failedCount -gt 0) {
Write-Error "Number of FAILED tests ($failedCount) exceeds threshold of 0"
echo "FAILED_COUNT=$failedCount" >> $env:GITHUB_ENV
@@ -860,8 +998,8 @@ jobs:
- name: Download test data
run: |
cd data
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
@@ -954,8 +1092,8 @@ jobs:
if: steps.check_failures.outputs.failed_count > 0
run: |
cd data
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
if: steps.check_failures.outputs.failed_count > 0
@@ -985,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: |
@@ -1051,8 +1206,8 @@ jobs:
- name: Download test data
run: |
cd data
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
@@ -1145,8 +1300,8 @@ jobs:
if: steps.check_failures.outputs.failed_count > 0
run: |
cd data
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
if: steps.check_failures.outputs.failed_count > 0
@@ -1176,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
@@ -1241,8 +1413,8 @@ jobs:
- name: Download test data
run: |
cd data
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
@@ -1334,8 +1506,8 @@ jobs:
if: steps.check_failures.outputs.failed_count > 0
run: |
cd data
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
if: steps.check_failures.outputs.failed_count > 0
@@ -1362,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
@@ -1427,8 +1617,8 @@ jobs:
- name: Download test data
run: |
cd data
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
@@ -1520,8 +1710,8 @@ jobs:
if: steps.check_failures.outputs.failed_count > 0
run: |
cd data
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
if: steps.check_failures.outputs.failed_count > 0
@@ -1548,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
@@ -1597,7 +1805,7 @@ jobs:
test-summary:
name: 'Summarize Test Results'
runs-on: ubuntu-24.04
if: always() && github.event_name == 'pull_request'
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
needs: [retest-windows-x64, retest-windows-clang-x64, retest-macos-x64, retest-macos-gcc-x64, retest-linux-clang-x64, retest-linux-gcc-x64]
steps:
@@ -1629,7 +1837,7 @@ jobs:
run: |
response=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=${{ github.event.pull_request.base.ref }}")
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=${{ github.event.pull_request.base.ref }}&status=success")
latest_run_id=$(echo "$response" | jq -r '.workflow_runs[] | select(.name=="Build and Test OCCT on Multiple Platforms") | .id' | head -n 1)
echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV
@@ -1661,13 +1869,25 @@ jobs:
done
wait
- name: Install BeautifulSoup
run: pip install beautifulsoup4
- name: Clean unused test images
run: |
# copy to the install/bin/results directory
cp ${{ github.workspace }}/.github/actions/scripts/cleanup_test_images.py install/bin/results
cd install/bin/results
python cleanup_test_images.py
- name: Upload comparison results
uses: actions/upload-artifact@v4.4.3
with:
name: test-compare-results
retention-days: 15
overwrite: true
path: |
install/bin/results/current/**/diff-*.html
install/bin/results/current/**/diff-*.log
install/bin/results/current/**/summary.html
install/bin/results/current/**/tests.log
install/bin/results/**/diff-*.html
install/bin/results/**/diff-*.log
install/bin/results/**/summary.html
install/bin/results/**/tests.log
install/bin/results/**/*.png

View File

@@ -27,6 +27,7 @@ jobs:
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-x86_64-toolchain",
thirdparty_dir: "/mingw64",
compiler_flags: "",
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
@@ -35,6 +36,7 @@ jobs:
cxx: "clang++",
package: "mingw-w64-clang-x86_64-toolchain",
thirdparty_dir: "/clang64",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Wall -Wextra\"",
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
@@ -43,8 +45,10 @@ jobs:
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-ucrt-x86_64-toolchain",
thirdparty_dir: "/ucrt64",
compiler_flags: "",
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
@@ -77,14 +81,14 @@ jobs:
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.config.compiler_flags }} ..
- name: Build basic
shell: msys2 {0}
run: |
cd build
cmake --build . -- -j 4
cmake --build . --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
@@ -105,9 +109,9 @@ jobs:
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR="${{ github.workspace }}/install" \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
@@ -118,20 +122,19 @@ jobs:
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
${{ matrix.config.compiler_flags }} ..
- name: Build full shared
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full static
shell: msys2 {0}
@@ -144,12 +147,12 @@ jobs:
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_OPT_PROFILE=Default \
-D BUILD_LIBRARY_TYPE=Static \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR="${{ github.workspace }}/install" \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
@@ -160,20 +163,19 @@ jobs:
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
${{ matrix.config.compiler_flags }} ..
- name: Build full static
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full with DEBUG define
shell: msys2 {0}
@@ -190,8 +192,8 @@ jobs:
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D INSTALL_DIR="${{ github.workspace }}/install" \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
@@ -201,16 +203,17 @@ jobs:
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full with DEBUG define
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}

View File

@@ -51,7 +51,7 @@ jobs:
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
@@ -141,7 +141,7 @@ jobs:
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_OPT_PROFILE=Default `
-D BUILD_LIBRARY_TYPE=Static `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `

View File

@@ -24,13 +24,16 @@ jobs:
- {
name: "GCC",
cc: "gcc",
cxx: "g++"
cxx: "g++",
compiler_flags: ""
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++"
cxx: "clang++",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Werror -Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Werror -Wall -Wextra\""
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
@@ -51,13 +54,13 @@ jobs:
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.config.compiler_flags }} ..
- name: Build basic
run: |
cd build
cmake --build . -- -j 4
cmake --build . --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
@@ -75,9 +78,9 @@ jobs:
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
@@ -89,18 +92,17 @@ jobs:
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
${{ matrix.config.compiler_flags }} ..
- name: Build full shared
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full static
run: |
@@ -111,12 +113,12 @@ jobs:
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_OPT_PROFILE=Default \
-D BUILD_LIBRARY_TYPE=Static \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
@@ -128,18 +130,17 @@ jobs:
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
${{ matrix.config.compiler_flags }} ..
- name: Build full static
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full with DEBUG define
run: |
@@ -154,8 +155,8 @@ jobs:
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=Debug \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
@@ -171,9 +172,9 @@ jobs:
- name: Build full with DEBUG define
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}

View File

@@ -0,0 +1,102 @@
# This workflow validates the WebAssembly build on Ubuntu.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project.
name: WebAssembly build (Ubuntu)
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
USERNAME: Open-Cascade-SAS
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/Open-Cascade-SAS/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite"
EMSDK_VERSION: 3.1.74
jobs:
wasm-build:
name: WebAssembly Build
runs-on: ubuntu-24.04
strategy:
matrix:
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
- name: Setup vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
- name: Add NuGet sources
run: |
mono $(${VCPKG_EXE} fetch nuget | tail -n 1) \
sources add \
-Source "${FEED_URL}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${USERNAME}" \
-Password "${{ secrets.GITHUB_TOKEN }}"
mono $(${VCPKG_EXE} fetch nuget | tail -n 1) \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-Source "${FEED_URL}"
- name: Setup Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install ${EMSDK_VERSION}
./emsdk activate ${EMSDK_VERSION}
echo "EMSDK=${{ github.workspace }}/emsdk" >> $GITHUB_ENV
echo "${{ github.workspace }}/emsdk" >> $GITHUB_PATH
echo "${{ github.workspace }}/emsdk/upstream/emscripten" >> $GITHUB_PATH
- name: Configure OCCT with vcpkg
run: |
source "${{ github.workspace }}/emsdk/emsdk_env.sh"
mkdir -p "build-${{ matrix.build_type }}"
cd "build-${{ matrix.build_type }}"
export VCPKG_ROOT="${{ github.workspace }}/vcpkg"
emcmake cmake -G "Ninja" \
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET=wasm32-emscripten \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_USE_VCPKG=ON \
-DUSE_MMGR_TYPE=NATIVE \
-DBUILD_LIBRARY_TYPE=Static \
-DBUILD_MODULE_Draw=OFF \
-DUSE_FREETYPE=OFF \
-DUSE_TK=OFF \
-DUSE_TCL=OFF \
-DUSE_DRACO=ON \
-DUSE_FFMPEG=OFF \
-DUSE_FREEIMAGE=OFF \
-DUSE_OPENVR=OFF \
-DUSE_VTK=OFF \
-DUSE_TBB=OFF \
-DUSE_RAPIDJSON=ON \
-DINSTALL_DIR="${{ github.workspace }}/install-wasm-${{ matrix.build_type }}" \
-DCMAKE_CXX_FLAGS="-s WASM=1 -s EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] -s ALLOW_MEMORY_GROWTH=1" \
-DCMAKE_EXECUTABLE_SUFFIX=".js" ..
- name: Build
run: |
cd build-${{ matrix.build_type }}
cmake --build . --config ${{ matrix.build_type }} --target install -- -j4

View File

@@ -25,7 +25,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019, macos-15, macos-14, macos-13]
os: [ubuntu-24.04, ubuntu-22.04, windows-2022, windows-2019, macos-15, macos-14, macos-13]
build_type: [Debug, Release]
steps:
@@ -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 \

3
.gitignore vendored
View File

@@ -54,4 +54,5 @@ win64
/libtool
/stamp*
/build*
/install
/install*
/tools/build*

View File

@@ -32,6 +32,30 @@ if (BUILD_USE_VCPKG)
endif()
set (VCPKG_MANIFEST_DIR "${CMAKE_SOURCE_DIR}/adm/vcpkg")
# Disable default features for vcpkg manifest
set (VCPKG_MANIFEST_NO_DEFAULT_FEATURES 1)
# detection for Emscripten toolchain
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*mscripten\.cmake$" OR "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" MATCHES ".*mscripten\.cmake$")
set(EMSCRIPTEN 1)
endif()
# detection for Android toolchain
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*ndroid\.toolchain\.cmake$" OR "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" MATCHES ".*ndroid\.toolchain\.cmake$")
set(ANDROID 1)
endif()
# detection for android common variables
if (NOT "${CMAKE_ANDROID_NDK}" STREQUAL "" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Android" OR NOT "${ANDROID_NDK}" STREQUAL "")
set (ANDROID 1)
endif()
else()
# Setting up the system and compiler specific variables.
# Can't be done on early stages with VCPKG enabled.
# VCPKG installing dependencies as soon as call PROJECT,
# but for then moment need to define required list of dependencies.
PROJECT (OCCT)
endif()
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
@@ -60,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
@@ -93,8 +113,17 @@ if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX "" CACHE STRING "${BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR}" FORCE)
endif()
else()
message(AUTHOR_WARNING "OCCT is licensed under LGPL 2.1, which has limitations on"
"static linking with proprietary software."
"OCCT3D offers commercial licensing exceptions to LGPL 2.1."
"Please use our contact form at https://occt3d.com/")
unset (BUILD_SHARED_LIBS)
unset (BUILD_SHARED_LIBRARY_NAME_POSTFIX)
if (BUILD_OPT_PROFILE STREQUAL "Production")
set (BUILD_OPT_PROFILE "Default" CACHE STRING "Select profile for compiler and linker." FORCE)
message(WARNING "Static libraries are not optimized for production builds. "
"Please use shared libraries for production builds.")
endif()
endif()
if (WIN32)
@@ -191,6 +220,11 @@ if (NOT DEFINED BUILD_INCLUDE_SYMLINK)
set (BUILD_INCLUDE_SYMLINK OFF CACHE BOOL "${BUILD_INCLUDE_SYMLINK_DESCR}")
endif()
# Overview
if (NOT DEFINED BUILD_DOC_Overview)
set (BUILD_DOC_Overview OFF CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
endif()
if (CMAKE_VERSION VERSION_LESS "3.14")
OCCT_CHECK_AND_UNSET (BUILD_INCLUDE_SYMLINK)
endif()
@@ -284,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)
@@ -352,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)
@@ -369,6 +400,10 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND BUILD_MODULE_Draw)
message (STATUS "Info. Draw module is turned off due to it is not supported on UWP")
set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
endif()
if (EMSCRIPTEN AND BUILD_MODULE_DETools)
message (STATUS "Info. DETools module is turned off due to it is not supported on Emscripten")
set (BUILD_MODULE_DETools OFF CACHE BOOL "${BUILD_MODULE_DETools_DESCR}" FORCE)
endif()
# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
@@ -578,7 +613,9 @@ if (CAN_USE_GLES2 AND USE_GLES2)
if (NOT IOS)
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/egl")
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/gles2")
OCCT_ADD_VCPKG_FEATURE ("angle")
if (NOT EMSCRIPTEN)
OCCT_ADD_VCPKG_FEATURE ("angle")
endif()
endif()
else()
if (NOT CAN_USE_GLES2)
@@ -720,8 +757,12 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_QT")
endif()
# the name of the project
project (OCCT)
# VCPKG require delayed processing of 3rdparty.
# That is why we delay the creating project and setting up
# the platform specific variables.
if (BUILD_USE_VCPKG)
project (OCCT)
endif()
# copying clang-format file to the root of the project
file(COPY ${CMAKE_SOURCE_DIR}/.clang-format DESTINATION ${CMAKE_SOURCE_DIR})
@@ -864,20 +905,7 @@ if(APPLE)
set (INSTALL_NAME_DIR "" CACHE STRING "install_name library suffix on OS X (e.g. @executable_path/../Frameworks)")
endif()
# Overview
if (NOT DEFINED BUILD_DOC_Overview)
set (DO_ONLY_CHECK_FOR_DOXYGEN ON)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen")
set (DO_ONLY_CHECK_FOR_DOXYGEN OFF)
if (CAN_DOXYGEN_BE_USED)
message (STATUS "Info. Overview building is turned on")
endif()
set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
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})
@@ -975,6 +1003,9 @@ message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header fi
# collect all the headers to <binary dir>/inc folder
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "src" "${INSTALL_DIR_INCLUDE}")
# Create and install Standard_Version.hxx
CONFIGURE_AND_INSTALL_VERSION_HEADER()
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
@@ -991,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)
@@ -1054,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}")
@@ -1260,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

@@ -38,17 +38,17 @@ If HTML documentation is not available in your package, you can:
- **Generate together with sources:** You need to have CMake and 1.8.4 (or above) installed on your system. Enable `BUILD_DOC_Overview` CMake parameter and set the path to Doxygen `3RDPARTY_DOXYGEN_EXECUTABLE`. Then build ALL or only `Overview`.
- **Read documentation in source plain text (Markdown) format** found in the subfolder `dox` or [GitHub Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki).
See `dox/dev_guides/documentation/documentation.md` or [Building Documentation](https://dev.opencascade.org/doc/occt-7.8.0/overview/html/build_upgrade__building_documentation.html) for details.
See [dox/build/build_documentation/building_documentation.md](dox/build/build_documentation/building_documentation.md) or [Building Documentation](https://dev.opencascade.org/doc/occt-7.8.0/overview/html/build_upgrade__building_documentation.html) for details.
## Building
In most cases, you need to rebuild OCCT on your platform (OS, compiler) before using it in your project to ensure binary compatibility.
Consult the file `dox/dev_guides/building/building.md` or [Building OCCT](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html) or [Building OCCT Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki/build_upgrade) for instructions on building OCCT from sources on supported platforms.
Consult the file [dox/build/build_occt/building_occt.md](dox/build/build_occt/building_occt.md) or [Building OCCT](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html) or [Building OCCT Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki/build_upgrade) for instructions on building OCCT from sources on supported platforms.
## Version
The current version of OCCT can be found in the file `src/Standard/Standard_Version.hxx`.
The current version of OCCT can be found in the file [`adm/cmake/version.cmake`](adm/cmake/version.cmake).
## Development

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

@@ -26,7 +26,7 @@ endif()
if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd26812")
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
@@ -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)
@@ -75,6 +71,10 @@ endmacro()
# COMPILER variable
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
if (MSVC)
if (MSVC_VERSION LESS 1914)
message (AUTHOR_WARNING "Microsoft Visual C++ 19.14 (VS 2017 15.7) or newer is required for C++17 support")
endif()
if ((MSVC_VERSION EQUAL 1300) OR (MSVC_VERSION EQUAL 1310))
set (COMPILER vc7)
elseif (MSVC_VERSION EQUAL 1400)
@@ -92,20 +92,39 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
elseif ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
# Since Visual Studio 15 (2017), its version diverged from version of
# compiler which is 14.1; as that compiler uses the same run-time as 14.0,
# we keep its id as "vc14" to be compatibille
# we keep its id as "vc14" to be compatible
set (COMPILER vc14)
else()
message (FATAL_ERROR "Unrecognized MSVC_VERSION")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
endif()
set (COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
endif()
set (COMPILER gxx)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
if(APPLE)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
message (AUTHOR_WARNING "Apple Clang version 11.0.0 or newer is required for C++17 support")
endif()
else()
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
message (AUTHOR_WARNING "Clang version 7.0 or newer is required for C++17 support")
endif()
endif()
set (COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.1.1)
message (AUTHOR_WARNING "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
endif()
set (COMPILER icc)
else()
message (AUTHOR_WARNING "Unknown compiler - please verify C++17 support")
set (COMPILER ${CMAKE_GENERATOR})
string (REGEX REPLACE " " "" COMPILER ${COMPILER})
endif()
@@ -152,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)
@@ -226,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()
@@ -291,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()
@@ -308,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)
@@ -389,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()
@@ -403,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})
@@ -414,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.
@@ -454,18 +434,32 @@ 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()
# Macro to configure and install Standard_Version.hxx file
macro (CONFIGURE_AND_INSTALL_VERSION_HEADER)
if (DEFINED BUILD_OCCT_VERSION_EXT AND "${BUILD_OCCT_VERSION_EXT}" STREQUAL "${OCC_VERSION_STRING_EXT}" AND EXISTS "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx")
install(FILES "${OCCT_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
else()
set(BUILD_OCCT_VERSION_EXT "${OCC_VERSION_STRING_EXT}" CACHE STRING "OCCT Version string. Used only for caching, can't impact on build. For modification of version, please check adm/cmake/version.cmake" FORCE)
mark_as_advanced(BUILD_OCCT_VERSION_EXT)
string(TIMESTAMP OCCT_VERSION_DATE "%Y-%m-%d" UTC)
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/Standard_Version.hxx.in" "${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" "Standard_Version.hxx" "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
endif()
endmacro()
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()
@@ -474,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")
@@ -550,42 +533,80 @@ function (OCCT_MODULES_AND_TOOLKITS FILE_NAME TOOLKITS_NAME_SUFFIX MODULE_LIST)
set (${MODULE_LIST} ${${MODULE_LIST}} PARENT_SCOPE)
endfunction()
# Returns OCC version string from file Standard_Version.hxx (if available)
# Macro to extract git hash from the source directory
# and store it in the variable GIT_HASH
# in case if git is not found or error occurs, GIT_HASH is set to empty string
macro(OCCT_GET_GIT_HASH)
set(GIT_HASH "")
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_HASH
ERROR_VARIABLE GIT_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_ERROR)
# Check if working directory is clean
execute_process(
COMMAND ${GIT_EXECUTABLE} status --porcelain
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_STATUS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT "${GIT_STATUS}" STREQUAL "")
message(DEBUG "Git working directory is not clean. Git hash may be incorrect.")
endif()
else()
set(GIT_HASH "")
endif()
endif()
endmacro()
# Returns OCC version string
function (OCC_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT)
set (OCC_VERSION_MAJOR 7)
set (OCC_VERSION_MINOR 0)
set (OCC_VERSION_MAINTENANCE 0)
set (OCC_VERSION_DEVELOPMENT dev)
set (OCC_VERSION_COMPLETE "7.0.0")
set (STANDARD_VERSION_FILE "${CMAKE_SOURCE_DIR}/src/Standard/Standard_Version.hxx")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/Standard/Standard_Version.hxx")
set (STANDARD_VERSION_FILE "${BUILD_PATCH}/src/Standard/Standard_Version.hxx")
endif()
include (version)
set (OCC_VERSION_COMPLETE "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}")
if (EXISTS "${STANDARD_VERSION_FILE}")
foreach (SOUGHT_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE)
file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*")
string (REGEX REPLACE ".*${SOUGHT_VERSION} .*([^ ]+).*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" )
endforeach()
foreach (SOUGHT_VERSION OCC_VERSION_DEVELOPMENT OCC_VERSION_COMPLETE)
file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*")
string (REGEX REPLACE ".*${SOUGHT_VERSION} .*\"([^ ]+)\".*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" )
endforeach()
endif()
set (OCC_VERSION_MAJOR "${OCC_VERSION_MAJOR}" PARENT_SCOPE)
set (OCC_VERSION_MINOR "${OCC_VERSION_MINOR}" PARENT_SCOPE)
set (OCC_VERSION_MAINTENANCE "${OCC_VERSION_MAINTENANCE}" PARENT_SCOPE)
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
if (OCC_VERSION_DEVELOPMENT AND OCC_VERSION_COMPLETE)
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
else()
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}" PARENT_SCOPE)
set (OCCT_ON_DEVELOPMENT OFF)
if (NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "" AND NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "OCC_VERSION_DEVELOPMENT")
set (OCCT_ON_DEVELOPMENT ON)
endif()
if (${OCCT_ON_DEVELOPMENT})
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
endif()
set (SET_OCC_VERSION_DEVELOPMENT "")
if (${OCCT_ON_DEVELOPMENT})
# Use special flag from cache to turn on or off git hash extraction
if (NOT DEFINED USE_GIT_HASH)
set (USE_GIT_HASH ON CACHE BOOL "Use git hash in version string")
endif()
if (${USE_GIT_HASH})
OCCT_GET_GIT_HASH()
endif()
if (NOT "${GIT_HASH}" STREQUAL "")
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}-${GIT_HASH}")
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
else()
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}")
endif()
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}")
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
set (SET_OCC_VERSION_DEVELOPMENT "#define OCC_VERSION_DEVELOPMENT \"${OCC_VERSION_DEVELOPMENT}\"")
set (SET_OCC_VERSION_DEVELOPMENT "${SET_OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
else()
OCCT_CHECK_AND_UNSET(USE_GIT_HASH)
endif()
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
endfunction()
macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME THE_VAR_TYPE THE_MESSAGE_OF_BEING_CHECKED_PATH)
@@ -689,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}\")
@@ -833,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

@@ -3,38 +3,54 @@
# Qt is searched manually first (just determine root)
message (STATUS "Processing Qt 3-rd party")
set (USE_QT_FROM_3RDPARTY_DIR TRUE)
if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
set (3RDPARTY_QT_DIR "" CACHE PATH "The directory containing qt")
message (FATAL_ERROR "Could not find used third-party product: 3RDPARTY_QT_DIR")
set (USE_QT_FROM_3RDPARTY_DIR FALSE)
else()
# Combine directory name with absolute path and show in GUI
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
endif()
# Combine directory name with absolute path and show in GUI
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
endif()
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
# Without this setting find_package() will not work
set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
# Now we can apply standard CMake finder for Qt5. We do this mostly
# to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
if (${USE_QT_FROM_3RDPARTY_DIR})
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
# Without this setting find_package() will not work
set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
# Now we can apply standard CMake finder for Qt5. We do this mostly
# to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
else()
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml)
endif()
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)
#message (STATUS "Qt4 cmake configuration")
else()
#message (STATUS "Qt5 cmake configuration")
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()
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}")
set (USED_3RDPARTY_QT_DIR "${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

21
adm/cmake/version.cmake Normal file
View File

@@ -0,0 +1,21 @@
#======================================================================
#
# Purpose: Defines macros identifying current version of Open CASCADE
#
# OCC_VERSION_MAJOR : (integer) number identifying major version
# OCC_VERSION_MINOR : (integer) number identifying minor version
# OCC_VERSION_MAINTENANCE : (integer) number identifying maintenance version
# OCC_VERSION_DEVELOPMENT : (string) if defined, indicates development or modified version
# in case of release, remove the value
#
# Sample values of OCC_VERSION_DEVELOPMENT:
# - "dev" for development version between releases
# - "beta..." or "rc..." for beta releases or release candidates
# - "project..." for version containing project-specific fixes
#
# For development version git commit hash can be added to the version string
#======================================================================
set (OCC_VERSION_MAJOR 7 )
set (OCC_VERSION_MINOR 9 )
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")
@@ -26,7 +38,7 @@ endif()
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify VTK folder in connectin with 3RDPARTY_DIR
# specify VTK folder in connection with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_VTK_DIR PATH "The directory containing VTK")
@@ -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

@@ -142,19 +142,41 @@ proc OCCDoc_GetRelPath {thePathFrom thePathTo} {
return $thePathTo
}
# Returns OCCT version string from file Standard_Version.hxx (if available)
# Returns OCCT version string from version.cmake (if available)
proc OCCDoc_DetectCasVersion {} {
set occt_ver 6.7.0
# Default version in case the file is not found or readable
set occt_ver "7.8.0"
set occt_ver_add ""
set filename "[OCCDoc_GetSourceDir]/Standard/Standard_Version.hxx"
if { [file exists $filename] } {
set fh [open $filename "r"]
set fh_loaded [read $fh]
close $fh
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
regexp {[^/]\s*#\s*define\s+OCC_VERSION_DEVELOPMENT\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver_add
if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
# Construct path to version.cmake relative to script location
set filename "[file normalize [file dirname [info script]]/cmake/version.cmake]"
if { [file exists $filename] && [file readable $filename] } {
if {[catch {
set fh [open $filename "r"]
set fh_loaded [read $fh]
close $fh
# Use more robust regular expressions
regexp {OCC_VERSION_MAJOR\s+(\d+)} $fh_loaded -> major
regexp {OCC_VERSION_MINOR\s+(\d+)} $fh_loaded -> minor
regexp {OCC_VERSION_MAINTENANCE\s+(\d+)} $fh_loaded -> maint
regexp {OCC_VERSION_DEVELOPMENT\s+\"([^\"]+)\"} $fh_loaded -> occt_ver_add
if {[info exists major] && [info exists minor] && [info exists maint]} {
puts "Info: Open CASCADE Technology version $major.$minor.$maint"
set occt_ver "$major.$minor.$maint"
if { [info exists occt_ver_add] && $occt_ver_add != "" } {
set occt_ver ${occt_ver}.$occt_ver_add
}
}
} err]} {
puts "Warning: Error reading version from $filename: $err"
}
} else {
puts "Warning: Version file $filename not found or not readable"
}
return $occt_ver
}

View File

@@ -67,8 +67,9 @@ if ["%toCMake%"] == ["1"] (
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
rem Get OCCT version
call "%~dp0build_common.bat"
set "aGitBranch="
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
for %%s in (%anNdkAbiList%) do (

View File

@@ -0,0 +1,8 @@
@echo OFF
rem Extract version info from version.cmake
for /f tokens^=2^ delims^=^" %%i in ('findstr OCC_VERSION_DEVELOPMENT "%~dp0\..\cmake\version.cmake"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MAJOR "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MAJOR=%%i" )
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MINOR "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MINOR=%%i" )
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MAINTENANCE "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MAINTENANCE=%%i" )
set "anOcctVersion=%OCC_VERSION_MAJOR%.%OCC_VERSION_MINOR%.%OCC_VERSION_MAINTENANCE%"

View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Ensure script dir is defined
if [ -z "$aScriptDir" ]; then
aScriptDir=$(dirname "$0")
fi
# Check if version file exists
versionFile="$aScriptDir/../cmake/version.cmake"
if [ ! -f "$versionFile" ]; then
echo "Error: version.cmake not found"
exit 1
fi
# Extract version info from version.cmake
OCC_VERSION_MAJOR=$(awk '/set.*OCC_VERSION_MAJOR/ {print $3}' "$versionFile")
OCC_VERSION_MINOR=$(awk '/set.*OCC_VERSION_MINOR/ {print $3}' "$versionFile")
OCC_VERSION_MAINTENANCE=$(awk '/set.*OCC_VERSION_MAINTENANCE/ {print $3}' "$versionFile")
anOcctVerSuffix=$(awk '/set.*OCC_VERSION_DEVELOPMENT/ {
if (NF > 2) {
gsub(/[)" ]/, "", $3)
print $3
} else {
print ""
}
}' "$versionFile")
# Combine version string
anOcctVersion="${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}"

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

@@ -49,8 +49,7 @@ if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
source "${aScriptDir}/ios_custom.sh"
fi
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
source "${aScriptDir}/build_common.sh"
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")

View File

@@ -51,8 +51,7 @@ if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
source "${aScriptDir}/macos_custom.sh"
fi
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
source "${aScriptDir}/build_common.sh"
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")

View File

@@ -53,9 +53,8 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
call "%~dp0build_common.bat"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
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"

View File

@@ -55,8 +55,8 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
call "%~dp0build_common.bat"
set "aGitBranch="
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"

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

@@ -1,6 +1,5 @@
// Created on: 2002-07-09
// Created by: Andrey BETENEV
// Copyright (c) 2002-2014 OPEN CASCADE SAS
// Created on: @OCCT_VERSION_DATE@
// Copyright (c) 2002-2025 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -37,21 +36,21 @@ major, minor, and patch number
#define _Standard_Version_HeaderFile
// Primary definitions
#define OCC_VERSION_MAJOR 7
#define OCC_VERSION_MINOR 8
#define OCC_VERSION_MAINTENANCE 2
#define OCC_VERSION_MAJOR @OCC_VERSION_MAJOR@
#define OCC_VERSION_MINOR @OCC_VERSION_MINOR@
#define OCC_VERSION_MAINTENANCE @OCC_VERSION_MAINTENANCE@
//! This macro must be commented in official release, and set to non-empty
//! string in other situations, to identify specifics of the version, e.g.:
//! - "dev" for development version between releases
//! - "beta..." or "rc..." for beta releases or release candidates
//! - "project..." for version containing project-specific fixes
#define OCC_VERSION_DEVELOPMENT "dev"
@SET_OCC_VERSION_DEVELOPMENT@
// Derived (manually): version as real and string (major.minor)
#define OCC_VERSION 7.8
#define OCC_VERSION_STRING "7.8"
#define OCC_VERSION_COMPLETE "7.8.2"
#define OCC_VERSION @OCC_VERSION_MAJOR@.@OCC_VERSION_MINOR@
#define OCC_VERSION_STRING "@OCC_VERSION_MAJOR@.@OCC_VERSION_MINOR@"
#define OCC_VERSION_COMPLETE "@OCC_VERSION_MAJOR@.@OCC_VERSION_MINOR@.@OCC_VERSION_MAINTENANCE@"
//! Derived: extended version as string ("major.minor.maintenance.dev")
#ifdef OCC_VERSION_DEVELOPMENT

View File

@@ -23,7 +23,7 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export CSF_OCCTBinPath="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
export CSF_OCCTLibPath="@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@"
export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/inc"
export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@"
export CSF_OCCTResourcePath="@CMAKE_SOURCE_DIR@/src"
export CSF_OCCTDataPath="@CMAKE_SOURCE_DIR@/data"
export CSF_OCCTSamplesPath="@CMAKE_SOURCE_DIR@/samples"

View File

@@ -1,10 +1,21 @@
#!/bin/bash
aCurrentPath="$PWD"
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
cd ${aCurrentPath}
# ----- For compatibility with external application using CASROOT -----
if [ "${CASROOT}" == "" ]; then
export CASROOT="${aScriptPath}"
# Get the last directory name from the path
lastDir=$(basename "$aScriptPath")
# Check if last directory is exactly bin, bind, or bini
if [ "$lastDir" = "bin" ] || [ "$lastDir" = "bind" ] || [ "$lastDir" = "bini" ]; then
# If path contains binary folder, go one level up
export CASROOT=$(cd "$aScriptPath/.." && pwd)
else
# Keep current location
export CASROOT="${aScriptPath}"
fi
cd ${aCurrentPath}
fi
# ----- Define path to 3rdparty products -----

View File

@@ -1,10 +1,21 @@
#!/bin/bash
aCurrentPath="$PWD"
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
cd ${aCurrentPath}
# ----- For compatibility with external application using CASROOT -----
if [ "${CASROOT}" == "" ]; then
export CASROOT="@INSTALL_DIR@"
# Get the last directory name from the path
lastDir=$(basename "$aScriptPath")
# Check if last directory is exactly bin, bind, or bini
if [ "$lastDir" = "bin" ] || [ "$lastDir" = "bind" ] || [ "$lastDir" = "bini" ]; then
# If path contains binary folder, go one level up
export CASROOT=$(cd "$aScriptPath/.." && pwd)
else
# Keep current location
export CASROOT="${aScriptPath}"
fi
cd ${aCurrentPath}
fi
# ----- Define path to 3rdparty products -----

View File

@@ -20,7 +20,7 @@ BEGIN
VALUE "LegalCopyright", "\251 OPEN CASCADE SAS\000"
VALUE "ProductName", "Open CASCADE Technology\000"
VALUE "ProductVersion", OCC_VERSION_STRING_EXT "\000"
VALUE "OfficialSite", "www.opencascade.com\000"
VALUE "OfficialSite", "www.occt3d.com\000"
END
END
BLOCK "VarFileInfo"

View File

@@ -12,54 +12,70 @@ The easiest way to install third-party libraries is to download archive with pre
from [Development Portal](https://dev.opencascade.org/resources/download/3rd-party-components).
You can also build third-party libraries from their sources, see @ref build_upgrade_building_3rdparty for instructions.
On Linux and macOS we recommend to use libraries maintained by distributive developers, when possible.
On Linux and macOS we recommend using libraries maintained by distributive developers when possible.
@section build_occt_win_cmake Building with CMake tool
@section build_requirements System Requirements
This chapter describes the [CMake](https://cmake.org/download/)-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources.
OCCT requires CMake version 3.1 or later.
* **CMake** version 3.10 or later (3.16+ recommended for precompiled headers support)
* C++11 compliant compiler (required)
* Supported platforms and compilers:
* Windows:
- Visual Studio 2015 or later
- MinGW-w64 7.3 or later
* Linux:
- GCC 5.0 or later
- Clang 3.8 or later
* macOS:
- Apple Clang 9.0 or later
- Xcode 9.0 or later
CMake is a tool that generates the actual project files for the selected target build system (e.g. Unix makefiles) or IDE (e.g. Visual Studio 2010).
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
@section build_occt_cmake Building with CMake
This chapter describes the [CMake](https://cmake.org/download/)-based build process, which is the standard way to produce OCCT binaries from sources.
CMake is a tool that generates project files for the selected target build system (e.g. Unix makefiles) or IDE (e.g. Visual Studio).
Here we describe the build procedure using Windows platform with Visual Studio as an example.
However, CMake is cross-platform and can be used to build OCCT on Linux and macOS in essentially the same way.
CMake deals with three directories: source, build or binary and installation.
* The source directory is where the sources of OCCT are located in your file system;
* The build or binary directory is where all files created during CMake configuration and generation process will be located. The mentioned process will be described below.
* The installation directory is where binaries will be installed after building the *INSTALL* project that is created by CMake generation process, along with header files and resources required for OCCT use in applications.
* The build or binary directory is where all files created during CMake configuration and generation process will be located;
* The installation directory is where binaries will be installed after building the *INSTALL* project, along with header files and resources required for OCCT use in applications.
The good practice is not to use the source directory as a build one.
Different configurations should be built in different build directories to avoid conflicts.
It is however possible to choose one installation directory for several configurations of OCCT (differentiated by platform, bitness, compiler and build type), for example:
Different configurations should be built in different build directories to avoid conflicts.
For example:
d:/occt/ - the source directory
d:/tmp/occt-build-vc10-x64 - the build directory with the generated
d:/tmp/occt-build-vc14-x64 - the build directory with the generated
solution and other intermediate files created during a CMake tool working
d:/occt-install - the installation directory that is
able to contain several OCCT configurations
d:/occt-install - the installation directory that can
contain several OCCT configurations
@subsection build_cmake_conf Configuration process
For unexperienced users we recommend to start with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
For inexperienced users we recommend starting with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* can also be used.
If the command-line tool is used, run the tool from the build directory with a single argument indicating the source (relative or absolute path) directory, and press *c* to configure:
If the command-line tool is used, run it from the build directory with a single argument indicating the source directory:
cd d:/tmp/occt-build-vc10-x64
cd d:/tmp/occt-build-vc14-x64
ccmake d:/occt
Then press *c* to configure.
@figure{/build/build_occt/images/cmake_image000.png}
If the GUI tool is used, run this tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**:
If the GUI tool is used, run this tool without additional arguments and specify the source directory by clicking **Browse Source** and the build directory by clicking **Browse Build**:
@figure{/build/build_occt/images/cmake_image001.png}
@note Each configuration of the project should be built in its own directory.
When building multiple configurations it is suggested to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc10</i>).
When building multiple configurations it is suggested to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc14</i>).
Once the source and build directories are selected, "Configure" button should be pressed in order to start manual configuration process.
It begins with selection of a target configurator. It is "Visual Studio 10 2010 Win64" in our example.
It begins with selection of a target configurator. It is "Visual Studio 14 2015 Win64" in our example.
@figure{/build/build_occt/images/cmake_image002.png}
@@ -86,24 +102,29 @@ The following table gives the full list of environment variables used at the con
| Variable | Type | Purpose |
|----------|------|---------|
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREETYPE | Boolean | Indicates whether FreeType product should be used in OCCT for text rendering |
| USE_FREEIMAGE | Boolean | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
| USE_OPENVR | Boolean | Indicates whether OpenVR product should be used in OCCT visualization module for support of Virtual Reality |
| USE_OPENGL | Boolean | Indicates whether TKOpenGl graphic driver using OpenGL library (desktop) should be built within OCCT visualization module |
| USE_GLES2 | Boolean | Indicates whether TKOpenGles graphic driver using OpenGL ES library (embedded OpenGL) should be built within OCCT visualization module |
| USE_RAPIDJSON | Boolean | Indicates whether RapidJSON product should be used in OCCT Data Exchange module for support of glTF mesh file format |
| USE_DRACO | Boolean | Indicates whether Draco product should be used in OCCT Data Exchange module for support of Draco compression in glTF mesh file format |
| USE_TK | Boolean | Indicates whether Tcl/Tk product should be used in OCCT Draw Harness module for user interface (in addition to Tcl, which is mandatory for Draw Harness) |
| USE_TBB | Boolean | Indicates whether TBB (Threading Building Blocks) 3rd party is used or not. Note that OCCT remains parallel even without TBB product |
| USE_VTK | Boolean | Indicates whether VTK 3rd party is used or not. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
| USE_FREETYPE | Boolean | Indicates whether FreeType product should be used in OCCT for text rendering |
| USE_FREEIMAGE | Boolean | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats |
| USE_FFMPEG | Boolean | Indicates whether FFmpeg framework should be used for video encoding/decoding support |
| USE_OPENVR | Boolean | Indicates whether OpenVR product should be used in OCCT visualization module for VR support |
| USE_OPENGL | Boolean | Indicates whether TKOpenGl graphic driver using OpenGL library (desktop) should be built |
| USE_GLES2 | Boolean | Indicates whether TKOpenGles graphic driver using OpenGL ES library should be built |
| USE_RAPIDJSON | Boolean | Indicates whether RapidJSON product should be used for JSON format support |
| USE_DRACO | Boolean | Indicates whether Draco mesh compression library should be used |
| USE_TK | Boolean | Indicates whether Tcl/Tk product should be used in Draw Harness for user interface |
| USE_TBB | Boolean | Indicates whether TBB (Threading Building Blocks) should be used for parallel computations |
| USE_VTK | Boolean | Indicates whether VTK bridge should be built |
| BUILD_USE_PCH | Boolean | Enable/disable use of precompiled headers. Requires CMake 3.16 or later |
| BUILD_USE_VCPKG | Boolean | Use vcpkg for managing third-party dependencies |
| BUILD_INCLUDE_SYMLINK | Boolean | Use symbolic links instead of copies for header files in build directory |
| BUILD_MODULE_<MODULE>| Boolean | Indicates whether the corresponding OCCT module should be built |
| BUILD_LIBRARY_TYPE | String | Specifies library type ("Shared" or "Static") |
| BUILD_CPP_STANDARD | String | Select C++ standard (C++11, C++14, C++17, C++20, C++23) |
| 3RDPARTY_DIR | Path | Defines the root directory where all required 3rd party products will be searched. Once you define this path it is very convenient to click "Configure" button in order to let CMake automatically detect all necessary products|
| 3RDPARTY_FREETYPE_* | Path | Path to FreeType binaries |
| 3RDPARTY_TCL_* 3RDPARTY_TK_* | Path | Path to Tcl/Tk binaries |
| 3RDPARTY_FREEIMAGE* | Path | Path to FreeImage binaries |
| 3RDPARTY_TBB* | Path | Path to TBB binaries |
| 3RDPARTY_VTK_* | Path | Path to VTK binaries |
| BUILD_MODULE_<MODULE>| Boolean | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in @ref user_guides |
| BUILD_LIBRARY_TYPE | String | Specifies the type of library to be created. "Shared" libraries are linked dynamically and loaded at runtime. "Static" libraries are archives of object files used when linking other targets. Note that Draw Harness plugin system is incompatible with "Static" builds, and therefore it is disabled for these builds.|
| BUILD_ADDITIONAL_TOOLKITS | String | Semicolon-separated individual toolkits to include into build process. If you want to build some particular libraries (toolkits) only, then you may uncheck all modules in the corresponding *BUILD_MODUE_\<MODULE\>* options and provide the list of necessary libraries here. Of course, all dependencies will be resolved automatically |
| BUILD_YACCLEX | Boolean | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this option leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_SAMPLES_MFC | Boolean | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
@@ -113,7 +134,6 @@ The following table gives the full list of environment variables used at the con
| BUILD_PATCH | Path | Points to the directory recognized as a "patch" for OCCT. If specified, the files from this directory take precedence over the corresponding native OCCT sources. This way you are able to introduce patches to Open CASCADE Technology not affecting the original source distribution |
| BUILD_WITH_DEBUG | Boolean | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| BUILD_CPP_STANDARD | String | Employ corresponding c++ standard (C++11, C++14, ..C++23) for building OCCT |
| CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |
@@ -211,7 +231,7 @@ The directory structure is as follows:
samples - samples
src - all required source files for OCCT
tests - OCCT test suite
win32\vc10\bind - binary files (installed 3rdparties and occt)
win32\vc14\bind - binary files (installed 3rdparties and occt)
\libd - libraries (installed 3rdparties and occt)
@note The above example is given for debug configuration.
@@ -219,7 +239,7 @@ However, it is generally safe to use the same installation directory for the rel
In the latter case the contents of install directory will be enriched with subdirectories and files related to the release configuration.
In particular, the binaries directory win64 will be expanded as follows:
\win32\vc10\bind
\win32\vc14\bind
\libd
\bin
\lib
@@ -235,10 +255,11 @@ This section describes the steps to build OCCT libraries for Android from a comp
The steps on Windows 7 and Ubuntu 15.10 are similar. There is the only one difference: makefiles are built with mingw32-make on Windows and native GNU make on Ubuntu.
Required tools (download and install if it is required):
- CMake 3.0+
- [Cross-compilation toolchain for CMake](https://github.com/taka-no-me/android-cmake)
- [Android NDK r12+](https://developer.android.com/ndk/downloads)
- GNU Make: MinGW v4.82+ for [Windows](https://www.mingw-w64.org/), GNU Make 4.0 for Ubuntu.
- CMake 3.10+ (3.16+ recommended)
- Android NDK r19+
- Android SDK API level 21+
- For Windows: MinGW-w64 7.3+ or Visual Studio 2015+
- For Linux/macOS: GNU Make 4.0+
Run GUI tool provided by CMake and:
- Specify the root folder of OCCT (`$CASROOT`, which contains *CMakelists.txt* file) by clicking **Browse Source**.
@@ -263,9 +284,9 @@ specify `CMAKE_MAKE_PROGRAM` to mingw32-make executable.
@figure{/build/build_occt/images/android_image005.png}
How to configure OCCT, see @ref build_cmake_conf "Configure" section taking into account the specific configuration variables for Android:
- `ANDROID_ABI` = `armeabi-v7a`
- `ANDROID_NATIVE_API_LEVEL` = `15`
- `ANDROID_NDK_LAYOUT` is equal to `CMAKE_BUILD_TYPE` variable
- `ANDROID_ABI` = `armeabi-v7a`, `arm64-v8a`, `x86`, or `x86_64`
- `ANDROID_PLATFORM` = `android-21` (minimum supported API level)
- `ANDROID_STL` = `c++_shared` (recommended)
- `BUILD_MODULE_Draw` = `OFF`
@figure{/build/build_occt/images/android_image006.png}

View File

@@ -233,13 +233,18 @@ void Average (const Standard_Real** theArray,
To improve the open source readability and, consequently, maintainability, the following set of rules is applied.
### Clang-format [MANDATORY]
The source code should be formatted using the clang-format tool with the configuration file provided in the OCCT repository.
The version of clang-format should be 18.1.8 or higher.
### International language [MANDATORY]
All comments in all sources must be in English.
### Line length
Try to stay within the limit of 120 characters per line in all sources.
Try to stay within the limit of 100 characters per line in all sources.
### C++ style comments
@@ -254,49 +259,6 @@ Delete unused code instead of commenting it or using \#define.
Indentation in all sources should be set to two space characters.
Use of tabulation characters for indentation is disallowed.
### Separating spaces
Punctuation rules follow the rules of the English language.
* C/C++ reserved words, commas, colons and semicolons should be followed by a space character if they are not at the end of a line.
* There should be no space characters after '(' and before ')'. Closing and opening brackets should be separated by a space character.
* For better readability it is also recommended to surround conventional operators by a space character.
Examples:
~~~~{.cpp}
while (true) // NOT: while( true ) ...
{
DoSomething (theA, theB, theC, theD); // NOT: DoSomething(theA,theB,theC,theD);
}
for (anIter = 0; anIter < 10; ++anIter) // NOT: for (anIter=0;anIter<10;++anIter){
{
theA = (theB + theC) * theD; // NOT: theA=(theB+theC)*theD
}
~~~~
### Declaration of pointers and references
In declarations of simple pointers and references put asterisk (*) or ampersand (&) right after the type without extra space.
Since declaration of several variables with mixed pointer types contrudicts this rule, it should be avoided. Instead, declare each variable independently with fully qualified type.
Examples:
~~~~{.cpp}
Standard_Integer *theVariable; // not recommended
Standard_Integer * theVariable; // not recommended
Standard_Integer* theVariable; // this is OK
Standard_Integer *&theVariable; // not recommended
Standard_Integer *& theVariable; // not recommended
Standard_Integer*& theVariable; // this is OK
Standard_Integer **theVariable; // not recommended
Standard_Integer ** theVariable; // not recommended
Standard_Integer** theVariable; // this is OK
Standard_Integer *theA, theB, **theC; // not recommended (declare each variable independently)
~~~~
### Separate logical blocks
Separate logical blocks of code with one blank line and comments.
@@ -330,19 +292,16 @@ Each descriptive block should contain at least a function name and purpose descr
See the following example:
~~~~{.cpp}
// =======================================================================
// function : TellMeSmthGood
// purpose : Gives me good news
// =======================================================================
// ================================================================================================
void TellMeSmthGood()
{
...
}
// =======================================================================
// function : TellMeSmthBad
// purpose : Gives me bad news
// =======================================================================
// ================================================================================================
void TellMeSmthBad()
{
...
@@ -400,23 +359,6 @@ if (THE_LIMIT == theValue) // bad style (global constant vs. variable)
if (theValue == THE_LIMIT) // OK
~~~~
### Alignment
Use alignment wherever it enhances the readability. See the following example:
~~~~{.cpp}
MyPackage_MyClass anObject;
Standard_Real aMinimum = 0.0;
Standard_Integer aVal = theVal;
switch (aVal)
{
case 0: computeSomething(); break;
case 12: computeSomethingElse (aMinimum); break;
case 3:
default: computeSomethingElseYet(); break;
}
~~~~
### Indentation of comments
Comments should be indented in the same way as the code to which they refer or they can be in the same line if they are short.

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

@@ -7,7 +7,7 @@ Upgrade from older OCCT versions {#occt__upgrade}
This document provides technical details on changes made in particular versions of OCCT. It can help to upgrade user applications based on previous versions of OCCT to newer ones.
@ref upgrade_occt780 "SEEK TO THE LAST CHAPTER (UPGRADE TO 7.8.0)"
@ref upgrade_occt790 "SEEK TO THE LAST CHAPTER (UPGRADE TO 7.9.0)"
@subsection upgrade_intro_precautions Precautions
@@ -2409,3 +2409,77 @@ The most recommended manager is `JeMalloc`. To use it with a plugin system, like
`BUILD_OPT_PROFILE` is a new variable to define optimization level. Available profiles:
* `Default` - specializes only in quality-dependent parameters for the compiler.
* `Production` - specializes in performance and quality-dependent parameters for the compiler and linker.
@section upgrade_occt790 Upgrade to OCCT 7.9.0
@subsection upgrade_790_code_formatting Code Formatting update
The entire code base has been formatted with `clang-format` 18.1.8 (Windows) using settings available in the root of the repository.
Most custom patches on top of previous releases will likely have merge conflicts.
When encountering merge conflicts, it is recommended to use `clang-format` to format the code.
To maintain patches, it is recommended to merge them into the main repository as part of a contribution. See [Get Involved](https://dev.opencascade.org/get_involved) and [Contribution Guide](https://github.com/Open-Cascade-SAS/OCCT/discussions/36).
@subsection upgrade_790_migration Migration to GitHub
The OCCT repository has been migrated to GitHub. The new repository is available at [GitHub](https://github.com/Open-Cascade-SAS/OCCT).
The old repository will be available for some time, but it is recommended to use the new repository for all new changes.
Contribution to the new repository is available through the GitHub interface - see [Get Involved](https://dev.opencascade.org/get_involved) and [Contribution Guide](https://github.com/Open-Cascade-SAS/OCCT/discussions/36).
@subsection upgrade_790_configuration GenProj no longer supported
The `GenProj` tool is no longer supported. It is recommended to use CMake for building OCCT.
In case of problems, please refer to the [CMake Guide](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html).
@subsection upgrade_790_modeling_scale_exception Disabling exception for transformation with scale
The exception for transformation with scale has been disabled by default.
These exceptions were enabled in OCCT 7.6.0 for all cases of applying a transformation on a `TopoDS_Shape` with scale or negative determinant.
Now the exceptions are disabled by default but can be enabled by changing the parameter in the method which applies the transformation on `TopoDS_Shape`.
@subsection upgrade_790_de_wrapper Migration of DE_Wrapper classes
The DE Wrapper classes have been reorganized to follow a single style throughout the OCCT open source and commercial code.
All DE formats starting from 7.8.0 were grouped into their own TKs with the `TKDE` prefix.
Now all DE Wrapper interfaces have moved to their own package with the `DE` prefix.
DE Wrapper classes follow the pattern: `DE<Format>_Parameters`, `DE<Format>_Provider`, and `DE<Format>_ConfigurationNode`.
Example: `DESTEP_Parameters`, `DESTEP_Provider`, `DESTEP_ConfigurationNode`.
@subsection upgrade_790_de_shape_healing Migration of shape healing parameters
The shape healing parameters have migrated from the resource file to the DE interface.
The previous implementation was based on the resource file or `Interface_Static`.
Now the parameters are stored in the `DE_ShapeFixParameters` structure with the option to use a string-string map to store extra parameters.
To use the previous interface, use code similar to:
~~~~{.cpp}
STEPControl_Reader aReader;
XSAlgo_ShapeProcessor::ProcessingData aProcessingData =
XSAlgo_ShapeProcessor::ReadProcessingData("read.step.resource.name", "read.step.sequence");
aReader.SetShapeFixParameters(std::move(aProcessingData.first));
aReader.SetShapeProcessFlags(aProcessingData.second);
~~~~
It is recommended to use the new interface to store parameters in the `DE_ShapeFixParameters` structure directly.
@subsection upgrade_790_de_interface_static Migration of DE parameters from Interface_Static
During transfer operations, all parameters that were stored in `Interface_Static` have moved to their own DE structure.
The parameters are read only once during initialization and stored in the model.
Parameters are now available as part of the DE Wrapper interface, for example: `DESTEP_Parameters`, `DEIGES_Parameters`.
Code samples showing how to set the parameters can be found in `DESTEP_Provider` and `DEIGES_Provider`.
@subsection upgrade_790_general_handle_types Deprecated Handle types
The `Handle_*` type names have been deprecated in favor of directly using the macro.
The `Handle_*` type names are still available, but it is recommended to use the macro directly.
Example:
~~~~{.cpp}
Handle(TDataStd_Application) anApp = new TDataStd_Application(); // recommended
Handle_TDataStd_Application anApp = new TDataStd_Application(); // deprecated
~~~~
@subsection upgrade_790_general_map NCollection_Map algorithm method migration
The `NCollection_Map` class has been reorganized to migrate extra methods to the `NCollection_MapAlgo` class.
Boolean operations on maps are now available in the `NCollection_MapAlgo` class.

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
@@ -197,7 +197,7 @@ All registered providers are set to the map with information about its vendor an
@subsubsection occt_de_wrapper_3_3_1 Registering providers. Code sample
It is nesessary to register only one ConfigurationNode for all needed formats.
It is necessary to register only one ConfigurationNode for all needed formats.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
Handle(DE_ConfigurationNode) aNode = new DESTEP_ConfigurationNode();

View File

@@ -6480,7 +6480,7 @@ blend b b 2 .
==fleche : 0.001
==tolblend 0.01 0.0001 1e-05 0.001
==Pick an object
# click on the edge you want ot fillet
# click on the edge you want to fillet
==COMPUTE: temps total 0.1s dont :
==- Init + ExtentAnalyse 0s

View File

@@ -87,7 +87,7 @@ Note that if a given value of linear deflection is less than shape tolerance the
The application should provide deflection parameters to compute a satisfactory mesh. Angular deflection is relatively simple and allows using a default value (12-20 degrees). Linear deflection has an absolute meaning and the application should provide the correct value for its models. Giving small values may result in a too huge mesh (consuming a lot of memory, which results in a long computation time and slow rendering) while big values result in an ugly mesh.
For an application working in dimensions known in advance it can be reasonable to use the absolute linear deflection for all models. This provides meshes according to metrics and precision used in the application (for example, it it is known that the model will be stored in meters, 0.004 m is enough for most tasks).
For an application working in dimensions known in advance it can be reasonable to use the absolute linear deflection for all models. This provides meshes according to metrics and precision used in the application (for example, it is known that the model will be stored in meters, 0.004 m is enough for most tasks).
However, an application that imports models created in other applications may not use the same deflection for all models. Note that actually this is an abnormal situation and this application is probably just a viewer for CAD models with dimensions varying by an order of magnitude. This problem can be solved by introducing the concept of a relative linear deflection with some LOD (level of detail). The level of detail is a scale factor for absolute deflection, which is applied to model dimensions.

View File

@@ -2782,7 +2782,7 @@ The *TObj* sources are distributed in the following packages:
* **External links** -- references from one data structure to another data structure in another document.
To store these references properly, a label must also contain an external link attribute.
* **Father** -- a label, from which other labels have been created. The other labels are, by definition, the children of this label.
* **Framework** -- a group of co-operating classes which enable a design to be re-used for a given category of problem. The framework guides the architecture of the application by breaking it up into abstract classes, each of which has different responsibilities and collaborates in a predefined way. Application developer creates a specialized framework by:
* **Framework** -- a group of co-operating classes which enable a design to be reused for a given category of problem. The framework guides the architecture of the application by breaking it up into abstract classes, each of which has different responsibilities and collaborates in a predefined way. Application developer creates a specialized framework by:
* defining new classes which inherit from these abstract classes
* composing framework class instances
* implementing the services required by the framework.

View File

@@ -459,7 +459,7 @@ Boolean flag regulating translation of entities that define tessellated geometry
* TRIANGULATED_FACE
* COMPLEX_TRIANGULATED_FACE
Tesselated geometry is attached to shapes as objects of <i>Poly_Triangulation</i> type using STEP links.
Tessellated geometry is attached to shapes as objects of <i>Poly_Triangulation</i> type using STEP links.
* 0 (Off) -- do not translate
* 1 (On) -- translate
@@ -1020,7 +1020,7 @@ Boolean flag regulating writing of entities that define tessellated geometry:
* TESSELLATED_SOLID
* TRIANGULATED_FACE
Tesselated geometry is taken as objects of <i>Poly_Triangulation type</i> from the active <i>TopoDS_Face</i> triangulation.
Tessellated geometry is taken as objects of <i>Poly_Triangulation type</i> from the active <i>TopoDS_Face</i> triangulation.
* 0 (Off) -- do not write
* 1 (On) -- write

View File

@@ -3,7 +3,11 @@ CONFIG += debug_and_release qt
TARGET = FuncDemo
SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
isEmpty(CSF_OCCTSamplesPath) {
SAMPLESROOT = $$PWD/..
} else {
SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
}
HEADERS = src/*.h
SOURCES = src/*.cpp

View File

@@ -3,7 +3,11 @@ CONFIG += debug_and_release qt
TARGET = IESample
SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
isEmpty(CSF_OCCTSamplesPath) {
SAMPLESROOT = $$PWD/..
} else {
SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
}
HEADERS = $${SAMPLESROOT}/Common/src/*.h \
$${SAMPLESROOT}/Interface/src/*.h

View File

@@ -9,7 +9,11 @@ greaterThan(QT_MAJOR_VERSION, 4) {
TARGET = OCCTOverview
SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
isEmpty(CSF_OCCTSamplesPath) {
SAMPLESROOT = $$PWD/..
} else {
SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
}
HEADERS = ./src/*.h \

View File

@@ -3,7 +3,11 @@ CONFIG += debug_and_release qt
TARGET = Tutorial
SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
isEmpty(CSF_OCCTSamplesPath) {
SAMPLESROOT = $$PWD/..
} else {
SAMPLESROOT = $$quote($$(CSF_OCCTSamplesPath)/qt)
}
HEADERS = src/*.h \
$${SAMPLESROOT}/Common/src/*.h \

View File

@@ -18,10 +18,8 @@
IMPLEMENT_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
// =======================================================================
// function : AIS_GlobalStatus
// purpose :
// =======================================================================
//=================================================================================================
AIS_GlobalStatus::AIS_GlobalStatus()
: myDispMode(0),
myIsHilit(Standard_False),

View File

@@ -937,6 +937,11 @@ void AIS_InteractiveContext::RecomputePrsOnly(const Handle(AIS_InteractiveObject
{
myMainVwr->Update();
}
if (!myMainVwr->ActiveViews().IsEmpty())
{
theIObj->RecomputeTransformation(myMainVwr->ActiveViewIterator().Value()->Camera());
}
}
//=================================================================================================
@@ -3277,10 +3282,8 @@ void AIS_InteractiveContext::AddOrRemoveSelected(const Handle(SelectMgr_EntityOw
}
}
// =======================================================================
// function : SetSelectedState
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean AIS_InteractiveContext::SetSelectedState(
const Handle(SelectMgr_EntityOwner)& theEntity,
const Standard_Boolean theIsSelected)
@@ -3671,10 +3674,8 @@ void AIS_InteractiveContext::SetSelectionModeActive(
(*aStat)->AddSelectionMode(theMode);
}
// ============================================================================
// function : Activate
// purpose :
// ============================================================================
//=================================================================================================
void AIS_InteractiveContext::Activate(const Standard_Integer theMode,
const Standard_Boolean theIsForce)
{
@@ -3687,10 +3688,8 @@ void AIS_InteractiveContext::Activate(const Standard_Integer theMode,
}
}
// ============================================================================
// function : Deactivate
// purpose :
// ============================================================================
//=================================================================================================
void AIS_InteractiveContext::Deactivate(const Standard_Integer theMode)
{
AIS_ListOfInteractive aDisplayedObjects;
@@ -3701,10 +3700,8 @@ void AIS_InteractiveContext::Deactivate(const Standard_Integer theMode)
}
}
// ============================================================================
// function : Deactivate
// purpose :
// ============================================================================
//=================================================================================================
void AIS_InteractiveContext::Deactivate()
{
AIS_ListOfInteractive aDisplayedObjects;

View File

@@ -34,10 +34,8 @@
IMPLEMENT_STANDARD_RTTIEXT(AIS_LightSource, AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(AIS_LightSourceOwner, SelectMgr_EntityOwner)
// =======================================================================
// function : AIS_LightSourceOwner
// purpose :
// =======================================================================
//=================================================================================================
AIS_LightSourceOwner::AIS_LightSourceOwner(const Handle(AIS_LightSource)& theObject,
Standard_Integer thePriority)
: SelectMgr_EntityOwner((const Handle(SelectMgr_SelectableObject)&)theObject, thePriority)
@@ -45,10 +43,8 @@ AIS_LightSourceOwner::AIS_LightSourceOwner(const Handle(AIS_LightSource)& theObj
//
}
// =======================================================================
// function : HandleMouseClick
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean AIS_LightSourceOwner::HandleMouseClick(const Graphic3d_Vec2i&,
Aspect_VKeyMouse theKey,
Aspect_VKeyFlags theFlags,
@@ -167,10 +163,8 @@ Standard_Boolean AIS_LightSourceOwner::IsForcedHilight() const
return Standard_False;
}
// =======================================================================
// function : Constructor
// purpose :
// =======================================================================
//=================================================================================================
AIS_LightSource::AIS_LightSource(const Handle(Graphic3d_CLight)& theLight)
: myLightSource(theLight),
myCodirMarkerType(Aspect_TOM_X),
@@ -295,10 +289,8 @@ Standard_Boolean AIS_LightSource::ProcessDragging(const Handle(AIS_InteractiveCo
return Standard_False;
}
// =======================================================================
// function : updateLightAspects
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::updateLightAspects()
{
const Quantity_Color aBaseColor = myLightSource->Color();
@@ -333,10 +325,8 @@ void AIS_LightSource::updateLightAspects()
SynchronizeAspects();
}
// =======================================================================
// function : updateLightTransformPersistence
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::updateLightTransformPersistence()
{
Handle(Graphic3d_TransformPers) aTrsfPers = myTransformPersistence;
@@ -421,10 +411,8 @@ void AIS_LightSource::updateLightTransformPersistence()
SetTransformPersistence(aTrsfPers);
}
// =======================================================================
// function : updateLightLocalTransformation
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::updateLightLocalTransformation()
{
myLocalTransformation.Nullify();
@@ -470,10 +458,8 @@ void AIS_LightSource::updateLightLocalTransformation()
UpdateTransformation();
}
// =======================================================================
// function : setLocalTransformation
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::setLocalTransformation(const Handle(TopLoc_Datum3D)& theTrsf)
{
const gp_Trsf aTrsf = !theTrsf.IsNull() ? theTrsf->Transformation() : gp_Trsf();
@@ -513,10 +499,8 @@ void AIS_LightSource::setLocalTransformation(const Handle(TopLoc_Datum3D)& theTr
updateLightTransformPersistence();
}
// =======================================================================
// function : Compute
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::Compute(const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
@@ -559,10 +543,8 @@ void AIS_LightSource::Compute(const Handle(PrsMgr_PresentationManager)&,
}
}
// =======================================================================
// function : computeAmbient
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::computeAmbient(const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
@@ -635,10 +617,8 @@ void AIS_LightSource::computeAmbient(const Handle(Prs3d_Presentation)& thePrs,
}
}
// =======================================================================
// function : computeDirectional
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::computeDirectional(const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
@@ -763,10 +743,8 @@ void AIS_LightSource::computeDirectional(const Handle(Prs3d_Presentation)& thePr
}
}
// =======================================================================
// function : computePositional
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::computePositional(const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
@@ -792,10 +770,8 @@ void AIS_LightSource::computePositional(const Handle(Prs3d_Presentation)& thePrs
}
}
// =======================================================================
// function : computeSpot
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::computeSpot(const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
@@ -851,10 +827,8 @@ void AIS_LightSource::computeSpot(const Handle(Prs3d_Presentation)& thePrs,
}
}
// =======================================================================
// function : ComputeSelection
// purpose :
// =======================================================================
//=================================================================================================
void AIS_LightSource::ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{

View File

@@ -236,6 +236,7 @@ AIS_Manipulator::AIS_Manipulator()
: myPosition(gp::XOY()),
myCurrentIndex(-1),
myCurrentMode(AIS_MM_None),
mySkinMode(ManipulatorSkin_Shaded),
myIsActivationOnDetection(Standard_False),
myIsZoomPersistentMode(Standard_True),
myHasStartedTransformation(Standard_False),
@@ -255,6 +256,7 @@ AIS_Manipulator::AIS_Manipulator(const gp_Ax2& thePosition)
: myPosition(thePosition),
myCurrentIndex(-1),
myCurrentMode(AIS_MM_None),
mySkinMode(ManipulatorSkin_Shaded),
myIsActivationOnDetection(Standard_False),
myIsZoomPersistentMode(Standard_True),
myHasStartedTransformation(Standard_False),
@@ -331,6 +333,15 @@ void AIS_Manipulator::EnableMode(const AIS_ManipulatorMode theMode)
//=================================================================================================
void AIS_Manipulator::attachToPoint(const gp_Pnt& thePoint)
{
gp_Ax2 aPosition = gp::XOY();
aPosition.SetLocation(thePoint);
SetPosition(aPosition);
}
//=================================================================================================
void AIS_Manipulator::attachToBox(const Bnd_Box& theBox)
{
if (theBox.IsVoid())
@@ -392,7 +403,15 @@ void AIS_Manipulator::Attach(const Handle(AIS_ManipulatorObjectSequence)& theObj
if (theOptions.AdjustPosition)
{
attachToBox(aBox);
const Handle(Graphic3d_TransformPers)& aTransPers = aCurObject->TransformPersistence();
if (!aTransPers.IsNull() && (aTransPers->IsZoomOrRotate() || aTransPers->IsAxial()))
{
attachToPoint(aTransPers->AnchorPoint());
}
else
{
attachToBox(aBox);
}
}
if (theOptions.AdjustSize)
@@ -592,6 +611,41 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation(const Standard_Integer t
gp_Dir aCurrentAxis = gce_MakeDir(aPosLoc, aNewPosition);
Standard_Real anAngle = aStartAxis.AngleWithRef(aCurrentAxis, aCurrAxis.Direction());
if (Abs(anAngle) < Precision::Confusion())
{
return Standard_False;
}
// Draw a sector indicating the rotation angle
if (mySkinMode == ManipulatorSkin_Flat)
{
const gp_Ax1& anAxis = myAxes[myCurrentIndex].ReferenceAxis();
const gp_Dir aRotationStart =
anAxis.Direction().Z() > 0 ? myStartPosition.YDirection() : myStartPosition.Direction();
Standard_Real aRotationAngle =
aRotationStart.AngleWithRef(aCurrentAxis, aCurrAxis.Direction());
aRotationAngle -= (anAngle > 0) ? anAngle * 2.0 : anAngle;
if (anAxis.Direction().Z() > 0)
{
aRotationAngle += M_PI_2;
}
gp_Trsf aTrsf;
aTrsf.SetRotation(anAxis, aRotationAngle);
Handle(Prs3d_ShadingAspect) anAspect = new Prs3d_ShadingAspect();
anAspect->Aspect()->SetShadingModel(Graphic3d_TypeOfShadingModel_Unlit);
anAspect->SetMaterial(myDrawer->ShadingAspect()->Material());
anAspect->SetTransparency(0.5);
anAspect->SetColor(myAxes[myCurrentIndex].Color());
mySector.Init(0.0f, myAxes[myCurrentIndex].InnerRadius(), anAxis, Abs(anAngle));
mySectorGroup->Clear();
mySectorGroup->SetPrimitivesAspect(anAspect->Aspect());
mySectorGroup->AddPrimitiveArray(mySector.Array());
mySectorGroup->SetTransformation(aTrsf);
}
// Change value of an angle if it should have different sign.
if (anAngle * myPrevState < 0 && Abs(anAngle) < M_PI_2)
{
@@ -599,11 +653,6 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation(const Standard_Integer t
anAngle = aSign * (M_PI * 2 - anAngle);
}
if (Abs(anAngle) < Precision::Confusion())
{
return Standard_False;
}
gp_Trsf aNewTrsf;
aNewTrsf.SetRotation(aCurrAxis, anAngle);
theTrsf *= aNewTrsf;
@@ -678,10 +727,14 @@ Standard_Boolean AIS_Manipulator::ProcessDragging(const Handle(AIS_InteractiveCo
return Standard_True;
}
case AIS_DragAction_Stop: {
// at the end of transformation redisplay for updating sensitive areas
StopTransform(true);
if (aCtx->IsDisplayed(this))
if (mySkinMode == ManipulatorSkin_Flat)
{
mySectorGroup->Clear();
}
else if (aCtx->IsDisplayed(this))
{
// at the end of transformation redisplay for updating sensitive areas
aCtx->Redisplay(this, true);
}
return Standard_True;
@@ -733,6 +786,195 @@ void AIS_Manipulator::StopTransform(const Standard_Boolean theToApply)
//=================================================================================================
void AIS_Manipulator::RecomputeTransformation(const Handle(Graphic3d_Camera)& theCamera)
{
if (mySkinMode == ManipulatorSkin_Shaded)
{
return;
}
Standard_Boolean isRecomputedTranslation = Standard_False;
Standard_Boolean isRecomputedRotation = Standard_False;
Standard_Boolean isRecomputedDragging = Standard_False;
Standard_Boolean isRecomputedScaling = Standard_False;
// Remove transformation from dragger group
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
if (myAxes[anIt].HasDragging())
{
myAxes[anIt].DraggerGroup()->SetTransformation(gp_Trsf());
isRecomputedDragging = Standard_True;
}
}
const gp_Dir& aCameraDir = theCamera->Direction();
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
Axis& anAxis = myAxes[anIt];
const gp_Ax1& aRefAxis = anAxis.ReferenceAxis();
gp_Dir anAxisDir, aNormal;
if (aRefAxis.Direction().X() > 0)
{
aNormal = myPosition.YDirection().Reversed();
anAxisDir = myPosition.XDirection();
}
else if (aRefAxis.Direction().Y() > 0)
{
aNormal = myPosition.XDirection().Crossed(myPosition.YDirection()).Reversed();
anAxisDir = myPosition.YDirection();
}
else
{
aNormal = myPosition.XDirection().Reversed();
anAxisDir = myPosition.XDirection().Crossed(myPosition.YDirection());
}
const gp_Dir aCameraProj = Abs(Abs(anAxisDir.Dot(aCameraDir)) - 1.0) <= gp::Resolution()
? aCameraDir
: anAxisDir.Crossed(aCameraDir).Crossed(anAxisDir);
const Standard_Boolean isReversed = anAxisDir.Dot(aCameraDir) > 0;
Standard_Real anAngle = aNormal.AngleWithRef(aCameraProj, anAxisDir);
if (aRefAxis.Direction().X() > 0)
anAngle -= M_PI_2;
if (anAxis.HasTranslation())
{
Handle(Prs3d_ShadingAspect) anAspect = new Prs3d_ShadingAspect();
anAspect->Aspect()->SetShadingModel(Graphic3d_TypeOfShadingModel_Unlit);
Quantity_Color aColor =
isReversed ? Quantity_Color(anAxis.Color().Rgb() * 0.1f) : anAxis.Color();
anAspect->Aspect()->SetInteriorColor(aColor);
gp_Trsf aTranslatorTrsf;
aTranslatorTrsf.SetRotation(aRefAxis, anAngle);
if (isReversed)
{
const Standard_Real aLength = anAxis.AxisLength() + anAxis.Indent() * 4.0f;
aTranslatorTrsf.SetTranslationPart(aRefAxis.Direction().XYZ().Reversed() * aLength);
}
anAxis.TranslatorGroup()->SetGroupPrimitivesAspect(anAspect->Aspect());
anAxis.TranslatorGroup()->SetTransformation(aTranslatorTrsf);
anAxis.TranslatorHighlightPrs()->CurrentGroup()->SetTransformation(aTranslatorTrsf);
isRecomputedTranslation = Standard_True;
}
if (anAxis.HasRotation())
{
gp_Trsf aRotatorTrsf;
aRotatorTrsf.SetRotation(aRefAxis, anAngle - M_PI_2);
anAxis.RotatorGroup()->SetTransformation(aRotatorTrsf);
anAxis.RotatorHighlightPrs()->CurrentGroup()->SetTransformation(aRotatorTrsf);
isRecomputedRotation = Standard_True;
}
if (anAxis.HasDragging() && isReversed)
{
for (Standard_Integer anIndexIter = 0; anIndexIter < 3; ++anIndexIter)
{
gp_Vec aTranslation =
(anIndexIter == anIt)
? aRefAxis.Direction().XYZ() * myAxes[anIndexIter].AxisRadius() * 2.0f
: aRefAxis.Direction().XYZ().Reversed() * myAxes[anIndexIter].AxisLength();
gp_Trsf aDraggerTrsf;
aDraggerTrsf.SetTranslation(aTranslation);
const Handle(Graphic3d_Group)& aDraggerGroup = myAxes[anIndexIter].DraggerGroup();
aDraggerTrsf *= aDraggerGroup->Transformation();
aDraggerGroup->SetTransformation(aDraggerTrsf);
}
}
if (anAxis.HasScaling())
{
gp_Trsf aScalerTrsf;
if (aRefAxis.Direction().X() > 0)
{
anAngle += M_PI_2;
}
aScalerTrsf.SetRotation(aRefAxis, anAngle);
if (isReversed)
{
Standard_ShortReal aLength =
anAxis.AxisLength() * 2.0f + anAxis.BoxSize() + anAxis.Indent() * 4.0f;
aScalerTrsf.SetTranslationPart(gp_Vec(aRefAxis.Direction().XYZ().Reversed() * aLength));
}
anAxis.ScalerGroup()->SetTransformation(aScalerTrsf);
anAxis.ScalerHighlightPrs()->CurrentGroup()->SetTransformation(aScalerTrsf);
isRecomputedScaling = Standard_True;
}
}
if (isRecomputedRotation)
{
const gp_Dir aXDir = gp::DX();
const gp_Dir anYDir = gp::DY();
const gp_Dir aZDir = gp::DZ();
const gp_Dir aCameraProjection =
Abs(aXDir.Dot(aCameraDir)) <= gp::Resolution()
|| Abs(anYDir.Dot(aCameraDir)) <= gp::Resolution()
? aCameraDir
: aXDir.XYZ() * (aXDir.Dot(aCameraDir)) + anYDir.XYZ() * (anYDir.Dot(aCameraDir));
const Standard_Boolean isReversed = aZDir.Dot(aCameraDir) > 0;
const Standard_Real anAngle = M_PI_2 - aCameraDir.Angle(aCameraProjection);
gp_Dir aRotAxis = Abs(Abs(aCameraProjection.Dot(aZDir)) - 1.0) <= gp::Resolution()
? aZDir
: aCameraProjection.Crossed(aZDir);
if (isReversed)
{
aRotAxis.Reverse();
}
gp_Trsf aRotationTrsf;
aRotationTrsf.SetRotation(gp_Ax1(gp::Origin(), aRotAxis), anAngle);
gp_Ax3 aToSystem(gp::Origin(),
myPosition.XDirection().Crossed(myPosition.YDirection()),
myPosition.XDirection());
gp_Ax3 aFromSystem(gp::XOY());
aFromSystem.Transform(aRotationTrsf);
gp_Trsf aTrsf;
aTrsf.SetTransformation(aFromSystem, aToSystem);
myCircleGroup->SetTransformation(aTrsf);
}
if (isRecomputedDragging)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
myAxes[anIt].DraggerHighlightPrs()->CurrentGroup()->SetTransformation(
myAxes[anIt].DraggerGroup()->Transformation());
}
}
if (isRecomputedTranslation)
{
RecomputeSelection(AIS_MM_Translation);
};
if (isRecomputedRotation)
{
RecomputeSelection(AIS_MM_Rotation);
};
if (isRecomputedDragging)
{
RecomputeSelection(AIS_MM_TranslationPlane);
};
if (isRecomputedScaling)
{
RecomputeSelection(AIS_MM_Scaling);
};
Object()->GetContext()->RecomputeSelectionOnly(this);
}
//=================================================================================================
void AIS_Manipulator::Transform(const gp_Trsf& theTrsf)
{
if (!IsAttached() || !myHasStartedTransformation)
@@ -746,9 +988,18 @@ void AIS_Manipulator::Transform(const gp_Trsf& theTrsf)
NCollection_Sequence<gp_Trsf>::Iterator aTrsfIter(myStartTrsfs);
for (; anObjIter.More(); anObjIter.Next(), aTrsfIter.Next())
{
const Handle(AIS_InteractiveObject)& anObj = anObjIter.ChangeValue();
const gp_Trsf& anOldTrsf = aTrsfIter.Value();
const Handle(TopLoc_Datum3D)& aParentTrsf = anObj->CombinedParentTransformation();
const Handle(AIS_InteractiveObject)& anObj = anObjIter.ChangeValue();
const Handle(Graphic3d_TransformPers)& aTransPers = anObj->TransformPersistence();
if (!aTransPers.IsNull() && (aTransPers->IsZoomOrRotate() || aTransPers->IsAxial()))
{
gp_XYZ aNewAnchorPoint = aTransPers->AnchorPoint().XYZ() - myPosition.Location().XYZ();
aNewAnchorPoint += myStartPosition.Location().Transformed(theTrsf).XYZ();
aTransPers->SetAnchorPoint(aNewAnchorPoint);
continue;
}
const gp_Trsf& anOldTrsf = aTrsfIter.Value();
const Handle(TopLoc_Datum3D)& aParentTrsf = anObj->CombinedParentTransformation();
if (!aParentTrsf.IsNull() && aParentTrsf->Form() != gp_Identity)
{
// recompute local transformation relative to parent transformation
@@ -892,6 +1143,10 @@ void AIS_Manipulator::DeactivateCurrentMode()
}
Handle(Prs3d_ShadingAspect) anAspect = new Prs3d_ShadingAspect();
if (mySkinMode == ManipulatorSkin_Flat)
{
anAspect->Aspect()->SetShadingModel(Graphic3d_TypeOfShadingModel_Unlit);
}
anAspect->Aspect()->SetInteriorStyle(Aspect_IS_SOLID);
anAspect->SetMaterial(myDrawer->ShadingAspect()->Material());
if (myCurrentMode == AIS_MM_TranslationPlane)
@@ -935,6 +1190,17 @@ void AIS_Manipulator::SetZoomPersistence(const Standard_Boolean theToEnable)
//=================================================================================================
void AIS_Manipulator::SetSkinMode(const ManipulatorSkin theSkinMode)
{
if (mySkinMode != theSkinMode)
{
SetToUpdate();
}
mySkinMode = theSkinMode;
}
//=================================================================================================
void AIS_Manipulator::SetTransformPersistence(const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
Standard_ASSERT_RETURN(!myIsZoomPersistentMode,
@@ -979,16 +1245,37 @@ void AIS_Manipulator::Compute(const Handle(PrsMgr_PresentationManager)& thePrsMg
thePrs->SetMutable(Standard_True);
Handle(Graphic3d_Group) aGroup;
Handle(Prs3d_ShadingAspect) anAspect = new Prs3d_ShadingAspect();
if (mySkinMode == ManipulatorSkin_Flat)
{
anAspect->Aspect()->SetShadingModel(Graphic3d_TypeOfShadingModel_Unlit);
}
anAspect->Aspect()->SetInteriorStyle(Aspect_IS_SOLID);
anAspect->SetMaterial(myDrawer->ShadingAspect()->Material());
anAspect->SetTransparency(myDrawer->ShadingAspect()->Transparency());
// Display center
myCenter.Init(myAxes[0].AxisRadius() * 2.0f, gp::Origin());
myCenter.Init(myAxes[0].AxisRadius() * 2.0f, gp::Origin(), mySkinMode);
aGroup = thePrs->NewGroup();
aGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
aGroup->AddPrimitiveArray(myCenter.Array());
// Display outer circle
if (mySkinMode == ManipulatorSkin_Flat
&& (myAxes[0].HasRotation() || myAxes[1].HasRotation() || myAxes[2].HasRotation()))
{
myCircle.Init(myAxes[0].InnerRadius(),
myAxes[0].Size(),
gp_Ax1(gp::Origin(), gp::DZ()),
2.0f * M_PI,
myAxes[0].FacettesNumber() * 4);
myCircleGroup = thePrs->NewGroup();
myCircleGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
myCircleGroup->AddPrimitiveArray(myCircle.Array());
mySectorGroup = thePrs->NewGroup();
mySectorGroup->SetGroupPrimitivesAspect(anAspect->Aspect());
}
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
// Display axes
@@ -998,7 +1285,7 @@ void AIS_Manipulator::Compute(const Handle(PrsMgr_PresentationManager)& thePrsMg
new Prs3d_ShadingAspect(new Graphic3d_AspectFillArea3d(*anAspect->Aspect()));
anAspectAx->SetColor(myAxes[anIt].Color());
aGroup->SetGroupPrimitivesAspect(anAspectAx->Aspect());
myAxes[anIt].Compute(thePrsMgr, thePrs, anAspectAx);
myAxes[anIt].Compute(thePrsMgr, thePrs, anAspectAx, mySkinMode);
myAxes[anIt].SetTransformPersistence(TransformPersistence());
}
@@ -1034,7 +1321,7 @@ void AIS_Manipulator::HilightSelected(const Handle(PrsMgr_PresentationManager)&
return;
}
if (anOwner->Mode() == AIS_MM_TranslationPlane)
if (anOwner->Mode() == AIS_MM_TranslationPlane && mySkinMode == ManipulatorSkin_Shaded)
{
myDraggerHighlight->SetColor(myAxes[anOwner->Index()].Color());
aGroup->SetGroupPrimitivesAspect(myDraggerHighlight->Aspect());
@@ -1068,7 +1355,7 @@ void AIS_Manipulator::HilightOwnerWithColor(const Handle(PrsMgr_PresentationMana
aPresentation->CStructure()->ViewAffinity = myViewAffinity;
if (anOwner->Mode() == AIS_MM_TranslationPlane)
if (anOwner->Mode() == AIS_MM_TranslationPlane && mySkinMode == ManipulatorSkin_Shaded)
{
Handle(Prs3d_Drawer) aStyle = new Prs3d_Drawer();
aStyle->SetColor(myAxes[anOwner->Index()].Color());
@@ -1106,6 +1393,23 @@ void AIS_Manipulator::HilightOwnerWithColor(const Handle(PrsMgr_PresentationMana
//=================================================================================================
void AIS_Manipulator::RecomputeSelection(const AIS_ManipulatorMode theMode)
{
if (theMode == AIS_MM_None)
{
return;
}
const Handle(SelectMgr_Selection)& aSelection = Object()->Selection(theMode);
if (!aSelection.IsNull())
{
aSelection->Clear();
ComputeSelection(aSelection, theMode);
}
}
//=================================================================================================
void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode)
{
@@ -1138,18 +1442,25 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
const Axis& anAxis = myAxes[anIt];
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Translation, 9);
// define sensitivity by line
Handle(Select3D_SensitiveSegment) aLine =
new Select3D_SensitiveSegment(anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor(aHighSensitivity);
theSelection->Add(aLine);
if (mySkinMode == ManipulatorSkin_Shaded)
{
// define sensitivity by line
Handle(Select3D_SensitiveSegment) aLine =
new Select3D_SensitiveSegment(anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor(aHighSensitivity);
theSelection->Add(aLine);
}
// enlarge sensitivity by triangulation
Handle(Select3D_SensitivePrimitiveArray) aTri =
new Select3D_SensitivePrimitiveArray(anOwner);
TopLoc_Location aTrsf =
!myAxes[anIt].TranslatorGroup().IsNull()
? TopLoc_Location(myAxes[anIt].TranslatorGroup()->Transformation())
: TopLoc_Location();
aTri->InitTriangulation(anAxis.TriangleArray()->Attributes(),
anAxis.TriangleArray()->Indices(),
TopLoc_Location());
aTrsf);
theSelection->Add(aTri);
}
break;
@@ -1164,17 +1475,24 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
const Axis& anAxis = myAxes[anIt];
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Rotation, 9);
// define sensitivity by circle
const gp_Circ aGeomCircle(gp_Ax2(gp::Origin(), anAxis.ReferenceAxis().Direction()),
anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle(anOwner, aGeomCircle);
aCircle->SetSensitivityFactor(aLowSensitivity);
theSelection->Add(aCircle);
if (mySkinMode == ManipulatorSkin_Shaded)
{
// define sensitivity by circle
const gp_Circ aGeomCircle(gp_Ax2(gp::Origin(), anAxis.ReferenceAxis().Direction()),
anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle(anOwner, aGeomCircle);
aCircle->SetSensitivityFactor(aLowSensitivity);
theSelection->Add(aCircle);
}
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri =
new ManipSensTriangulation(anOwner,
myAxes[anIt].RotatorDisk().Triangulation(),
anAxis.ReferenceAxis().Direction());
Handle(Select3D_SensitivePrimitiveArray) aTri =
new Select3D_SensitivePrimitiveArray(anOwner);
const Handle(Graphic3d_Group)& aGroup = myAxes[anIt].RotatorGroup();
TopLoc_Location aTrsf =
!aGroup.IsNull() ? TopLoc_Location(aGroup->Transformation()) : TopLoc_Location();
aTri->InitTriangulation(myAxes[anIt].RotatorDisk().Array()->Attributes(),
myAxes[anIt].RotatorDisk().Array()->Indices(),
aTrsf);
theSelection->Add(aTri);
}
break;
@@ -1188,17 +1506,23 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Scaling, 9);
// define sensitivity by point
Handle(Select3D_SensitivePoint) aPnt =
new Select3D_SensitivePoint(anOwner, myAxes[anIt].ScalerCubePosition());
aPnt->SetSensitivityFactor(aHighSensitivity);
theSelection->Add(aPnt);
if (mySkinMode == ManipulatorSkin_Shaded)
{
// define sensitivity by point
Handle(Select3D_SensitivePoint) aPnt =
new Select3D_SensitivePoint(anOwner, myAxes[anIt].ScalerCubePosition());
aPnt->SetSensitivityFactor(aHighSensitivity);
theSelection->Add(aPnt);
}
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri =
new Select3D_SensitiveTriangulation(anOwner,
myAxes[anIt].ScalerCube().Triangulation(),
TopLoc_Location(),
Standard_True);
Handle(Select3D_SensitivePrimitiveArray) aTri =
new Select3D_SensitivePrimitiveArray(anOwner);
const Handle(Graphic3d_Group)& aGroup = myAxes[anIt].ScalerGroup();
TopLoc_Location aTrsf =
!aGroup.IsNull() ? TopLoc_Location(aGroup->Transformation()) : TopLoc_Location();
aTri->InitTriangulation(myAxes[anIt].ScalerCube().Array()->Attributes(),
myAxes[anIt].ScalerCube().Array()->Indices(),
aTrsf);
theSelection->Add(aTri);
}
break;
@@ -1212,30 +1536,37 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
// define sensitivity by two crossed lines
Standard_Real aSensitivityOffset =
ZoomPersistence() ? aHighSensitivity * (0.5 + M_SQRT2) : 0.0;
gp_Pnt aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition().Translated(
myAxes[((anIt + 2) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_Pnt aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition().Translated(
myAxes[((anIt + 1) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
gp_XYZ anOrig = aMidP.Normalized().Multiplied(aSensitivityOffset);
if (mySkinMode == ManipulatorSkin_Shaded)
{
// define sensitivity by two crossed lines
Standard_Real aSensitivityOffset =
ZoomPersistence() ? aHighSensitivity * (0.5 + M_SQRT2) : 0.0;
gp_Pnt aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition().Translated(
myAxes[((anIt + 2) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_Pnt aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition().Translated(
myAxes[((anIt + 1) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
gp_XYZ anOrig = aMidP.Normalized().Multiplied(aSensitivityOffset);
Handle(Select3D_SensitiveSegment) aLine1 = new Select3D_SensitiveSegment(anOwner, aP1, aP2);
aLine1->SetSensitivityFactor(aLowSensitivity);
theSelection->Add(aLine1);
Handle(Select3D_SensitiveSegment) aLine2 =
new Select3D_SensitiveSegment(anOwner, anOrig, aMidP);
aLine2->SetSensitivityFactor(aLowSensitivity);
theSelection->Add(aLine2);
Handle(Select3D_SensitiveSegment) aLine1 =
new Select3D_SensitiveSegment(anOwner, aP1, aP2);
aLine1->SetSensitivityFactor(aLowSensitivity);
theSelection->Add(aLine1);
Handle(Select3D_SensitiveSegment) aLine2 =
new Select3D_SensitiveSegment(anOwner, anOrig, aMidP);
aLine2->SetSensitivityFactor(aLowSensitivity);
theSelection->Add(aLine2);
}
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri =
new Select3D_SensitiveTriangulation(anOwner,
myAxes[anIt].DraggerSector().Triangulation(),
TopLoc_Location(),
Standard_True);
Handle(Select3D_SensitivePrimitiveArray) aTri =
new Select3D_SensitivePrimitiveArray(anOwner);
const Handle(Graphic3d_Group)& aGroup = myAxes[anIt].DraggerGroup();
TopLoc_Location aTrsf =
!aGroup.IsNull() ? TopLoc_Location(aGroup->Transformation()) : TopLoc_Location();
aTri->InitTriangulation(myAxes[anIt].DraggerSector().Array()->Attributes(),
myAxes[anIt].DraggerSector().Array()->Indices(),
aTrsf);
theSelection->Add(aTri);
}
break;
@@ -1255,6 +1586,7 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
void AIS_Manipulator::Disk::Init(const Standard_ShortReal theInnerRadius,
const Standard_ShortReal theOuterRadius,
const gp_Ax1& thePosition,
const Standard_Real theAngle,
const Standard_Integer theSlicesNb,
const Standard_Integer theStacksNb)
{
@@ -1263,8 +1595,9 @@ void AIS_Manipulator::Disk::Init(const Standard_ShortReal theInnerRadius,
myOuterRad = theOuterRadius;
Prs3d_ToolDisk aTool(theInnerRadius, theOuterRadius, theSlicesNb, theStacksNb);
gp_Ax3 aSystem(myPosition.Location(), myPosition.Direction());
gp_Trsf aTrsf;
aTool.SetAngleRange(0, theAngle);
gp_Ax3 aSystem(myPosition.Location(), myPosition.Direction());
gp_Trsf aTrsf;
aTrsf.SetTransformation(aSystem, gp_Ax3());
myArray = aTool.CreateTriangulation(aTrsf);
myTriangulation = aTool.CreatePolyTriangulation(aTrsf);
@@ -1277,15 +1610,18 @@ void AIS_Manipulator::Disk::Init(const Standard_ShortReal theInnerRadius,
//=======================================================================
void AIS_Manipulator::Sphere::Init(const Standard_ShortReal theRadius,
const gp_Pnt& thePosition,
const ManipulatorSkin theSkinMode,
const Standard_Integer theSlicesNb,
const Standard_Integer theStacksNb)
{
myPosition = thePosition;
myRadius = theRadius;
Prs3d_ToolSphere aTool(theRadius, theSlicesNb, theStacksNb);
gp_Trsf aTrsf;
gp_Trsf aTrsf;
aTrsf.SetTranslation(gp_Vec(gp::Origin(), thePosition));
const Standard_Real aRadius = theSkinMode == ManipulatorSkin_Flat ? theRadius * 0.5 : theRadius;
Prs3d_ToolSphere aTool(aRadius, theSlicesNb, theStacksNb);
myArray = aTool.CreateTriangulation(aTrsf);
myTriangulation = aTool.CreatePolyTriangulation(aTrsf);
}
@@ -1295,56 +1631,80 @@ void AIS_Manipulator::Sphere::Init(const Standard_ShortReal theRadius,
// function : Init
// purpose :
//=======================================================================
void AIS_Manipulator::Cube::Init(const gp_Ax1& thePosition, const Standard_ShortReal theSize)
void AIS_Manipulator::Cube::Init(const gp_Ax1& thePosition,
const Standard_ShortReal theSize,
const ManipulatorSkin theSkinMode)
{
myArray = new Graphic3d_ArrayOfTriangles(12 * 3, 0, Standard_True);
if (theSkinMode == ManipulatorSkin_Flat)
{
gp_Dir aXDirection;
if (thePosition.Direction().X() > 0)
aXDirection = gp::DY();
else if (thePosition.Direction().Y() > 0)
aXDirection = gp::DZ();
else
aXDirection = gp::DX();
Poly_Array1OfTriangle aPolyTriangles(1, 12);
TColgp_Array1OfPnt aPoints(1, 36);
NCollection_Array1<gp_Dir> aNormals(1, 12);
myTriangulation = new Poly_Triangulation(aPoints, aPolyTriangles);
gp_Pnt aLocation =
thePosition.Location().Translated(gp_Vec(thePosition.Direction().XYZ() * theSize));
gp_Ax3 aSystem(aLocation, aXDirection, thePosition.Direction());
gp_Trsf aTrsf;
aTrsf.SetTransformation(aSystem, gp_Ax3());
gp_Ax2 aPln(thePosition.Location(), thePosition.Direction());
gp_Pnt aBottomLeft = thePosition.Location().XYZ() - aPln.XDirection().XYZ() * theSize * 0.5
- aPln.YDirection().XYZ() * theSize * 0.5;
gp_Pnt aV2 = aBottomLeft.XYZ() + aPln.YDirection().XYZ() * theSize;
gp_Pnt aV3 =
aBottomLeft.XYZ() + aPln.YDirection().XYZ() * theSize + aPln.XDirection().XYZ() * theSize;
gp_Pnt aV4 = aBottomLeft.XYZ() + aPln.XDirection().XYZ() * theSize;
gp_Pnt aTopRight = thePosition.Location().XYZ() + thePosition.Direction().XYZ() * theSize
+ aPln.XDirection().XYZ() * theSize * 0.5
+ aPln.YDirection().XYZ() * theSize * 0.5;
gp_Pnt aV5 = aTopRight.XYZ() - aPln.YDirection().XYZ() * theSize;
gp_Pnt aV6 =
aTopRight.XYZ() - aPln.YDirection().XYZ() * theSize - aPln.XDirection().XYZ() * theSize;
gp_Pnt aV7 = aTopRight.XYZ() - aPln.XDirection().XYZ() * theSize;
Prs3d_ToolDisk aTool(0.0, theSize, 40, 40);
myArray = aTool.CreateTriangulation(aTrsf);
myTriangulation = aTool.CreatePolyTriangulation(aTrsf);
}
else
{
myArray = new Graphic3d_ArrayOfTriangles(12 * 3, 0, Standard_True);
gp_Dir aRight((gp_Vec(aTopRight, aV7) ^ gp_Vec(aTopRight, aV2)).XYZ());
gp_Dir aFront((gp_Vec(aV3, aV4) ^ gp_Vec(aV3, aV5)).XYZ());
Poly_Array1OfTriangle aPolyTriangles(1, 12);
TColgp_Array1OfPnt aPoints(1, 36);
myTriangulation = new Poly_Triangulation(aPoints, aPolyTriangles);
// Bottom
addTriangle(0, aBottomLeft, aV2, aV3, -thePosition.Direction());
addTriangle(1, aBottomLeft, aV3, aV4, -thePosition.Direction());
gp_Ax2 aPln(thePosition.Location(), thePosition.Direction());
gp_Pnt aBottomLeft = thePosition.Location().XYZ() - aPln.XDirection().XYZ() * theSize * 0.5
- aPln.YDirection().XYZ() * theSize * 0.5;
gp_Pnt aV2 = aBottomLeft.XYZ() + aPln.YDirection().XYZ() * theSize;
gp_Pnt aV3 =
aBottomLeft.XYZ() + aPln.YDirection().XYZ() * theSize + aPln.XDirection().XYZ() * theSize;
gp_Pnt aV4 = aBottomLeft.XYZ() + aPln.XDirection().XYZ() * theSize;
gp_Pnt aTopRight = thePosition.Location().XYZ() + thePosition.Direction().XYZ() * theSize
+ aPln.XDirection().XYZ() * theSize * 0.5
+ aPln.YDirection().XYZ() * theSize * 0.5;
gp_Pnt aV5 = aTopRight.XYZ() - aPln.YDirection().XYZ() * theSize;
gp_Pnt aV6 =
aTopRight.XYZ() - aPln.YDirection().XYZ() * theSize - aPln.XDirection().XYZ() * theSize;
gp_Pnt aV7 = aTopRight.XYZ() - aPln.XDirection().XYZ() * theSize;
// Front
addTriangle(2, aV3, aV5, aV4, -aFront);
addTriangle(3, aV3, aTopRight, aV5, -aFront);
gp_Dir aRight((gp_Vec(aTopRight, aV7) ^ gp_Vec(aTopRight, aV2)).XYZ());
gp_Dir aFront((gp_Vec(aV3, aV4) ^ gp_Vec(aV3, aV5)).XYZ());
// Back
addTriangle(4, aBottomLeft, aV7, aV2, aFront);
addTriangle(5, aBottomLeft, aV6, aV7, aFront);
// Bottom
addTriangle(0, aBottomLeft, aV2, aV3, -thePosition.Direction());
addTriangle(1, aBottomLeft, aV3, aV4, -thePosition.Direction());
// aTop
addTriangle(6, aV7, aV6, aV5, thePosition.Direction());
addTriangle(7, aTopRight, aV7, aV5, thePosition.Direction());
// Front
addTriangle(2, aV3, aV5, aV4, -aFront);
addTriangle(3, aV3, aTopRight, aV5, -aFront);
// Left
addTriangle(8, aV6, aV4, aV5, aRight);
addTriangle(9, aBottomLeft, aV4, aV6, aRight);
// Back
addTriangle(4, aBottomLeft, aV7, aV2, aFront);
addTriangle(5, aBottomLeft, aV6, aV7, aFront);
// Right
addTriangle(10, aV3, aV7, aTopRight, -aRight);
addTriangle(11, aV3, aV2, aV7, -aRight);
// aTop
addTriangle(6, aV7, aV6, aV5, thePosition.Direction());
addTriangle(7, aTopRight, aV7, aV5, thePosition.Direction());
// Left
addTriangle(8, aV6, aV4, aV5, aRight);
addTriangle(9, aBottomLeft, aV4, aV6, aRight);
// Right
addTriangle(10, aV3, aV7, aTopRight, -aRight);
addTriangle(11, aV3, aV2, aV7, -aRight);
}
}
//=======================================================================
@@ -1377,15 +1737,46 @@ void AIS_Manipulator::Cube::addTriangle(const Standard_Integer theIndex,
void AIS_Manipulator::Sector::Init(const Standard_ShortReal theRadius,
const gp_Ax1& thePosition,
const gp_Dir& theXDirection,
const ManipulatorSkin theSkinMode,
const Standard_Integer theSlicesNb,
const Standard_Integer theStacksNb)
{
Prs3d_ToolSector aTool(theRadius, theSlicesNb, theStacksNb);
gp_Ax3 aSystem(thePosition.Location(), thePosition.Direction(), theXDirection);
gp_Trsf aTrsf;
gp_Ax3 aSystem(thePosition.Location(), thePosition.Direction(), theXDirection);
gp_Trsf aTrsf;
aTrsf.SetTransformation(aSystem, gp_Ax3());
myArray = aTool.CreateTriangulation(aTrsf);
myTriangulation = aTool.CreatePolyTriangulation(aTrsf);
if (theSkinMode == ManipulatorSkin_Flat)
{
myArray = new Graphic3d_ArrayOfTriangles(4, 6, Graphic3d_ArrayFlags_VertexNormal);
myTriangulation = new Poly_Triangulation(4, 2, Standard_False);
const Standard_Real anIndent = theRadius / 3.0;
gp_Pnt aV1 = gp_Pnt(anIndent, anIndent, 0.0).Transformed(aTrsf);
gp_Pnt aV2 = gp_Pnt(anIndent, anIndent * 2.0, 0.0).Transformed(aTrsf);
gp_Pnt aV3 = gp_Pnt(anIndent * 2.0, anIndent * 2.0, 0.0).Transformed(aTrsf);
gp_Pnt aV4 = gp_Pnt(anIndent * 2.0, anIndent, 0.0).Transformed(aTrsf);
gp_Dir aNormal = gp_Dir(0.0, 0.0, -1.0).Transformed(aTrsf);
myArray->AddVertex(aV1, aNormal);
myArray->AddVertex(aV2, aNormal);
myArray->AddVertex(aV3, aNormal);
myArray->AddVertex(aV4, aNormal);
myArray->AddTriangleEdges(3, 1, 2);
myArray->AddTriangleEdges(1, 3, 4);
myTriangulation->SetNode(1, aV1);
myTriangulation->SetNode(2, aV2);
myTriangulation->SetNode(3, aV3);
myTriangulation->SetNode(4, aV4);
myTriangulation->SetTriangle(1, Poly_Triangle(3, 1, 2));
myTriangulation->SetTriangle(2, Poly_Triangle(1, 3, 4));
}
else
{
Prs3d_ToolSector aTool(theRadius, theSlicesNb, theStacksNb);
myArray = aTool.CreateTriangulation(aTrsf);
myTriangulation = aTool.CreatePolyTriangulation(aTrsf);
}
}
//=======================================================================
@@ -1423,7 +1814,8 @@ AIS_Manipulator::Axis::Axis(const gp_Ax1& theAxis,
void AIS_Manipulator::Axis::Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Handle(Prs3d_ShadingAspect)& theAspect)
const Handle(Prs3d_ShadingAspect)& theAspect,
const ManipulatorSkin theSkinMode)
{
if (myHasTranslation)
{
@@ -1432,16 +1824,80 @@ void AIS_Manipulator::Axis::Compute(const Handle(PrsMgr_PresentationManager)& th
myArrowTipPos =
gp_Pnt(0.0, 0.0, 0.0).Translated(myReferenceAxis.Direction().XYZ() * aCylinderLength);
myTriangleArray = Prs3d_Arrow::DrawShaded(gp_Ax1(gp::Origin(), myReferenceAxis.Direction()),
myAxisRadius,
myLength,
myAxisRadius * 1.5,
anArrowLength,
myFacettesNumber);
myTranslatorGroup = thePrs->NewGroup();
myTranslatorGroup->SetClosed(true);
myTranslatorGroup->SetClosed(theSkinMode == ManipulatorSkin_Shaded);
myTranslatorGroup->SetGroupPrimitivesAspect(theAspect->Aspect());
myTranslatorGroup->AddPrimitiveArray(myTriangleArray);
if (theSkinMode == ManipulatorSkin_Flat)
{
const Standard_Integer aStripsNb = 14;
myTriangleArray = new Graphic3d_ArrayOfTriangles(aStripsNb * 4,
aStripsNb * 6,
Graphic3d_ArrayFlags_VertexNormal);
Handle(Graphic3d_ArrayOfTriangles) aColorlessArr =
new Graphic3d_ArrayOfTriangles(aStripsNb * 2,
aStripsNb * 3,
Graphic3d_ArrayFlags_VertexNormal);
Handle(Graphic3d_ArrayOfTriangles) aColoredArr = new Graphic3d_ArrayOfTriangles(
aStripsNb * 2,
aStripsNb * 3,
Graphic3d_ArrayFlags_VertexNormal | Graphic3d_ArrayFlags_VertexColor);
gp_Ax3 aSystem(gp::Origin(), myReferenceAxis.Direction());
gp_Trsf aTrsf;
aTrsf.SetTransformation(aSystem, gp_Ax3());
gp_Dir aNormal = gp_Dir(1.0, 0.0, 0.0).Transformed(aTrsf);
Standard_Real aLength = myLength + myIndent * 4.0f;
const Standard_Real aStepV = 1.0f / aStripsNb;
for (Standard_Integer aU = 0; aU <= 1; ++aU)
{
for (Standard_Integer aV = 0; aV <= aStripsNb; ++aV)
{
gp_Pnt aVertex = gp_Pnt(0.0, myAxisRadius * (1.5f * aU - 0.75f), aLength * aV * aStepV)
.Transformed(aTrsf);
myTriangleArray->AddVertex(aVertex, aNormal);
if (aV != 0)
{
aColorlessArr->AddVertex(aVertex, aNormal);
}
if (aV != aStripsNb)
{
aColoredArr->AddVertex(aVertex, aNormal, myColor);
}
if (aU != 0 && aV != 0)
{
int aVertId = myTriangleArray->VertexNumber();
myTriangleArray->AddTriangleEdges(aVertId, aVertId - aStripsNb - 2, aVertId - 1);
myTriangleArray->AddTriangleEdges(aVertId - aStripsNb - 2,
aVertId,
aVertId - aStripsNb - 1);
Handle(Graphic3d_ArrayOfTriangles) aSquares = aV % 2 == 0 ? aColorlessArr : aColoredArr;
aVertId = aSquares->VertexNumber();
aSquares->AddTriangleEdges(aVertId, aVertId - aStripsNb - 1, aVertId - 1);
aSquares->AddTriangleEdges(aVertId - aStripsNb - 1, aVertId, aVertId - aStripsNb);
}
}
}
myTranslatorGroup->AddPrimitiveArray(aColoredArr);
myTranslatorGroup->AddPrimitiveArray(aColorlessArr);
}
else
{
myTriangleArray = Prs3d_Arrow::DrawShaded(gp_Ax1(gp::Origin(), myReferenceAxis.Direction()),
myAxisRadius,
myLength,
myAxisRadius * 1.5,
anArrowLength,
myFacettesNumber);
myTranslatorGroup->AddPrimitiveArray(myTriangleArray);
}
if (myHighlightTranslator.IsNull())
{
@@ -1461,10 +1917,12 @@ void AIS_Manipulator::Axis::Compute(const Handle(PrsMgr_PresentationManager)& th
if (myHasScaling)
{
myCubePos = myReferenceAxis.Direction().XYZ() * (myLength + myIndent);
myCube.Init(gp_Ax1(myCubePos, myReferenceAxis.Direction()), myBoxSize);
const Standard_ShortReal aBoxSize =
theSkinMode == ManipulatorSkin_Shaded ? myBoxSize : myBoxSize * 0.5f + myIndent;
myCube.Init(gp_Ax1(myCubePos, myReferenceAxis.Direction()), aBoxSize, theSkinMode);
myScalerGroup = thePrs->NewGroup();
myScalerGroup->SetClosed(true);
myScalerGroup->SetClosed(theSkinMode == ManipulatorSkin_Shaded);
myScalerGroup->SetGroupPrimitivesAspect(theAspect->Aspect());
myScalerGroup->AddPrimitiveArray(myCube.Array());
@@ -1485,10 +1943,12 @@ void AIS_Manipulator::Axis::Compute(const Handle(PrsMgr_PresentationManager)& th
if (myHasRotation)
{
myCircleRadius = myInnerRadius + myIndent * 2 + myDiskThickness * 0.5f;
myCircle.Init(myInnerRadius + myIndent * 2,
myInnerRadius + myDiskThickness + myIndent * 2,
myCircleRadius = myInnerRadius + myIndent * 2.0f + myDiskThickness * 0.5f;
const Standard_Real anAngle = theSkinMode == ManipulatorSkin_Shaded ? M_PI * 2.0f : M_PI;
myCircle.Init(myInnerRadius + myIndent * 2.0f,
Size(),
gp_Ax1(gp::Origin(), myReferenceAxis.Direction()),
anAngle,
myFacettesNumber * 2);
myRotatorGroup = thePrs->NewGroup();
myRotatorGroup->SetGroupPrimitivesAspect(theAspect->Aspect());
@@ -1519,13 +1979,21 @@ void AIS_Manipulator::Axis::Compute(const Handle(PrsMgr_PresentationManager)& th
else
aXDirection = gp::DX();
mySector.Init(myInnerRadius + myIndent * 2,
gp_Ax1(gp::Origin(), myReferenceAxis.Direction()),
gp_Pnt aPosition = theSkinMode == ManipulatorSkin_Flat
? gp_Pnt(myReferenceAxis.Direction().Reversed().XYZ() * (myAxisRadius))
: gp::Origin();
Standard_ShortReal aRadius =
theSkinMode == ManipulatorSkin_Flat ? myLength : myInnerRadius + myIndent * 2;
mySector.Init(aRadius,
gp_Ax1(aPosition, myReferenceAxis.Direction()),
aXDirection,
theSkinMode,
myFacettesNumber * 2);
myDraggerGroup = thePrs->NewGroup();
Handle(Graphic3d_AspectFillArea3d) aFillArea = new Graphic3d_AspectFillArea3d();
Handle(Graphic3d_AspectFillArea3d) aFillArea =
theSkinMode == ManipulatorSkin_Flat ? theAspect->Aspect() : new Graphic3d_AspectFillArea3d();
myDraggerGroup->SetGroupPrimitivesAspect(aFillArea);
myDraggerGroup->AddPrimitiveArray(mySector.Array());

View File

@@ -217,6 +217,14 @@ public:
//! @warning It will does nothing if transformation is not initiated (with StartTransform() call).
Standard_EXPORT void Transform(const gp_Trsf& aTrsf);
//! Apply camera transformation to flat skin manipulator
Standard_EXPORT void RecomputeTransformation(const Handle(Graphic3d_Camera)& theCamera)
Standard_OVERRIDE;
//! Recomputes sensitive primitives for the given selection mode.
//! @param theMode selection mode to recompute sensitive primitives
Standard_EXPORT void RecomputeSelection(const AIS_ManipulatorMode theMode);
//! Reset start (reference) transformation.
//! @param[in] theToApply option to apply or to cancel the started transformation.
//! @warning It is used in chain with StartTransform-Transform(gp_Trsf)-StopTransform
@@ -304,6 +312,18 @@ public: //! @name Configuration of graphical transformations
const Handle(Graphic3d_TransformPers)& theTrsfPers) Standard_OVERRIDE;
public: //! @name Setters for parameters
enum ManipulatorSkin
{
ManipulatorSkin_Shaded,
ManipulatorSkin_Flat
};
//! @return current manipulator skin mode.
ManipulatorSkin SkinMode() const { return mySkinMode; }
//! Sets skin mode for the manipulator.
Standard_EXPORT void SetSkinMode(const ManipulatorSkin theSkinMode);
AIS_ManipulatorMode ActiveMode() const { return myCurrentMode; }
Standard_Integer ActiveAxisIndex() const { return myCurrentIndex; }
@@ -416,6 +436,8 @@ protected:
Standard_EXPORT Handle(Graphic3d_Group) getGroup(const Standard_Integer theIndex,
const AIS_ManipulatorMode theMode) const;
Standard_EXPORT void attachToPoint(const gp_Pnt& thePoint);
Standard_EXPORT void attachToBox(const Bnd_Box& theBox);
Standard_EXPORT void adjustSize(const Bnd_Box& theBox);
@@ -466,6 +488,7 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
void Init(const Standard_ShortReal theInnerRadius,
const Standard_ShortReal theOuterRadius,
const gp_Ax1& thePosition,
const Standard_Real theAngle,
const Standard_Integer theSlicesNb = 20,
const Standard_Integer theStacksNb = 20);
@@ -486,6 +509,7 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
void Init(const Standard_ShortReal theRadius,
const gp_Pnt& thePosition,
const ManipulatorSkin theSkinMode,
const Standard_Integer theSlicesNb = 20,
const Standard_Integer theStacksNb = 20);
@@ -501,7 +525,9 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
~Cube() {}
void Init(const gp_Ax1& thePosition, const Standard_ShortReal myBoxSize);
void Init(const gp_Ax1& thePosition,
const Standard_ShortReal myBoxSize,
const ManipulatorSkin theSkinMode);
const Handle(Poly_Triangulation)& Triangulation() const { return myTriangulation; }
@@ -533,6 +559,7 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
void Init(const Standard_ShortReal theRadius,
const gp_Ax1& thePosition,
const gp_Dir& theXDirection,
const ManipulatorSkin theSkinMode,
const Standard_Integer theSlicesNb = 5,
const Standard_Integer theStacksNb = 5);
@@ -555,7 +582,8 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Handle(Prs3d_ShadingAspect)& theAspect);
const Handle(Prs3d_ShadingAspect)& theAspect,
const ManipulatorSkin theSkinMode);
const gp_Ax1& ReferenceAxis() const { return myReferenceAxis; }
@@ -629,8 +657,12 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
Standard_ShortReal AxisLength() const { return myLength; }
Standard_ShortReal BoxSize() const { return myBoxSize; }
Standard_ShortReal AxisRadius() const { return myAxisRadius; }
Standard_ShortReal Indent() const { return myIndent; }
void SetAxisRadius(const Standard_ShortReal theValue) { myAxisRadius = theValue; }
const Handle(Prs3d_Presentation)& TranslatorHighlightPrs() const
@@ -656,10 +688,9 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
void SetIndent(const Standard_ShortReal theValue) { myIndent = theValue; }
Standard_ShortReal Size() const
{
return myLength + myBoxSize + myDiskThickness + myIndent * 2.0f;
}
Standard_ShortReal Size() const { return myInnerRadius + myDiskThickness + myIndent * 2; }
Standard_ShortReal InnerRadius() const { return myInnerRadius + myIndent * 2.0f; }
gp_Pnt ScalerCenter(const gp_Pnt& theLocation) const
{
@@ -750,8 +781,15 @@ protected:
// clang-format off
gp_Ax2 myPosition; //!< Position of the manipulator object. it displays its location and position of its axes.
Disk myCircle; //!< Outer circle
Handle(Graphic3d_Group) myCircleGroup;
Disk mySector; //!< Sector indicating the rotation angle
Handle(Graphic3d_Group) mySectorGroup;
Standard_Integer myCurrentIndex; //!< Index of active axis.
AIS_ManipulatorMode myCurrentMode; //!< Name of active manipulation mode.
ManipulatorSkin mySkinMode; //!< Name of active skin mode.
Standard_Boolean myIsActivationOnDetection; //!< Manual activation of modes (not on parts selection).
Standard_Boolean myIsZoomPersistentMode; //!< Zoom persistence mode activation.

View File

@@ -71,10 +71,8 @@ AIS_MediaPlayer::~AIS_MediaPlayer()
myFramePair.Nullify();
}
// =======================================================================
// function : OpenInput
// purpose :
// =======================================================================
//=================================================================================================
void AIS_MediaPlayer::OpenInput(const TCollection_AsciiString& thePath, Standard_Boolean theToWait)
{
if (myFramePair->PlayerContext().IsNull() && thePath.IsEmpty())
@@ -86,10 +84,8 @@ void AIS_MediaPlayer::OpenInput(const TCollection_AsciiString& thePath, Standard
SynchronizeAspects();
}
// =======================================================================
// function : PresentFrame
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_MediaPlayer::PresentFrame(const Graphic3d_Vec2i& theLeftCorner,
const Graphic3d_Vec2i& theMaxSize)
{
@@ -128,10 +124,8 @@ bool AIS_MediaPlayer::PresentFrame(const Graphic3d_Vec2i& theLeftCorner,
return toRedraw;
}
// =======================================================================
// function : updateSize
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_MediaPlayer::updateSize(const Graphic3d_Vec2i& theLeftCorner,
const Graphic3d_Vec2i& theMaxSize)
{
@@ -185,10 +179,8 @@ bool AIS_MediaPlayer::updateSize(const Graphic3d_Vec2i& theLeftCorner,
return true;
}
// =======================================================================
// function : PlayPause
// purpose :
// =======================================================================
//=================================================================================================
void AIS_MediaPlayer::PlayPause()
{
if (myFramePair->PlayerContext().IsNull())
@@ -201,10 +193,8 @@ void AIS_MediaPlayer::PlayPause()
myFramePair->PlayerContext()->PlayPause(isPaused, aProgress, aDuration);
}
// =======================================================================
// function : Compute
// purpose :
// =======================================================================
//=================================================================================================
void AIS_MediaPlayer::Compute(const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
@@ -227,10 +217,8 @@ void AIS_MediaPlayer::Compute(const Handle(PrsMgr_PresentationManager)&,
}
}
// =======================================================================
// function : ComputeSelection
// purpose :
// =======================================================================
//=================================================================================================
void AIS_MediaPlayer::ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{

View File

@@ -65,8 +65,11 @@ AIS_SelectStatus AIS_Selection::Select(const Handle(SelectMgr_EntityOwner)& theO
const Standard_Boolean wasSelected = theOwner->IsSelected();
const Standard_Boolean toSelect = theOwner->Select(theSelScheme, isDetected);
if (toSelect && !wasSelected)
if (!wasSelected || !myResultMap.IsBound(theOwner))
{
if (!toSelect)
return AIS_SS_NotDone;
AIS_NListOfEntityOwner::Iterator aListIter;
myresult.Append(theOwner, aListIter);
myResultMap.Bind(theOwner, aListIter);
@@ -74,11 +77,6 @@ AIS_SelectStatus AIS_Selection::Select(const Handle(SelectMgr_EntityOwner)& theO
return AIS_SS_Added;
}
if (!toSelect && !wasSelected)
{
return AIS_SS_NotDone;
}
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find(theOwner);
if (myIterator == aListIter)
{

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

@@ -738,10 +738,8 @@ Handle(Select3D_SensitiveEntity) AIS_Trihedron::createSensitiveEntity(
return Handle(Select3D_SensitiveEntity)();
}
// =======================================================================
// function : updatePrimitives
// purpose :
// =======================================================================
//=================================================================================================
void AIS_Trihedron::updatePrimitives(const Handle(Prs3d_DatumAspect)& theAspect,
Prs3d_DatumMode theMode,
const gp_Pnt& theOrigin,

View File

@@ -16,10 +16,8 @@
IMPLEMENT_STANDARD_RTTIEXT(AIS_TrihedronOwner, SelectMgr_EntityOwner)
// =======================================================================
// function : AIS_TrihedronOwner
// purpose :
// =======================================================================
//=================================================================================================
AIS_TrihedronOwner::AIS_TrihedronOwner(const Handle(SelectMgr_SelectableObject)& theSelObject,
const Prs3d_DatumParts thePart,
const Standard_Integer thePriority)
@@ -28,10 +26,8 @@ AIS_TrihedronOwner::AIS_TrihedronOwner(const Handle(SelectMgr_SelectableObject)&
{
}
// =======================================================================
// function : HilightWithColor
// purpose :
// =======================================================================
//=================================================================================================
void AIS_TrihedronOwner::HilightWithColor(const Handle(PrsMgr_PresentationManager)& thePM,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer /*theMode*/)
@@ -39,10 +35,8 @@ void AIS_TrihedronOwner::HilightWithColor(const Handle(PrsMgr_PresentationManage
Selectable()->HilightOwnerWithColor(thePM, theStyle, this);
}
// =======================================================================
// function : IsHilighted
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean AIS_TrihedronOwner::IsHilighted(const Handle(PrsMgr_PresentationManager)& thePM,
const Standard_Integer theMode) const
{
@@ -54,10 +48,8 @@ Standard_Boolean AIS_TrihedronOwner::IsHilighted(const Handle(PrsMgr_Presentatio
return thePM->IsHighlighted(Selectable(), theMode);
}
// =======================================================================
// function : Unhilight
// purpose :
// =======================================================================
//=================================================================================================
void AIS_TrihedronOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& thePM,
const Standard_Integer theMode)
{

View File

@@ -27,10 +27,8 @@
#include <V3d_Viewer.hxx>
#include <WNT_HIDSpaceMouse.hxx>
// =======================================================================
// function : AIS_ViewController
// purpose :
// =======================================================================
//=================================================================================================
AIS_ViewController::AIS_ViewController()
: myLastEventsTime(0.0),
myToAskNextFrame(false),
@@ -174,19 +172,15 @@ AIS_ViewController::AIS_ViewController()
myXRSelectHaptic.Amplitude = 0.5f;
}
// =======================================================================
// function : ~AIS_ViewController
// purpose :
// =======================================================================
//=================================================================================================
AIS_ViewController::~AIS_ViewController()
{
//
}
// =======================================================================
// function : ResetViewInput
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::ResetViewInput()
{
myKeys.Reset();
@@ -199,10 +193,8 @@ void AIS_ViewController::ResetViewInput()
myMouseClickCounter = 0;
}
// =======================================================================
// function : FlushViewEvents
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::FlushViewEvents(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
Standard_Boolean theToHandle)
@@ -262,10 +254,8 @@ void AIS_ViewController::FlushViewEvents(const Handle(AIS_InteractiveContext)& t
}
}
// =======================================================================
// function : flushBuffers
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::flushBuffers(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)&)
{
@@ -393,10 +383,8 @@ void AIS_ViewController::flushBuffers(const Handle(AIS_InteractiveContext)&,
}
}
// =======================================================================
// function : flushGestures
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::flushGestures(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView)
{
@@ -543,10 +531,8 @@ void AIS_ViewController::flushGestures(const Handle(AIS_InteractiveContext)&,
}
}
// =======================================================================
// function : UpdateViewOrientation
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::UpdateViewOrientation(V3d_TypeOfOrientation theOrientation,
bool theToFitAll)
{
@@ -555,10 +541,8 @@ void AIS_ViewController::UpdateViewOrientation(V3d_TypeOfOrientation theOrientat
myUI.Orientation.ViewOrient = theOrientation;
}
// =======================================================================
// function : SelectInViewer
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::SelectInViewer(const Graphic3d_Vec2i& thePnt,
const AIS_SelectionScheme theScheme)
{
@@ -572,10 +556,8 @@ void AIS_ViewController::SelectInViewer(const Graphic3d_Vec2i& thePnt,
myUI.Selection.Points.Append(thePnt);
}
// =======================================================================
// function : SelectInViewer
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::SelectInViewer(const NCollection_Sequence<Graphic3d_Vec2i>& thePnts,
const AIS_SelectionScheme theScheme)
{
@@ -596,10 +578,8 @@ void AIS_ViewController::SelectInViewer(const NCollection_Sequence<Graphic3d_Vec
}
}
// =======================================================================
// function : UpdateRubberBand
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::UpdateRubberBand(const Graphic3d_Vec2i& thePntFrom,
const Graphic3d_Vec2i& thePntTo)
{
@@ -609,10 +589,8 @@ void AIS_ViewController::UpdateRubberBand(const Graphic3d_Vec2i& thePntFrom,
myUI.Selection.Points.Append(thePntTo);
}
// =======================================================================
// function : UpdatePolySelection
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::UpdatePolySelection(const Graphic3d_Vec2i& thePnt, bool theToAppend)
{
if (myUI.Selection.Tool != AIS_ViewSelectionTool_Polygon)
@@ -635,10 +613,8 @@ void AIS_ViewController::UpdatePolySelection(const Graphic3d_Vec2i& thePnt, bool
}
}
// =======================================================================
// function : UpdateZoom
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::UpdateZoom(const Aspect_ScrollDelta& theDelta)
{
if (!myUI.ZoomActions.IsEmpty())
@@ -654,10 +630,8 @@ bool AIS_ViewController::UpdateZoom(const Aspect_ScrollDelta& theDelta)
return true;
}
// =======================================================================
// function : UpdateZRotation
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::UpdateZRotation(double theAngle)
{
if (!ToAllowTouchZRotation())
@@ -674,10 +648,8 @@ bool AIS_ViewController::UpdateZRotation(double theAngle)
return true;
}
// =======================================================================
// function : UpdateMouseScroll
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::UpdateMouseScroll(const Aspect_ScrollDelta& theDelta)
{
Aspect_ScrollDelta aDelta = theDelta;
@@ -685,10 +657,8 @@ bool AIS_ViewController::UpdateMouseScroll(const Aspect_ScrollDelta& theDelta)
return UpdateZoom(aDelta);
}
// =======================================================================
// function : UpdateMouseClick
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::UpdateMouseClick(const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
@@ -710,10 +680,8 @@ bool AIS_ViewController::UpdateMouseClick(const Graphic3d_Vec2i& thePoint,
return false;
}
// =======================================================================
// function : UpdateMouseButtons
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::UpdateMouseButtons(const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButtons,
Aspect_VKeyFlags theModifiers,
@@ -727,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();
@@ -912,10 +893,8 @@ bool AIS_ViewController::UpdateMouseButtons(const Graphic3d_Vec2i& thePoint,
return toUpdateView;
}
// =======================================================================
// function : UpdateMousePosition
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::UpdateMousePosition(const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButtons,
Aspect_VKeyFlags theModifiers,
@@ -1135,10 +1114,8 @@ bool AIS_ViewController::UpdateMousePosition(const Graphic3d_Vec2i& thePoint,
return toUpdateView;
}
// =======================================================================
// function : AddTouchPoint
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::AddTouchPoint(Standard_Size theId,
const Graphic3d_Vec2d& thePnt,
Standard_Boolean theClearBefore)
@@ -1168,10 +1145,8 @@ void AIS_ViewController::AddTouchPoint(Standard_Size theId,
myUI.IsNewGesture = true;
}
// =======================================================================
// function : RemoveTouchPoint
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::RemoveTouchPoint(Standard_Size theId, Standard_Boolean theClearSelectPnts)
{
if (!Aspect_WindowInputListener::RemoveTouchPoint(theId, theClearSelectPnts))
@@ -1233,10 +1208,8 @@ bool AIS_ViewController::RemoveTouchPoint(Standard_Size theId, Standard_Boolean
return true;
}
// =======================================================================
// function : UpdateTouchPoint
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::UpdateTouchPoint(Standard_Size theId, const Graphic3d_Vec2d& thePnt)
{
Aspect_WindowInputListener::UpdateTouchPoint(theId, thePnt);
@@ -1248,10 +1221,8 @@ void AIS_ViewController::UpdateTouchPoint(Standard_Size theId, const Graphic3d_V
}
}
// =======================================================================
// function : Update3dMouse
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::Update3dMouse(const WNT_HIDSpaceMouse& theEvent)
{
bool toUpdate = false;
@@ -1261,10 +1232,8 @@ bool AIS_ViewController::Update3dMouse(const WNT_HIDSpaceMouse& theEvent)
return toUpdate;
}
// =======================================================================
// function : SetNavigationMode
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::SetNavigationMode(AIS_NavigationMode theMode)
{
myNavigationMode = theMode;
@@ -1276,28 +1245,22 @@ void AIS_ViewController::SetNavigationMode(AIS_NavigationMode theMode)
myUI.ViewRotation.ToRotate = false;
}
// =======================================================================
// function : KeyDown
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::KeyDown(Aspect_VKey theKey, double theTime, double thePressure)
{
Aspect_WindowInputListener::KeyDown(theKey, theTime, thePressure);
}
// =======================================================================
// function : KeyUp
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::KeyUp(Aspect_VKey theKey, double theTime)
{
Aspect_WindowInputListener::KeyUp(theKey, theTime);
}
// =======================================================================
// function : KeyFromAxis
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::KeyFromAxis(Aspect_VKey theNegative,
Aspect_VKey thePositive,
double theTime,
@@ -1306,10 +1269,8 @@ void AIS_ViewController::KeyFromAxis(Aspect_VKey theNegative,
Aspect_WindowInputListener::KeyFromAxis(theNegative, thePositive, theTime, thePressure);
}
// =======================================================================
// function : FetchNavigationKeys
// purpose :
// =======================================================================
//=================================================================================================
AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRatio,
Standard_Real theRunRatio)
{
@@ -1456,10 +1417,8 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat
return aWalk;
}
// =======================================================================
// function : AbortViewAnimation
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::AbortViewAnimation()
{
if (!myViewAnimation.IsNull() && !myViewAnimation->IsStopped())
@@ -1469,10 +1428,8 @@ void AIS_ViewController::AbortViewAnimation()
}
}
// =======================================================================
// function : handlePanning
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handlePanning(const Handle(V3d_View)& theView)
{
if (!myGL.Panning.ToPan || !myToAllowPanning)
@@ -1513,10 +1470,8 @@ void AIS_ViewController::handlePanning(const Handle(V3d_View)& theView)
theView->View()->SynchronizeXRPosedToBaseCamera();
}
// =======================================================================
// function : handleZRotate
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleZRotate(const Handle(V3d_View)& theView)
{
if (!myGL.ZRotate.ToRotate || !myToAllowRotation)
@@ -1536,10 +1491,8 @@ void AIS_ViewController::handleZRotate(const Handle(V3d_View)& theView)
theView->View()->SynchronizeXRPosedToBaseCamera();
}
// =======================================================================
// function : handleZoom
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleZoom(const Handle(V3d_View)& theView,
const Aspect_ScrollDelta& theParams,
const gp_Pnt* thePnt)
@@ -1643,10 +1596,8 @@ void AIS_ViewController::handleZoom(const Handle(V3d_View)& theView,
theView->View()->SynchronizeXRPosedToBaseCamera();
}
// =======================================================================
// function : handleZFocusScroll
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleZFocusScroll(const Handle(V3d_View)& theView,
const Aspect_ScrollDelta& theParams)
{
@@ -1663,10 +1614,8 @@ void AIS_ViewController::handleZFocusScroll(const Handle(V3d_View)& theView,
}
}
// =======================================================================
// function : handleOrbitRotation
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleOrbitRotation(const Handle(V3d_View)& theView,
const gp_Pnt& thePnt,
bool theToLockZUp)
@@ -1815,10 +1764,8 @@ void AIS_ViewController::handleOrbitRotation(const Handle(V3d_View)& theView,
theView->View()->SynchronizeXRBaseToPosedCamera();
}
// =======================================================================
// function : handleViewRotation
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleViewRotation(const Handle(V3d_View)& theView,
double theYawExtra,
double thePitchExtra,
@@ -1891,10 +1838,8 @@ void AIS_ViewController::handleViewRotation(const Handle(V3d_View)& theView,
theView->Invalidate();
}
// =======================================================================
// function : PickPoint
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::PickPoint(gp_Pnt& thePnt,
const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
@@ -1923,10 +1868,8 @@ bool AIS_ViewController::PickPoint(gp_Pnt& thePnt,
&& !Precision::IsInfinite(thePnt.Z());
}
// =======================================================================
// function : PickAxis
// purpose :
// =======================================================================
//=================================================================================================
bool AIS_ViewController::PickAxis(gp_Pnt& theTopPnt,
const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
@@ -1947,10 +1890,8 @@ bool AIS_ViewController::PickAxis(gp_Pnt& theTopPn
&& !Precision::IsInfinite(theTopPnt.Z());
}
// =======================================================================
// function : GravityPoint
// purpose :
// =======================================================================
//=================================================================================================
gp_Pnt AIS_ViewController::GravityPoint(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -1993,10 +1934,8 @@ gp_Pnt AIS_ViewController::GravityPoint(const Handle(AIS_InteractiveContext)& th
return theCtx->GravityPoint(theView);
}
// =======================================================================
// function : FitAllAuto
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::FitAllAuto(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -2031,10 +1970,8 @@ void AIS_ViewController::FitAllAuto(const Handle(AIS_InteractiveContext)& theCtx
}
}
// =======================================================================
// function : handleViewOrientationKeys
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleViewOrientationKeys(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -2123,10 +2060,8 @@ void AIS_ViewController::handleViewOrientationKeys(const Handle(AIS_InteractiveC
}
}
// =======================================================================
// function : handleNavigationKeys
// purpose :
// =======================================================================
//=================================================================================================
AIS_WalkDelta AIS_ViewController::handleNavigationKeys(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView)
{
@@ -2256,10 +2191,8 @@ AIS_WalkDelta AIS_ViewController::handleNavigationKeys(const Handle(AIS_Interact
return aWalk;
}
// =======================================================================
// function : handleCameraActions
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleCameraActions(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const AIS_WalkDelta& theWalk)
@@ -2280,6 +2213,13 @@ void AIS_ViewController::handleCameraActions(const Handle(AIS_InteractiveContext
myGL.Orientation.ToFitAll = false;
}
AIS_ListOfInteractive anObjects;
theCtx->DisplayedObjects(anObjects);
for (AIS_ListIteratorOfListOfInteractive anObjIter(anObjects); anObjIter.More(); anObjIter.Next())
{
anObjIter.Value()->RecomputeTransformation(theView->Camera());
}
if (myGL.IsNewGesture)
{
if (myAnchorPointPrs1->HasInteractiveContext())
@@ -2465,10 +2405,8 @@ void AIS_ViewController::handleCameraActions(const Handle(AIS_InteractiveContext
}
}
// =======================================================================
// function : handleXRInput
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleXRInput(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const AIS_WalkDelta&)
@@ -2483,10 +2421,8 @@ void AIS_ViewController::handleXRInput(const Handle(AIS_InteractiveContext)& the
handleXRPicking(theCtx, theView);
}
// =======================================================================
// function : handleXRTurnPad
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleXRTurnPad(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView)
{
@@ -2526,10 +2462,8 @@ void AIS_ViewController::handleXRTurnPad(const Handle(AIS_InteractiveContext)&,
}
}
// =======================================================================
// function : handleXRTeleport
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleXRTeleport(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -2663,10 +2597,8 @@ void AIS_ViewController::handleXRTeleport(const Handle(AIS_InteractiveContext)&
}
}
// =======================================================================
// function : handleXRPicking
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleXRPicking(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -2719,20 +2651,16 @@ void AIS_ViewController::handleXRPicking(const Handle(AIS_InteractiveContext)& t
}
}
// =======================================================================
// function : OnSelectionChanged
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::OnSelectionChanged(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)&)
{
//
}
// =======================================================================
// function : OnSubviewChanged
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::OnSubviewChanged(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)&,
const Handle(V3d_View)&)
@@ -2740,10 +2668,8 @@ void AIS_ViewController::OnSubviewChanged(const Handle(AIS_InteractiveContext)&,
//
}
// =======================================================================
// function : OnObjectDragged
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::OnObjectDragged(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
AIS_DragAction theAction)
@@ -2850,10 +2776,8 @@ void AIS_ViewController::OnObjectDragged(const Handle(AIS_InteractiveContext)& t
}
}
// =======================================================================
// function : contextLazyMoveTo
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::contextLazyMoveTo(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const Graphic3d_Vec2i& thePnt)
@@ -2907,10 +2831,8 @@ void AIS_ViewController::contextLazyMoveTo(const Handle(AIS_InteractiveContext)&
}
}
// =======================================================================
// function : handleSelectionPick
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleSelectionPick(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -2939,10 +2861,8 @@ void AIS_ViewController::handleSelectionPick(const Handle(AIS_InteractiveContext
}
}
// =======================================================================
// function : handleSelectionPoly
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleSelectionPoly(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -3067,10 +2987,8 @@ void AIS_ViewController::handleSelectionPoly(const Handle(AIS_InteractiveContext
}
}
// =======================================================================
// function : handleDynamicHighlight
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleDynamicHighlight(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -3135,10 +3053,8 @@ void AIS_ViewController::handleDynamicHighlight(const Handle(AIS_InteractiveCont
}
}
// =======================================================================
// function : handleMoveTo
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleMoveTo(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -3147,10 +3063,8 @@ void AIS_ViewController::handleMoveTo(const Handle(AIS_InteractiveContext)& theC
handleSelectionPoly(theCtx, theView);
}
// =======================================================================
// function : handleViewRedraw
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleViewRedraw(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView)
{
@@ -3258,10 +3172,8 @@ void AIS_ViewController::handleViewRedraw(const Handle(AIS_InteractiveContext)&,
}
}
// =======================================================================
// function : handleXRMoveTo
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer AIS_ViewController::handleXRMoveTo(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const gp_Trsf& thePose,
@@ -3290,10 +3202,8 @@ Standard_Integer AIS_ViewController::handleXRMoveTo(const Handle(AIS_Interactive
return aPickResult;
}
// =======================================================================
// function : handleXRHighlight
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleXRHighlight(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -3340,10 +3250,8 @@ void AIS_ViewController::handleXRHighlight(const Handle(AIS_InteractiveContext)&
}
}
// =======================================================================
// function : handleXRPresentations
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handleXRPresentations(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
@@ -3502,10 +3410,8 @@ void AIS_ViewController::handleXRPresentations(const Handle(AIS_InteractiveConte
}
}
// =======================================================================
// function : HandleViewEvents
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::HandleViewEvents(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{

View File

@@ -18,7 +18,7 @@
#include <AdvApp2Var_Context.hxx>
#include <Standard_ConstructionError.hxx>
// Calculaton of parameters
// Calculation of parameters
static Standard_Boolean lesparam(const Standard_Integer iordre,
const Standard_Integer ncflim,
const Standard_Integer icodeo,

View File

@@ -17,8 +17,10 @@
#ifndef _AdvApp2Var_CriterionType_HeaderFile
#define _AdvApp2Var_CriterionType_HeaderFile
//! influency of the criterion on cutting process//! cutting when criterion is not satisfied
//! desactivation of the compute of the error max//! cutting when error max is not good or if error
//! influence of the criterion on cutting process
//! cutting when criterion is not satisfied
//! deactivation of the compute of the error max
//! cutting when error max is not good or if error
//! max is good and criterion is not satisfied
enum AdvApp2Var_CriterionType
{

View File

@@ -5339,7 +5339,7 @@ int mmherm1_(doublereal* debfin,
/* INPUT ARGUMENTS : */
/* -------------------- */
/* DEBFIN : PARAMETES DEFINING THE CONSTRAINTS */
/* DEBFIN : PARAMETERS DEFINING THE CONSTRAINTS */
/* DEBFIN(1) : FIRST PARAMETER */
/* DEBFIN(2) : SECOND PARAMETER */

View File

@@ -459,7 +459,7 @@ Standard_Boolean Approx_SweepApproximation::D0(const Standard_Real Param,
AAffin->Value(ii).Transforms(myPoles2d->ChangeValue(ii).ChangeCoord());
}
// Update variables of controle and return
// Update variables of control and return
first = First;
last = Last;
myOrder = 0;

View File

@@ -58,10 +58,8 @@ Quantity_Color Aspect_Background::Color() const
return (MyColor);
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_Background::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, Aspect_Background)

View File

@@ -23,10 +23,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection, Standard_Transient)
// =======================================================================
// function : Aspect_DisplayConnection
// purpose :
// =======================================================================
//=================================================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection()
{
#if defined(HAVE_XLIB)
@@ -40,10 +38,8 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
#endif
}
// =======================================================================
// function : ~Aspect_DisplayConnection
// purpose :
// =======================================================================
//=================================================================================================
Aspect_DisplayConnection::~Aspect_DisplayConnection()
{
#if defined(HAVE_XLIB)
@@ -58,10 +54,8 @@ Aspect_DisplayConnection::~Aspect_DisplayConnection()
#endif
}
// =======================================================================
// function : Aspect_DisplayConnection
// purpose :
// =======================================================================
//=================================================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection(const TCollection_AsciiString& theDisplayName)
: myDisplay(NULL),
myDefVisualInfo(NULL),
@@ -72,10 +66,8 @@ Aspect_DisplayConnection::Aspect_DisplayConnection(const TCollection_AsciiString
Init(NULL);
}
// =======================================================================
// function : Aspect_DisplayConnection
// purpose :
// =======================================================================
//=================================================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection(Aspect_XDisplay* theDisplay)
: myDisplay(NULL),
myDefVisualInfo(NULL),
@@ -85,10 +77,8 @@ Aspect_DisplayConnection::Aspect_DisplayConnection(Aspect_XDisplay* theDisplay)
Init(theDisplay);
}
// =======================================================================
// function : SetDefaultVisualInfo
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_DisplayConnection::SetDefaultVisualInfo(Aspect_XVisualInfo* theVisual,
Aspect_FBConfig theFBConfig)
{
@@ -102,10 +92,8 @@ void Aspect_DisplayConnection::SetDefaultVisualInfo(Aspect_XVisualInfo* theVisua
myDefFBConfig = theFBConfig;
}
// =======================================================================
// function : Init
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_DisplayConnection::Init(Aspect_XDisplay* theDisplay)
{
#if defined(HAVE_XLIB)

View File

@@ -19,10 +19,8 @@
#include <Standard_Dump.hxx>
// =======================================================================
// function : Aspect_GenId
// purpose :
// =======================================================================
//=================================================================================================
Aspect_GenId::Aspect_GenId()
: myFreeCount(INT_MAX / 2 + 1),
myLength(INT_MAX / 2 + 1),
@@ -32,10 +30,8 @@ Aspect_GenId::Aspect_GenId()
//
}
// =======================================================================
// function : Aspect_GenId
// purpose :
// =======================================================================
//=================================================================================================
Aspect_GenId::Aspect_GenId(const Standard_Integer theLow, const Standard_Integer theUpper)
: myFreeCount(theUpper - theLow + 1),
myLength(theUpper - theLow + 1),
@@ -48,20 +44,16 @@ Aspect_GenId::Aspect_GenId(const Standard_Integer theLow, const Standard_Integer
}
}
// =======================================================================
// function : Free
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_GenId::Free()
{
myFreeCount = myLength;
myFreeIds.Clear();
}
// =======================================================================
// function : Free
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_GenId::Free(const Standard_Integer theId)
{
if (theId >= myLowerBound && theId <= myUpperBound)
@@ -78,10 +70,8 @@ void Aspect_GenId::Free(const Standard_Integer theId)
}
}
// =======================================================================
// function : Next
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Aspect_GenId::Next()
{
Standard_Integer aNewId = 0;
@@ -92,10 +82,8 @@ Standard_Integer Aspect_GenId::Next()
return aNewId;
}
// =======================================================================
// function : Next
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Aspect_GenId::Next(Standard_Integer& theId)
{
if (!myFreeIds.IsEmpty())
@@ -114,10 +102,8 @@ Standard_Boolean Aspect_GenId::Next(Standard_Integer& theId)
return Standard_True;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_GenId::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myFreeCount)

View File

@@ -54,10 +54,8 @@ Aspect_GradientFillMethod Aspect_GradientBackground::BgGradientFillMethod() cons
return MyGradientMethod;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_GradientBackground::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{

View File

@@ -15,10 +15,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Aspect_NeutralWindow, Aspect_Window)
// =======================================================================
// function : Aspect_NeutralWindow
// purpose :
// =======================================================================
//=================================================================================================
Aspect_NeutralWindow::Aspect_NeutralWindow()
: myHandle(0),
myParentHandle(0),
@@ -31,10 +29,8 @@ Aspect_NeutralWindow::Aspect_NeutralWindow()
{
}
// =======================================================================
// function : SetNativeHandles
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Aspect_NeutralWindow::SetNativeHandles(Aspect_Drawable theWindow,
Aspect_Drawable theParentWindow,
Aspect_FBConfig theFbConfig)
@@ -50,10 +46,8 @@ Standard_Boolean Aspect_NeutralWindow::SetNativeHandles(Aspect_Drawable theWindo
return Standard_True;
}
// =======================================================================
// function : SetPosition
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Aspect_NeutralWindow::SetPosition(Standard_Integer theX1, Standard_Integer theY1)
{
if (myPosX == theX1 && myPosY == theY1)
@@ -66,10 +60,8 @@ Standard_Boolean Aspect_NeutralWindow::SetPosition(Standard_Integer theX1, Stand
return Standard_True;
}
// =======================================================================
// function : SetPosition
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Aspect_NeutralWindow::SetPosition(Standard_Integer theX1,
Standard_Integer theY1,
Standard_Integer theX2,
@@ -89,10 +81,8 @@ Standard_Boolean Aspect_NeutralWindow::SetPosition(Standard_Integer theX1,
return Standard_True;
}
// =======================================================================
// function : SetSize
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Aspect_NeutralWindow::SetSize(const Standard_Integer theWidth,
const Standard_Integer theHeight)
{

View File

@@ -206,7 +206,7 @@ TCollection_AsciiString defaultActionsManifestInit()
return aCasRoot + "/XRResources/src/" + THE_ACTIONS_JSON;
}
}
return OSD_Process::ExecutablePath() + "/occtvr_actions.json";
return OSD_Process::ExecutableFolder() + "/occtvr_actions.json";
}
} // namespace
#endif
@@ -341,10 +341,8 @@ private:
};
#endif
// =======================================================================
// function : IsHmdPresent
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_OpenVRSession::IsHmdPresent()
{
#ifdef HAVE_OPENVR
@@ -354,10 +352,8 @@ bool Aspect_OpenVRSession::IsHmdPresent()
#endif
}
// =======================================================================
// function : defaultActionsManifest
// purpose :
// =======================================================================
//=================================================================================================
TCollection_AsciiString Aspect_OpenVRSession::defaultActionsManifest()
{
#ifdef HAVE_OPENVR
@@ -368,10 +364,8 @@ TCollection_AsciiString Aspect_OpenVRSession::defaultActionsManifest()
#endif
}
// =======================================================================
// function : Aspect_OpenVRSession
// purpose :
// =======================================================================
//=================================================================================================
Aspect_OpenVRSession::Aspect_OpenVRSession()
: myContext(new VRContext())
{
@@ -491,20 +485,16 @@ Aspect_OpenVRSession::Aspect_OpenVRSession()
#endif
}
// =======================================================================
// function : ~Aspect_OpenVRSession
// purpose :
// =======================================================================
//=================================================================================================
Aspect_OpenVRSession::~Aspect_OpenVRSession()
{
closeVR();
delete myContext;
}
// =======================================================================
// function : closeVR
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::closeVR()
{
#ifdef HAVE_OPENVR
@@ -516,10 +506,8 @@ void Aspect_OpenVRSession::closeVR()
#endif
}
// =======================================================================
// function : getVRSystem
// purpose :
// =======================================================================
//=================================================================================================
void* Aspect_OpenVRSession::getVRSystem() const
{
#ifdef HAVE_OPENVR
@@ -529,19 +517,15 @@ void* Aspect_OpenVRSession::getVRSystem() const
#endif
}
// =======================================================================
// function : Close
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::Close()
{
closeVR();
}
// =======================================================================
// function : IsOpen
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_OpenVRSession::IsOpen() const
{
#ifdef HAVE_OPENVR
@@ -551,10 +535,8 @@ bool Aspect_OpenVRSession::IsOpen() const
#endif
}
// =======================================================================
// function : Open
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_OpenVRSession::Open()
{
#ifdef HAVE_OPENVR
@@ -600,10 +582,8 @@ bool Aspect_OpenVRSession::Open()
#endif
}
// =======================================================================
// function : initInput
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_OpenVRSession::initInput()
{
#ifdef HAVE_OPENVR
@@ -670,10 +650,8 @@ bool Aspect_OpenVRSession::initInput()
#endif
}
// =======================================================================
// function : GetString
// purpose :
// =======================================================================
//=================================================================================================
TCollection_AsciiString Aspect_OpenVRSession::GetString(InfoString theInfo) const
{
#ifdef HAVE_OPENVR
@@ -706,10 +684,8 @@ TCollection_AsciiString Aspect_OpenVRSession::GetString(InfoString theInfo) cons
return TCollection_AsciiString();
}
// =======================================================================
// function : NamedTrackedDevice
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Aspect_OpenVRSession::NamedTrackedDevice(
Aspect_XRTrackedDeviceRole theDevice) const
{
@@ -745,10 +721,8 @@ Standard_Integer Aspect_OpenVRSession::NamedTrackedDevice(
return -1;
}
// =======================================================================
// function : loadRenderModel
// purpose :
// =======================================================================
//=================================================================================================
Handle(Graphic3d_ArrayOfTriangles) Aspect_OpenVRSession::loadRenderModel(
Standard_Integer theDevice,
Standard_Boolean theToApplyUnitFactor,
@@ -823,10 +797,8 @@ Handle(Graphic3d_ArrayOfTriangles) Aspect_OpenVRSession::loadRenderModel(
#endif
}
// =======================================================================
// function : EyeToHeadTransform
// purpose :
// =======================================================================
//=================================================================================================
NCollection_Mat4<double> Aspect_OpenVRSession::EyeToHeadTransform(Aspect_Eye theEye) const
{
#ifdef HAVE_OPENVR
@@ -849,10 +821,8 @@ NCollection_Mat4<double> Aspect_OpenVRSession::EyeToHeadTransform(Aspect_Eye the
return NCollection_Mat4<double>();
}
// =======================================================================
// function : ProjectionMatrix
// purpose :
// =======================================================================
//=================================================================================================
NCollection_Mat4<double> Aspect_OpenVRSession::ProjectionMatrix(Aspect_Eye theEye,
double theZNear,
double theZFar) const
@@ -874,10 +844,8 @@ NCollection_Mat4<double> Aspect_OpenVRSession::ProjectionMatrix(Aspect_Eye theEy
return NCollection_Mat4<double>();
}
// =======================================================================
// function : updateProjectionFrustums
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::updateProjectionFrustums()
{
#ifdef HAVE_OPENVR
@@ -913,10 +881,8 @@ void Aspect_OpenVRSession::updateProjectionFrustums()
#endif
}
// =======================================================================
// function : SetTrackingOrigin
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::SetTrackingOrigin(TrackingUniverseOrigin theOrigin)
{
#ifdef HAVE_OPENVR
@@ -938,10 +904,8 @@ void Aspect_OpenVRSession::SetTrackingOrigin(TrackingUniverseOrigin theOrigin)
myTrackOrigin = theOrigin;
}
// =======================================================================
// function : WaitPoses
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_OpenVRSession::WaitPoses()
{
#ifdef HAVE_OPENVR
@@ -990,10 +954,8 @@ bool Aspect_OpenVRSession::WaitPoses()
#endif
}
// =======================================================================
// function : GetDigitalActionData
// purpose :
// =======================================================================
//=================================================================================================
Aspect_XRDigitalActionData Aspect_OpenVRSession::GetDigitalActionData(
const Handle(Aspect_XRAction)& theAction) const
{
@@ -1030,10 +992,8 @@ Aspect_XRDigitalActionData Aspect_OpenVRSession::GetDigitalActionData(
return anActionData;
}
// =======================================================================
// function : GetAnalogActionData
// purpose :
// =======================================================================
//=================================================================================================
Aspect_XRAnalogActionData Aspect_OpenVRSession::GetAnalogActionData(
const Handle(Aspect_XRAction)& theAction) const
{
@@ -1069,10 +1029,8 @@ Aspect_XRAnalogActionData Aspect_OpenVRSession::GetAnalogActionData(
return anActionData;
}
// =======================================================================
// function : GetPoseActionDataForNextFrame
// purpose :
// =======================================================================
//=================================================================================================
Aspect_XRPoseActionData Aspect_OpenVRSession::GetPoseActionDataForNextFrame(
const Handle(Aspect_XRAction)& theAction) const
{
@@ -1118,10 +1076,8 @@ Aspect_XRPoseActionData Aspect_OpenVRSession::GetPoseActionDataForNextFrame(
return anActionData;
}
// =======================================================================
// function : triggerHapticVibrationAction
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::triggerHapticVibrationAction(const Handle(Aspect_XRAction)& theAction,
const Aspect_XRHapticActionData& theParams)
{
@@ -1160,10 +1116,8 @@ void Aspect_OpenVRSession::triggerHapticVibrationAction(const Handle(Aspect_XRAc
#endif
}
// =======================================================================
// function : ProcessEvents
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::ProcessEvents()
{
#ifdef HAVE_OPENVR
@@ -1247,37 +1201,29 @@ void Aspect_OpenVRSession::ProcessEvents()
#endif
}
// =======================================================================
// function : onTrackedDeviceActivated
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::onTrackedDeviceActivated(Standard_Integer theDeviceIndex)
{
Message::SendTrace(TCollection_AsciiString("OpenVR, Device ") + theDeviceIndex + " attached");
}
// =======================================================================
// function : onTrackedDeviceDeactivated
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::onTrackedDeviceDeactivated(Standard_Integer theDeviceIndex)
{
Message::SendTrace(TCollection_AsciiString("OpenVR, Device ") + theDeviceIndex + " detached");
}
// =======================================================================
// function : onTrackedDeviceUpdated
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_OpenVRSession::onTrackedDeviceUpdated(Standard_Integer theDeviceIndex)
{
Message::SendTrace(TCollection_AsciiString("OpenVR, Device ") + theDeviceIndex + " updated");
}
// =======================================================================
// function : SubmitEye
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_OpenVRSession::SubmitEye(void* theTexture,
Aspect_GraphicsLibrary theGraphicsLib,
Aspect_ColorSpace theColorSpace,

View File

@@ -17,10 +17,8 @@
#include <Standard_RangeError.hxx>
// =======================================================================
// function : Constructor
// purpose :
// =======================================================================
//=================================================================================================
Aspect_SkydomeBackground::Aspect_SkydomeBackground()
: mySunDirection(0.0f, 1.0f, 0.0f),
myCloudiness(0.2f),
@@ -31,10 +29,8 @@ Aspect_SkydomeBackground::Aspect_SkydomeBackground()
//
}
// =======================================================================
// function : Constructor
// purpose :
// =======================================================================
//=================================================================================================
Aspect_SkydomeBackground::Aspect_SkydomeBackground(const gp_Dir& theSunDirection,
Standard_ShortReal theCloudiness,
Standard_ShortReal theTime,
@@ -57,19 +53,15 @@ Aspect_SkydomeBackground::Aspect_SkydomeBackground(const gp_Dir& theSunDire
"Aspect_SkydomeBackground::Aspect_SkydomeBackground() theSize must be > 0");
}
// =======================================================================
// function : ~Aspect_SkydomeBackground
// purpose :
// =======================================================================
//=================================================================================================
Aspect_SkydomeBackground::~Aspect_SkydomeBackground()
{
//
}
// =======================================================================
// function : SetCloudiness
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_SkydomeBackground::SetCloudiness(Standard_ShortReal theCloudiness)
{
Standard_RangeError_Raise_if(
@@ -78,10 +70,8 @@ void Aspect_SkydomeBackground::SetCloudiness(Standard_ShortReal theCloudiness)
myCloudiness = theCloudiness;
}
// =======================================================================
// function : SetFogginess
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_SkydomeBackground::SetFogginess(Standard_ShortReal theFogginess)
{
Standard_RangeError_Raise_if(theFogginess < 0,
@@ -89,10 +79,8 @@ void Aspect_SkydomeBackground::SetFogginess(Standard_ShortReal theFogginess)
myFogginess = theFogginess;
}
// =======================================================================
// function : SetSize
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_SkydomeBackground::SetSize(Standard_Integer theSize)
{
Standard_RangeError_Raise_if(theSize <= 0,
@@ -100,10 +88,8 @@ void Aspect_SkydomeBackground::SetSize(Standard_Integer theSize)
mySize = theSize;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_SkydomeBackground::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{

View File

@@ -15,10 +15,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Aspect_VKeySet, Standard_Transient)
// ================================================================
// Function : As1pect_VKeySet
// Purpose :
// ================================================================
//=================================================================================================
Aspect_VKeySet::Aspect_VKeySet()
: myKeys(0, Aspect_VKey_MAX),
myModifiers(Aspect_VKeyFlags_NONE)
@@ -26,10 +24,8 @@ Aspect_VKeySet::Aspect_VKeySet()
//
}
// ================================================================
// Function : Reset
// Purpose :
// ================================================================
//=================================================================================================
void Aspect_VKeySet::Reset()
{
Standard_Mutex::Sentry aLock(myLock);
@@ -40,10 +36,8 @@ void Aspect_VKeySet::Reset()
}
}
// ================================================================
// Function : KeyDown
// Purpose :
// ================================================================
//=================================================================================================
void Aspect_VKeySet::KeyDown(Aspect_VKey theKey, double theTime, double thePressure)
{
Standard_Mutex::Sentry aLock(myLock);
@@ -58,10 +52,8 @@ void Aspect_VKeySet::KeyDown(Aspect_VKey theKey, double theTime, double thePress
myModifiers = myModifiers | aModif;
}
// ================================================================
// Function : KeyUp
// Purpose :
// ================================================================
//=================================================================================================
void Aspect_VKeySet::KeyUp(Aspect_VKey theKey, double theTime)
{
Standard_Mutex::Sentry aLock(myLock);
@@ -78,10 +70,8 @@ void Aspect_VKeySet::KeyUp(Aspect_VKey theKey, double theTime)
}
}
// ================================================================
// Function : KeyFromAxis
// Purpose :
// ================================================================
//=================================================================================================
void Aspect_VKeySet::KeyFromAxis(Aspect_VKey theNegative,
Aspect_VKey thePositive,
double theTime,
@@ -112,10 +102,8 @@ void Aspect_VKeySet::KeyFromAxis(Aspect_VKey theNegative,
}
}
// ================================================================
// Function : HoldDuration
// Purpose :
// ================================================================
//=================================================================================================
bool Aspect_VKeySet::HoldDuration(Aspect_VKey theKey,
double theTime,
double& theDuration,

View File

@@ -15,10 +15,8 @@
#include <WNT_HIDSpaceMouse.hxx>
// =======================================================================
// function : Aspect_WindowInputListener
// purpose :
// =======================================================================
//=================================================================================================
Aspect_WindowInputListener::Aspect_WindowInputListener()
: myMousePressed(Aspect_VKeyMouse_NONE),
myMouseModifiers(Aspect_VKeyFlags_NONE),
@@ -33,37 +31,29 @@ Aspect_WindowInputListener::Aspect_WindowInputListener()
myEventTimer.Start();
}
// =======================================================================
// function : ~Aspect_WindowInputListener
// purpose :
// =======================================================================
//=================================================================================================
Aspect_WindowInputListener::~Aspect_WindowInputListener()
{
//
}
// =======================================================================
// function : KeyDown
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_WindowInputListener::KeyDown(Aspect_VKey theKey, double theTime, double thePressure)
{
myKeys.KeyDown(theKey, theTime, thePressure);
}
// =======================================================================
// function : KeyUp
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_WindowInputListener::KeyUp(Aspect_VKey theKey, double theTime)
{
myKeys.KeyUp(theKey, theTime);
}
// =======================================================================
// function : KeyFromAxis
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_WindowInputListener::KeyFromAxis(Aspect_VKey theNegative,
Aspect_VKey thePositive,
double theTime,
@@ -72,10 +62,8 @@ void Aspect_WindowInputListener::KeyFromAxis(Aspect_VKey theNegative,
myKeys.KeyFromAxis(theNegative, thePositive, theTime, thePressure);
}
// =======================================================================
// function : AddTouchPoint
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_WindowInputListener::AddTouchPoint(Standard_Size theId,
const Graphic3d_Vec2d& thePnt,
Standard_Boolean theClearBefore)
@@ -88,10 +76,8 @@ void Aspect_WindowInputListener::AddTouchPoint(Standard_Size theId,
myTouchPoints.Add(theId, Aspect_Touch(thePnt, false));
}
// =======================================================================
// function : RemoveTouchPoint
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_WindowInputListener::RemoveTouchPoint(Standard_Size theId,
Standard_Boolean theClearSelectPnts)
{
@@ -119,10 +105,8 @@ bool Aspect_WindowInputListener::RemoveTouchPoint(Standard_Size theId,
return true;
}
// =======================================================================
// function : UpdateTouchPoint
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_WindowInputListener::UpdateTouchPoint(Standard_Size theId,
const Graphic3d_Vec2d& thePnt)
{
@@ -136,10 +120,8 @@ void Aspect_WindowInputListener::UpdateTouchPoint(Standard_Size theId,
}
}
// =======================================================================
// function : update3dMouseTranslation
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_WindowInputListener::update3dMouseTranslation(const WNT_HIDSpaceMouse& theEvent)
{
if (!theEvent.IsTranslation())
@@ -157,10 +139,8 @@ bool Aspect_WindowInputListener::update3dMouseTranslation(const WNT_HIDSpaceMous
return true;
}
// =======================================================================
// function : update3dMouseRotation
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_WindowInputListener::update3dMouseRotation(const WNT_HIDSpaceMouse& theEvent)
{
if (!theEvent.IsRotation())
@@ -199,10 +179,8 @@ bool Aspect_WindowInputListener::update3dMouseRotation(const WNT_HIDSpaceMouse&
return toUpdate;
}
// =======================================================================
// function : update3dMouseKeys
// purpose :
// =======================================================================
//=================================================================================================
bool Aspect_WindowInputListener::update3dMouseKeys(const WNT_HIDSpaceMouse& theEvent)
{
bool toUpdate = false;

View File

@@ -17,10 +17,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Aspect_XRSession, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Aspect_XRAction, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Aspect_XRActionSet, Standard_Transient)
// =======================================================================
// function : Aspect_XRSession
// purpose :
// =======================================================================
//=================================================================================================
Aspect_XRSession::Aspect_XRSession()
: myTrackOrigin(TrackingUniverseOrigin_Standing),
myTrackedPoses(0, 0),
@@ -36,19 +34,15 @@ Aspect_XRSession::Aspect_XRSession()
}
}
// =======================================================================
// function : AbortHapticVibrationAction
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_XRSession::AbortHapticVibrationAction(const Handle(Aspect_XRAction)& theAction)
{
triggerHapticVibrationAction(theAction, Aspect_XRHapticActionData());
}
// =======================================================================
// function : TriggerHapticVibrationAction
// purpose :
// =======================================================================
//=================================================================================================
void Aspect_XRSession::TriggerHapticVibrationAction(const Handle(Aspect_XRAction)& theAction,
const Aspect_XRHapticActionData& theParams)
{

View File

@@ -41,10 +41,8 @@
#include <TopTools_MapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
// ================================================================================
// function: Constructor
// purpose:
// ================================================================================
//=================================================================================================
BOPAlgo_ArgumentAnalyzer::BOPAlgo_ArgumentAnalyzer()
: BOPAlgo_Algo(),
myStopOnFirst(Standard_False),
@@ -70,64 +68,50 @@ BOPAlgo_ArgumentAnalyzer::~BOPAlgo_ArgumentAnalyzer()
myResult.Clear();
}
// ================================================================================
// function: SetShape1
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::SetShape1(const TopoDS_Shape& TheShape)
{
myShape1 = TheShape;
}
// ================================================================================
// function: SetShape2
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::SetShape2(const TopoDS_Shape& TheShape)
{
myShape2 = TheShape;
}
// ================================================================================
// function: GetShape1
// purpose:
// ================================================================================
//=================================================================================================
const TopoDS_Shape& BOPAlgo_ArgumentAnalyzer::GetShape1() const
{
return myShape1;
}
// ================================================================================
// function: GetShape2
// purpose:
// ================================================================================
//=================================================================================================
const TopoDS_Shape& BOPAlgo_ArgumentAnalyzer::GetShape2() const
{
return myShape2;
}
// ================================================================================
// function: OperationType
// purpose:
// ================================================================================
//=================================================================================================
BOPAlgo_Operation& BOPAlgo_ArgumentAnalyzer::OperationType()
{
return myOperation;
}
// ================================================================================
// function: StopOnFirstFaulty
// purpose:
// ================================================================================
//=================================================================================================
Standard_Boolean& BOPAlgo_ArgumentAnalyzer::StopOnFirstFaulty()
{
return myStopOnFirst;
}
// ================================================================================
// function: Prepare
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::Prepare()
{
Standard_Boolean isS1 = myShape1.IsNull(), isS2 = myShape2.IsNull();
@@ -141,10 +125,8 @@ void BOPAlgo_ArgumentAnalyzer::Prepare()
}
}
// ================================================================================
// function: Perform
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange)
{
Message_ProgressScope aPS(theRange, "Analyze shapes", 10);
@@ -262,28 +244,22 @@ void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange)
}
}
// ================================================================================
// function: HasFaulty
// purpose:
// ================================================================================
//=================================================================================================
Standard_Boolean BOPAlgo_ArgumentAnalyzer::HasFaulty() const
{
return (!myResult.IsEmpty());
}
// ================================================================================
// function: GetCheckResult
// purpose:
// ================================================================================
//=================================================================================================
const BOPAlgo_ListOfCheckResult& BOPAlgo_ArgumentAnalyzer::GetCheckResult() const
{
return myResult;
}
// ================================================================================
// function: TestTypes
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestTypes()
{
Standard_Boolean isS1 = myShape1.IsNull(), isS2 = myShape2.IsNull();
@@ -448,10 +424,8 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences(const Message_ProgressRange
} // for(ii = 0; ii < 2; ii++) {
}
// ================================================================================
// function: TestSmallEdge
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
{
Standard_Integer i = 0;
@@ -570,10 +544,8 @@ void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
}
}
// ================================================================================
// function: TestRebuildFace
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestRebuildFace()
{
if ((myOperation == BOPAlgo_SECTION) || (myOperation == BOPAlgo_UNKNOWN))
@@ -671,19 +643,15 @@ void BOPAlgo_ArgumentAnalyzer::TestRebuildFace()
}
}
// ================================================================================
// function: TestTangent
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestTangent()
{
// not implemented
}
// ================================================================================
// function: TestMergeSubShapes
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestMergeSubShapes(const TopAbs_ShapeEnum theType)
{
if (myShape1.IsNull() || myShape2.IsNull())
@@ -869,28 +837,22 @@ void BOPAlgo_ArgumentAnalyzer::TestMergeSubShapes(const TopAbs_ShapeEnum theType
}
}
// ================================================================================
// function: TestMergeVertex
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestMergeVertex()
{
TestMergeSubShapes(TopAbs_VERTEX);
}
// ================================================================================
// function: TestMergeEdge
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestMergeEdge()
{
TestMergeSubShapes(TopAbs_EDGE);
}
// ================================================================================
// function: TestContinuity
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestContinuity()
{
Standard_Integer i, j, aNbS;
@@ -955,10 +917,8 @@ void BOPAlgo_ArgumentAnalyzer::TestContinuity()
}
}
// ================================================================================
// function: TestCurveOnSurface
// purpose:
// ================================================================================
//=================================================================================================
void BOPAlgo_ArgumentAnalyzer::TestCurveOnSurface()
{
Standard_Integer i;

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

@@ -57,9 +57,12 @@ void BRepAdaptor_Curve2d::Initialize(const TopoDS_Edge& E, const TopoDS_Face& F)
{
myEdge = E;
myFace = F;
Standard_Real pf, pl;
const Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(E, F, pf, pl);
Geom2dAdaptor_Curve::Load(PC, pf, pl);
Standard_Real aFirs, aLast;
const Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(E, F, aFirs, aLast);
if (!aPCurve.IsNull())
{
Geom2dAdaptor_Curve::Load(aPCurve, aFirs, aLast);
}
}
//=================================================================================================

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

@@ -79,8 +79,8 @@ class Geom_Plane;
//! the NotDone error. When Done is false on a command
//! the error description can be asked to the command.
//!
//! In theory the comands can be called with any
//! arguments, argument checking is performed by the
//! In theory the commands can be called with any
//! arguments, argument checking is performed by the
//! command.
class BRepBuilderAPI
{

View File

@@ -28,7 +28,7 @@ class TopoDS_Shape;
//! Conversion of the complete geometry of a shape
//! (all 3D analytical representation of surfaces and curves)
//! into NURBS geometry (execpt for Planes). For example,
//! into NURBS geometry (except for Planes). For example,
//! all curves supporting edges of the basis shape are converted
//! into BSpline curves, and all surfaces supporting its faces are
//! converted into BSpline surfaces.

View File

@@ -2332,7 +2332,7 @@ void BRepBuilderAPI_Sewing::Dump() const
std::cout << " Number of Vertices : " << myNbVertices << std::endl;
std::cout << " Number of Nodes : " << mapVertices.Extent() << std::endl;
std::cout << " Number of Free Edges : " << myFreeEdges.Extent() << std::endl;
std::cout << " Number of Contigous Edges : " << myContigousEdges.Extent() << std::endl;
std::cout << " Number of Contiguous Edges : " << myContigousEdges.Extent() << std::endl;
std::cout << " Number of Multiple Edges : " << myMultipleEdges.Extent() << std::endl;
std::cout << " Number of Degenerated Edges : " << myDegenerated.Extent() << std::endl;
std::cout << " ===========================================================" << std::endl;
@@ -4733,7 +4733,7 @@ void BRepBuilderAPI_Sewing::CreateOutputInformations()
}
}
// Fill maps of Free, Contigous and Multiple edges
// Fill maps of Free, Contiguous and Multiple edges
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIter(edgeSections);
for (; anIter.More(); anIter.Next())
{

View File

@@ -69,7 +69,7 @@ DEFINE_STANDARD_HANDLE(BRepBuilderAPI_Sewing, Standard_Transient)
//! - set the cutting option as you need (default True)
//! - define a tolerance
//! - add shapes to be sewed -> Add
//! - compute -> Perfom
//! - compute -> Perform
//! - output the resulted shapes
//! - output free edges if necessary
//! - output multiple edges if necessary
@@ -97,7 +97,7 @@ public:
const Standard_Boolean option3 = Standard_True,
const Standard_Boolean option4 = Standard_False);
//! Loades the context shape.
//! Loads the context shape.
Standard_EXPORT void Load(const TopoDS_Shape& shape);
//! Defines the shapes to be sewed or controlled
@@ -146,7 +146,7 @@ public:
//! Gives the original edge (free boundary) which becomes the
//! the section. Remember that sections constitute common edges.
//! This imformation is important for control because with
//! This information is important for control because with
//! original edge we can find the surface to which the section
//! is attached.
Standard_EXPORT const TopoDS_Edge& SectionToBoundary(const TopoDS_Edge& section) const;

View File

@@ -164,10 +164,8 @@ public:
}
};
// =======================================================================
// function : sign
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real sign(const BVH_Vec3d& theVertex0,
const BVH_Vec3d& theVertex1,
const BVH_Vec3d& theVertex2,
@@ -178,10 +176,8 @@ Standard_Real sign(const BVH_Vec3d& theVertex0,
- (theVertex1[theX] - theVertex2[theX]) * (theVertex0[theY] - theVertex2[theY]);
}
// =======================================================================
// function : pointInTriangle
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean pointInTriangle(const BVH_Vec3d& theTestPnt,
const BVH_Vec3d& theTrgVtx0,
const BVH_Vec3d& theTrgVtx1,

View File

@@ -99,10 +99,8 @@ Standard_Boolean rayInsideAngle(const BVH_Vec3d& theDirec,
&& ccw(ZERO_VEC, theDirec, theEdge1, theX, theY) == aCCW;
}
// =======================================================================
// function : getProjectionAxes
// purpose :
// =======================================================================
//=================================================================================================
void getProjectionAxes(const BVH_Vec3d& theNorm,
Standard_Integer& theAxisX,
Standard_Integer& theAxisY)

View File

@@ -27,7 +27,7 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepFill_DraftLaw, BRepFill_Edge3DLaw)
//=======================================================================
// function : ToG0
// purpose : Cacul une tranformation T tq T.M2 = M1
// purpose : Calculate a transformation T tq T.M2 = M1
//=======================================================================
static void ToG0(const gp_Mat& M1, const gp_Mat& M2, gp_Mat& T)
{

View File

@@ -119,6 +119,12 @@ static TopoDS_Wire WireFromList(TopTools_ListOfShape& Edges)
break;
}
}
if (!itl.More())
{
Message::SendWarning() << "Warning: WireFromList: can't find the next edge. The wire is not "
"complete, some edges are lost.";
break;
}
BB.Add(aWire, anEdge);
Edges.Remove(itl);
}
@@ -557,6 +563,13 @@ void BRepFill_Filling::Build()
myTolAng,
myTolCurv,
myAnisotropie));
if (myBoundary.IsEmpty())
{
myIsDone = Standard_False;
return;
}
TopoDS_Edge CurEdge;
TopoDS_Face CurFace;
Standard_Integer i, j;

View File

@@ -189,10 +189,8 @@ static void UpdateSectionEdge(TopoDS_Edge& theEdge,
TopoDS_Vertex& theVertex,
const Standard_Real theParam);
// ===========================================================================================
// function: Constructor
// purpose:
// ===========================================================================================
//=================================================================================================
BRepFill_TrimShellCorner::BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces,
const BRepFill_TransitionStyle theTransition,
const gp_Ax2& theAxeOfBisPlane,
@@ -210,10 +208,8 @@ BRepFill_TrimShellCorner::BRepFill_TrimShellCorner(const Handle(TopTools_HArray2
myFaces->ChangeArray2() = theFaces->Array2();
}
// ===========================================================================================
// function: AddBounds
// purpose:
// ===========================================================================================
//=================================================================================================
void BRepFill_TrimShellCorner::AddBounds(const Handle(TopTools_HArray2OfShape)& theBounds)
{
myBounds = new TopTools_HArray2OfShape(theBounds->LowerRow(),
@@ -223,10 +219,8 @@ void BRepFill_TrimShellCorner::AddBounds(const Handle(TopTools_HArray2OfShape)&
myBounds->ChangeArray2() = theBounds->Array2();
}
// ===========================================================================================
// function: AddUEdges
// purpose:
// ===========================================================================================
//=================================================================================================
void BRepFill_TrimShellCorner::AddUEdges(const Handle(TopTools_HArray2OfShape)& theUEdges)
{
myUEdges = new TopTools_HArray2OfShape(theUEdges->LowerRow(),
@@ -236,10 +230,8 @@ void BRepFill_TrimShellCorner::AddUEdges(const Handle(TopTools_HArray2OfShape)&
myUEdges->ChangeArray2() = theUEdges->Array2();
}
// ===========================================================================================
// function: AddVEdges
// purpose:
// ===========================================================================================
//=================================================================================================
void BRepFill_TrimShellCorner::AddVEdges(const Handle(TopTools_HArray2OfShape)& theVEdges,
const Standard_Integer theIndex)
{
@@ -249,10 +241,8 @@ void BRepFill_TrimShellCorner::AddVEdges(const Handle(TopTools_HArray2OfShape)&
myVEdges->SetValue(i, theVEdges->Value(i, theIndex));
}
// ===========================================================================================
// function: Perform
// purpose:
// ===========================================================================================
//=================================================================================================
void BRepFill_TrimShellCorner::Perform()
{
Standard_Integer anIndex1, anIndex2, nF1, nF2, i, j, aNbP, aNbC;
@@ -395,28 +385,22 @@ void BRepFill_TrimShellCorner::Perform()
myDone = Standard_True;
}
// ===========================================================================================
// function: IsDone
// purpose:
// ===========================================================================================
//=================================================================================================
Standard_Boolean BRepFill_TrimShellCorner::IsDone() const
{
return myDone;
}
// ===========================================================================================
// function: HasSection
// purpose:
// ===========================================================================================
//=================================================================================================
Standard_Boolean BRepFill_TrimShellCorner::HasSection() const
{
return myHasSection;
}
// ===========================================================================================
// function: Modified
// purpose:
// ===========================================================================================
//=================================================================================================
void BRepFill_TrimShellCorner::Modified(const TopoDS_Shape& theShape,
TopTools_ListOfShape& theModified)
{

View File

@@ -154,7 +154,7 @@ Standard_Boolean BRepGProp_UFunction::CenterMassValue(const Standard_Real X, Sta
//=======================================================================
// function : InertiaValue
// purpose : Compute the value of intertia.
// purpose : Compute the value of inertia.
//=======================================================================
Standard_Boolean BRepGProp_UFunction::InertiaValue(const Standard_Real X, Standard_Real& F)

View File

@@ -83,7 +83,7 @@ private:
//! Private method. Returns the value for volume computation.
//! Other returned values are:
//! - thePMP0 - PSurf(X,Y) minus Location.
//! - theS and theD1 coeffitients that are computed and used
//! - theS and theD1 coefficients that are computed and used
//! for computation of center of mass and inertia values
//! by plane.
Standard_EXPORT Standard_Real VolumeValue(const Standard_Real X,
@@ -98,7 +98,7 @@ private:
//! computation of a value.
Standard_EXPORT Standard_Boolean CenterMassValue(const Standard_Real X, Standard_Real& F);
//! Private method. Computes the value of intertia. The type of
//! Private method. Computes the value of inertia. The type of
//! a value returned is defined by the value type. If it is
//! other then GProp_InertiaXX, GProp_InertiaYY,
//! GProp_InertiaZZ, GProp_InertiaXY, GProp_InertiaXZ or

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