Commit Graph

6776 Commits

Author SHA1 Message Date
luzpaz
bd53a03b31 Documentation - Fix whitespace and typos (#805)
- Corrected spelling of "transfert" to "transfer" throughout IGES-related files
- Fixed various grammatical and punctuation errors in comments
- Improved whitespace and formatting in multi-line comments
2025-11-05 13:40:06 +00:00
Pasukhin Dmitry
2cc2bfdd27 Foundation Classes, gp - Add constexpr/noexcept constructors and standard direction enums (#803)
- Addition of `gp_Dir::D` and `gp_Dir2d::D` enums for standard directions (X, Y, Z, NX, NY, NZ)
- Constexpr/noexcept constructors for geometric primitives (circles, cones, cylinders, etc.)
- Enhanced axis placement classes with enum-based constructors
- Replacement of hardcoded direction values throughout the codebase
2025-11-04 16:21:59 +00:00
luzpaz
0763d96209 Documentation - Fix whitespace and typos (#797)
- Normalized spacing in multi-line comments
- Fixed typos in documentation (e.g., "toipological" → "topological", "exist" → "exists")
- Improved comment formatting and alignment
2025-11-04 15:06:11 +00:00
Pasukhin Dmitry
5062c69dc2 Coding - Renew Standard Macro (#792)
- Added `Standard_MACRO_DEPRECATED` macro to mark preprocessor macros as deprecated with compiler-specific warning generation
- Simplified deprecated macros (`Standard_OVERRIDE`, `Standard_DELETE`, `Standard_FALLTHROUGH`, `Standard_NODISCARD`, `Standard_THREADLOCAL`, `Standard_ATOMIC`, `Standard_Noexcept`) to expand directly to their C++11/C++17 equivalents while emitting deprecation warnings
- Removed complex conditional compilation logic that checked for compiler/standard support
2025-11-04 13:48:05 +00:00
Pasukhin Dmitry
f923370c82 Foundation Classes - Modernize NCollection_SparseArrayBase memory handling and style (#804)
- Replace malloc/calloc/free with Standard::AllocateOptimal/Standard::Free for OCCT-consistent memory management
- Modernize constructor declarations and use nullptr instead of 0 for null pointers
- Replace custom swap implementation with std::swap and add noexcept specifications
2025-11-04 10:55:54 +00:00
Pasukhin Dmitry
f0f1578853 Foundation Classes - Rework AddValuesSeparator logic for JSon dump (#748)
- Introduces position and dynamic_cast based logic in AddValuesSeparator to decide when to append ", ".
- Adds new GTest suite Standard_Dump_Test.cxx plus an extra Bnd_Box JSON test in TKMath.
- Updates FILES.cmake to include the new test file.
2025-11-03 16:45:26 +00:00
Pasukhin Dmitry
787bee375c Coding - Replace Standard_Mutex with std::mutex and migrate to RAII locks (#766)
- Replace legacy Standard_Mutex usage across many modules with std::mutex.
- Include <mutex> where needed and remove <Standard_Mutex.hxx> includes.
- Replace Standard_Mutex::Sentry / explicit Lock/Unlock with std::lock_guard or std::unique_lock.
- Convert optional/heap mutex holders to std::unique_ptr<std::mutex> and adapt locking accordingly.
- Simplify several singleton initializations (remove manual double-checked locking where safe).
- Use thread_local for per-thread flags instead of ad-hoc mutex protection.
- Fix BVH_BuildQueue Fetch logic to preserve thread counters and wasBusy handling.
- Remove obsolete TopTools_MutexForShapeProvider sources and update FILES.cmake.

This modernizes mutex usage, reduces dependency on custom mutex types and improves clarity of locking patterns.
2025-11-03 16:44:08 +00:00
Pasukhin Dmitry
d98f74d893 Foundation Classes, gp - Mark geometry APIs noexcept/constexpr (#798)
- Add noexcept to many small mutating and non-throwing methods (Mirror, Mirrored, SetMirror, SetTranslationPart, etc.) across gp classes.
- Annotate trivial getters, translators and small computations as constexpr where applicable (SetLocation/SetPosition, Area/Length/Radius/Volume, Axis/Location/Position accessors, Translate helpers).
- Update headers and source files to improve noexcept/constexpr conformance for gp geometry and math types, enabling better optimization and stronger exception-safety guarantees.
2025-11-03 10:19:05 +00:00
Pasukhin Dmitry
ddffad0a65 Foundation Classes, gp - Mark 2D geometry APIs noexcept/constexpr (#796)
- Added `noexcept` to transformation and mirroring methods across all 2D geometry classes
- Added `constexpr` to trivial getters, setters, and simple computational methods where applicable
- Removed an unused variable declaration in GeomInt_IntSS_1.cxx
2025-11-02 21:02:53 +00:00
Pasukhin Dmitry
6c32db17c1 Foundation Classes - remove PLib_Base and migrate to concrete polynomial types (#795)
- Delete PLib_Base.hxx / PLib_Base.cxx and remove from PLib/FILES.cmake.
- Convert PLib_JacobiPolynomial and PLib_HermitJacobi from polymorphic Handle-based types to direct value types:
  - Remove inheritance from PLib_Base and RTTI macros.
  - Replace DEFINE_STANDARD_HANDLE / Handle usage with plain objects/members.
  - Make internal PLib_JacobiPolynomial member const where appropriate.
- Make basis evaluation methods const (D0/D1/D2/D3 and internal D0123) and mark trivial accessors noexcept:
  - WorkDegree() and NivConstr() now noexcept.
  - Update signatures (const correctness) across implementation and headers.
- Update all call sites to new API and value semantics:
  - Tests: PLib_HermitJacobi_Test.cxx, PLib_JacobiPolynomial_Test.cxx updated to construct objects by value and call methods without '->'.
  - Modeling/approximation & FEM code: AdvApprox_ApproxAFunction, AdvApprox_SimpleApprox, AppDef_LinearCriteria, AppDef_Variational, FEmTool_Curve, FEmTool_ElementsOfRefMatrix, FEmTool_LinearFlexion/Jerk/Tension and related headers updated to accept/use PLib_HermitJacobi by reference/value and call new methods.
  - Replace Handle(...) constructions with stack/local objects and adapt calls (ToCoefficients, ReduceDegree, MaxError, AverageError, Points, Weights, etc.).
- Miscellaneous API adjustments to match new declarations (removed Standard_OVERRIDE annotations where not applicable).
- Keep behavior unchanged; this is an API/implementation refactor to remove legacy polymorphic base and improve const-correctness and performance.
2025-11-02 15:53:23 +00:00
luzpaz
9d27a67a46 Documentation - Fix whitespace and typos (#794)
- Fixed capitalization of comment opening words to follow standard documentation conventions
- Reformatted multi-line comments to improve readability by reducing excessive line breaks
- Corrected a typo in parameter description
2025-11-02 13:25:26 +00:00
Pasukhin Dmitry
f170de5042 Foundation Classes - Refactor PLib_HermitJacobi implementation (#780)
- Remove separate PLib_HermitJacobi.lxx and stop installing it in FILES.cmake.
- Move Hermite matrices and W coefficients into the .cxx translation unit (anonymous namespace) as constexpr/static helpers.
- Replace Handle(PLib_JacobiPolynomial) with a value member; forward WorkDegree() and NivConstr() inline to myJacobi.
- Update ToCoefficients, D0123 and related methods to use the new helper functions and value-style myJacobi API.
- Remove myH and myWCoeff members and adapt matrix/coeff access accordingly.
- Minor naming/variable adjustments for clarity (NivConstr/WorkDegree -> aNivConstr/aWorkDegree).
2025-11-02 11:41:42 +00:00
Pasukhin Dmitry
7e9b74cc31 Foundation Classes - Precompute Jacobi coefficients (#778)
- Add PLib_JacobiPolynomial_Coeffs.pxx with large constexpr tables and a JacobiCoefficientsCache + GetJacobiCoefficients() fast lookup to serve precomputed TNorm/CofA/CofB/Denom arrays for all constraint levels and degrees.
- Replace several runtime-initialized per-instance arrays/handles with zero-overhead constexpr data; remove myTNorm/myCofA/myCofB/myDenom handles from the class.
- Modernize PLib_JacobiPolynomial implementation:
  - Use constructor initializer list and validate inputs there.
  - Use constexpr lookup tables for weights/transforms and memcpy/std::fill_n to speed copying into TColStd arrays.
  - Replace switch-based pointer selection with indexed arrays for cleaner selection of DB pointers.
  - Simplify numerical loops, make offsets/indices const where possible and use clearer variable names.
  - Use GetJacobiCoefficients() in D0123 (and callers) to remove on-demand initialization and reduce per-call overhead.
- Change static data types to constexpr double for stronger optimization and clearer intent.
- Various micro-optimizations and safety fixes (avoid NULL, tighten const correctness) to improve performance and reduce runtime allocations.
2025-11-02 11:22:34 +00:00
Pasukhin Dmitry
b30cee0125 Foundation Classes, gp - Mark core types and methods constexpr/noexcept (#790)
Make gp basic types and operations more constexpr-friendly and noexcept:
- Mark gp::Resolution as constexpr.
- Add constexpr and/or noexcept to many constructors and small access/modifier methods.
- Convert several functions to constexpr where safe to allow compile-time evaluation.
- Initialize members via initializer lists for several GTrsf/GTrsf2d/Mat/etc constructors.
- Add noexcept to transformation/serialization helpers and small utilities where appropriate.

This enables better compile-time optimizations and safer noexcept semantics across TKMath gp primitives.
2025-11-02 00:52:32 +00:00
Pasukhin Dmitry
962a456f9b Foundation Classes, Strings - add EmptyString() for Ascii/Extended and use it everywhere (#788)
Introduce TCollection_AsciiString::EmptyString() and TCollection_ExtendedString::EmptyString()
  and update headers.
Replace many local/static empty string instances and default-constructed
  temporaries with the shared EmptyString() reference across ApplicationFramework, DataExchange,
  Visualization and other modules.
Remove several unused local empty-key/static variables and
  adjust default parameters and return paths to use the centralized empty-string accessors.
Add missing #include <TCollection_AsciiString.hxx> to several headers that use/forward TCollection_AsciiString.
2025-11-01 22:39:12 +00:00
Pasukhin Dmitry
a575926c2d Foundation Classes, NCollection - Modernize code, add noexcept/constexpr (#793)
- Mark many methods and operators noexcept (iterators, containers, allocators, maps, lists, buffers, UTF/string utilities, etc.)
- Add constexpr to suitable functions and factory methods (matrices, vectors, static sizes) to enable compile-time usage
- Replace non-constexpr memcpy usages in NCollection_Mat3/NCollection_Mat4 with constexpr-friendly initialization and promote static arrays to constexpr
- Make several small API improvements: stronger const-correctness, noexcept on allocation/deallocation operators, delete forbidden copy ctors/assign where appropriate
- Remove obsolete NCollection_TypeDef.hxx and update FILES.cmake
- Miscellaneous small refactors to support modern C++ patterns and better compile-time guarantees
2025-11-01 21:38:48 +00:00
Pasukhin Dmitry
b04257c256 Foundation Classes - Move to constexpr Pascal allocator for PLib::Bin (#777)
- Converts `BSplCLib::MaxDegree()` to a constexpr function to enable compile-time evaluation
- Replaces the dynamically allocated `BinomAllocator` with a template-based constexpr Pascal's triangle that is computed at compile time
2025-11-01 19:56:04 +00:00
Pasukhin Dmitry
fe2f7bc983 Configuration, gitignore - Ignore all at root except explicit allowlist (#787)
Add single-level rules to ignore everything at the repository root while whitelisting
essential config files and directories. Explicitly allow selected data subdirectories
and top-level src modules, and preserve deeper-level ignore rules.
2025-11-01 19:52:20 +00:00
Pasukhin Dmitry
426242306d Data Exchange, STEP - Refactor StepType selection (#786)
- Removed static `lastvalue` variable and mutex-based synchronization, replacing them with a mutable member field `theLastValue`
- Restructured logic with early returns to reduce nesting and improve readability
- Updated variable naming to follow OCCT conventions (e.g., `module` → `aModule`, `CN` → `aCN`)
2025-11-01 17:42:53 +00:00
Pasukhin Dmitry
c88c05399f Coding - Introduce compile-time sqrt constants and use them consistently (#789)
- Add M_SQRT2 macro in multiple sources and replace runtime sqrt/Sqrt(2) calls with the macro
- Add SQRT_3 constexpr in IGESGraph_Color and Bnd_OBB and replace Sqrt(3) usages
- Make BSplSLib_zero a constexpr array
- Replace a few computed sqrt literals with compile-time constants for clarity and consistency
2025-11-01 13:57:11 +00:00
ikochetkova
c640cafb8b Data Exchange, Step Import - Add import of coordinate system connection points for dimensions (#779)
Add possibility to retrieve and save the whole coordinate system as a connection point for dimensions.
Refactor reading of connection points from STEP.
Refactor Set and Get methods of Dimension XCAF object.
Add new exporting data to the test method XDumpDGTs and update the test cases respectively.
2025-10-31 10:45:32 +00:00
Pasukhin Dmitry
96d91cb765 Coding - Create a C++17 version macro (#785)
- Updated preprocessor directives to utilize Standard_CPP17_OR_HIGHER instead of direct __cplusplus checks.
- Removed unnecessary preprocessor checks for C++17 in TCollection_AsciiString implementation and tests.
- Enhanced code readability and maintainability by centralizing C++ version checks.
2025-10-31 08:45:06 +00:00
Pasukhin Dmitry
bc1b021e86 Foundation Classes - Remove PLib_DoubleJacobiPolynomial implementation and tests (#781)
Delete PLib_DoubleJacobiPolynomial sources (cxx/hxx/lxx), remove associated Google Test (PLib_DoubleJacobiPolynomial_Test.cxx)
and update FILES.cmake entries in TKMath/PLib and TKMath/GTests to stop building the removed files.
2025-10-30 17:23:13 +00:00
Pasukhin Dmitry
f4c2224d86 Testing - Use newer Inspector commit (#776)
Update TInpector with QT6 update and C++ version upgrade.
2025-10-29 19:06:47 +00:00
luzpaz
ae33c4ef42 Documentation - Fix whitespace and typos (#772)
- Corrected spelling errors (e.g., "aera" → "area", "nithing" → "nothing")
- Normalized excessive whitespace in comments for better readability
- Standardized comment formatting while preserving technical content
2025-10-29 17:57:19 +00:00
Pasukhin Dmitry
cd3fc87130 Coding, PerfMeter - Use NCollection_DataMap and TCollection_AsciiString (#774)
- Replace std::unordered_map<std::string, Stopwatch> with NCollection_DataMap<TCollection_AsciiString, Stopwatch>
- Update all method signatures to use TCollection_AsciiString instead of std::string
- Replace STL map operations with OCCT equivalents (Bind/Seek/ChangeSeek/IsBound/UnBind/Clear)
2025-10-29 08:48:47 +00:00
luzpaz
44110e06b9 Documentation - Fix various typos and comment uniformity (#771)
- Corrected parameter name from `tehNbIterations` to `theNbIterations` in constructor declaration
2025-10-28 13:49:33 +00:00
luzpaz
719ed090cb Documentation - Fix whitespace uniformity (#770)
- Standardized spacing in documentation comments by removing extra spaces between words
- Fixed inconsistent line breaks in multi-line comment blocks  
- Corrected minor spelling/grammar issues (e.g., "follow" → "follows", "form" → "from")
2025-10-28 08:26:46 +00:00
Pasukhin Dmitry
8da5219913 Shape Healing - Regression after #584 (#769)
Second iteration of fixing regressions.
Fixed issue with loops and incorrect shell created.
#584 affected some tests which were not updated on time.
Now all test cases are passed.
2025-10-27 21:27:16 +00:00
Pasukhin Dmitry
07c8845fc8 Revert "Data Exchange - Step supplemental geometry support (#744)" (#768)
This reverts commit 4ca8112dab.
2025-10-27 19:18:53 +00:00
luzpaz
859d1d6f6c Documentation - Fix various typos and comment uniformity (#767)
Fixes user-facing and non-user-facing typos.  
Also removes code comment justification and optimizes whitespace.
2025-10-27 10:42:17 +00:00
Pasukhin Dmitry
190c90c856 Configuration - Validate the configuration on CMake 3.10 and later (#762)
- adm/cmake/gtest.cmake: check CMake version before using FetchContent; emit a warning and skip FetchContent-based GoogleTest setup when CMake < 3.11.
- adm/cmake/occt_macros.cmake: wrap list(REMOVE_DUPLICATES ...) calls in if() checks to avoid operating on empty/unset variables.
2025-10-25 15:49:04 +01:00
Pasukhin Dmitry
7d89343b9b Application Framework - Early-return null NamedShape when TNaming_UsedShapes is missing (#760)
Check Acces.Root().FindAttribute(...) result in TNaming_Tool::NamedShape and return an empty Handle
if the TNaming_UsedShapes attribute is not found to avoid using an uninitialized map.
2025-10-24 09:11:48 +01:00
Pasukhin Dmitry
c57f5e7647 Data Exchange, STEP - Replace String typedef and global temp buffers in StepData_StepReaderData (#756)
- Remove typedef TCollection_HAsciiString String and global statics (txtmes, initstr, subl)
- Use explicit string for message handles and function-local char txtmes buffers, drop constructor initstr logic, and update error/warning formatting.
- Reduce global mutable state and clarify message handling.
2025-10-22 18:03:50 +01:00
Pasukhin Dmitry
a6e4f8e20a Foundation, Testing - Use computational basis size for arrays in PLib_JacobiPolynomial tests (#755)
Allocate TColStd_Array1OfReal using aDegree = WorkDegree - 2*(NivConstr()+1) in BasisFunctionD0, BasisFunctionDerivatives and StressTests so array sizes match the actual number of basis functions and avoid sizing mismatches.
2025-10-22 16:42:45 +01:00
Pasukhin Dmitry
3b67b4b5da Foundation Classes - Optimize AsciiString with pre-defined string (#752)
- Rename internal members mystring/mylength -> myString/myLength across AsciiString
  implementation and related files to improve naming consistency.
- Add std::string_view support and efficient overloads:
  - constructor from string_view, AssignCat/Copy/Insert/SetValue from string_view
  - Cat, operators (+, +=) and comparison helpers accepting string_view
  - Token/StartsWith/EndsWith/Search helpers and literal-template overloads
  - operator std::string_view() to obtain a non-owning view
  - IsEqual/IsSameString/IsDifferent variants for string_view/C-string combinations
  - optimized literal templates to avoid runtime strlen for compile-time literals
- Improve memory handling and allocation helpers (allocate/reallocate/deallocate)
  and keep padding strategy consistent.
- Add Insert/AssignCat implementations that accept string_view and use memmove/memcpy.
- Fix calls in HAsciiString to use direct method instead of members
- Adjust misc. parameter names and small code-style/clarity improvements.

These changes enable zero-copy interop with std::string_view, reduce redundant C-string
operations for literals, and unify internal naming for maintainability.
2025-10-22 12:39:48 +01:00
Dmitrii Kulikov
4ca8112dab Data Exchange - Step supplemental geometry support (#744)
- Added three new GUIDs to identify supplemental geometry containers, references, and individual supplemental geometry items in the XCAF document structure
- Implemented logic to extract and convert STEP geometric items (curves and surfaces) into TopoDS shapes when they are referenced by PMI but not present in the main model
- Refactored duplicate code for finding PMI reference positions and geometry into reusable functions
2025-10-22 11:21:13 +01:00
Pasukhin Dmitry
1c0bb24479 Shape Healing - Regression after #584 (#753)
Fixed issue with unstable shape order after fixing.
Fixed reference data which was changed
2025-10-21 11:14:33 +01:00
Dmitrii Kulikov
de1fcc2018 Mesh - Import of STEP file crashes at the very end when visualizing the boundary curves (#745)
When an edge (BRepMeshData_Edge) has multiple PCurve curves (IMeshData_PCurve) with different orientations, the index array is filled for only one PCurve curve.
This would cause problems later, so a fix was made to fill index arrays for curves with another orientation.
2025-10-16 18:46:10 +01:00
Pasukhin Dmitry
f4741d647f Coding - Checking for copyright notice (#749)
Created a new CI step to validate the presence of a copyright notice in each source file.
Updated existed files to include the copyright notice.
2025-10-16 18:39:56 +01:00
Pasukhin Dmitry
184fb9bf56 Visualization - Unexpected moving with AIS_ViewCube (#727)
- Removes Euler angle storage and calculations that caused rotation instabilities
- Replaces complex coordinate transformations with direct camera vector manipulation
- Implements quaternion-based rotation logic using stored camera direction and up vectors
2025-10-16 14:13:50 +01:00
Dmitrii Kulikov
d54a7e0786 Modelling - Crash in BRepFilletAPI_MakeChamfer (#743)
- Refactored helper functions with clearer naming and improved parameter handling
- Added null safety checks to prevent crashes when edge lookup fails in face topology
- Removed debug code and simplified variable declarations for better maintainability
2025-10-16 08:54:40 +01:00
Pasukhin Dmitry
87c50319c7 Shape Healing - Optimize FixFaceOrientation (#584)
Refactor shell construction algorithm for improved performance:
- Add GetConnectedFaceGroups function using DFS to identify topologically 
  connected face groups before shell construction
- Replace O(nˆ3) iterations with pre-built connectivity maps (FaceEdgesMap, 
  EdgeFacesMap) using STL unordered_map with custom allocators for O(1) lookup.
- Process only the largest connected component first, significantly reducing 
  time complexity for large face sets
2025-10-11 12:19:50 +01:00
Gordan Segon
a042bed175 Coding - Add RTTI support for TFunction_Logbook class (#741)
- Added RTTI macro declarations and implementations for TFunction_Logbook
- Improved type identification for debugging and error reporting
2025-10-10 13:07:03 +01:00
Dmitrii Kulikov
df7e26c79d Modeling - Crash in BRepOffsetAPI_MakePipeShell (#740)
Performed a basic refactoring of BRepFill_SectionPlacement::Perform()
  and fixed a crash.
2025-10-09 18:37:51 +01:00
Pasukhin Dmitry
0476fd3936 Testing - Add ShapeAnalysis_CanonicalRecognition unit tests (#720)
- Implements 20+ test cases covering curve recognition (line, circle, ellipse) and surface recognition (plane, cylinder, cone, sphere)
- Tests both simple canonical shapes and complex multi-segment/sewn geometry scenarios
- Includes error handling tests for invalid/null shapes
2025-10-09 11:27:04 +01:00
Pasukhin Dmitry
775454b75a Coding - Remove duplicate and self-referencing include directives (#739)
- Removal of self-referencing includes where files include themselves
- Elimination of duplicate include statements within the same file
- Cleanup of redundant includes in conditional compilation blocks
- Adding CI validation for validation PRs
2025-10-08 20:31:35 +01:00
Pasukhin Dmitry
76b05809d0 Testing - Cover Boolean operation with GTests (#721)
- Added systematic Boolean operation test coverage using Google Test framework
- Implemented test utilities for shape creation, transformation, and validation
- Migrated existing Draw-based Boolean tests to C++ GTests for better automation
2025-10-08 11:50:42 +01:00
Rodrigo Brayner Lyra
b295b40387 Visualization - Fix method to transform AABB (#735)
Replace the incorrect implementation of Axis Aligned Bounding Boxes transformation to Jim Arvo's efficient AABB transformation algorithm described in his chapter in the Graphics Gems (1990) book.

The algorithm simplifies the number of operations necessary to transform the AABB. Instead of transforming the eight vertices of the original AABB, and then computing the bounding box of the transformed vertices, Arvo's algorithm works by forming both products for each component of the min and max point, and summing the smallest/largest terms, we arrive at the minimal/maximal value.
2025-10-07 20:19:11 +01:00
Dmitrii Kulikov
6b431882bc Modeling - Segfault on chamfer or fillet approaching ellipse (#738)
Fixed nullptr dereference
2025-10-07 20:15:37 +01:00