RotationSpline.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef IGNITION_MATH_ROTATIONSPLINE_HH_
18 #define IGNITION_MATH_ROTATIONSPLINE_HH_
19 
21 #include <ignition/math/config.hh>
22 
23 namespace ignition
24 {
25  namespace math
26  {
27  inline namespace IGNITION_MATH_VERSION_NAMESPACE
28  {
29  // Forward declare private data
30  class RotationSplinePrivate;
31 
34  class IGNITION_MATH_VISIBLE RotationSpline
35  {
37  public: RotationSpline();
38 
40  public: ~RotationSpline();
41 
44  public: void AddPoint(const Quaterniond &_p);
45 
53  public: const Quaterniond &Point(const unsigned int _index) const;
54 
57  public: unsigned int PointCount() const;
58 
60  public: void Clear();
61 
68  public: bool UpdatePoint(const unsigned int _index,
69  const Quaterniond &_value);
70 
81  public: Quaterniond Interpolate(double _t,
82  const bool _useShortestPath = true);
83 
93  public: Quaterniond Interpolate(const unsigned int _fromIndex,
94  const double _t, const bool _useShortestPath = true);
95 
110  public: void AutoCalculate(bool _autoCalc);
111 
116  public: void RecalcTangents();
117 
119  private: RotationSplinePrivate *dataPtr;
120  };
121  }
122  }
123 }
124 
125 #endif
A quaternion class.
Definition: Quaternion.hh:32
Spline for rotations.
Definition: RotationSpline.hh:35
void AutoCalculate(bool _autoCalc)
Tells the spline whether it should automatically calculate tangents on demand as points are added.
void RecalcTangents()
Recalculates the tangents associated with this spline.
void AddPoint(const Quaterniond &_p)
Adds a control point to the end of the spline.
Quaterniond Interpolate(const unsigned int _fromIndex, const double _t, const bool _useShortestPath=true)
Interpolates a single segment of the spline given a parametric value.
const Quaterniond & Point(const unsigned int _index) const
Gets the detail of one of the control points of the spline.
void Clear()
Clears all the points in the spline.
unsigned int PointCount() const
Gets the number of control points in the spline.
Quaterniond Interpolate(double _t, const bool _useShortestPath=true)
Returns an interpolated point based on a parametric value over the whole series.
RotationSpline()
Constructor. Sets the autoCalc to true.
bool UpdatePoint(const unsigned int _index, const Quaterniond &_value)
Updates a single point in the spline.
Definition: Angle.hh:40