mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-06 12:57:35 +08:00
Refactor GeomProp, Geom2dProp, and GeomProp_Surface evaluator systems to support direct construction from geometry handles without creating intermediate adaptors, add per-parameter derivative caching, and optimize type dispatch. Key changes: Handle-based construction path: - All evaluators accept Handle(Geom_Curve)/Handle(Geom2d_Curve)/ Handle(Geom_Surface) directly, bypassing adaptor creation for analytical types (Line, Circle, Plane, etc.) - Wrapper initialization from handles uses DynamicType() comparison (single extraction, == checks) instead of IsKind() virtual walks - TrimmedCurve/RectangularTrimmedSurface automatically unwrapped to basis geometry with optional CurveDomain/SurfaceDomain bounds Adaptor-based construction path: - Specialized evaluators accept only specific adaptor types (GeomAdaptor_Curve*, Geom2dAdaptor_Curve*, GeomAdaptor_Surface*) - OtherCurve/OtherSurface accept base adaptor types for unknown geometry - GeomAdaptor dispatch uses GetType() switch/case for direct specialized evaluator construction - GeomAdaptor_TransformedSurface handled by extracting transformed adaptor via new public AdaptorSurfaceTransformed() method Domain structs: - Add CurveDomain (First, Last) and SurfaceDomain (FirstU, LastU, FirstV, LastV) structs to GeomProp and Geom2dProp namespaces - Stored as std::optional in evaluators, set only for trimmed geometry or adaptor-sourced bounds Derivative caching: - Add CurveDerivOrder/SurfaceDerivOrder enums and CurveCache/ SurfaceCache structs using std::variant over ResD1/ResD2/ResD3 - Enum values match variant alternative indices for direct access - Non-trivial evaluators (BSpline, Bezier, Offset, Other) store mutable cache with requested derivative order - Shared evaluation helpers in CurveAnalysisTools.pxx and SurfaceAnalysisTools.pxx eliminate duplication across evaluators - Degenerate tangent points upgrade cache to D3, reusing cached point for neighbor evaluation Other improvements: - Simplify Adaptor() to direct myOwnedAdaptor return - Add GeomAdaptor_TransformedSurface::AdaptorSurfaceTransformed() public method - Improve MathRoot_Multiple robustness: double minimum sampling (2*NbSamples, min 20) for better root detection, add EffectiveXTolerance() to prevent spurious duplicates, introduce derivative-aware FindAllRootsWithDerivativeImpl() with golden section extrema detection and Brent/Newton hybrid refinement - Update Geom2dLProp CurAndInf2d to use GeomProp-based analysis