93 lines
2.6 KiB
C++
93 lines
2.6 KiB
C++
//-----------------------------------------------------------------------------+
|
|||
|
|
// Copyright (C), 1998-2007, SH Software Co. Ltd.
|
||
|
|
// = FileName : XCircle类
|
||
|
|
// = Version : ver2.0
|
||
|
|
// = Author : zjq
|
||
|
|
// = CreateDate : 2002-09-09
|
||
|
|
// = Description: XCircle类声明
|
||
|
|
// = Maintainers:
|
||
|
|
//
|
||
|
|
//-----------------------------------------------------------------------------+
|
||
|
|
#ifndef _XCIRCLE_H_
|
||
|
|
#define _XCIRCLE_H_
|
||
|
|
|
||
|
|
#ifndef _XSHAPE_H_
|
||
|
|
#include "XCell.h"
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#ifndef _XPOINT_H_
|
||
|
|
#include "XPoint.h"
|
||
|
|
#endif
|
||
|
|
|
||
|
|
class XArc;
|
||
|
|
class XLine;
|
||
|
|
class Entity;
|
||
|
|
|
||
|
|
class GEOAPI XCircle : public XCell
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
XCircle();
|
||
|
|
XCircle(const XCircle &src);
|
||
|
|
XCircle(const ads_point, const ads_point);
|
||
|
|
XCircle(const ads_point ptcenter,double dradius);
|
||
|
|
XCircle(const Entity &entCircle, ads_matrix mat = NULL);
|
||
|
|
XCircle(const XPoint &pt1, const XPoint &pt2, const XPoint &pt3);
|
||
|
|
virtual ~XCircle();
|
||
|
|
|
||
|
|
virtual bool IsKindOf(TEntityId entType) const;
|
||
|
|
virtual TEntityId Type() const;
|
||
|
|
virtual void CopyFrom(const XEntity* pSrc);
|
||
|
|
|
||
|
|
virtual ShapeType GetShapeType() const;
|
||
|
|
|
||
|
|
virtual int Intersection(const XLine* pLine, ads_point ptrp1 = NULL, ads_point ptrp2 = NULL) const;
|
||
|
|
virtual int Intersection(const XArc* pArc, ads_point ptrp1 = NULL, ads_point ptrp2 = NULL) const;
|
||
|
|
virtual int Intersection(const XCircle* pCir, ads_point ptrp1 = NULL, ads_point ptrp2 = NULL) const;
|
||
|
|
|
||
|
|
virtual int GetExtend(ads_point lowPt, ads_point upPt) const;
|
||
|
|
virtual int GetSubArc(const XPoint& ptloc, ads_real dchordLen, XArc& xarcres) const;
|
||
|
|
|
||
|
|
virtual int Make(const TCHAR* szlay = NULL) const;
|
||
|
|
virtual int Modify(const Entity* pEntity) const;
|
||
|
|
virtual int MakeEntity(const Entity* pEntity) const;
|
||
|
|
|
||
|
|
virtual void Center(ads_point ptCen);
|
||
|
|
//图形长度,周长
|
||
|
|
virtual ads_real GetLength() const;
|
||
|
|
|
||
|
|
virtual ads_real Area() const;
|
||
|
|
|
||
|
|
virtual int HitTest2d(const XPoint &ptTest) const;
|
||
|
|
virtual int OSnap(int nMode, XPoint &ptPick) const;
|
||
|
|
|
||
|
|
//第一象限点圆心变换,求半径
|
||
|
|
virtual void TransUCS(ads_matrix mat);
|
||
|
|
|
||
|
|
int operator !() const;
|
||
|
|
XCircle& operator = (const XCircle &src);
|
||
|
|
bool operator == (const XCircle &src) const;
|
||
|
|
|
||
|
|
XCircle Offset(ads_real dist) const;
|
||
|
|
|
||
|
|
XPoint GetCenterPt();
|
||
|
|
XPoint GetCenterPt() const;
|
||
|
|
void SetCenterPt(XPoint pt);
|
||
|
|
|
||
|
|
double GetRadius() const;
|
||
|
|
double GetRadius();
|
||
|
|
void SetRadius(double dR);
|
||
|
|
bool Set(const XPoint &ptStart, const XPoint &ptOn, const XPoint &ptEnd);
|
||
|
|
void Set(const XPoint &diaPt1, const XPoint &diaPt2);
|
||
|
|
|
||
|
|
int PtOnCircle(const XPoint &pt);
|
||
|
|
public:
|
||
|
|
XPoint m_ptCenter;
|
||
|
|
double m_dRadius;
|
||
|
|
};
|
||
|
|
|
||
|
|
inline XEntity::TEntityId XCircle::Type() const
|
||
|
|
{
|
||
|
|
return XEntity::eCircle;
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif
|