1 // This is oxl/mvl/LineSeg.cxx
2 #include <iostream>
3 #include "LineSeg.h"
4 //:
5 // \file
6
7 #ifdef _MSC_VER
8 # include "vcl_msvc_warnings.h"
9 #endif
10
11 //: Constructor
LineSeg(float x0,float y0,float x1,float y1,float theta,float grad_mean)12 LineSeg::LineSeg(float x0, float y0, float x1, float y1, float theta, float grad_mean)
13 {
14 x0_ = x0;
15 y0_ = y0;
16 x1_ = x1;
17 y1_ = y1;
18 theta_ = theta;
19 grad_mean_ = grad_mean;
20 }
21
22 //: Save to std::ostream
operator <<(std::ostream & s,const LineSeg & l)23 std::ostream& operator<<(std::ostream& s, const LineSeg& l)
24 {
25 return s << l.x0_ << ' '
26 << l.y0_ << ' '
27 << l.x1_ << ' '
28 << l.y1_ << ' '
29 << l.theta_ << ' '
30 << l.grad_mean_ << std::endl;
31 }
32
33 //: Read from std::istream
operator >>(std::istream & s,LineSeg & l)34 std::istream& operator>>(std::istream& s, LineSeg& l)
35 {
36 return s >> l.x0_ >> l.y0_ >> l.x1_ >> l.y1_ >> l.theta_ >> l.grad_mean_;
37 }
38