|
|
#pragma once
|
|
|
#include ".\text.h"
|
|
|
|
|
|
class CXyDC;
|
|
|
|
|
|
/* @brief 矩形标注 */
|
|
|
class AFX_EXT_CLASS CRectLabel
|
|
|
: public CText
|
|
|
{
|
|
|
public:
|
|
|
CRectLabel(void);
|
|
|
~CRectLabel(void);
|
|
|
|
|
|
/// 重载CBaseObject函数
|
|
|
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 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 bool GetRange(CRect8& range);
|
|
|
virtual BOOL IsInRange(CRect8& range);
|
|
|
virtual CRect8 GetRect(void);
|
|
|
virtual void SetRect(CRect8 rect);
|
|
|
|
|
|
virtual void ScaleCoor(double xs, double ys, double dx, double dy);
|
|
|
virtual void ScaleCoordinate(double sx, double sy, int mode); //mode=0:加,1:减,2:乘,3:除
|
|
|
|
|
|
// type为校正类型,比如两点校位、四点校位等;pValue为类对象指针,如CCalibrate2、CCalibrate4等
|
|
|
virtual void Calibrate(int type, void* pValue);
|
|
|
virtual void ExchangeXY(void);
|
|
|
virtual void ExchangeXY(void* pProjection); //转换到指定投影坐标,CPrljectio* pProjection
|
|
|
virtual void Rotate(double xs, double ys, double dAngle);
|
|
|
virtual void Offset(double dx, double dy);
|
|
|
void operator = (CRectLabel& rl);
|
|
|
void GetText(CText& text);
|
|
|
|
|
|
CCurveEx* GetCurve();
|
|
|
|
|
|
// 判断点对应在哪个边上
|
|
|
////////////////////////////////////////////////////////////////
|
|
|
//
|
|
|
// __2_|_1__
|
|
|
// 3 | | | 0
|
|
|
// ---|----|----|---
|
|
|
// 4 | | | 7
|
|
|
// --5---6--
|
|
|
// |
|
|
|
//
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
int GetAnchorEdgeIndex(CPoint2D point);
|
|
|
virtual void CreateCurve();
|
|
|
void CreateRectCurve();
|
|
|
void CreateEllipseCurve(double dRadiusX, double dRadiusY);
|
|
|
|
|
|
public:
|
|
|
DWORD m_nType; //为了扩展
|
|
|
double m_dAnchorWidth; // 锚宽度, 默认为1/4
|
|
|
CPoint2D m_ptAnchor;
|
|
|
CRect8 m_rect;
|
|
|
|
|
|
protected:
|
|
|
CCurveEx* m_pCurve;
|
|
|
|
|
|
public:
|
|
|
virtual int ReadPCG(void *pxp, const short &ver);
|
|
|
};
|
|
|
|