00001 00011 class OPoint : public OGraphic 00012 { 00013 protected: 00014 int x; 00015 int y; 00016 00017 public: 00018 inline OGraphic* clone() const; 00019 inline OGraphic* create() const; 00020 OPoint(); 00021 OPoint(int,int); 00022 ~OPoint(); 00023 00024 int getDX(OPoint &); 00025 int getDY(OPoint &); 00026 double euclid(OPoint &); 00027 void move(int,int); 00028 void scalar(double); 00029 OPoint getFollowing(int); 00030 bool isConnected(OPoint &); 00031 int getDirection(OPoint &); 00032 00033 bool operator == (OPoint &); 00034 bool operator != (OPoint &); 00035 OPoint operator + (OPoint &); 00036 OPoint operator - (OPoint &); 00037 OPoint operator / (int); 00038 OPoint operator * (int); 00039 00040 void gomo(ostream &); 00041 void gomi(istream &); 00042 void xmlo(ostream &); 00043 void svgo(ostream &); 00044 00045 inline bool isValid(); 00046 inline void clear(); 00047 inline void set(int,int); 00048 inline void setX(int); 00049 inline void setY(int); 00050 inline int getX(); 00051 inline int getY(); 00052 }; 00053 00057 inline OGraphic* OPoint::clone() const 00058 { return new OPoint(*this); } 00062 inline OGraphic* OPoint::create() const 00063 { return new OPoint(); } 00064 00065 00070 inline bool OPoint::isValid() 00071 { if((x>=0)&&(y>=0)) return true; return false;} 00075 inline void OPoint::clear() 00076 { this->x = -1; this->y = -1; } 00080 inline void OPoint::set(int x,int y) 00081 { this->x = x; this->y = y; } 00085 inline void OPoint::setX(int x) 00086 { this->x = x;} 00090 inline void OPoint::setY(int y) 00091 { this->y = y;} 00095 inline int OPoint::getX() 00096 {return x;} 00100 inline int OPoint::getY() 00101 {return y;}