2 #ifndef vgl_conic_segment_2d_h_ 3 #define vgl_conic_segment_2d_h_ 97 # include <vcl_msvc_warnings.h> 102 template <
class Type>
131 bool counterclockwise =
true)
139 bool counterclockwise =
true)
140 :
p1_(p1.x(), p1.y(), (Type)1),
p2_(p2.x(), p2.y(), (Type)1),
147 bool counterclockwise =
true)
155 bool counterclockwise =
true)
156 :
p1_(p1.x(), p1.y(), (Type)1),
p2_(p2.x(), p2.y(), (Type)1),
227 bool counterclockwise =
true)
239 bool counterclockwise =
true)
251 bool is_finite()
const { assert(!
"Not yet implemented");
return true; }
264 template <
class Type>
269 template <
class Type>
272 #define VGL_CONIC_SEGMENT_2D_INSTANTIATE(T) extern "please include vgl/vgl_conic_segment_2d.hxx first" 274 #endif // vgl_conic_segment_2d_h_
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_homg_point_2d< Type > point2() const
The second end-point of the conic segment.
vgl_homg_point_2d< Type > p1_
One end of conic segment.
a point in 2D nonhomogeneous space
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".
vgl_homg_point_2d< Type > point1() const
The first end-point of the conic segment.
vgl_conic< Type > conic() const
The conic underlying the segment.
void swap_direction()
Change the direction of the conic section but keep the end points.
bool contains(vgl_homg_point_2d< Type > const &) const
Finds out whether the given point lies on the conic segment.
vgl_conic< Type > conic_
The conic that represents the curve between point1 and point2.
bool is_counterclockwise() const
The direction of the segment (clockwise or counterclockwise).
void swap_endpoints()
Interchange the two endpoints but keep the direction.
bool is_clockwise() const
The direction of the segment (clockwise or counterclockwise).
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
bool counterclockwise_
Whether traversal is in counter-clockwise direction (the default) or not.
~vgl_conic_segment_2d()=default
Destructor.
vgl_conic_segment_2d()=default
Default constructor - does not initialise!.
bool operator==(vgl_conic_segment_2d< Type > const &l) const
The equality comparison operator.
Represents a 2D conic segment using two points.
bool is_finite() const
Finds out whether this curve has a finite length.
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".
point in projective 2D space
void set(T px, T py, T pw=(T) 1)
Set x,y,w.
bool operator!=(vgl_conic_segment_2d< Type >const &other) const
The inequality comparison operator.
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
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".
vgl_homg_point_2d< Type > p2_
The other end of the conic segment.
Represents a cartesian 2D point.
void normalize()
Normalise the direction of the segment to counterclockwise.
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".
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_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_conic_segment_2d< Type > const &l)
Copy constructor.
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).