1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 #ifndef NewGeom_SalomeViewer_H
5 #define NewGeom_SalomeViewer_H
9 #include <ModuleBase_IViewer.h>
10 #include <ModuleBase_IViewWindow.h>
12 #include <V3d_View.hxx>
14 class SUIT_ViewWindow;
18 class NewGeom_OCCSelector;
19 class OCCViewer_Viewer;
20 class SUIT_ViewManager;
23 class NewGeom_SalomeView: public ModuleBase_IViewWindow
26 NewGeom_SalomeView(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
28 virtual Handle(V3d_View) v3dView() const;
30 void setViewer(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
31 OCCViewer_Viewer* viewer() const { return myViewer; }
34 OCCViewer_Viewer* myViewer;
38 class NewGeom_SalomeViewer : public ModuleBase_IViewer
42 NewGeom_SalomeViewer(QObject* theParent);
44 ~NewGeom_SalomeViewer();
46 //! Returns AIS_InteractiveContext from current OCCViewer
47 virtual Handle(AIS_InteractiveContext) AISContext() const;
49 //! Retrurns V3d_Vioewer from current viewer
50 virtual Handle(V3d_Viewer) v3dViewer() const;
52 //! Returns Vsd_View object from currently active view window
53 virtual Handle(V3d_View) activeView() const;
55 //! Enable or disable selection in the viewer
56 virtual void enableSelection(bool isEnabled);
58 //! Returns true if selection is enabled
59 virtual bool isSelectionEnabled() const;
61 //! Enable or disable multiselection in the viewer
62 virtual void enableMultiselection(bool isEnable);
64 //! Returns true if multiselection is enabled
65 virtual bool isMultiSelectionEnabled() const;
67 //! Perfroms the fit all for the active view
68 virtual void fitAll();
70 //! Sets the view projection
71 /// \param theX the X projection value
72 /// \param theY the Y projection value
73 /// \param theZ the Z projection value
74 virtual void setViewProjection(double theX, double theY, double theZ);
76 void setSelector(NewGeom_OCCSelector* theSel);
78 /// Add selection filter to the viewer
79 virtual void addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
81 /// Remove selection filter from the viewer
82 virtual void removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
84 /// Remove all selection filters from the viewer
85 virtual void clearSelectionFilters();
87 NewGeom_OCCSelector* selector() const
93 void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
94 void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
95 void onMouseDoubleClick(SUIT_ViewWindow*, QMouseEvent*);
96 void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
97 void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
98 void onKeyRelease(SUIT_ViewWindow*, QKeyEvent*);
100 void onTryCloseView(SUIT_ViewWindow*);
101 void onDeleteView(SUIT_ViewWindow*);
102 void onViewCreated(SUIT_ViewWindow*);
103 void onActivated(SUIT_ViewWindow*);
105 void onSelectionChanged();
108 NewGeom_OCCSelector* mySelector;
109 NewGeom_SalomeView* myView;
110 bool myIsSelectionChanged;