Fix the replacement issue when Standard_CString was replaced to const char* even when it was const.
Now "const Standard_CString" is replaced with "const char* const".
Only places which were before const Standard_CString is replaced.
- Refactored loop control flow to use an `if` statement instead of a `for` loop with immediate `break`
- Changed variable type from `int` to `size_t` to match the expected type and eliminate conversion warnings
- Removed legacy metadata entries (EXTERNLIB, PACKAGES, DEFINES, FILES) that are no longer used by the build system
- Removed references to obsolete build artifacts (.lex, .yacc files) that appear to be superseded by generated .c/.h files
- Removed references to non-source files (README.md, .tcl scripts, GUID.txt) that shouldn't be listed in source file manifests
- Optimized map lookup in `IntTools_SurfaceRangeLocalizeData::FindBox` by using `Seek()` instead of `IsBound()` + `operator()`
- Refactored surface handling functions to accept `BRepAdaptor_Surface` instead of `Handle(Geom_BSplineSurface)` to avoid redundant conversions
- Updated `ComputeGridPoints` to take both `BRepAdaptor_Surface` and `Handle(Geom_BSplineSurface)` parameters for accessing different surface properties
First patch in iterative renovation of exceptions.
- Simplify exception classes to be container of data only.
- Removed redundant inclusion of <Standard_Type.hxx> in various header files across the project.
- Removed Set methods for failure and its define template.
- Removed Raise and Rerise static methods.
- Remove Instance and Throw methods
- Deprecated getting message with old approach, and moving to what()
- Update ErrorHandler to handle only specific list of exceptions.
- Removed non-functional pcurve handling code that was never properly executed
- Simplified the function to focus solely on 3D curve concatenation
- Improved code readability with better variable naming and modern C++ practices
- Eliminates redundant `Extrema_ExtPS` object creation by initializing once and performing multiple projections
- Removes unused `#include <Extrema_ExtPS.hxx>` directives from files that no longer directly instantiate the class
- Improves performance by avoiding repeated surface initialization overhead
- Removed unnecessary reference qualifiers (`&`) from `gp_Dir` variable declarations in geometric evaluation classes
- Initialized previously uninitialized variables (`DuvBuf`, `anFDOpenMode`) to prevent undefined behavior
- Removed redundant `Standard_EXPORT` from deleted copy constructors
- Added explicit base class initialization in `EnumeratedThread` copy constructor
- Replaced C-style cast with `reinterpret_cast` in `Quantity_ColorRGBA` for type safety
- Deleted TopoDS_ListOfShape.hxx and removed its references in various files.
- Replaced instances of TopoDS_ListOfShape with NCollection_List in TopoDS_Builder, TopoDS_Iterator, and TopoDS_TShape.
- Updated CMake files to exclude TopoDS_ListOfShape from the build.
- Removed Geom2dConvert_SequenceOfPPoint and its usages, replacing them with NCollection_Sequence.
- Cleaned up Select3D and SelectMgr modules by removing Select3D_EntitySequence, Select3D_IndexedMapOfEntity, and SelectMgr_IndexedMapOfOwner.
- Adjusted includes in various files to use NCollection types instead of removed classes.
- Overall, this commit streamlines the codebase by eliminating unused types and reducing dependencies.
- 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
- 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.
- Updated multiple files in the HLRBRep module to replace occurrences of Standard_Address with new type aliases HLRBRep_CurvePtr and HLRBRep_SurfacePtr.
- Introduced HLRBRep_TypeDef.hxx to define these type aliases for better clarity and maintainability.
- Adjusted constructors, method signatures, and internal variable types to use the new pointer types.
- Ensured compatibility with existing functionality while enhancing type safety and readability.
- Removed SetUVParams/SetParams methods from all GeomGridEval classes
- Updated all evaluation methods to accept parameters directly as arguments
- Added new EvaluatePoints methods for arbitrary UV pair evaluation
- Updated all callers to use the new direct evaluation pattern
- Refactored polyhedron initialization to use `GeomGridEval_Surface` for grid-based evaluation
- Implemented isoline optimization in surface evaluators (1D curve extraction for 1×N/N×1 grids)
- Reorganized tests: moved BSpline surface tests to dedicated file and added comprehensive isoline validation tests
- Added height-ordering detection methods (`IsHeightInverted()`, `AreHeightsEqual()`) to `BRepPrim_OneAxis`
- Fixed edge vertex ordering and wire direction flags to handle inverted heights
- Replaced preprocessor macros with modern C++ enums in anonymous namespace
- Added comprehensive GTest suite for `BRepPrimAPI_MakeTorus`
- Refactored template-based code generation to explicit implementations across multiple packages
Fixed incorrect loop index initialization in GlueEdgesWithPCurves function.
The loop for iterating PCurves started from index 0, but BRep_Tool::CurveOnSurface
requires 1-based indexing (returns immediately when Index < 1).
This bug caused the first PCurve to be skipped, potentially leading to
incorrect edge gluing results in ShapeUpgrade_UnifySameDomain.
Changed: for (int aCurveIndex = 0;; ...) -> for (int aCurveIndex = 1;; ...)
Refactor TKHLR module to eliminate usage of Standard_Address (void*)
for surface parameters, replacing them with type-safe HLRBRep_Surface*
pointers. This improves code readability, type safety, and enables
better compiler diagnostics.
Key changes:
- HLRBRep_Data: Change iFaceGeom member from Standard_Address to
HLRBRep_Surface*, removing all associated casts
- HLRBRep_SurfaceTool: Update all methods to take const HLRBRep_Surface*
- HLRBRep_Surface: Make NbUIntervals/NbVIntervals const-qualified
- HLRBRep_InterCSurf: Use typed pointer via type alias
- HLRBRep_Intersector: Remove Standard_Address from public interface
- HLRBRep_ThePolyhedronOfInterCSurf: Use HLRBRep_Surface* directly
- HLRBRep_TheCSFunctionOfInterCSurf: Use typed pointer member
- HLRBRep_TheQuadCurvExactInterCSurf: Use HLRBRep_Surface* parameter
- Template instantiation files (_0.cxx): Change #define to typedef
for ThePSurface to ensure correct const semantics with templates
- Introduced `GeomGridEval` package with specialized evaluators for analytical surfaces (plane, cylinder, sphere, cone, torus) and parametric surfaces (Bezier, BSpline, offset)
- Refactored extrema computation in `Extrema_GenExtSS`, `Extrema_GenExtPS`, and `Extrema_GenExtCS` to use batch grid evaluation
- Added comprehensive derivative computation support (D0-D3, DN) for all surface types
This commit completes the refactoring of geometry evaluator classes, replacing polymorphic Handle-based evaluators with inline template utilities and std::variant-based data storage in adaptor classes.
Key changes:
1. Removed GeomEvaluator and Geom2dEvaluator packages:
- Deleted GeomEvaluator_Curve, GeomEvaluator_Surface base classes
- Deleted GeomEvaluator_OffsetCurve, GeomEvaluator_OffsetSurface
- Deleted GeomEvaluator_SurfaceOfExtrusion, GeomEvaluator_SurfaceOfRevolution
- Deleted Geom2dEvaluator_Curve, Geom2dEvaluator_OffsetCurve
2. Added private utility headers (.pxx files) with inline template functions:
- Geom_OffsetCurveUtils.pxx - offset curve evaluation
- Geom_OffsetSurfaceUtils.pxx - offset surface evaluation
- Geom_ExtrusionUtils.pxx - surface of extrusion evaluation
- Geom_RevolutionUtils.pxx - surface of revolution evaluation
- Geom2d_OffsetCurveUtils.pxx - 2D offset curve evaluation
3. Refactored GeomAdaptor_Curve:
- Moved BezierData and BSplineData structs inside the class
- Added std::variant<monostate, OffsetData, BezierData, BSplineData> for type-specific evaluation data
- Removed separate myBSplineCurve and myCurveCache members
- Updated all evaluation methods to use variant-based access
4. Refactored GeomAdaptor_Surface:
- Changed ExtrusionData and RevolutionData to use Handle(Adaptor3d_Curve) instead of Handle(GeomAdaptor_Curve) for flexibility
- Changed RevolutionData to store gp_Ax1 instead of separate AxisLoc/AxisDir
- Updated OffsetData to store Handle(Geom_OffsetSurface) for osculating surface queries instead of creating new Geom_OsculatingSurface
5. Updated Geom_OsculatingSurface:
- Renamed UOscSurf/VOscSurf methods to UOsculatingSurface/VOsculatingSurface for consistency with Geom_OffsetSurface public API
6. Fixed specialized adaptor classes:
- GeomAdaptor_SurfaceOfLinearExtrusion - removed evaluator, uses variant
- GeomAdaptor_SurfaceOfRevolution - removed evaluator, uses variant
- Geom2dAdaptor_Curve - updated to use variant-based data
- Adaptor2d_OffsetCurve - updated to use Geom2d_OffsetCurveUtils
7. Fixed Geom_SurfaceOfRevolution:
- Updated utility calls to use gp_Ax1 parameter instead of separate XYZ
8. Added missing includes in dependent files:
- Adaptor3d_HSurfaceTool.cxx - added GeomAdaptor_Curve.hxx
- GeomAdaptor.cxx - added Adaptor3d_Surface.hxx, GeomAbs_SurfaceType.hxx
- Extrema_GenExtPS.cxx - added Adaptor3d_Curve/Surface.hxx, GeomAbs_IsoType.hxx
- TopOpeBRepTool_GEOMETRY.cxx - added Geom2dAdaptor_Curve.hxx
- BRepAdaptor_Curve2d.cxx - updated ShallowCopy for variant
Benefits:
- Reduced virtual function call overhead in hot evaluation paths
- Better code locality with inline template functions
- Simplified class hierarchy without abstract evaluator base classes
- More efficient memory layout with variant instead of polymorphic handles
- Consistent method naming across related classes
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
Completed the migration of IntCurveSurface_ThePolyhedronOfHInter and
HLRBRep_ThePolyhedronOfInterCSurf to fully utilize shared template
functions in IntCurveSurface_PolyhedronUtils.pxx.
The original commit fff55ee5fc introduced the .pxx template pattern but
only migrated 4 functions, leaving significant code duplication between
the two polyhedron implementations
Changes:
- Extended IntCurveSurface_PolyhedronUtils.pxx with 15 additional
template functions: AllocateArrays, Destroy, NbTriangles, NbPoints,
Triangle, TriConnex, PlaneEquation, Contain, FillBounding, IsOnBound,
ComputeMaxDeflection, ComputeMaxBorderDeflection,
SetDeflectionOverEstimation, Parameters, Point (3 overloads)
- Refactored both .cxx files to delegate all logic to PolyUtils namespace
This aligns the Polyhedron classes with other properly migrated classes
(Polygon, Inter, QuadricCurveExactInter) where the Utils.pxx contains
all shared logic and .cxx files are minimal wrappers.
Cleans up the BRepClass3d_SolidExplorer class by removing the
unused Bnd_Box member and associated code,
including preprocessor directives and function definitions.
The isVertexInsidePolygon method uses the winding number algorithm,
which computes cumulative angles from the test point to polygon vertices.
For a point inside a polygon, this sum should be ±2π.
The gp_Vec2d::Angle method uses an inverted sign convention where
CCW rotation gives negative angles. For CCW polygons, the total angle
is -2π, but the original check only accepted +2π.
Changed the condition from:
std::abs(Angle2PI - aTotalAng) > Precision::Angular()
to:
std::abs(std::abs(aTotalAng) - Angle2PI) > Precision::Angular()
This correctly handles both CCW (-2π) and CW (+2π) polygon orientations.
Replace custom HLRAlgo_PolyData::Box struct with standard Bnd_Box class
to leverage its built-in update functionality and reduce code duplication.
Changes:
- Remove HLRAlgo_PolyData::Box struct definition
- Update UpdateGlobalMinMax methods to use Bnd_Box::Update()
- Simplify bounding box computation logic using Bnd_Box methods
- Use C++17 structured bindings with Bnd_Box::Get()
- 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.
BRep_Tool::CurveOnSurface expects Index >= 1, but the loop started
from ii = 0, resulting in a wasted iteration that always returned
a null pointer.
Fixes#0032371
Modernized curve/surface intersection algorithms by replacing preprocessor-based
generic programming (.gxx macros) with C++ templates (.pxx headers):
IntCurveSurface package (TKGeomAlgo):
- Introduced IntCurveSurface_Inter.pxx with callback-based template functions
for intersection algorithms, replacing IntCurveSurface_Inter.gxx
- Created IntCurveSurface_InterUtils.pxx with utility template functions for
surface decomposition, UV clamping, and quadric intersection handling
- Added IntCurveSurface_PolygonUtils.pxx for polygon construction utilities
- Added IntCurveSurface_PolyhedronUtils.pxx for polyhedron construction utilities
- Added IntCurveSurface_QuadricCurveExactInterUtils.pxx for exact quadric
intersection computations
- Converted standalone implementation files from macro instantiation (_0.cxx)
to direct template usage (.cxx)
- Removed obsolete .gxx and .lxx files
HLRBRep package (TKHLR):
- Updated HLRBRep_InterCSurf to use new IntCurveSurface template utilities
- Converted HLRBRep polygon, polyhedron, and intersection classes to use
modern template instantiation pattern
- Removed legacy macro-based instantiation files (_0.cxx)
This refactoring improves code maintainability, enables better IDE support
and debugging, and aligns with modern C++ practices while preserving
the existing API and functionality.
- Moved temporary allocator reset to the end of the iteration in BOPAlgo_PaveFiller to prevent memory accumulation.
- Introduced a separate temporary allocator for per-iteration data in BOPAlgo_FillIn3DParts, enhancing memory reclamation during processing.
- Cleared face map before resetting the allocator in BOPAlgo_Tools to ensure efficient memory usage.
- Deleted copy and move constructors and assignment operators in BRepAlgoAPI_BuilderAlgo to ensure non-copyability and non-movability, preventing potential double-free issues.
- Added comprehensive unit tests to verify the non-copyable and non-movable nature of BRepAlgoAPI_BuilderAlgo and its derived classes.
- Updated CMake files to include the new test source file for build integration.
- Updated isBSplineCurveInvalid to check for uneven parameterization speed and determine the need for ProjLib usage.
- Enhanced the logic for computing parameterization speed across knot intervals.
- Simplified the handling of B-spline curves with problematic knot spacing by directly utilizing ProjLib for projection.
- Improved overall clarity and maintainability of the code by removing redundant checks and streamlining parameter handling.
- Implemented various test cases including projections of lines, circles, and B-splines on different surface types (planes, cylinders, spheres, and toroids).
- Refactored ShapeConstruct_ProjectCurveOnSurface to improve handling of periodic surfaces and edge cases.
- Updated header files to reflect new type aliases and improved structure for better readability and maintainability.
- Added a new function `extractBSplineCurve` to streamline the extraction of B-spline curves from both trimmed and untrimmed curves.
- Refactored `isBSplineCurveInvalid` to utilize the new extraction function, improving clarity and reducing code duplication.
- Updated `generateCurvePoints` to leverage the new extraction method for better handling of B-spline curves.
- Replaced std::vector with NCollection_Vector for better memory management in isBSplineCurveInvalid.
- Enhanced rebuildBSpline function to improve knot adjustment logic while preserving curve geometry.
- Introduced a new utility class, SurfaceProjectorWithCache, to enhance the projection of points onto B-spline surfaces by caching pole positions and their UV parameters.
- Updated the intersection logic to check for non-null C2dint1 when determining periodicity of 3D curves.
- Improved robustness of the PerformIntersectionAtEnd function to prevent potential issues with null parameters.
- Added a helper function to create B-spline curves from poles and knot sequences.
- Introduced a new test case to validate ThruSections with B-spline profiles of varying pole counts.
- Ensured compatibility of closed B-spline curves during lofting operations.
- Improved test coverage for the BRepOffsetAPI_ThruSections functionality.
- Fixed CheckMixedContinuity to detect actual mixed concavity
(both convex and concave regions) instead of any G1/non-G1 transitions
- Added null edge and PCurve checks in RefEdgeInter to prevent crashes
- Added GTests for BRepOffset_MakeOffset covering various loft scenarios
- Replacing preprocessor-based generic programming with C++ templates
- Converting inline implementation files (`.lxx`) to inline definitions within header files
- Removing legacy instantiation files (`_0.cxx`)
- Updating type aliases to use modern `using` declarations instead of macro-based instantiation
- Introduced a separate temporary allocator (`aTmpAllocator`) for per-iteration collections
- Reorganized collection declarations to distinguish between temporary (per-iteration) and persistent (cross-iteration) data structures
- Added allocator reset logic at the start of each iteration to reclaim memory
- Added null checks for 2D curve handles to prevent dereferencing null geometry
- Refactored `ProcessDE()` to use modern C++ idioms (auto, structured bindings, range-based iteration patterns)
- Simplified `FindPaveBlocks()` using a lambda function to reduce code duplication
- Refactored the `ReorderFaces` function to iterate through all edges at a vertex instead of assuming only two edges exist
- Replaced manual face swapping with `std::swap` for cleaner code
- Removed debug output statements and unused debug declarations
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.
- 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