119 lines
2.4 KiB
C++
119 lines
2.4 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TPGeGLineSeg2D 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TPGeGLineSeg2D 声明
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#ifndef _TPGEGLINESEG2D_H_
|
|
#define _TPGEGLINESEG2D_H_
|
|
|
|
#ifndef _TPGECURVE2D_H_
|
|
#include "TPGeCurve2D.h"
|
|
#endif
|
|
|
|
#ifndef _TGVECTOR2D_H_
|
|
#include "TGVector2D.h"
|
|
#endif
|
|
|
|
#ifndef _TPGELINE2D_H_
|
|
#include "TPGeLine2D.h"
|
|
#endif
|
|
|
|
#ifndef _TGPOINT_H_
|
|
#include "TGPoint.h"
|
|
#endif
|
|
|
|
#ifndef _TTABLE_H_
|
|
#include "TTable.h"
|
|
#endif
|
|
|
|
#ifndef _TPGEEXTEND2D_H_
|
|
#include "TPGeExtend2D.h"
|
|
#endif
|
|
|
|
#ifndef _TGOBJECT_H_
|
|
#include "TGObject.h"
|
|
#endif
|
|
|
|
#ifndef _TGOBJECTLIST_H_
|
|
#include "TGObjectList.h"
|
|
#endif
|
|
|
|
#ifndef _TWFLAG_H_
|
|
#include "TWFlag.h"
|
|
#endif
|
|
|
|
#ifndef _TGMLINE2D_H_
|
|
#include "TGMLine2D.h"
|
|
#endif
|
|
|
|
class TGObject3D;
|
|
|
|
class GEOAPI TPGeGLineSeg2D : public TPGeGLine2D
|
|
{
|
|
DECLARE_RUN_TIME_CLASS(TPGeGLineSeg2D)
|
|
|
|
public:
|
|
|
|
TPGeGLineSeg2D();
|
|
|
|
TPGeGLineSeg2D(const TPGeLine2D& line);
|
|
|
|
TPGeGLineSeg2D(const TGVector2D& vt,const TGPoint& pt);
|
|
|
|
TPGeGLineSeg2D(const TGPoint& pt0,const TGPoint& pt1);
|
|
virtual ~TPGeGLineSeg2D();
|
|
|
|
//重载 TPGeCurve2D
|
|
//存在区间[0,1]
|
|
virtual void GetStartPoint(TGPoint& pt) const;
|
|
|
|
virtual void GetEndPoint(TGPoint& pt) const;
|
|
|
|
virtual bool IsFinite(bool bStart) const;
|
|
|
|
virtual TGMLine2D* MLinearize(double paDist=0) const;
|
|
|
|
virtual TPGeCurve2D* GetExtendCurve() const;
|
|
|
|
virtual double Length() const;
|
|
|
|
virtual void Reverse();
|
|
|
|
virtual void Split(const TTable<double>& paTable,TGObjectList& res) const;
|
|
|
|
//重载 TGObject3D
|
|
virtual TGObject3D* Convert3D() const;
|
|
|
|
//重载 TGObject
|
|
virtual TGObject * Clone() const;
|
|
|
|
virtual GRelation HitTest(const TGPoint& pt) const;
|
|
|
|
virtual bool Intersect(const TGObject& obj,TGObjectList& res) const;
|
|
|
|
virtual bool IsInclude(const TGObject& obj) const;
|
|
|
|
virtual bool GetExtend2D(TPGeExtend2D& ext) const;
|
|
|
|
TGPoint GetEndPoint() const;
|
|
|
|
TGPoint GetMidPoint() const;
|
|
|
|
const TGPoint& GetStartPoint() const;
|
|
|
|
bool IsSameSeg(const TPGeGLineSeg2D& seg,bool bSameDirection = false) const;
|
|
|
|
bool SubtractBy(const TPGeGLineSeg2D& seg,TGObjectList& res) const;
|
|
|
|
void SubtractBy(const TGObjectList& oList,TGObjectList& res) const;
|
|
|
|
};
|
|
|
|
#endif
|
|
|