Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
BSplSLib_Cache Class Reference

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

#include <BSplSLib_Cache.hxx>

Inheritance diagram for BSplSLib_Cache:
Inheritance graph
[legend]

Public Member Functions

 BSplSLib_Cache (const int &theDegreeU, const bool &thePeriodicU, const NCollection_Array1< double > &theFlatKnotsU, const int &theDegreeV, const bool &thePeriodicV, const NCollection_Array1< double > &theFlatKnotsV, const NCollection_Array2< double > *theWeights=nullptr)
 Constructor for caching of the span for the surface.
 
bool IsCacheValid (double theParameterU, double theParameterV) const
 Verifies validity of the cache using parameters of the point.
 
void BuildCache (const double &theParameterU, const double &theParameterV, const NCollection_Array1< double > &theFlatKnotsU, const NCollection_Array1< double > &theFlatKnotsV, const NCollection_Array2< gp_Pnt > &thePoles, const NCollection_Array2< double > *theWeights=nullptr)
 Recomputes the cache data. Does not verify validity of the cache.
 
void D0 (const double &theU, const double &theV, gp_Pnt &thePoint) const
 Calculates the point on the surface for specified parameters.
 
void D1 (const double &theU, const double &theV, gp_Pnt &thePoint, gp_Vec &theTangentU, gp_Vec &theTangentV) const
 Calculates the point on the surface and its first derivative.
 
void D2 (const double &theU, const double &theV, gp_Pnt &thePoint, gp_Vec &theTangentU, gp_Vec &theTangentV, gp_Vec &theCurvatureU, gp_Vec &theCurvatureV, gp_Vec &theCurvatureUV) const
 Calculates the point on the surface and derivatives till second order.
 
void D0Local (double theLocalU, double theLocalV, gp_Pnt &thePoint) const
 Calculates the point using pre-computed local parameters in [-1, 1] range. This bypasses periodic normalization and local parameter calculation.
 
void D1Local (double theLocalU, double theLocalV, gp_Pnt &thePoint, gp_Vec &theTangentU, gp_Vec &theTangentV) const
 Calculates the point and first derivatives using pre-computed local parameters in [-1, 1] range. This bypasses periodic normalization and local parameter calculation.
 
void D2Local (double theLocalU, double theLocalV, gp_Pnt &thePoint, gp_Vec &theTangentU, gp_Vec &theTangentV, gp_Vec &theCurvatureU, gp_Vec &theCurvatureV, gp_Vec &theCurvatureUV) const
 Calculates the point and derivatives till second order using pre-computed local parameters. This bypasses periodic normalization and local parameter calculation.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (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_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.
 
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.
 

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 charget_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.
 

Detailed Description

A cache class for Bezier and B-spline surfaces.

Defines all data, that can be cached on a span of the surface. The data should be recalculated in going from span to span.

Constructor & Destructor Documentation

◆ BSplSLib_Cache()

BSplSLib_Cache::BSplSLib_Cache ( const int & theDegreeU,
const bool & thePeriodicU,
const NCollection_Array1< double > & theFlatKnotsU,
const int & theDegreeV,
const bool & thePeriodicV,
const NCollection_Array1< double > & theFlatKnotsV,
const NCollection_Array2< double > * theWeights = nullptr )

Constructor for caching of the span for the surface.

Parameters
theDegreeUdegree along the first parameter (U) of the surface
thePeriodicUidentify the surface is periodical along U axis
theFlatKnotsUknots of the surface (with repetition) along U axis
theDegreeVdegree along the second parameter (V) of the surface
thePeriodicVidentify the surface is periodical along V axis
theFlatKnotsVknots of the surface (with repetition) along V axis
theWeightsarray of weights of corresponding poles

Member Function Documentation

◆ BuildCache()

void BSplSLib_Cache::BuildCache ( const double & theParameterU,
const double & theParameterV,
const NCollection_Array1< double > & theFlatKnotsU,
const NCollection_Array1< double > & theFlatKnotsV,
const NCollection_Array2< gp_Pnt > & thePoles,
const NCollection_Array2< double > * theWeights = nullptr )

Recomputes the cache data. Does not verify validity of the cache.

Parameters
theParameterUthe parametric value on the U axis to identify the span
theParameterVthe parametric value on the V axis to identify the span
theDegreeUdegree along U axis
thePeriodicUidentify whether the surface is periodic along U axis
theFlatKnotsUflat knots of the surface along U axis
theDegreeVdegree along V axis
thePeriodicVidentify whether the surface is periodic along V axis
theFlatKnotsVflat knots of the surface along V axis
thePolesarray of poles of the surface
theWeightsarray of weights of corresponding poles

◆ D0()

void BSplSLib_Cache::D0 ( const double & theU,
const double & theV,
gp_Pnt & thePoint ) const

Calculates the point on the surface for specified parameters.

Parameters
[in]theUfirst parameter for calculation of the value
[in]theVsecond parameter for calculation of the value
[out]thePointthe result of calculation (the point on the surface)

◆ D0Local()

void BSplSLib_Cache::D0Local ( double theLocalU,
double theLocalV,
gp_Pnt & thePoint ) const

Calculates the point using pre-computed local parameters in [-1, 1] range. This bypasses periodic normalization and local parameter calculation.

Parameters
[in]theLocalUpre-computed local U parameter: (U - SpanMid) / SpanHalfLen
[in]theLocalVpre-computed local V parameter: (V - SpanMid) / SpanHalfLen
[out]thePointthe result of calculation (the point on the surface)

◆ D1()

void BSplSLib_Cache::D1 ( const double & theU,
const double & theV,
gp_Pnt & thePoint,
gp_Vec & theTangentU,
gp_Vec & theTangentV ) const

Calculates the point on the surface and its first derivative.

Parameters
[in]theUfirst parameter of calculation of the value
[in]theVsecond parameter of calculation of the value
[out]thePointthe result of calculation (the point on the surface)
[out]theTangentUtangent vector along U axis in the calculated point
[out]theTangentVtangent vector along V axis in the calculated point

◆ D1Local()

void BSplSLib_Cache::D1Local ( double theLocalU,
double theLocalV,
gp_Pnt & thePoint,
gp_Vec & theTangentU,
gp_Vec & theTangentV ) const

Calculates the point and first derivatives using pre-computed local parameters in [-1, 1] range. This bypasses periodic normalization and local parameter calculation.

Parameters
[in]theLocalUpre-computed local U parameter: (U - SpanMid) / SpanHalfLen
[in]theLocalVpre-computed local V parameter: (V - SpanMid) / SpanHalfLen
[out]thePointthe result of calculation (the point on the surface)
[out]theTangentUtangent vector along U axis in the calculated point
[out]theTangentVtangent vector along V axis in the calculated point

◆ D2()

void BSplSLib_Cache::D2 ( const double & theU,
const double & theV,
gp_Pnt & thePoint,
gp_Vec & theTangentU,
gp_Vec & theTangentV,
gp_Vec & theCurvatureU,
gp_Vec & theCurvatureV,
gp_Vec & theCurvatureUV ) const

Calculates the point on the surface and derivatives till second order.

Parameters
[in]theUfirst parameter of calculation of the value
[in]theVsecond parameter of calculation of the value
[out]thePointthe result of calculation (the point on the surface)
[out]theTangentUtangent vector along U axis in the calculated point
[out]theTangentVtangent vector along V axis in the calculated point
[out]theCurvatureUcurvature vector (2nd derivative on U) along U axis
[out]theCurvatureVcurvature vector (2nd derivative on V) along V axis
[out]theCurvatureUV2nd mixed derivative on U anv V

◆ D2Local()

void BSplSLib_Cache::D2Local ( double theLocalU,
double theLocalV,
gp_Pnt & thePoint,
gp_Vec & theTangentU,
gp_Vec & theTangentV,
gp_Vec & theCurvatureU,
gp_Vec & theCurvatureV,
gp_Vec & theCurvatureUV ) const

Calculates the point and derivatives till second order using pre-computed local parameters. This bypasses periodic normalization and local parameter calculation.

Parameters
[in]theLocalUpre-computed local U parameter: (U - SpanMid) / SpanHalfLen
[in]theLocalVpre-computed local V parameter: (V - SpanMid) / SpanHalfLen
[out]thePointthe result of calculation (the point on the surface)
[out]theTangentUtangent vector along U axis in the calculated point
[out]theTangentVtangent vector along V axis in the calculated point
[out]theCurvatureUcurvature vector (2nd derivative on U) along U axis
[out]theCurvatureVcurvature vector (2nd derivative on V) along V axis
[out]theCurvatureUV2nd mixed derivative on U and V

◆ IsCacheValid()

bool BSplSLib_Cache::IsCacheValid ( double theParameterU,
double theParameterV ) const

Verifies validity of the cache using parameters of the point.

Parameters
theParameterUfirst parameter of the point placed in the span
theParameterVsecond parameter of the point placed in the span

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