2026-10-04 00:04:20 +08:00
|
|
|
|
#pragma once
|
2026-09-28 15:28:50 +08:00
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
#include "Resource.h"
|
|
|
|
|
|
#include "afxwin.h"
|
|
|
|
|
|
|
|
|
|
|
|
enum EDrawType
|
|
|
|
|
|
{
|
|
|
|
|
|
kSelectPolyLine,
|
2026-10-04 00:04:20 +08:00
|
|
|
|
kSelectDiagonalPt//对角点
|
2026-09-28 15:28:50 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum EGrridType
|
|
|
|
|
|
{
|
|
|
|
|
|
kCrossGrid,
|
|
|
|
|
|
kLineGrid
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CCoordGridDataManage
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CCoordGridDataManage(void);
|
|
|
|
|
|
virtual ~CCoordGridDataManage();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
int GetGirdType() { return m_iGridType;}
|
|
|
|
|
|
int GetDrawType() { return m_iDrawType;}
|
|
|
|
|
|
int GetGridSpacing();
|
|
|
|
|
|
CString GetTextStyle() { return m_strTextStyle;}
|
|
|
|
|
|
double GetTextHeight() { return m_dTextHeight;}
|
2026-10-04 00:04:20 +08:00
|
|
|
|
bool GetEquationForm() { return m_bEquationForm;}//为真为等式,不为真不为等式
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void SetGirdType(int iType) { m_iGridType = iType;}
|
|
|
|
|
|
void SetDrawType(int iType) { m_iDrawType = iType;}
|
|
|
|
|
|
void SetGridSpacing(int iGridSpacing) { m_iGridSpacing = iGridSpacing;}
|
|
|
|
|
|
void SetTextStyle(CString &strTextStyle) { m_strTextStyle = strTextStyle;}
|
|
|
|
|
|
void SetTextHeight(double dHeight) { m_dTextHeight = dHeight;}
|
|
|
|
|
|
void SetEuqationForm(bool bEquationForm) {m_bEquationForm = bEquationForm;}
|
|
|
|
|
|
void SetDefalutTextStyleAndTextHight();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
2026-10-04 00:04:20 +08:00
|
|
|
|
CString GetFullPath(const TCHAR *szFileName); // 获得文件路径
|
2026-09-28 15:28:50 +08:00
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
int m_iGridType;
|
|
|
|
|
|
int m_iDrawType;
|
2026-10-04 00:04:20 +08:00
|
|
|
|
int m_iGridSpacing; //以米单位进行保存
|
2026-09-28 15:28:50 +08:00
|
|
|
|
CString m_strTextStyle;
|
|
|
|
|
|
double m_dTextHeight;
|
|
|
|
|
|
bool m_bEquationForm;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//坐标网格绘制类
|
2026-09-28 15:28:50 +08:00
|
|
|
|
class CCoordGridDrawStyle
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CCoordGridDrawStyle(void) {};
|
|
|
|
|
|
~CCoordGridDrawStyle(void) {};
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//生成测量坐标网格,十字交叉线
|
2026-09-28 15:28:50 +08:00
|
|
|
|
bool DrawCroosGridrInterface(TADSGePoint3d ptLeftTop, TADSGePoint3d ptRightBottom, int iGridSpacing);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//生成建筑坐标网格,网格通线
|
2026-09-28 15:28:50 +08:00
|
|
|
|
bool DrawLineGridInterface(TADSGePoint3d ptLeftTop, TADSGePoint3d ptRightBottom, int iGridSpacing);
|
|
|
|
|
|
private:
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//功能:根据指定左上交点和右下角点,网格间距,得到边上分别对应的点
|
|
|
|
|
|
//得到点存储在对应的成员变量中m_ptsLeft,m_ptsRight,m_ptsTop,m_ptsDown
|
2026-09-28 15:28:50 +08:00
|
|
|
|
bool GetEdgePoints(TADSGePoint3d ptLeftTop, TADSGePoint3d ptRightBottom, int iGridSpacing);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//功能:给点一个点,绘制世界坐标的十字交叉线,需要判断当前图纸单位
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void DrawCrossLine(TADSGePoint3d ptPosition);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//功能:根据上下左右边界点,生成十字交叉线,返回生成的十字交叉线个数
|
2026-09-28 15:28:50 +08:00
|
|
|
|
int DrawCroosGrid();
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//功能:根据上下左右边界点,生成网格通线,返回生成线的个数
|
2026-09-28 15:28:50 +08:00
|
|
|
|
int DrawLineGrid();
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//功能:根据上下左右边界点,以及网格类型,生成不同的标注点
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void DrawTextSymbol(int nDrawType);
|
|
|
|
|
|
|
2026-10-04 00:04:20 +08:00
|
|
|
|
//功能:绘制标注点
|
2026-09-28 15:28:50 +08:00
|
|
|
|
void DrawTDbText(CString &strText, XPoint &ptLocation, double dDirAng = 0.0);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
TADSGePointList m_ptsLeft;
|
|
|
|
|
|
TADSGePointList m_ptsRight;
|
|
|
|
|
|
TADSGePointList m_ptsTop;
|
|
|
|
|
|
TADSGePointList m_ptsBottom;
|
|
|
|
|
|
|
|
|
|
|
|
};
|