contrib/gel/vdgl/vdgl_edgel.cxx
Go to the documentation of this file.
00001 // This is gel/vdgl/vdgl_edgel.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 
00006 #include "vdgl_edgel.h"
00007 #include <vgl/vgl_point_2d.h>
00008 #include <vcl_iostream.h>
00009 
00010 vdgl_edgel::vdgl_edgel( const double x, const double y, const double grad, const double theta )
00011   : p_( x, y), grad_( grad), theta_( theta)
00012 {
00013 }
00014 
00015 vdgl_edgel& vdgl_edgel::operator=(const vdgl_edgel& that)
00016 {
00017   p_    = vgl_point_2d<double>( that.get_x(), that.get_y());
00018   grad_ = that.get_grad();
00019   theta_= that.get_theta();
00020 
00021   return *this;
00022 }
00023 
00024 
00025 bool operator==( const vdgl_edgel &e1, const vdgl_edgel &e2)
00026 {
00027   return (( e1.p_.x()== e2.p_.x()) &&
00028           ( e1.p_.y()== e2.p_.y()) &&
00029           ( e1.grad_== e2.grad_) &&
00030           ( e2.theta_== e2.theta_));
00031 }
00032 
00033 vcl_ostream&  operator<<(vcl_ostream& s, const vdgl_edgel& p)
00034 {
00035   return s << "<vdgl_edgel (" << p.p_.x() << ", " << p.p_.y() << "),("
00036            << p.grad_ << ", " << p.theta_ <<  ")>";
00037 }
00038