Basic Image AlgorithmS Library
2.8.0
|
This class implements a NURBS-function with a three dimensional parameter space (A NURBS volume). More...
#include <MathAlgo/Nurbs/Nurbs3D.hh>
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 °ree, 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 °ree, 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 |
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
Definition at line 31 of file Nurbs3D.hh.
Nurbs3D::Nurbs3D | ( | int | knotsPerDim = 4 , |
int | degree = 2 |
||
) |
Standard Constructor.
knotsPerDim | The number of knots in the knot vector (without the dublications) |
degree | The 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_.
Nurbs3D::~Nurbs3D | ( | ) |
Definition at line 61 of file Nurbs3D.cpp.
|
inlineprotectedinherited |
This is a serial implementation of the recursive nurbs evaluation.
Recursive function values are stored in the evaluation cache (evalCache_)
dim | The dimension (determines which knot vector is used) |
knot | The index of the knot in the knot vector |
degree | The current degree the function is evaluated in |
u | The 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().
|
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.
dim | The dimension (determines which knot vector is used) |
knot | The index of the knot in the knot vector |
degree | The current degree the function is evaluated in |
u | The parmeter for which the base function is evaluated |
cachePointer | The 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_.
void Nurbs3D::Eval | ( | const BIAS::Vector3< double > & | nurbsParam, |
ControlPointsT & | result | ||
) | const |
Evaluate the NURBS function at a given point in the parameter space.
nurbsParam | Point in the parameter space ( [0,0,0] - [1,1,1] ) |
result | The return value |
Definition at line 78 of file Nurbs3D.cpp.
References TemplateInit::Init().
|
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().
|
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_.
|
inline |
Get the value of a specific control point.
No out of bounds checks are performed in release builds
indexU | The u index of the control point |
indexV | The v index of the control point |
indexW | The w index of the control point |
Definition at line 92 of file Nurbs3D.hh.
References BIAS::Nurbs3D< ControlPointsT >::controlPoints_, and BIAS::NurbsBase::numCtrlPoints_.
|
inherited |
Returns the degree of the NURBS.
Definition at line 61 of file NurbsBase.cpp.
|
inherited |
Returns the position of a knot with a given index of a given dimension.
Definition at line 69 of file NurbsBase.cpp.
|
inherited |
Returns the number of control points per dimension.
Definition at line 65 of file NurbsBase.cpp.
|
inherited |
Returns the number of knots of the NURBS.
Definition at line 57 of file NurbsBase.cpp.
|
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.
nurbsParam | The point in the parameter space to perform the test in |
begin | The first control point (indices) |
end | The last control points (indices) |
Definition at line 118 of file Nurbs3D.hh.
References BIAS::NurbsBase::degree_, BIAS::NurbsBase::knotVector_, and BIAS::NurbsBase::numCtrlPoints_.
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.
|
inline |
Set the value of a specific control point.
No out of bounds checks are performed in release builds
indexU | The u index of the control point |
indexV | The v index of the control point |
indexW | The w index of the control point |
value | The 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_.
|
inherited |
Set the position of a knot with a given index and of a given dimension.
Definition at line 75 of file NurbsBase.cpp.
|
friend |
Definition at line 34 of file Nurbs3D.hh.
|
friend |
Definition at line 33 of file Nurbs3D.hh.
|
protectedinherited |
Definition at line 78 of file NurbsBase.hh.
|
protected |
The array of control points.
Definition at line 59 of file Nurbs3D.hh.
Referenced by BIAS::Nurbs3D< ControlPointsT >::GetCtrlPoint(), BIAS::Nurbs3D< ControlPointsT >::Nurbs3D(), and BIAS::Nurbs3D< ControlPointsT >::SetCtrlPoint().
|
protectedinherited |
Degree of the b-splines.
Definition at line 68 of file NurbsBase.hh.
Referenced by BIAS::Nurbs1D< ControlPointsT >::EvalBaseFunc(), BIAS::Nurbs2D< ControlPointsT >::EvalBaseFunc(), BIAS::Nurbs3D< ControlPointsT >::EvalBaseFunc(), BIAS::Nurbs1D< ControlPointsT >::GetRelevantBaseCtrlPoints(), BIAS::Nurbs2D< ControlPointsT >::GetRelevantBaseCtrlPoints(), and BIAS::Nurbs3D< ControlPointsT >::GetRelevantBaseCtrlPoints().
|
protectedinherited |
Number of knots in each dimension.
Definition at line 65 of file NurbsBase.hh.
|
protectedinherited |
The vector of knot vectors (One for each dimension)
Definition at line 62 of file NurbsBase.hh.
Referenced by BIAS::NurbsBase::BaseFunc(), BIAS::Nurbs1D< ControlPointsT >::GetRelevantBaseCtrlPoints(), BIAS::Nurbs2D< ControlPointsT >::GetRelevantBaseCtrlPoints(), and BIAS::Nurbs3D< ControlPointsT >::GetRelevantBaseCtrlPoints().
|
protectedinherited |
The number of control points per dimension.
Definition at line 71 of file NurbsBase.hh.
Referenced by BIAS::Nurbs1D< ControlPointsT >::GetCtrlPoint(), BIAS::Nurbs2D< ControlPointsT >::GetCtrlPoint(), BIAS::Nurbs3D< ControlPointsT >::GetCtrlPoint(), BIAS::Nurbs1D< ControlPointsT >::GetRelevantBaseCtrlPoints(), BIAS::Nurbs2D< ControlPointsT >::GetRelevantBaseCtrlPoints(), BIAS::Nurbs3D< ControlPointsT >::GetRelevantBaseCtrlPoints(), BIAS::Nurbs1D< ControlPointsT >::Nurbs1D(), BIAS::Nurbs2D< ControlPointsT >::Nurbs2D(), BIAS::Nurbs3D< ControlPointsT >::Nurbs3D(), BIAS::Nurbs1D< ControlPointsT >::SetCtrlPoint(), BIAS::Nurbs2D< ControlPointsT >::SetCtrlPoint(), and BIAS::Nurbs3D< ControlPointsT >::SetCtrlPoint().
|
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().
|
protected |
The corresponding weights to the function points.
Definition at line 62 of file Nurbs3D.hh.
Referenced by BIAS::Nurbs3D< ControlPointsT >::Nurbs3D().