46a0b2ba6f6435a5b057d79a229b58286ba8ff31
[occt.git] / samples / mfc / standard / Common / OCC_BaseDoc.h
1 // OCC_BaseDoc.h: interface for the OCC_BaseDoc class.
2 //
3 //////////////////////////////////////////////////////////////////////
4
5 #if !defined(AFX_OCC_BASEDOC_H__2E048CC8_38F9_11D7_8611_0060B0EE281E__INCLUDED_)
6 #define AFX_OCC_BASEDOC_H__2E048CC8_38F9_11D7_8611_0060B0EE281E__INCLUDED_
7
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
11
12 #include <AIS_InteractiveContext.hxx>
13 #include <V3d_Viewer.hxx>
14
15 // Base class for all documents in the sample.
16 // Declares base functionlaity and interface for the sample documents.
17 // Common properties:
18 // - interactive context
19 // - 3d viewer
20 // Common methods:
21 // - base events
22 // - export into one of supported export formats.
23 class AFX_EXT_CLASS OCC_BaseDoc : public CDocument
24 {
25 public:
26
27   OCC_BaseDoc();
28
29   virtual ~OCC_BaseDoc();
30
31   Handle(AIS_InteractiveContext)& GetAISContext() { return myAISContext; }
32
33   Handle(V3d_Viewer) GetViewer() { return myViewer; }
34
35   // Returns string with supported export pixel and vector images formats.
36   const CString SupportedImageFormats() const;
37
38   // Exports the given view into of the supported formats.
39   void ExportView (const Handle(V3d_View)& theView) const;
40
41   //Events
42   virtual void DragEvent (const Standard_Integer /*theMouseX*/,
43                           const Standard_Integer /*theMouseY*/,
44                           const Standard_Integer /*theState*/,
45                           const Handle(V3d_View)& /*theView*/) {}
46
47   virtual void InputEvent (const Standard_Integer /*theMouseX*/,
48                            const Standard_Integer /*theMouseY*/,
49                            const Handle(V3d_View)& /*theView*/) {}
50
51   virtual void MoveEvent (const Standard_Integer /*theMouseX*/,
52                           const Standard_Integer /*theMouseY*/,
53                           const Handle(V3d_View)& /*theView*/) {}
54
55   virtual void ShiftMoveEvent (const Standard_Integer /*theMouseX*/,
56                                const Standard_Integer /*theMouseY*/,
57                                const Handle(V3d_View)& /*theView*/) {}
58
59   virtual void ShiftDragEvent (const Standard_Integer /*theMouseX*/,
60                                const Standard_Integer /*theMouseY*/,
61                                const Standard_Integer /*theState*/,
62                                const Handle(V3d_View)& /*theView*/) {}
63
64   virtual void ShiftInputEvent(const Standard_Integer /*theMouseX*/,
65                                const Standard_Integer /*theMouseY*/,
66                                const Handle(V3d_View)& /*theView*/) {}
67
68   virtual void Popup (const Standard_Integer /*theMouseX*/,
69                       const Standard_Integer /*theMouseY*/,
70                       const Handle(V3d_View)& /*theView*/) {}
71 protected:
72
73   Handle(V3d_Viewer) myViewer;
74   Handle(AIS_InteractiveContext) myAISContext;
75 };
76
77 #endif // !defined(AFX_OCC_BASEDOC_H__2E048CC8_38F9_11D7_8611_0060B0EE281E__INCLUDED_)