0025338: MFC standard samples: 3D selection rectangle blinking
[occt.git] / samples / mfc / standard / Common / OCC_2dView.h
1 // OCC_2dView.h: interface for the OCC_2dView class.
2 //
3 //////////////////////////////////////////////////////////////////////
4
5 #if !defined(AFX_OCC_2dVIEW_H__2E048CC9_38F9_11D7_8611_0060B0EE281E__INCLUDED_)
6 #define AFX_OCC_2dVIEW_H__2E048CC9_38F9_11D7_8611_0060B0EE281E__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include "OCC_BaseView.h"
13 #include "OCC_2dDoc.h"
14 #include "Resource2d/RectangularGrid.h"
15 #include "Resource2d/CircularGrid.h"
16
17 enum CurrentAction2d
18 {
19   CurAction2d_Nothing,
20   CurAction2d_DynamicZooming,
21   CurAction2d_WindowZooming,
22   CurAction2d_DynamicPanning,
23   CurAction2d_GlobalPanning,
24 };
25
26 class AFX_EXT_CLASS OCC_2dView : public OCC_BaseView  
27 {
28   DECLARE_DYNCREATE(OCC_2dView)
29
30 public:
31
32   OCC_2dView();
33
34   virtual ~OCC_2dView();
35
36   OCC_2dDoc* GetDocument();
37
38   Handle(V3d_View)& GetV2dView() { return myV2dView; }
39
40   void FitAll();
41
42 // Overrides
43   // ClassWizard generated virtual function overrides
44   //{{AFX_VIRTUAL(OCC_2dView)
45   public:
46   virtual void OnDraw(CDC* pDC);  // overridden to draw this view
47   virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
48   protected:
49   virtual void OnInitialUpdate(); // called first time after construct
50     //}}AFX_VIRTUAL
51
52 #ifdef _DEBUG
53   virtual void AssertValid() const;
54   virtual void Dump(CDumpContext& dc) const;
55 #endif
56
57 protected:
58
59 // Generated message map functions
60 protected:
61   //{{AFX_MSG(OCC_2dView)
62     // NOTE - the ClassWizard will add and remove member functions here.
63     //    DO NOT EDIT what you see in these blocks of generated code !
64   afx_msg void OnFileExportImage();
65   afx_msg void OnBUTTONGridRectLines();
66   afx_msg void OnBUTTONGridRectPoints();
67   afx_msg void OnBUTTONGridCircLines();
68   afx_msg void OnBUTTONGridCircPoints();
69   afx_msg void OnBUTTONGridValues();
70   afx_msg void OnUpdateBUTTONGridValues(CCmdUI* pCmdUI);
71   afx_msg void OnBUTTONGridCancel();
72   afx_msg void OnUpdateBUTTONGridCancel(CCmdUI* pCmdUI);
73   afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
74   afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
75   afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
76   afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
77   afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
78   afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
79   afx_msg void OnMouseMove(UINT nFlags, CPoint point);
80   afx_msg void OnSize(UINT nType, int cx, int cy);
81   afx_msg void OnBUTTONFitAll();
82   afx_msg void OnBUTTONGlobPanning();
83   afx_msg void OnBUTTONPanning();
84   afx_msg void OnBUTTONZoomProg();
85   afx_msg void OnBUTTONZoomWin();
86   afx_msg void OnUpdateBUTTON2DGlobPanning(CCmdUI* pCmdUI);
87   afx_msg void OnUpdateBUTTON2DPanning(CCmdUI* pCmdUI);
88   afx_msg void OnUpdateBUTTON2DZoomProg(CCmdUI* pCmdUI);
89   afx_msg void OnUpdateBUTTON2DZoomWin(CCmdUI* pCmdUI);
90   afx_msg void OnChangeBackground();
91   //}}AFX_MSG
92   DECLARE_MESSAGE_MAP()
93
94 protected:
95
96     virtual void DragEvent2D (const Standard_Integer x,
97                               const Standard_Integer y,
98                               const Standard_Integer TheState);
99
100     virtual void InputEvent2D (const Standard_Integer x,
101                                const Standard_Integer  y);
102
103     virtual void MoveEvent2D (const Standard_Integer x,
104                               const Standard_Integer y);
105
106     virtual void MultiMoveEvent2D (const Standard_Integer x,
107                                    const Standard_Integer y);
108
109     virtual void MultiDragEvent2D (const Standard_Integer x,
110                                    const Standard_Integer y,
111                                    const Standard_Integer TheState);
112
113     virtual void MultiInputEvent2D (const Standard_Integer x,
114                                     const Standard_Integer y);
115
116     virtual void Popup2D (const Standard_Integer x,
117                           const Standard_Integer y);
118
119 protected:
120
121   Handle(V3d_View) myV2dView;
122   CurrentAction2d  myCurrentMode;
123   CRectangularGrid TheRectangularGridDialog;
124   CCircularGrid    TheCircularGridDialog;
125 };
126
127 #ifndef _DEBUG  // debug version in 2DDisplayView.cpp
128 inline OCC_2dDoc* OCC_2dView::GetDocument()
129    { return (OCC_2dDoc*)m_pDocument; }
130 #endif
131
132 #endif // !defined(AFX_OCC_2dVIEW_H__2E048CC9_38F9_11D7_8611_0060B0EE281E__INCLUDED_)