00001 00010 class OLine : public OGraphic 00011 { 00012 protected: 00013 OPoint b,e; 00014 00015 public: 00016 inline OGraphic* clone() const; 00017 inline OGraphic* create() const; 00018 OLine(); 00019 OLine(OPoint &,OPoint &); 00020 OLine(int,int,int,int); 00021 ~OLine(); 00022 00023 int getDX(); 00024 int getDY(); 00025 double getLength(); 00026 double matchLength(OLine &); 00027 bool isOpposite(OLine &); 00028 void move(int,int,int=1); 00029 void movec(); 00030 void reverse(); 00031 OLine getReverse(); 00032 OPoint getMiddle(); 00033 bool isConnected(OLine &); 00034 bool isNear(OLine &); 00035 double getTangent(); 00036 int getOrigin(); 00037 double getDirection(); 00038 double getDAngle(OLine &); 00039 double getAngle(OLine &); 00040 double getNAzimuth(); 00041 double getSAzimuth(); 00042 double getEAzimuth(); 00043 double getWAzimuth(); 00044 bool isParallel(OLine &); 00045 double matchTeta(OLine &); 00046 bool isOrthogonal(OLine &); 00047 bool isColinear(OPoint &); 00048 bool between(OPoint &); 00049 bool belong(OPoint &); 00050 OPoint getIntersection(OLine &); 00051 bool intersect(OLine &); 00052 bool overlap(OLine &); 00053 double euclid(OPoint &); 00054 double euclid(OLine &); 00055 00056 bool operator == (OLine &); 00057 bool operator != (OLine &); 00058 OLine operator / (int); 00059 OLine operator * (int); 00060 00061 void gomo(ostream &); 00062 void gomi(istream &); 00063 void svgo(ostream &); 00064 void xmlo(ostream &); 00065 00066 inline bool isValid(); 00067 inline void clear(); 00068 inline void set(OPoint &,OPoint &); 00069 inline void set(int,int,int,int); 00070 inline void setBegin(OPoint &); 00071 inline void setBegin(int,int); 00072 inline void setEnd(OPoint &); 00073 inline void setEnd(int,int); 00074 inline OPoint getBegin(); 00075 inline OPoint getEnd(); 00076 }; 00077 00081 inline OGraphic* OLine::clone() const 00082 { return new OLine(*this); } 00086 inline OGraphic* OLine::create() const 00087 { return new OLine(); } 00088 00093 bool OLine::isValid() 00094 { if(b.isValid() && e.isValid()) return true; return false; } 00098 inline void OLine::clear() 00099 { b.clear(); e.clear();} 00103 inline void OLine::set(OPoint & b,OPoint & e) 00104 { this->b = b; this->e = e;} 00108 inline void OLine::set(int x1,int y1,int x2, int y2) 00109 { b.set(x1,y1); e.set(x2,y2);} 00113 inline void OLine::setBegin(OPoint & b) 00114 { this->b = b;} 00118 inline void OLine::setBegin(int x,int y) 00119 { b.set(x,y);} 00123 inline void OLine::setEnd(OPoint & e) 00124 { this->e = e;} 00128 inline void OLine::setEnd(int x,int y) 00129 { e.set(x,y);} 00130 00134 inline OPoint OLine::getBegin() 00135 {return b;} 00139 inline OPoint OLine::getEnd() 00140 {return e;}