mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-10 09:30:48 +08:00
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
HLR sample demonstrates hidden line removal algorithm. It supports exact and polygonal HLR algorithms. To try HLR you need to follow some steps: 1) to import model, which will displayed in 3d view. 2) to choose "File->Process HLR" or press "HLR' button in the toolbar. Dialog with options of HLR will be opened. 3) to press "Get shapes" button of the HLR dialog to display results in the 2d view. Optionally, this dialog allow to view chosen shapes in his own view. Here you can choose needed direction of view and press "Update 2d" button to update shapes HLR 2d view.