24 #ifndef __GEOMETRY_SPLINE_H_ 25 #define __GEOMETRY_SPLINE_H_ 27 #include <geometry/transformable.h> 28 #include <geometry/hom_point.h> 29 #include <geometry/bezier.h> 42 Spline(
const std::vector<HomPoint>& control_points);
54 std::vector<HomPoint>
approximate(
unsigned int num_subdivisions = 4);
62 void construct_bezier_curves();
64 std::vector<HomPoint> m_control_points;
65 std::vector<Bezier> m_bezier_curves;
67 unsigned int m_num_subdivisions;
A spline made up of cubic Bezier curves.
void set_control_point(unsigned int i, const HomPoint &p)
Set a specific control point.
HomPoint eval(unsigned int bezier_index, float t)
Get a point on the curve for a specified segment and value t.
Fawkes library namespace.
Drawer for Spline objects.
std::vector< HomPoint > approximate(unsigned int num_subdivisions=4)
Get linear approximation of the curve.
void set_control_points(const std::vector< HomPoint > &control_points)
Set the control points.
virtual ~Spline()
Destructor.
const std::vector< Bezier > & get_bezier_curves() const
Get the Bezier curves.
virtual void register_primitives()
Here, a derived class should register its primitives (HomPoints and HomVectors) by calling add_primit...
HomVector tangent(unsigned int bezier_index, float t)
Compute the tangent vector at position t of the i-th Bezier curve.
virtual void post_transform()
This method is called after the primitives are transformed.
const std::vector< HomPoint > & get_control_points() const
Get the control points.