Open CASCADE Technology  7.2.0
Public Member Functions | Protected Member Functions

BSplCLib_Cache Class Reference

A cache class for Bezier and B-spline curves. More...

#include <BSplCLib_Cache.hxx>

Inheritance diagram for BSplCLib_Cache:
Inheritance graph
[legend]

Public Member Functions

 BSplCLib_Cache ()
 Default constructor. More...
 
 BSplCLib_Cache (const Standard_Integer &theDegree, const Standard_Boolean &thePeriodic, const TColStd_Array1OfReal &theFlatKnots, const TColgp_Array1OfPnt2d &thePoles2d, const TColStd_Array1OfReal *theWeights=NULL)
 Constructor for caching of 2D curves. More...
 
 BSplCLib_Cache (const Standard_Integer &theDegree, const Standard_Boolean &thePeriodic, const TColStd_Array1OfReal &theFlatKnots, const TColgp_Array1OfPnt &thePoles, const TColStd_Array1OfReal *theWeights=NULL)
 Constructor for caching of 3D curves. More...
 
Standard_Boolean IsCacheValid (Standard_Real theParameter) const
 Verifies validity of the cache using flat parameter of the point. More...
 
void BuildCache (const Standard_Real &theParameter, const Standard_Integer &theDegree, const Standard_Boolean &thePeriodic, const TColStd_Array1OfReal &theFlatKnots, const TColgp_Array1OfPnt2d &thePoles2d, const TColStd_Array1OfReal *theWeights=NULL)
 Recomputes the cache data for 2D curves. Does not verify validity of the cache. More...
 
void BuildCache (const Standard_Real &theParameter, const Standard_Integer &theDegree, const Standard_Boolean &thePeriodic, 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. More...
 
void D0 (const Standard_Real &theParameter, gp_Pnt2d &thePoint) const
 Calculates the point on the curve in the specified parameter. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
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. More...
 
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. More...
 
Standard_TransientThis () 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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Member Functions

void PeriodicNormalization (const TColStd_Array1OfReal &theFlatKnots, Standard_Real &theParameter) const
 Normalizes the parameter for periodical curves. More...
 
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. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BSplCLib_Cache() [1/3]

BSplCLib_Cache::BSplCLib_Cache ( )

Default constructor.

◆ BSplCLib_Cache() [2/3]

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 for caching of 2D curves.

Parameters
theDegreedegree of the curve
thePeriodicidentify the curve is periodic
theFlatKnotsknots of Bezier/B-spline curve (with repetitions)
thePoles2darray of poles of 2D curve
theWeightsarray of weights of corresponding poles

◆ BSplCLib_Cache() [3/3]

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 for caching of 3D curves.

Parameters
theDegreedegree of the curve
thePeriodicidentify the curve is periodic
theFlatKnotsknots of Bezier/B-spline curve (with repetitions)
thePolesarray of poles of 3D curve
theWeightsarray of weights of corresponding poles

Member Function Documentation

◆ BuildCache() [1/2]

void BSplCLib_Cache::BuildCache ( const Standard_Real theParameter,
const Standard_Integer theDegree,
const Standard_Boolean thePeriodic,
const TColStd_Array1OfReal theFlatKnots,
const TColgp_Array1OfPnt2d thePoles2d,
const TColStd_Array1OfReal theWeights = NULL 
)

Recomputes the cache data for 2D curves. Does not verify validity of the cache.

Parameters
theParameterthe value on the knot's axis to identify the span
theDegreedegree of the curve
thePeriodicidentify the curve is periodic
theFlatKnotsknots of Bezier/B-spline curve (with repetitions)
thePoles2darray of poles of 2D curve
theWeightsarray of weights of corresponding poles

◆ BuildCache() [2/2]

void BSplCLib_Cache::BuildCache ( const Standard_Real theParameter,
const Standard_Integer theDegree,
const Standard_Boolean thePeriodic,
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.

Parameters
theParameterthe value on the knot's axis to identify the span
theDegreedegree of the curve
thePeriodicidentify the curve is periodic
theFlatKnotsknots of Bezier/B-spline curve (with repetitions)
thePolesarray of poles of 3D curve
theWeightsarray of weights of corresponding poles

◆ CalculateDerivative()

void BSplCLib_Cache::CalculateDerivative ( const Standard_Real theParameter,
const Standard_Integer theDerivative,
Standard_Real theDerivArray 
) const
protected

Fills array of derivatives in the selected point of the curve.

Parameters
[in]theParameterparameter of the calculation
[in]theDerivativemaximal derivative to be calculated (computes all derivatives lesser than specified)
[out]theDerivArrayresult array of derivatives (with size (theDerivative+1)*(PntDim+1), where PntDim = 2 or 3 is a dimension of the curve)

◆ D0() [1/2]

void BSplCLib_Cache::D0 ( const Standard_Real theParameter,
gp_Pnt2d thePoint 
) const

Calculates the point on the curve in the specified parameter.

Parameters
[in]theParameterparameter of calculation of the value
[out]thePointthe result of calculation (the point on the curve)

◆ D0() [2/2]

void BSplCLib_Cache::D0 ( const Standard_Real theParameter,
gp_Pnt thePoint 
) const

◆ D1() [1/2]

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.

Parameters
[in]theParameterparameter of calculation of the value
[out]thePointthe result of calculation (the point on the curve)
[out]theTangenttangent vector (first derivatives) for the curve in the calculated point

◆ D1() [2/2]

void BSplCLib_Cache::D1 ( const Standard_Real theParameter,
gp_Pnt thePoint,
gp_Vec theTangent 
) const

◆ D2() [1/2]

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.

Parameters
[in]theParameterparameter of calculation of the value
[out]thePointthe result of calculation (the point on the curve)
[out]theTangenttangent vector (1st derivatives) for the curve in the calculated point
[out]theCurvaturecurvature vector (2nd derivatives) for the curve in the calculated point

◆ D2() [2/2]

void BSplCLib_Cache::D2 ( const Standard_Real theParameter,
gp_Pnt thePoint,
gp_Vec theTangent,
gp_Vec theCurvature 
) const

◆ D3() [1/2]

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.

Parameters
[in]theParameterparameter of calculation of the value
[out]thePointthe result of calculation (the point on the curve)
[out]theTangenttangent vector (1st derivatives) for the curve in the calculated point
[out]theCurvaturecurvature vector (2nd derivatives) for the curve in the calculated point
[out]theTorsionsecond curvature vector (3rd derivatives) for the curve in the calculated point

◆ D3() [2/2]

void BSplCLib_Cache::D3 ( const Standard_Real theParameter,
gp_Pnt thePoint,
gp_Vec theTangent,
gp_Vec theCurvature,
gp_Vec theTorsion 
) const

◆ IsCacheValid()

Standard_Boolean BSplCLib_Cache::IsCacheValid ( Standard_Real  theParameter) const

Verifies validity of the cache using flat parameter of the point.

Parameters
theParameterparameter of the point placed in the span

◆ PeriodicNormalization()

void BSplCLib_Cache::PeriodicNormalization ( const TColStd_Array1OfReal theFlatKnots,
Standard_Real theParameter 
) const
protected

Normalizes the parameter for periodical curves.

Parameters
theFlatKnotsknots with repetitions
theParameterthe value to be normalized into the knots array

The documentation for this class was generated from the following file: