X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FPlaneGCSSolver%2FPlaneGCSSolver_GeoExtensions.h;fp=src%2FSketchSolver%2FPlaneGCSSolver%2FPlaneGCSSolver_GeoExtensions.h;h=3b734538fa53fd76854c147b8a0153c4809fb68a;hb=87447545000c44e455431ed0d401f850f373374e;hp=c83e1a9ddde3eacbfb8f664161ffcc2439e44020;hpb=5fbfd2e75c41fcacf436f668bf4f5898bf37a1a9;p=modules%2Fshaper.git diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_GeoExtensions.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_GeoExtensions.h index c83e1a9dd..3b734538f 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_GeoExtensions.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_GeoExtensions.h @@ -22,12 +22,6 @@ #include -#include -#include - -class GeomAPI_BSpline2d; -class GeomAPI_Pnt2d; - namespace GCS { /// \brife SHAPER's implementation of B-spline curves in PlaneGCS solver class BSplineImpl : public BSpline @@ -39,17 +33,32 @@ namespace GCS { virtual BSplineImpl* Copy(); private: - /// Verify the cached curve satisfies to the parameters - bool isCacheValid() const; - /// Poles or weights are changed, cache curve has to be rebuilt - void rebuildCache(); + /// Return the index of start knot for the given parameter. + /// Parameter is updated accordingly, if the B-spline curve is periodic + /// and the parameter is out of period. + int spanIndex(double& u); + + /// Collect the list of poles and their weights affecting the given span + void spanPolesAndWeights(int theSpanIndex, + double* theDerivParam, + std::vector& thePoles, + std::vector& theWeights) const; + + /// Execute De Boor algorithm to calculate B-spline curve's value + void performDeBoor(double theU, int theSpanIndex, + std::vector& thePoles, std::vector& theWeights, + GCS::DeriVector2& theValue, GCS::DeriVector2& theDerivative) const; + + /// Calculate the value and the first derivative for the given parameter on B-spline + void d1(double theU, double* theDerivParam, + GCS::DeriVector2& theValue, GCS::DeriVector2& theDerivative); + + /// Find the parameter on B-spline corresponding to the given point + /// \return \c false if it is unable to calculate the parameter + bool parameter(const Point& thePoint, double& theParam) const; private: - std::shared_ptr myCurve; /// cached B-spline curve - std::list > myCachedPoles; /// cached B-spline poles - std::list myCachedWeights; /// cached B-spline weights - std::list myCachedKnots; /// cached B-spline knots - std::list myCachedMultiplicities; /// cached B-spline multiplicities + VEC_D myFlatKnots; /// indices of knots duplicated by multiplicity }; }