138 lines
3.1 KiB
C++
138 lines
3.1 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TPGeCircle2D 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TPGeCircle2D 声明
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#ifndef _TPGECIRCLE2D_H_
|
|
#define _TPGECIRCLE2D_H_
|
|
|
|
#ifndef _TPGECURVE2D_H_
|
|
#include "TPGeCurve2D.h"
|
|
#endif
|
|
|
|
#ifndef _TPGECIRCLE_H_
|
|
#include "TPGeCircle.h"
|
|
#endif
|
|
|
|
#ifndef _TGPOINT_H_
|
|
#include "TGPoint.h"
|
|
#endif
|
|
|
|
#ifndef _TPGELINE2D_H_
|
|
#include "TPGeLine2D.h"
|
|
#endif
|
|
|
|
#ifndef _TTABLE_H_
|
|
#include "TTable.h"
|
|
#endif
|
|
|
|
#ifndef _TGMATRIX_H_
|
|
#include "TGMatrix.h"
|
|
#endif
|
|
|
|
#ifndef _TGOBJECT_H_
|
|
#include "TGObject.h"
|
|
#endif
|
|
|
|
#ifndef _TGOBJECTLIST_H_
|
|
#include "TGObjectList.h"
|
|
#endif
|
|
|
|
#ifndef _TPGEEXTEND2D_H_
|
|
#include "TPGeExtend2D.h"
|
|
#endif
|
|
|
|
class GEOAPI TPGeCircle2D : public TPGeCurve2D,public TPGeCircle
|
|
{
|
|
DECLARE_RUN_TIME_CLASS(TPGeCircle2D)
|
|
|
|
public:
|
|
|
|
TPGeCircle2D(bool bUnclock = true);
|
|
|
|
TPGeCircle2D(const TGPoint& pt,double r,bool bUnclock = true);
|
|
|
|
TPGeCircle2D(const TPGeCircle& circle,bool bUnclock = true);
|
|
|
|
TPGeCircle2D(const TGPoint& pt0,const TGPoint& pt1,const TGPoint& pt2);
|
|
|
|
TPGeCircle2D(const TGPoint& pt0,const TGPoint& pt1,double angle);
|
|
|
|
virtual ~TPGeCircle2D();
|
|
|
|
//正向圆参数为正向弧度,反向圆参数为反向弧度
|
|
virtual void Pa2Pt(double pa,TGPoint& pt) const;
|
|
|
|
//返回区间[0,2PI)
|
|
virtual void Pt2Pa(const TGPoint& pt,double& pa) const;
|
|
|
|
virtual void Reverse();
|
|
|
|
virtual void GetTangent(double pa,TPGeLine2D& line) const;
|
|
|
|
virtual bool IsClosed() const;
|
|
|
|
virtual bool IsFinite(bool bStart) const;
|
|
|
|
virtual bool IsClockwise() const;
|
|
|
|
virtual double Integration(double pa0,double pa1) const;
|
|
|
|
virtual double Area() const;
|
|
|
|
virtual double Length() const;
|
|
|
|
virtual TGMLine2D* MLinearize(double paDist = 0) const;
|
|
|
|
virtual TGMLine2D* PLinearize(double paDist = 0) const;
|
|
|
|
virtual double GetMLinePrec() const;
|
|
|
|
virtual void Split(const TTable<double> & paTable,TGObjectList& res) const;
|
|
|
|
virtual TPGeCurve2D* GetSubCurve(double pa0,double pa1) const;
|
|
|
|
virtual bool Offset(double offset);
|
|
|
|
//重载 TGObject2D
|
|
virtual void SetElev(double elev);
|
|
virtual double GetElev() const;
|
|
|
|
//重载 TGObject
|
|
virtual bool IsValid() const;
|
|
|
|
virtual void TransformBy(const TGMatrix& matrix);
|
|
|
|
virtual TGObject * Clone() const;
|
|
|
|
virtual bool Intersect(const TGObject& obj,TGObjectList& res) const;
|
|
|
|
virtual bool IsInclude(const TGObject& obj) const;
|
|
|
|
virtual GRelation HitTest(const TGPoint& pt) const;
|
|
|
|
virtual bool GetExtend2D(TPGeExtend2D& ext) const;
|
|
|
|
//参数点按圆曲线方向排列
|
|
void Init(const TGPoint& pt0,const TGPoint& pt1,const TGPoint& pt2);
|
|
|
|
//angle决定朝向
|
|
void Init(const TGPoint& pt0,const TGPoint& pt1,double angle);
|
|
|
|
bool IsSameCircle(const TPGeCircle2D& cir,bool bSameDirection = false) const;
|
|
|
|
static void SetMLinePreci(double preci);
|
|
|
|
public:
|
|
|
|
//默认为0.005
|
|
static double g_fMLinePreci;
|
|
};
|
|
|
|
#endif
|