vgl_line_3d_2_points.hxx
Go to the documentation of this file.
1 // This is core/vgl/vgl_line_3d_2_points.hxx
2 #ifndef vgl_line_3d_2_points_hxx_
3 #define vgl_line_3d_2_points_hxx_
4 //:
5 // \file
6 
7 #include <iostream>
8 #include <limits>
9 #include "vgl_line_3d_2_points.h"
10 // not used? #include <vcl_compiler.h>
11 
12 //***************************************************************************
13 // Initialization
14 //***************************************************************************
15 
16 
17 //***************************************************************************
18 // Utility methods
19 //***************************************************************************
20 
21 template <class Type>
23 {
24  if (this==&other)
25  return true;
26  // It suffices to check that the points are collinear:
27  return collinear(point1(), point2(), other.point1())
28  && collinear(point1(), point2(), other.point2());
29 }
30 
31 //*****************************************************************************
32 // stream operators
33 //*****************************************************************************
34 
35 template <class Type>
36 std::ostream& operator<<(std::ostream &s,
38 {
39  return s << "<vgl_line_3d_2_points "
40  << p.point1() << p.point2() << " >";
41 }
42 
43 #undef VGL_LINE_3D_2_POINTS_INSTANTIATE
44 #define VGL_LINE_3D_2_POINTS_INSTANTIATE(T) \
45 template class vgl_line_3d_2_points<T >;\
46 template std::ostream& operator<<(std::ostream&, vgl_line_3d_2_points<T > const&)
47 
48 #endif // vgl_line_3d_2_points_hxx_
bool operator==(vgl_line_3d_2_points< Type > const &l) const
comparison.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
A class to hold a non-homogeneous representation of a 3D line.
Definition: vgl_fwd.h:17
bool collinear(l const &l1, vgl_homg_point_3d< Type > const &p)
Does a line pass through a point, i.e., are the point and the line collinear?.
vgl_point_3d< Type > point1() const
Return the first point representing this line.
vgl_point_3d< Type > point2() const
Return the second point representing this line.
non-homogeneous 3D line, represented by 2 points.