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 }
1.7.5.1