SDC C-Project CF Review 프로그램
LYW
2022-05-31 f1a543772246f59b8b52a8857270b38ee38f3588
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
#pragma once
 
#include "CHImageControls/CHRectTracker.h"
#include "CameraImageView.h"
// CCameraViewReview
 
struct SPixelInfo
{
    SPixelInfo() 
    {
        nWidthPixel = 0;
        nHeightPixel = 0;
        dDiagonalPixel = 0;
        dWidthRealUM = 0;
        dHeightRealUM = 0;
        dDiagonalRealUM = 0;
    }
    int        nWidthPixel;
    int        nHeightPixel;
    double    dDiagonalPixel;
 
    double    dWidthRealUM;
    double    dHeightRealUM;
    double    dDiagonalRealUM;
 
};
 
class CCameraViewReview : public CCameraImageView
{
    DECLARE_DYNAMIC(CCameraViewReview)
 
public:
    CCameraViewReview(CWnd *pParentWnd);
    virtual ~CCameraViewReview();
    void    SetDrawROIRect(BOOL bDraw);
    void    SetTrackerRect(const CRect& rtRect);
    BOOL    GetTrackerRect(CRect& rtRect);
    void    ClearTrackerRect();
    void    SetDefectPos(const CPoint& ptPoint);
    //  임시 추가 cmj 
    void    ContextMenu(UINT nFlags, CPoint point);
 
    
protected:
    BOOL            m_bDrawROIRect;
    CRect            m_rtROIRect;
    SPixelInfo        m_sROIInfo;
 
    // tracker
    BOOL            m_bDrawTracker;
    CPoint            m_ptTrackerStart;
    CCHRectTracker    m_rectTracker;
 
    CPoint            m_ptDefectPos;
 
    void            DrawROIRect(CDC *pDC);
    void            DrawDefectPos(CDC *pDC);
 
    BOOL            m_bUseOnlyImageSave;
 
protected:
    DECLARE_MESSAGE_MAP()
    afx_msg void OnSaveImage();
    afx_msg void OnSaveAsImage();
    afx_msg void OnManualSimulation();
 
    afx_msg void OnPaint();
    afx_msg void OnROIRect();
    afx_msg void OnClearROIRect();
    afx_msg void OnSaveROIRect();
 
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
 
    afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
 
    afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
 
    afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
 
    afx_msg void OnUseOnlyImageSave();
 
 
    
};