Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BIAS::NurbsBase Class Reference

Base class for NURBS classes. More...

#include <MathAlgo/Nurbs/NurbsBase.hh>

+ Inheritance diagram for BIAS::NurbsBase:
+ Collaboration diagram for BIAS::NurbsBase:

Public Member Functions

int GetDegree () const
 Returns the degree of the NURBS. More...
 
double GetKnot (int dim, int index) const
 Returns the position of a knot with a given index of a given dimension. More...
 
int GetNumCtrlPts () const
 Returns the number of control points per dimension. More...
 
int GetNumKnots () const
 Returns the number of knots of the NURBS. More...
 
 NurbsBase (int knotsPerDim=4, int degree=2, int dimension=1)
 Standard Constructor. More...
 
void SetKnot (int dim, int index, double value)
 Set the position of a knot with a given index and of a given dimension. More...
 
 ~NurbsBase ()
 Empty Destructor (Virtual to make this whole thing polymorphic) More...
 

Protected Member Functions

double BaseFunc (const int &dim, const int &knot, const int &degree, const double &u) const
 This is a serial implementation of the recursive nurbs evaluation. More...
 
double BaseFunc (const int &dim, const int &knot, const int &degree, const double &u, double *&cachePointer) const
 This is a serial implementation of the recursive nurbs evaluation. More...
 

Protected Attributes

int baseOps_
 
int degree_
 Degree of the b-splines. More...
 
int knotsPerDim_
 Number of knots in each dimension. More...
 
std::vector< std::vector
< double > > 
knotVector_
 The vector of knot vectors (One for each dimension) More...
 
int numCtrlPoints_
 The number of control points per dimension. More...
 

Detailed Description

Base class for NURBS classes.

The NURBS Base function is implemented here

Author
jordt

Definition at line 29 of file NurbsBase.hh.

Constructor & Destructor Documentation

NurbsBase::NurbsBase ( int  knotsPerDim = 4,
int  degree = 2,
int  dimension = 1 
)

Standard Constructor.

Parameters
knotsPerDimThe number of knots in the knot vector (without the dublications)
degreeThe degree of the b-splines
dimensionThe dimension of the parameter space! (not the control point space)

Definition at line 16 of file NurbsBase.cpp.

BIAS::NurbsBase::~NurbsBase ( )
inline

Empty Destructor (Virtual to make this whole thing polymorphic)

Definition at line 40 of file NurbsBase.hh.

Member Function Documentation

double BIAS::NurbsBase::BaseFunc ( const int &  dim,
const int &  knot,
const int &  degree,
const double &  u 
) const
inlineprotected

This is a serial implementation of the recursive nurbs evaluation.

Recursive function values are stored in the evaluation cache (evalCache_)

Parameters
dimThe dimension (determines which knot vector is used)
knotThe index of the knot in the knot vector
degreeThe current degree the function is evaluated in
uThe parmeter for which the base function is evaluated

Definition at line 108 of file NurbsBase.hh.

References knotVector_.

Referenced by BIAS::Nurbs1D< ControlPointsT >::EvalBaseFunc(), BIAS::Nurbs2D< ControlPointsT >::EvalBaseFunc(), and BIAS::Nurbs3D< ControlPointsT >::EvalBaseFunc().

double BIAS::NurbsBase::BaseFunc ( const int &  dim,
const int &  knot,
const int &  degree,
const double &  u,
double *&  cachePointer 
) const
inlineprotected

This is a serial implementation of the recursive nurbs evaluation.

Recursive function values are stored in the evaluation cache (evalCache_) In this function, the cache pointer has to be provided in order to save the memory allocation time.

Parameters
dimThe dimension (determines which knot vector is used)
knotThe index of the knot in the knot vector
degreeThe current degree the function is evaluated in
uThe parmeter for which the base function is evaluated
cachePointerThe pointer to a cache, this function is allowed to use (already allocated). The size should be degree+1

Definition at line 152 of file NurbsBase.hh.

References knotVector_.

int NurbsBase::GetDegree ( ) const

Returns the degree of the NURBS.

Definition at line 61 of file NurbsBase.cpp.

double NurbsBase::GetKnot ( int  dim,
int  index 
) const

Returns the position of a knot with a given index of a given dimension.

Definition at line 69 of file NurbsBase.cpp.

int NurbsBase::GetNumCtrlPts ( ) const

Returns the number of control points per dimension.

Definition at line 65 of file NurbsBase.cpp.

int NurbsBase::GetNumKnots ( ) const

Returns the number of knots of the NURBS.

Definition at line 57 of file NurbsBase.cpp.

void NurbsBase::SetKnot ( int  dim,
int  index,
double  value 
)

Set the position of a knot with a given index and of a given dimension.

Definition at line 75 of file NurbsBase.cpp.

Member Data Documentation

int BIAS::NurbsBase::baseOps_
protected

Definition at line 78 of file NurbsBase.hh.

int BIAS::NurbsBase::degree_
protected
int BIAS::NurbsBase::knotsPerDim_
protected

Number of knots in each dimension.

Definition at line 65 of file NurbsBase.hh.

std::vector<std::vector<double> > BIAS::NurbsBase::knotVector_
protected
int BIAS::NurbsBase::numCtrlPoints_
protected

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