Splines. More...
#include <ignition/math/Spline.hh>
Public Member Functions | |
Spline () | |
constructor | |
~Spline () | |
destructor | |
void | AddPoint (const Vector3d &_p) |
Adds a single control point to the end of the spline. | |
void | AddPoint (const Vector3d &_p, const Vector3d &_t) |
Adds a single control point to the end of the spline with fixed tangent. | |
double | ArcLength () const |
Gets spline arc length. | |
double | ArcLength (const double _t) const |
Gets spline arc length up to a given parameter value _t . | |
double | ArcLength (const unsigned int _index, const double _t) const |
Gets a spline segment arc length. | |
void | AutoCalculate (bool _autoCalc) |
Tells the spline whether it should automatically calculate tangents on demand as points are added. | |
void | Clear () |
Clears all the points in the spline. | |
Vector3d | Interpolate (const double _t) const |
Interpolates a point on the spline at parameter value _t . | |
Vector3d | Interpolate (const unsigned int _fromIndex, const double _t) const |
Interpolates a point on a segment of the spline at parameter value _t . | |
Vector3d | InterpolateMthDerivative (const unsigned int _fromIndex, const unsigned int _mth, const double _s) const |
Interpolates the mth derivative of a segment of the spline at parameter value _t . | |
Vector3d | InterpolateMthDerivative (const unsigned int _mth, const double _1) const |
Interpolates the mth derivative of the spline at parameter value _t . | |
Vector3d | InterpolateTangent (const double _t) const |
Interpolates a tangent on the spline at parameter value _t . | |
Vector3d | InterpolateTangent (const unsigned int _fromIndex, const double _t) const |
Interpolates the tangent on a segment of 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. | |
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 | RecalcTangents () |
Recalculates the tangents associated with this spline. | |
Vector3d | Tangent (const unsigned int _index) const |
Gets the tangent value for one of the control points of the spline. | |
double | Tension () const |
Gets the tension value. | |
void | Tension (double _t) |
Sets the tension parameter. | |
bool | UpdatePoint (const unsigned int _index, const Vector3d &_p) |
Updates a single control point value in the spline, keeping its tangent. | |
bool | UpdatePoint (const unsigned int _index, const Vector3d &_p, const Vector3d &_t) |
Updates a single control point in the spline, along with its tangent. | |
Splines.
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::Spline | ( | ) |
constructor
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::~Spline | ( | ) |
destructor
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::AddPoint | ( | const Vector3d & | _p | ) |
Adds a single control point to the end of the spline.
[in] | _p | control point value to add. |
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::AddPoint | ( | const Vector3d & | _p, |
const Vector3d & | _t ) |
Adds a single control point to the end of the spline with fixed tangent.
[in] | _p | control point value to add. |
[in] | _t | tangent at _p . |
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::ArcLength | ( | ) | const |
Gets spline arc length.
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::ArcLength | ( | const double | _t | ) | const |
Gets spline arc length up to a given parameter value _t
.
[in] | _t | parameter value (range 0 to 1). |
_t
or INF on error. double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::ArcLength | ( | const unsigned int | _index, |
const double | _t ) const |
Gets a spline segment arc length.
[in] | _index | of the spline segment. |
[in] | _t | parameter value (range 0 to 1). |
_t
or INF on error. void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::AutoCalculate | ( | bool | _autoCalc | ) |
Tells the spline whether it should automatically calculate tangents on demand as points are added.
[in] | _autoCalc | If true, tangents are calculated for you whenever a point changes. If false, you must call RecalcTangents to recalculate them when it best suits. |
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::Clear | ( | ) |
Clears all the points in the spline.
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::Interpolate | ( | const double | _t | ) | const |
Interpolates a point on the spline at parameter value _t
.
[in] | _t | parameter value (range 0 to 1). |
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::Interpolate | ( | const unsigned int | _fromIndex, |
const double | _t ) const |
Interpolates a point on a segment of the spline at parameter value _t
.
[in] | _fromIndex | The point index to treat as t = 0. fromIndex + 1 is deemed to be t = 1. |
[in] | _t | parameter value (range 0 to 1). |
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::InterpolateMthDerivative | ( | const unsigned int | _fromIndex, |
const unsigned int | _mth, | ||
const double | _s ) const |
Interpolates the mth derivative of a segment of the spline at parameter value _t
.
[in] | _fromIndex | point index to treat as t = 0, fromIndex + 1 is deemed to be t = 1. |
[in] | _mth | order of curve derivative to interpolate. |
[in] | _t | parameter value (range 0 to 1). |
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::InterpolateMthDerivative | ( | const unsigned int | _mth, |
const double | _1 ) const |
Interpolates the mth derivative of the spline at parameter value _t
.
[in] | _mth | order of curve derivative to interpolate. |
[in] | _t | parameter value (range 0 to 1). |
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::InterpolateTangent | ( | const double | _t | ) | const |
Interpolates a tangent on the spline at parameter value _t
.
[in] | _t | parameter value (range 0 to 1). |
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::InterpolateTangent | ( | const unsigned int | _fromIndex, |
const double | _t ) const |
Interpolates the tangent on a segment of the spline at parameter value _t
.
[in] | _fromIndex | the point index to treat as t = 0. fromIndex + 1 is deemed to be t = 1. |
[in] | _t | parameter value (range 0 to 1). |
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::MthDerivative | ( | const unsigned int | _index, |
const unsigned int | _mth ) const |
Gets the mth derivative for one of the control points of the spline.
[in] | _index | the control point index. |
[in] | _mth | derivative order. |
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::Point | ( | const unsigned int | _index | ) | const |
Gets the value for one of the control points of the spline.
[in] | _index | the control point index. |
size_t ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::PointCount | ( | ) | const |
Gets the number of control points in the spline.
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::RecalcTangents | ( | ) |
Recalculates the tangents associated with this spline.
Vector3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::Tangent | ( | const unsigned int | _index | ) | const |
Gets the tangent value for one of the control points of the spline.
[in] | _index | the control point index. |
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::Tension | ( | ) | const |
Gets the tension value.
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::Tension | ( | double | _t | ) |
Sets the tension parameter.
[in] | _t | Tension value between 0.0 and 1.0 |
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::UpdatePoint | ( | const unsigned int | _index, |
const Vector3d & | _p ) |
Updates a single control point value in the spline, keeping its tangent.
[in] | _index | the control point index. |
[in] | _p | the new control point value. |
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Spline::UpdatePoint | ( | const unsigned int | _index, |
const Vector3d & | _p, | ||
const Vector3d & | _t ) |
Updates a single control point in the spline, along with its tangent.
[in] | _index | the control point index. |
[in] | _p | the new control point value. |
[in] | _t | the new control point tangent. |