Salome HOME
Issue #236: Provide filtering of selected objects for extrusion
[modules/shaper.git] / src / ModuleBase / ModuleBase_IViewer.h
1 #ifndef ModuleBase_IViewer_H
2 #define ModuleBase_IViewer_H
3
4 #include "ModuleBase.h"
5 #include <QObject>
6 #include <AIS_InteractiveContext.hxx>
7 #include <V3d_View.hxx>
8
9 class QMouseEvent;
10 class QKeyEvent;
11 class QContextMenuEvent;
12
13 /**
14  * A Base object for definition of connector object to
15  * Salome Viewer. Reimplemented in NewGeom_SalomeViewer class
16  */
17 class MODULEBASE_EXPORT ModuleBase_IViewer : public QObject
18 {
19 Q_OBJECT
20  public:
21   ModuleBase_IViewer(QObject* theParent)
22       : QObject(theParent)
23   {
24   }
25
26   //! Returns AIS_InteractiveContext from current OCCViewer
27   virtual Handle(AIS_InteractiveContext) AISContext() const = 0;
28
29   //! Retrurns V3d_Vioewer from current viewer
30   virtual Handle(V3d_Viewer) v3dViewer() const = 0;
31
32   //! Returns Vsd_View object from currently active view window
33   virtual Handle(V3d_View) activeView() const = 0;
34
35   //! Enable or disable selection in the viewer
36   virtual void enableSelection(bool isEnabled) = 0;
37
38   //! Returns true if selection is enabled
39   virtual bool isSelectionEnabled() const = 0;
40
41   //! Enable or disable multiselection in the viewer
42   virtual void enableMultiselection(bool isEnable) = 0;
43
44   //! Returns true if multiselection is enabled
45   virtual bool isMultiSelectionEnabled() const = 0;
46
47   //! Perfroms the fit all for the active view
48   virtual void fitAll() = 0;
49
50   //! Sets the view projection
51   /// \param theX the X projection value
52   /// \param theY the Y projection value
53   /// \param theZ the Z projection value
54   virtual void setViewProjection(double theX, double theY, double theZ) = 0;
55
56   /// Add selection filter to the viewer
57   virtual void addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) = 0;
58
59   /// Remove selection filter from the viewer
60   virtual void removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) = 0;
61
62   /// Remove all selection filters from the viewer
63   virtual void clearSelectionFilters() = 0;
64
65 signals:
66   void lastViewClosed();
67   void tryCloseView();
68   void deleteView();
69   void viewCreated();
70   void mousePress(QMouseEvent* theEvent);
71   void mouseRelease(QMouseEvent* theEvent);
72   void mouseDoubleClick(QMouseEvent* theEvent);
73   void mouseMove(QMouseEvent* theEvent);
74   void keyPress(QKeyEvent* theEvent);
75   void keyRelease(QKeyEvent* theEvent);
76   void activated();
77
78   void selectionChanged();
79   void contextMenuRequested(QContextMenuEvent*);
80 };
81
82 #endif