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

Compare commits

..

28 Commits

Author SHA1 Message Date
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
375 changed files with 8734 additions and 10629 deletions

View File

@@ -0,0 +1,90 @@
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_8_0/3rdparty-vc14-64.zip'
runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- 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,21 @@ 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' }}
prepare-and-build-windows-x64:
name: Prepare and Build on Windows with MSVC (x64)
runs-on: windows-2022
@@ -374,6 +389,36 @@ 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
test-windows-x64:
name: Test on Windows (x64)
runs-on: windows-2022
@@ -596,8 +641,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
@@ -830,8 +882,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
@@ -1597,7 +1656,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 +1720,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

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 "beta1" )

View File

@@ -142,17 +142,20 @@ 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
set occt_ver "7.8.0"
set occt_ver_add ""
set filename "[OCCDoc_GetSourceDir]/Standard/Standard_Version.hxx"
set filename "[OCCDoc_GetSourceDir]/../adm/cmake/version.cmake"
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
regexp {set\s+OCC_VERSION_MAJOR\s+([0-9]+)} $fh_loaded dummy major
regexp {set\s+OCC_VERSION_MINOR\s+([0-9]+)} $fh_loaded dummy minor
regexp {set\s+OCC_VERSION_MAINTENANCE\s+([0-9]+)} $fh_loaded dummy maint
regexp {set\s+OCC_VERSION_DEVELOPMENT\s+\"([^\"]+)\"} $fh_loaded dummy occt_ver_add
set occt_ver "$major.$minor.$maint"
if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
}
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

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

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

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

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

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

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

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

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

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

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

View File

@@ -17,19 +17,15 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectFillArea3d, Graphic3d_Aspects)
// =======================================================================
// function : Graphic3d_AspectFillArea3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d()
{
myInteriorStyle = Aspect_IS_EMPTY;
}
// =======================================================================
// function : Graphic3d_AspectFillArea3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d(
const Aspect_InteriorStyle theInteriorStyle,
const Quantity_Color& theInteriorColor,

View File

@@ -17,10 +17,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectLine3d, Graphic3d_Aspects)
// =======================================================================
// function : Graphic3d_AspectLine3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectLine3d::Graphic3d_AspectLine3d()
{
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
@@ -29,10 +27,8 @@ Graphic3d_AspectLine3d::Graphic3d_AspectLine3d()
myLineWidth = 1.0f;
}
// =======================================================================
// function : Graphic3d_AspectLine3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectLine3d::Graphic3d_AspectLine3d(const Quantity_Color& theColor,
Aspect_TypeOfLine theType,
Standard_Real theWidth)

View File

@@ -17,10 +17,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
// =======================================================================
// function : Graphic3d_AspectMarker3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d()
{
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
@@ -29,10 +27,8 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d()
myMarkerScale = 1.0f;
}
// =======================================================================
// function : Graphic3d_AspectMarker3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker theType,
const Quantity_Color& theColor,
const Standard_Real theScale)
@@ -43,10 +39,8 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker the
SetMarkerScale((float)theScale);
}
// =======================================================================
// function : Graphic3d_AspectMarker3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(
const Quantity_Color& theColor,
const Standard_Integer theWidth,
@@ -59,10 +53,8 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(
myMarkerScale = 1.0f;
}
// =======================================================================
// function : Graphic3d_AspectMarker3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(const Handle(Image_PixMap)& theTextureImage)
{
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
@@ -72,10 +64,8 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(const Handle(Image_PixMap)& t
myMarkerScale = 1.0f;
}
// =======================================================================
// function : GetTextureSize
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AspectMarker3d::GetTextureSize(Standard_Integer& theWidth,
Standard_Integer& theHeight) const
{
@@ -90,10 +80,8 @@ void Graphic3d_AspectMarker3d::GetTextureSize(Standard_Integer& theWidth,
}
}
// =======================================================================
// function : SetBitMap
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AspectMarker3d::SetBitMap(const Standard_Integer theWidth,
const Standard_Integer theHeight,
const Handle(TColStd_HArray1OfByte)& theTextureBitMap)

View File

@@ -17,10 +17,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectText3d, Graphic3d_Aspects)
// =======================================================================
// function : Graphic3d_AspectText3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectText3d::Graphic3d_AspectText3d()
{
SetAlphaMode(Graphic3d_AlphaMode_MaskBlend, 0.285f);
@@ -29,10 +27,8 @@ Graphic3d_AspectText3d::Graphic3d_AspectText3d()
myEdgeColor.SetRGB(Quantity_NOC_WHITE);
}
// =======================================================================
// function : Graphic3d_AspectText3d
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AspectText3d::Graphic3d_AspectText3d(const Quantity_Color& theColor,
Standard_CString theFont,
Standard_Real,
@@ -52,10 +48,8 @@ Graphic3d_AspectText3d::Graphic3d_AspectText3d(const Quantity_Color& theColor,
}
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AspectText3d::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)

View File

@@ -16,10 +16,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
// =======================================================================
// function : Graphic3d_Aspects
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Aspects::Graphic3d_Aspects()
: myInteriorColor(Quantity_NOC_CYAN1),
myBackInteriorColor(Quantity_NOC_CYAN1),
@@ -49,10 +47,8 @@ Graphic3d_Aspects::Graphic3d_Aspects()
//
}
// =======================================================================
// function : SetTextureMap
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Aspects::SetTextureMap(const Handle(Graphic3d_TextureMap)& theTexture)
{
if (theTexture.IsNull())

View File

@@ -15,10 +15,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AttribBuffer, Graphic3d_Buffer)
// =======================================================================
// function : Graphic3d_AttribBuffer
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_AttribBuffer::Graphic3d_AttribBuffer(const Handle(NCollection_BaseAllocator)& theAlloc)
: Graphic3d_Buffer(theAlloc),
myIsInterleaved(Standard_True),
@@ -26,10 +24,8 @@ Graphic3d_AttribBuffer::Graphic3d_AttribBuffer(const Handle(NCollection_BaseAllo
{
}
// =======================================================================
// function : Init
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_AttribBuffer::Init(const Standard_Integer theNbElems,
const Graphic3d_Attribute* theAttribs,
const Standard_Integer theNbAttribs)
@@ -47,10 +43,8 @@ bool Graphic3d_AttribBuffer::Init(const Standard_Integer theNbElems,
return true;
}
// =======================================================================
// function : SetMutable
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AttribBuffer::SetMutable(Standard_Boolean theMutable)
{
if (mySize > (Standard_Size)IntegerLast() && theMutable)
@@ -61,10 +55,8 @@ void Graphic3d_AttribBuffer::SetMutable(Standard_Boolean theMutable)
myIsMutable = theMutable;
}
// =======================================================================
// function : Invalidate
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AttribBuffer::SetInterleaved(Standard_Boolean theIsInterleaved)
{
if (NbMaxElements() != 0)
@@ -75,10 +67,8 @@ void Graphic3d_AttribBuffer::SetInterleaved(Standard_Boolean theIsInterleaved)
myIsInterleaved = theIsInterleaved;
}
// =======================================================================
// function : invalidate
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AttribBuffer::invalidate(const Graphic3d_BufferRange& theRange)
{
if (mySize > (Standard_Size)IntegerLast())
@@ -90,10 +80,8 @@ void Graphic3d_AttribBuffer::invalidate(const Graphic3d_BufferRange& theRange)
myInvalidatedRange.Unite(theRange);
}
// =======================================================================
// function : Invalidate
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AttribBuffer::Invalidate()
{
if (mySize > (Standard_Size)IntegerLast())
@@ -105,10 +93,8 @@ void Graphic3d_AttribBuffer::Invalidate()
invalidate(Graphic3d_BufferRange(0, (Standard_Integer)mySize));
}
// =======================================================================
// function : Invalidate
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AttribBuffer::Invalidate(Standard_Integer theAttributeIndex)
{
Standard_OutOfRange_Raise_if(theAttributeIndex < 0 || theAttributeIndex >= NbAttributes,
@@ -136,10 +122,8 @@ void Graphic3d_AttribBuffer::Invalidate(Standard_Integer theAttributeIndex)
}
}
// =======================================================================
// function : Invalidate
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AttribBuffer::Invalidate(Standard_Integer theAttributeIndex,
Standard_Integer theVertexLower,
Standard_Integer theVertexUpper)
@@ -172,10 +156,8 @@ void Graphic3d_AttribBuffer::Invalidate(Standard_Integer theAttributeIndex,
}
}
// =======================================================================
// function : Invalidate
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_AttribBuffer::Invalidate(Standard_Integer theVertexLower,
Standard_Integer theVertexUpper)
{

View File

@@ -19,10 +19,8 @@
#include <algorithm>
// =======================================================================
// function : Serialize
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Vec4 Graphic3d_Fresnel::Serialize() const
{
Graphic3d_Vec4 aData = Graphic3d_Vec4(myFresnelData, 0.f);
@@ -35,19 +33,15 @@ Graphic3d_Vec4 Graphic3d_Fresnel::Serialize() const
return aData;
}
// =======================================================================
// function : fresnelNormal
// purpose :
// =======================================================================
//=================================================================================================
inline float fresnelNormal(float theN, float theK)
{
return ((theN - 1.f) * (theN - 1.f) + theK * theK) / ((theN + 1.f) * (theN + 1.f) + theK * theK);
}
// =======================================================================
// function : CreateConductor
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Fresnel Graphic3d_Fresnel::CreateConductor(const Graphic3d_Vec3& theRefractionIndex,
const Graphic3d_Vec3& theAbsorptionIndex)
{
@@ -66,10 +60,8 @@ void Graphic3d_Fresnel::DumpJson(Standard_OStream& theOStream, Standard_Integer
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myFresnelType)
OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, &myFresnelData)}
// =======================================================================
// function : Graphic3d_BSDF
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BSDF::Graphic3d_BSDF()
: Ks(Graphic3d_Vec3(0.f), 1.f)
{
@@ -88,10 +80,8 @@ bool Graphic3d_BSDF::operator==(const Graphic3d_BSDF& theOther) const
&& FresnelCoat == theOther.FresnelCoat && FresnelBase == theOther.FresnelBase;
}
// =======================================================================
// function : Normalize
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_BSDF::Normalize()
{
float aMax = 0.f;
@@ -112,10 +102,8 @@ void Graphic3d_BSDF::Normalize()
}
}
// =======================================================================
// function : CreateDiffuse
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BSDF Graphic3d_BSDF::CreateDiffuse(const Graphic3d_Vec3& theWeight)
{
Graphic3d_BSDF aBSDF;
@@ -125,10 +113,8 @@ Graphic3d_BSDF Graphic3d_BSDF::CreateDiffuse(const Graphic3d_Vec3& theWeight)
return aBSDF;
}
// =======================================================================
// function : CreateMetallic
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BSDF Graphic3d_BSDF::CreateMetallic(const Graphic3d_Vec3& theWeight,
const Graphic3d_Fresnel& theFresnel,
const float theRoughness)
@@ -144,10 +130,8 @@ Graphic3d_BSDF Graphic3d_BSDF::CreateMetallic(const Graphic3d_Vec3& theWeight
return aBSDF;
}
// =======================================================================
// function : CreateTransparent
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BSDF Graphic3d_BSDF::CreateTransparent(const Graphic3d_Vec3& theWeight,
const Graphic3d_Vec3& theAbsorptionColor,
const float theAbsorptionCoeff)
@@ -170,10 +154,8 @@ Graphic3d_BSDF Graphic3d_BSDF::CreateTransparent(const Graphic3d_Vec3& theWeight
return aBSDF;
}
// =======================================================================
// function : CreateGlass
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BSDF Graphic3d_BSDF::CreateGlass(const Graphic3d_Vec3& theWeight,
const Graphic3d_Vec3& theAbsorptionColor,
const float theAbsorptionCoeff,
@@ -195,10 +177,8 @@ Graphic3d_BSDF Graphic3d_BSDF::CreateGlass(const Graphic3d_Vec3& theWeight,
return aBSDF;
}
// =======================================================================
// function : CreateMetallicRoughness
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BSDF Graphic3d_BSDF::CreateMetallicRoughness(const Graphic3d_PBRMaterial& thePbr)
{
const Graphic3d_Vec3 aDiff = (Graphic3d_Vec3)thePbr.Color().GetRGB() * thePbr.Alpha();

View File

@@ -22,20 +22,16 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_IndexBuffer, Graphic3d_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_BoundBuffer, NCollection_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_MutableIndexBuffer, Graphic3d_IndexBuffer)
// =======================================================================
// function : DefaultAllocator
// purpose :
// =======================================================================
//=================================================================================================
const Handle(NCollection_BaseAllocator)& Graphic3d_Buffer::DefaultAllocator()
{
static const Handle(NCollection_BaseAllocator) THE_ALLOC = new NCollection_AlignedAllocator(16);
return THE_ALLOC;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Buffer::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)

View File

@@ -20,38 +20,30 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_BvhCStructureSet, BVH_PrimitiveSet3d)
// =======================================================================
// function : Graphic3d_BvhCStructureSet
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BvhCStructureSet::Graphic3d_BvhCStructureSet()
{
myBuilder = new BVH_BinnedBuilder<Standard_Real, 3>(BVH_Constants_LeafNodeSizeSingle,
BVH_Constants_MaxTreeDepth);
}
// =======================================================================
// function : Size
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_BvhCStructureSet::Size() const
{
return myStructs.Size();
}
// =======================================================================
// function : Box
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BndBox3d Graphic3d_BvhCStructureSet::Box(const Standard_Integer theIdx) const
{
return myStructs.FindKey(theIdx + 1)->BoundingBox();
}
// =======================================================================
// function : Center
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real Graphic3d_BvhCStructureSet::Center(const Standard_Integer theIdx,
const Standard_Integer theAxis) const
{
@@ -63,20 +55,16 @@ Standard_Real Graphic3d_BvhCStructureSet::Center(const Standard_Integer theIdx,
return aCenter;
}
// =======================================================================
// function : Swap
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_BvhCStructureSet::Swap(const Standard_Integer theIdx1,
const Standard_Integer theIdx2)
{
myStructs.Swap(theIdx1 + 1, theIdx2 + 1);
}
// =======================================================================
// function : Add
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_BvhCStructureSet::Add(const Graphic3d_CStructure* theStruct)
{
const Standard_Integer aSize = myStructs.Size();
@@ -91,10 +79,8 @@ Standard_Boolean Graphic3d_BvhCStructureSet::Add(const Graphic3d_CStructure* the
return Standard_False;
}
// =======================================================================
// function : Remove
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_BvhCStructureSet::Remove(const Graphic3d_CStructure* theStruct)
{
const Standard_Integer anIndex = myStructs.FindIndex(theStruct);
@@ -111,20 +97,16 @@ Standard_Boolean Graphic3d_BvhCStructureSet::Remove(const Graphic3d_CStructure*
return Standard_False;
}
// =======================================================================
// function : Clear
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_BvhCStructureSet::Clear()
{
myStructs.Clear();
MarkDirty();
}
// =======================================================================
// function : GetStructureById
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_CStructure* Graphic3d_BvhCStructureSet::GetStructureById(Standard_Integer theId)
{
return myStructs.FindKey(theId + 1);

View File

@@ -17,10 +17,8 @@
#include <Graphic3d_CStructure.hxx>
// =======================================================================
// function : Graphic3d_BvhCStructureSetTrsfPers
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BvhCStructureSetTrsfPers::Graphic3d_BvhCStructureSetTrsfPers(
const Handle(BVH_Builder3d)& theBuilder)
: myIsDirty(Standard_False),
@@ -30,28 +28,22 @@ Graphic3d_BvhCStructureSetTrsfPers::Graphic3d_BvhCStructureSetTrsfPers(
//
}
// =======================================================================
// function : Size
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_BvhCStructureSetTrsfPers::Size() const
{
return myStructs.Size();
}
// =======================================================================
// function : Box
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_BndBox3d Graphic3d_BvhCStructureSetTrsfPers::Box(const Standard_Integer theIdx) const
{
return *myStructBoxes(theIdx + 1);
}
// =======================================================================
// function : Center
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real Graphic3d_BvhCStructureSetTrsfPers::Center(const Standard_Integer theIdx,
const Standard_Integer theAxis) const
{
@@ -59,10 +51,8 @@ Standard_Real Graphic3d_BvhCStructureSetTrsfPers::Center(const Standard_Integer
return (aBndBox.CornerMin()[theAxis] + aBndBox.CornerMax()[theAxis]) * 0.5;
}
// =======================================================================
// function : Swap
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_BvhCStructureSetTrsfPers::Swap(const Standard_Integer theIdx1,
const Standard_Integer theIdx2)
{
@@ -73,10 +63,8 @@ void Graphic3d_BvhCStructureSetTrsfPers::Swap(const Standard_Integer theIdx1,
myStructBoxes.Swap(aStructIdx1, aStructIdx2);
}
// =======================================================================
// function : Add
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_BvhCStructureSetTrsfPers::Add(const Graphic3d_CStructure* theStruct)
{
const Standard_Integer aSize = myStructs.Size();
@@ -91,10 +79,8 @@ Standard_Boolean Graphic3d_BvhCStructureSetTrsfPers::Add(const Graphic3d_CStruct
return Standard_False;
}
// =======================================================================
// function : Remove
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_BvhCStructureSetTrsfPers::Remove(const Graphic3d_CStructure* theStruct)
{
const Standard_Integer anIndex = myStructs.FindIndex(theStruct);
@@ -111,20 +97,16 @@ Standard_Boolean Graphic3d_BvhCStructureSetTrsfPers::Remove(const Graphic3d_CStr
return Standard_False;
}
// =======================================================================
// function : Clear
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_BvhCStructureSetTrsfPers::Clear()
{
myStructs.Clear();
MarkDirty();
}
// =======================================================================
// function : GetStructureById
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_CStructure* Graphic3d_BvhCStructureSetTrsfPers::GetStructureById(
Standard_Integer theId)
{

View File

@@ -24,10 +24,8 @@ namespace
static volatile Standard_Integer THE_LIGHT_COUNTER = 0;
}
// =======================================================================
// function : makeId
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::makeId()
{
TCollection_AsciiString aTypeSuffix;
@@ -51,10 +49,8 @@ void Graphic3d_CLight::makeId()
+ TCollection_AsciiString(Standard_Atomic_Increment(&THE_LIGHT_COUNTER));
}
// =======================================================================
// function : Graphic3d_CLight
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CLight::Graphic3d_CLight(Graphic3d_TypeOfLightSource theType)
: myPosition(0.0, 0.0, 0.0),
myColor(1.0f, 1.0f, 1.0f, 1.0f),
@@ -94,10 +90,8 @@ Graphic3d_CLight::Graphic3d_CLight(Graphic3d_TypeOfLightSource theType)
makeId();
}
// =======================================================================
// function : CopyFrom
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::CopyFrom(const Handle(Graphic3d_CLight)& theLight)
{
myName = theLight->myName;
@@ -127,30 +121,24 @@ void Graphic3d_CLight::CopyFrom(const Handle(Graphic3d_CLight)& theLight)
}
}
// =======================================================================
// function : SetColor
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetColor(const Quantity_Color& theColor)
{
updateRevisionIf(myColor.GetRGB().IsDifferent(theColor));
myColor.SetRGB(theColor);
}
// =======================================================================
// function : SetEnabled
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetEnabled(Standard_Boolean theIsOn)
{
updateRevisionIf(myIsEnabled != theIsOn);
myIsEnabled = theIsOn;
}
// =======================================================================
// function : SetCastShadows
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetCastShadows(Standard_Boolean theToCast)
{
if (myType != Graphic3d_TypeOfLightSource_Directional
@@ -163,10 +151,8 @@ void Graphic3d_CLight::SetCastShadows(Standard_Boolean theToCast)
myToCastShadows = theToCast;
}
// =======================================================================
// function : SetHeadlight
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetHeadlight(Standard_Boolean theValue)
{
if (myType == Graphic3d_TypeOfLightSource_Ambient)
@@ -178,10 +164,8 @@ void Graphic3d_CLight::SetHeadlight(Standard_Boolean theValue)
myIsHeadlight = theValue;
}
// =======================================================================
// function : SetDirection
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetDirection(const gp_Dir& theDir)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Spot
@@ -197,10 +181,8 @@ void Graphic3d_CLight::SetDirection(const gp_Dir& theDir)
myDirection.z() = static_cast<Standard_ShortReal>(theDir.Z());
}
// =======================================================================
// function : SetPosition
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetPosition(const gp_Pnt& thePosition)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Spot
@@ -210,10 +192,8 @@ void Graphic3d_CLight::SetPosition(const gp_Pnt& thePosition)
myPosition = thePosition;
}
// =======================================================================
// function : SetDisplayPosition
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetDisplayPosition(const gp_Pnt& thePosition)
{
Standard_ProgramError_Raise_if(myType == Graphic3d_TypeOfLightSource_Ambient,
@@ -222,10 +202,8 @@ void Graphic3d_CLight::SetDisplayPosition(const gp_Pnt& thePosition)
myPosition = thePosition;
}
// =======================================================================
// function : SetIntensity
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetIntensity(Standard_ShortReal theValue)
{
Standard_OutOfRange_Raise_if(theValue <= 0.0f,
@@ -234,10 +212,8 @@ void Graphic3d_CLight::SetIntensity(Standard_ShortReal theValue)
myIntensity = theValue;
}
// =======================================================================
// function : SetAngle
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetAngle(Standard_ShortReal theAngle)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Spot,
@@ -248,10 +224,8 @@ void Graphic3d_CLight::SetAngle(Standard_ShortReal theAngle)
changeAngle() = theAngle;
}
// =======================================================================
// function : SetAttenuation
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetAttenuation(Standard_ShortReal theConstAttenuation,
Standard_ShortReal theLinearAttenuation)
{
@@ -267,10 +241,8 @@ void Graphic3d_CLight::SetAttenuation(Standard_ShortReal theConstAttenuation,
changeLinearAttenuation() = theLinearAttenuation;
}
// =======================================================================
// function : SetConcentration
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetConcentration(Standard_ShortReal theConcentration)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Spot,
@@ -281,10 +253,8 @@ void Graphic3d_CLight::SetConcentration(Standard_ShortReal theConcentration)
changeConcentration() = theConcentration;
}
// =======================================================================
// function : SetSmoothRadius
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetSmoothRadius(Standard_ShortReal theValue)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Positional
@@ -297,10 +267,8 @@ void Graphic3d_CLight::SetSmoothRadius(Standard_ShortReal theValue)
mySmoothness = theValue;
}
// =======================================================================
// function : SetSmoothAngle
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetSmoothAngle(Standard_ShortReal theValue)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Directional,
@@ -311,10 +279,8 @@ void Graphic3d_CLight::SetSmoothAngle(Standard_ShortReal theValue)
mySmoothness = theValue;
}
// =======================================================================
// function : SetRange
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CLight::SetRange(Standard_ShortReal theValue)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Positional

View File

@@ -63,10 +63,8 @@ Graphic3d_CView::~Graphic3d_CView()
}
}
// =======================================================================
// function : SetBackgroundSkydome
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::SetBackgroundSkydome(const Aspect_SkydomeBackground& theAspect,
Standard_Boolean theToUpdatePBREnv)
{
@@ -81,10 +79,8 @@ void Graphic3d_CView::SetBackgroundSkydome(const Aspect_SkydomeBackground& theAs
}
}
// =======================================================================
// function : Activate
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Activate()
{
if (!IsActive())
@@ -120,10 +116,8 @@ void Graphic3d_CView::Activate()
Update();
}
// =======================================================================
// function : Deactivate
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Deactivate()
{
if (IsActive())
@@ -157,10 +151,8 @@ void Graphic3d_CView::Deactivate()
}
}
// ========================================================================
// function : Remove
// purpose :
// ========================================================================
//=================================================================================================
void Graphic3d_CView::Remove()
{
if (IsRemoved())
@@ -202,19 +194,15 @@ void Graphic3d_CView::Remove()
myIsRemoved = Standard_True;
}
// ========================================================================
// function : AddSubview
// purpose :
// ========================================================================
//=================================================================================================
void Graphic3d_CView::AddSubview(const Handle(Graphic3d_CView)& theView)
{
mySubviews.Append(theView);
}
// ========================================================================
// function : RemoveSubview
// purpose :
// ========================================================================
//=================================================================================================
bool Graphic3d_CView::RemoveSubview(const Graphic3d_CView* theView)
{
for (NCollection_Sequence<Handle(Graphic3d_CView)>::Iterator aViewIter(mySubviews);
@@ -230,10 +218,8 @@ bool Graphic3d_CView::RemoveSubview(const Graphic3d_CView* theView)
return false;
}
// ========================================================================
// function : Resized
// purpose :
// ========================================================================
//=================================================================================================
void Graphic3d_CView::Resized()
{
if (IsSubview())
@@ -256,10 +242,8 @@ static int getSubViewOffset(double theOffset, int theWinSize)
}
}
// ========================================================================
// function : SubviewResized
// purpose :
// ========================================================================
//=================================================================================================
void Graphic3d_CView::SubviewResized(const Handle(Aspect_NeutralWindow)& theWindow)
{
if (!IsSubview() || theWindow.IsNull())
@@ -311,10 +295,8 @@ void Graphic3d_CView::SubviewResized(const Handle(Aspect_NeutralWindow)& theWind
theWindow->SetSize(aViewSize.x(), aViewSize.y());
}
// ========================================================================
// function : SetComputedMode
// purpose :
// ========================================================================
//=================================================================================================
void Graphic3d_CView::SetComputedMode(const Standard_Boolean theMode)
{
if ((theMode && myIsInComputedMode) || (!theMode && !myIsInComputedMode))
@@ -428,10 +410,8 @@ void Graphic3d_CView::SetComputedMode(const Standard_Boolean theMode)
Update();
}
// =======================================================================
// function : ReCompute
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::ReCompute(const Handle(Graphic3d_Structure)& theStruct)
{
theStruct->CalculateBoundBox();
@@ -447,6 +427,8 @@ void Graphic3d_CView::ReCompute(const Handle(Graphic3d_Structure)& theStruct)
return;
}
theStruct->RecomputeTransformation(myCamera);
const Graphic3d_TypeOfAnswer anAnswer = acceptDisplay(theStruct->Visual());
if (anAnswer != Graphic3d_TOA_COMPUTE)
{
@@ -510,19 +492,15 @@ void Graphic3d_CView::ReCompute(const Handle(Graphic3d_Structure)& theStruct)
myStructsComputed.Remove(anIndex);
}
// =======================================================================
// function : Update
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Update(const Graphic3d_ZLayerId theLayerId)
{
InvalidateZLayerBoundingBox(theLayerId);
}
// =======================================================================
// function : InvalidateZLayerBoundingBox
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::InvalidateZLayerBoundingBox(const Graphic3d_ZLayerId theLayerId)
{
if (Handle(Graphic3d_Layer) aLayer = Layer(theLayerId))
@@ -542,10 +520,8 @@ void Graphic3d_CView::InvalidateZLayerBoundingBox(const Graphic3d_ZLayerId theLa
}
}
// =======================================================================
// function : DisplayedStructures
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::DisplayedStructures(Graphic3d_MapOfStructure& theStructures) const
{
for (Graphic3d_MapOfStructure::Iterator aStructIter(myStructsDisplayed); aStructIter.More();
@@ -555,10 +531,8 @@ void Graphic3d_CView::DisplayedStructures(Graphic3d_MapOfStructure& theStructure
}
}
// =======================================================================
// function : MinMaxValues
// purpose :
// =======================================================================
//=================================================================================================
Bnd_Box Graphic3d_CView::MinMaxValues(const Standard_Boolean theToIncludeAuxiliary) const
{
if (!IsDefined())
@@ -585,10 +559,8 @@ Bnd_Box Graphic3d_CView::MinMaxValues(const Standard_Boolean theToIncludeAuxilia
return aResult;
}
// =======================================================================
// function : ConsiderZoomPersistenceObjects
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real Graphic3d_CView::ConsiderZoomPersistenceObjects()
{
if (!IsDefined())
@@ -615,10 +587,8 @@ Standard_Real Graphic3d_CView::ConsiderZoomPersistenceObjects()
return aMaxCoef;
}
// =======================================================================
// function : MinMaxValues
// purpose :
// =======================================================================
//=================================================================================================
Bnd_Box Graphic3d_CView::MinMaxValues(const Graphic3d_MapOfStructure& theSet,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
@@ -685,10 +655,8 @@ Bnd_Box Graphic3d_CView::MinMaxValues(const Graphic3d_MapOfStructure& theSet,
return aResult;
}
// =======================================================================
// function : acceptDisplay
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_TypeOfAnswer Graphic3d_CView::acceptDisplay(
const Graphic3d_TypeOfStructure theStructType) const
{
@@ -713,10 +681,8 @@ Graphic3d_TypeOfAnswer Graphic3d_CView::acceptDisplay(
return Graphic3d_TOA_NO;
}
// =======================================================================
// function : Compute
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Compute()
{
// force HLRValidation to False on all structures calculated in the view
@@ -726,6 +692,12 @@ void Graphic3d_CView::Compute()
aStructIter.Value()->SetHLRValidation(Standard_False);
}
for (Graphic3d_MapOfStructure::Iterator aStructIter(myStructsDisplayed); aStructIter.More();
aStructIter.Next())
{
aStructIter.Value()->RecomputeTransformation(myCamera);
}
if (!ComputedMode())
{
return;
@@ -755,10 +727,8 @@ void Graphic3d_CView::Compute()
}
}
// =======================================================================
// function : Clear
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Clear(Graphic3d_Structure* theStructure,
const Standard_Boolean theWithDestruction)
{
@@ -771,10 +741,8 @@ void Graphic3d_CView::Clear(Graphic3d_Structure* theStructure,
}
}
// =======================================================================
// function : Connect
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Connect(const Graphic3d_Structure* theMother,
const Graphic3d_Structure* theDaughter)
{
@@ -788,10 +756,8 @@ void Graphic3d_CView::Connect(const Graphic3d_Structure* theMother,
}
}
// =======================================================================
// function : Disconnect
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Disconnect(const Graphic3d_Structure* theMother,
const Graphic3d_Structure* theDaughter)
{
@@ -805,10 +771,8 @@ void Graphic3d_CView::Disconnect(const Graphic3d_Structure* theMother,
}
}
// =======================================================================
// function : Display
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Display(const Handle(Graphic3d_Structure)& theStructure)
{
if (!IsActive())
@@ -828,6 +792,8 @@ void Graphic3d_CView::Display(const Handle(Graphic3d_Structure)& theStructure)
anIndex = 0;
}
theStructure->RecomputeTransformation(myCamera);
Graphic3d_TypeOfAnswer anAnswer = acceptDisplay(theStructure->Visual());
if (anAnswer == Graphic3d_TOA_NO)
{
@@ -967,10 +933,8 @@ void Graphic3d_CView::Display(const Handle(Graphic3d_Structure)& theStructure)
Update(aStruct->GetZLayer());
}
// =======================================================================
// function : Erase
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Erase(const Handle(Graphic3d_Structure)& theStructure)
{
if (!IsDisplayed(theStructure))
@@ -1001,10 +965,8 @@ void Graphic3d_CView::Erase(const Handle(Graphic3d_Structure)& theStructure)
Update(theStructure->GetZLayer());
}
// =======================================================================
// function : Highlight
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::Highlight(const Handle(Graphic3d_Structure)& theStructure)
{
const Standard_Integer anIndex = IsComputed(theStructure);
@@ -1015,10 +977,8 @@ void Graphic3d_CView::Highlight(const Handle(Graphic3d_Structure)& theStructure)
}
}
// =======================================================================
// function : SetTransform
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::SetTransform(const Handle(Graphic3d_Structure)& theStructure,
const Handle(TopLoc_Datum3D)& theTrsf)
{
@@ -1051,10 +1011,8 @@ void Graphic3d_CView::SetTransform(const Handle(Graphic3d_Structure)& theStructu
}
}
// =======================================================================
// function : UnHighlight
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::UnHighlight(const Handle(Graphic3d_Structure)& theStructure)
{
Standard_Integer anIndex = IsComputed(theStructure);
@@ -1065,10 +1023,8 @@ void Graphic3d_CView::UnHighlight(const Handle(Graphic3d_Structure)& theStructur
}
}
// ========================================================================
// function : IsComputed
// purpose :
// ========================================================================
//=================================================================================================
Standard_Boolean Graphic3d_CView::IsComputed(const Standard_Integer theStructId,
Handle(Graphic3d_Structure)& theComputedStruct) const
{
@@ -1088,10 +1044,8 @@ Standard_Boolean Graphic3d_CView::IsComputed(const Standard_Integer theStr
return Standard_False;
}
// =======================================================================
// function : IsComputed
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_CView::IsComputed(const Graphic3d_Structure* theStructure) const
{
const Standard_Integer aStructId = theStructure->Identification();
@@ -1108,19 +1062,15 @@ Standard_Integer Graphic3d_CView::IsComputed(const Graphic3d_Structure* theStruc
return 0;
}
// =======================================================================
// function : IsDisplayed
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_CView::IsDisplayed(const Handle(Graphic3d_Structure)& theStructure) const
{
return myStructsDisplayed.Contains(theStructure);
}
// =======================================================================
// function : ChangePriority
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::ChangePriority(const Handle(Graphic3d_Structure)& theStructure,
const Graphic3d_DisplayPriority /*theOldPriority*/,
const Graphic3d_DisplayPriority theNewPriority)
@@ -1143,10 +1093,8 @@ void Graphic3d_CView::ChangePriority(const Handle(Graphic3d_Structure)& theStruc
changePriority(aCStruct, theNewPriority);
}
// =======================================================================
// function : ChangeZLayer
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::ChangeZLayer(const Handle(Graphic3d_Structure)& theStructure,
const Graphic3d_ZLayerId theLayerId)
{
@@ -1168,10 +1116,8 @@ void Graphic3d_CView::ChangeZLayer(const Handle(Graphic3d_Structure)& theStructu
changeZLayer(aCStruct, theLayerId);
}
// =======================================================================
// function : HaveTheSameOwner
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_CView::HaveTheSameOwner(
const Handle(Graphic3d_Structure)& theStructure) const
{
@@ -1196,10 +1142,8 @@ Standard_Integer Graphic3d_CView::HaveTheSameOwner(
return 0;
}
// =======================================================================
// function : CopySettings
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::CopySettings(const Handle(Graphic3d_CView)& theOther)
{
ChangeRenderingParams() = theOther->RenderingParams();
@@ -1215,10 +1159,8 @@ void Graphic3d_CView::CopySettings(const Handle(Graphic3d_CView)& theOther)
SetClipPlanes(theOther->ClipPlanes());
}
// =======================================================================
// function : SetShadingModel
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::SetShadingModel(Graphic3d_TypeOfShadingModel theModel)
{
if (theModel == Graphic3d_TypeOfShadingModel_DEFAULT)
@@ -1230,10 +1172,8 @@ void Graphic3d_CView::SetShadingModel(Graphic3d_TypeOfShadingModel theModel)
myRenderParams.ShadingModel = theModel;
}
// =======================================================================
// function : SetUnitFactor
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::SetUnitFactor(Standard_Real theFactor)
{
if (theFactor <= 0.0)
@@ -1247,19 +1187,15 @@ void Graphic3d_CView::SetUnitFactor(Standard_Real theFactor)
}
}
// =======================================================================
// function : IsActiveXR
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_CView::IsActiveXR() const
{
return !myXRSession.IsNull() && myXRSession->IsOpen();
}
// =======================================================================
// function : InitXR
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_CView::InitXR()
{
if (myXRSession.IsNull())
@@ -1279,10 +1215,8 @@ bool Graphic3d_CView::InitXR()
return myXRSession->IsOpen();
}
// =======================================================================
// function : ReleaseXR
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CView::ReleaseXR()
{
if (!myXRSession.IsNull())

View File

@@ -89,6 +89,12 @@ public:
//! Sets camera used by the view.
virtual void SetCamera(const Handle(Graphic3d_Camera)& theCamera) { myCamera = theCamera; }
//! Returns necessity to flip OY in projection matrix
virtual Standard_Boolean ToFlipOutput() const { return Standard_False; }
//! Sets state of flip OY necessity in projection matrix
virtual void SetToFlipOutput(const Standard_Boolean) {}
public:
//! Returns default Shading Model of the view; Graphic3d_TypeOfShadingModel_Phong by default.
Graphic3d_TypeOfShadingModel ShadingModel() const { return myRenderParams.ShadingModel; }

View File

@@ -69,10 +69,8 @@ gp_Ax3 cameraToAx3(const Graphic3d_Camera& theCamera)
}
} // namespace
// =======================================================================
// function : Graphic3d_Camera
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Camera::Graphic3d_Camera()
: myUp(0.0, 1.0, 0.0),
myDirection(0.0, 0.0, 1.0),
@@ -102,10 +100,8 @@ Graphic3d_Camera::Graphic3d_Camera()
this);
}
// =======================================================================
// function : Graphic3d_Camera
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Camera::Graphic3d_Camera(const Handle(Graphic3d_Camera)& theOther)
: myUp(0.0, 1.0, 0.0),
myDirection(0.0, 0.0, 1.0),
@@ -135,10 +131,8 @@ Graphic3d_Camera::Graphic3d_Camera(const Handle(Graphic3d_Camera)& theOther)
Copy(theOther);
}
// =======================================================================
// function : CopyMappingData
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::CopyMappingData(const Handle(Graphic3d_Camera)& theOtherCamera)
{
SetZeroToOneDepth(theOtherCamera->IsZeroToOneDepth());
@@ -170,10 +164,8 @@ void Graphic3d_Camera::CopyMappingData(const Handle(Graphic3d_Camera)& theOtherC
}
}
// =======================================================================
// function : CopyOrientationData
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::CopyOrientationData(const Handle(Graphic3d_Camera)& theOtherCamera)
{
if (!myEye.IsEqual(theOtherCamera->Eye(), 0.0) || !myUp.IsEqual(theOtherCamera->Up(), 0.0)
@@ -189,30 +181,24 @@ void Graphic3d_Camera::CopyOrientationData(const Handle(Graphic3d_Camera)& theOt
SetAxialScale(theOtherCamera->AxialScale());
}
// =======================================================================
// function : Copy
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::Copy(const Handle(Graphic3d_Camera)& theOther)
{
CopyMappingData(theOther);
CopyOrientationData(theOther);
}
// =======================================================================
// function : SetIdentityOrientation
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetIdentityOrientation()
{
SetEyeAndCenter(gp_Pnt(0.0, 0.0, 0.0), gp_Pnt(0.0, 0.0, -1.0));
SetUp(gp_Dir(0.0, 1.0, 0.0));
}
// =======================================================================
// function : MoveEyeTo
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::MoveEyeTo(const gp_Pnt& theEye)
{
if (myEye.IsEqual(theEye, 0.0))
@@ -224,10 +210,8 @@ void Graphic3d_Camera::MoveEyeTo(const gp_Pnt& theEye)
InvalidateOrientation();
}
// =======================================================================
// function : SetEyeAndCenter
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetEyeAndCenter(const gp_Pnt& theEye, const gp_Pnt& theCenter)
{
if (Eye().IsEqual(theEye, 0.0) && Center().IsEqual(theCenter, 0.0))
@@ -244,10 +228,8 @@ void Graphic3d_Camera::SetEyeAndCenter(const gp_Pnt& theEye, const gp_Pnt& theCe
InvalidateOrientation();
}
// =======================================================================
// function : SetEye
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetEye(const gp_Pnt& theEye)
{
if (Eye().IsEqual(theEye, 0.0))
@@ -265,10 +247,8 @@ void Graphic3d_Camera::SetEye(const gp_Pnt& theEye)
InvalidateOrientation();
}
// =======================================================================
// function : SetCenter
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetCenter(const gp_Pnt& theCenter)
{
const Standard_Real aDistance = myEye.Distance(theCenter);
@@ -285,10 +265,8 @@ void Graphic3d_Camera::SetCenter(const gp_Pnt& theCenter)
InvalidateOrientation();
}
// =======================================================================
// function : SetUp
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetUp(const gp_Dir& theUp)
{
if (Up().IsEqual(theUp, 0.0))
@@ -300,10 +278,8 @@ void Graphic3d_Camera::SetUp(const gp_Dir& theUp)
InvalidateOrientation();
}
// =======================================================================
// function : SetAxialScale
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetAxialScale(const gp_XYZ& theAxialScale)
{
Standard_OutOfRange_Raise_if(theAxialScale.X() <= 0.0 || theAxialScale.Y() <= 0.0
@@ -318,10 +294,8 @@ void Graphic3d_Camera::SetAxialScale(const gp_XYZ& theAxialScale)
InvalidateOrientation();
}
// =======================================================================
// function : SetDistance
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetDistance(const Standard_Real theDistance)
{
if (myDistance == theDistance)
@@ -335,10 +309,8 @@ void Graphic3d_Camera::SetDistance(const Standard_Real theDistance)
InvalidateOrientation();
}
// =======================================================================
// function : SetDirectionFromEye
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetDirectionFromEye(const gp_Dir& theDir)
{
if (myDirection.IsEqual(theDir, 0.0))
@@ -350,10 +322,8 @@ void Graphic3d_Camera::SetDirectionFromEye(const gp_Dir& theDir)
InvalidateOrientation();
}
// =======================================================================
// function : SetDirection
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetDirection(const gp_Dir& theDir)
{
if (myDirection.IsEqual(theDir, 0.0))
@@ -367,10 +337,8 @@ void Graphic3d_Camera::SetDirection(const gp_Dir& theDir)
InvalidateOrientation();
}
// =======================================================================
// function : SetScale
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetScale(const Standard_Real theScale)
{
if (Scale() == theScale)
@@ -397,10 +365,8 @@ void Graphic3d_Camera::SetScale(const Standard_Real theScale)
InvalidateProjection();
}
// =======================================================================
// function : Scale
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real Graphic3d_Camera::Scale() const
{
switch (myProjType)
@@ -417,10 +383,8 @@ Standard_Real Graphic3d_Camera::Scale() const
}
}
// =======================================================================
// function : SetProjectionType
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetProjectionType(const Projection theProjectionType)
{
Projection anOldType = ProjectionType();
@@ -447,10 +411,8 @@ void Graphic3d_Camera::SetProjectionType(const Projection theProjectionType)
InvalidateProjection();
}
// =======================================================================
// function : SetFOVy
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetFOVy(const Standard_Real theFOVy)
{
if (FOVy() == theFOVy)
@@ -465,10 +427,8 @@ void Graphic3d_Camera::SetFOVy(const Standard_Real theFOVy)
InvalidateProjection();
}
// =======================================================================
// function : SetFOV2d
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetFOV2d(const Standard_Real theFOV)
{
if (FOV2d() == theFOV)
@@ -480,10 +440,8 @@ void Graphic3d_Camera::SetFOV2d(const Standard_Real theFOV)
InvalidateProjection();
}
// =======================================================================
// function : SetZRange
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetZRange(const Standard_Real theZNear, const Standard_Real theZFar)
{
Standard_ASSERT_RAISE(theZFar > theZNear, "ZFar should be greater than ZNear");
@@ -504,10 +462,8 @@ void Graphic3d_Camera::SetZRange(const Standard_Real theZNear, const Standard_Re
InvalidateProjection();
}
// =======================================================================
// function : SetAspect
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetAspect(const Standard_Real theAspect)
{
if (Aspect() == theAspect)
@@ -521,10 +477,8 @@ void Graphic3d_Camera::SetAspect(const Standard_Real theAspect)
InvalidateProjection();
}
// =======================================================================
// function : SetZFocus
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetZFocus(const FocusType theType, const Standard_Real theZFocus)
{
if (ZFocusType() == theType && ZFocus() == theZFocus)
@@ -538,10 +492,8 @@ void Graphic3d_Camera::SetZFocus(const FocusType theType, const Standard_Real th
InvalidateProjection();
}
// =======================================================================
// function : SetIOD
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetIOD(const IODType theType, const Standard_Real theIOD)
{
if (GetIODType() == theType && IOD() == theIOD)
@@ -555,10 +507,8 @@ void Graphic3d_Camera::SetIOD(const IODType theType, const Standard_Real theIOD)
InvalidateProjection();
}
// =======================================================================
// function : SetTile
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetTile(const Graphic3d_CameraTile& theTile)
{
if (myTile == theTile)
@@ -570,19 +520,15 @@ void Graphic3d_Camera::SetTile(const Graphic3d_CameraTile& theTile)
InvalidateProjection();
}
// =======================================================================
// function : OrthogonalizeUp
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::OrthogonalizeUp()
{
SetUp(OrthogonalizedUp());
}
// =======================================================================
// function : OrthogonalizedUp
// purpose :
// =======================================================================
//=================================================================================================
gp_Dir Graphic3d_Camera::OrthogonalizedUp() const
{
gp_Dir aDir = Direction();
@@ -592,10 +538,8 @@ gp_Dir Graphic3d_Camera::OrthogonalizedUp() const
return aLeft.Crossed(aDir);
}
// =======================================================================
// function : Transform
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::Transform(const gp_Trsf& theTrsf)
{
if (theTrsf.Form() == gp_Identity)
@@ -609,10 +553,8 @@ void Graphic3d_Camera::Transform(const gp_Trsf& theTrsf)
InvalidateOrientation();
}
// =======================================================================
// function : safePointCast
// purpose :
// =======================================================================
//=================================================================================================
static Graphic3d_Vec4d safePointCast(const gp_Pnt& thePnt)
{
Standard_Real aLim = 1e15f;
@@ -633,10 +575,8 @@ static Graphic3d_Vec4d safePointCast(const gp_Pnt& thePnt)
return aPnt;
}
// =======================================================================
// function : Project
// purpose :
// =======================================================================
//=================================================================================================
gp_Pnt Graphic3d_Camera::Project(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aViewMx = OrientationMatrix();
@@ -653,10 +593,8 @@ gp_Pnt Graphic3d_Camera::Project(const gp_Pnt& thePnt) const
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
// =======================================================================
// function : UnProject
// purpose :
// =======================================================================
//=================================================================================================
gp_Pnt Graphic3d_Camera::UnProject(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aViewMx = OrientationMatrix();
@@ -682,10 +620,8 @@ gp_Pnt Graphic3d_Camera::UnProject(const gp_Pnt& thePnt) const
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
// =======================================================================
// function : ConvertView2Proj
// purpose :
// =======================================================================
//=================================================================================================
gp_Pnt Graphic3d_Camera::ConvertView2Proj(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aProjMx = ProjectionMatrix();
@@ -700,10 +636,8 @@ gp_Pnt Graphic3d_Camera::ConvertView2Proj(const gp_Pnt& thePnt) const
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
// =======================================================================
// function : ConvertProj2View
// purpose :
// =======================================================================
//=================================================================================================
gp_Pnt Graphic3d_Camera::ConvertProj2View(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aProjMx = ProjectionMatrix();
@@ -726,10 +660,8 @@ gp_Pnt Graphic3d_Camera::ConvertProj2View(const gp_Pnt& thePnt) const
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
// =======================================================================
// function : ConvertWorld2View
// purpose :
// =======================================================================
//=================================================================================================
gp_Pnt Graphic3d_Camera::ConvertWorld2View(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aViewMx = OrientationMatrix();
@@ -744,10 +676,8 @@ gp_Pnt Graphic3d_Camera::ConvertWorld2View(const gp_Pnt& thePnt) const
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
// =======================================================================
// function : ConvertView2World
// purpose :
// =======================================================================
//=================================================================================================
gp_Pnt Graphic3d_Camera::ConvertView2World(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aViewMx = OrientationMatrix();
@@ -769,10 +699,8 @@ gp_Pnt Graphic3d_Camera::ConvertView2World(const gp_Pnt& thePnt) const
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
// =======================================================================
// function : ViewDimensions
// purpose :
// =======================================================================
//=================================================================================================
gp_XYZ Graphic3d_Camera::ViewDimensions(const Standard_Real theZValue) const
{
// view plane dimensions
@@ -793,10 +721,8 @@ gp_XYZ Graphic3d_Camera::ViewDimensions(const Standard_Real theZValue) const
return gp_XYZ(aSizeX, aSizeY, myZFar - myZNear);
}
// =======================================================================
// function : Frustum
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::Frustum(gp_Pln& theLeft,
gp_Pln& theRight,
gp_Pln& theBottom,
@@ -851,82 +777,64 @@ void Graphic3d_Camera::Frustum(gp_Pln& theLeft,
theTop = gp_Pln(aPntTop, aDirTop);
}
// =======================================================================
// function : OrientationMatrix
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_Mat4d& Graphic3d_Camera::OrientationMatrix() const
{
return UpdateOrientation(myMatricesD).Orientation;
}
// =======================================================================
// function : OrientationMatrixF
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_Mat4& Graphic3d_Camera::OrientationMatrixF() const
{
return UpdateOrientation(myMatricesF).Orientation;
}
// =======================================================================
// function : ProjectionMatrix
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_Mat4d& Graphic3d_Camera::ProjectionMatrix() const
{
return UpdateProjection(myMatricesD).MProjection;
}
// =======================================================================
// function : ProjectionMatrixF
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_Mat4& Graphic3d_Camera::ProjectionMatrixF() const
{
return UpdateProjection(myMatricesF).MProjection;
}
// =======================================================================
// function : ProjectionStereoLeft
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_Mat4d& Graphic3d_Camera::ProjectionStereoLeft() const
{
return UpdateProjection(myMatricesD).LProjection;
}
// =======================================================================
// function : ProjectionStereoLeftF
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_Mat4& Graphic3d_Camera::ProjectionStereoLeftF() const
{
return UpdateProjection(myMatricesF).LProjection;
}
// =======================================================================
// function : ProjectionStereoRight
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_Mat4d& Graphic3d_Camera::ProjectionStereoRight() const
{
return UpdateProjection(myMatricesD).RProjection;
}
// =======================================================================
// function : ProjectionStereoRightF
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_Mat4& Graphic3d_Camera::ProjectionStereoRightF() const
{
return UpdateProjection(myMatricesF).RProjection;
}
// =======================================================================
// function : ResetCustomProjection
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::ResetCustomProjection()
{
if (myIsCustomFrustomLR || myIsCustomProjMatLR || myIsCustomProjMatM)
@@ -938,10 +846,8 @@ void Graphic3d_Camera::ResetCustomProjection()
}
}
// =======================================================================
// function : StereoProjection
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::StereoProjection(Graphic3d_Mat4d& theProjL,
Graphic3d_Mat4d& theHeadToEyeL,
Graphic3d_Mat4d& theProjR,
@@ -950,10 +856,8 @@ void Graphic3d_Camera::StereoProjection(Graphic3d_Mat4d& theProjL,
stereoProjection(theProjL, theHeadToEyeL, theProjR, theHeadToEyeR);
}
// =======================================================================
// function : StereoProjectionF
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::StereoProjectionF(Graphic3d_Mat4& theProjL,
Graphic3d_Mat4& theHeadToEyeL,
Graphic3d_Mat4& theProjR,
@@ -962,10 +866,8 @@ void Graphic3d_Camera::StereoProjectionF(Graphic3d_Mat4& theProjL,
stereoProjection(theProjL, theHeadToEyeL, theProjR, theHeadToEyeR);
}
// =======================================================================
// function : stereoProjection
// purpose :
// =======================================================================
//=================================================================================================
template <typename Elem_t>
void Graphic3d_Camera::stereoProjection(NCollection_Mat4<Elem_t>& theProjL,
NCollection_Mat4<Elem_t>& theHeadToEyeL,
@@ -998,10 +900,8 @@ void Graphic3d_Camera::stereoProjection(NCollection_Mat4<Elem_t>& theProjL,
}
}
// =======================================================================
// function : SetCustomStereoFrustums
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetCustomStereoFrustums(const Aspect_FrustumLRBT<Standard_Real>& theFrustumL,
const Aspect_FrustumLRBT<Standard_Real>& theFrustumR)
{
@@ -1012,10 +912,8 @@ void Graphic3d_Camera::SetCustomStereoFrustums(const Aspect_FrustumLRBT<Standard
InvalidateProjection();
}
// =======================================================================
// function : SetCustomStereoProjection
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetCustomStereoProjection(const Graphic3d_Mat4d& theProjL,
const Graphic3d_Mat4d& theHeadToEyeL,
const Graphic3d_Mat4d& theProjR,
@@ -1030,10 +928,8 @@ void Graphic3d_Camera::SetCustomStereoProjection(const Graphic3d_Mat4d& theProjL
InvalidateProjection();
}
// =======================================================================
// function : SetCustomMonoProjection
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::SetCustomMonoProjection(const Graphic3d_Mat4d& theProj)
{
myCustomProjMatM = theProj;
@@ -1041,10 +937,8 @@ void Graphic3d_Camera::SetCustomMonoProjection(const Graphic3d_Mat4d& theProj)
InvalidateProjection();
}
// =======================================================================
// function : computeProjection
// purpose :
// =======================================================================
//=================================================================================================
template <typename Elem_t>
void Graphic3d_Camera::computeProjection(NCollection_Mat4<Elem_t>& theProjM,
NCollection_Mat4<Elem_t>& theProjL,
@@ -1184,10 +1078,8 @@ void Graphic3d_Camera::computeProjection(NCollection_Mat4<Elem_t>& theProjM,
}
}
// =======================================================================
// function : UpdateOrientation
// purpose :
// =======================================================================
//=================================================================================================
template <typename Elem_t>
Graphic3d_Camera::TransformMatrices<Elem_t>& Graphic3d_Camera::UpdateOrientation(
TransformMatrices<Elem_t>& theMatrices) const
@@ -1220,10 +1112,8 @@ Graphic3d_Camera::TransformMatrices<Elem_t>& Graphic3d_Camera::UpdateOrientation
return theMatrices; // for inline accessors
}
// =======================================================================
// function : InvalidateProjection
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::InvalidateProjection()
{
myMatricesD.ResetProjection();
@@ -1232,10 +1122,8 @@ void Graphic3d_Camera::InvalidateProjection()
(Standard_Size)Standard_Atomic_Increment(&THE_STATE_COUNTER);
}
// =======================================================================
// function : InvalidateOrientation
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Camera::InvalidateOrientation()
{
myMatricesD.ResetOrientation();
@@ -1244,10 +1132,8 @@ void Graphic3d_Camera::InvalidateOrientation()
(Standard_Size)Standard_Atomic_Increment(&THE_STATE_COUNTER);
}
// =======================================================================
// function : orthoProj
// purpose :
// =======================================================================
//=================================================================================================
template <typename Elem_t>
void Graphic3d_Camera::orthoProj(NCollection_Mat4<Elem_t>& theOutMx,
const Aspect_FrustumLRBT<Elem_t>& theLRBT,
@@ -1287,10 +1173,8 @@ void Graphic3d_Camera::orthoProj(NCollection_Mat4<Elem_t>& theOutMx,
theOutMx.ChangeValue(3, 3) = Elem_t(1.0);
}
// =======================================================================
// function : PerspectiveProj
// purpose :
// =======================================================================
//=================================================================================================
template <typename Elem_t>
void Graphic3d_Camera::perspectiveProj(NCollection_Mat4<Elem_t>& theOutMx,
const Aspect_FrustumLRBT<Elem_t>& theLRBT,
@@ -1336,10 +1220,8 @@ void Graphic3d_Camera::perspectiveProj(NCollection_Mat4<Elem_t>& theOutM
theOutMx.ChangeValue(3, 3) = Elem_t(0.0);
}
// =======================================================================
// function : StereoEyeProj
// purpose :
// =======================================================================
//=================================================================================================
template <typename Elem_t>
void Graphic3d_Camera::stereoEyeProj(NCollection_Mat4<Elem_t>& theOutMx,
const Aspect_FrustumLRBT<Elem_t>& theLRBT,
@@ -1359,10 +1241,8 @@ void Graphic3d_Camera::stereoEyeProj(NCollection_Mat4<Elem_t>& theOutMx,
perspectiveProj(theOutMx, aLRBT, theNear, theFar);
}
// =======================================================================
// function : LookOrientation
// purpose :
// =======================================================================
//=================================================================================================
template <typename Elem_t>
void Graphic3d_Camera::LookOrientation(const NCollection_Vec3<Elem_t>& theEye,
const NCollection_Vec3<Elem_t>& theFwdDir,
@@ -1397,10 +1277,8 @@ void Graphic3d_Camera::LookOrientation(const NCollection_Vec3<Elem_t>& theEye,
theOutMx.Multiply(anAxialScaleMx);
}
// =======================================================================
// function : FitMinMax
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_Camera::FitMinMax(const Bnd_Box& theBox,
const Standard_Real theResolution,
const bool theToEnlargeIfLine)

View File

@@ -39,10 +39,8 @@ static Handle(Graphic3d_AspectFillArea3d) defaultAspect()
}
} // namespace
// =======================================================================
// function : Graphic3d_ClipPlane
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_ClipPlane::Graphic3d_ClipPlane()
: myAspect(defaultAspect()),
myPrevInChain(NULL),
@@ -59,10 +57,8 @@ Graphic3d_ClipPlane::Graphic3d_ClipPlane()
makeId();
}
// =======================================================================
// function : Graphic3d_ClipPlane
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Graphic3d_Vec4d& theEquation)
: myAspect(defaultAspect()),
myPrevInChain(NULL),
@@ -80,10 +76,8 @@ Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Graphic3d_Vec4d& theEquation)
updateInversedPlane();
}
// =======================================================================
// function : Graphic3d_ClipPlane
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Graphic3d_ClipPlane& theOther)
: Standard_Transient(theOther),
myAspect(defaultAspect()),
@@ -102,10 +96,8 @@ Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Graphic3d_ClipPlane& theOther)
*myAspect = *theOther.CappingAspect();
}
// =======================================================================
// function : Graphic3d_ClipPlane
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const gp_Pln& thePlane)
: myAspect(defaultAspect()),
myPrevInChain(NULL),
@@ -122,10 +114,8 @@ Graphic3d_ClipPlane::Graphic3d_ClipPlane(const gp_Pln& thePlane)
makeId();
}
// =======================================================================
// function : SetEquation
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetEquation(const Graphic3d_Vec4d& theEquation)
{
myPlane = gp_Pln(theEquation.x(), theEquation.y(), theEquation.z(), theEquation.w());
@@ -134,10 +124,8 @@ void Graphic3d_ClipPlane::SetEquation(const Graphic3d_Vec4d& theEquation)
myEquationMod++;
}
// =======================================================================
// function : SetPlane
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetEquation(const gp_Pln& thePlane)
{
myPlane = thePlane;
@@ -146,10 +134,8 @@ void Graphic3d_ClipPlane::SetEquation(const gp_Pln& thePlane)
myEquationMod++;
}
// =======================================================================
// function : SetOn
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetOn(const Standard_Boolean theIsOn)
{
if (myPrevInChain != NULL)
@@ -160,28 +146,22 @@ void Graphic3d_ClipPlane::SetOn(const Standard_Boolean theIsOn)
myIsOn = theIsOn;
}
// =======================================================================
// function : SetCapping
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCapping(const Standard_Boolean theIsOn)
{
myIsCapping = theIsOn;
}
// =======================================================================
// function : Clone
// purpose :
// =======================================================================
//=================================================================================================
Handle(Graphic3d_ClipPlane) Graphic3d_ClipPlane::Clone() const
{
return new Graphic3d_ClipPlane(*this);
}
// =======================================================================
// function : SetCappingColor
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCappingColor(const Quantity_Color& theColor)
{
myAspect->SetInteriorColor(theColor);
@@ -189,10 +169,8 @@ void Graphic3d_ClipPlane::SetCappingColor(const Quantity_Color& theColor)
++myAspectMod;
}
// =======================================================================
// function : SetCappingMaterial
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCappingMaterial(const Graphic3d_MaterialAspect& theMat)
{
myAspect->SetFrontMaterial(theMat);
@@ -203,10 +181,8 @@ void Graphic3d_ClipPlane::SetCappingMaterial(const Graphic3d_MaterialAspect& the
++myAspectMod;
}
// =======================================================================
// function : SetCappingTexture
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCappingTexture(const Handle(Graphic3d_TextureMap)& theTexture)
{
if (!theTexture.IsNull())
@@ -231,60 +207,48 @@ void Graphic3d_ClipPlane::SetCappingTexture(const Handle(Graphic3d_TextureMap)&
++myAspectMod;
}
// =======================================================================
// function : SetCappingHatch
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCappingHatch(const Aspect_HatchStyle theStyle)
{
myAspect->SetHatchStyle(theStyle);
++myAspectMod;
}
// =======================================================================
// function : SetCappingCustomHatch
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCappingCustomHatch(const Handle(Graphic3d_HatchStyle)& theStyle)
{
myAspect->SetHatchStyle(theStyle);
++myAspectMod;
}
// =======================================================================
// function : SetCappingHatchOn
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCappingHatchOn()
{
myAspect->SetInteriorStyle(Aspect_IS_HATCH);
++myAspectMod;
}
// =======================================================================
// function : SetCappingHatchOff
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCappingHatchOff()
{
myAspect->SetInteriorStyle(Aspect_IS_SOLID);
++myAspectMod;
}
// =======================================================================
// function : SetCappingAspect
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetCappingAspect(const Handle(Graphic3d_AspectFillArea3d)& theAspect)
{
myAspect = theAspect;
++myAspectMod;
}
// =======================================================================
// function : setCappingFlag
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::setCappingFlag(bool theToUse, int theFlag)
{
if (theToUse)
@@ -298,20 +262,16 @@ void Graphic3d_ClipPlane::setCappingFlag(bool theToUse, int theFlag)
++myAspectMod;
}
// =======================================================================
// function : makeId
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::makeId()
{
myId = TCollection_AsciiString("Graphic3d_ClipPlane_") // DynamicType()->Name()
+ TCollection_AsciiString(Standard_Atomic_Increment(&THE_CLIP_PLANE_COUNTER));
}
// =======================================================================
// function : updateChainLen
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::updateChainLen()
{
myChainLenFwd = !myNextInChain.IsNull() ? (myNextInChain->myChainLenFwd + 1) : 1;
@@ -321,10 +281,8 @@ void Graphic3d_ClipPlane::updateChainLen()
}
}
// =======================================================================
// function : SetChainNextPlane
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::SetChainNextPlane(const Handle(Graphic3d_ClipPlane)& thePlane)
{
++myEquationMod;
@@ -340,10 +298,8 @@ void Graphic3d_ClipPlane::SetChainNextPlane(const Handle(Graphic3d_ClipPlane)& t
updateChainLen();
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_ClipPlane::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)

View File

@@ -16,10 +16,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CubeMap, Graphic3d_TextureMap)
// =======================================================================
// function : Graphic3d_CubeMap
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMap::Graphic3d_CubeMap(const TCollection_AsciiString& theFileName,
Standard_Boolean theToGenerateMipmaps)
: Graphic3d_TextureMap(theFileName, Graphic3d_TypeOfTexture_CUBEMAP),
@@ -30,10 +28,8 @@ Graphic3d_CubeMap::Graphic3d_CubeMap(const TCollection_AsciiString& theFileName,
myHasMipmaps = theToGenerateMipmaps;
}
// =======================================================================
// function : Graphic3d_CubeMap
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMap::Graphic3d_CubeMap(const Handle(Image_PixMap)& thePixmap,
Standard_Boolean theToGenerateMipmaps)
: Graphic3d_TextureMap(thePixmap, Graphic3d_TypeOfTexture_CUBEMAP),
@@ -44,10 +40,8 @@ Graphic3d_CubeMap::Graphic3d_CubeMap(const Handle(Image_PixMap)& thePixmap,
myHasMipmaps = theToGenerateMipmaps;
}
// =======================================================================
// function : ~Graphic3d_CubeMap
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMap::~Graphic3d_CubeMap()
{
//

View File

@@ -18,20 +18,16 @@
#include <bitset>
// =======================================================================
// function : Graphic3d_CubeMapOrder
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder()
: myConvolution(0),
myHasOverflows(false)
{
}
// =======================================================================
// function : Graphic3d_CubeMapOrder
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder(unsigned char thePosXLocation,
unsigned char theNegXLocation,
unsigned char thePosYLocation,
@@ -49,20 +45,16 @@ Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder(unsigned char thePosXLocation,
Set(Graphic3d_CMS_NEG_Z, theNegZLocation);
}
// =======================================================================
// function : Graphic3d_CubeMapOrder
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder(const Graphic3d_ValidatedCubeMapOrder& theOrder)
: myConvolution(theOrder.Order.myConvolution),
myHasOverflows(theOrder.Order.myHasOverflows)
{
}
// =======================================================================
// function : Set
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Set(const Graphic3d_CubeMapOrder& theOrder)
{
myConvolution = theOrder.myConvolution;
@@ -85,10 +77,8 @@ Graphic3d_ValidatedCubeMapOrder Graphic3d_CubeMapOrder::Validated() const
return *this;
}
// =======================================================================
// function : Set
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Set(Graphic3d_CubeMapSide theCubeMapSide,
unsigned char theValue)
{
@@ -101,10 +91,8 @@ Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Set(Graphic3d_CubeMapSide theCub
return *this;
}
// =======================================================================
// function : Get
// purpose :
// =======================================================================
//=================================================================================================
unsigned char Graphic3d_CubeMapOrder::Get(Graphic3d_CubeMapSide theCubeMapSide) const
{
return get(static_cast<unsigned char>(theCubeMapSide));
@@ -119,10 +107,8 @@ unsigned char Graphic3d_CubeMapOrder::operator[](Graphic3d_CubeMapSide theCubeMa
return Get(theCubeMapSide);
}
// =======================================================================
// function : SetDefault
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::SetDefault()
{
for (unsigned char i = 0; i < 6; ++i)
@@ -132,10 +118,8 @@ Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::SetDefault()
return *this;
}
// =======================================================================
// function : Permute
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Permute(
const Graphic3d_ValidatedCubeMapOrder& thePermutation)
{
@@ -147,10 +131,8 @@ Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Permute(
return *this;
}
// =======================================================================
// function : Permuted
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder Graphic3d_CubeMapOrder::Permuted(
const Graphic3d_ValidatedCubeMapOrder& thePermutation) const
{
@@ -159,10 +141,8 @@ Graphic3d_CubeMapOrder Graphic3d_CubeMapOrder::Permuted(
return anOrder;
}
// =======================================================================
// function : Swap
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Swap(Graphic3d_CubeMapSide theFirstSide,
Graphic3d_CubeMapSide theSecondSide)
{
@@ -172,10 +152,8 @@ Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Swap(Graphic3d_CubeMapSide theFi
return *this;
}
// =======================================================================
// function : Swapped
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder Graphic3d_CubeMapOrder::Swapped(Graphic3d_CubeMapSide theFirstSide,
Graphic3d_CubeMapSide theSecondSide) const
{
@@ -184,10 +162,8 @@ Graphic3d_CubeMapOrder Graphic3d_CubeMapOrder::Swapped(Graphic3d_CubeMapSide the
return anOrder;
}
// =======================================================================
// function : Clear
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Clear()
{
myConvolution = 0;
@@ -195,19 +171,15 @@ Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Clear()
return *this;
}
// =======================================================================
// function : IsEmpty
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_CubeMapOrder::IsEmpty() const
{
return myConvolution == 0;
}
// =======================================================================
// function : HasRepetitions
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_CubeMapOrder::HasRepetitions() const
{
std::bitset<6> aBitSet;
@@ -223,37 +195,29 @@ bool Graphic3d_CubeMapOrder::HasRepetitions() const
return false;
}
// =======================================================================
// function : HasOverflows
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_CubeMapOrder::HasOverflows() const
{
return myHasOverflows;
}
// =======================================================================
// function : IsValid
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_CubeMapOrder::IsValid() const
{
return !HasRepetitions() && !HasOverflows();
}
// =======================================================================
// function : get
// purpose :
// =======================================================================
//=================================================================================================
unsigned char Graphic3d_CubeMapOrder::get(unsigned char theCubeMapSide) const
{
return (myConvolution / (1 << (theCubeMapSide * 3))) % (1 << 3);
}
// =======================================================================
// function : set
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CubeMapOrder::set(unsigned char theCubeMapSide, unsigned char theValue)
{
unsigned int aValuePlace = 1 << (theCubeMapSide * 3);
@@ -261,19 +225,15 @@ void Graphic3d_CubeMapOrder::set(unsigned char theCubeMapSide, unsigned char the
myConvolution += aValuePlace * theValue;
}
// =======================================================================
// function : set
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CubeMapOrder::set(Graphic3d_CubeMapSide theCubeMapSide, unsigned char theValue)
{
set(static_cast<unsigned char>(theCubeMapSide), theValue);
}
// =======================================================================
// function : Default
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_ValidatedCubeMapOrder& Graphic3d_CubeMapOrder::Default()
{
static const Graphic3d_ValidatedCubeMapOrder aCubeMapOrder =

View File

@@ -19,10 +19,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CubeMapPacked, Graphic3d_CubeMap)
// =======================================================================
// function : Graphic3d_CubeMapPacked
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked(const TCollection_AsciiString& theFilePath,
const Graphic3d_ValidatedCubeMapOrder& theOrder)
: Graphic3d_CubeMap(theFilePath),
@@ -31,10 +29,8 @@ Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked(const TCollection_AsciiString&
{
}
// =======================================================================
// function : Graphic3d_CubeMapPacked
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked(const Handle(Image_PixMap)& theImage,
const Graphic3d_ValidatedCubeMapOrder& theOrder)
: Graphic3d_CubeMap(Handle(Image_PixMap)()),
@@ -47,10 +43,8 @@ Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked(const Handle(Image_PixMap)&
}
}
// =======================================================================
// function : CompressedValue
// purpose :
// =======================================================================
//=================================================================================================
Handle(Image_CompressedPixMap) Graphic3d_CubeMapPacked::CompressedValue(
const Handle(Image_SupportedFormats)& theSupported)
{
@@ -75,10 +69,8 @@ Handle(Image_CompressedPixMap) Graphic3d_CubeMapPacked::CompressedValue(
return Handle(Image_CompressedPixMap)();
}
// =======================================================================
// function : Value
// purpose :
// =======================================================================
//=================================================================================================
Handle(Image_PixMap) Graphic3d_CubeMapPacked::Value(
const Handle(Image_SupportedFormats)& theSupported)
{
@@ -135,10 +127,8 @@ Handle(Image_PixMap) Graphic3d_CubeMapPacked::Value(
return Handle(Image_PixMap)();
}
// =======================================================================
// function : checkOrder
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_CubeMapPacked::checkOrder(
const NCollection_Array1<unsigned int>& theOrder)
{
@@ -177,10 +167,8 @@ Standard_Boolean Graphic3d_CubeMapPacked::checkOrder(
return anOrderIsValid;
}
// =======================================================================
// function : checkImage
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_CubeMapPacked::checkImage(const Handle(Image_PixMap)& theImage,
unsigned int& theTileNumberX)
{
@@ -211,10 +199,8 @@ Standard_Boolean Graphic3d_CubeMapPacked::checkImage(const Handle(Image_PixMap)&
return Standard_True;
}
// =======================================================================
// function : tryLoadImage
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CubeMapPacked::tryLoadImage(const Handle(Image_SupportedFormats)& theSupported,
const TCollection_AsciiString& theFilePath)
{

View File

@@ -22,10 +22,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CubeMapSeparate, Graphic3d_CubeMap)
// =======================================================================
// function : Graphic3d_CubeMapSeparate
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapSeparate::Graphic3d_CubeMapSeparate(
const NCollection_Array1<TCollection_AsciiString>& thePaths)
{
@@ -42,10 +40,8 @@ Graphic3d_CubeMapSeparate::Graphic3d_CubeMapSeparate(
}
}
// =======================================================================
// function : Graphic3d_CubeMapSeparate
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CubeMapSeparate::Graphic3d_CubeMapSeparate(
const NCollection_Array1<Handle(Image_PixMap)>& theImages)
{
@@ -87,10 +83,8 @@ Graphic3d_CubeMapSeparate::Graphic3d_CubeMapSeparate(
}
}
// =======================================================================
// function : CompressedValue
// purpose :
// =======================================================================
//=================================================================================================
Handle(Image_CompressedPixMap) Graphic3d_CubeMapSeparate::CompressedValue(
const Handle(Image_SupportedFormats)& theSupported)
{
@@ -131,10 +125,8 @@ Handle(Image_CompressedPixMap) Graphic3d_CubeMapSeparate::CompressedValue(
return Handle(Image_CompressedPixMap)();
}
// =======================================================================
// function : Value
// purpose :
// =======================================================================
//=================================================================================================
Handle(Image_PixMap) Graphic3d_CubeMapSeparate::Value(
const Handle(Image_SupportedFormats)& theSupported)
{
@@ -199,10 +191,8 @@ Handle(Image_PixMap) Graphic3d_CubeMapSeparate::Value(
return Handle(Image_PixMap)();
}
// =======================================================================
// function : IsDone
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_CubeMapSeparate::IsDone() const
{
if (!myImages[0].IsNull())
@@ -222,10 +212,8 @@ Standard_Boolean Graphic3d_CubeMapSeparate::IsDone() const
return Standard_True;
}
// =======================================================================
// function : resetImages
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CubeMapSeparate::resetImages()
{
for (unsigned int i = 0; i < 6; ++i)

View File

@@ -19,10 +19,8 @@
#include <limits>
// =======================================================================
// function : Graphic3d_CullingTool
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_CullingTool::Graphic3d_CullingTool()
: myClipVerts(0, Graphic3d_Camera::FrustumVerticesNB),
myIsProjectionParallel(Standard_True),
@@ -32,10 +30,8 @@ Graphic3d_CullingTool::Graphic3d_CullingTool()
//
}
// =======================================================================
// function : SetViewVolume
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CullingTool::SetViewVolume(const Handle(Graphic3d_Camera)& theCamera,
const Graphic3d_Mat4d& theModelWorld)
{
@@ -102,10 +98,8 @@ void Graphic3d_CullingTool::SetViewVolume(const Handle(Graphic3d_Camera)& theCam
}
}
// =======================================================================
// function : SetViewportSize
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CullingTool::SetViewportSize(Standard_Integer theViewportWidth,
Standard_Integer theViewportHeight,
Standard_Real theResolutionRatio)
@@ -115,10 +109,8 @@ void Graphic3d_CullingTool::SetViewportSize(Standard_Integer theViewportWidth,
myPixelSize = Max(theResolutionRatio / myViewportHeight, theResolutionRatio / myViewportWidth);
}
// =======================================================================
// function : SignedPlanePointDistance
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real Graphic3d_CullingTool::SignedPlanePointDistance(const Graphic3d_Vec4d& theNormal,
const Graphic3d_Vec4d& thePnt)
{
@@ -136,10 +128,8 @@ Standard_Real Graphic3d_CullingTool::SignedPlanePointDistance(const Graphic3d_Ve
return aD + (anA * thePnt.x() + aB * thePnt.y() + aC * thePnt.z());
}
// =======================================================================
// function : SetCullingDistance
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CullingTool::SetCullingDistance(CullingContext& theCtx,
Standard_Real theDistance) const
{
@@ -150,10 +140,8 @@ void Graphic3d_CullingTool::SetCullingDistance(CullingContext& theCtx,
}
}
// =======================================================================
// function : SetCullingSize
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CullingTool::SetCullingSize(CullingContext& theCtx, Standard_Real theSize) const
{
theCtx.SizeCull2 = -1.0;
@@ -165,10 +153,8 @@ void Graphic3d_CullingTool::SetCullingSize(CullingContext& theCtx, Standard_Real
}
}
// =======================================================================
// function : CacheClipPtsProjections
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_CullingTool::CacheClipPtsProjections()
{
// project frustum onto its own normals

View File

@@ -237,10 +237,8 @@ static void addTimeInfo(TColStd_IndexedDataMapOfStringString& theDict,
}
} // namespace
// =======================================================================
// function : Graphic3d_FrameStats
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_FrameStats::Graphic3d_FrameStats()
: myFpsTimer(Standard_True),
myFrameStartTime(0.0),
@@ -254,19 +252,15 @@ Graphic3d_FrameStats::Graphic3d_FrameStats()
//
}
// =======================================================================
// function : ~Graphic3d_FrameStats
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_FrameStats::~Graphic3d_FrameStats()
{
//
}
// =======================================================================
// function : FormatStats
// purpose :
// =======================================================================
//=================================================================================================
TCollection_AsciiString Graphic3d_FrameStats::FormatStats(
Graphic3d_RenderingParams::PerfCounters theFlags) const
{
@@ -558,10 +552,8 @@ TCollection_AsciiString Graphic3d_FrameStats::FormatStats(
return TCollection_AsciiString(aBuf.str().c_str());
}
// =======================================================================
// function : FormatStats
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_FrameStats::FormatStats(TColStd_IndexedDataMapOfStringString& theDict,
Graphic3d_RenderingParams::PerfCounters theFlags) const
{
@@ -676,10 +668,8 @@ void Graphic3d_FrameStats::FormatStats(TColStd_IndexedDataMapOfStringString& t
}
}
// =======================================================================
// function : FrameStart
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_FrameStats::FrameStart(const Handle(Graphic3d_CView)& theView,
bool theIsImmediateOnly)
{
@@ -713,10 +703,8 @@ void Graphic3d_FrameStats::FrameStart(const Handle(Graphic3d_CView)& theView,
}
}
// =======================================================================
// function : FrameEnd
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_FrameStats::FrameEnd(const Handle(Graphic3d_CView)& theView, bool theIsImmediateOnly)
{
const Graphic3d_RenderingParams::PerfCounters aBits =

View File

@@ -13,10 +13,8 @@
#include <Graphic3d_FrameStatsData.hxx>
// =======================================================================
// function : Graphic3d_FrameStatsData
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_FrameStatsData::Graphic3d_FrameStatsData()
: myFps(-1.0),
myFpsCpu(-1.0),
@@ -30,10 +28,8 @@ Graphic3d_FrameStatsData::Graphic3d_FrameStatsData()
Reset();
}
// =======================================================================
// function : Graphic3d_FrameStatsData
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_FrameStatsData::Graphic3d_FrameStatsData(const Graphic3d_FrameStatsData& theOther)
: myCounters(theOther.myCounters),
myTimers(theOther.myTimers),
@@ -46,10 +42,8 @@ Graphic3d_FrameStatsData::Graphic3d_FrameStatsData(const Graphic3d_FrameStatsDat
{
}
// =======================================================================
// function : Graphic3d_FrameStatsData
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_FrameStatsData::Graphic3d_FrameStatsData(Graphic3d_FrameStatsData&& theOther) noexcept
: myCounters(std::move(theOther.myCounters)),
myTimers(std::move(theOther.myTimers)),
@@ -106,10 +100,8 @@ Graphic3d_FrameStatsData& Graphic3d_FrameStatsData::operator=(
return *this;
}
// =======================================================================
// function : Reset
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_FrameStatsData::Reset()
{
myFps = -1.0;
@@ -122,10 +114,8 @@ void Graphic3d_FrameStatsData::Reset()
myTimersMax.assign(myTimersMax.size(), 0.0);
}
// =======================================================================
// function : FillMax
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_FrameStatsData::FillMax(const Graphic3d_FrameStatsData& theOther)
{
myFps = Max(myFps, theOther.myFps);
@@ -146,20 +136,16 @@ void Graphic3d_FrameStatsData::FillMax(const Graphic3d_FrameStatsData& theOther)
}
}
// =======================================================================
// function : Graphic3d_FrameStatsDataTmp
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_FrameStatsDataTmp::Graphic3d_FrameStatsDataTmp()
{
myOsdTimers.resize(Graphic3d_FrameStatsTimer_NB, OSD_Timer(true));
myTimersPrev.resize(Graphic3d_FrameStatsTimer_NB, 0.0);
}
// =======================================================================
// function : FlushTimers
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_FrameStatsDataTmp::FlushTimers(Standard_Size theNbFrames, bool theIsFinal)
{
for (size_t aTimerIter = 0; aTimerIter < myTimers.size(); ++aTimerIter)
@@ -180,10 +166,8 @@ void Graphic3d_FrameStatsDataTmp::FlushTimers(Standard_Size theNbFrames, bool th
}
}
// =======================================================================
// function : Reset
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_FrameStatsDataTmp::Reset()
{
Graphic3d_FrameStatsData::Reset();

View File

@@ -20,10 +20,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_GraphicDriver, Standard_Transient)
// =======================================================================
// function : Graphic3d_GraphicDriver
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_GraphicDriver::Graphic3d_GraphicDriver(const Handle(Aspect_DisplayConnection)& theDisp)
: myDisplayConnection(theDisp)
{
@@ -114,28 +112,22 @@ Graphic3d_GraphicDriver::Graphic3d_GraphicDriver(const Handle(Aspect_DisplayConn
}
}
// =======================================================================
// function : GetDisplayConnection
// purpose :
// =======================================================================
//=================================================================================================
const Handle(Aspect_DisplayConnection)& Graphic3d_GraphicDriver::GetDisplayConnection() const
{
return myDisplayConnection;
}
// =======================================================================
// function : NewIdentification
// purpose :
// =======================================================================
//=================================================================================================
Standard_Integer Graphic3d_GraphicDriver::NewIdentification()
{
return myStructGenId.Next();
}
// =======================================================================
// function : RemoveIdentification
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_GraphicDriver::RemoveIdentification(const Standard_Integer theId)
{
myStructGenId.Free(theId);
@@ -288,10 +280,8 @@ void Graphic3d_GraphicDriver::SetZLayerSettings(const Graphic3d_ZLayerId
aLayerDef->SetLayerSettings(theSettings);
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_GraphicDriver::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{

View File

@@ -26,19 +26,15 @@ static Graphic3d_GraphicDriverFactoryList& getDriverFactories()
}
} // namespace
// =======================================================================
// function : DriverFactories
// purpose :
// =======================================================================
//=================================================================================================
const Graphic3d_GraphicDriverFactoryList& Graphic3d_GraphicDriverFactory::DriverFactories()
{
return getDriverFactories();
}
// =======================================================================
// function : RegisterFactory
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_GraphicDriverFactory::RegisterFactory(
const Handle(Graphic3d_GraphicDriverFactory)& theFactory,
bool theIsPreferred)
@@ -63,10 +59,8 @@ void Graphic3d_GraphicDriverFactory::RegisterFactory(
aFactories.Append(theFactory);
}
// =======================================================================
// function : UnregisterFactory
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_GraphicDriverFactory::UnregisterFactory(const TCollection_AsciiString& theName)
{
Graphic3d_GraphicDriverFactoryList& aFactories = getDriverFactories();
@@ -83,20 +77,16 @@ void Graphic3d_GraphicDriverFactory::UnregisterFactory(const TCollection_AsciiSt
}
}
// =======================================================================
// function : DefaultDriverFactory
// purpose :
// =======================================================================
//=================================================================================================
Handle(Graphic3d_GraphicDriverFactory) Graphic3d_GraphicDriverFactory::DefaultDriverFactory()
{
const Graphic3d_GraphicDriverFactoryList& aMap = getDriverFactories();
return !aMap.IsEmpty() ? aMap.First() : Handle(Graphic3d_GraphicDriverFactory)();
}
// =======================================================================
// function : Graphic3d_GraphicDriverFactory
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_GraphicDriverFactory::Graphic3d_GraphicDriverFactory(
const TCollection_AsciiString& theName)
: myName(theName)

View File

@@ -30,10 +30,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Group, Standard_Transient)
// =======================================================================
// function : Graphic3d_Group
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Group::Graphic3d_Group(const Handle(Graphic3d_Structure)& theStruct)
: myStructure(theStruct.operator->()),
myIsClosed(false)
@@ -41,20 +39,16 @@ Graphic3d_Group::Graphic3d_Group(const Handle(Graphic3d_Structure)& theStruct)
//
}
// =======================================================================
// function : ~Graphic3d_Group
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Group::~Graphic3d_Group()
{
// tell graphics driver to clear internal resources of the group
Clear(Standard_False);
}
// =======================================================================
// function : Clear
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Clear(Standard_Boolean theUpdateStructureMgr)
{
if (IsDeleted())
@@ -73,10 +67,8 @@ void Graphic3d_Group::Clear(Standard_Boolean theUpdateStructureMgr)
}
}
// =======================================================================
// function : Remove
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Remove()
{
if (IsDeleted())
@@ -91,19 +83,15 @@ void Graphic3d_Group::Remove()
myBounds.Clear();
}
// =======================================================================
// function : IsDeleted
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_Group::IsDeleted() const
{
return myStructure == NULL || myStructure->IsDeleted();
}
// =======================================================================
// function : IsEmpty
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_Group::IsEmpty() const
{
if (IsDeleted())
@@ -114,10 +102,8 @@ Standard_Boolean Graphic3d_Group::IsEmpty() const
return !myStructure->IsInfinite() && !myBounds.IsValid();
}
// =======================================================================
// function : SetTransformPersistence
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::SetTransformPersistence(const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
if (myTrsfPers != theTrsfPers)
@@ -130,10 +116,8 @@ void Graphic3d_Group::SetTransformPersistence(const Handle(Graphic3d_TransformPe
}
}
// =======================================================================
// function : SetMinMaxValues
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::SetMinMaxValues(const Standard_Real theXMin,
const Standard_Real theYMin,
const Standard_Real theZMin,
@@ -151,19 +135,15 @@ void Graphic3d_Group::SetMinMaxValues(const Standard_Real theXMin,
1.0f));
}
// =======================================================================
// function : Structure
// purpose :
// =======================================================================
//=================================================================================================
Handle(Graphic3d_Structure) Graphic3d_Group::Structure() const
{
return myStructure;
}
// =======================================================================
// function : MinMaxValues
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::MinMaxValues(Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theZMin,
@@ -196,10 +176,8 @@ void Graphic3d_Group::MinMaxValues(Standard_Real& theXMin,
}
}
// =======================================================================
// function : Update
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Update() const
{
if (IsDeleted())
@@ -210,10 +188,8 @@ void Graphic3d_Group::Update() const
myStructure->StructureManager()->Update();
}
// =======================================================================
// function : AddPrimitiveArray
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::AddPrimitiveArray(const Handle(Graphic3d_ArrayOfPrimitives)& thePrim,
const Standard_Boolean theToEvalMinMax)
{
@@ -229,10 +205,8 @@ void Graphic3d_Group::AddPrimitiveArray(const Handle(Graphic3d_ArrayOfPrimitives
theToEvalMinMax);
}
// =======================================================================
// function : AddPrimitiveArray
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::AddPrimitiveArray(const Graphic3d_TypeOfPrimitiveArray theType,
const Handle(Graphic3d_IndexBuffer)&,
const Handle(Graphic3d_Buffer)& theAttribs,
@@ -289,10 +263,8 @@ void Graphic3d_Group::AddPrimitiveArray(const Graphic3d_TypeOfPrimitiveArray the
Update();
}
// =======================================================================
// function : Marker
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Marker(const Graphic3d_Vertex& thePoint,
const Standard_Boolean theToEvalMinMax)
{
@@ -301,10 +273,8 @@ void Graphic3d_Group::Marker(const Graphic3d_Vertex& thePoint,
AddPrimitiveArray(aPoints, theToEvalMinMax);
}
// =======================================================================
// function : Text
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Text(const Standard_CString theText,
const Graphic3d_Vertex& thePoint,
const Standard_Real theHeight,
@@ -322,10 +292,8 @@ void Graphic3d_Group::Text(const Standard_CString theText,
AddText(aText, theToEvalMinMax);
}
// =======================================================================
// function : Text
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Text(const Standard_CString theText,
const Graphic3d_Vertex& thePoint,
const Standard_Real theHeight,
@@ -337,10 +305,8 @@ void Graphic3d_Group::Text(const Standard_CString theText,
AddText(aText, theToEvalMinMax);
}
// =======================================================================
// function : Text
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
const Graphic3d_Vertex& thePoint,
const Standard_Real theHeight,
@@ -358,10 +324,8 @@ void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
AddText(aText, theToEvalMinMax);
}
// =======================================================================
// function : Text
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
const gp_Ax2& theOrientation,
const Standard_Real theHeight,
@@ -381,10 +345,8 @@ void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
AddText(aText, theToEvalMinMax);
}
// =======================================================================
// function : Text
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Text(const Standard_CString theText,
const gp_Ax2& theOrientation,
const Standard_Real theHeight,
@@ -404,10 +366,8 @@ void Graphic3d_Group::Text(const Standard_CString theText,
AddText(aText, theToEvalMinMax);
}
// =======================================================================
// function : Text
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
const Graphic3d_Vertex& thePoint,
const Standard_Real theHeight,
@@ -419,10 +379,8 @@ void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
AddText(aText, theToEvalMinMax);
}
// =======================================================================
// function : AddText
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::AddText(const Handle(Graphic3d_Text)& theTextParams,
const Standard_Boolean theToEvalMinMax)
{
@@ -445,10 +403,8 @@ void Graphic3d_Group::AddText(const Handle(Graphic3d_Text)& theTextParams,
Update();
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Group::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)

View File

@@ -131,6 +131,12 @@ public:
Standard_EXPORT virtual void SetFlippingOptions(const Standard_Boolean theIsEnabled,
const gp_Ax2& theRefPlane) = 0;
//! Return transformation.
const gp_Trsf& Transformation() const { return myTrsf; }
//! Assign transformation.
virtual void SetTransformation(const gp_Trsf& theTrsf) { myTrsf = theTrsf; }
//! Return transformation persistence.
const Handle(Graphic3d_TransformPers)& TransformPersistence() const { return myTrsfPers; }
@@ -310,6 +316,7 @@ protected:
Handle(Graphic3d_TransformPers) myTrsfPers; //!< current transform persistence
Graphic3d_Structure* myStructure; //!< pointer to the parent structure
Graphic3d_BndBox4f myBounds; //!< bounding box
gp_Trsf myTrsf; //!< group transformation
bool myIsClosed; //!< flag indicating closed volume
};

View File

@@ -18,10 +18,8 @@
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Layer, Standard_Transient)
// =======================================================================
// function : Graphic3d_Layer
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Layer::Graphic3d_Layer(Graphic3d_ZLayerId theId, const Handle(BVH_Builder3d)& theBuilder)
: myNbStructures(0),
myNbStructuresNotCulled(0),
@@ -33,19 +31,15 @@ Graphic3d_Layer::Graphic3d_Layer(Graphic3d_ZLayerId theId, const Handle(BVH_Buil
myIsBoundingBoxNeedsReset[0] = myIsBoundingBoxNeedsReset[1] = true;
}
// =======================================================================
// function : ~Graphic3d_Layer
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_Layer::~Graphic3d_Layer()
{
//
}
// =======================================================================
// function : Add
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Layer::Add(const Graphic3d_CStructure* theStruct,
Graphic3d_DisplayPriority thePriority,
Standard_Boolean isForChangePriority)
@@ -80,10 +74,8 @@ void Graphic3d_Layer::Add(const Graphic3d_CStructure* theStruct,
++myNbStructures;
}
// =======================================================================
// function : Remove
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_Layer::Remove(const Graphic3d_CStructure* theStruct,
Graphic3d_DisplayPriority& thePriority,
Standard_Boolean isForChangePriority)
@@ -140,10 +132,8 @@ bool Graphic3d_Layer::Remove(const Graphic3d_CStructure* theStruct,
return false;
}
// =======================================================================
// function : InvalidateBVHData
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Layer::InvalidateBVHData()
{
myIsBVHPrimitivesNeedsReset = Standard_True;
@@ -181,10 +171,8 @@ static void addBox3dToBndBox(Bnd_Box& theResBox, const Graphic3d_BndBox3d& theBo
}
}
// =======================================================================
// function : BoundingBox
// purpose :
// =======================================================================
//=================================================================================================
Bnd_Box Graphic3d_Layer::BoundingBox(Standard_Integer theViewId,
const Handle(Graphic3d_Camera)& theCamera,
Standard_Integer theWindowWidth,
@@ -339,10 +327,8 @@ Bnd_Box Graphic3d_Layer::BoundingBox(Standard_Integer theViewId,
return aResBox;
}
// =======================================================================
// function : considerZoomPersistenceObjects
// purpose :
// =======================================================================
//=================================================================================================
Standard_Real Graphic3d_Layer::considerZoomPersistenceObjects(
Standard_Integer theViewId,
const Handle(Graphic3d_Camera)& theCamera,
@@ -477,10 +463,8 @@ Standard_Real Graphic3d_Layer::considerZoomPersistenceObjects(
return (aMaxCoef > 0.0) ? aMaxCoef : 1.0;
}
// =======================================================================
// function : updateBVH
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Layer::updateBVH() const
{
if (!myIsBVHPrimitivesNeedsReset)
@@ -534,10 +518,8 @@ struct NodeInStack
};
} // namespace
// =======================================================================
// function : UpdateCulling
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Layer::UpdateCulling(
Standard_Integer theViewId,
const Graphic3d_CullingTool& theSelector,
@@ -706,10 +688,8 @@ void Graphic3d_Layer::UpdateCulling(
}
}
// =======================================================================
// function : Append
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_Layer::Append(const Graphic3d_Layer& theOther)
{
// add all structures to destination priority list
@@ -754,10 +734,8 @@ void Graphic3d_Layer::SetLayerSettings(const Graphic3d_ZLayerSettings& theSettin
}
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_Layer::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)

View File

@@ -28,10 +28,8 @@ static const char THE_LIGHT_KEY_LETTERS[Graphic3d_TypeOfLightSource_NB] = {
};
} // namespace
// =======================================================================
// function : Graphic3d_LightSet
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_LightSet::Graphic3d_LightSet()
: myAmbient(0.0f, 0.0f, 0.0f, 0.0f),
myNbEnabled(0),
@@ -43,10 +41,8 @@ Graphic3d_LightSet::Graphic3d_LightSet()
memset(myLightTypesEnabled, 0, sizeof(myLightTypesEnabled));
}
// =======================================================================
// function : Add
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_LightSet::Add(const Handle(Graphic3d_CLight)& theLight)
{
if (theLight.IsNull())
@@ -67,10 +63,8 @@ Standard_Boolean Graphic3d_LightSet::Add(const Handle(Graphic3d_CLight)& theLigh
return Standard_True;
}
// =======================================================================
// function : Remove
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_LightSet::Remove(const Handle(Graphic3d_CLight)& theLight)
{
const Standard_Integer anIndToRemove = myLights.FindIndex(theLight);
@@ -85,10 +79,8 @@ Standard_Boolean Graphic3d_LightSet::Remove(const Handle(Graphic3d_CLight)& theL
return Standard_True;
}
// =======================================================================
// function : UpdateRevision
// purpose :
// =======================================================================
//=================================================================================================
Standard_Size Graphic3d_LightSet::UpdateRevision()
{
if (myCacheRevision == myRevision)

View File

@@ -169,10 +169,8 @@ static Handle(Graphic3d_MarkerImage) getTextureImage(const Aspect_TypeOfMarker t
}
} // namespace
// =======================================================================
// function : Graphic3d_MarkerImage
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_MarkerImage::Graphic3d_MarkerImage(const Handle(Image_PixMap)& theImage,
const Handle(Image_PixMap)& theImageAlpha)
: myImage(theImage),
@@ -201,10 +199,8 @@ Graphic3d_MarkerImage::Graphic3d_MarkerImage(const Handle(Image_PixMap)& theImag
}
}
// =======================================================================
// function : Graphic3d_MarkerImage
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_MarkerImage::Graphic3d_MarkerImage(const TCollection_AsciiString& theId,
const TCollection_AsciiString& theAlphaId,
const Handle(Image_PixMap)& theImage,
@@ -231,10 +227,8 @@ Graphic3d_MarkerImage::Graphic3d_MarkerImage(const TCollection_AsciiString& theI
}
}
// =======================================================================
// function : Graphic3d_MarkerImage
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_MarkerImage::Graphic3d_MarkerImage(const Handle(TColStd_HArray1OfByte)& theBitMap,
const Standard_Integer theWidth,
const Standard_Integer theHeight)
@@ -250,20 +244,16 @@ Graphic3d_MarkerImage::Graphic3d_MarkerImage(const Handle(TColStd_HArray1OfByte)
+ TCollection_AsciiString(THE_MARKER_IMAGE_COUNTER);
}
// =======================================================================
// function : IsColoredImage
// purpose :
// =======================================================================
//=================================================================================================
bool Graphic3d_MarkerImage::IsColoredImage() const
{
return !myImage.IsNull() && myImage->Format() != Image_Format_Alpha
&& myImage->Format() != Image_Format_Gray;
}
// =======================================================================
// function : GetBitMapArray
// purpose :
// =======================================================================
//=================================================================================================
Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray(
const Standard_Real theAlphaValue,
const Standard_Boolean theIsTopDown) const
@@ -306,10 +296,8 @@ Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray(
return aBitMap;
}
// =======================================================================
// function : GetImage
// purpose :
// =======================================================================
//=================================================================================================
const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage()
{
if (!myImage.IsNull() || myBitMap.IsNull())
@@ -344,10 +332,8 @@ const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage()
return myImage;
}
// =======================================================================
// function : GetImageAlpha
// purpose :
// =======================================================================
//=================================================================================================
const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImageAlpha()
{
if (!myImageAlpha.IsNull())
@@ -382,28 +368,22 @@ const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImageAlpha()
return myImageAlpha;
}
// =======================================================================
// function : GetImageId
// purpose :
// =======================================================================
//=================================================================================================
const TCollection_AsciiString& Graphic3d_MarkerImage::GetImageId() const
{
return myImageId;
}
// =======================================================================
// function : GetImageAlphaId
// purpose :
// =======================================================================
//=================================================================================================
const TCollection_AsciiString& Graphic3d_MarkerImage::GetImageAlphaId() const
{
return myImageAlphaId;
}
// =======================================================================
// function : GetTextureSize
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MarkerImage::GetTextureSize(Standard_Integer& theWidth,
Standard_Integer& theHeight) const
{
@@ -411,10 +391,8 @@ void Graphic3d_MarkerImage::GetTextureSize(Standard_Integer& theWidth,
theHeight = myHeight;
}
// =======================================================================
// function : GetMarkerImage
// purpose :
// =======================================================================
//=================================================================================================
Handle(Graphic3d_MarkerImage) Graphic3d_MarkerImage::StandardMarker(
const Aspect_TypeOfMarker theMarkerType,
const Standard_ShortReal theScale,

View File

@@ -69,10 +69,8 @@ static const RawMaterial THE_MATERIALS[] = {
RawMaterial(Graphic3d_NameOfMaterial_UserDefined, "UserDefined")};
} // namespace
// =======================================================================
// function : RawMaterial
// purpose :
// =======================================================================
//=================================================================================================
RawMaterial::RawMaterial(Graphic3d_NameOfMaterial theName, const char* theStringName)
: StringName(theStringName),
BSDF(Graphic3d_BSDF::CreateDiffuse(Graphic3d_Vec3(0.0f))),
@@ -471,30 +469,24 @@ RawMaterial::RawMaterial(Graphic3d_NameOfMaterial theName, const char* theString
PBRMaterial.SetBSDF(BSDF);
}
// =======================================================================
// function : Graphic3d_MaterialAspect
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect()
: myRequestedMaterialName(Graphic3d_NameOfMaterial_DEFAULT)
{
init(Graphic3d_NameOfMaterial_DEFAULT);
}
// =======================================================================
// function : Graphic3d_MaterialAspect
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect(const Graphic3d_NameOfMaterial theName)
: myRequestedMaterialName(theName)
{
init(theName);
}
// =======================================================================
// function : init
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::init(const Graphic3d_NameOfMaterial theName)
{
const RawMaterial& aMat = THE_MATERIALS[theName];
@@ -513,10 +505,8 @@ void Graphic3d_MaterialAspect::init(const Graphic3d_NameOfMaterial theName)
myRequestedMaterialName = theName;
}
// =======================================================================
// function : IncreaseShine
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::IncreaseShine(const Standard_ShortReal theDelta)
{
const Standard_ShortReal anOldShine = myShininess;
@@ -527,10 +517,8 @@ void Graphic3d_MaterialAspect::IncreaseShine(const Standard_ShortReal theDelta)
}
}
// =======================================================================
// function : SetMaterialType
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetMaterialType(const Graphic3d_TypeOfMaterial theType)
{
myMaterialType = theType;
@@ -540,10 +528,8 @@ void Graphic3d_MaterialAspect::SetMaterialType(const Graphic3d_TypeOfMaterial th
}
}
// =======================================================================
// function : SetColor
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_ASPECT)
@@ -566,10 +552,8 @@ void Graphic3d_MaterialAspect::SetColor(const Quantity_Color& theColor)
myColors[Graphic3d_TOR_DIFFUSE] = aDiffuse;
}
// =======================================================================
// function : SetAmbientColor
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetAmbientColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
@@ -581,10 +565,8 @@ void Graphic3d_MaterialAspect::SetAmbientColor(const Quantity_Color& theColor)
myColors[Graphic3d_TOR_AMBIENT] = theColor;
}
// =======================================================================
// function : SetDiffuseColor
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetDiffuseColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
@@ -596,10 +578,8 @@ void Graphic3d_MaterialAspect::SetDiffuseColor(const Quantity_Color& theColor)
myColors[Graphic3d_TOR_DIFFUSE] = theColor;
}
// =======================================================================
// function : SetSpecularColor
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetSpecularColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
@@ -611,10 +591,8 @@ void Graphic3d_MaterialAspect::SetSpecularColor(const Quantity_Color& theColor)
myColors[Graphic3d_TOR_SPECULAR] = theColor;
}
// =======================================================================
// function : SetEmissiveColor
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetEmissiveColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
@@ -626,10 +604,8 @@ void Graphic3d_MaterialAspect::SetEmissiveColor(const Quantity_Color& theColor)
myColors[Graphic3d_TOR_EMISSION] = theColor;
}
// =======================================================================
// function : SetTransparency
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetTransparency(const Standard_ShortReal theValue)
{
if (theValue < 0.0f || theValue > 1.0f)
@@ -641,10 +617,8 @@ void Graphic3d_MaterialAspect::SetTransparency(const Standard_ShortReal theValue
myPBRMaterial.SetAlpha(1.0f - theValue);
}
// =======================================================================
// function : SetRefractionIndex
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetRefractionIndex(const Standard_ShortReal theValue)
{
if (theValue < 1.0f)
@@ -655,10 +629,8 @@ void Graphic3d_MaterialAspect::SetRefractionIndex(const Standard_ShortReal theVa
myRefractionIndex = theValue;
}
// =======================================================================
// function : SetShininess
// purpose :
// =======================================================================
//=================================================================================================
void Graphic3d_MaterialAspect::SetShininess(const Standard_ShortReal theValue)
{
if (theValue < 0.0f || theValue > 1.0f)
@@ -673,10 +645,8 @@ void Graphic3d_MaterialAspect::SetShininess(const Standard_ShortReal theValue)
}
}
// =======================================================================
// function : MaterialName
// purpose :
// =======================================================================
//=================================================================================================
Standard_CString Graphic3d_MaterialAspect::MaterialName(const Standard_Integer theRank)
{
if (theRank < 1 || theRank > NumberOfMaterials())
@@ -687,10 +657,8 @@ Standard_CString Graphic3d_MaterialAspect::MaterialName(const Standard_Integer t
return aMat.StringName;
}
// =======================================================================
// function : MaterialFromName
// purpose :
// =======================================================================
//=================================================================================================
Standard_Boolean Graphic3d_MaterialAspect::MaterialFromName(const Standard_CString theName,
Graphic3d_NameOfMaterial& theMat)
{
@@ -742,10 +710,8 @@ Standard_Boolean Graphic3d_MaterialAspect::MaterialFromName(const Standard_CStri
return Standard_False;
}
// =======================================================================
// function : MaterialType
// purpose :
// =======================================================================
//=================================================================================================
Graphic3d_TypeOfMaterial Graphic3d_MaterialAspect::MaterialType(const Standard_Integer theRank)
{
if (theRank < 1 || theRank > NumberOfMaterials())

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