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::Nurbs1D< ControlPointsT > Class Template Reference

This class implements a NURBS-function with a one dimensional parameter space (A NURBS line). More...

#include <MathAlgo/Nurbs/Nurbs1D.hh>

+ Inheritance diagram for BIAS::Nurbs1D< ControlPointsT >:
+ Collaboration diagram for BIAS::Nurbs1D< ControlPointsT >:

Public Member Functions

void Eval (const double &nurbsParam, ControlPointsT &result) const
 Evaluate the NURBS function at a given point in the parameter space. More...
 
const void EvalBaseFunc (const int x, const double &nurbsParam, double &result) const
 Evaluate the base function for the control point (x,y,z) for the point nurbsParam. More...
 
void EvalBaseFunc (const int x, const int y, const double &nurbsParam, double &result, double *baseFuncCache) const
 Evaluate the base function for the control point (x,y,z) for the point nurbsParam using a dedicated cache for the serial evaluation. More...
 
ControlPointsT GetCtrlPoint (int &index) const
 Get the value of a specific control point. More...
 
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...
 
double GetKnot (int index) const
 Returns the position of a knot with a given index. 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...
 
void GetRelevantBaseCtrlPoints (const double &nurbsParam, int &begin, int &end) const
 for a given point in the parameter space, this functions yields for each dimension the first and the last control point index influencing the value at this position. More...
 
 Nurbs1D (int knotsPerDim=4, int degree=2)
 Standard Constructor. More...
 
void SetCtrlPoint (const int &index, const ControlPointsT &value)
 Set the value of a specific control point. 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...
 
void SetKnot (int index, double value)
 Set the position of a knot with a given index. 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_
 
ControlPointsT * controlPoints_
 The array of control points. More...
 
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...
 
double * weights_
 The corresponding weights to the function points. More...
 

Detailed Description

template<class ControlPointsT>
class BIAS::Nurbs1D< ControlPointsT >

This class implements a NURBS-function with a one dimensional parameter space (A NURBS line).

The dimension of the output values is defined by the template type of control points

Author
jordt

Definition at line 24 of file Nurbs1D.hh.

Constructor & Destructor Documentation

template<class ControlPointsT >
Nurbs1D::Nurbs1D ( int  knotsPerDim = 4,
int  degree = 2 
)

Standard Constructor.

Parameters
knotsPerDimThe number of knots in the knot vector (without the dublications)
degreeThe degree of the b-splines

Definition at line 25 of file Nurbs1D.cpp.

References BIAS::Nurbs1D< ControlPointsT >::controlPoints_, TemplateInit::Init(), BIAS::NurbsBase::numCtrlPoints_, and BIAS::Nurbs1D< ControlPointsT >::weights_.

Member Function Documentation

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

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 BIAS::NurbsBase::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
inlineprotectedinherited

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 BIAS::NurbsBase::knotVector_.

template<class ControlPointsT >
void Nurbs1D::Eval ( const double &  nurbsParam,
ControlPointsT &  result 
) const

Evaluate the NURBS function at a given point in the parameter space.

Parameters
nurbsParamPoint in the parameter space ( [0] - [1] )
resultThe return value

Definition at line 41 of file Nurbs1D.cpp.

References TemplateInit::Init().

template<class ControlPointsT >
const void BIAS::Nurbs1D< ControlPointsT >::EvalBaseFunc ( const int  x,
const double &  nurbsParam,
double &  result 
) const
inline

Evaluate the base function for the control point (x,y,z) for the point nurbsParam.

Definition at line 70 of file Nurbs1D.hh.

References BIAS::NurbsBase::BaseFunc(), and BIAS::NurbsBase::degree_.

template<class ControlPointsT >
void BIAS::Nurbs1D< ControlPointsT >::EvalBaseFunc ( const int  x,
const int  y,
const double &  nurbsParam,
double &  result,
double *  baseFuncCache 
) const
inline

Evaluate the base function for the control point (x,y,z) for the point nurbsParam using a dedicated cache for the serial evaluation.

Definition at line 76 of file Nurbs1D.hh.

References BIAS::NurbsBase::BaseFunc(), and BIAS::NurbsBase::degree_.

template<class ControlPointsT >
ControlPointsT BIAS::Nurbs1D< ControlPointsT >::GetCtrlPoint ( int &  index) const
inline

Get the value of a specific control point.

No out of bounds checks are performed in release builds

Parameters
indexThe index of the control point

Definition at line 63 of file Nurbs1D.hh.

References BIAS::Nurbs1D< ControlPointsT >::controlPoints_, and BIAS::NurbsBase::numCtrlPoints_.

int NurbsBase::GetDegree ( ) const
inherited

Returns the degree of the NURBS.

Definition at line 61 of file NurbsBase.cpp.

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

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

Definition at line 69 of file NurbsBase.cpp.

template<class ControlPointsT >
double Nurbs1D::GetKnot ( int  index) const

Returns the position of a knot with a given index.

Definition at line 71 of file Nurbs1D.cpp.

int NurbsBase::GetNumCtrlPts ( ) const
inherited

Returns the number of control points per dimension.

Definition at line 65 of file NurbsBase.cpp.

int NurbsBase::GetNumKnots ( ) const
inherited

Returns the number of knots of the NURBS.

Definition at line 57 of file NurbsBase.cpp.

template<class ControlPointsT >
void BIAS::Nurbs1D< ControlPointsT >::GetRelevantBaseCtrlPoints ( const double &  nurbsParam,
int &  begin,
int &  end 
) const
inline

for a given point in the parameter space, this functions yields for each dimension the first and the last control point index influencing the value at this position.

Parameters
nurbsParamThe point in the parameter space to perform the test in
beginThe first control point (index)
endThe last control points (index)

Definition at line 85 of file Nurbs1D.hh.

References BIAS::NurbsBase::degree_, BIAS::NurbsBase::knotVector_, and BIAS::NurbsBase::numCtrlPoints_.

template<class ControlPointsT >
void BIAS::Nurbs1D< ControlPointsT >::SetCtrlPoint ( const int &  index,
const ControlPointsT &  value 
)
inline

Set the value of a specific control point.

No out of bounds checks are performed in release builds

Parameters
indexThe index of the control point
valueThe value that is assigned to the control point

Definition at line 54 of file Nurbs1D.hh.

References BIAS::Nurbs1D< ControlPointsT >::controlPoints_, and BIAS::NurbsBase::numCtrlPoints_.

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

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

Definition at line 75 of file NurbsBase.cpp.

template<class ControlPointsT >
void Nurbs1D::SetKnot ( int  index,
double  value 
)

Set the position of a knot with a given index.

Definition at line 77 of file Nurbs1D.cpp.

Member Data Documentation

int BIAS::NurbsBase::baseOps_
protectedinherited

Definition at line 78 of file NurbsBase.hh.

template<class ControlPointsT >
ControlPointsT* BIAS::Nurbs1D< ControlPointsT >::controlPoints_
protected
int BIAS::NurbsBase::degree_
protectedinherited
int BIAS::NurbsBase::knotsPerDim_
protectedinherited

Number of knots in each dimension.

Definition at line 65 of file NurbsBase.hh.

std::vector<std::vector<double> > BIAS::NurbsBase::knotVector_
protectedinherited
int BIAS::NurbsBase::numCtrlPoints_
protectedinherited
template<class ControlPointsT >
double* BIAS::Nurbs1D< ControlPointsT >::weights_
protected

The corresponding weights to the function points.

Definition at line 44 of file Nurbs1D.hh.

Referenced by BIAS::Nurbs1D< ControlPointsT >::Nurbs1D().


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