0023776: Redesign of MFC samples after V2d viewer removing
[occt.git] / samples / mfc / standard / 01_Geometry / src / GeometryDoc.h
1 // GeometryDoc.h : interface of the CGeometryDoc class
2 //
3 /////////////////////////////////////////////////////////////////////////////
4
5 #if !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)
6 #define AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_
7
8 #if _MSC_VER >= 1000
9 #pragma once
10 #endif // _MSC_VER >= 1000
11
12 #include "ResultDialog.h"
13
14 class Handle_AIS_Point;
15
16 class CGeometryDoc : public CDocument
17 {
18 public:
19   void Put2DOnTop(bool isMax = true);
20   void Put3DOnTop(bool isMax = true);
21   void Fit2DViews();
22   void Set3DViewsZoom(const Quantity_Factor& Coef );
23   void Fit3DViews(Quantity_Coefficient Coef);
24   void simplify(const TopoDS_Shape& aShape);
25
26
27   static void Fit();
28
29   //              2D
30   void DragEvent2D       (const Standard_Integer  x       ,
31                           const Standard_Integer  y       ,
32                           const Standard_Integer  TheState,
33                           const Handle_V3d_View& aView   );
34   void InputEvent2D      (const Standard_Integer  x       ,
35                           const Standard_Integer  y       ,
36                           const Handle_V3d_View& aView   );  
37   void MoveEvent2D       (const Standard_Integer  x       ,
38                           const Standard_Integer  y       ,
39                           const Handle_V3d_View& aView   ); 
40   void ShiftMoveEvent2D  (const Standard_Integer  x       ,
41                           const Standard_Integer  y       ,
42                           const Handle_V3d_View& aView   ); 
43   void ShiftDragEvent2D  (const Standard_Integer  x       ,
44                           const Standard_Integer  y       ,
45                           const Standard_Integer  TheState,
46                           const Handle_V3d_View& aView   ); 
47   void ShiftInputEvent2D (const Standard_Integer  x       ,
48                           const Standard_Integer  y       ,
49                           const Handle_V3d_View& aView   ); 
50   void Popup2D           (const Standard_Integer  x       ,
51                           const Standard_Integer  y       ,
52                           const Handle_V3d_View& aView   ); 
53
54   Handle_AIS_InteractiveObject drawSurface
55     (const Handle_Geom_Surface& theSurface,
56     const Quantity_Color& theColor,
57     const Standard_Boolean toDisplay);
58
59   Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
60   // Waits for a user input or a period of time has been elapsed
61
62   Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
63                               const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
64                               const Standard_Boolean toDisplay = Standard_True);
65   // creates a presentation of the given point
66   // and displays it in the viewer if toDisplay = Standard_True
67
68   Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
69                               const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
70                               const Standard_Boolean toDisplay = Standard_True);
71   // creates a presentation of the given shape with the given material
72   // (color is default for a given material)
73   // and displays it in the viewer if toDisplay = Standard_True
74
75 protected: // create from serialization only
76   CGeometryDoc();
77   DECLARE_DYNCREATE(CGeometryDoc)
78
79   // Attributes
80 public:
81
82   // Operations
83 public:
84
85   // Overrides
86   // ClassWizard generated virtual function overrides
87   //{{AFX_VIRTUAL(CGeometryDoc)
88 public:
89   virtual BOOL OnNewDocument();
90   virtual void Serialize(CArchive& ar);
91   virtual void OnCloseDocument();
92   //}}AFX_VIRTUAL
93
94   // Implementation
95 public:
96   virtual ~CGeometryDoc();
97 #ifdef _DEBUG
98   virtual void AssertValid() const;
99   virtual void Dump(CDumpContext& dc) const;
100 #endif
101
102 protected:
103
104   // Generated message map functions
105 protected:
106   //{{AFX_MSG(CGeometryDoc)
107   afx_msg void OnWindowNew2d();
108   afx_msg void OnBUTTONTest1();
109   afx_msg void OnBUTTONTest2();
110   afx_msg void OnBUTTONTest3();
111   afx_msg void OnBUTTONTest4();
112   afx_msg void OnBUTTONTest5();
113   afx_msg void OnBUTTONTest6();
114   afx_msg void OnBUTTONTest7();
115   afx_msg void OnBUTTONTest8();
116   afx_msg void OnBUTTONTest9();
117   afx_msg void OnBUTTONTest10();
118   afx_msg void OnBUTTONTest11();
119   afx_msg void OnBUTTONTest12();
120   afx_msg void OnBUTTONTest13();
121   afx_msg void OnBUTTONTest14();
122   afx_msg void OnBUTTONTest15();
123   afx_msg void OnBUTTONTest16();
124   afx_msg void OnBUTTONTest17();
125   afx_msg void OnBUTTONTest18();
126   afx_msg void OnBUTTONTest19();
127   afx_msg void OnBUTTONTest20();
128   afx_msg void OnBUTTONTest21();
129   afx_msg void OnBUTTONTest22();
130   afx_msg void OnBUTTONTest23();
131   afx_msg void OnBUTTONTest24();
132   afx_msg void OnBUTTONTest25();
133   afx_msg void OnBUTTONTest26();
134   afx_msg void OnBUTTONTest27();
135   afx_msg void OnBUTTONTest28();
136   afx_msg void OnBUTTONTest29();
137   afx_msg void OnBUTTONTest30();
138   afx_msg void OnBUTTONTest31();
139   afx_msg void OnBUTTONTest32();
140   afx_msg void OnBUTTONTest33();
141   afx_msg void OnBUTTONTest34();
142   afx_msg void OnBUTTONTest35();
143   afx_msg void OnBUTTONTest36();
144   afx_msg void OnBUTTONTest37();
145   afx_msg void OnBUTTONTest38();
146   afx_msg void OnBUTTONTest39();
147   afx_msg void OnBUTTONTest40();
148   afx_msg void OnBUTTONTest41();
149   afx_msg void OnBUTTONTest42();
150   afx_msg void OnBUTTONTest43();
151   afx_msg void OnBUTTONTest44();
152   afx_msg void OnBUTTONTest45();
153   afx_msg void OnBUTTONTest46();
154   afx_msg void OnBUTTONTest47();
155   afx_msg void OnBUTTONTest48();
156   afx_msg void OnBUTTONTest49();
157   afx_msg void OnBUTTONTest50();
158   afx_msg void OnUpdateBUTTONTest1(CCmdUI* pCmdUI);
159   afx_msg void OnUpdateBUTTONTest2(CCmdUI* pCmdUI);
160   afx_msg void OnUpdateBUTTONTest3(CCmdUI* pCmdUI);
161   afx_msg void OnUpdateBUTTONTest4(CCmdUI* pCmdUI);
162   afx_msg void OnUpdateBUTTONTest5(CCmdUI* pCmdUI);
163   afx_msg void OnUpdateBUTTONTest6(CCmdUI* pCmdUI);
164   afx_msg void OnUpdateBUTTONTest7(CCmdUI* pCmdUI);
165   afx_msg void OnUpdateBUTTONTest8(CCmdUI* pCmdUI);
166   afx_msg void OnUpdateBUTTONTest9(CCmdUI* pCmdUI);
167   afx_msg void OnUpdateBUTTONTest10(CCmdUI* pCmdUI);
168   afx_msg void OnUpdateBUTTONTest11(CCmdUI* pCmdUI);
169   afx_msg void OnUpdateBUTTONTest12(CCmdUI* pCmdUI);
170   afx_msg void OnUpdateBUTTONTest13(CCmdUI* pCmdUI);
171   afx_msg void OnUpdateBUTTONTest14(CCmdUI* pCmdUI);
172   afx_msg void OnUpdateBUTTONTest15(CCmdUI* pCmdUI);
173   afx_msg void OnUpdateBUTTONTest16(CCmdUI* pCmdUI);
174   afx_msg void OnUpdateBUTTONTest17(CCmdUI* pCmdUI);
175   afx_msg void OnUpdateBUTTONTest18(CCmdUI* pCmdUI);
176   afx_msg void OnUpdateBUTTONTest19(CCmdUI* pCmdUI);
177   afx_msg void OnUpdateBUTTONTest20(CCmdUI* pCmdUI);
178   afx_msg void OnUpdateBUTTONTest21(CCmdUI* pCmdUI);
179   afx_msg void OnUpdateBUTTONTest22(CCmdUI* pCmdUI);
180   afx_msg void OnUpdateBUTTONTest23(CCmdUI* pCmdUI);
181   afx_msg void OnUpdateBUTTONTest24(CCmdUI* pCmdUI);
182   afx_msg void OnUpdateBUTTONTest25(CCmdUI* pCmdUI);
183   afx_msg void OnUpdateBUTTONTest26(CCmdUI* pCmdUI);
184   afx_msg void OnUpdateBUTTONTest27(CCmdUI* pCmdUI);
185   afx_msg void OnUpdateBUTTONTest28(CCmdUI* pCmdUI);
186   afx_msg void OnUpdateBUTTONTest29(CCmdUI* pCmdUI);
187   afx_msg void OnUpdateBUTTONTest30(CCmdUI* pCmdUI);
188   afx_msg void OnUpdateBUTTONTest31(CCmdUI* pCmdUI);
189   afx_msg void OnUpdateBUTTONTest32(CCmdUI* pCmdUI);
190   afx_msg void OnUpdateBUTTONTest33(CCmdUI* pCmdUI);
191   afx_msg void OnUpdateBUTTONTest34(CCmdUI* pCmdUI);
192   afx_msg void OnUpdateBUTTONTest35(CCmdUI* pCmdUI);
193   afx_msg void OnUpdateBUTTONTest36(CCmdUI* pCmdUI);
194   afx_msg void OnUpdateBUTTONTest37(CCmdUI* pCmdUI);
195   afx_msg void OnUpdateBUTTONTest38(CCmdUI* pCmdUI);
196   afx_msg void OnUpdateBUTTONTest39(CCmdUI* pCmdUI);
197   afx_msg void OnUpdateBUTTONTest40(CCmdUI* pCmdUI);
198   afx_msg void OnUpdateBUTTONTest41(CCmdUI* pCmdUI);
199   afx_msg void OnUpdateBUTTONTest42(CCmdUI* pCmdUI);
200   afx_msg void OnUpdateBUTTONTest43(CCmdUI* pCmdUI);
201   afx_msg void OnUpdateBUTTONTest44(CCmdUI* pCmdUI);
202   afx_msg void OnUpdateBUTTONTest45(CCmdUI* pCmdUI);
203   afx_msg void OnUpdateBUTTONTest46(CCmdUI* pCmdUI);
204   afx_msg void OnUpdateBUTTONTest47(CCmdUI* pCmdUI);
205   afx_msg void OnUpdateBUTTONTest48(CCmdUI* pCmdUI);
206   afx_msg void OnUpdateBUTTONTest49(CCmdUI* pCmdUI);
207   afx_msg void OnUpdateBUTTONTest50(CCmdUI* pCmdUI);
208   afx_msg void OnCreateSol();
209   afx_msg void OnSimplify();
210   //}}AFX_MSG
211   DECLARE_MESSAGE_MAP()
212
213
214 private:
215   Handle_V3d_Viewer myViewer;
216   Handle_V3d_Viewer myViewerCollector;
217   Handle_AIS_InteractiveContext myAISContext;
218 public :
219   Handle_AIS_InteractiveContext& GetAISContext(){ return myAISContext; };
220   Handle_V3d_Viewer GetViewer()  { return myViewer; };
221   Handle_V3d_Viewer GetViewerCollector()  { return myViewerCollector; };
222
223
224 private:
225   Handle_V3d_Viewer myViewer2D;
226   Handle_AIS_InteractiveContext myAISContext2D;
227 public :
228   int Current;
229   void Minimize3D();
230   void Minimize2D();
231   Handle_V3d_Viewer GetViewer2D()  { return myViewer2D; };
232   Handle_AIS_InteractiveContext& GetISessionContext(){ return myAISContext2D; };
233   BOOL FitMode;
234
235 public :
236   CResultDialog myCResultDialog;
237
238 };
239
240 /////////////////////////////////////////////////////////////////////////////
241
242 #endif // !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)