0023776: Redesign of MFC samples after V2d viewer removing
[occt.git] / samples / mfc / standard / 08_HLR / src / HLRView2D.cpp
1 // HLRView.cpp : implementation of the CHLRView2D class
2 //
3
4 #include "stdafx.h"
5 #include "HLRView2D.h"
6 #include "HLRApp.h"
7 #include "HLRDoc.h"
8 #include "resource2d\RectangularGrid.h"
9 #include "resource2d\CircularGrid.h"
10
11 #define ValZWMin 1
12
13 #ifdef _DEBUG
14 //#define new DEBUG_NEW
15 #undef THIS_FILE
16 static char THIS_FILE[] = __FILE__;
17 #endif
18
19 // the key for multi selection :
20 #define MULTISELECTIONKEY MK_SHIFT
21
22 // the key for shortcut ( use to activate dynamic rotation, panning )
23 #define CASCADESHORTCUTKEY MK_CONTROL
24
25 // define in witch case you want to display the popup
26 #define POPUPONBUTTONDOWN
27
28 /////////////////////////////////////////////////////////////////////////////
29 // CHLRView2D
30
31 IMPLEMENT_DYNCREATE(CHLRView2D, OCC_2dView)
32
33 BEGIN_MESSAGE_MAP(CHLRView2D, OCC_2dView)
34   //{{AFX_MSG_MAP(CHLRView2D)
35   // NOTE - the ClassWizard will add and remove mapping macros here.
36   //    DO NOT EDIT what you see in these blocks of generated code!
37   //}}AFX_MSG_MAP
38 END_MESSAGE_MAP()
39
40 /////////////////////////////////////////////////////////////////////////////
41 // CHLRView2D construction/destruction
42
43 CHLRView2D::CHLRView2D()
44 {
45 }
46
47 CHLRView2D::~CHLRView2D()
48 {
49 }
50
51 CHLRDoc* CHLRView2D::GetDocument() // non-debug version is inline
52 {
53   //ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(OCC_2dDoc)));
54   return (CHLRDoc*)m_pDocument;
55 }
56
57
58 void CHLRView2D::OnInitialUpdate()
59 {
60   Handle(WNT_Window) aWNTWindow;
61   aWNTWindow = new WNT_Window(GetSafeHwnd(),Quantity_NOC_GRAY);
62   myV2dView = GetDocument()->GetViewer2D()->CreateView();
63   myV2dView->SetWindow(aWNTWindow);
64
65   // initialyse the grids dialogs
66   TheRectangularGridDialog.Create(CRectangularGrid::IDD, NULL);
67   TheCircularGridDialog.Create(CCircularGrid::IDD, NULL);
68   TheRectangularGridDialog.SetViewer (GetDocument()->GetViewer2D());
69   TheCircularGridDialog.SetViewer (GetDocument()->GetViewer2D());
70
71   Standard_Integer w=100 , h=100 ;   /* Debug Matrox                         */
72   aWNTWindow->Size (w,h) ;           /* Keeps me unsatisfied (rlb).....      */
73   /* Resize is not supposed to be done on */
74   /* Matrox                               */
75   /* I suspect another problem elsewhere  */
76   ::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
77 }
78
79 //-----------------------------------------------------------------------------------------
80 //
81 //-----------------------------------------------------------------------------------------
82 void CHLRView2D::DragEvent2D(const Standard_Integer  x        ,
83                             const Standard_Integer  y        ,
84                             const Standard_Integer  TheState )
85 {
86 }
87
88
89 //-----------------------------------------------------------------------------------------
90 //
91 //-----------------------------------------------------------------------------------------
92 void CHLRView2D::InputEvent2D(const Standard_Integer  x     ,
93                               const Standard_Integer  y     ) 
94 {
95 }
96
97 //-----------------------------------------------------------------------------------------
98 //
99 //-----------------------------------------------------------------------------------------
100 void CHLRView2D::MoveEvent2D(const Standard_Integer  x       ,
101                             const Standard_Integer  y       ) 
102 {
103 }
104
105 //-----------------------------------------------------------------------------------------
106 //
107 //-----------------------------------------------------------------------------------------
108 void CHLRView2D::MultiMoveEvent2D(const Standard_Integer  x       ,
109                                   const Standard_Integer  y      ) 
110 {
111 }
112
113 //-----------------------------------------------------------------------------------------
114 //
115 //-----------------------------------------------------------------------------------------
116 void CHLRView2D::MultiDragEvent2D(const Standard_Integer  x        ,
117                                   const Standard_Integer  y        ,
118                                   const Standard_Integer  TheState) 
119 {
120 }
121
122
123 //-----------------------------------------------------------------------------------------
124 //
125 //-----------------------------------------------------------------------------------------
126 void CHLRView2D::MultiInputEvent2D(const Standard_Integer  x       ,
127                                   const Standard_Integer  y       ) 
128 {
129 }
130
131
132 #ifdef _DEBUG
133 void CHLRView2D::AssertValid() const
134 {
135   OCC_2dView::AssertValid();
136 }
137
138 void CHLRView2D::Dump(CDumpContext& dc) const
139 {
140   OCC_2dView::Dump(dc);
141 }
142
143 #endif