vgl_line_segment_3d.hxx
Go to the documentation of this file.
1 // This is core/vgl/vgl_line_segment_3d.hxx
2 #ifndef vgl_line_segment_3d_hxx_
3 #define vgl_line_segment_3d_hxx_
4 
5 #include <iostream>
6 #include "vgl_line_segment_3d.h"
7 
8 #ifdef _MSC_VER
9 # include <vcl_msvc_warnings.h>
10 #endif
11 
12 // stream operators
13 template <class Type>
14 std::ostream& operator<<(std::ostream& s, vgl_line_segment_3d<Type> const & p)
15 {
16  return s << "<vgl_line_segment_3d " << p.point1() << " to " << p.point2() << " >";
17 }
18 
19 template <class Type>
20 std::istream& operator>>(std::istream& s, vgl_line_segment_3d<Type>& p)
21 {
22  vgl_point_3d<Type> p1, p2;
23  s >> p1 >> p2;
24  p.set(p1, p2);
25  return s;
26 }
27 
28 #undef VGL_LINE_SEGMENT_3D_INSTANTIATE
29 #define VGL_LINE_SEGMENT_3D_INSTANTIATE(Type) \
30 template class vgl_line_segment_3d<Type >;\
31 template std::istream& operator>>(std::istream&, vgl_line_segment_3d<Type >&);\
32 template std::ostream& operator<<(std::ostream&, vgl_line_segment_3d<Type > const&)
33 
34 #endif // vgl_line_segment_3d_hxx_
vgl_point_3d< Type > point1() const
void set(vgl_point_3d< Type > const &p1, vgl_point_3d< Type > const &p2)
assignment.
vgl_point_3d< Type > point2() const
Represents a cartesian 3D point.
Definition: vgl_fwd.h:11
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
line segment in 3D nonhomogeneous space
Represents a 3D line segment using two points.
Definition: vgl_fwd.h:19
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.