contrib/oxl/mvl/LineSeg.cxx
Go to the documentation of this file.
00001 // This is oxl/mvl/LineSeg.cxx
00002 #include "LineSeg.h"
00003 //:
00004 //  \file
00005 
00006 #include <vcl_iostream.h>
00007 
00008 //: Constructor
00009 LineSeg::LineSeg(float x0, float y0, float x1, float y1, float theta, float grad_mean)
00010 {
00011   x0_ = x0;
00012   y0_ = y0;
00013   x1_ = x1;
00014   y1_ = y1;
00015   theta_ = theta;
00016   grad_mean_ = grad_mean;
00017 }
00018 
00019 //: Save to vcl_ostream
00020 vcl_ostream& operator<<(vcl_ostream& s, const LineSeg& l)
00021 {
00022   return s << l.x0_ << ' '
00023            << l.y0_ << ' '
00024            << l.x1_ << ' '
00025            << l.y1_ << ' '
00026            << l.theta_ << ' '
00027            << l.grad_mean_ << vcl_endl;
00028 }
00029 
00030 //: Read from vcl_istream
00031 vcl_istream& operator>>(vcl_istream& s, LineSeg& l)
00032 {
00033   return s >> l.x0_ >> l.y0_ >> l.x1_ >> l.y1_ >> l.theta_ >> l.grad_mean_;
00034 }