contrib/gel/vdgl/vdgl_edgel.h
Go to the documentation of this file.
00001 // This is gel/vdgl/vdgl_edgel.h
00002 #ifndef vdgl_edgel_h
00003 #define vdgl_edgel_h
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Represents a 2D image edgel
00010 //
00011 // \author
00012 //    Geoff Cross
00013 
00014 #include <vcl_iosfwd.h>
00015 #include <vgl/vgl_point_2d.h>
00016 
00017 class vdgl_edgel
00018 {
00019  public:
00020 
00021   // Constructors/Destructor---------------------------------------------------
00022   vdgl_edgel() {}
00023   vdgl_edgel( const double x, const double y, const double grad= -1, const double theta= 0 );
00024   ~vdgl_edgel() {}
00025 
00026   // Operators-----------------------------------------------------------------
00027 
00028   vdgl_edgel& operator=(const vdgl_edgel& that);
00029 
00030   friend bool operator==( const vdgl_edgel &e1, const vdgl_edgel &e2);
00031   friend vcl_ostream& operator<<(vcl_ostream& s, const vdgl_edgel& p);
00032 
00033   // Data Access---------------------------------------------------------------
00034 
00035   // getters
00036   inline vgl_point_2d<double> get_pt() const { return p_; }
00037   inline double get_x() const { return p_.x(); }
00038   inline double get_y() const { return p_.y(); }
00039   inline double get_grad() const { return grad_; }
00040   inline double get_theta() const { return theta_; }
00041   inline double x() const { return p_.x(); }
00042   inline double y() const { return p_.y(); }
00043 
00044   // setters
00045   inline void set_x( const double x) { p_.set(x,p_.y()); }
00046   inline void set_y( const double y) { p_.set(p_.x(),y); }
00047   inline void set_grad( const double grad) { grad_= grad; }
00048   inline void set_theta( const double theta) { theta_= theta; }
00049 
00050   // INTERNALS-----------------------------------------------------------------
00051  protected:
00052   // Data Members--------------------------------------------------------------
00053 
00054   vgl_point_2d<double> p_;
00055   double grad_;
00056   double theta_;
00057 };
00058 
00059 bool operator==( const vdgl_edgel &e1, const vdgl_edgel &e2);
00060 vcl_ostream& operator<<(vcl_ostream& s, const vdgl_edgel& p);
00061 
00062 #endif // vdgl_edgel_h