00001 // This is oxl/mvl/HomgLine3D.h 00002 #ifndef HomgLine3D_h_ 00003 #define HomgLine3D_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Homogeneous 3D Line 00010 // 00011 // A class to hold a homogeneous representation of a 3D Line. The 00012 // line is stored as a pair of HomgPoint3Ds. 00013 // 00014 // \verbatim 00015 // Modifications: 00016 // Peter Vanroose - 11 Mar 97 - added operator== 00017 // \endverbatim 00018 00019 #include <mvl/HomgPoint3D.h> 00020 #include <vcl_iosfwd.h> 00021 00022 class HomgLine3D 00023 { 00024 // Data Members------------------------------------------------------------ 00025 HomgPoint3D point_finite_; //!< any finite point on the line 00026 HomgPoint3D point_infinite_; 00027 00028 public: 00029 // Constructors/Initializers/Destructors----------------------------------- 00030 00031 HomgLine3D(); 00032 HomgLine3D(const HomgLine3D&); 00033 HomgLine3D(const HomgPoint3D& point_finite,const HomgPoint3D& point_infinite); 00034 ~HomgLine3D(); 00035 00036 // Data Access------------------------------------------------------------- 00037 HomgPoint3D const & get_point_finite() const { return point_finite_; } 00038 HomgPoint3D & get_point_finite() { return point_finite_; } 00039 HomgPoint3D const & get_point_infinite() const { return point_infinite_; } 00040 HomgPoint3D & get_point_infinite() { return point_infinite_; } 00041 vnl_double_3 dir() const; 00042 00043 // Utility Methods--------------------------------------------------------- 00044 void force_point2_infinite(); 00045 bool operator==(HomgLine3D const& p) const { 00046 return point_finite_==p.point_finite_ && point_infinite_==p.point_infinite_; 00047 } 00048 }; 00049 00050 vcl_ostream& operator<<(vcl_ostream& s, const HomgLine3D& ); 00051 00052 #endif // HomgLine3D_h_