contrib/oxl/mvl/HomgPlane3D.h
Go to the documentation of this file.
00001 // This is oxl/mvl/HomgPlane3D.h
00002 #ifndef HomgPlane3D_h_
00003 #define HomgPlane3D_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Homogeneous 4-vector for a 3D plane
00010 //
00011 // A class to hold a homogeneous 4-vector for a 3D plane.
00012 
00013 #include <mvl/Homg3D.h>
00014 #include <vnl/vnl_double_3.h>
00015 #include <vcl_iosfwd.h>
00016 
00017 class HomgPoint3D;
00018 
00019 class HomgPlane3D : public Homg3D
00020 {
00021  public:
00022   // Constructors/Initializers/Destructors-------------------------------------
00023 
00024   HomgPlane3D ();
00025   HomgPlane3D (double x, double y, double z, double w);
00026   HomgPlane3D (const vnl_double_3& n, double d);
00027   HomgPlane3D (const vnl_double_4& v): Homg3D(v) {}
00028   ~HomgPlane3D ();
00029 
00030   // Utility Methods-----------------------------------------------------------
00031   HomgPoint3D closest_point(const HomgPoint3D& x) const;
00032   double distance(const HomgPoint3D& x) const;
00033 
00034   vnl_vector<double> n() const { return homg_vector_.extract(3).normalize(); }
00035 };
00036 
00037 vcl_ostream& operator<<(vcl_ostream&, const HomgPlane3D&);
00038 
00039 #endif // HomgPlane3D_h_