Line | |
---|
1 | #include <iostream> |
---|
2 | #include <duchamp/PixelMap/Line.hh> |
---|
3 | #include <duchamp/PixelMap/Voxel.hh> |
---|
4 | |
---|
5 | namespace PixelInfo |
---|
6 | { |
---|
7 | |
---|
8 | Line::Line(Voxel start, Voxel end): |
---|
9 | itsStart(start),itsEnd(end) |
---|
10 | { |
---|
11 | } |
---|
12 | |
---|
13 | Line::Line(int x0, int y0, int x1, int y1) |
---|
14 | { |
---|
15 | this->itsStart = Voxel(x0,y0); |
---|
16 | this->itsEnd = Voxel(x1,y1); |
---|
17 | } |
---|
18 | |
---|
19 | Line::Line(const Line& other) |
---|
20 | { |
---|
21 | this->operator=(other); |
---|
22 | } |
---|
23 | |
---|
24 | Line& Line::operator= (const Line& other) |
---|
25 | { |
---|
26 | if(this == &other) return *this; |
---|
27 | this->itsStart = other.itsStart; |
---|
28 | this->itsEnd = other.itsEnd; |
---|
29 | return *this; |
---|
30 | } |
---|
31 | |
---|
32 | std::ostream &operator<<(std::ostream &theStream, Line &theLine) |
---|
33 | { |
---|
34 | // theStream << theLine.itsStart << "-->" << theLine.itsEnd; |
---|
35 | theStream << theLine.itsStart.getX()<<","<<theLine.itsStart.getY() << "-->" << theLine.itsEnd.getX()<<","<<theLine.itsEnd.getY(); |
---|
36 | return theStream; |
---|
37 | } |
---|
38 | |
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.