3adbbbd35356e4fa8573b263d58cfc3a05d96681
[occt.git] / samples / qt / Graphic3dDemo / inc / ViewOperations.h
1 #ifndef VIEWOPERATIONS_H
2 #define VIEWOPERATIONS_H
3
4 #include <qobject.h>
5 #include <qlist.h>
6 #include <qaction.h>
7
8 #include <AIS_InteractiveContext.hxx>
9
10 class ViewOperations : public QObject
11 {
12         Q_OBJECT
13
14 public:
15   enum ViewActions { /*MagViewId, AxoViewId, PerViewId,*/ ToolWireframeId, ToolShadingId };
16
17   enum Action { ViewFitAllId, ViewFitAreaId, ViewZoomId, ViewPanId, 
18                                 ViewGlobalPanId, ViewFrontId, ViewBackId, 
19                                   ViewTopId, ViewBottomId, ViewLeftId, ViewRightId,ViewAxoId, 
20                                   ViewRotationId, ViewResetId };
21
22         ViewOperations( QObject * parent=0 ) ;
23         ViewOperations( Handle(AIS_InteractiveContext) theContext, QObject * parent=0 ) ;
24         ~ViewOperations();
25
26         QList<QAction*>     getViewActions();
27         QList<QAction*>     getToolActions();
28         void                initActions();
29         int                 getDisplayMode();
30
31 signals:
32   void                setCursor( const QCursor& );
33
34 private slots:
35   void                onActionActivated();
36
37 public slots:
38         void                onWireframe();
39         void                onShading();
40         void                onToolAction();
41         void                updateToggled( bool );
42         void                onNoActiveActions();
43
44 private:
45   void                initCursors();
46         void                initViewActions();
47         void                initToolActions();
48
49 private:
50         Handle_AIS_InteractiveContext   myContext;
51         QList<QAction*>                 myViewActions;
52   QList<QAction*>                 myToolActions;
53 };
54
55 #endif