0031521: Samples - update MFC ImportExport sample to use AIS_ViewController
[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 Standard_EXPORT OCC_BaseDoc : public CDocument
24 {
25 public:
26
27   OCC_BaseDoc();
28
29   virtual ~OCC_BaseDoc();
30
31   const Handle(AIS_InteractiveContext)& GetAISContext() const { return myAISContext; }
32   const Handle(AIS_InteractiveContext)& GetInteractiveContext() const { return myAISContext; };
33
34   const Handle(V3d_Viewer)& GetViewer() const { return myViewer; }
35
36   // Returns string with supported export pixel and vector images formats.
37   const CString SupportedImageFormats() const;
38
39   // Exports the given view into of the supported formats.
40   void ExportView (const Handle(V3d_View)& theView) const;
41
42   //Events
43   virtual void DragEvent (const Standard_Integer /*theMouseX*/,
44                           const Standard_Integer /*theMouseY*/,
45                           const Standard_Integer /*theState*/,
46                           const Handle(V3d_View)& /*theView*/) {}
47
48   virtual void InputEvent (const Standard_Integer /*theMouseX*/,
49                            const Standard_Integer /*theMouseY*/,
50                            const Handle(V3d_View)& /*theView*/) {}
51
52   virtual void MoveEvent (const Standard_Integer /*theMouseX*/,
53                           const Standard_Integer /*theMouseY*/,
54                           const Handle(V3d_View)& /*theView*/) {}
55
56   virtual void ShiftMoveEvent (const Standard_Integer /*theMouseX*/,
57                                const Standard_Integer /*theMouseY*/,
58                                const Handle(V3d_View)& /*theView*/) {}
59
60   virtual void ShiftDragEvent (const Standard_Integer /*theMouseX*/,
61                                const Standard_Integer /*theMouseY*/,
62                                const Standard_Integer /*theState*/,
63                                const Handle(V3d_View)& /*theView*/) {}
64
65   virtual void ShiftInputEvent(const Standard_Integer /*theMouseX*/,
66                                const Standard_Integer /*theMouseY*/,
67                                const Handle(V3d_View)& /*theView*/) {}
68
69   virtual void Popup (const Standard_Integer /*theMouseX*/,
70                       const Standard_Integer /*theMouseY*/,
71                       const Handle(V3d_View)& /*theView*/) {}
72
73   //! Callback called by handleMoveTo() on Selection in 3D Viewer.
74   virtual void OnSelectionChanged (const Handle(AIS_InteractiveContext)& ,
75                                    const Handle(V3d_View)& ) {}
76
77   void ResetDocumentViews (CDocTemplate* theTemplate);
78
79 protected:
80
81   Handle(V3d_Viewer) myViewer;
82   Handle(AIS_InteractiveContext) myAISContext;
83 };
84
85 #endif // !defined(AFX_OCC_BASEDOC_H__2E048CC8_38F9_11D7_8611_0060B0EE281E__INCLUDED_)