Go to the documentation of this file.
19 #ifndef GZ_MATH_SPLINE_HH_
20 #define GZ_MATH_SPLINE_HH_
24 #include <gz/math/config.hh>
31 inline namespace IGNITION_MATH_VERSION_NAMESPACE {
51 public:
void Tension(
double _t);
55 public:
double Tension()
const;
59 public:
double ArcLength()
const;
65 public:
double ArcLength(
const double _t)
const;
72 public:
double ArcLength(
const unsigned int _index,
73 const double _t)
const;
78 public:
void AddPoint(
const Vector3d &_p);
91 private:
void AddPoint(
const ControlPoint &_cp,
const bool _fixed);
98 public:
Vector3d Point(
const unsigned int _index)
const;
105 public:
Vector3d Tangent(
const unsigned int _index)
const;
113 public:
Vector3d MthDerivative(
const unsigned int _index,
114 const unsigned int _mth)
const;
118 public:
size_t PointCount()
const;
121 public:
void Clear();
128 public:
bool UpdatePoint(
const unsigned int _index,
137 public:
bool UpdatePoint(
const unsigned int _index,
147 private:
bool UpdatePoint(
const unsigned int _index,
148 const ControlPoint &_cp,
160 public:
Vector3d Interpolate(
const double _t)
const;
172 public:
Vector3d Interpolate(
const unsigned int _fromIndex,
173 const double _t)
const;
183 public:
Vector3d InterpolateTangent(
const double _t)
const;
195 public:
Vector3d InterpolateTangent(
const unsigned int _fromIndex,
196 const double _t)
const;
204 public:
Vector3d InterpolateMthDerivative(
const unsigned int _mth,
205 const double _1)
const;
217 public:
Vector3d InterpolateMthDerivative(
const unsigned int _fromIndex,
218 const unsigned int _mth,
219 const double _s)
const;
235 public:
void AutoCalculate(
bool _autoCalc);
241 public:
void RecalcTangents();
244 private:
void Rebuild();
255 private:
bool MapToSegment(
const double _t,
256 unsigned int &_index,
257 double &_fraction)
const;
261 private: SplinePrivate *dataPtr;
void RecalcTangents()
Recalculates the tangents associated with this spline.
Splines.
Definition: gz/math/Spline.hh:39
double Tension() const
Gets the tension value.
Definition: gz/math/AdditivelySeparableScalarField3.hh:27
void AutoCalculate(bool _autoCalc)
Tells the spline whether it should automatically calculate tangents on demand as points are added.
Vector3d Tangent(const unsigned int _index) const
Gets the tangent value for one of the control points of the spline.
Vector3d Point(const unsigned int _index) const
Gets the value for one of the control points of the spline.
size_t PointCount() const
Gets the number of control points in the spline.
void AddPoint(const Vector3d &_p)
Adds a single control point to the end of the spline.
double ArcLength() const
Gets spline arc length.
The Vector3 class represents the generic vector containing 3 elements. Since it's commonly used to ke...
Definition: gz/math/Vector3.hh:41
Vector3d InterpolateMthDerivative(const unsigned int _mth, const double _1) const
Interpolates the mth derivative of the spline at parameter value _t.
void Clear()
Clears all the points in the spline.
bool UpdatePoint(const unsigned int _index, const Vector3d &_p)
Updates a single control point value in the spline, keeping its tangent.
Vector3d InterpolateTangent(const double _t) const
Interpolates a tangent on the spline at parameter value _t.
Vector3d Interpolate(const double _t) const
Interpolates a point on the spline at parameter value _t.
Vector3d MthDerivative(const unsigned int _index, const unsigned int _mth) const
Gets the mth derivative for one of the control points of the spline.