2 #ifndef NewGeom_SalomeViewer_H
3 #define NewGeom_SalomeViewer_H
7 #include <ModuleBase_IViewer.h>
8 #include <ModuleBase_IViewWindow.h>
10 #include <V3d_View.hxx>
12 class SUIT_ViewWindow;
16 class NewGeom_OCCSelector;
17 class OCCViewer_Viewer;
18 class SUIT_ViewManager;
21 class NewGeom_SalomeView: public ModuleBase_IViewWindow
24 NewGeom_SalomeView(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
26 virtual Handle(V3d_View) v3dView() const;
28 void setViewer(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
29 OCCViewer_Viewer* viewer() const { return myViewer; }
32 OCCViewer_Viewer* myViewer;
36 class NewGeom_SalomeViewer : public ModuleBase_IViewer
40 NewGeom_SalomeViewer(QObject* theParent);
42 ~NewGeom_SalomeViewer();
44 //! Returns AIS_InteractiveContext from current OCCViewer
45 virtual Handle(AIS_InteractiveContext) AISContext() const;
47 //! Retrurns V3d_Vioewer from current viewer
48 virtual Handle(V3d_Viewer) v3dViewer() const;
50 //! Returns Vsd_View object from currently active view window
51 virtual Handle(V3d_View) activeView() const;
53 //! Enable or disable selection in the viewer
54 virtual void enableSelection(bool isEnabled);
56 //! Returns true if selection is enabled
57 virtual bool isSelectionEnabled() const;
59 //! Enable or disable multiselection in the viewer
60 virtual void enableMultiselection(bool isEnable);
62 //! Returns true if multiselection is enabled
63 virtual bool isMultiSelectionEnabled() const;
65 //! Perfroms the fit all for the active view
66 virtual void fitAll();
68 //! Sets the view projection
69 /// \param theX the X projection value
70 /// \param theY the Y projection value
71 /// \param theZ the Z projection value
72 virtual void setViewProjection(double theX, double theY, double theZ);
74 void setSelector(NewGeom_OCCSelector* theSel);
76 /// Add selection filter to the viewer
77 virtual void addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
79 /// Remove selection filter from the viewer
80 virtual void removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
82 /// Remove all selection filters from the viewer
83 virtual void clearSelectionFilters();
85 NewGeom_OCCSelector* selector() const
91 void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
92 void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
93 void onMouseDoubleClick(SUIT_ViewWindow*, QMouseEvent*);
94 void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
95 void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
96 void onKeyRelease(SUIT_ViewWindow*, QKeyEvent*);
98 void onTryCloseView(SUIT_ViewWindow*);
99 void onDeleteView(SUIT_ViewWindow*);
100 void onViewCreated(SUIT_ViewWindow*);
101 void onActivated(SUIT_ViewWindow*);
103 void onSelectionChanged();
106 NewGeom_OCCSelector* mySelector;
107 NewGeom_SalomeView* myView;
108 bool myIsSelectionChanged;