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

Compare commits

...

42 Commits

Author SHA1 Message Date
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
473 changed files with 9661 additions and 11196 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,86 @@
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 `
..
- 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 \
..
- 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
@@ -498,7 +616,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 +625,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
@@ -596,8 +714,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 +744,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 +752,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
@@ -732,7 +857,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 +866,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
@@ -830,8 +955,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 +992,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 +1086,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
@@ -1051,8 +1183,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 +1277,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
@@ -1241,8 +1373,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 +1466,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
@@ -1427,8 +1559,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 +1652,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
@@ -1597,7 +1729,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:
@@ -1661,13 +1793,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

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

3
.gitignore vendored
View File

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

View File

@@ -93,6 +93,10 @@ 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)
endif()
@@ -975,6 +979,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")

View File

@@ -48,7 +48,7 @@ Consult the file [dox/build/build_occt/building_occt.md](dox/build/build_occt/bu
## Version
The current version of OCCT can be found in the file [`src/Standard/Standard_Version.hxx`](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

@@ -75,6 +75,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 +96,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()
@@ -458,6 +481,18 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
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()
@@ -550,42 +585,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)

View File

@@ -3,37 +3,40 @@
# 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")
set (3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
endif()
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
else()

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

@@ -0,0 +1,22 @@
#======================================================================
#
# 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 0 )
set (OCC_VERSION_DEVELOPMENT "beta2" )

View File

@@ -26,7 +26,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")

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

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

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

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

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

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

@@ -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,
@@ -912,10 +880,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 +1101,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 +1132,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 +1195,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 +1208,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 +1219,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 +1232,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 +1256,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 +1404,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 +1415,8 @@ void AIS_ViewController::AbortViewAnimation()
}
}
// =======================================================================
// function : handlePanning
// purpose :
// =======================================================================
//=================================================================================================
void AIS_ViewController::handlePanning(const Handle(V3d_View)& theView)
{
if (!myGL.Panning.ToPan || !myToAllowPanning)
@@ -1513,10 +1457,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 +1478,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 +1583,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 +1601,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 +1751,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 +1825,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 +1855,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 +1877,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 +1921,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 +1957,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 +2047,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 +2178,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 +2200,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 +2392,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 +2408,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 +2449,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 +2584,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 +2638,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 +2655,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 +2763,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 +2818,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 +2848,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 +2974,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 +3040,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 +3050,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 +3159,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 +3189,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 +3237,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 +3397,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

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

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

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

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

@@ -30,10 +30,8 @@
#include <random>
// =======================================================================
// function : BRepLib_PointCloudShape
// purpose :
// =======================================================================
//=================================================================================================
BRepLib_PointCloudShape::BRepLib_PointCloudShape(const TopoDS_Shape& theShape,
const Standard_Real theTol)
: myShape(theShape),
@@ -44,19 +42,15 @@ BRepLib_PointCloudShape::BRepLib_PointCloudShape(const TopoDS_Shape& theShape,
//
}
// =======================================================================
// function : ~BRepLib_PointCloudShape
// purpose :
// =======================================================================
//=================================================================================================
BRepLib_PointCloudShape::~BRepLib_PointCloudShape()
{
//
}
// =======================================================================
// function : NbPointsByDensity
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer BRepLib_PointCloudShape::NbPointsByDensity(const Standard_Real theDensity)
{
clear();
@@ -78,10 +72,8 @@ Standard_Integer BRepLib_PointCloudShape::NbPointsByDensity(const Standard_Real
return aNbPoints;
}
// =======================================================================
// function : GeneratePointsByDensity
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByDensity(const Standard_Real theDensity)
{
if (myFacePoints.IsEmpty())
@@ -103,10 +95,8 @@ Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByDensity(const Standard
return (aNbAdded > 0);
}
// =======================================================================
// function : GeneratePointsByTriangulation
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByTriangulation()
{
clear();
@@ -122,10 +112,8 @@ Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByTriangulation()
return (aNbAdded > 0);
}
// =======================================================================
// function : faceArea
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real BRepLib_PointCloudShape::faceArea(const TopoDS_Shape& theShape)
{
Standard_Real anArea = 0.0;
@@ -141,10 +129,8 @@ Standard_Real BRepLib_PointCloudShape::faceArea(const TopoDS_Shape& theShape)
return anArea;
}
// =======================================================================
// function : computeDensity
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real BRepLib_PointCloudShape::computeDensity()
{
// at first step find the face with smallest area
@@ -165,10 +151,8 @@ Standard_Real BRepLib_PointCloudShape::computeDensity()
return anAreaMin * 0.1;
}
// =======================================================================
// function : NbPointsByTriangulation
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer BRepLib_PointCloudShape::NbPointsByTriangulation() const
{
// at first step find the face with smallest area
@@ -188,10 +172,8 @@ Standard_Integer BRepLib_PointCloudShape::NbPointsByTriangulation() const
return aNbPoints;
}
// =======================================================================
// function : addDensityPoints
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean BRepLib_PointCloudShape::addDensityPoints(const TopoDS_Shape& theFace)
{
// addition of the points with specified density on the face by random way
@@ -261,10 +243,8 @@ Standard_Boolean BRepLib_PointCloudShape::addDensityPoints(const TopoDS_Shape& t
return Standard_True;
}
// =======================================================================
// function : addTriangulationPoints
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean BRepLib_PointCloudShape::addTriangulationPoints(const TopoDS_Shape& theFace)
{
TopLoc_Location aLoc;
@@ -297,10 +277,8 @@ Standard_Boolean BRepLib_PointCloudShape::addTriangulationPoints(const TopoDS_Sh
return Standard_True;
}
// =======================================================================
// function : clear
// purpose :
// =======================================================================
//=================================================================================================
void BRepLib_PointCloudShape::clear()
{
myFaceArea.Clear();

View File

@@ -22,10 +22,8 @@
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
// =======================================================================
// function : ComputeNormals
// purpose :
// =======================================================================
//=================================================================================================
void BRepLib_ToolTriangulatedShape::ComputeNormals(const TopoDS_Face& theFace,
const Handle(Poly_Triangulation)& theTris,
Poly_Connect& thePolyConnect)

View File

@@ -2501,10 +2501,8 @@ Standard_Real BRepMesh_Delaun::polyArea(const IMeshData::SequenceOfInteger& theP
}
#ifdef OCCT_DEBUG
//=======================================================================
// function : BRepMesh_DumpPoly
// purpose :
//=======================================================================
//=================================================================================================
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <Standard_ErrorHandler.hxx>

View File

@@ -1321,10 +1321,10 @@ public:
//! result of the poles are divided by the
//! result of the interpolation of the
//! weights. Otherwise if HomogenousFlag == 1
//! the Poles and Weigths are treated homogeneously
//! the Poles and Weights are treated homogeneously
//! that is that those are interpolated as they
//! are and result is returned without division
//! by the interpolated weigths.
//! by the interpolated weights.
Standard_EXPORT static Standard_Integer SolveBandedSystem(const math_Matrix& Matrix,
const Standard_Integer UpperBandWidth,
const Standard_Integer LowerBandWidth,
@@ -1348,10 +1348,10 @@ public:
//! result of the poles are divided by the
//! result of the interpolation of the
//! weights. Otherwise if HomogenousFlag == 1
//! the Poles and Weigths are treated homogeneously
//! the Poles and Weights are treated homogeneously
//! that is that those are interpolated as they
//! are and result is returned without division
//! by the interpolated weigths.
//! by the interpolated weights.
Standard_EXPORT static Standard_Integer SolveBandedSystem(const math_Matrix& Matrix,
const Standard_Integer UpperBandWidth,
const Standard_Integer LowerBandWidth,

View File

@@ -618,7 +618,7 @@ BSplCLib::SolveBandedSystem(const math_Matrix& Matrix,
//function : Solves a LU factored Matrix
//purpose : if HomogeneousFlag is 1 then the input and the output
// will be homogeneous that is no division or multiplication
// by weigths will happen. On the contrary if HomogeneousFlag
// by weights will happen. On the contrary if HomogeneousFlag
// is 0 then the poles will be multiplied first by the weights
// and after interpolation they will be divided by the weights
//=======================================================================

View File

@@ -427,11 +427,11 @@ struct SurfaceCalculator<T, 2>
{
static T Area(const typename BVH_Box<T, 2>::BVH_VecNt& theSize)
{
const T anArea = theSize.x() * theSize.y();
const T anArea = std::abs(theSize.x() * theSize.y());
if (anArea < std::numeric_limits<T>::epsilon())
{
return theSize.x() + theSize.y();
return std::abs(theSize.x()) + std::abs(theSize.y());
}
return anArea;
@@ -443,13 +443,13 @@ struct SurfaceCalculator<T, 3>
{
static T Area(const typename BVH_Box<T, 3>::BVH_VecNt& theSize)
{
const T anArea =
(theSize.x() * theSize.y() + theSize.x() * theSize.z() + theSize.z() * theSize.y())
* static_cast<T>(2.0);
const T anArea = (std::abs(theSize.x() * theSize.y()) + std::abs(theSize.x() * theSize.z())
+ std::abs(theSize.z() * theSize.y()))
* static_cast<T>(2.0);
if (anArea < std::numeric_limits<T>::epsilon())
{
return theSize.x() + theSize.y() + theSize.z();
return std::abs(theSize.x()) + std::abs(theSize.y()) + std::abs(theSize.z());
}
return anArea;
@@ -461,13 +461,13 @@ struct SurfaceCalculator<T, 4>
{
static T Area(const typename BVH_Box<T, 4>::BVH_VecNt& theSize)
{
const T anArea =
(theSize.x() * theSize.y() + theSize.x() * theSize.z() + theSize.z() * theSize.y())
* static_cast<T>(2.0);
const T anArea = (std::abs(theSize.x() * theSize.y()) + std::abs(theSize.x() * theSize.z())
+ std::abs(theSize.z() * theSize.y()))
* static_cast<T>(2.0);
if (anArea < std::numeric_limits<T>::epsilon())
{
return theSize.x() + theSize.y() + theSize.z();
return std::abs(theSize.x()) + std::abs(theSize.y()) + std::abs(theSize.z());
}
return anArea;

View File

@@ -17,10 +17,8 @@
IMPLEMENT_STANDARD_RTTIEXT(BVH_Properties, Standard_Transient)
// =======================================================================
// function : ~BVH_Properties
// purpose :
// =======================================================================
//=================================================================================================
BVH_Properties::~BVH_Properties()
{
//

View File

@@ -814,10 +814,8 @@ void Bnd_OBB::ReBuild(const TColgp_Array1OfPnt& theListOfPoints,
aTool.BuildBox(*this);
}
// =======================================================================
// function : IsOut
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Bnd_OBB::IsOut(const Bnd_OBB& theOther) const
{
if (IsVoid() || theOther.IsVoid())
@@ -919,10 +917,8 @@ Standard_Boolean Bnd_OBB::IsOut(const Bnd_OBB& theOther) const
return Standard_False;
}
// =======================================================================
// function : IsOut
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Bnd_OBB::IsOut(const gp_Pnt& theP) const
{
// 1. Project the point to myAxes[i] (i=0...2).
@@ -956,10 +952,8 @@ Standard_Boolean Bnd_OBB::IsCompletelyInside(const Bnd_OBB& theOther) const
return Standard_True;
}
// =======================================================================
// function : Add
// purpose :
// =======================================================================
//=================================================================================================
void Bnd_OBB::Add(const gp_Pnt& theP)
{
if (IsVoid())
@@ -982,10 +976,8 @@ void Bnd_OBB::Add(const gp_Pnt& theP)
}
}
// =======================================================================
// function : Add
// purpose :
// =======================================================================
//=================================================================================================
void Bnd_OBB::Add(const Bnd_OBB& theOther)
{
if (!theOther.IsVoid())

View File

@@ -166,10 +166,8 @@ void Bnd_Range::Split(const Standard_Real theVal,
}
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Bnd_Range::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, Bnd_Range)

View File

@@ -79,7 +79,7 @@ public:
Standard_EXPORT Cocoa_Window(NSView* theViewNS);
#endif
//! Destroys the Window and all resourses attached to it
//! Destroys the Window and all resources attached to it
Standard_EXPORT ~Cocoa_Window();
//! Opens the window <me>

View File

@@ -25,10 +25,8 @@
IMPLEMENT_STANDARD_RTTIEXT(D3DHost_FrameBuffer, OpenGl_FrameBuffer)
// =======================================================================
// function : D3DHost_FrameBuffer
// purpose :
// =======================================================================
//=================================================================================================
D3DHost_FrameBuffer::D3DHost_FrameBuffer()
: myD3dSurf(NULL),
myD3dSurfShare(NULL),
@@ -41,19 +39,15 @@ D3DHost_FrameBuffer::D3DHost_FrameBuffer()
//
}
// =======================================================================
// function : ~D3DHost_FrameBuffer
// purpose :
// =======================================================================
//=================================================================================================
D3DHost_FrameBuffer::~D3DHost_FrameBuffer()
{
Release(NULL);
}
// =======================================================================
// function : Release
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_FrameBuffer::Release(OpenGl_Context* theCtx)
{
if (myGlD3dDevice != NULL)
@@ -86,10 +80,8 @@ void D3DHost_FrameBuffer::Release(OpenGl_Context* theCtx)
OpenGl_FrameBuffer::Release(theCtx);
}
// =======================================================================
// function : Init
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean D3DHost_FrameBuffer::Init(const Handle(OpenGl_Context)& theCtx,
IDirect3DDevice9* theD3DDevice,
const Standard_Boolean theIsD3dEx,
@@ -103,10 +95,8 @@ Standard_Boolean D3DHost_FrameBuffer::Init(const Handle(OpenGl_Context)& theCtx,
return InitD3dFallback(theCtx, theD3DDevice, theIsD3dEx, theSizeX, theSizeY, GL_DEPTH24_STENCIL8);
}
// =======================================================================
// function : InitD3dFallback
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean D3DHost_FrameBuffer::InitD3dFallback(const Handle(OpenGl_Context)& theCtx,
IDirect3DDevice9* theD3DDevice,
const Standard_Boolean theIsD3dEx,
@@ -146,10 +136,8 @@ Standard_Boolean D3DHost_FrameBuffer::InitD3dFallback(const Handle(OpenGl_Contex
return isGlInit;
}
// =======================================================================
// function : InitD3dInterop
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean D3DHost_FrameBuffer::InitD3dInterop(const Handle(OpenGl_Context)& theCtx,
IDirect3DDevice9* theD3DDevice,
const Standard_Boolean theIsD3dEx,
@@ -248,10 +236,8 @@ Standard_Boolean D3DHost_FrameBuffer::InitD3dInterop(const Handle(OpenGl_Context
return Standard_True;
}
// =======================================================================
// function : registerD3dBuffer
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean D3DHost_FrameBuffer::registerD3dBuffer(const Handle(OpenGl_Context)& theCtx)
{
const OpenGl_GlFunctions* aFuncs = theCtx->Functions();
@@ -302,10 +288,8 @@ Standard_Boolean D3DHost_FrameBuffer::registerD3dBuffer(const Handle(OpenGl_Cont
return Standard_True;
}
// =======================================================================
// function : BindBuffer
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_FrameBuffer::BindBuffer(const Handle(OpenGl_Context)& theCtx)
{
Standard_ProgramError_Raise_if(
@@ -376,10 +360,8 @@ void D3DHost_FrameBuffer::BindBuffer(const Handle(OpenGl_Context)& theCtx)
}
}
// =======================================================================
// function : LockSurface
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_FrameBuffer::LockSurface(const Handle(OpenGl_Context)& theCtx)
{
if (++myLockCount > 1)
@@ -402,10 +384,8 @@ void D3DHost_FrameBuffer::LockSurface(const Handle(OpenGl_Context)& theCtx)
}
}
// =======================================================================
// function : UnlockSurface
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_FrameBuffer::UnlockSurface(const Handle(OpenGl_Context)& theCtx)
{
if (--myLockCount != 0)

View File

@@ -24,29 +24,23 @@ IMPLEMENT_STANDARD_RTTIEXT(D3DHost_GraphicDriver, OpenGl_GraphicDriver)
#pragma comment(lib, "D3D9.lib")
#endif
// =======================================================================
// function : D3DHost_GraphicDriver
// purpose :
// =======================================================================
//=================================================================================================
D3DHost_GraphicDriver::D3DHost_GraphicDriver()
: OpenGl_GraphicDriver(Handle(Aspect_DisplayConnection)(), Standard_True)
{
//
}
// =======================================================================
// function : ~D3DHost_GraphicDriver
// purpose :
// =======================================================================
//=================================================================================================
D3DHost_GraphicDriver::~D3DHost_GraphicDriver()
{
//
}
// =======================================================================
// function : CreateView
// purpose :
// =======================================================================
//=================================================================================================
Handle(Graphic3d_CView) D3DHost_GraphicDriver::CreateView(
const Handle(Graphic3d_StructureManager)& theMgr)
{

View File

@@ -17,19 +17,15 @@
IMPLEMENT_STANDARD_RTTIEXT(D3DHost_GraphicDriverFactory, OpenGl_GraphicDriverFactory)
// =======================================================================
// function : D3DHost_GraphicDriverFactory
// purpose :
// =======================================================================
//=================================================================================================
D3DHost_GraphicDriverFactory::D3DHost_GraphicDriverFactory()
{
myName = "TKD3DHost";
}
// =======================================================================
// function : CreateDriver
// purpose :
// =======================================================================
//=================================================================================================
Handle(Graphic3d_GraphicDriver) D3DHost_GraphicDriverFactory::CreateDriver(
const Handle(Aspect_DisplayConnection)&)
{

View File

@@ -35,10 +35,8 @@ enum D3DHost_VendorId
};
} // namespace
// =======================================================================
// function : d3dFormatError
// purpose :
// =======================================================================
//=================================================================================================
TCollection_AsciiString D3DHost_View::d3dFormatError(const long theErrCode)
{
switch (theErrCode)
@@ -60,10 +58,8 @@ TCollection_AsciiString D3DHost_View::d3dFormatError(const long theErrCode)
}
}
// =======================================================================
// function : D3DHost_View
// purpose :
// =======================================================================
//=================================================================================================
D3DHost_View::D3DHost_View(const Handle(Graphic3d_StructureManager)& theMgr,
const Handle(D3DHost_GraphicDriver)& theDriver,
const Handle(OpenGl_Caps)& theCaps,
@@ -89,10 +85,8 @@ D3DHost_View::D3DHost_View(const Handle(Graphic3d_StructureManager)& theMgr,
myD3dParams->PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
}
// =======================================================================
// function : ~D3DHost_View
// purpose :
// =======================================================================
//=================================================================================================
D3DHost_View::~D3DHost_View()
{
ReleaseGlResources(NULL);
@@ -108,10 +102,8 @@ D3DHost_View::~D3DHost_View()
}
}
// =======================================================================
// function : ReleaseGlResources
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_View::ReleaseGlResources(const Handle(OpenGl_Context)& theCtx)
{
if (!myD3dWglFbo.IsNull())
@@ -122,19 +114,15 @@ void D3DHost_View::ReleaseGlResources(const Handle(OpenGl_Context)& theCtx)
OpenGl_View::ReleaseGlResources(theCtx);
}
// =======================================================================
// function : D3dColorSurface
// purpose :
// =======================================================================
//=================================================================================================
IDirect3DSurface9* D3DHost_View::D3dColorSurface() const
{
return myD3dWglFbo->D3dColorSurface();
}
// =======================================================================
// function : SetWindow
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_View::SetWindow(const Handle(Graphic3d_CView)& theParentVIew,
const Handle(Aspect_Window)& theWindow,
const Aspect_RenderingContext theContext)
@@ -159,10 +147,8 @@ void D3DHost_View::SetWindow(const Handle(Graphic3d_CView)& theParentVIew,
}
}
// =======================================================================
// function : DiagnosticInformation
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_View::DiagnosticInformation(TColStd_IndexedDataMapOfStringString& theDict,
Graphic3d_DiagnosticInfo theFlags) const
{
@@ -210,10 +196,8 @@ void D3DHost_View::DiagnosticInformation(TColStd_IndexedDataMapOfStringString& t
: "WGL_NV_DX_interop");
}
// =======================================================================
// function : d3dInitLib
// purpose :
// =======================================================================
//=================================================================================================
bool D3DHost_View::d3dInitLib()
{
if (myD3dLib == NULL)
@@ -242,10 +226,8 @@ bool D3DHost_View::d3dInitLib()
return myD3dLib != NULL;
}
// =======================================================================
// function : d3dInit
// purpose :
// =======================================================================
//=================================================================================================
bool D3DHost_View::d3dInit()
{
if (!d3dInitLib())
@@ -289,10 +271,8 @@ bool D3DHost_View::d3dInit()
return myD3dDevice != NULL;
}
// =======================================================================
// function : d3dReset
// purpose :
// =======================================================================
//=================================================================================================
bool D3DHost_View::d3dReset()
{
if (myD3dDevice == NULL)
@@ -310,10 +290,8 @@ bool D3DHost_View::d3dReset()
return isOK == D3D_OK;
}
// =======================================================================
// function : d3dCreateRenderTarget
// purpose :
// =======================================================================
//=================================================================================================
bool D3DHost_View::d3dCreateRenderTarget()
{
bool toD3dFallback = false;
@@ -355,10 +333,8 @@ bool D3DHost_View::d3dCreateRenderTarget()
return true;
}
// =======================================================================
// function : d3dBeginRender
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_View::d3dBeginRender()
{
if (myD3dDevice == NULL)
@@ -371,10 +347,8 @@ void D3DHost_View::d3dBeginRender()
myD3dDevice->BeginScene();
}
// =======================================================================
// function : d3dEndRender
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_View::d3dEndRender()
{
if (myD3dDevice != NULL)
@@ -383,10 +357,8 @@ void D3DHost_View::d3dEndRender()
}
}
// =======================================================================
// function : d3dSwap
// purpose :
// =======================================================================
//=================================================================================================
bool D3DHost_View::d3dSwap()
{
if (myD3dDevice == NULL)
@@ -407,10 +379,8 @@ bool D3DHost_View::d3dSwap()
return isOK == D3D_OK;
}
// =======================================================================
// function : Redraw
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_View::Redraw()
{
if (!myWorkspace->Activate() || myD3dDevice == NULL)
@@ -470,10 +440,8 @@ void D3DHost_View::Redraw()
d3dSwap();
}
// =======================================================================
// function : RedrawImmediate
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_View::RedrawImmediate()
{
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
@@ -520,10 +488,8 @@ void D3DHost_View::RedrawImmediate()
d3dSwap();
}
// =======================================================================
// function : Resize
// purpose :
// =======================================================================
//=================================================================================================
void D3DHost_View::Resized()
{
const Standard_Integer aWidthOld = myWindow->Width();

View File

@@ -16,10 +16,8 @@
#include <Draw_PluginMacro.hxx>
#include <D3DHost_GraphicDriverFactory.hxx>
// ======================================================================
// function : Factory
// purpose :
// ======================================================================
//=================================================================================================
void D3DHostTest::Factory(Draw_Interpretor&)
{
static const Handle(D3DHost_GraphicDriverFactory) aFactory = new D3DHost_GraphicDriverFactory();

View File

@@ -52,7 +52,7 @@ struct DE_ShapeFixParameters
FixMode FixIntersectingWiresMode = FixMode::FixOrNot;
FixMode FixLoopWiresMode = FixMode::FixOrNot;
FixMode FixSplitFaceMode = FixMode::FixOrNot;
FixMode AutoCorrectPrecisionMode = FixMode::FixOrNot;
FixMode AutoCorrectPrecisionMode = FixMode::Fix;
FixMode ModifyTopologyMode = FixMode::NotFix;
FixMode ModifyGeometryMode = FixMode::Fix;
FixMode ClosedWireMode = FixMode::Fix;

View File

@@ -142,6 +142,8 @@ bool DESTEP_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theRe
theResource->BooleanVal("read.props", InternalParameters.ReadProps, aScope);
InternalParameters.ReadMetadata =
theResource->BooleanVal("read.metadata", InternalParameters.ReadMetadata, aScope);
InternalParameters.ReadProductMetadata =
theResource->BooleanVal("read.productmetadata", InternalParameters.ReadProductMetadata, aScope);
InternalParameters.WritePrecisionMode =
(DESTEP_Parameters::WriteMode_PrecisionMode)theResource->IntegerVal(
@@ -180,6 +182,8 @@ bool DESTEP_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theRe
aScope);
InternalParameters.WriteColor =
theResource->BooleanVal("write.color", InternalParameters.WriteColor, aScope);
InternalParameters.WriteNonmanifold =
theResource->BooleanVal("write.nonmanifold", InternalParameters.WriteNonmanifold, aScope);
InternalParameters.WriteName =
theResource->BooleanVal("write.name", InternalParameters.WriteName, aScope);
InternalParameters.WriteLayer =
@@ -435,6 +439,13 @@ TCollection_AsciiString DESTEP_ConfigurationNode::Save() const
aResult += aScope + "read.metadata :\t " + InternalParameters.ReadMetadata + "\n";
aResult += "!\n";
aResult += "!\n";
aResult += "!Setting up the read.productmetadata parameter which is used to indicate whether to "
"read Product Metadata or not\n";
aResult += "!Default value: 0(\"OFF\"). Available values: 0(\"OFF\"), 1(\"ON\")\n";
aResult += aScope + "read.productmetadata :\t " + InternalParameters.ReadProductMetadata + "\n";
aResult += "!\n";
aResult += "!\n";
aResult += "!Write Parameters:\n";
aResult += "!\n";
@@ -517,6 +528,12 @@ TCollection_AsciiString DESTEP_ConfigurationNode::Save() const
aResult += aScope + "write.color :\t " + InternalParameters.WriteColor + "\n";
aResult += "!\n";
aResult += "!\n";
aResult += "!Non-manifold topology writing\n";
aResult += "!Default value: 0(\"OFF\"). Available values: 0(\"OFF\"), 1(\"ON\")\n";
aResult += aScope + "write.nonmanifold :\t " + InternalParameters.WriteNonmanifold + "\n";
aResult += "!\n";
aResult += "!\n";
aResult += "!Setting up the write.name parameter which is used to indicate write Names or not\n";
aResult += "!Default value: +. Available values: \"-\", \"+\"\n";

View File

@@ -55,11 +55,6 @@ void DESTEP_Parameters::InitFromStatic()
ReadIdeas = Interface_Static::IVal("read.step.ideas") == 1;
ReadAllShapes = Interface_Static::IVal("read.step.all.shapes") == 1;
ReadRootTransformation = Interface_Static::IVal("read.step.root.transformation") == 1;
ReadColor = Interface_Static::IVal("read.color") == 1;
ReadName = Interface_Static::IVal("read.name") == 1;
ReadLayer = Interface_Static::IVal("read.layer") == 1;
ReadProps = Interface_Static::IVal("read.props") == 1;
ReadMetadata = Interface_Static::IVal("read.metadata") == 1;
WritePrecisionMode =
(DESTEP_Parameters::WriteMode_PrecisionMode)Interface_Static::IVal("write.precision.mode");

View File

@@ -181,6 +181,7 @@ public:
bool ReadLayer = true; //<! LayerMode is used to indicate read Layers or not
bool ReadProps = true; //<! PropsMode is used to indicate read Validation properties or not
bool ReadMetadata = true; //! Parameter for metadata reading
bool ReadProductMetadata = false; //! Parameter for product metadata reading
// Write
WriteMode_PrecisionMode WritePrecisionMode = WriteMode_PrecisionMode_Average; //<! Specifies the mode of writing the resolution value into the STEP file

View File

@@ -69,6 +69,7 @@ bool DESTEP_Provider::Read(const TCollection_AsciiString& thePath,
aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
aReader.SetPropsMode(aNode->InternalParameters.ReadProps);
aReader.SetMetaMode(aNode->InternalParameters.ReadMetadata);
aReader.SetProductMetaMode(aNode->InternalParameters.ReadProductMetadata);
aReader.SetShapeFixParameters(aNode->ShapeFixParameters);
IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
DESTEP_Parameters aParams = aNode->InternalParameters;

View File

@@ -125,17 +125,18 @@ private:
//! Print message to Module.printMessage callback.
EM_JS(void, occJSPrintMessage, (const char* theStr, int theGravity), {
const aStr = Number(theStr); // bigintToI53Checked(theStr);
if (Module.printMessage != undefined && Module.printMessage != null)
{
Module.printMessage(UTF8ToString(theStr), theGravity);
Module.printMessage(UTF8ToString(aStr), theGravity);
}
else if (Module.print != undefined && Module.print != null)
{
Module.print(UTF8ToString(theStr));
Module.print(UTF8ToString(aStr));
}
else
{
// console.info (UTF8ToString(theStr));
// console.info (UTF8ToString(aStr));
}
});

View File

@@ -1991,7 +1991,9 @@ static DWORD WINAPI tkLoop(const LPVOID theThreadParameter)
#endif
}
Tcl_Exit(0);
#if (!((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 6) && (TCL_RELEASE_SERIAL >= 15)))
return 0;
#endif
}
/*--------------------------------------------------------*\

View File

@@ -21,10 +21,8 @@
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_ArrowAspect.hxx>
// =======================================================================
// function : Add
// purpose :
// =======================================================================
//=================================================================================================
void DsgPrs_DatumPrs::Add(const Handle(Prs3d_Presentation)& thePresentation,
const gp_Ax2& theDatum,
const Handle(Prs3d_Drawer)& theDrawer)

View File

@@ -53,7 +53,7 @@ public:
Standard_EXPORT Standard_Integer
NbFields(const Standard_Boolean theInherited = Standard_False) const;
//! Sets abstruct flag for entity;
//! Sets abstract flag for entity;
Standard_EXPORT void SetAbstractFlag(const Standard_Boolean theIsAbstract);
//! Returns abstract flag.

View File

@@ -106,13 +106,13 @@ public:
//! Set flag for presence of method Check in the class
Standard_EXPORT void SetCheckFlag(const Standard_Boolean theCheckFlag);
//! Get flag resposible for presence of method Check in the class
//! Get flag responsible for presence of method Check in the class
Standard_EXPORT Standard_Boolean CheckFlag() const;
//! Set flag for presence of method FillShared in the class
Standard_EXPORT void SetFillSharedFlag(const Standard_Boolean theFillSharedFlag);
//! Get flag resposible for presence of method FillShared in the class
//! Get flag responsible for presence of method FillShared in the class
Standard_EXPORT Standard_Boolean FillSharedFlag() const;
//! Set start entity index

View File

@@ -109,7 +109,7 @@ Handle(Express_Item) Express_Schema::Item(const Handle(TCollection_HAsciiString)
//=======================================================================
// function : nameToCasCade
// purpose : auxilary for Prepare()
// purpose : auxiliary for Prepare()
// Convert STEP-style name (lowercase, with underscores)
// to CASCADE-style name (each word starts with uppercase, no intervals)
//=======================================================================
@@ -135,7 +135,7 @@ static void nameToCasCade(const Handle(TCollection_HAsciiString)& theName)
//=======================================================================
// function : nameToCasCade
// purpose : auxilary for Prepare()
// purpose : auxiliary for Prepare()
// Convert names for Type object
//=======================================================================
static void nameToCasCade(const Handle(Express_Type)& theType)

View File

@@ -129,10 +129,8 @@ Extrema_GenExtCS::Extrema_GenExtCS()
{
}
// =======================================================================
// function : ~Extrema_GenExtCS
// purpose :
// =======================================================================
//=================================================================================================
Extrema_GenExtCS::~Extrema_GenExtCS()
{
//

View File

@@ -215,19 +215,15 @@ Extrema_GenExtPS::Extrema_GenExtPS()
myAlgo = Extrema_ExtAlgo_Grad;
}
// =======================================================================
// function : ~Extrema_GenExtPS
// purpose :
// =======================================================================
//=================================================================================================
Extrema_GenExtPS::~Extrema_GenExtPS()
{
//
}
// =======================================================================
// function : Extrema_GenExtPS
// purpose :
// =======================================================================
//=================================================================================================
Extrema_GenExtPS::Extrema_GenExtPS(const gp_Pnt& P,
const Adaptor3d_Surface& S,
const Standard_Integer NbU,

View File

@@ -111,10 +111,8 @@ Extrema_GenExtSS::Extrema_GenExtSS()
myInit = Standard_False;
}
// =======================================================================
// function : ~Extrema_GenExtSS
// purpose :
// =======================================================================
//=================================================================================================
Extrema_GenExtSS::~Extrema_GenExtSS()
{
//

View File

@@ -30,10 +30,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Font_FTFont, Standard_Transient)
// =======================================================================
// function : Font_FTFont
// purpose :
// =======================================================================
//=================================================================================================
Font_FTFont::Font_FTFont(const Handle(Font_FTLibrary)& theFTLib)
: myFTLib(theFTLib),
myFTFace(NULL),
@@ -54,19 +52,15 @@ Font_FTFont::Font_FTFont(const Handle(Font_FTLibrary)& theFTLib)
}
}
// =======================================================================
// function : Font_FTFont
// purpose :
// =======================================================================
//=================================================================================================
Font_FTFont::~Font_FTFont()
{
Release();
}
// =======================================================================
// function : Release
// purpose :
// =======================================================================
//=================================================================================================
void Font_FTFont::Release()
{
myGlyphImg.Clear();
@@ -83,10 +77,8 @@ void Font_FTFont::Release()
myBuffer.Nullify();
}
// =======================================================================
// function : Init
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FTFont::Init(const Handle(NCollection_Buffer)& theData,
const TCollection_AsciiString& theFileName,
const Font_FTFontParams& theParams,
@@ -200,10 +192,8 @@ bool Font_FTFont::Init(const Handle(NCollection_Buffer)& theData,
#endif
}
// =======================================================================
// function : FindAndCreate
// purpose :
// =======================================================================
//=================================================================================================
Handle(Font_FTFont) Font_FTFont::FindAndCreate(const TCollection_AsciiString& theFontName,
const Font_FontAspect theFontAspect,
const Font_FTFontParams& theParams,
@@ -257,10 +247,8 @@ Handle(Font_FTFont) Font_FTFont::FindAndCreate(const TCollection_AsciiString& th
return Handle(Font_FTFont)();
}
// =======================================================================
// function : FindAndInit
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FTFont::FindAndInit(const TCollection_AsciiString& theFontName,
Font_FontAspect theFontAspect,
const Font_FTFontParams& theParams,
@@ -296,10 +284,8 @@ bool Font_FTFont::FindAndInit(const TCollection_AsciiString& theFontName,
return false;
}
// =======================================================================
// function : findAndInitFallback
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FTFont::findAndInitFallback(Font_UnicodeSubset theSubset)
{
if (!myFallbackFaces[theSubset].IsNull())
@@ -331,10 +317,8 @@ bool Font_FTFont::findAndInitFallback(Font_UnicodeSubset theSubset)
return myFallbackFaces[theSubset]->IsValid();
}
// =======================================================================
// function : HasSymbol
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FTFont::HasSymbol(Standard_Utf32Char theUChar) const
{
#ifdef HAVE_FREETYPE
@@ -345,10 +329,8 @@ bool Font_FTFont::HasSymbol(Standard_Utf32Char theUChar) const
#endif
}
// =======================================================================
// function : loadGlyph
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FTFont::loadGlyph(const Standard_Utf32Char theUChar)
{
if (myUChar == theUChar)
@@ -388,10 +370,8 @@ bool Font_FTFont::loadGlyph(const Standard_Utf32Char theUChar)
#endif
}
// =======================================================================
// function : RenderGlyph
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FTFont::RenderGlyph(const Standard_Utf32Char theUChar)
{
myGlyphImg.Clear();
@@ -466,10 +446,8 @@ bool Font_FTFont::RenderGlyph(const Standard_Utf32Char theUChar)
#endif
}
// =======================================================================
// function : GlyphMaxSizeX
// purpose :
// =======================================================================
//=================================================================================================
unsigned int Font_FTFont::GlyphMaxSizeX(bool theToIncludeFallback) const
{
#ifdef HAVE_FREETYPE
@@ -500,10 +478,8 @@ unsigned int Font_FTFont::GlyphMaxSizeX(bool theToIncludeFallback) const
#endif
}
// =======================================================================
// function : GlyphMaxSizeY
// purpose :
// =======================================================================
//=================================================================================================
unsigned int Font_FTFont::GlyphMaxSizeY(bool theToIncludeFallback) const
{
#ifdef HAVE_FREETYPE
@@ -534,10 +510,8 @@ unsigned int Font_FTFont::GlyphMaxSizeY(bool theToIncludeFallback) const
#endif
}
// =======================================================================
// function : Ascender
// purpose :
// =======================================================================
//=================================================================================================
float Font_FTFont::Ascender() const
{
#ifdef HAVE_FREETYPE
@@ -548,10 +522,8 @@ float Font_FTFont::Ascender() const
#endif
}
// =======================================================================
// function : Descender
// purpose :
// =======================================================================
//=================================================================================================
float Font_FTFont::Descender() const
{
#ifdef HAVE_FREETYPE
@@ -562,10 +534,8 @@ float Font_FTFont::Descender() const
#endif
}
// =======================================================================
// function : LineSpacing
// purpose :
// =======================================================================
//=================================================================================================
float Font_FTFont::LineSpacing() const
{
#ifdef HAVE_FREETYPE
@@ -576,30 +546,24 @@ float Font_FTFont::LineSpacing() const
#endif
}
// =======================================================================
// function : AdvanceX
// purpose :
// =======================================================================
//=================================================================================================
float Font_FTFont::AdvanceX(Standard_Utf32Char theUChar, Standard_Utf32Char theUCharNext)
{
loadGlyph(theUChar);
return AdvanceX(theUCharNext);
}
// =======================================================================
// function : AdvanceY
// purpose :
// =======================================================================
//=================================================================================================
float Font_FTFont::AdvanceY(Standard_Utf32Char theUChar, Standard_Utf32Char theUCharNext)
{
loadGlyph(theUChar);
return AdvanceY(theUCharNext);
}
// =======================================================================
// function : getKerning
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FTFont::getKerning(FT_Vector& theKern,
Standard_Utf32Char theUCharCurr,
Standard_Utf32Char theUCharNext) const
@@ -628,10 +592,8 @@ bool Font_FTFont::getKerning(FT_Vector& theKern,
return false;
}
// =======================================================================
// function : AdvanceX
// purpose :
// =======================================================================
//=================================================================================================
float Font_FTFont::AdvanceX(Standard_Utf32Char theUCharNext) const
{
if (myUChar == 0)
@@ -652,10 +614,8 @@ float Font_FTFont::AdvanceX(Standard_Utf32Char theUCharNext) const
#endif
}
// =======================================================================
// function : AdvanceY
// purpose :
// =======================================================================
//=================================================================================================
float Font_FTFont::AdvanceY(Standard_Utf32Char theUCharNext) const
{
if (myUChar == 0)
@@ -673,10 +633,8 @@ float Font_FTFont::AdvanceY(Standard_Utf32Char theUCharNext) const
#endif
}
// =======================================================================
// function : GlyphsNumber
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Font_FTFont::GlyphsNumber(bool theToIncludeFallback) const
{
#ifdef HAVE_FREETYPE
@@ -698,10 +656,8 @@ Standard_Integer Font_FTFont::GlyphsNumber(bool theToIncludeFallback) const
#endif
}
// =======================================================================
// function : GlyphRect
// purpose :
// =======================================================================
//=================================================================================================
void Font_FTFont::GlyphRect(Font_Rect& theRect) const
{
#ifdef HAVE_FREETYPE
@@ -715,10 +671,8 @@ void Font_FTFont::GlyphRect(Font_Rect& theRect) const
#endif
}
// =======================================================================
// function : BoundingBox
// purpose :
// =======================================================================
//=================================================================================================
Font_Rect Font_FTFont::BoundingBox(const NCollection_String& theString,
const Graphic3d_HorizontalTextAlignment theAlignX,
const Graphic3d_VerticalTextAlignment theAlignY)
@@ -735,10 +689,8 @@ Font_Rect Font_FTFont::BoundingBox(const NCollection_String& theSt
return aBndBox;
}
// =======================================================================
// function : renderGlyphOutline
// purpose :
// =======================================================================
//=================================================================================================
const FT_Outline* Font_FTFont::renderGlyphOutline(const Standard_Utf32Char theChar)
{
#ifdef HAVE_FREETYPE

View File

@@ -22,10 +22,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Font_FTLibrary, Standard_Transient)
// =======================================================================
// function : Font_FTLibrary
// purpose :
// =======================================================================
//=================================================================================================
Font_FTLibrary::Font_FTLibrary()
: myFTLib(NULL)
{
@@ -37,10 +35,8 @@ Font_FTLibrary::Font_FTLibrary()
#endif
}
// =======================================================================
// function : ~Font_FTLibrary
// purpose :
// =======================================================================
//=================================================================================================
Font_FTLibrary::~Font_FTLibrary()
{
if (IsValid())

View File

@@ -281,10 +281,8 @@ static bool checkFont(NCollection_Sequence<Handle(Font_SystemFont)>& theFonts,
#endif
}
// =======================================================================
// function : GetInstance
// purpose :
// =======================================================================
//=================================================================================================
Handle(Font_FontMgr) Font_FontMgr::GetInstance()
{
static Handle(Font_FontMgr) _mgr;
@@ -296,20 +294,16 @@ Handle(Font_FontMgr) Font_FontMgr::GetInstance()
return _mgr;
}
// =======================================================================
// function : ToUseUnicodeSubsetFallback
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean& Font_FontMgr::ToUseUnicodeSubsetFallback()
{
static Standard_Boolean TheToUseUnicodeSubsetFallback = true;
return TheToUseUnicodeSubsetFallback;
}
// =======================================================================
// function : AddFontAlias
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FontMgr::AddFontAlias(const TCollection_AsciiString& theAliasName,
const TCollection_AsciiString& theFontName)
{
@@ -335,10 +329,8 @@ bool Font_FontMgr::AddFontAlias(const TCollection_AsciiString& theAliasName,
return true;
}
// =======================================================================
// function : RemoveFontAlias
// purpose :
// =======================================================================
//=================================================================================================
bool Font_FontMgr::RemoveFontAlias(const TCollection_AsciiString& theAliasName,
const TCollection_AsciiString& theFontName)
{
@@ -381,10 +373,8 @@ bool Font_FontMgr::RemoveFontAlias(const TCollection_AsciiString& theAliasName,
return false;
}
// =======================================================================
// function : GetAllAliases
// purpose :
// =======================================================================
//=================================================================================================
void Font_FontMgr::GetAllAliases(TColStd_SequenceOfHAsciiString& theAliases) const
{
for (NCollection_DataMap<TCollection_AsciiString, Handle(Font_FontAliasSequence)>::Iterator
@@ -396,10 +386,8 @@ void Font_FontMgr::GetAllAliases(TColStd_SequenceOfHAsciiString& theAliases) con
}
}
// =======================================================================
// function : GetFontAliases
// purpose :
// =======================================================================
//=================================================================================================
void Font_FontMgr::GetFontAliases(TColStd_SequenceOfHAsciiString& theFontNames,
const TCollection_AsciiString& theAliasName) const
{
@@ -417,10 +405,8 @@ void Font_FontMgr::GetFontAliases(TColStd_SequenceOfHAsciiString& theFontNames,
}
}
// =======================================================================
// function : addFontAlias
// purpose :
// =======================================================================
//=================================================================================================
void Font_FontMgr::addFontAlias(const TCollection_AsciiString& theAliasName,
const Handle(Font_FontAliasSequence)& theAliases,
Font_FontAspect theAspect)
@@ -447,10 +433,8 @@ void Font_FontMgr::addFontAlias(const TCollection_AsciiString& theAliasNa
myFontAliases.Bind(anAliasName, anAliases);
}
// =======================================================================
// function : Font_FontMgr
// purpose :
// =======================================================================
//=================================================================================================
Font_FontMgr::Font_FontMgr()
: myToTraceAliases(Standard_False)
{
@@ -553,10 +537,8 @@ Font_FontMgr::Font_FontMgr()
InitFontDataBase();
}
// =======================================================================
// function : CheckFont
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Font_FontMgr::CheckFont(NCollection_Sequence<Handle(Font_SystemFont)>& theFonts,
const TCollection_AsciiString& theFontPath) const
{
@@ -564,10 +546,8 @@ Standard_Boolean Font_FontMgr::CheckFont(NCollection_Sequence<Handle(Font_System
return checkFont(theFonts, aFtLibrary, theFontPath, 0);
}
// =======================================================================
// function : CheckFont
// purpose :
// =======================================================================
//=================================================================================================
Handle(Font_SystemFont) Font_FontMgr::CheckFont(Standard_CString theFontPath) const
{
Handle(Font_FTLibrary) aFtLibrary = new Font_FTLibrary();
@@ -575,10 +555,8 @@ Handle(Font_SystemFont) Font_FontMgr::CheckFont(Standard_CString theFontPath) co
return checkFont(aFonts, aFtLibrary, theFontPath, 0) ? aFonts.First() : Handle(Font_SystemFont)();
}
// =======================================================================
// function : RegisterFont
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Font_FontMgr::RegisterFont(const Handle(Font_SystemFont)& theFont,
const Standard_Boolean theToOverride)
{
@@ -618,19 +596,15 @@ Standard_Boolean Font_FontMgr::RegisterFont(const Handle(Font_SystemFont)& theFo
return Standard_True;
}
// =======================================================================
// function : ClearFontDataBase()
// purpose :
// =======================================================================
//=================================================================================================
void Font_FontMgr::ClearFontDataBase()
{
myFontMap.Clear();
}
// =======================================================================
// function : InitFontDataBase
// purpose :
// =======================================================================
//=================================================================================================
void Font_FontMgr::InitFontDataBase()
{
myFontMap.Clear();
@@ -941,10 +915,8 @@ void Font_FontMgr::InitFontDataBase()
#endif
}
// =======================================================================
// function : GetAvailableFontsNames
// purpose :
// =======================================================================
//=================================================================================================
void Font_FontMgr::GetAvailableFontsNames(TColStd_SequenceOfHAsciiString& theFontsNames) const
{
theFontsNames.Clear();
@@ -955,10 +927,8 @@ void Font_FontMgr::GetAvailableFontsNames(TColStd_SequenceOfHAsciiString& theFon
}
}
// =======================================================================
// function : GetFont
// purpose :
// =======================================================================
//=================================================================================================
Handle(Font_SystemFont) Font_FontMgr::GetFont(const Handle(TCollection_HAsciiString)& theFontName,
const Font_FontAspect theFontAspect,
const Standard_Integer theFontSize) const
@@ -975,19 +945,15 @@ Handle(Font_SystemFont) Font_FontMgr::GetFont(const Handle(TCollection_HAsciiStr
: Handle(Font_SystemFont)();
}
// =======================================================================
// function : GetFont
// purpose :
// =======================================================================
//=================================================================================================
Handle(Font_SystemFont) Font_FontMgr::GetFont(const TCollection_AsciiString& theFontName) const
{
return myFontMap.Find(theFontName);
}
// =======================================================================
// function : FindFallbackFont
// purpose :
// =======================================================================
//=================================================================================================
Handle(Font_SystemFont) Font_FontMgr::FindFallbackFont(Font_UnicodeSubset theSubset,
Font_FontAspect theFontAspect) const
{
@@ -1032,10 +998,8 @@ Handle(Font_SystemFont) Font_FontMgr::FindFallbackFont(Font_UnicodeSubset theSub
return aFont;
}
// =======================================================================
// function : FindFont
// purpose :
// =======================================================================
//=================================================================================================
Handle(Font_SystemFont) Font_FontMgr::FindFont(const TCollection_AsciiString& theFontName,
Font_StrictLevel theStrictLevel,
Font_FontAspect& theFontAspect,
@@ -1145,10 +1109,8 @@ Handle(Font_SystemFont) Font_FontMgr::FindFont(const TCollection_AsciiString& th
return aFont;
}
// =======================================================================
// function : Font_FontMap::Find
// purpose :
// =======================================================================
//=================================================================================================
Handle(Font_SystemFont) Font_FontMgr::Font_FontMap::Find(
const TCollection_AsciiString& theFontName) const
{
@@ -1169,10 +1131,8 @@ Handle(Font_SystemFont) Font_FontMgr::Font_FontMap::Find(
return Handle(Font_SystemFont)();
}
// =======================================================================
// function : EmbedFallbackFont
// purpose :
// =======================================================================
//=================================================================================================
Handle(NCollection_Buffer) Font_FontMgr::EmbedFallbackFont()
{
#ifdef HAVE_FREETYPE

View File

@@ -20,10 +20,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Font_SystemFont, Standard_Transient)
// =======================================================================
// function : Font_SystemFont
// purpose :
// =======================================================================
//=================================================================================================
Font_SystemFont::Font_SystemFont(const TCollection_AsciiString& theFontName)
: myFontKey(theFontName),
myFontName(theFontName),
@@ -37,10 +35,8 @@ Font_SystemFont::Font_SystemFont(const TCollection_AsciiString& theFontName)
myFontKey.LowerCase();
}
// =======================================================================
// function : SetFontPath
// purpose :
// =======================================================================
//=================================================================================================
void Font_SystemFont::SetFontPath(Font_FontAspect theAspect,
const TCollection_AsciiString& thePath,
const Standard_Integer theFaceId)
@@ -53,19 +49,15 @@ void Font_SystemFont::SetFontPath(Font_FontAspect theAspect,
myFaceIds[theAspect] = theFaceId;
}
// =======================================================================
// function : IsEqual
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Font_SystemFont::IsEqual(const Handle(Font_SystemFont)& theOtherFont) const
{
return theOtherFont.get() == this || myFontKey.IsEqual(theOtherFont->myFontKey);
}
// =======================================================================
// function : ToString
// purpose :
// =======================================================================
//=================================================================================================
TCollection_AsciiString Font_SystemFont::ToString() const
{
TCollection_AsciiString aDesc;

View File

@@ -51,10 +51,8 @@ inline void moveY(NCollection_Vector<Vec2f>& theCorners,
} // namespace
// =======================================================================
// function : Font_TextFormatter
// purpose :
// =======================================================================
//=================================================================================================
Font_TextFormatter::Font_TextFormatter()
: myAlignX(Graphic3d_HTA_LEFT),
myAlignY(Graphic3d_VTA_TOP),
@@ -80,10 +78,8 @@ Font_TextFormatter::Font_TextFormatter()
//
}
// =======================================================================
// function : SetupAlignment
// purpose :
// =======================================================================
//=================================================================================================
void Font_TextFormatter::SetupAlignment(const Graphic3d_HorizontalTextAlignment theAlignX,
const Graphic3d_VerticalTextAlignment theAlignY)
{
@@ -91,10 +87,8 @@ void Font_TextFormatter::SetupAlignment(const Graphic3d_HorizontalTextAlignment
myAlignY = theAlignY;
}
// =======================================================================
// function : Reset
// purpose :
// =======================================================================
//=================================================================================================
void Font_TextFormatter::Reset()
{
myIsFormatted = false;
@@ -108,10 +102,8 @@ void Font_TextFormatter::Reset()
myMaxSymbolWidth = 0.0f;
}
// =======================================================================
// function : Append
// purpose :
// =======================================================================
//=================================================================================================
void Font_TextFormatter::Append(const NCollection_String& theString, Font_FTFont& theFont)
{
if (theString.IsEmpty())
@@ -164,10 +156,8 @@ void Font_TextFormatter::Append(const NCollection_String& theString, Font_FTFont
myLastSymbolWidth = myPen.x() - myCorners.Last().x();
}
// =======================================================================
// function : newLine
// purpose :
// =======================================================================
//=================================================================================================
void Font_TextFormatter::newLine(const Standard_Integer theLastRect,
const Standard_ShortReal theMaxLineWidth)
{
@@ -208,10 +198,8 @@ void Font_TextFormatter::newLine(const Standard_Integer theLastRect,
myRectLineStart = theLastRect + 1;
}
// =======================================================================
// function : Format
// purpose :
// =======================================================================
//=================================================================================================
void Font_TextFormatter::Format()
{
if (myCorners.Length() == 0 || myIsFormatted)
@@ -326,10 +314,8 @@ void Font_TextFormatter::Format()
}
}
// =======================================================================
// function : GlyphBoundingBox
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Font_TextFormatter::GlyphBoundingBox(const Standard_Integer theIndex,
Font_Rect& theBndBox) const
{
@@ -375,10 +361,8 @@ Standard_Boolean Font_TextFormatter::GlyphBoundingBox(const Standard_Integer the
return Standard_True;
}
// =======================================================================
// function : IsLFSymbol
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Font_TextFormatter::IsLFSymbol(const Standard_Integer theIndex) const
{
Font_Rect aBndBox;
@@ -390,10 +374,8 @@ Standard_Boolean Font_TextFormatter::IsLFSymbol(const Standard_Integer theIndex)
return Abs(aBndBox.Right - aBndBox.Left) < Precision::Confusion();
}
// =======================================================================
// function : FirstPosition
// purpose :
// =======================================================================
//=================================================================================================
Standard_ShortReal Font_TextFormatter::FirstPosition() const
{
switch (myAlignX)
@@ -408,10 +390,8 @@ Standard_ShortReal Font_TextFormatter::FirstPosition() const
}
}
// =======================================================================
// function : LinePositionIndex
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Font_TextFormatter::LinePositionIndex(const Standard_Integer theIndex) const
{
Standard_Integer anIndex = 0;
@@ -428,10 +408,8 @@ Standard_Integer Font_TextFormatter::LinePositionIndex(const Standard_Integer th
return anIndex;
}
// =======================================================================
// function : LineIndex
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Font_TextFormatter::LineIndex(const Standard_Integer theIndex) const
{
if (myLineSpacing < 0.0f)
@@ -442,10 +420,8 @@ Standard_Integer Font_TextFormatter::LineIndex(const Standard_Integer theIndex)
return (Standard_Integer)Abs((BottomLeft(theIndex).y() + myAscender) / myLineSpacing);
}
// =======================================================================
// function : LineWidth
// purpose :
// =======================================================================
//=================================================================================================
Standard_ShortReal Font_TextFormatter::LineWidth(const Standard_Integer theIndex) const
{
if (theIndex < 0)

View File

@@ -567,7 +567,7 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu
//=======================================================================
// function : Pretreatment
// purpose : Put the two first and two last weigths at one if they are
// purpose : Put the two first and two last weights at one if they are
// equal
//=======================================================================
@@ -594,7 +594,7 @@ static void Pretreatment(TColGeom2d_Array1OfBSplineCurve& tab)
//=======================================================================
// function : NeedToBeTreated
// purpose : Say if the BSpline is rational and if the two first and two
// last weigths are different
// last weights are different
//=======================================================================
static Standard_Boolean NeedToBeTreated(const Handle(Geom2d_BSplineCurve)& BS)

View File

@@ -580,7 +580,7 @@ static Handle(Geom_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCurv
//=======================================================================
// function : Pretreatment
// purpose : Put the two first and two last weigths at one if they are
// purpose : Put the two first and two last weights at one if they are
// equal
//=======================================================================
@@ -607,7 +607,7 @@ static void Pretreatment(TColGeom_Array1OfBSplineCurve& tab)
//=======================================================================
// function : NeedToBeTreated
// purpose : Say if the BSpline is rational and if the two first and two
// last weigths are different
// last weights are different
//=======================================================================
static Standard_Boolean NeedToBeTreated(const Handle(Geom_BSplineCurve)& BS)

View File

@@ -43,10 +43,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfPrimit
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolygons, Graphic3d_ArrayOfPrimitives)
// =======================================================================
// function : CreateArray
// purpose :
// =======================================================================
//=================================================================================================
Handle(Graphic3d_ArrayOfPrimitives) Graphic3d_ArrayOfPrimitives::CreateArray(
Graphic3d_TypeOfPrimitiveArray theType,
Standard_Integer theMaxVertexs,
@@ -92,10 +90,8 @@ Handle(Graphic3d_ArrayOfPrimitives) Graphic3d_ArrayOfPrimitives::CreateArray(
return Handle(Graphic3d_ArrayOfPrimitives)();
}
// =======================================================================
// function : init
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ArrayOfPrimitives::init(Graphic3d_TypeOfPrimitiveArray theType,
Standard_Integer theMaxVertexs,
Standard_Integer theMaxBounds,
@@ -217,10 +213,8 @@ void Graphic3d_ArrayOfPrimitives::init(Graphic3d_TypeOfPrimitiveArray theType,
}
}
// =======================================================================
// function : ~Graphic3d_ArrayOfPrimitives
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives()
{
myIndices.Nullify();
@@ -228,10 +222,8 @@ Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives()
myBounds.Nullify();
}
// =======================================================================
// function : AddBound
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(const Standard_Integer theEdgeNumber)
{
Standard_OutOfRange_Raise_if(myBounds.IsNull() || myBounds->NbBounds >= myBounds->NbMaxBounds,
@@ -240,10 +232,8 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(const Standard_Integer th
return ++myBounds->NbBounds;
}
// =======================================================================
// function : AddBound
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(const Standard_Integer theEdgeNumber,
const Standard_Real theR,
const Standard_Real theG,
@@ -257,10 +247,8 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(const Standard_Integer th
return myBounds->NbBounds;
}
// =======================================================================
// function : AddEdge
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(const Standard_Integer theVertexIndex)
{
Standard_OutOfRange_Raise_if(myIndices.IsNull()
@@ -273,10 +261,8 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(const Standard_Integer the
return ++myIndices->NbElements;
}
// =======================================================================
// function : AddTriangleStripEdges
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ArrayOfPrimitives::AddTriangleStripEdges(Standard_Integer theVertexLower,
Standard_Integer theVertexUpper)
{
@@ -300,10 +286,8 @@ void Graphic3d_ArrayOfPrimitives::AddTriangleStripEdges(Standard_Integer theVert
}
}
// =======================================================================
// function : AddTriangleFanEdges
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ArrayOfPrimitives::AddTriangleFanEdges(Standard_Integer theVertexLower,
Standard_Integer theVertexUpper,
Standard_Boolean theToClose)
@@ -323,10 +307,8 @@ void Graphic3d_ArrayOfPrimitives::AddTriangleFanEdges(Standard_Integer theVertex
}
}
// =======================================================================
// function : AddPolylineEdges
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ArrayOfPrimitives::AddPolylineEdges(Standard_Integer theVertexLower,
Standard_Integer theVertexUpper,
Standard_Boolean theToClose)
@@ -346,10 +328,8 @@ void Graphic3d_ArrayOfPrimitives::AddPolylineEdges(Standard_Integer theVertexLow
}
}
// =======================================================================
// function : StringType
// purpose :
// =======================================================================
//=================================================================================================
Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
{
switch (myType)
@@ -386,10 +366,8 @@ Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
return "UndefinedArray";
}
// =======================================================================
// function : ItemNumber
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
{
if (myAttribs.IsNull())
@@ -440,10 +418,8 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
return -1;
}
// =======================================================================
// function : IsValid
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid()
{
if (myAttribs.IsNull())

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