00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "Teddy/Models/Line.h"
00026 #include "Teddy/Models/Vertex.h"
00027
00028
00029 namespace Teddy {
00030 namespace Models {
00031
00032
00034 Line::Line( Vertex *v1, Vertex * v2 ){
00035 start_point = v1;
00036 end_point = v2;
00037 }
00038
00039
00041 Line::Line( const Line &l ){
00042 start_point = l.start_point;
00043 end_point = l.end_point;
00044
00045 }
00046
00047
00051 void Line::draw( Projection *p ){
00052 start_point->draw( p );
00053 end_point ->draw( p );
00054 }
00055
00056
00058
00059
00060
00061
00062
00063
00064
00066 void Line::swap(){
00067 Vertex *old_start = start_point;
00068 start_point = end_point;
00069 end_point = old_start;
00070 }
00071
00072
00077 bool Line::operator==( const Line &l ) const {
00078 if( (start_point==l.start_point &&
00079 end_point ==l.end_point ) ||
00080 (start_point==l.end_point &&
00081 end_point ==l.start_point ) )
00082 {
00083 return true;
00084 }else{
00085 return false;
00086 }
00087 }
00088
00089
00091 bool Line::operator!=( const Line &l ) const {
00092 if( (start_point==l.start_point &&
00093 end_point ==l.end_point ) ||
00094 (start_point==l.end_point &&
00095 end_point ==l.start_point ) )
00096 {
00097 return false;
00098 }else{
00099 return true;
00100 }
00101 }
00102
00103
00104 };
00105 };
00106