You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
10 KiB
C++

#pragma once
#include "Module.h"
#include "DataPoint.h"
#include "EnumPropertieType.h"
#define SCROLL_SIZE_CX (15000000) //滚动区域x 的范围--(单位:像素)
#define SCROLL_SIZE_CY (8000000) //滚动区域y 的范围--(单位:像素)
#define LOGIC_CENTER_X (SCROLL_SIZE_CX/2) //逻辑坐标中心点X --(单位:像素)
#define LOGIC_CENTER_Y (SCROLL_SIZE_CY/2) //逻辑坐标中心点Y --(单位:像素)
class CGlobalDrawMgr:public CModule
{
public:
CGlobalDrawMgr(void);
~CGlobalDrawMgr(void);
virtual void OnAppInitialize();
virtual CMFCPropertyGridProperty *CreatGridProperty();
//响应属性的改变
virtual void OnPropertyChanged();
virtual MODULE GetModuleType(){return _DRAW_PROP;};
virtual void Draw(CDC* pDC);
public:
void XorDrawLine(CDC* pDC,CPen&pen,Dbxy pt1,Dbxy pt2);
COLORREF GetBkgndColor(){return m_BkgndColor;};
CSize GetScrollViewSize(){return m_ScrollViewSize;};
Dbxy CPoint2Dbxy(CPoint point);
CPoint Dbxy2CPoint(Dbxy point);
CRect DbRect2CRect(DbRect dbRect);
double Int2Double(int size);
int Double2Int(double d);
CPen& GetObjectPen(){return m_ObjectPen;};
CPen& GetSelObjectPen(){return m_SelObjectPen;};
CPen& GetMouseRectPen(){return m_MouseRectPen;};
CPen& GetSelObjRectPen(){return m_SelObjRectPen;};
CPen& GetSelObjSmallRectPen(){return m_SelObjSmallRectPen;};
CPen& GetCatchNodePen(){return m_CatchNodePen;};
CPen& GetMeasurePen(){return m_MeasurePen;};
CPen& GetObjComponentAreaPen(){return m_ObjComponentAreaPen;};
CPen& GetMarkPointPen(){return m_MarkPointPen;};
CPen& GetTempRectPen(){return m_TempRectPen;};
CPen& GetScanLine(){return m_ScanLinePen;};
double GetCatchNodeSize();
COLORREF GetObjNodeColor(){return m_ObjNodeColor;};
COLORREF GetObjFirstNodeColor(){return m_ObjFirstNodeColor;};
COLORREF GetEasyOperationColor(){return m_EasyOperationColor;};
COLORREF GetButtomDefaultColor(){return m_ButtomDefaultColor;};
COLORREF GetScanLineColor(){return m_ScanLineColor;};
COLORREF GetEditTextColor(){return m_EditTextColor;};
COLORREF GetEditBkColor(){return m_EditBkColor;};
int GetEditFontSize(){return m_EditFontSize;};
double GetSelObjRectGap();
double GetRotatoPtDis();
DbRect GetCurPointRect(Dbxy pt,double Scale = 1);
DbRect GetCurCatchRect(Dbxy pt);
bool IsCatchObjNode(){return (m_bCatchObjNode||m_bObjEditMode);};
bool IsCatchObjLine(){return (m_bCatchObjLine||m_bObjEditMode);};
bool IsCatchCrossPoint(){return (m_bCatchCrossPoint||m_bObjEditMode);};
bool IsCatchOrthoPoint(){return (m_bCatchOrthoPoint||m_bObjEditMode);};
bool IsCatchCutTrack(){return (m_bCatchCutTrack||m_bObjEditMode);};
void SetCurZoomPoint(CPoint point){m_CurZoomPoint = point;};
CPoint GetCurZoomPoint(){return m_CurZoomPoint;};
void DrawMouseCross(CDC* pDC,Dbxy pt);
void DrawMouseRect(CDC* pDC,Dbxy pt);
void DrawDbxyVec(CDC* pDC,vector<vector<Dbxy>> &vec);
double GetKeyboardMoveDis(){return m_KeyboardMoveDis;};
void SetViewToDlg();
void ResetView();
double GetWorkAreaViewScale();
double GetMouseWheelScale(){return m_MouseWheelScale;};
bool IsbRectSel(){return (m_bRectSel||m_bObjEditMode);};
bool IsbPointSel(){return (m_bPointSel||m_bObjEditMode);};
bool IsEditLayerObj(){return (m_bEditLayerObj||m_bObjEditMode);};
bool IsbMultipleSel(){return (m_bMultipleSel||m_bObjEditMode);};
bool IsbMouseWheel(){return (m_bMouseWheel||m_bObjEditMode);};
void SetTempViewScale(double val){m_TempViewScale = val;};
int GetCirclePtCnt(double R);
CPoint GetProgressDlgPos(){return m_ProgressDlgPos;};
void DrawTxt(CDC *pDC,CString txt,Dbxy pt);
bool IsbUseEasyOperation(){return m_bUseEasyOperation;};
double GetAreaGridGap(){return m_AreaGridGap;};
bool IsbShowObjNode(){return m_bShowObjNode;};
bool IsbDrawObjIdxCenter(){return m_bDrawObjIdxCenter;};
void SetbNeedRedraw(bool b){m_bNeedRedraw = b;};
bool IsbNeedRedraw(){return m_bNeedRedraw;};
void SetbObjEditMode(bool b){m_bObjEditMode = b;};
bool IsbObjEditMode(){return m_bObjEditMode;};
int GetDlgMainWidth();
COLORREF GetWaferSateColor(int Idx);
double GetLCD_Txt_LineW(){return m_LCD_Txt_LineW;};
bool IsbDlgLayerViewShow(){return m_bDlgLayerViewShow;};
private:
DbRect GetCurRect(Dbxy pt,double size);
void DrawAxis(CDC* pDC);
int Logic2Divce(double LogicCoord,X_OR_Y xy);
double Divce2Logic(int DivceCoord,X_OR_Y xy);
private:
CPoint m_LogicCenter;//逻辑中心点
CPoint m_DlgLogicCenter;//对话框逻辑中心点
double m_ViewScale;//视图设备坐标对应逻辑坐标的比例
double m_DlgViewScale;//对话框视图设备坐标对应逻辑坐标的比例
double m_SelObjRectGap;//选择obj 外围框的间隔
double m_RotatoPtDis;//旋转点的距离
double m_MousePointRectSize;//鼠标点选的矩形的尺寸
double m_MouseCatchRectSize;//鼠标捕获的矩形范围
double m_CatchNodeSize;//绘制捕获node 点方框的尺寸
double m_MouseCursorSize;//鼠标光标的尺寸
double m_MouseCursorRectSize;//光标中间方框的尺寸
CSize m_ScrollViewSize;//滚动视图的范围
CPoint m_ProgressDlgPos;//进度条对话框的位置
CPoint m_ScrollViewCenterPt;//滚动视图的中心点
COLORREF m_BkgndColor; //view背景色
bool m_bDrawAxis;//是否绘制坐标轴
COLORREF m_AxisColor; //坐标轴颜色
COLORREF m_EditTextColor;//编辑框字体颜色
COLORREF m_EditBkColor;//编辑框背景色
int m_EditFontSize;//编辑框字体的大小
int m_PenWidth;//笔的宽度
CPen m_ObjectPen;//Object 绘制笔
CPen m_SelObjectPen;//选择的Object 绘制笔
CPen m_MouseRectPen;//鼠标选择框的笔
CPen m_SelObjRectPen;//选择obj 的外框笔
CPen m_SelObjSmallRectPen;//选择obj 的小外框笔
CPen m_CatchNodePen;//捕获node 点的笔
CPen m_MeasurePen;//测量笔
CPen m_ObjComponentAreaPen;//元件范围框
CPen m_MarkPointPen;//理论定位点
CPen m_TempRectPen;//模板边框
CPen m_ScanLinePen;//扫描过的线
COLORREF m_ObjNodeColor;//obj 节点的颜色
COLORREF m_ObjFirstNodeColor;//obj 节点的颜色
COLORREF m_EasyOperationColor;//便捷操作点的颜色
bool m_bObjEditMode;//图形编辑模式
bool m_bCatchObjNode;//是否抓取obj 的节点
bool m_bCatchObjLine;//是否抓取obj 的线段上的点
bool m_bCatchCrossPoint;//是否抓取obj 的交叉
bool m_bCatchOrthoPoint;//是否抓取正交点
bool m_bCatchCutTrack;//是否抓取元件切割道的交点
CPoint m_CurZoomPoint;//当前的缩放点
double m_KeyboardMoveDis;//键盘移动选择的对象一次移动的距离(单位:mm)
double m_WorkAreaViewScale;//工作区域观察缩放比例
double m_TempViewScale;//临时的缩放比例
double m_MouseWheelScale;//鼠标滚动的比例
bool m_bRectSel;//允许框选
bool m_bPointSel;//允许点选
bool m_bMultipleSel;//是否允许多选(false 的时候会取消之前的选择)
bool m_bMouseWheel;//是否允许鼠标滚动
bool m_bEditLayerObj;//是否可以编辑layer 的obj
bool m_bUseEasyOperation;//是否使用缩放快捷操作
COLORREF m_ButtomDefaultColor;//按钮的默认颜色
COLORREF m_ScanLineColor;//扫描线的颜色
int m_CircleOneMMptCnt;//生成圆时1mm 的周长上包含多少个点
int m_MinCircleOneMMptCnt;//点数的最小值(自动的点数不能小于这个值)
double m_AreaGridGap;//area 区域显示网格的间隔mm
bool m_bShowObjNode;//是否绘制obj 的节点
bool m_bDrawObjIdxCenter;//obj 的索引值在中心显示(false 在第一个点显示)
bool m_bNeedRedraw;//是否需要重绘
int m_DlgMainWidth;//操作面板的宽度
int m_DlgMainWidthNoteBook;//操作面板的宽度(笔记本)
COLORREF m_WaferSateColor1;//wafer 状态的颜色
COLORREF m_WaferSateColor2;//wafer 状态的颜色
COLORREF m_WaferSateColor3;//wafer 状态的颜色
COLORREF m_WaferSateColor4;//wafer 状态的颜色
COLORREF m_WaferSateColor5;//wafer 状态的颜色
COLORREF m_WaferSateColor6;//wafer 状态的颜色
COLORREF m_WaferSateColor7;//wafer 状态的颜色
double m_LCD_Txt_LineW;//LCD 显示框字体的线宽
bool m_bDlgLayerViewShow;//是否在对话框显示view 的内容
};
extern CGlobalDrawMgr *gDraw;