1 #ifndef ModuleBase_IViewer_H
2 #define ModuleBase_IViewer_H
4 #include "ModuleBase.h"
6 #include <AIS_InteractiveContext.hxx>
7 #include <V3d_View.hxx>
11 class QContextMenuEvent;
14 * A Base object for definition of connector object to
15 * Salome Viewer. Reimplemented in NewGeom_SalomeViewer class
17 class MODULEBASE_EXPORT ModuleBase_IViewer : public QObject
21 ModuleBase_IViewer(QObject* theParent)
26 //! Returns AIS_InteractiveContext from current OCCViewer
27 virtual Handle(AIS_InteractiveContext) AISContext() const = 0;
29 //! Retrurns V3d_Vioewer from current viewer
30 virtual Handle(V3d_Viewer) v3dViewer() const = 0;
32 //! Returns Vsd_View object from currently active view window
33 virtual Handle(V3d_View) activeView() const = 0;
35 //! Enable or disable selection in the viewer
36 virtual void enableSelection(bool isEnabled) = 0;
38 //! Returns true if selection is enabled
39 virtual bool isSelectionEnabled() const = 0;
41 //! Enable or disable multiselection in the viewer
42 virtual void enableMultiselection(bool isEnable) = 0;
44 //! Returns true if multiselection is enabled
45 virtual bool isMultiSelectionEnabled() const = 0;
47 //! Perfroms the fit all for the active view
48 virtual void fitAll() = 0;
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;
58 void lastViewClosed();
62 void mousePress(QMouseEvent* theEvent);
63 void mouseRelease(QMouseEvent* theEvent);
64 void mouseDoubleClick(QMouseEvent* theEvent);
65 void mouseMove(QMouseEvent* theEvent);
66 void keyPress(QKeyEvent* theEvent);
67 void keyRelease(QKeyEvent* theEvent);
70 void selectionChanged();
71 void contextMenuRequested(QContextMenuEvent*);