//-------------------------------------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TPGeLine2D Àà // = Version : ver2.0 // = Author : wlw // = CreateDate : 2002-09-09 // = Description: TPGeLine2D ÉùÃ÷ ·½³Ì£ºx=basePoint.x+a*t;y=basePoint.y+b*t;TGVector2D=(a,b) // = Maintainers: // //-------------------------------------------------------------------------------------------------------+ #ifndef _TPGELINE2D_H_ #define _TPGELINE2D_H_ #ifndef _TGVECTOR2D_H_ #include "TGVector2D.h" #endif #ifndef _TGPOINT_H_ #include "TGPoint.h" #endif #ifndef _TWFLAG_H_ #include "TWFlag.h" #endif class TPGeCircle; class TGMatrix; class GEOAPI TPGeLine2D : public TGVector2D { public: TPGeLine2D(); TPGeLine2D(const TPGeLine2D& line); TPGeLine2D(const TGPoint& pt0,const TGPoint& pt1); TPGeLine2D(const TGVector2D& vt,const TGPoint& pt); virtual ~TPGeLine2D(); TPGeLine2D& operator = (const TPGeLine2D& line); bool IsValid()const; void Offset(double nDist); void Pt2Pa(const TGPoint& pt,double& pa) const; void Pa2Pt(double pa,TGPoint& pt) const; void GetNearestPoint(const TGPoint& pt,TGPoint& res) const; void SetPoint(const TGPoint& pt0,const TGPoint& pt1); void SetVector(const TGPoint& vt); void TransformBy(const TGMatrix* pMatrix); GRelation HitTest(const TGPoint& pt,bool bNormalized = false) const; bool IsSameLine(const TPGeLine2D& line,bool bSameDirection,bool bNormalized = false) const; int Intersect(const TPGeLine2D& line,double& pa,bool bNormalized = false) const; int Intersect(const TPGeLine2D& line,double& pa1,double& pa2,bool bNormalized = false) const; int Intersect(const TPGeLine2D& line,TGPoint& pt,bool bNormalized = false) const; int Intersect(const TPGeCircle* pCircle,double& pa1,double& pa2,bool bNormalized = false) const; double Integration(double pa0,double pa1) const; public: double &a,&b,&c; TGPoint basePoint; }; #endif