74 lines
2.2 KiB
C++
74 lines
2.2 KiB
C++
#pragma once
|
|
#include "GeShape.h"
|
|
#include "ADSGePoint3d.h"
|
|
|
|
class GeArc;
|
|
class GeLine;
|
|
class EntitySet;
|
|
|
|
class GeCircle : public GeShape
|
|
{
|
|
public:
|
|
GeCircle();
|
|
GeCircle(const GeCircle &src);
|
|
GeCircle(const ads_point, const ads_point);
|
|
GeCircle(const ads_point ptcenter,double dradius);
|
|
GeCircle(const EntitySet &entCircle, ads_matrix mat = NULL);
|
|
GeCircle(const ADSGePoint3d &pt1, const ADSGePoint3d &pt2, const ADSGePoint3d &pt3);
|
|
virtual ~GeCircle();
|
|
|
|
virtual bool IsKindOf(TEntityId entType) const;
|
|
virtual TEntityId Type() const;
|
|
virtual void CopyFrom(const GeEntity* pSrc);
|
|
|
|
virtual ShapeType GetShapeType() const;
|
|
|
|
virtual int Intersection(const GeLine* pLine, ads_point ptrp1 = NULL, ads_point ptrp2 = NULL) const;
|
|
virtual int Intersection(const GeArc* pArc, ads_point ptrp1 = NULL, ads_point ptrp2 = NULL) const;
|
|
virtual int Intersection(const GeCircle* pCir, ads_point ptrp1 = NULL, ads_point ptrp2 = NULL) const;
|
|
|
|
virtual int GetExtend(ads_point lowPt, ads_point upPt) const;
|
|
virtual int GetSubArc(const ADSGePoint3d& ptloc, ads_real dchordLen, GeArc& xarcres) const;
|
|
|
|
virtual int Make(const TCHAR* szlay = NULL) const;
|
|
virtual int Modify(const EntitySet* pEntity) const;
|
|
virtual int MakeEntity(const EntitySet* pEntity) const;
|
|
|
|
virtual void Center(ads_point ptCen);
|
|
//图形长度,周长
|
|
virtual ads_real GetLength() const;
|
|
|
|
virtual ads_real Area() const;
|
|
|
|
virtual int HitTest2d(const ADSGePoint3d &ptTest) const;
|
|
virtual int OSnap(int nMode, ADSGePoint3d &ptPick) const;
|
|
|
|
//第一象限点圆心变换,求半径
|
|
virtual void TransUCS(ads_matrix mat);
|
|
|
|
int operator !() const;
|
|
GeCircle& operator = (const GeCircle &src);
|
|
bool operator == (const GeCircle &src) const;
|
|
|
|
GeCircle Offset(ads_real dist) const;
|
|
|
|
ADSGePoint3d GetCenterPt();
|
|
ADSGePoint3d GetCenterPt() const;
|
|
void SetCenterPt(ADSGePoint3d pt);
|
|
|
|
double GetRadius() const;
|
|
double GetRadius();
|
|
void SetRadius(double dR);
|
|
bool Set(const ADSGePoint3d &ptStart, const ADSGePoint3d &ptOn, const ADSGePoint3d &ptEnd);
|
|
void Set(const ADSGePoint3d &diaPt1, const ADSGePoint3d &diaPt2);
|
|
|
|
int PtOnCircle(const ADSGePoint3d &pt);
|
|
public:
|
|
ADSGePoint3d m_ptCenter;
|
|
double m_dRadius;
|
|
};
|
|
|
|
inline GeEntity::TEntityId GeCircle::Type() const
|
|
{
|
|
return GeEntity::eCircle;
|
|
} |