95 lines
2.4 KiB
C++
95 lines
2.4 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TGMCurve2D 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TGMCurve2D 声明
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#ifndef _TGMCURVE2D_H_
|
|
#define _TGMCURVE2D_H_
|
|
|
|
#ifndef _TPGECURVE2D_H_
|
|
#include "TPGeCurve2D.h"
|
|
#endif
|
|
|
|
#ifndef _TGPOINT_H_
|
|
#include "TGPoint.h"
|
|
#endif
|
|
|
|
#ifndef _TPDLIST_H_
|
|
#include "TPDList.h"
|
|
#endif
|
|
|
|
#ifndef _TGOBJECTLIST_H_
|
|
#include "TGObjectList.h"
|
|
#endif
|
|
|
|
#ifndef _TGMATRIX_H_
|
|
#include "TGMatrix.h"
|
|
#endif
|
|
|
|
#ifndef _TGOBJECT_H_
|
|
#include "TGObject.h"
|
|
#endif
|
|
|
|
#ifndef _TPGELINE2D_H_
|
|
#include "TPGeLine2D.h"
|
|
#endif
|
|
|
|
class TGMLine2D;
|
|
|
|
class GEOAPI TGMCurve2D:public TPGeCurve2D,public TPDList< TPGeCurve2D >
|
|
{
|
|
DECLARE_RUN_TIME_CLASS(TGMCurve2D)
|
|
public:
|
|
//construct
|
|
TGMCurve2D();
|
|
TGMCurve2D(const TPGeCurve2D&curve);
|
|
TGMCurve2D(const TGMCurve2D&curve);
|
|
virtual ~TGMCurve2D();
|
|
|
|
|
|
//override TPGeCurve2D
|
|
virtual bool IsClosed() const;
|
|
virtual bool IsFinite(bool bStart) const;
|
|
|
|
//只有相邻段有且只有一点交(封闭且段数为2时,有两点交),段数大于2时子段不能封闭!
|
|
virtual bool IsSelfCross() const;
|
|
|
|
virtual void GetTangent(double pa,TPGeLine2D&line) const;
|
|
virtual void Pa2Pt(double pa,TGPoint&pt) const;
|
|
virtual void Pt2Pa(const TGPoint&pt,double&pa) const;
|
|
virtual void GetStartPoint(TGPoint&pt) const;
|
|
virtual void GetEndPoint(TGPoint&pt) const;
|
|
virtual double Integration(double pa0,double pa1) const;
|
|
virtual void Reverse();
|
|
virtual TGMLine2D* MLinearize(double paDist=0) const;
|
|
virtual TGMLine2D* PLinearize(double paDist=0) const;
|
|
virtual TPGeCurve2D* GetSubCurve(double pa0,double pa1) const;
|
|
virtual TGPoint GetSamplePoint() const;
|
|
virtual bool Offset(double offset);
|
|
|
|
//override TGObject2D
|
|
virtual void SetElev(double elev);
|
|
virtual double GetElev() const;
|
|
|
|
//override TGObject
|
|
//不空,各段有效且前后相连
|
|
virtual bool IsValid() const;
|
|
virtual TGObject* Clone() const;
|
|
virtual void TransformBy(const TGMatrix&matrix);
|
|
//分解为子段
|
|
virtual bool Explode(TGObjectList&res) const;
|
|
virtual bool IsInclude(const TGObject&obj) const;
|
|
|
|
//query
|
|
long GetSegNum() const;
|
|
//pa转化为本地参数
|
|
long Pa2Seg(double &pa) const;
|
|
|
|
};
|
|
#endif
|