17 #ifndef IGNITION_MATH_SPLINEPRIVATE_HH_ 18 #define IGNITION_MATH_SPLINEPRIVATE_HH_ 38 public:
explicit ControlPoint(
const std::vector<Vector3d> &_initList)
39 : derivatives(_initList.begin(), _initList.end())
50 std::copy(_other.derivatives.begin(),
51 _other.derivatives.end(),
52 this->derivatives.begin());
63 if (this->derivatives.size() != _other.derivatives.size())
66 for (
size_t i = 0; i < this->derivatives.size(); ++i)
67 if (this->derivatives[i] != _other.derivatives[i])
80 if (_mth >= this->derivatives.size())
82 return this->derivatives[_mth];
93 if (_mth >= this->derivatives.size())
95 this->derivatives.insert(this->derivatives.end(),
96 _mth - this->derivatives.size() + 1,
99 return this->derivatives[_mth];
103 private: std::vector<Vector3d> derivatives;
123 return this->startPoint;
130 return this->endPoint;
140 const unsigned int _mth,
const double _t)
const;
144 public:
inline double ArcLength()
const {
return this->arcLength; }
149 public:
double ArcLength(
const double _t)
const;
157 private:
Vector3d DoInterpolateMthDerivative(
158 const unsigned int _mth,
const double _t)
const;
171 private:
double arcLength;
188 public: std::vector<ControlPoint>
points;
std::vector< IntervalCubicSpline > segments
Definition: SplinePrivate.hh:191
std::vector< bool > fixings
fixings for control points.
Definition: SplinePrivate.hh:185
const ControlPoint & StartPoint() const
Gets the start control point.
Definition: SplinePrivate.hh:121
IntervalCubicSpline()
Dummy constructor.
ControlPoint(const std::vector< Vector3d > &_initList)
Constructor that takes the M derivatives that define the control point.
Definition: SplinePrivate.hh:38
void Match(const ControlPoint &_other)
Matches all mth derivatives defined in _other to this.
Definition: SplinePrivate.hh:48
Vector3< double > Vector3d
Definition: Vector3.hh:744
double arcLength
Definition: SplinePrivate.hh:197
Vector3d MthDerivative(const unsigned int _mth) const
Gets the mth derivative of this control point.
Definition: SplinePrivate.hh:78
Private data for Spline class.
Definition: SplinePrivate.hh:175
Vector3d InterpolateMthDerivative(const unsigned int _mth, const double _t) const
Interpolates the curve mth derivative at parameter value _t.
const ControlPoint & EndPoint() const
Gets the end control point.
Definition: SplinePrivate.hh:128
std::vector< ControlPoint > points
control points.
Definition: SplinePrivate.hh:188
Cubic interpolator for splines defined between each pair of control points.
Definition: SplinePrivate.hh:108
Control point representation for polynomial interpolation, defined in terms of arbitrary m derivative...
Definition: SplinePrivate.hh:33
double tension
tension of 0 = Catmull-Rom spline, otherwise a Cardinal spline.
Definition: SplinePrivate.hh:182
void SetPoints(const ControlPoint &_startPoint, const ControlPoint &_endPoint)
Sets both control points.
double ArcLength() const
Gets curve arc length.
Definition: SplinePrivate.hh:144
bool operator==(const ControlPoint &_other) const
Checks for control point equality.
Definition: SplinePrivate.hh:58
bool autoCalc
when true, the tangents are recalculated when the control point change.
Definition: SplinePrivate.hh:179
Vector3d & MthDerivative(const unsigned int _mth)
Returns a mutable reference to the mth derivative of this control point.
Definition: SplinePrivate.hh:91
std::vector< double > cumulativeArcLengths
Definition: SplinePrivate.hh:194