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;
12 class ModuleBase_IViewWindow;
15 * A Base object for definition of connector object to
16 * Salome Viewer. Reimplemented in NewGeom_SalomeViewer class
18 class MODULEBASE_EXPORT ModuleBase_IViewer : public QObject
22 ModuleBase_IViewer(QObject* theParent)
27 //! Returns AIS_InteractiveContext from current OCCViewer
28 virtual Handle(AIS_InteractiveContext) AISContext() const = 0;
30 //! Retrurns V3d_Vioewer from current viewer
31 virtual Handle(V3d_Viewer) v3dViewer() const = 0;
33 //! Returns Vsd_View object from currently active view window
34 virtual Handle(V3d_View) activeView() const = 0;
36 //! Enable or disable selection in the viewer
37 virtual void enableSelection(bool isEnabled) = 0;
39 //! Returns true if selection is enabled
40 virtual bool isSelectionEnabled() const = 0;
42 //! Enable or disable multiselection in the viewer
43 virtual void enableMultiselection(bool isEnable) = 0;
45 //! Returns true if multiselection is enabled
46 virtual bool isMultiSelectionEnabled() const = 0;
48 //! Perfroms the fit all for the active view
49 virtual void fitAll() = 0;
51 //! Sets the view projection
52 /// \param theX the X projection value
53 /// \param theY the Y projection value
54 /// \param theZ the Z projection value
55 virtual void setViewProjection(double theX, double theY, double theZ) = 0;
57 /// Add selection filter to the viewer
58 virtual void addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) = 0;
60 /// Remove selection filter from the viewer
61 virtual void removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) = 0;
63 /// Remove all selection filters from the viewer
64 virtual void clearSelectionFilters() = 0;
67 void lastViewClosed();
68 void tryCloseView(ModuleBase_IViewWindow* theWnd);
69 void deleteView(ModuleBase_IViewWindow* theWnd);
70 void viewCreated(ModuleBase_IViewWindow* theWnd);
71 void activated(ModuleBase_IViewWindow* theWnd);
73 void mousePress(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
74 void mouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
75 void mouseDoubleClick(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
76 void mouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
78 void keyPress(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent);
79 void keyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent);
81 void selectionChanged();
82 void contextMenuRequested(QContextMenuEvent*);