Represents a 2D conic segment using two points. More...
#include <vgl_conic_segment_2d.h>
Public Member Functions | |
| vgl_conic_segment_2d () | |
| Default constructor - does not initialise!. | |
| vgl_conic_segment_2d (vgl_conic_segment_2d< Type > const &l) | |
| Copy constructor. | |
| vgl_conic_segment_2d (vgl_homg_point_2d< Type > const &p1, vgl_homg_point_2d< Type > const &p2, vgl_conic< Type > const &co, bool counterclockwise=true) | |
| Construct from two end points (homogeneous) and a conic. | |
| vgl_conic_segment_2d (vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2, vgl_conic< Type > const &co, bool counterclockwise=true) | |
| Construct from two end points (Cartesian) and a conic. | |
| vgl_conic_segment_2d (vgl_conic< Type > const &co, vgl_homg_point_2d< Type > const &p1, vgl_homg_point_2d< Type > const &p2, bool counterclockwise=true) | |
| Construct from a conic and two end points (homogeneous). | |
| vgl_conic_segment_2d (vgl_conic< Type > const &co, vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2, bool counterclockwise=true) | |
| Construct from a conic and two end points (Cartesian). | |
| ~vgl_conic_segment_2d () | |
| Destructor. | |
| void | normalize () |
| Normalise the direction of the segment to counterclockwise. | |
| void | swap_endpoints () |
| Interchange the two endpoints but keep the direction. | |
| void | swap_direction () |
| Change the direction of the conic section but keep the end points. | |
| vgl_homg_point_2d< Type > | point1 () const |
| The first end-point of the conic segment. | |
| vgl_homg_point_2d< Type > | point2 () const |
| The second end-point of the conic segment. | |
| vgl_conic< Type > | conic () const |
| The conic underlying the segment. | |
| bool | is_counterclockwise () const |
| The direction of the segment (clockwise or counterclockwise). | |
| bool | is_clockwise () const |
| The direction of the segment (clockwise or counterclockwise). | |
| bool | operator== (vgl_conic_segment_2d< Type > const &l) const |
| The equality comparison operator. | |
| bool | operator!= (vgl_conic_segment_2d< Type >const &other) const |
| The inequality comparison operator. | |
| void | set (vgl_homg_point_2d< Type > const &p1, vgl_homg_point_2d< Type > const &p2, vgl_conic< Type > co, bool counterclockwise=true) |
| (Re)initialise the conic segment by passing it its three "constructors". | |
| void | set (vgl_conic< Type > co, vgl_homg_point_2d< Type > const &p1, vgl_homg_point_2d< Type > const &p2, bool counterclockwise=true) |
| (Re)initialise the conic segment by passing it its three "constructors". | |
| void | set (vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2, vgl_conic< Type > co, bool counterclockwise=true) |
| (Re)initialise the conic segment by passing it its three "constructors". | |
| void | set (vgl_conic< Type > co, vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2, bool counterclockwise=true) |
| (Re)initialise the conic segment by passing it its three "constructors". | |
| bool | is_finite () const |
| Finds out whether this curve has a finite length. | |
| bool | contains (vgl_homg_point_2d< Type > const &pt) const |
| Finds out whether the given point lies on the conic segment. | |
Private Attributes | |
| vgl_homg_point_2d< Type > | p1_ |
| One end of conic segment. | |
| vgl_homg_point_2d< Type > | p2_ |
| The other end of the conic segment. | |
| vgl_conic< Type > | conic_ |
| The conic that represents the curve between point1 and point2. | |
| bool | counterclockwise_ |
| Whether traversal is in counter-clockwise direction (the default) or not. | |
Related Functions | |
(Note that these are not member functions.) | |
| template<class Type > | |
| vcl_ostream & | operator<< (vcl_ostream &s, const vgl_conic_segment_2d< Type > &c_s) |
| Write to stream. | |
| template<class Type > | |
| vcl_istream & | operator>> (vcl_istream &is, vgl_conic_segment_2d< Type > &c_s) |
| Read from stream. | |
Represents a 2D conic segment using two points.
Definition at line 102 of file vgl_conic_segment_2d.h.
| vgl_conic_segment_2d< Type >::vgl_conic_segment_2d | ( | ) | [inline] |
Default constructor - does not initialise!.
Use the set() method to make this conic segment useful.
Definition at line 119 of file vgl_conic_segment_2d.h.
| vgl_conic_segment_2d< Type >::vgl_conic_segment_2d | ( | vgl_conic_segment_2d< Type > const & | l | ) | [inline] |
Copy constructor.
Definition at line 122 of file vgl_conic_segment_2d.h.
| vgl_conic_segment_2d< Type >::vgl_conic_segment_2d | ( | vgl_homg_point_2d< Type > const & | p1, |
| vgl_homg_point_2d< Type > const & | p2, | ||
| vgl_conic< Type > const & | co, | ||
| bool | counterclockwise = true |
||
| ) | [inline] |
Construct from two end points (homogeneous) and a conic.
Definition at line 127 of file vgl_conic_segment_2d.h.
| vgl_conic_segment_2d< Type >::vgl_conic_segment_2d | ( | vgl_point_2d< Type > const & | p1, |
| vgl_point_2d< Type > const & | p2, | ||
| vgl_conic< Type > const & | co, | ||
| bool | counterclockwise = true |
||
| ) | [inline] |
Construct from two end points (Cartesian) and a conic.
Definition at line 135 of file vgl_conic_segment_2d.h.
| vgl_conic_segment_2d< Type >::vgl_conic_segment_2d | ( | vgl_conic< Type > const & | co, |
| vgl_homg_point_2d< Type > const & | p1, | ||
| vgl_homg_point_2d< Type > const & | p2, | ||
| bool | counterclockwise = true |
||
| ) | [inline] |
Construct from a conic and two end points (homogeneous).
Definition at line 143 of file vgl_conic_segment_2d.h.
| vgl_conic_segment_2d< Type >::vgl_conic_segment_2d | ( | vgl_conic< Type > const & | co, |
| vgl_point_2d< Type > const & | p1, | ||
| vgl_point_2d< Type > const & | p2, | ||
| bool | counterclockwise = true |
||
| ) | [inline] |
Construct from a conic and two end points (Cartesian).
Definition at line 151 of file vgl_conic_segment_2d.h.
| vgl_conic_segment_2d< Type >::~vgl_conic_segment_2d | ( | ) | [inline] |
Destructor.
Definition at line 159 of file vgl_conic_segment_2d.h.
| vgl_conic<Type> vgl_conic_segment_2d< Type >::conic | ( | ) | const [inline] |
The conic underlying the segment.
Definition at line 184 of file vgl_conic_segment_2d.h.
| bool vgl_conic_segment_2d< Type >::contains | ( | vgl_homg_point_2d< Type > const & | pt | ) | const [inline] |
Finds out whether the given point lies on the conic segment.
More specifically, lying on the segment implies lying on the conic. Moreover, the two endpoints (if effectively on the conic) will always lie on the segment. All other points of the conic lie either on this segment, or on the "swapped" segment, but never on both.
Definition at line 256 of file vgl_conic_segment_2d.h.
| bool vgl_conic_segment_2d< Type >::is_clockwise | ( | ) | const [inline] |
The direction of the segment (clockwise or counterclockwise).
Definition at line 190 of file vgl_conic_segment_2d.h.
| bool vgl_conic_segment_2d< Type >::is_counterclockwise | ( | ) | const [inline] |
The direction of the segment (clockwise or counterclockwise).
Definition at line 187 of file vgl_conic_segment_2d.h.
| bool vgl_conic_segment_2d< Type >::is_finite | ( | ) | const [inline] |
Finds out whether this curve has a finite length.
If the conic segment has an underlying ellipse, the segment is of course always finite. Otherwise, is_finite returns false whenever the segment passes through one of the points at infinity of the hyperbola or parabola. Note that the methods swap_endpoints() and swap_direction() always swaps finiteness of a parabolic segment (unless the endpoints coincide). For hyperbolic segments this is not necessarily the case: both can be infinite.
Definition at line 249 of file vgl_conic_segment_2d.h.
| void vgl_conic_segment_2d< Type >::normalize | ( | ) | [inline] |
Normalise the direction of the segment to counterclockwise.
This will also swap the end points if the direction is to be swapped.
Definition at line 163 of file vgl_conic_segment_2d.h.
| bool vgl_conic_segment_2d< Type >::operator!= | ( | vgl_conic_segment_2d< Type >const & | other | ) | const [inline] |
The inequality comparison operator.
Definition at line 216 of file vgl_conic_segment_2d.h.
| bool vgl_conic_segment_2d< Type >::operator== | ( | vgl_conic_segment_2d< Type > const & | l | ) | const [inline] |
The equality comparison operator.
Two conic segments are only identical if the underlying conic is identical and if direction and both endpoints are identical, in the same order! Two conic segments with identical conic and identical end points but in the opposite order are not identical but rather complementary: they share no other points than the two end points. Use the swap_direction or the swap_endpoints() method on one of the two segments to turn complementary segments into identical ones. Note that two conic segments *are* equal if both the direction and the two end points are swapped. To normalize a conic segment such that its direction becomes counterclockwise, use the normalize() method.
Definition at line 203 of file vgl_conic_segment_2d.h.
| vgl_homg_point_2d<Type> vgl_conic_segment_2d< Type >::point1 | ( | ) | const [inline] |
The first end-point of the conic segment.
Definition at line 178 of file vgl_conic_segment_2d.h.
| vgl_homg_point_2d<Type> vgl_conic_segment_2d< Type >::point2 | ( | ) | const [inline] |
The second end-point of the conic segment.
Definition at line 181 of file vgl_conic_segment_2d.h.
| void vgl_conic_segment_2d< Type >::set | ( | vgl_homg_point_2d< Type > const & | p1, |
| vgl_homg_point_2d< Type > const & | p2, | ||
| vgl_conic< Type > | co, | ||
| bool | counterclockwise = true |
||
| ) | [inline] |
(Re)initialise the conic segment by passing it its three "constructors".
Definition at line 219 of file vgl_conic_segment_2d.h.
| void vgl_conic_segment_2d< Type >::set | ( | vgl_conic< Type > | co, |
| vgl_homg_point_2d< Type > const & | p1, | ||
| vgl_homg_point_2d< Type > const & | p2, | ||
| bool | counterclockwise = true |
||
| ) | [inline] |
(Re)initialise the conic segment by passing it its three "constructors".
Definition at line 224 of file vgl_conic_segment_2d.h.
| void vgl_conic_segment_2d< Type >::set | ( | vgl_point_2d< Type > const & | p1, |
| vgl_point_2d< Type > const & | p2, | ||
| vgl_conic< Type > | co, | ||
| bool | counterclockwise = true |
||
| ) | [inline] |
(Re)initialise the conic segment by passing it its three "constructors".
Definition at line 230 of file vgl_conic_segment_2d.h.
| void vgl_conic_segment_2d< Type >::set | ( | vgl_conic< Type > | co, |
| vgl_point_2d< Type > const & | p1, | ||
| vgl_point_2d< Type > const & | p2, | ||
| bool | counterclockwise = true |
||
| ) | [inline] |
(Re)initialise the conic segment by passing it its three "constructors".
Definition at line 236 of file vgl_conic_segment_2d.h.
| void vgl_conic_segment_2d< Type >::swap_direction | ( | ) | [inline] |
Change the direction of the conic section but keep the end points.
This implies that now the conic segment contains those points of the conic which before did not belong to the conic segment! (Except for the two end points, of course.)
Definition at line 175 of file vgl_conic_segment_2d.h.
| void vgl_conic_segment_2d< Type >::swap_endpoints | ( | ) | [inline] |
Interchange the two endpoints but keep the direction.
This implies that now the conic segment contains those points of the conic which before did not belong to the conic segment! (Except for the two end points, of course.)
Definition at line 169 of file vgl_conic_segment_2d.h.
| vcl_ostream & operator<< | ( | vcl_ostream & | s, |
| const vgl_conic_segment_2d< Type > & | c_s | ||
| ) | [related] |
Write to stream.
| vcl_istream & operator>> | ( | vcl_istream & | is, |
| vgl_conic_segment_2d< Type > & | c_s | ||
| ) | [related] |
Read from stream.
vgl_conic<Type> vgl_conic_segment_2d< Type >::conic_ [private] |
The conic that represents the curve between point1 and point2.
Definition at line 111 of file vgl_conic_segment_2d.h.
bool vgl_conic_segment_2d< Type >::counterclockwise_ [private] |
Whether traversal is in counter-clockwise direction (the default) or not.
Definition at line 114 of file vgl_conic_segment_2d.h.
vgl_homg_point_2d<Type> vgl_conic_segment_2d< Type >::p1_ [private] |
One end of conic segment.
Definition at line 105 of file vgl_conic_segment_2d.h.
vgl_homg_point_2d<Type> vgl_conic_segment_2d< Type >::p2_ [private] |
The other end of the conic segment.
Definition at line 108 of file vgl_conic_segment_2d.h.
1.7.5.1