11 #include <Base/Debug/Error.hh>
13 #include "NurbsBase.hh"
23 template <
class ControlPo
intsT>
31 Nurbs1D(
int knotsPerDim = 4,
int degree = 2);
36 void Eval(
const double &nurbsParam, ControlPointsT &result)
const;
54 inline void SetCtrlPoint(
const int &index,
const ControlPointsT &value){
55 BIASASSERT(index >= 0);
64 BIASASSERT(index >= 0);
70 inline void EvalBaseFunc(
const int x,
const double &nurbsParam,
double &result)
const{
76 inline void EvalBaseFunc(
const int x,
const int y,
const double &nurbsParam,
double &result,
double* baseFuncCache)
const{
100 double GetKnot(
int index)
const;
103 void SetKnot(
int index,
double value);
int degree_
Degree of the b-splines.
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.
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.
void SetCtrlPoint(const int &index, const ControlPointsT &value)
Set the value of a specific control point.
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 ...
void Eval(const double &nurbsParam, ControlPointsT &result) const
Evaluate the NURBS function at a given point in the parameter space.
ControlPointsT * controlPoints_
The array of control points.
Base class for NURBS classes.
Nurbs1D(int knotsPerDim=4, int degree=2)
Standard Constructor.
std::vector< std::vector< double > > knotVector_
The vector of knot vectors (One for each dimension)
ControlPointsT GetCtrlPoint(int &index) const
Get the value of a specific control point.
void SetKnot(int index, double value)
Set the position of a knot with a given index.
double * weights_
The corresponding weights to the function points.
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 c...
This class implements a NURBS-function with a one dimensional parameter space (A NURBS line)...
int numCtrlPoints_
The number of control points per dimension.
double GetKnot(int index) const
Returns the position of a knot with a given index.