|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
//文件 Arc.h
|
|
|
//主要功能:
|
|
|
//
|
|
|
//程序编写: 2005-12-07
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
#include "curveex.h"
|
|
|
#include ".\circle.h"
|
|
|
|
|
|
|
|
|
class AFX_EXT_CLASS CArc : public CEllipse
|
|
|
{
|
|
|
CCurveEx *m_pCurveArc;
|
|
|
public:
|
|
|
CArc(void);
|
|
|
virtual ~CArc(void);
|
|
|
|
|
|
double step;
|
|
|
double arc1,arc2;
|
|
|
|
|
|
void Serialize(CArchive& ar, const short &ver) override;
|
|
|
virtual int Read(CFile &fr, const short& ver);
|
|
|
virtual void Write(CFile &fw, const short& ver);
|
|
|
virtual int IsInRange(CRect8 &range,void *HowToViewCurve=NULL);
|
|
|
virtual void GetRange(CRect8 &range,void *HowToViewCurve=NULL);
|
|
|
virtual void GetRange(CPoint3D& minPoint, CPoint3D& maxPoint);
|
|
|
virtual void ScaleProperty(double sx, double sy);
|
|
|
virtual void Rotate(double xs, double ys, double angle);
|
|
|
virtual void Offset(double dx, double dy);
|
|
|
virtual void ScaleCoor(double xs, double ys, double dx, double dy);
|
|
|
virtual void ExchangeXY(void);
|
|
|
virtual void ExchangeXY(void* pProjection); //转换到指定投影坐标,CPrljectio* pProjection
|
|
|
// type为校正类型,比如两点校位、四点校位等;pValue为类对象指针,如CCalibrate2、CCalibrate4等
|
|
|
virtual void Calibrate(int type, void* pValue);
|
|
|
|
|
|
virtual void WriteDML(CFile &fw, const short& ver, int nBaseTabNum);
|
|
|
virtual int ReadDML(CFile &fr, const short &ver);
|
|
|
|
|
|
virtual void WritePCG(CFile &fw, const short& ver, int nBaseTabNum);
|
|
|
virtual int ReadPCG(CFile &fr, const short &ver);
|
|
|
|
|
|
virtual int ReadPCG2(CFile &fr, const short &ver);
|
|
|
|
|
|
void SetParameter(CPoint2D CircleCenter, CPoint2D ptStart, CPoint2D ptEnd);
|
|
|
void GetInTriangle(CPoint2D& ptArc1, CPoint2D& ptArc2, CPoint2D& ptArc3);//获得内接三角形的三个顶点
|
|
|
virtual void SetInTriangle(CPoint2D& ptArc1, CPoint2D& ptArc2, CPoint2D& ptArc3);//根据内接三角形的三个顶点设置弧
|
|
|
|
|
|
void operator = (CArc &t);
|
|
|
void GetCurve(double step1);
|
|
|
CCurveEx* GetCurve(void);
|
|
|
|
|
|
DWORD GetType(void);
|
|
|
void SetType(DWORD nType);
|
|
|
|
|
|
COLORREF color;
|
|
|
|
|
|
//该定义与椭圆中的定义是连续的,不能相同
|
|
|
enum ArcStyleFlags
|
|
|
{
|
|
|
drawArc = 0x0008, //显示为弧
|
|
|
drawChord = 0x0010, //显示为弦
|
|
|
drawPie = 0x0020 //显示为饼
|
|
|
};
|
|
|
|
|
|
private:
|
|
|
int toCurve(double &step1);
|
|
|
|
|
|
public:
|
|
|
virtual int ReadPCG(void *pxp, const short &ver);
|
|
|
virtual int ReadPCG2(void *pxp, const short &ver);
|
|
|
};
|