![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
A cache class for Bezier and B-spline curves. More...
#include <BSplCLib_Cache.hxx>

Public Member Functions | |
| BSplCLib_Cache (const int &theDegree, const bool &thePeriodic, const NCollection_Array1< double > &theFlatKnots, const NCollection_Array1< gp_Pnt2d > &thePoles2d, const NCollection_Array1< double > *theWeights=nullptr) | |
| Constructor, prepares data structures for caching values on a 2d curve. | |
| BSplCLib_Cache (const int &theDegree, const bool &thePeriodic, const NCollection_Array1< double > &theFlatKnots, const NCollection_Array1< gp_Pnt > &thePoles, const NCollection_Array1< double > *theWeights=nullptr) | |
| Constructor, prepares data structures for caching values on a 3d curve. | |
| bool | IsCacheValid (double theParameter) const |
| Verifies validity of the cache using flat parameter of the point. | |
| void | BuildCache (const double &theParameter, const NCollection_Array1< double > &theFlatKnots, const NCollection_Array1< gp_Pnt2d > &thePoles2d, const NCollection_Array1< double > *theWeights) |
| Recomputes the cache data for 2D curves. Does not verify validity of the cache. | |
| void | BuildCache (const double &theParameter, const NCollection_Array1< double > &theFlatKnots, const NCollection_Array1< gp_Pnt > &thePoles, const NCollection_Array1< double > *theWeights=nullptr) |
| Recomputes the cache data for 3D curves. Does not verify validity of the cache. | |
| void | D0 (const double &theParameter, gp_Pnt2d &thePoint) const |
| Calculates the point on the curve in the specified parameter. | |
| void | D0 (const double &theParameter, gp_Pnt &thePoint) const |
| void | D1 (const double &theParameter, gp_Pnt2d &thePoint, gp_Vec2d &theTangent) const |
| Calculates the point on the curve and its first derivative in the specified parameter. | |
| void | D1 (const double &theParameter, gp_Pnt &thePoint, gp_Vec &theTangent) const |
| void | D2 (const double &theParameter, gp_Pnt2d &thePoint, gp_Vec2d &theTangent, gp_Vec2d &theCurvature) const |
| Calculates the point on the curve and two derivatives in the specified parameter. | |
| void | D2 (const double &theParameter, gp_Pnt &thePoint, gp_Vec &theTangent, gp_Vec &theCurvature) const |
| void | D3 (const double &theParameter, gp_Pnt2d &thePoint, gp_Vec2d &theTangent, gp_Vec2d &theCurvature, gp_Vec2d &theTorsion) const |
| Calculates the point on the curve and three derivatives in the specified parameter. | |
| void | D3 (const double &theParameter, gp_Pnt &thePoint, gp_Vec &theTangent, gp_Vec &theCurvature, gp_Vec &theTorsion) const |
| void | D0Local (double theLocalParam, gp_Pnt &thePoint) const |
| Calculates the 3D point using pre-computed local parameter in [0, 1] range. This bypasses periodic normalization and local parameter calculation. | |
| void | D1Local (double theLocalParam, gp_Pnt &thePoint, gp_Vec &theTangent) const |
| Calculates the 3D point and first derivative using pre-computed local parameter. | |
| void | D2Local (double theLocalParam, gp_Pnt &thePoint, gp_Vec &theTangent, gp_Vec &theCurvature) const |
| Calculates the 3D point, first and second derivatives using pre-computed local parameter. | |
| void | D3Local (double theLocalParam, gp_Pnt &thePoint, gp_Vec &theTangent, gp_Vec &theCurvature, gp_Vec &theTorsion) const |
| Calculates the 3D point, first, second and third derivatives using pre-computed local parameter. | |
| void | D0Local (double theLocalParam, gp_Pnt2d &thePoint) const |
| Calculates the 2D point using pre-computed local parameter in [0, 1] range. This bypasses periodic normalization and local parameter calculation. | |
| void | D1Local (double theLocalParam, gp_Pnt2d &thePoint, gp_Vec2d &theTangent) const |
| Calculates the 2D point and first derivative using pre-computed local parameter. | |
| void | D2Local (double theLocalParam, gp_Pnt2d &thePoint, gp_Vec2d &theTangent, gp_Vec2d &theCurvature) const |
| Calculates the 2D point, first and second derivatives using pre-computed local parameter. | |
| void | D3Local (double theLocalParam, gp_Pnt2d &thePoint, gp_Vec2d &theTangent, gp_Vec2d &theCurvature, gp_Vec2d &theTorsion) const |
| Calculates the 2D point, first, second and third derivatives using pre-computed local parameter. | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. | |
| virtual | ~Standard_Transient ()=default |
| Destructor must be virtual. | |
| virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object. | |
| bool | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
| Returns a true value if this is an instance of Type. | |
| bool | IsInstance (const char *const theTypeName) const |
| Returns a true value if this is an instance of TypeName. | |
| bool | IsKind (const opencascade::handle< Standard_Type > &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| bool | IsKind (const char *const theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| Standard_Transient * | This () const |
| Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. | |
| int | GetRefCount () const noexcept |
| Get the reference counter of this object. | |
| void | IncrementRefCounter () noexcept |
| Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations. | |
| int | DecrementRefCounter () noexcept |
| Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement. | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. | |
Protected Member Functions | |
| void | calculateDerivative (double theParameter, int theDerivative, double *theDerivArray) const |
| Fills array of derivatives in the selected point of the curve. | |
| void | calculateDerivativeLocal (double theLocalParam, int theDerivative, double *theDerivArray) const |
| Fills array of derivatives using pre-computed local parameter. | |
| BSplCLib_Cache (const BSplCLib_Cache &)=delete | |
| void | operator= (const BSplCLib_Cache &)=delete |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
| typedef void | base_type |
| Returns a type descriptor about this object. | |
Static Public Member Functions inherited from Standard_Transient | |
| static constexpr const char * | get_type_name () |
| Returns a type descriptor about this object. | |
| static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
| Returns type descriptor of Standard_Transient class. | |
A cache class for Bezier and B-spline curves.
Defines all data, that can be cached on a span of a curve. The data should be recalculated in going from span to span.
| BSplCLib_Cache::BSplCLib_Cache | ( | const int & | theDegree, |
| const bool & | thePeriodic, | ||
| const NCollection_Array1< double > & | theFlatKnots, | ||
| const NCollection_Array1< gp_Pnt2d > & | thePoles2d, | ||
| const NCollection_Array1< double > * | theWeights = nullptr ) |
Constructor, prepares data structures for caching values on a 2d curve.
| theDegree | degree of the curve |
| thePeriodic | identify whether the curve is periodic |
| theFlatKnots | knots of Bezier/B-spline curve (with repetitions) |
| thePoles2d | array of poles of 2D curve |
| theWeights | array of weights of corresponding poles |
| BSplCLib_Cache::BSplCLib_Cache | ( | const int & | theDegree, |
| const bool & | thePeriodic, | ||
| const NCollection_Array1< double > & | theFlatKnots, | ||
| const NCollection_Array1< gp_Pnt > & | thePoles, | ||
| const NCollection_Array1< double > * | theWeights = nullptr ) |
Constructor, prepares data structures for caching values on a 3d curve.
| theDegree | degree of the curve |
| thePeriodic | identify whether the curve is periodic |
| theFlatKnots | knots of Bezier/B-spline curve (with repetitions) |
| thePoles | array of poles of 3D curve |
| theWeights | array of weights of corresponding poles |
|
protecteddelete |
| void BSplCLib_Cache::BuildCache | ( | const double & | theParameter, |
| const NCollection_Array1< double > & | theFlatKnots, | ||
| const NCollection_Array1< gp_Pnt > & | thePoles, | ||
| const NCollection_Array1< double > * | theWeights = nullptr ) |
Recomputes the cache data for 3D curves. Does not verify validity of the cache.
| theParameter | the value on the knot's axis to identify the span |
| theFlatKnots | knots of Bezier/B-spline curve (with repetitions) |
| thePoles | array of poles of 3D curve |
| theWeights | array of weights of corresponding poles |
| void BSplCLib_Cache::BuildCache | ( | const double & | theParameter, |
| const NCollection_Array1< double > & | theFlatKnots, | ||
| const NCollection_Array1< gp_Pnt2d > & | thePoles2d, | ||
| const NCollection_Array1< double > * | theWeights ) |
Recomputes the cache data for 2D curves. Does not verify validity of the cache.
| theParameter | the value on the knot's axis to identify the span |
| theFlatKnots | knots of Bezier/B-spline curve (with repetitions) |
| thePoles2d | array of poles of 2D curve |
| theWeights | array of weights of corresponding poles |
|
protected |
Fills array of derivatives in the selected point of the curve.
| [in] | theParameter | parameter of the calculation |
| [in] | theDerivative | maximal derivative to be calculated (computes all derivatives lesser than specified) |
| [out] | theDerivArray | result array of derivatives with size (theDerivative+1)*(PntDim+1), where PntDim = 2 or 3 is a dimension of the curve |
|
protected |
Fills array of derivatives using pre-computed local parameter.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [in] | theDerivative | maximal derivative to be calculated (1, 2, or 3) |
| [out] | theDerivArray | result array of derivatives |
Calculates the point on the curve in the specified parameter.
| [in] | theParameter | parameter of calculation of the value |
| [out] | thePoint | the result of calculation (the point on the curve) |
Calculates the 3D point using pre-computed local parameter in [0, 1] range. This bypasses periodic normalization and local parameter calculation.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [out] | thePoint | the result of calculation (the point on the curve) |
Calculates the 2D point using pre-computed local parameter in [0, 1] range. This bypasses periodic normalization and local parameter calculation.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [out] | thePoint | the result of calculation (the point on the curve) |
| void BSplCLib_Cache::D1 | ( | const double & | theParameter, |
| gp_Pnt & | thePoint, | ||
| gp_Vec & | theTangent ) const |
| void BSplCLib_Cache::D1 | ( | const double & | theParameter, |
| gp_Pnt2d & | thePoint, | ||
| gp_Vec2d & | theTangent ) const |
Calculates the point on the curve and its first derivative in the specified parameter.
| [in] | theParameter | parameter of calculation of the value |
| [out] | thePoint | the result of calculation (the point on the curve) |
| [out] | theTangent | tangent vector (first derivatives) for the curve in the calculated point |
Calculates the 3D point and first derivative using pre-computed local parameter.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [out] | thePoint | the point on the curve |
| [out] | theTangent | first derivative (tangent vector) |
| void BSplCLib_Cache::D1Local | ( | double | theLocalParam, |
| gp_Pnt2d & | thePoint, | ||
| gp_Vec2d & | theTangent ) const |
Calculates the 2D point and first derivative using pre-computed local parameter.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [out] | thePoint | the point on the curve |
| [out] | theTangent | first derivative (tangent vector) |
| void BSplCLib_Cache::D2 | ( | const double & | theParameter, |
| gp_Pnt & | thePoint, | ||
| gp_Vec & | theTangent, | ||
| gp_Vec & | theCurvature ) const |
| void BSplCLib_Cache::D2 | ( | const double & | theParameter, |
| gp_Pnt2d & | thePoint, | ||
| gp_Vec2d & | theTangent, | ||
| gp_Vec2d & | theCurvature ) const |
Calculates the point on the curve and two derivatives in the specified parameter.
| [in] | theParameter | parameter of calculation of the value |
| [out] | thePoint | the result of calculation (the point on the curve) |
| [out] | theTangent | tangent vector (1st derivatives) for the curve in the calculated point |
| [out] | theCurvature | curvature vector (2nd derivatives) for the curve in the calculated point |
| void BSplCLib_Cache::D2Local | ( | double | theLocalParam, |
| gp_Pnt & | thePoint, | ||
| gp_Vec & | theTangent, | ||
| gp_Vec & | theCurvature ) const |
Calculates the 3D point, first and second derivatives using pre-computed local parameter.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [out] | thePoint | the point on the curve |
| [out] | theTangent | first derivative (tangent vector) |
| [out] | theCurvature | second derivative (curvature vector) |
| void BSplCLib_Cache::D2Local | ( | double | theLocalParam, |
| gp_Pnt2d & | thePoint, | ||
| gp_Vec2d & | theTangent, | ||
| gp_Vec2d & | theCurvature ) const |
Calculates the 2D point, first and second derivatives using pre-computed local parameter.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [out] | thePoint | the point on the curve |
| [out] | theTangent | first derivative (tangent vector) |
| [out] | theCurvature | second derivative (curvature vector) |
| void BSplCLib_Cache::D3 | ( | const double & | theParameter, |
| gp_Pnt & | thePoint, | ||
| gp_Vec & | theTangent, | ||
| gp_Vec & | theCurvature, | ||
| gp_Vec & | theTorsion ) const |
| void BSplCLib_Cache::D3 | ( | const double & | theParameter, |
| gp_Pnt2d & | thePoint, | ||
| gp_Vec2d & | theTangent, | ||
| gp_Vec2d & | theCurvature, | ||
| gp_Vec2d & | theTorsion ) const |
Calculates the point on the curve and three derivatives in the specified parameter.
| [in] | theParameter | parameter of calculation of the value |
| [out] | thePoint | the result of calculation (the point on the curve) |
| [out] | theTangent | tangent vector (1st derivatives) for the curve in the calculated point |
| [out] | theCurvature | curvature vector (2nd derivatives) for the curve in the calculated point |
| [out] | theTorsion | second curvature vector (3rd derivatives) for the curve in the calculated point |
| void BSplCLib_Cache::D3Local | ( | double | theLocalParam, |
| gp_Pnt & | thePoint, | ||
| gp_Vec & | theTangent, | ||
| gp_Vec & | theCurvature, | ||
| gp_Vec & | theTorsion ) const |
Calculates the 3D point, first, second and third derivatives using pre-computed local parameter.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [out] | thePoint | the point on the curve |
| [out] | theTangent | first derivative (tangent vector) |
| [out] | theCurvature | second derivative (curvature vector) |
| [out] | theTorsion | third derivative (torsion vector) |
| void BSplCLib_Cache::D3Local | ( | double | theLocalParam, |
| gp_Pnt2d & | thePoint, | ||
| gp_Vec2d & | theTangent, | ||
| gp_Vec2d & | theCurvature, | ||
| gp_Vec2d & | theTorsion ) const |
Calculates the 2D point, first, second and third derivatives using pre-computed local parameter.
| [in] | theLocalParam | pre-computed local parameter: (Param - SpanStart) / SpanLength |
| [out] | thePoint | the point on the curve |
| [out] | theTangent | first derivative (tangent vector) |
| [out] | theCurvature | second derivative (curvature vector) |
| [out] | theTorsion | third derivative (torsion vector) |
Verifies validity of the cache using flat parameter of the point.
| theParameter | parameter of the point placed in the span |
|
protecteddelete |