Files
envi-code/SourceCode/Code2026/tg_shs/shs_siteplan/CoordGrid.h
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

93 lines
2.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include "stdafx.h"
#include "Resource.h"
#include "afxwin.h"
enum EDrawType
{
kSelectPolyLine,
kSelectDiagonalPt//对角点
};
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;}
bool GetEquationForm() { return m_bEquationForm;}//为真为等式,不为真不为等式
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:
CString GetFullPath(const TCHAR *szFileName); // 获得文件路径
private:
int m_iGridType;
int m_iDrawType;
int m_iGridSpacing; //以米单位进行保存
CString m_strTextStyle;
double m_dTextHeight;
bool m_bEquationForm;
};
//坐标网格绘制类
class CCoordGridDrawStyle
{
public:
CCoordGridDrawStyle(void) {};
~CCoordGridDrawStyle(void) {};
public:
//生成测量坐标网格,十字交叉线
bool DrawCroosGridrInterface(TADSGePoint3d ptLeftTop, TADSGePoint3d ptRightBottom, int iGridSpacing);
//生成建筑坐标网格,网格通线
bool DrawLineGridInterface(TADSGePoint3d ptLeftTop, TADSGePoint3d ptRightBottom, int iGridSpacing);
private:
//功能:根据指定左上交点和右下角点,网格间距,得到边上分别对应的点
//得到点存储在对应的成员变量中m_ptsLeft,m_ptsRight,m_ptsTop,m_ptsDown
bool GetEdgePoints(TADSGePoint3d ptLeftTop, TADSGePoint3d ptRightBottom, int iGridSpacing);
//功能:给点一个点,绘制世界坐标的十字交叉线,需要判断当前图纸单位
void DrawCrossLine(TADSGePoint3d ptPosition);
//功能:根据上下左右边界点,生成十字交叉线,返回生成的十字交叉线个数
int DrawCroosGrid();
//功能:根据上下左右边界点,生成网格通线,返回生成线的个数
int DrawLineGrid();
//功能:根据上下左右边界点,以及网格类型,生成不同的标注点
void DrawTextSymbol(int nDrawType);
//功能:绘制标注点
void DrawTDbText(CString &strText, XPoint &ptLocation, double dDirAng = 0.0);
private:
TADSGePointList m_ptsLeft;
TADSGePointList m_ptsRight;
TADSGePointList m_ptsTop;
TADSGePointList m_ptsBottom;
};