Claw
1.7.3
|
Implementation of the Bézier curve. More...
#include <curve.hpp>
Classes | |
class | control_point |
The control_point class describes a control point of the curve, with the direction of the curve before and after the point. More... | |
class | section |
A section is a part of the curve between two control points. More... |
Public Types | |
typedef C | coordinate_type |
The type of the coordinates of the curve. | |
typedef Traits | traits_type |
The traits provide an access to the properties of the coordinates. | |
typedef traits_type::value_type | value_type |
The type of the components of the coordinates. | |
typedef control_point_list::iterator | iterator |
The type of the iterator on the control points of the curve. | |
typedef control_point_list::const_iterator | const_iterator |
The type of the iterator on the control points of the curve. |
Public Member Functions | |
void | push_back (const control_point &p) |
Add a point at the end of the curve. | |
void | push_front (const control_point &p) |
Add a point at the beginning of the curve. | |
void | insert (const iterator &pos, const control_point &p) |
Add a point before an other point of the curve. | |
section | get_section (const const_iterator &pos) const |
Get the section of the curve starting at a given control point. | |
std::vector< typename section::resolved_point > | get_point_at_x (value_type x, bool off_domain=false) const |
Get the points having the given x-coordinate on the curve. | |
iterator | begin () |
Get an iterator on the first control point. | |
iterator | end () |
Get an iterator past the last control point. | |
const_iterator | begin () const |
Get an iterator on the first control point. | |
const_iterator | end () const |
Get an iterator past the last control point. |
Implementation of the Bézier curve.
The curve is made of a sequence of points, each of which having a direction telling how the curve enters the point and how to leave.
std::vector< typename claw::math::curve< C, Traits >::section::resolved_point > claw::math::curve< C, Traits >::get_point_at_x | ( | value_type | x, |
bool | off_domain = false |
||
) | const |
Get the points having the given x-coordinate on the curve.
x | The coordinate for which we want the points. |
off_domain | Tell the method to keep the points found at a date outside [0, 1]. |
Definition at line 607 of file curve.tpp.
References claw::math::curve< C, Traits >::begin(), claw::math::curve< C, Traits >::section::empty(), claw::math::curve< C, Traits >::end(), claw::math::curve< C, Traits >::section::get_point_at_x(), and claw::math::curve< C, Traits >::get_section().
claw::math::curve< C, Traits >::section claw::math::curve< C, Traits >::get_section | ( | const const_iterator & | pos | ) | const |
Get the section of the curve starting at a given control point.
pos | An iterator of the control point at which the returned section begins. |
Definition at line 584 of file curve.tpp.
References claw::math::curve< C, Traits >::end().
Referenced by claw::math::curve< C, Traits >::get_point_at_x().
void claw::math::curve< C, Traits >::insert | ( | const iterator & | pos, |
const control_point & | p | ||
) |
void claw::math::curve< C, Traits >::push_back | ( | const control_point & | p | ) |
void claw::math::curve< C, Traits >::push_front | ( | const control_point & | p | ) |