Spline.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 // Note: Originally cribbed from Ogre3d. Modified to implement Cardinal
18 // spline and catmull-rom spline
19 #ifndef _SPLINE_HH_
20 #define _SPLINE_HH_
21 
22 #include <vector>
23 
24 #include "gazebo/math/Vector3.hh"
25 #include "gazebo/math/Matrix4.hh"
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace math
31  {
34 
37  class GZ_MATH_VISIBLE Spline
38  {
41  public: Spline() GAZEBO_DEPRECATED(8.0);
42 
45  public: ~Spline() GAZEBO_DEPRECATED(8.0);
46 
51  public: void SetTension(double _t) GAZEBO_DEPRECATED(8.0);
52 
56  public: double GetTension() const GAZEBO_DEPRECATED(8.0);
57 
61  public: void AddPoint(const Vector3 &_pt) GAZEBO_DEPRECATED(8.0);
62 
68  public: Vector3 GetPoint(unsigned int _index) const
69  GAZEBO_DEPRECATED(8.0);
70 
74  public: unsigned int GetPointCount() const GAZEBO_DEPRECATED(8.0);
75 
79  public: Vector3 GetTangent(unsigned int _index) const
80  GAZEBO_DEPRECATED(8.0);
81 
84  public: void Clear() GAZEBO_DEPRECATED(8.0);
85 
92  public: void UpdatePoint(unsigned int _index, const Vector3 &_value)
93  GAZEBO_DEPRECATED(8.0);
94 
99  public: Vector3 Interpolate(double _t) const GAZEBO_DEPRECATED(8.0);
100 
107  public: Vector3 Interpolate(unsigned int _fromIndex, double _t) const
108  GAZEBO_DEPRECATED(8.0);
109 
125  public: void SetAutoCalculate(bool _autoCalc) GAZEBO_DEPRECATED(8.0);
126 
132  public: void RecalcTangents() GAZEBO_DEPRECATED(8.0);
133 
136  protected: bool autoCalc;
137 
139  protected: std::vector<Vector3> points;
140 
142  protected: std::vector<Vector3> tangents;
143 
145  protected: Matrix4 coeffs;
146 
148  protected: double tension;
149  };
151  }
152 }
153 #endif
bool autoCalc
when true, the tangents are recalculated when the control point change
Definition: Spline.hh:136
Forward declarations for the common classes.
Definition: Animation.hh:33
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
static const double GAZEBO_DEPRECATED(8.0) MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:140
A 3x3 matrix class.
Definition: Matrix4.hh:40
Splines.
Definition: Spline.hh:37
std::vector< Vector3 > tangents
tangents
Definition: Spline.hh:142
double tension
Tension of 0 = Catmull-Rom spline, otherwise a Cardinal spline.
Definition: Spline.hh:148
std::vector< Vector3 > points
control points
Definition: Spline.hh:139
Matrix4 coeffs
Matrix of coefficients.
Definition: Spline.hh:145