Commit Graph

111 Commits

Author SHA1 Message Date
Pasukhin Dmitry
c020fc2fad Coding - Clang-Tidy apply with refactoring (#965)
- Replacing empty constructor/destructor implementations with `= default`
- Removing redundant `virtual` keywords from override methods
- Replacing `NULL` and `0` with `nullptr`
- Replacing C headers with C++ equivalents (`<cstdio>`, `<cstring>`, etc.)
- Marking copy constructors/assignment operators as `= delete` for non-copyable classes
- Converting `void` parameter lists to empty parameter lists
- Replacing integer literals with appropriate boolean values
2025-12-29 11:55:04 +00:00
Pasukhin Dmitry
14d4e91171 Coding - Global Refactoring OCCT as a part of 8.0.0 (#955)
- Added automated migration scripts for handle syntax, standard types, and macros
- Deprecated legacy `Standard_*` types and macros in favor of native C++ equivalents
- Introduced modern `occ` namespace with template-based type checking helpers
- Enhanced NCollection macros to support variadic arguments for complex template types- Added automated migration scripts for handle syntax, standard types, and macros
- Deprecated legacy `Standard_*` types and macros in favor of native C++ equivalents
- Introduced modern `occ` namespace with template-based type checking helpers
- Enhanced NCollection macros to support variadic arguments for complex template types
2025-12-28 14:38:06 +00:00
Pasukhin Dmitry
b5d2fc73fb Coding - Refactor HArray and HSequence Definitions (#962)
- Replaced custom DEFINE_HARRAY1 and DEFINE_HSEQUENCE macros with typedefs to NCollection_HArray1 and NCollection_HSequence for various data types across multiple files.
- Updated header files in the following modules:
  - HLRAlgo
  - TKShHealing
  - TKBRep
  - TKG2d
  - TKG3d
  - TKGeomBase
  - TKMeshVS
  - TKV3d
- This change improves consistency and reduces the complexity of the codebase by utilizing the standard NCollection templates.
2025-12-28 11:42:24 +00:00
Pasukhin Dmitry
5c63727727 Modeling - Optimize Bnd_BoundSortBox (#958)
Replaced std::vector with NCollection_Vector and std::unordered_map with NCollection_Array1 to use OCCT's native collection classes.
Avoid hashing to use array of elements with index directly.
Remove bit maps for storing the filling status and use the direct checking for emptiness.
Optimise allocations by using IncAllocator for all NCollection_Vector objects.
2025-12-26 09:39:11 +00:00
Pasukhin Dmitry
c3da25d597 Modeling - Implementation for math_Vector Resize functionality (#957)
math_VectorBase can be used with both stack and heap storage and resized when needed.
This is not often required, but when it is, the Resize method allows to do it efficiently,
  preserving existing data and optimizing memory usage.
2025-12-26 00:25:05 +00:00
Pasukhin Dmitry
0b9a5e0aab Foundation Classes - Optimize PLib polynomial evaluation (#953)
- Replaced `memcpy`/`memset` calls with direct initialization loops to enable register allocation for small dimensions (1-15)
- Introduced local stack arrays that reduce memory round-trips by writing to output only at the end of computation
- Fused derivative and value update loops to minimize redundant memory reads
2025-12-25 22:56:22 +00:00
Pasukhin Dmitry
e7d1148e8f Foundation Classes - Enhance MathRoot and MathSys with new utilities (#954)
- Added comprehensive testing infrastructure for trigonometric root finding with multiple edge cases
- Introduced optimized 2D Newton solver with gradient descent fallback and bounds checking
- Created domain management utilities for 1D/2D parameter spaces
- Fixed critical bugs in trigonometric root finding algorithm
2025-12-25 21:21:59 +00:00
Pasukhin Dmitry
0ad3a1a297 Foundation Classes - Modernize TKMath with new packages (#944)
- Added six new packages: MathUtils, MathPoly, MathLin, MathOpt, MathRoot, MathSys, and MathInteg
- Implemented modern template-based algorithms with consistent result structures and error handling
- Added comprehensive test files for all new packages
2025-12-22 16:52:23 +00:00
Pasukhin Dmitry
a425c6882a Foundation Classes - Improve BVH Box and Rays (#882)
- Refactored Add method in BVH_Box to utilize in-place component-wise operations, reducing temporary vector creation.
- Introduced precomputed reciprocal direction in BVH_Ray for faster ray-box intersection tests.
- Updated RayBoxIntersection methods to leverage the new reciprocal direction for optimal performance.
- Enhanced documentation for clarity on new functionalities and optimizations.
2025-12-22 16:51:46 +00:00
Pasukhin Dmitry
8a2df59d6c Coding - Add constexpr compatibility to more gp classes (#933)
- Added constexpr to constructors and methods in both classes, with special handling for already-normalized inputs
- Refactored coordinate access methods to avoid pointer arithmetic (incompatible with constexpr)
- Implemented a dual-path approach: fast path for normalized inputs (constexpr-compatible) and slow path for runtime normalization
2025-12-19 16:12:21 +00:00
Pasukhin Dmitry
e417b0c408 Foundation Classes - Refactor math_DirectPolynomialRoots (#937)
Modernized and refactored the polynomial root-finding implementation
with improved numerical stability and modern C++ practices.

Key changes:

1. Implementation refactoring (math_DirectPolynomialRoots.cxx):
   - Extracted helper functions into anonymous namespace for better encapsulation
   - Introduced ScaledCoefficients struct for coefficient scaling operations
   - Added separate functions for cubic root cases (three real, one real, multiple)
   - Replaced deprecated OCCT math functions with std:: equivalents
     (std::abs, std::sqrt, std::pow, std::log, std::cos, std::sin, std::atan, std::max)
   - Improved code documentation with algorithm references

2. Header modernization (math_DirectPolynomialRoots.hxx):
   - Added comprehensive Doxygen documentation for all public methods
   - Renamed private members to follow OCCT conventions (myDone, myRoots, etc.)
   - Moved inline implementations from .lxx file directly into header
   - Removed math_DirectPolynomialRoots.lxx file (merged into .hxx)

3. Test improvements:
   - Added test fixture class for math_DirectPolynomialRoots with helper methods
   - Extended test coverage with numerical stability tests
   - Added regression tests for problematic quartic cases
   - Added Geom2dGcc_Circ2d3Tan tests for BUC60622 regression case

4. Minor fixes:
   - Removed unused #include <iostream> from test file
   - Updated FILES.cmake to remove deleted .lxx file
   - Fixed test case expected values in bug28626_2
2025-12-19 16:07:59 +00:00
Pasukhin Dmitry
1d8add2970 Coding - Translate French comments and modernize constants (#932)
This commit performs safe code cleanup across multiple modules:

1. French to English comment translations:
   - ApplicationFramework: TNaming, TDF, TDataStd packages
   - ModelingAlgorithms: BRepFill, TopOpeBRepBuild, TopOpeBRepTool,
     NLPlate, FairCurve, IntSurf, Contap, ShapeFix, MAT2d, LocOpe
   - ModelingData: ProjLib, GeomLib, GeomConvert, IntAna, AppDef,
     GCPnts, Hermit, BinTools, LProp
   - Visualization: PrsDim, AIS, V3d packages

2. Constexpr modernization:
   - Convert static const variables to constexpr
   - Replace #define macros with constexpr variables
   - Add anonymous namespaces for internal constants
   - Affected files: V3d_View, V3d_CircularGrid, V3d_RectangularGrid,
     Graphic3d_FrameStats, PrsDim_*, Convert_*ToBSplineSurface,
     math_BrentMinimum, and others

3. Code organization:
   - Wrap file-scope constants in anonymous namespaces
   - Use consistent naming convention (THE_* prefix)

No functional changes - all modifications are comment-only or
compile-time constant improvements that preserve identical runtime
behavior.
2025-12-17 10:23:13 +00:00
Pasukhin Dmitry
bd3ce7be7c Coding - Implement move semantics and default constructor for CSLib_Class2d (#919)
- Added a default constructor to CSLib_Class2d for creating empty classifiers.
- Implemented move constructor and move assignment operator to optimize resource management.
- Updated IntTools_FClass2d and BRepTopAdaptor_FClass2d to utilize the new move semantics, eliminating unnecessary dynamic memory allocations.
- Replaced deprecated pointer-based storage with NCollection_Sequence for better memory management.
- Removed the obsolete BRepTopAdaptor_SeqOfPtr class to streamline the codebase.
2025-12-16 13:18:42 +00:00
Andrej730
be9b447204 Foundation Classes - Remove redundant pragma lib comment in OSD_Host.cxx (#902) 2025-12-15 16:57:10 +00:00
Pasukhin Dmitry
e5888e6d19 Modeing - BSpline Cache Optimised calls for Local (#906)
- Added `D0Local`, `D1Local`, `D2Local`, `D3Local` methods to `BSplCLib_Cache` and `BSplSLib_Cache` classes
- Added accessor methods to `Geom_BSplineCurve` and `Geom_BSplineSurface` for direct handle access to internal arrays
- Comprehensive test coverage for both curve and surface cache implementations
2025-12-12 20:11:29 +00:00
Pasukhin Dmitry
2919e1baa1 Foundation Classes - Optimize BSpline data containers with constexpr and validation (#897)
Refactored BSplSLib_DataContainer and BSplCLib_DataContainer_T structs:
  - Use compile-time constexpr THE_MAX_DEGREE for array sizes
  - Remove constructors with runtime initialization overhead
  - Add standalone validateBSplineDegree() functions for degree checks
  - Eliminate unnecessary zero-initialization of stack buffers
  - Replace Standard_Real/Standard_Integer with native double/int types

  This improves performance by avoiding runtime memset of large arrays
  (~2800 doubles for surfaces, ~200 for curves) on every B-spline evaluation.
2025-12-08 19:57:34 +00:00
Pasukhin Dmitry
aa655079ad Foundation Classes - Refactor CSLib package and add GTests (#857)
- Updated CSLib_Class2d to enhance documentation and improve parameter types for constructors.
- Refined point classification methods with clearer return types and improved comments.
- Modified CSLib_DerivativeStatus to clarify the status of surface derivatives computation.
- Enhanced CSLib_NormalPolyDef for better readability and efficiency in polynomial evaluations.
- Updated CSLib_NormalStatus to provide clearer descriptions of normal computation statuses.
- Updated point classification methods to return clearer result types.
- Enhanced input validation and array management for polygon vertices.
- Improved documentation for methods and parameters.
- Refactored internal methods for consistency and readability.
2025-12-06 00:34:49 +00:00
Pasukhin Dmitry
c770a1a7f7 Coding - Fixing analyzer reports (#885)
- Replaced manual absolute value logic (conditional negation) with `std::abs` for clarity
- Added `const` qualifiers to variables that are not modified after initialization
- Moved variable declarations closer to their first use and removed unused variable assignments
2025-12-05 21:20:08 +00:00
dpasukhi
985c3992f8 Revert "Foundation Classes - TopLoc package update (#849)"
This reverts commit a6e68c7e70.
2025-12-02 21:36:52 +00:00
Pasukhin Dmitry
59907db19d Foundation Classes - Remove [[nodiscard]] attribute from Deprecated Method (#865) 2025-11-30 09:08:58 +00:00
Pasukhin Dmitry
a91a0d189a Modeling - Fix out-of-range access in BSplCLib_Reverse function (#863)
- Added a conditional check `if (aL < aUpper)` to prevent accessing array elements beyond bounds when `aL` equals or exceeds `aUpper`
2025-11-29 21:54:09 +00:00
Pasukhin Dmitry
1663c65625 Foundation Classes - Refactor BVH_Box to use generic vector types and add transformation tests (#858)
- Replaced `Graphic3d_Vec3d` and `Graphic3d_Vec4d` with generic `BVH_VecNt` and `BVH::VectorType<T, 4>::Type`
- Changed `Standard_Integer` and `Standard_Real` to template type `T` and `int` for generic implementation
- Added comprehensive test coverage for float-precision transformations
2025-11-26 21:15:01 +00:00
Pasukhin Dmitry
652b07f92c Foundation Classes - Enhance B-Spline Curve Computation (#855)
- Introduces `BSplCLib_KnotArrays` template for efficient stack-based knot/multiplicity management
- Refactors `BSplCLib_Reverse` to use `std::reverse` for improved performance
- Replaces heap-allocated arrays with stack-based `NCollection_LocalArray` in critical code paths
- Modernizes copy constructor/assignment operator prevention using `= delete`
2025-11-26 16:43:09 +00:00
Pasukhin Dmitry
8a37fbd49f Foundation Classes - Enhance BVH Implementation (#842)
- Fixed leaf node size condition and SAH cost evaluation in `BVH_SweepPlaneBuilder`
- Added `constexpr` to `BVH_Box`, `BVH_Types`, and helper functions for compile-time evaluation
- Introduced 13 new comprehensive test files covering BVH components
- Removed unused `BVH_BuildQueue.cxx` file
- Added internal helper structures to `BVH_Traverse` classes
2025-11-26 10:38:42 +00:00
Pasukhin Dmitry
c5120a28c8 Foundation Classes - Optimize and fix Bnd package (#839)
- Fixed multiple bugs including uninitialized variables (zmin/zmax in IsOut(gp_Lin)), incorrect type usage (Standard_Integer → Standard_Boolean), and improper gap handling
- Optimized performance-critical methods through branchless operations, early exits, and cached computations
- Modernized codebase with C++17 features including constexpr constructors, noexcept specifications, and [[nodiscard]] attributes
- Refactor Bnd_Box and Bnd_Box2d classes to introduce GetXMin, GetXMax, GetYMin, GetYMax, and GetZMin,
  GetZMax methods for improved clarity and encapsulation.
- Add Limits struct to represent box limits in both classes.
2025-11-25 19:29:53 +00:00
Pasukhin Dmitry
a6e68c7e70 Foundation Classes - TopLoc package update (#849)
- Performance optimizations including binary exponentiation for `Powered()`, optimized hash code computation, and fast-path optimizations for common operations
- Code modernization with `noexcept` qualifiers, `constexpr` for compile-time constants, and inline wrapper methods
2025-11-25 16:07:49 +00:00
Pasukhin Dmitry
6730c842bd Foundation Classes - Implement move semantics for math_Matrix and math_Vector (#841)
- Added move constructors and move assignment operators to `math_VectorBase`, `math_Matrix`, and `math_DoubleTab`
- Optimized move operations to avoid unnecessary copying when dimensions match and both objects use heap allocation
- Added comprehensive test coverage for move semantics with both heap-allocated (large) and buffer-allocated (small) objects
2025-11-24 11:14:19 +00:00
Pasukhin Dmitry
845e75e598 Foundation classes - Formatting fixes for deprecated (#851)
- Removed empty lines following `Standard_DEPRECATED` macro declarations to improve code consistency
- Removed `[[nodiscard]]` attributes from deprecated functions in Standard_Real, Standard_ShortReal, and Standard_Integer headers to resolve compiler compatibility issues
- Updated the clang-format-check action's regex pattern to better handle `Standard_DEPRECATED` macro variations
2025-11-23 20:52:02 +00:00
Pasukhin Dmitry
851ac10c12 Foundation Classes - Modernize Bnd_B2 and Bnd_B3 (#838)
- Replace C-style arrays with std::array for internal storage (myCenter and myHSize fields)
  - Add constexpr noexcept constructors for all variants (default, gp_XY/gp_XYZ, and std::array overloads)
  - Add public getter methods Center() and HSize() for direct read access to internal fields
  - Add setter overloads accepting std::array parameters
  - Mark appropriate methods as constexpr and noexcept for compile-time evaluation and optimization guarantees
  - Clean up boolean comparisons (remove explicit Standard_True/False checks)
2025-11-19 11:34:04 +00:00
Dmitrii Kulikov
c479f6e000 Coding - Rework of Math global functions to stl (#833)
Majority of functions now simply call same functions from std namespace.
Functions that duplicate std namespace functionality are declared
deprecated.
Calls of deprecated functions are replaced with std functions calls.
2025-11-17 14:20:24 +00:00
Kirill Gavrilov
1a246afa2e Modeling, BSplineCache - Improve parameter validation logic #829
- Enhanced the parameter validation logic in BSplCLib_CacheParams to ensure correct handling of edge cases.
- Added checks for floating point precision when determining if the next knot should be used.
- Improved code readability by restructuring the return conditions.
2025-11-17 11:14:05 +00:00
Pasukhin Dmitry
c2375c78a6 Foundation Classes - Optimize Quantity package (#834)
- Converted validation macros to inline functions for better type safety
- Added `noexcept` specifiers to non-throwing functions for compiler optimization opportunities
- Added `constexpr` to compile-time evaluable functions (comparison operators, leap year calculation)
- Enhanced `Quantity_Color::StringName()` to return "UNDEFINED" instead of throwing exceptions
- Introduced shared time constants header for better maintainability
2025-11-17 09:54:17 +00:00
Pasukhin Dmitry
07239e2a8b Foundation Classes - Improve NCollection vector constructors (#835)
- Converted all constructor implementations from assignment-based to initializer list-based initialization
- Added `constexpr` and `noexcept` qualifiers to the default constructor where previously missing
- Removed `std::memset` usage in favor of compile-time initialization
2025-11-16 15:07:36 +00:00
Pasukhin Dmitry
ac9acb4fb1 Foundation Classes - Migrate BSplCLib from deprecated gxx macros (#826)
- Created BSplCLib_CurveComputation.pxx with template implementations
  for 2D/3D curve computation methods
- Updated BSplCLib_1.cxx to use explicit template instantiation for 2D types
  (gp_Pnt2d, gp_Vec2d, TColgp_Array1OfPnt2d)
- Updated BSplCLib_3.cxx to use explicit template instantiation for 3D types
  (gp_Pnt, gp_Vec, TColgp_Array1OfPnt)
- Removed deprecated BSplCLib_CurveComputation.gxx file
2025-11-13 18:03:39 +00:00
luzpaz
df59c53e79 Documentation - Fix whitespaces and typos (#821)
- Removed excessive whitespace between words in comments
- Removed <br> syntax
- Fixed spelling errors ("hilight" → "highlights", "texte" → "text")
- Improved comment formatting and structure
2025-11-13 09:30:53 +00:00
Pasukhin Dmitry
396b677095 Testing - Migrate QA DRAW tests to GTest (#823)
- Deletion of 20 legacy DRAW test files (.tcl format) from tests/bugs/ directories
- Addition of 15 new GTest C++ test files across multiple modules
- Removal of corresponding QA command implementations from TKQADraw
2025-11-13 09:28:07 +00:00
Pasukhin Dmitry
44df7106f3 Foundation Classes - Migrate Bnd_B2x and Bnd_B3x from macro-template to C++ templates (#820)
- Replaced macro-based template system with C++ templates for `Bnd_B2` and `Bnd_B3` classes
- Fixed incorrect use of Y-coordinate instead of Z-coordinate in transformation methods
- Added comprehensive GTest test coverage for both 2D and 3D bounding box classes
2025-11-12 18:46:10 +00:00
luzpaz
ed1d0c88cc Documentation - Fix whitespaces and typos (#819)
- Fixed inconsistent whitespace and line breaks in comments
- Corrected spelling errors ("witch" → "which", "sprcified" → "specified", "nul" → "null", etc.)
- Improved formatting consistency in documentation comments
2025-11-12 18:06:11 +00:00
dpasukhi
61d69fde9e Coding - Fix compilation issues on master
- Included <mutex> in Interface_Category.cxx to support thread synchronization.
- Added <windows.h> in Standard_StackTrace.cxx for Windows-specific functionality.
- Removed deprecated macro usage example in Standard_Macro.hxx to clean up the code.
2025-11-11 11:23:00 +00:00
Pasukhin Dmitry
d166ff70e7 Testing - Migrate QA DRAW tests to GTest (#818)
- Removed 37 DRAW test scripts from `tests/bugs/` directories
- Added 31 new GTest C++ test files in appropriate `GTests/` directories
- Removed corresponding QAcommands implementations from QABugs source files
- Updated CMake FILES.cmake files to include new test files
2025-11-10 21:17:50 +00:00
luzpaz
f9f94b6e36 Documentation - Fix whitespaces (#816)
- Standardized spacing in comment formatting (removing extra spaces after colons, between words)
- Fixed one typo in a parameter name within a comment
- Translated one French comment to English
2025-11-10 17:42:08 +00:00
luzpaz
a47cffd0eb Documentation - Fix whitespace and typos (#815) 2025-11-09 21:38:29 +00:00
Pasukhin Dmitry
989f00b9c4 Foundation Classes, math_Matrix - Remove redundant checks and inline methods (#814)
- Eliminated redundant member variables (`LowerRowIndex`, `UpperRowIndex`, `LowerColIndex`, `UpperColIndex`) that duplicated information already tracked by the underlying `math_DoubleTab Array`
- Inlined most `math_Matrix` methods into the `.lxx` file for better performance
- Updated all access patterns to use the `Array` member's methods directly
- Added `noexcept` qualifiers to non-throwing methods
- Modernized operator implementations (e.g., `operator-()` now returns `const`)
2025-11-09 15:27:10 +00:00
Pasukhin Dmitry
27e61c089c Foundation Classes - ElSLib, ElCLib Angle normalization refactor (#813)
- Introduced a centralized `normalizeAngle()` function in both ElSLib.cxx and ElCLib.cxx with special handling for values near zero and the 2π seam
- Replaced multiple instances of inline angle normalization code with calls to the new function
- Migrated the OCC24945 bug test from Draw Harness to GTest framework
- Updated expected test values to reflect the improved normalization behavior
2025-11-09 14:13:24 +00:00
Pasukhin Dmitry
bbdddd24d4 Foundation Classes - Add precision-related methods and descriptions in Precision.hxx (#811)
- Introduced new static constexpr methods: Computational() and SquareComputational() for machine epsilon precision.
- Enhanced documentation to clarify the purpose and use cases of these methods in numerical computations.
- Emphasized the distinction between machine epsilon and geometric tolerances for better understanding.
2025-11-08 14:12:16 +00:00
luzpaz
7ef4b0f2a6 Documentation - Fix whitespaces (#809)
- Corrected spelling errors in comments (e.g., "od" to "of", "thr" to "the")
- Removed unnecessary `<br>` HTML tags from comment formatting
- Normalized whitespace in comments for consistency
- Fixed terminology (e.g., "3-d" to "3D")
2025-11-08 14:11:10 +00:00
luzpaz
3e7aaf0f12 Documentation - Fix whitespaces (#808)
- Standardized whitespace and line breaks in multi-line documentation comments
- Fixed punctuation formatting (colons, periods)
- Corrected capitalization in comment sentences
- Improved readability by properly formatting lists and continuations
2025-11-08 09:25:04 +00:00
luzpaz
e525500470 Documentation - Fix whitespaces (#807)
- Reformatted multi-line documentation comments to improve readability
- Removed trailing whitespace and unnecessary separators
- Improved logical grouping of related documentation items
2025-11-08 09:24:07 +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
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