Commit Graph

5502 Commits

Author SHA1 Message Date
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
Kirill Gavrilov
c64a167a96 Visualization - Improve detection of full cylinder/cone parameters #830
Parametric space of TopoDS_Face and ElSLib::ConeVIso() are now used for calculating parameters.
Scale factor is pre-applied.
2025-11-24 23:02:34 +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
052c37669b Modeling Data - Add GeomHash and Geom2dHash packages (#845)
- Implementation of hashers for analytic curves (Line, Circle, Ellipse, Hyperbola, Parabola) and freeform curves (Bezier, BSpline, Trimmed, Offset) in both 2D and 3D
- Implementation of hashers for surfaces including elementary surfaces (Plane, Cylinder, Cone, Sphere, Torus) and derived surfaces (Revolution, LinearExtrusion, RectangularTrimmed, Offset)
- Comprehensive test coverage for all hasher implementations
2025-11-22 11:16:25 +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
e03b266234 Foundation Classes - Performance improvements for TopExp package (#831)
- Replaced raw pointer-based stack (`TopExp_Stack`) with `NCollection_Vector<TopoDS_Iterator>`
- Mark some methods noexcept
- Removed `myTop` field
2025-11-14 18:00:19 +00:00
luzpaz
79289339d8 Documentation - Fix whitespaces and typos (#824)
- Fixed excessive whitespace in multi-line comments
- Corrected spelling errors (e.g., "selectionnable" → "selectable", "begenning" → "beginning")
- Improved comment formatting and readability
2025-11-13 20:31:57 +00:00
Pasukhin Dmitry
570b34b666 Coding - Removing simple gxx files (#827)
- Converted generic template files to direct implementations for three packages (Extrema, MAT, TopBas/HLRAlgo)
- Removed preprocessor macro-based includes and replaced with concrete type definitions
- Updated CMake FILES lists to remove deprecated `.gxx` and `.lxx` files
2025-11-13 19:28:14 +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
dpasukhi
2962bc34f1 Coding - Remove unused Transfer_TransferDeadLoop includes 2025-11-11 09:20:27 +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
Pasukhin Dmitry
49cf4baea6 Coding - Migrate from exception to local status flag for dead loop handling (#817)
- Transfer_ProcessForFinder_0.cxx: Replace exception throw/catch with
  local status flag in Transferring() method
- Transfer_ProcessForTransient_0.cxx: Same changes for consistency
- Transfer_TransferDeadLoop.hxx: Mark exception class as deprecated with
  Standard_DEPRECATED attribute

The Transfer_TransferDeadLoop class is kept alive but marked as deprecated
for backward compatibility. Dead loop detection is now handled via local
status flags instead of exceptions, improving performance and code clarity.
2025-11-10 21:17:26 +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
9309eb9c2d Coding - Fixing compilation warnings (#812)
- Removed unused variables in IVtkOCC_ViewerSelector to clean up the code.
- Eliminated the 'acceptvoid' variable from multiple methods to streamline the code.
- Improved code clarity and maintainability by reducing unnecessary complexity.
2025-11-08 16:01:10 +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
luzpaz
03dce08137 Documentation - Fix whitespaces (#806)
- Corrected alignment of comment section delimiters (equals signs)
- Removed excessive whitespace in multi-line comment text
- Improved line breaks in documentation for better readability
2025-11-07 09:17:08 +00:00
Pasukhin Dmitry
dc13c08c8e Data Exchange, STEP - use std::string_view for STEP type names and API (#784)
- Replace many static TCollection_AsciiString recognition constants with
  constexpr std::string_view (Reco_*, s_* short names) and include <string_view>.
- Change StepType() API to return const std::string_view& in
  StepData_ReadWriteModule and related modules (RWHeaderSection, RWStepAP214).
- Convert typenums/typeshor maps to use std::string_view keys and lazy
  initialization via initializeTypenums/initializeTypeshor + getTypenums/getTypeshor.
- Update call sites to adapt to new return type (wrap into TCollection_AsciiString
  where a TCollection_AsciiString is required).
- Minor refactoring to headers to add <string_view> includes and keep thread-safe
  singleton initialization for the maps.
2025-11-05 16:50:28 +00:00
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