1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #ifndef ModuleBase_IViewer_H
4 #define ModuleBase_IViewer_H
6 #include "ModuleBase.h"
8 #include <AIS_InteractiveContext.hxx>
9 #include <V3d_View.hxx>
13 class QContextMenuEvent;
14 class ModuleBase_IViewWindow;
17 * A Base object for definition of connector object to
18 * Salome Viewer. Reimplemented in NewGeom_SalomeViewer class
20 class MODULEBASE_EXPORT ModuleBase_IViewer : public QObject
24 ModuleBase_IViewer(QObject* theParent)
29 //! Returns AIS_InteractiveContext from current OCCViewer
30 virtual Handle(AIS_InteractiveContext) AISContext() const = 0;
32 //! Retrurns V3d_Vioewer from current viewer
33 virtual Handle(V3d_Viewer) v3dViewer() const = 0;
35 //! Returns Vsd_View object from currently active view window
36 virtual Handle(V3d_View) activeView() const = 0;
38 //! Enable or disable selection in the viewer
39 virtual void enableSelection(bool isEnabled) = 0;
41 //! Returns true if selection is enabled
42 virtual bool isSelectionEnabled() const = 0;
44 //! Enable or disable multiselection in the viewer
45 virtual void enableMultiselection(bool isEnable) = 0;
47 //! Returns true if multiselection is enabled
48 virtual bool isMultiSelectionEnabled() const = 0;
50 //! Perfroms the fit all for the active view
51 virtual void fitAll() = 0;
53 //! Sets the view projection
54 /// \param theX the X projection value
55 /// \param theY the Y projection value
56 /// \param theZ the Z projection value
57 virtual void setViewProjection(double theX, double theY, double theZ) = 0;
59 /// Add selection filter to the viewer
60 virtual void addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) = 0;
62 /// Remove selection filter from the viewer
63 virtual void removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) = 0;
65 /// Remove all selection filters from the viewer
66 virtual void clearSelectionFilters() = 0;
69 void lastViewClosed();
70 void tryCloseView(ModuleBase_IViewWindow* theWnd);
71 void deleteView(ModuleBase_IViewWindow* theWnd);
72 void viewCreated(ModuleBase_IViewWindow* theWnd);
73 void activated(ModuleBase_IViewWindow* theWnd);
75 void mousePress(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
76 void mouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
77 void mouseDoubleClick(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
78 void mouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
80 void keyPress(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent);
81 void keyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent);
83 void selectionChanged();
84 void contextMenuRequested(QContextMenuEvent*);