2008-04-11 10:11:29 +02:00
|
|
|
#include "point.hh"
|
|
|
|
|
2008-05-29 10:48:05 +02:00
|
|
|
|
|
|
|
|
2008-04-11 10:11:29 +02:00
|
|
|
Point Point::operator=(const Point &p)
|
|
|
|
{
|
2008-04-15 12:19:15 +02:00
|
|
|
if(this == &p)
|
|
|
|
return *this;
|
|
|
|
x = p.x;
|
|
|
|
y = p.y;
|
|
|
|
z = p.z;
|
|
|
|
return *this;
|
2008-04-11 10:11:29 +02:00
|
|
|
}
|
|
|
|
|
2008-05-29 10:48:05 +02:00
|
|
|
|
|
|
|
|
2008-04-11 10:11:29 +02:00
|
|
|
bool Point::operator==(const Point &p)const
|
|
|
|
{
|
2008-04-15 12:19:15 +02:00
|
|
|
if((x == p.x) && (y == p.y) && (z == p.z))
|
|
|
|
return true;
|
|
|
|
return false;
|
2008-04-11 10:11:29 +02:00
|
|
|
}
|
|
|
|
|
2008-05-29 10:48:05 +02:00
|
|
|
|
|
|
|
|
2008-04-11 10:11:29 +02:00
|
|
|
bool Point::operator!=(const Point &p)const
|
|
|
|
{
|
2008-04-15 12:19:15 +02:00
|
|
|
if((x == p.x) && (y == p.y) && (z == p.z))
|
|
|
|
return false;
|
|
|
|
return true;
|
2008-04-11 10:11:29 +02:00
|
|
|
}
|
|
|
|
|
2008-05-29 10:48:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
bool Point::operator<(const Point &p)const
|
|
|
|
{
|
|
|
|
if (x + y + z < p.x + p.y + p.z)
|
|
|
|
return true ;
|
|
|
|
|
|
|
|
return false ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Point::operator>(const Point &p)const
|
|
|
|
{
|
|
|
|
return p < *this ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-11 10:11:29 +02:00
|
|
|
ostream &operator<<(ostream &os, const Point &p)
|
|
|
|
{
|
2008-04-15 12:19:15 +02:00
|
|
|
os << "(" << p.x << ";" << p.y << ";" << p.z << ")";
|
|
|
|
return os;
|
2008-04-11 10:11:29 +02:00
|
|
|
}
|