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;
56 /// Add selection filter to the viewer
57 virtual void addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) = 0;
59 /// Remove selection filter from the viewer
60 virtual void removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) = 0;
62 /// Remove all selection filters from the viewer
63 virtual void clearSelectionFilters() = 0;
66 void lastViewClosed();
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);
78 void selectionChanged();
79 void contextMenuRequested(QContextMenuEvent*);