Open CASCADE Technology 7.8.2.dev
|
A cache class for Bezier and B-spline curves. More...
#include <BSplCLib_Cache.hxx>
Public Member Functions | |
BSplCLib_Cache (const Standard_Integer &theDegree, const Standard_Boolean &thePeriodic, const TColStd_Array1OfReal &theFlatKnots, const TColgp_Array1OfPnt2d &thePoles2d, const TColStd_Array1OfReal *theWeights=NULL) | |
Constructor, prepares data structures for caching values on a 2d curve. | |
BSplCLib_Cache (const Standard_Integer &theDegree, const Standard_Boolean &thePeriodic, const TColStd_Array1OfReal &theFlatKnots, const TColgp_Array1OfPnt &thePoles, const TColStd_Array1OfReal *theWeights=NULL) | |
Constructor, prepares data structures for caching values on a 3d curve. | |
Standard_Boolean | IsCacheValid (Standard_Real theParameter) const |
Verifies validity of the cache using flat parameter of the point. | |
void | BuildCache (const Standard_Real &theParameter, const TColStd_Array1OfReal &theFlatKnots, const TColgp_Array1OfPnt2d &thePoles2d, const TColStd_Array1OfReal *theWeights) |
Recomputes the cache data for 2D curves. Does not verify validity of the cache. | |
void | BuildCache (const Standard_Real &theParameter, const TColStd_Array1OfReal &theFlatKnots, const TColgp_Array1OfPnt &thePoles, const TColStd_Array1OfReal *theWeights=NULL) |
Recomputes the cache data for 3D curves. Does not verify validity of the cache. | |
void | D0 (const Standard_Real &theParameter, gp_Pnt2d &thePoint) const |
Calculates the point on the curve in the specified parameter. | |
void | D0 (const Standard_Real &theParameter, gp_Pnt &thePoint) const |
void | D1 (const Standard_Real &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 Standard_Real &theParameter, gp_Pnt &thePoint, gp_Vec &theTangent) const |
void | D2 (const Standard_Real &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 Standard_Real &theParameter, gp_Pnt &thePoint, gp_Vec &theTangent, gp_Vec &theCurvature) const |
void | D3 (const Standard_Real &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 Standard_Real &theParameter, gp_Pnt &thePoint, gp_Vec &theTangent, gp_Vec &theCurvature, gp_Vec &theTorsion) const |
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 () |
Destructor must be virtual. | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. | |
Standard_Boolean | 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. | |
Standard_Boolean | IsKind (const Standard_CString 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. | |
Standard_Integer | GetRefCount () const noexcept |
Get the reference counter of this object. | |
void | IncrementRefCounter () noexcept |
Increments the reference counter of this object. | |
Standard_Integer | DecrementRefCounter () noexcept |
Decrements the reference counter of this object; returns the decremented value. | |
virtual void | Delete () const |
Memory deallocator for transient classes. | |
Protected Member Functions | |
void | CalculateDerivative (const Standard_Real &theParameter, const Standard_Integer &theDerivative, Standard_Real &theDerivArray) const |
Fills array of derivatives in the selected point of the curve. | |
BSplCLib_Cache (const BSplCLib_Cache &) | |
void | operator= (const BSplCLib_Cache &) |
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 Standard_Integer & | theDegree, |
const Standard_Boolean & | thePeriodic, | ||
const TColStd_Array1OfReal & | theFlatKnots, | ||
const TColgp_Array1OfPnt2d & | thePoles2d, | ||
const TColStd_Array1OfReal * | theWeights = NULL ) |
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 Standard_Integer & | theDegree, |
const Standard_Boolean & | thePeriodic, | ||
const TColStd_Array1OfReal & | theFlatKnots, | ||
const TColgp_Array1OfPnt & | thePoles, | ||
const TColStd_Array1OfReal * | theWeights = NULL ) |
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 |
|
protected |
void BSplCLib_Cache::BuildCache | ( | const Standard_Real & | theParameter, |
const TColStd_Array1OfReal & | theFlatKnots, | ||
const TColgp_Array1OfPnt & | thePoles, | ||
const TColStd_Array1OfReal * | theWeights = NULL ) |
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 Standard_Real & | theParameter, |
const TColStd_Array1OfReal & | theFlatKnots, | ||
const TColgp_Array1OfPnt2d & | thePoles2d, | ||
const TColStd_Array1OfReal * | 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) |
void BSplCLib_Cache::D0 | ( | const Standard_Real & | theParameter, |
gp_Pnt & | thePoint ) const |
void BSplCLib_Cache::D0 | ( | const Standard_Real & | theParameter, |
gp_Pnt2d & | thePoint ) const |
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) |
void BSplCLib_Cache::D1 | ( | const Standard_Real & | theParameter, |
gp_Pnt & | thePoint, | ||
gp_Vec & | theTangent ) const |
void BSplCLib_Cache::D1 | ( | const Standard_Real & | 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 |
void BSplCLib_Cache::D2 | ( | const Standard_Real & | theParameter, |
gp_Pnt & | thePoint, | ||
gp_Vec & | theTangent, | ||
gp_Vec & | theCurvature ) const |
void BSplCLib_Cache::D2 | ( | const Standard_Real & | 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::D3 | ( | const Standard_Real & | theParameter, |
gp_Pnt & | thePoint, | ||
gp_Vec & | theTangent, | ||
gp_Vec & | theCurvature, | ||
gp_Vec & | theTorsion ) const |
void BSplCLib_Cache::D3 | ( | const Standard_Real & | 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 |
Standard_Boolean BSplCLib_Cache::IsCacheValid | ( | Standard_Real | theParameter | ) | const |
Verifies validity of the cache using flat parameter of the point.
theParameter | parameter of the point placed in the span |
|
protected |