24 #ifndef __GEOMETRY_BEZIER_H_
25 #define __GEOMETRY_BEZIER_H_
27 #include <geometry/transformable.h>
38 Bezier(
const std::vector<HomPoint>& control_points);
48 unsigned int degree()
const;
54 const std::vector<HomPoint>&
approximate(
unsigned int num_subdivisions = 4);
62 void init_dclj_array();
63 unsigned int get_dclj_array_index(
unsigned int k,
unsigned int i)
const;
65 std::vector<HomPoint> m_control_points;
66 std::vector<HomPoint> m_approximation;
67 unsigned int m_num_subdivisions;
69 HomPoint de_casteljau(
unsigned int k,
unsigned int i,
float t);
71 std::pair<HomPoint*, bool>* m_de_casteljau_points;
72 unsigned int m_dclj_array_size;
74 unsigned int m_num_control_points;
HomVector tangent_at_t(float t)
Compute the tangent vector at position t.
unsigned int degree() const
Get the degree of the polynom.
virtual void register_primitives()
Here, a derived class should register its primitives (HomPoints and HomVectors) by calling add_primit...
Fawkes library namespace.
void subdivide(float t, Bezier &c, Bezier &d)
Subdivide the curve into two polynome of the same degree.
void set_control_points(const std::vector< HomPoint > &control_points)
Set the control points.
HomPoint get_control_point(unsigned int i) const
Get a specific control point.
const std::vector< HomPoint > & approximate(unsigned int num_subdivisions=4)
Approximate the curve with points.
virtual void post_transform()
This method is called after the primitives are transformed.
HomVector tangent_at_point(unsigned int index)
Compute the tangent vector at the specified control point.
HomPoint eval(float t)
Evalutate the polynom for a given t.
void set_control_point(unsigned int index, const HomPoint &control_point)
Replace a specific control point.
std::vector< HomPoint > get_control_points() const
Get the control points.