1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 #ifndef XGUI_VIEWERPROXY_H
4 #define XGUI_VIEWERPROXY_H
7 #include <ModuleBase_IViewer.h>
10 class AppElements_ViewWindow;
14 * Proxy class which repersents or AppElements_Viewer or Salome Viewer
15 * dependently on current launching environment.
16 * It is reccomennded to use this class in operation for accessing to viewer
17 * functionality instead of direct access to a viewer
19 class XGUI_EXPORT XGUI_ViewerProxy : public ModuleBase_IViewer
24 /// \param theParent a parent object
25 XGUI_ViewerProxy(XGUI_Workshop* theParent);
27 //! Returns AIS_InteractiveContext from current OCCViewer
28 virtual Handle(AIS_InteractiveContext) AISContext() const;
30 //! Retrurns V3d_Vioewer from current viewer
31 virtual Handle(V3d_Viewer) v3dViewer() const;
33 //! Returns Vsd_View object from currently active view window
34 virtual Handle(V3d_View) activeView() const;
36 //! Enable or disable selection in the viewer
37 virtual void enableSelection(bool isEnabled);
39 //! Returns true if selection is enabled
40 virtual bool isSelectionEnabled() const;
42 //! Enable or disable multiselection in the viewer
43 virtual void enableMultiselection(bool isEnable);
45 //! Returns true if multiselection is enabled
46 virtual bool isMultiSelectionEnabled() const;
48 //! Sets the view projection
49 /// \param theX the X projection value
50 /// \param theY the Y projection value
51 /// \param theZ the Z projection value
52 virtual void setViewProjection(double theX, double theY, double theZ);
54 //! Sets the view fitted all
55 virtual void fitAll();
57 /// Connects to a viewer according to current environment
58 void connectToViewer();
60 /// Add selection filter to the viewer
61 virtual void addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
63 /// Remove selection filter from the viewer
64 virtual void removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
66 /// Remove all selection filters from the viewer
67 virtual void clearSelectionFilters();
69 /// Update current viewer
70 virtual void update();
72 /// Method returns True if the viewer can process editing objects
73 /// by mouse drugging. If this is impossible thet it has to return False.
74 virtual bool canDragByMouse() const;
77 void onTryCloseView(AppElements_ViewWindow*);
78 void onDeleteView(AppElements_ViewWindow*);
79 void onViewCreated(AppElements_ViewWindow*);
80 void onActivated(AppElements_ViewWindow*);
82 void onMousePress(AppElements_ViewWindow*, QMouseEvent*);
83 void onMouseRelease(AppElements_ViewWindow*, QMouseEvent*);
84 void onMouseDoubleClick(AppElements_ViewWindow*, QMouseEvent*);
85 void onMouseMove(AppElements_ViewWindow*, QMouseEvent*);
87 void onKeyPress(AppElements_ViewWindow*, QKeyEvent*);
88 void onKeyRelease(AppElements_ViewWindow*, QKeyEvent*);
91 XGUI_Workshop* myWorkshop;