4 #include "XGUI_Constants.h"
10 #include <V3d_Viewer.hxx>
11 #include <AIS_InteractiveContext.hxx>
12 #include <AIS_Trihedron.hxx>
14 class XGUI_MainWindow;
16 class XGUI_ViewWindow;
20 class XGUI_Viewer: public QObject
24 static QString backgroundData(QStringList&, QIntList&, QIntList&);
26 XGUI_Viewer(XGUI_MainWindow* theParent, bool DisplayTrihedron = true);
29 QMdiSubWindow* createView(V3d_TypeOfView theType = V3d_ORTHOGRAPHIC);
31 XGUI_MainWindow* mainWindow() const
36 Handle(V3d_Viewer) v3dViewer() const
41 Handle(AIS_InteractiveContext) AISContext() const
46 Handle(AIS_Trihedron) trihedron() const
51 void toggleTrihedron();
52 bool isTrihedronVisible() const;
53 void setTrihedronShown(const bool on);
54 double trihedronSize() const;
55 void setTrihedronSize(const double sz, bool isRelative);
56 bool trihedronRelative() const
60 void updateTrihedron();
61 bool computeTrihedronSize(double& theNewSize, double& theSize);
63 static void setHotButton(XGUI::InteractionStyle theInteractionStyle, XGUI::HotOperation theOper,
64 Qt::KeyboardModifiers theState, Qt::MouseButtons theButton);
65 static void getHotButton(XGUI::InteractionStyle theInteractionStyle, XGUI::HotOperation theOper,
66 Qt::KeyboardModifiers& theState, Qt::MouseButtons& theButton);
68 typedef QMap<XGUI::HotOperation, Qt::KeyboardModifiers> StatesMap;
69 typedef QMap<XGUI::HotOperation, Qt::MouseButtons> ButtonsMap;
71 typedef QMap<XGUI::InteractionStyle, StatesMap> InteractionStyle2StatesMap;
72 typedef QMap<XGUI::InteractionStyle, ButtonsMap> InteractionStyle2ButtonsMap;
74 static InteractionStyle2StatesMap myStateMap;
75 static InteractionStyle2ButtonsMap myButtonMap;
78 void lastViewClosed();
79 void tryCloseView(XGUI_ViewWindow* theWindow);
80 void deleteView(XGUI_ViewWindow* theWindow);
81 void viewCreated(XGUI_ViewWindow* theWindow);
82 void mousePress(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent);
83 void mouseRelease(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent);
84 void mouseDoubleClick(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent);
85 void mouseMove(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent);
86 void keyPress(XGUI_ViewWindow* theWindow, QKeyEvent* theEvent);
87 void keyRelease(XGUI_ViewWindow* theWindow, QKeyEvent* theEvent);
88 void activated(XGUI_ViewWindow* theWindow);
91 void onViewClosed(QMdiSubWindow*);
92 //void onViewMapped();
93 void onWindowActivated(QMdiSubWindow*);
96 void addView(QMdiSubWindow* theView);
98 /*! Removes the View from internal Views list.*/
99 void removeView(QMdiSubWindow* theView);
102 XGUI_MainWindow* myMainWindow;
104 Handle(V3d_Viewer) myV3dViewer;Handle(AIS_Trihedron) myTrihedron;Handle(AIS_InteractiveContext) myAISContext;
106 XGUI::InteractionStyle myInteractionStyle;
108 bool myPreselectionEnabled;
109 bool mySelectionEnabled;
110 bool myMultiSelectionEnabled;
113 double myTrihedronSize;
115 QList<QMdiSubWindow*> myViews;
117 QMdiSubWindow* myActiveView;