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 | Friends | List of all members
BIAS::Nurbs3D< ControlPointsT > Class Template Reference

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

#include <MathAlgo/Nurbs/Nurbs3D.hh>

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

Public Member Functions

void Eval (const BIAS::Vector3< double > &nurbsParam, ControlPointsT &result) const
 Evaluate the NURBS function at a given point in the parameter space. More...
 
void EvalBaseFunc (const int x, const int y, const int z, const BIAS::Vector3< 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 int z, const BIAS::Vector3< 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 (const int &indexU, const int &indexV, const int &indexW) 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...
 
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 BIAS::Vector3< double > &nurbsParam, BIAS::Vector3< int > &begin, BIAS::Vector3< 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...
 
void Init (const ControlPointsT minX, const ControlPointsT maxX, const ControlPointsT minY, const ControlPointsT maxY, const ControlPointsT minZ, const ControlPointsT maxZ)
 Very generic initialization function for the control points. More...
 
 Nurbs3D (int knotsPerDim=4, int degree=2)
 Standard Constructor. More...
 
void SetCtrlPoint (const int &indexU, const int &indexV, const int &indexW, 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...
 
 ~Nurbs3D ()
 

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...
 
std::vector< BIAS::Vector3< int > > sphereCtrlPoints_
 A vector containing the control points in the vicinity of the hyper sphere. More...
 
double *** weights_
 The corresponding weights to the function points. More...
 

Friends

class AdvancedOptimizerNurbs3D
 
class SimpleOptimizerNurbs3D
 

Detailed Description

template<class ControlPointsT>
class BIAS::Nurbs3D< ControlPointsT >

This class implements a NURBS-function with a three dimensional parameter space (A NURBS volume).

The dimension of the output values is defined by the template type of control points Note: For common NURBS surface use the Nurbs2D class with three dimensional control points

Author
jordt

Definition at line 31 of file Nurbs3D.hh.

Constructor & Destructor Documentation

template<class ControlPointsT >
Nurbs3D::Nurbs3D ( 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 24 of file Nurbs3D.cpp.

References BIAS::Nurbs3D< ControlPointsT >::controlPoints_, BIAS::Nurbs3D< ControlPointsT >::EvalBaseFunc(), TemplateInit::Init(), BIAS::Vector3< T >::Length(), BIAS::Vector3< T >::Normalize(), BIAS::NurbsBase::numCtrlPoints_, BIAS::Nurbs3D< ControlPointsT >::sphereCtrlPoints_, and BIAS::Nurbs3D< ControlPointsT >::weights_.

template<class ControlPointsT >
Nurbs3D::~Nurbs3D ( )

Definition at line 61 of file Nurbs3D.cpp.

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 Nurbs3D::Eval ( const BIAS::Vector3< double > &  nurbsParam,
ControlPointsT &  result 
) const

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

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

Definition at line 78 of file Nurbs3D.cpp.

References TemplateInit::Init().

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

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

Definition at line 103 of file Nurbs3D.hh.

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

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

template<class ControlPointsT >
void BIAS::Nurbs3D< ControlPointsT >::EvalBaseFunc ( const int  x,
const int  y,
const int  z,
const BIAS::Vector3< 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 109 of file Nurbs3D.hh.

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

template<class ControlPointsT >
ControlPointsT BIAS::Nurbs3D< ControlPointsT >::GetCtrlPoint ( const int &  indexU,
const int &  indexV,
const int &  indexW 
) const
inline

Get the value of a specific control point.

No out of bounds checks are performed in release builds

Parameters
indexUThe u index of the control point
indexVThe v index of the control point
indexWThe w index of the control point

Definition at line 92 of file Nurbs3D.hh.

References BIAS::Nurbs3D< 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.

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::Nurbs3D< ControlPointsT >::GetRelevantBaseCtrlPoints ( const BIAS::Vector3< double > &  nurbsParam,
BIAS::Vector3< int > &  begin,
BIAS::Vector3< 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 (indices)
endThe last control points (indices)

Definition at line 118 of file Nurbs3D.hh.

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

template<class ControlPointsT >
void Nurbs3D::Init ( const ControlPointsT  minX,
const ControlPointsT  maxX,
const ControlPointsT  minY,
const ControlPointsT  maxY,
const ControlPointsT  minZ,
const ControlPointsT  maxZ 
)

Very generic initialization function for the control points.

The control points will be distributed equally over the cube defined by the min-max values.

Definition at line 115 of file Nurbs3D.cpp.

template<class ControlPointsT >
void BIAS::Nurbs3D< ControlPointsT >::SetCtrlPoint ( const int &  indexU,
const int &  indexV,
const int &  indexW,
const ControlPointsT &  value 
)
inline

Set the value of a specific control point.

No out of bounds checks are performed in release builds

Parameters
indexUThe u index of the control point
indexVThe v index of the control point
indexWThe w index of the control point
valueThe value that is assigned to the control point

Definition at line 77 of file Nurbs3D.hh.

References BIAS::Nurbs3D< 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.

Friends And Related Function Documentation

template<class ControlPointsT >
friend class AdvancedOptimizerNurbs3D
friend

Definition at line 34 of file Nurbs3D.hh.

template<class ControlPointsT >
friend class SimpleOptimizerNurbs3D
friend

Definition at line 33 of file Nurbs3D.hh.

Member Data Documentation

int BIAS::NurbsBase::baseOps_
protectedinherited

Definition at line 78 of file NurbsBase.hh.

template<class ControlPointsT >
ControlPointsT*** BIAS::Nurbs3D< 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 >
std::vector<BIAS::Vector3<int> > BIAS::Nurbs3D< ControlPointsT >::sphereCtrlPoints_
protected

A vector containing the control points in the vicinity of the hyper sphere.

Definition at line 65 of file Nurbs3D.hh.

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

template<class ControlPointsT >
double*** BIAS::Nurbs3D< ControlPointsT >::weights_
protected

The corresponding weights to the function points.

Definition at line 62 of file Nurbs3D.hh.

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


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