Basic Image AlgorithmS Library
2.8.0
|
This class implements a NURBS-function with a one dimensional parameter space (A NURBS line). More...
#include <MathAlgo/Nurbs/Nurbs1D.hh>
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 °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 one dimensional parameter space (A NURBS line).
The dimension of the output values is defined by the template type of control points
Definition at line 24 of file Nurbs1D.hh.
Nurbs1D::Nurbs1D | ( | 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 25 of file Nurbs1D.cpp.
References BIAS::Nurbs1D< ControlPointsT >::controlPoints_, TemplateInit::Init(), BIAS::NurbsBase::numCtrlPoints_, and BIAS::Nurbs1D< 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 Nurbs1D::Eval | ( | const double & | nurbsParam, |
ControlPointsT & | result | ||
) | const |
Evaluate the NURBS function at a given point in the parameter space.
nurbsParam | Point in the parameter space ( [0] - [1] ) |
result | The return value |
Definition at line 41 of file Nurbs1D.cpp.
References TemplateInit::Init().
|
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_.
|
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_.
|
inline |
Get the value of a specific control point.
No out of bounds checks are performed in release builds
index | The index of the control point |
Definition at line 63 of file Nurbs1D.hh.
References BIAS::Nurbs1D< 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.
double Nurbs1D::GetKnot | ( | int | index | ) | const |
Returns the position of a knot with a given index.
Definition at line 71 of file Nurbs1D.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 (index) |
end | The last control points (index) |
Definition at line 85 of file Nurbs1D.hh.
References BIAS::NurbsBase::degree_, BIAS::NurbsBase::knotVector_, and BIAS::NurbsBase::numCtrlPoints_.
|
inline |
Set the value of a specific control point.
No out of bounds checks are performed in release builds
index | The index of the control point |
value | The 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_.
|
inherited |
Set the position of a knot with a given index and of a given dimension.
Definition at line 75 of file NurbsBase.cpp.
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.
|
protectedinherited |
Definition at line 78 of file NurbsBase.hh.
|
protected |
The array of control points.
Definition at line 41 of file Nurbs1D.hh.
Referenced by BIAS::Nurbs1D< ControlPointsT >::GetCtrlPoint(), BIAS::Nurbs1D< ControlPointsT >::Nurbs1D(), and BIAS::Nurbs1D< 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 44 of file Nurbs1D.hh.
Referenced by BIAS::Nurbs1D< ControlPointsT >::Nurbs1D().