0023620: Follow up of 0022939 - make Bezier curve/surface evaluation thread-safe
[occt.git] / src / Geom / Geom_BezierCurve.hxx
index 1d7a9b5..c143b47 100644 (file)
@@ -29,6 +29,8 @@
 #include <TColgp_Array1OfPnt.hxx>
 #include <TColStd_Array1OfReal.hxx>
 #include <GeomAbs_Shape.hxx>
+#include <BSplCLib.hxx>
+
 class Standard_ConstructionError;
 class Standard_DimensionError;
 class Standard_RangeError;
@@ -304,7 +306,15 @@ public:
   //!
   //! Raised if the length of W is not equal to the number of poles.
   Standard_EXPORT void Weights (TColStd_Array1OfReal& W) const;
-  
+
+  //! Returns all the weights of the curve.
+  const TColStd_Array1OfReal* Weights() const
+  {
+    if (!weights.IsNull())
+      return &weights->Array1();
+    return BSplCLib::NoWeights();
+  }
+
   //! Applies the transformation T to this Bezier curve.
   Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
   
@@ -344,25 +354,12 @@ private:
   //! Update rational and closed.
   //!
   //! if nbpoles < 2 or nbboles > MaDegree + 1
-  Standard_EXPORT void Init (const Handle(TColgp_HArray1OfPnt)& Poles, const Handle(TColStd_HArray1OfReal)& Weights);
-  
-  //! returns true if the coefficients have been
-  //! computed with the right value of cacheparameter
-  //! for the given U value.
-  Standard_EXPORT Standard_Boolean CoefficientsOK (const Standard_Real U) const;
-  
-  //! Recompute the coeficients.
-  Standard_EXPORT void UpdateCoefficients (const Standard_Real U = 0.0);
+  void Init (const Handle(TColgp_HArray1OfPnt)& Poles, const Handle(TColStd_HArray1OfReal)& Weights);
 
   Standard_Boolean rational;
   Standard_Boolean closed;
   Handle(TColgp_HArray1OfPnt) poles;
   Handle(TColStd_HArray1OfReal) weights;
-  Handle(TColgp_HArray1OfPnt) coeffs;
-  Handle(TColStd_HArray1OfReal) wcoeffs;
-  Standard_Integer validcache;
-  Standard_Real parametercache;
-  Standard_Real spanlenghtcache;
   Standard_Real maxderivinv;
   Standard_Boolean maxderivinvok;