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) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>x <20>ķ<EFBFBD>Χ--(<28><>λ:<3A><><EFBFBD><EFBFBD>)
#define SCROLL_SIZE_CY (8000000) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y <20>ķ<EFBFBD>Χ--(<28><>λ:<3A><><EFBFBD><EFBFBD>)
#define LOGIC_CENTER_X (SCROLL_SIZE_CX/2) //<2F>߼<EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>X --(<28><>λ:<3A><><EFBFBD><EFBFBD>)
#define LOGIC_CENTER_Y (SCROLL_SIZE_CY/2) //<2F>߼<EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>Y --(<28><>λ:<3A><><EFBFBD><EFBFBD>)
class CGlobalDrawMgr:public CModule
{
public:
CGlobalDrawMgr(void);
~CGlobalDrawMgr(void);
virtual void OnAppInitialize();
virtual CMFCPropertyGridProperty *CreatGridProperty();
//<2F><>Ӧ<EFBFBD><D3A6><EFBFBD>Եĸı<C4B8>
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;//<2F>߼<EFBFBD><DFBC><EFBFBD><EFBFBD>ĵ<EFBFBD>
CPoint m_DlgLogicCenter;//<2F>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD>߼<EFBFBD><DFBC><EFBFBD><EFBFBD>ĵ<EFBFBD>
double m_ViewScale;//<2F><>ͼ<EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>߼<EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
double m_DlgViewScale;//<2F>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>߼<EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
double m_SelObjRectGap;//ѡ<><D1A1>obj <20><>Χ<EFBFBD><CEA7><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
double m_RotatoPtDis;//<2F><>ת<EFBFBD><D7AA><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD>
double m_MousePointRectSize;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>ľ<EFBFBD><C4BE>εijߴ<C4B3>
double m_MouseCatchRectSize;//<2F><><EFBFBD><EFBFBD><EAB2B6><EFBFBD>ľ<EFBFBD><C4BE>η<EFBFBD>Χ
double m_CatchNodeSize;//<2F><><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>node <20><EFBFBD><E3B7BD><EFBFBD>ijߴ<C4B3>
double m_MouseCursorSize;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijߴ<C4B3>
double m_MouseCursorRectSize;//<2F><><EFBFBD><EFBFBD><EFBFBD>м䷽<D0BC><E4B7BD><EFBFBD>ijߴ<C4B3>
CSize m_ScrollViewSize;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD>ķ<EFBFBD>Χ
CPoint m_ProgressDlgPos;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
CPoint m_ScrollViewCenterPt;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>
COLORREF m_BkgndColor; //view<65><77><EFBFBD><EFBFBD>ɫ
bool m_bDrawAxis;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
COLORREF m_AxisColor; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
COLORREF m_EditTextColor;//<2F><EFBFBD><E0BCAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
COLORREF m_EditBkColor;//<2F><EFBFBD>򱳾<EFBFBD>ɫ
int m_EditFontSize;//<2F><EFBFBD><E0BCAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С
int m_PenWidth;//<2F>ʵĿ<CAB5><C4BF><EFBFBD>
CPen m_ObjectPen;//Object <20><><EFBFBD>Ʊ<EFBFBD>
CPen m_SelObjectPen;//ѡ<><D1A1><EFBFBD><EFBFBD>Object <20><><EFBFBD>Ʊ<EFBFBD>
CPen m_MouseRectPen;//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
CPen m_SelObjRectPen;//ѡ<><D1A1>obj <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPen m_SelObjSmallRectPen;//ѡ<><D1A1>obj <20><>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPen m_CatchNodePen;//<2F><><EFBFBD><EFBFBD>node <20><><EFBFBD>ı<EFBFBD>
CPen m_MeasurePen;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPen m_ObjComponentAreaPen;//Ԫ<><D4AA><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7>
CPen m_MarkPointPen;//<2F><><EFBFBD>۶<EFBFBD>λ<EFBFBD><CEBB>
CPen m_TempRectPen;//ģ<><C4A3><EFBFBD>߿<EFBFBD>
CPen m_ScanLinePen;//ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
COLORREF m_ObjNodeColor;//obj <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ɫ
COLORREF m_ObjFirstNodeColor;//obj <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ɫ
COLORREF m_EasyOperationColor;//<2F><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
bool m_bObjEditMode;//ͼ<>α༭ģʽ
bool m_bCatchObjNode;//<2F>Ƿ<EFBFBD>ץȡobj <20>Ľڵ<C4BD>
bool m_bCatchObjLine;//<2F>Ƿ<EFBFBD>ץȡobj <20><><EFBFBD>߶<EFBFBD><DFB6>ϵĵ<CFB5>
bool m_bCatchCrossPoint;//<2F>Ƿ<EFBFBD>ץȡobj <20>Ľ<EFBFBD><C4BD><EFBFBD>
bool m_bCatchOrthoPoint;//<2F>Ƿ<EFBFBD>ץȡ<D7A5><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool m_bCatchCutTrack;//<2F>Ƿ<EFBFBD>ץȡԪ<C8A1><D4AA><EFBFBD>и<EFBFBD><D0B8><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>
CPoint m_CurZoomPoint;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>
double m_KeyboardMoveDis;//<2F><><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ƶ<EFBFBD><C6B6>ľ<EFBFBD><C4BE><EFBFBD>(<28><>λ:mm)
double m_WorkAreaViewScale;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>۲<EFBFBD><DBB2><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>
double m_TempViewScale;//<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>
double m_MouseWheelScale;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
bool m_bRectSel;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ
bool m_bPointSel;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ
bool m_bMultipleSel;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ(false <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>֮ǰ<D6AE><C7B0>ѡ<EFBFBD><D1A1>)
bool m_bMouseWheel;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool m_bEditLayerObj;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>Ա༭layer <20><>obj
bool m_bUseEasyOperation;//<2F>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD>ſ<EFBFBD><C5BF>ݲ<EFBFBD><DDB2><EFBFBD>
COLORREF m_ButtomDefaultColor;//<2F><>ť<EFBFBD><C5A5>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD>ɫ
COLORREF m_ScanLineColor;//ɨ<><C9A8><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD>ɫ
int m_CircleOneMMptCnt;//<2F><><EFBFBD><EFBFBD>Բʱ1mm <20><><EFBFBD>ܳ<EFBFBD><DCB3>ϰ<EFBFBD><CFB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٸ<EFBFBD><D9B8><EFBFBD>
int m_MinCircleOneMMptCnt;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ(<28>Զ<EFBFBD><D4B6>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ)
double m_AreaGridGap;//area <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>mm
bool m_bShowObjNode;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>obj <20>Ľڵ<C4BD>
bool m_bDrawObjIdxCenter;//obj <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ(false <20>ڵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ)
bool m_bNeedRedraw;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD>ػ<EFBFBD>
int m_DlgMainWidth;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>
int m_DlgMainWidthNoteBook;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>(<28>ʼDZ<CABC>)
COLORREF m_WaferSateColor1;//wafer ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ɫ
COLORREF m_WaferSateColor2;//wafer ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ɫ
COLORREF m_WaferSateColor3;//wafer ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ɫ
COLORREF m_WaferSateColor4;//wafer ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ɫ
COLORREF m_WaferSateColor5;//wafer ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ɫ
COLORREF m_WaferSateColor6;//wafer ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ɫ
COLORREF m_WaferSateColor7;//wafer ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ɫ
double m_LCD_Txt_LineW;//LCD <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD>
bool m_bDlgLayerViewShow;//<2F>Ƿ<EFBFBD><C7B7>ڶԻ<DAB6><D4BB><EFBFBD><EFBFBD><EFBFBD>ʾview <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
};
extern CGlobalDrawMgr *gDraw;