LAPTOP-SNT8I5JK\Boounion
2025-03-13 4f6aae9fe017a37bd8bc6199ba4e3804036d8693
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// DefectMap.h: interface for the CDefectMap class.
//
//////////////////////////////////////////////////////////////////////
 
#if !defined(AFX_DEFECTMAP_H__CF34B34E_7A0E_4CBB_880F_4C41FF83A64B__INCLUDED_)
#define AFX_DEFECTMAP_H__CF34B34E_7A0E_4CBB_880F_4C41FF83A64B__INCLUDED_
 
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
 
#define ORIGIN_LEFTTOP        1
#define ORIGIN_LEFTBOTTOM    0
#define ORIGIN_RIGHTTOP        2
#define ORIGIN_RIGHTBOTTOM    3
 
#define UM_MAP_CHANGED            5573
 
enum OriginDirection        { OD_LeftTop = 0, OD_RightTop = 1, OD_LeftBottom = 10, OD_RightBottom = 11 };
 
class AFX_EXT_CLASS CDefectMap  : public CStatic
{
public:
    CDefectMap();
    virtual ~CDefectMap();
 
public:
    void                InitGlass(CWnd* pParent, int nMapWidth, int nMapHeight, int nMapMargin);    // Pixel ´ÜÀ§ ¸¶Áø.
    void                DeinitGlass();
    int                    GetMapTotalWidth()        { return m_nMapTotalWidth; }
    int                    GetMapTotalHeight()        { return m_nMapTotalHeight; }
    int                    GetMapWidth()            { return m_nMapWidth; }
    int                    GetMapHeight()            { return m_nMapHeight; }
    
    void                SetMiniMap(BOOL bIsMiniMap, int nUnitSize)    { m_bIsMiniMap = bIsMiniMap; m_nUnitSize = nUnitSize; }
    int                    GetUnitSize()            { return m_nUnitSize; }
    
    virtual void        DrawGlass(CDC* pDC)                        { }
    virtual void        MouseRBtnDwn(CPoint& point)                { }
    virtual void        MouseLBtnDwn(CPoint& point)                { }
    virtual void        MouseLBtnUp(CPoint& point)                { }
    virtual void        MouseLBtnMove(CPoint& point)            { }
    virtual void        MouseLBtnDblClk(CPoint& point)            { }
    virtual void        Timer(UINT_PTR nIDEvent)                    { }
    
    // È®´ë/Ãà¼Ò
    void                IncreaseRatio();
    void                DecreaseRatio();
    void                ResetRatio();
    
    CPoint&                GetDisplayStart()        { return m_PointGlassStart; }
    CPoint&                GetDisplayEnd()            { return m_PointGlassEnd; }
    
    void                SetDisplayRect(CPoint& PointStart, CPoint& PointEnd);
    void                SetShowShot(BOOL bShow)    { m_bShowShot = bShow; }
    
    void                ConvertGlassToView(CRect &rect);
    void                ConvertGlassToView(CPoint &pt);
    CRect                ConvertViewToGlass(CRect &rect);
    CPoint                ConvertViewToGlass(CPoint &pt);
 
    // ÀúÀå
    void                SaveMapToFile(CString strFileName);
    
    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CStaticMap)
    //}}AFX_VIRTUAL
 
protected:
    CWnd*                m_pParentWnd;
    int                    m_nMapTotalWidth;
    int                    m_nMapTotalHeight;
    int                    m_nMapWidth;
    int                    m_nMapHeight;
    CRect                m_RectWnd;
    CRect                m_RectMap;
    
    //////////////////////////////////////////////////////////////////////////
    // ±×¸®±â Á¤º¸
    HBITMAP                m_hDrawingSurface;
    BITMAPINFOHEADER    m_BMIH;
    CRect                m_RectDrawingSurface;
    BYTE*                m_pDrawingSurfaceBits;
    
    OriginDirection        m_OriginDir;
    int                    m_nUnitSize;
    
    // Cell ±×¸®±â
    BOOL                m_bShowShot;
    
    // È®´ë/Ãà¼Ò
    CRect                m_RectShowWnd;
    
    double                m_dWidthRatio;
    double                m_dHeightRatio;
    double                m_dRatio;
    CPoint                m_PointWindowStart;
    BOOL                m_bDragMove;
    CPoint                m_PointDragStart;
    BOOL                m_bIsMiniMap;            // MinimapÀº È®´ë/Ãà¼Ò¸¦ ¾ÈÇÑ´Ù.
    CPoint                m_PointGlassStart;        // Glass Áß ÇöÀç º¸¿©Áö´Â ¿µ¿ª.
    CPoint                m_PointGlassEnd;
    
    CPoint                m_PointCCut[3];            //ÄÚ³ÊÄÆ ±×¸®±â ÁÂÇ¥
    int                    m_nCCutSize;
    int                    m_nCoordGabX;            // ÁÂÇ¥¸¦ »Ñ¸± °Å¸®.
    int                    m_nCoordGabY;            // ÁÂÇ¥¸¦ »Ñ¸± °Å¸®.
    
    //{{AFX_MSG(CStaticGlass)
    afx_msg void OnPaint();
    afx_msg void OnTimer(UINT_PTR nIDEvent);
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg long OnUpdateMap(WPARAM wParam, LPARAM lParam);
    //}}AFX_MSG
    
    DECLARE_MESSAGE_MAP()
};
 
#endif // !defined(AFX_DEFECTMAP_H__CF34B34E_7A0E_4CBB_880F_4C41FF83A64B__INCLUDED_)