26 #ifndef _BIAS_INTERPOLATOR_
27 #define _BIAS_INTERPOLATOR_
29 #include <bias_config.h>
33 #include <Base/Common/BIASpragmaStart.hh>
36 #include "Base/Debug/Debug.hh"
37 #include "Base/Math/Matrix.hh"
38 #include "Base/Math/Vector.hh"
39 #include "Base/Math/Vector2.hh"
40 #include "Base/Math/Vector3.hh"
41 #include "Base/Image/Image.hh"
66 #define D_INTERPOL_SPLINE3 1<<0
67 #define D_INTERPOL_SPLINE2 1<<1
68 #define D_INTERPOL_COMMON 1<<2
69 #define D_INTERPOL_BEZIER 1<<3
102 void SetKnotPoints(
const std::vector<double> &kPnt);
108 startTangentX_=startTangent;
111 startTangentX_=startTangent[0];startTangentY_=startTangent[1];
114 startTangentX_=startTangent[0]; startTangentY_=startTangent[1];
115 startTangentZ_=startTangent[2];
118 startTangentX_=startTangentY_=startTangentZ_=-10000;
123 endTangentX_=endTangent[0];endTangentY_=endTangent[1];};
125 endTangentX_=endTangent[0]; endTangentY_=endTangent[1];
126 endTangentZ_=endTangent[2];
129 endTangentX_=endTangentY_=endTangentZ_=-10000;
135 listTangDim1_=cTan1;};
153 int Spline(
double &res,
double t,
unsigned int k=3);
164 void InitBezier(
int dim_of_CP);
171 if the knotpoints are not set, the value of t must be between 0 and 1!
172 if t > 1 the value of the last controlpoint is returned!
174 calculates P(t)= tvector(t)*nmatrix*cpoints
175 @author Ingo Schiller
176 @param reference to the result(return value)
177 @param time t of which value is to be calculated
180 int Bezier3(
double &res,
double t);
194 int PrepareLuTSpline(
double min,
double max,
unsigned int N,
203 int SplineFromLuT(
double &res,
double t)
const;
211 const bool DoLuTSplinesDiffer(
const Interpolator& I)
const;
214 void InitSpline(
const unsigned int k,
const unsigned int dim);
216 const std::vector<double> &listPnt);
220 const std::vector<double>& listPnt,
221 const double startTangent=0,
const double endTangent=0);
226 const std::vector<double>& listPnt,
227 double startTangent=0);
232 const std::vector<double>& listPnt,
233 const double startTangent,
const double endTangent);
235 void InitSplineHermite(std::vector<double> &tangents,
236 const std::vector<double>& listPnt,
237 const double startTangent,
const double endTangent);
240 bool validate(
double &t,
bool debug=
false);
245 int from,
int to,
int intervall);
248 std::vector<double>
T_;
293 #include <Base/Common/BIASpragmaEnd.hh>
std::vector< double > listPntDim3_
void SetTangentsHermite(const std::vector< double > &cTan1)
for hermite splines, a tangent can be given for each control point.
std::vector< double > SplineLuT1_
std::vector< BIAS::Vector< double > > listPolynoms2_
std::vector< BIAS::Vector< double > > listPolynoms1_
BIAS::Matrix< double > nmatrix_
void GetKnotPoints(std::vector< double > &kPnt) const
std::vector< double > listTangDim1_
std::vector< double > bXK_1_
void SetStartTangent(double startTangent)
void SetEndTangent(BIAS::Vector2< double > endTangent)
std::vector< BIAS::Vector< double > > listPolynoms3_
void SetEndTangent(BIAS::Vector3< double > endTangent)
this class interpolates a function y=f(t) between given control points (the y-values) ...
std::vector< double > bXK_3_
std::vector< double > bYK_3_
void SetStartTangent(BIAS::Vector3< double > startTangent)
Interpolator(const Interpolator &ip)
std::vector< double > bYK_1_
void SetControlPoints(const std::vector< double > &cPnt1)
set the control points, which control the interpolating curve
std::vector< double > KPts_
unsigned int initializedPoly_
std::vector< double > bYK_2_
std::vector< double > bXK_2_
void GetControlPoints(std::vector< double > &cPnt) const
void SetStartTangent(BIAS::Vector2< double > startTangent)
std::vector< double > listPntDim2_
std::vector< double > listPntDim1_
void SetEndTangent(double endTangent)