Basic Image AlgorithmS Library
2.8.0
|
This class implements a NURBS-function with a two dimensional parameter space (A NURBS surface). More...
#include <MathAlgo/Nurbs/Nurbs2D.hh>
Public Member Functions | |
void | Eval (const BIAS::Vector2< 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 BIAS::Vector2< double > &nurbsParam, double &result) const |
Evaluate the base function for the control point for the point nurbsParam. More... | |
void | EvalBaseFunc (const int x, const int y, const BIAS::Vector2< double > &nurbsParam, double &result, double *baseFuncCache) const |
Evaluate the base function for the control point for the point nurbsParam using a dedicated cache for the serial evaluation. More... | |
void | EvalCustom (const BIAS::Vector2< double > &nurbsParam, ControlPointsT &result, const ControlPointsT **controlPoints) const |
Evaluate the NURBS function at a given point in the parameter space for a certain control point vector (helpfull for optimization) More... | |
ControlPointsT | GetCtrlPoint (const int &indexU, const int &indexV) 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::Vector2< double > &nurbsParam, BIAS::Vector2< int > &begin, BIAS::Vector2< 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) |
Very generic initialization function for the control points. More... | |
Nurbs2D (int knotsPerDim=4, int degree=2) | |
Standard Constructor. More... | |
void | SetCtrlPoint (const int &indexU, const int &indexV, 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... | |
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... | |
double ** | weights_ |
The corresponding weights to the function points. More... | |
This class implements a NURBS-function with a two dimensional parameter space (A NURBS surface).
The dimension of the output values is defined by the template type of control points
Definition at line 23 of file Nurbs2D.hh.
Nurbs2D::Nurbs2D | ( | 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 Nurbs2D.cpp.
References BIAS::Nurbs2D< ControlPointsT >::controlPoints_, TemplateInit::Init(), BIAS::NurbsBase::numCtrlPoints_, and BIAS::Nurbs2D< ControlPointsT >::weights_.
|
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 Nurbs2D::Eval | ( | const BIAS::Vector2< 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] - [1,1] ) |
result | The return value |
Definition at line 42 of file Nurbs2D.cpp.
References TemplateInit::Init().
|
inline |
Evaluate the base function for the control point for the point nurbsParam.
Definition at line 86 of file Nurbs2D.hh.
References BIAS::NurbsBase::BaseFunc(), and BIAS::NurbsBase::degree_.
|
inline |
Evaluate the base function for the control point for the point nurbsParam using a dedicated cache for the serial evaluation.
Definition at line 92 of file Nurbs2D.hh.
References BIAS::NurbsBase::BaseFunc(), and BIAS::NurbsBase::degree_.
void Nurbs2D::EvalCustom | ( | const BIAS::Vector2< double > & | nurbsParam, |
ControlPointsT & | result, | ||
const ControlPointsT ** | controlPoints | ||
) | const |
Evaluate the NURBS function at a given point in the parameter space for a certain control point vector (helpfull for optimization)
nurbsParam | Point in the parameter space ( [0,0] - [1,1] ) |
result | The return value |
Definition at line 78 of file Nurbs2D.cpp.
References TemplateInit::Init().
|
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 |
Definition at line 77 of file Nurbs2D.hh.
References BIAS::Nurbs2D< 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 101 of file Nurbs2D.hh.
References BIAS::NurbsBase::degree_, BIAS::NurbsBase::knotVector_, and BIAS::NurbsBase::numCtrlPoints_.
void Nurbs2D::Init | ( | const ControlPointsT | minX, |
const ControlPointsT | maxX, | ||
const ControlPointsT | minY, | ||
const ControlPointsT | maxY | ||
) |
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 111 of file Nurbs2D.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 |
value | The value that is assigned to the control point |
Definition at line 65 of file Nurbs2D.hh.
References BIAS::Nurbs2D< 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.
|
protectedinherited |
Definition at line 78 of file NurbsBase.hh.
|
protected |
The array of control points.
Definition at line 51 of file Nurbs2D.hh.
Referenced by BIAS::Nurbs2D< ControlPointsT >::GetCtrlPoint(), BIAS::Nurbs2D< ControlPointsT >::Nurbs2D(), and BIAS::Nurbs2D< 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 |
The corresponding weights to the function points.
Definition at line 54 of file Nurbs2D.hh.
Referenced by BIAS::Nurbs2D< ControlPointsT >::Nurbs2D().