Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing - TInspector building on GH #287

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ PackConstructorInitializers: Never
PointerAlignment: Left
ReferenceAlignment: Left
SeparateDefinitionBlocks: Always
SortIncludes: true
SortIncludes: false
UseTab: Never
#
# OCCT specific settings
StatementMacros:
- Standard_FALLTHROUGH
- Standard_DEPRECATED
TypenameMacros:
- Handle
54 changes: 29 additions & 25 deletions .github/workflows/build-multiconfig-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
name: MinGW build validation

on:
pull_request:
branches:
- '**'
push:
branches:
- 'master'
Expand All @@ -27,23 +30,23 @@ jobs:
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-x86_64-toolchain",
thirdparty_dir: "/mingw64",
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads mingw-w64-x86_64-qt5-base"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
package: "mingw-w64-clang-x86_64-toolchain",
thirdparty_dir: "/clang64",
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads mingw-w64-clang-x86_64-qt5-base"
}
- {
name: "UCRT",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-ucrt-x86_64-toolchain",
thirdparty_dir: "/ucrt64",
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads mingw-w64-ucrt-x86_64-qt5-base"
}

steps:
Expand All @@ -68,28 +71,28 @@ jobs:
echo "$MSYSTEM_PREFIX/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX" >> $GITHUB_ENV

- name: Configure basic
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
-D CMAKE_C_FLAGS="-Wall -Wextra" ..

- name: Build basic
shell: msys2 {0}
run: |
cd build
cmake --build . -- -j 4

- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
# - name: Configure basic
# shell: msys2 {0}
# run: |
# mkdir -p build
# cd build
# cmake -G "Ninja" \
# -D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
# -D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
# -D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
# -D CMAKE_CXX_FLAGS="-Wall -Wextra" \
# -D CMAKE_C_FLAGS="-Wall -Wextra" ..

# - name: Build basic
# shell: msys2 {0}
# run: |
# cd build
# cmake --build . -- -j 4

# - name: Clear up after build
# shell: pwsh
# run: |
# Remove-Item -Recurse -Force build

- name: Configure full shared
shell: msys2 {0}
Expand All @@ -100,6 +103,7 @@ jobs:
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D BUILD_Inspector=ON \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
Expand Down
42 changes: 23 additions & 19 deletions .github/workflows/build-multiconfig-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
name: Ubuntu build validation

on:
pull_request:
branches:
- '**'
push:
branches:
- 'master'
Expand Down Expand Up @@ -37,31 +40,31 @@ jobs:
uses: actions/checkout@v4.1.7

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang 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 libjemalloc-dev
run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang 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 libjemalloc-dev qtbase5-dev

- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip

- name: Configure basic
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..

- name: Build basic
run: |
cd build
cmake --build . -- -j 4

- name: Clear up after build
run: |
rm -rf build
# - name: Configure basic
# run: |
# mkdir -p build
# cd build
# cmake -G "Ninja" \
# -D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
# -D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
# -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
# -D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..

# - name: Build basic
# run: |
# cd build
# cmake --build . -- -j 4

# - name: Clear up after build
# run: |
# rm -rf build

- name: Configure full shared
run: |
Expand All @@ -70,6 +73,7 @@ jobs:
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D BUILD_Inspector=ON \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# 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 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

- name: Check clang-format version
run: |
$version = clang-format --version
Write-Output "Detected clang-format version: $version"
$version | Select-String "18.1.8" >$null
if ($LASTEXITCODE -ne 0) {
echo "::error::Wrong clang-format version. Expected 18.1.8"
Write-Output "Error: Version mismatch - expected 18.1.8"
exit 1
}
shell: pwsh

- name: Get changed files
id: changed-files
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 | 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'
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'
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'
uses: actions/upload-artifact@v4
with:
name: format-patch
path: format.patch

- name: Fail with instructions
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
82 changes: 44 additions & 38 deletions src/AIS/AIS.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,58 +21,64 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>

//! Application Interactive Services provide the means to create links between an application GUI viewer and
//! the packages which are used to manage selection and presentation.
//! The tools AIS defined in order to do this include different sorts of entities:
//! both the selectable viewable objects themselves and the context and attribute managers to define their selection and display.
//! To orient the user as he works in a modeling environment, views and selections must be comprehensible.
//! There must be several different sorts of selectable and viewable object defined.
//! These must also be interactive, that is, connecting graphic representation and the underlying reference geometry.
//! These entities are called Interactive Objects, and are divided into four types:
//! Application Interactive Services provide the means to create links between an application GUI
//! viewer and the packages which are used to manage selection and presentation. The tools AIS
//! defined in order to do this include different sorts of entities: both the selectable viewable
//! objects themselves and the context and attribute managers to define their selection and display.
//! To orient the user as he works in a modeling environment, views and selections must be
//! comprehensible. There must be several different sorts of selectable and viewable object defined.
//! These must also be interactive, that is, connecting graphic representation and the underlying
//! reference geometry. These entities are called Interactive Objects, and are divided into four
//! types:
//! - the Datum
//! - the Relation
//! - the Object
//! - None.
//! The Datum groups together the construction elements such as lines, circles, points, trihedra, plane trihedra, planes and axes.
//! The Relation is made up of constraints on one or more interactive shapes and the corresponding reference geometry.
//! For example, you might want to constrain two edges in a parallel relation.
//! This constraint is considered as an object in its own right, and is shown as a sensitive primitive.
//! This takes the graphic form of a perpendicular arrow marked with the || symbol and lying between the two edges.
//! The Object type includes topological shapes, and connections between shapes.
//! None, in order not to eliminate the object, tells the application to look further until it finds an object definition in its generation which is accepted.
//! Inside these categories, you have the possibility of an additional characterization by means of a signature.
//! The signature provides an index to the further characterization.
//! By default, the Interactive Object has a None type and a signature of 0 (equivalent to None.)
//! If you want to give a particular type and signature to your interactive object, you must redefine the two virtual methods: Type and Signature.
//! In the C++ inheritance structure of the package, each class representing a specific Interactive Object inherits AIS_InteractiveObject.
//! Among these inheriting classes, AIS_Relation functions as the abstract mother class for tinheriting classes defining display of specific relational constraints and types of dimension.
//! Some of these include:
//! - display of constraints based on relations of symmetry, tangency, parallelism and concentricity
//! The Datum groups together the construction elements such as lines, circles, points, trihedra,
//! plane trihedra, planes and axes. The Relation is made up of constraints on one or more
//! interactive shapes and the corresponding reference geometry. For example, you might want to
//! constrain two edges in a parallel relation. This constraint is considered as an object in its
//! own right, and is shown as a sensitive primitive. This takes the graphic form of a perpendicular
//! arrow marked with the || symbol and lying between the two edges. The Object type includes
//! topological shapes, and connections between shapes. None, in order not to eliminate the object,
//! tells the application to look further until it finds an object definition in its generation
//! which is accepted. Inside these categories, you have the possibility of an additional
//! characterization by means of a signature. The signature provides an index to the further
//! characterization. By default, the Interactive Object has a None type and a signature of 0
//! (equivalent to None.) If you want to give a particular type and signature to your interactive
//! object, you must redefine the two virtual methods: Type and Signature. In the C++ inheritance
//! structure of the package, each class representing a specific Interactive Object inherits
//! AIS_InteractiveObject. Among these inheriting classes, AIS_Relation functions as the abstract
//! mother class for tinheriting classes defining display of specific relational constraints and
//! types of dimension. Some of these include:
//! - display of constraints based on relations of symmetry, tangency, parallelism and
//! concentricity
//! - display of dimensions for angles, offsets, diameters, radii and chamfers.
//! No viewer can show everything at once with any coherence or clarity.
//! Views must be managed carefully both sequentially and at any given instant.
//! Another function of the view is that of a context to carry out design in.
//! The design changes are applied to the objects in the view and then extended to the underlying reference geometry by a solver.
//! To make sense of this complicated visual data, several display and selection tools are required.
//! To facilitate management, each object and each construction element has a selection priority.
//! There are also means to modify the default priority.
//! To define an environment of dynamic detection, you can use standard filter classes or create your own.
//! A filter questions the owner of the sensitive primitive to determine if it has the desired qualities.
//! If it answers positively, it is kept. If not, it is rejected.
//! The standard filters supplied in AIS include:
//! The design changes are applied to the objects in the view and then extended to the underlying
//! reference geometry by a solver. To make sense of this complicated visual data, several display
//! and selection tools are required. To facilitate management, each object and each construction
//! element has a selection priority. There are also means to modify the default priority. To define
//! an environment of dynamic detection, you can use standard filter classes or create your own. A
//! filter questions the owner of the sensitive primitive to determine if it has the desired
//! qualities. If it answers positively, it is kept. If not, it is rejected. The standard filters
//! supplied in AIS include:
//! - AIS_AttributeFilter
//! - AIS_SignatureFilter
//! - AIS_TypeFilter.
//! A set of functions allows you to choose the interactive objects which you want to act on, the selection modes which you want to activate.
//! An interactive object can have a certain number of graphic attributes which are specific to it, such as visualization mode, color, and material.
//! By the same token, the interactive context has a set of graphic attributes, the Drawer which is valid by default for the objects it controls.
//! When an interactive object is visualized, the required graphic attributes are first taken from the object's own Drawer if one exists, or from the context drawer for the others.
class AIS
//! A set of functions allows you to choose the interactive objects which you want to act on, the
//! selection modes which you want to activate. An interactive object can have a certain number of
//! graphic attributes which are specific to it, such as visualization mode, color, and material. By
//! the same token, the interactive context has a set of graphic attributes, the Drawer which is
//! valid by default for the objects it controls. When an interactive object is visualized, the
//! required graphic attributes are first taken from the object's own Drawer if one exists, or from
//! the context drawer for the others.
class AIS
{
public:

DEFINE_STANDARD_ALLOC

};

#endif // _AIS_HeaderFile
Loading
Loading