1 #ifndef OCCVIEWER_VIEWWINDOW_H
2 #define OCCVIEWER_VIEWWINDOW_H
4 #include "OCCViewer_ViewModel.h"
6 #include "SUIT_ViewWindow.h"
11 #include <qvaluelist.h>
14 class OCCViewer_ViewPort3d;
17 #pragma warning( disable:4251 )
20 class OCCVIEWER_EXPORT OCCViewer_ViewWindow : public SUIT_ViewWindow
25 enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
26 FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW };
28 OCCViewer_ViewWindow(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel);
29 virtual ~OCCViewer_ViewWindow() {};
31 OCCViewer_ViewPort3d* getViewPort() { return myViewPort; }
33 bool eventFilter(QObject* watched, QEvent* e);
35 QToolBar* getToolBar() { return myToolBar; }
37 void performRestoring( const viewAspect& );
39 virtual void initLayout();
53 void activateWindowFit();
54 void activateRotation();
55 void activatePanning();
56 void activateGlobalPanning();
58 void onMemorizeView();
60 void setRestoreFlag();
63 void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
64 void vpTransformationFinished(OCCViewer_ViewWindow::OperationType type);
68 enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId,
69 FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, MemId, RestoreId };
70 typedef QMap<int, QtxAction*> ActionsMap;
73 /* Transformation selected but not started yet */
74 bool transformRequested() const { return ( myOperation != NOTHING ); }
75 void setTransformRequested ( OperationType op );
77 /* Transformation is selected and already started */
78 bool transformInProcess() const { return myEventStarted; }
79 void setTransformInProcess( bool bOn ) { myEventStarted = bOn; }
81 void vpMousePressEvent(QMouseEvent* theEvent);
82 void vpMouseReleaseEvent(QMouseEvent* theEvent);
83 void vpMouseMoveEvent(QMouseEvent* theEvent);
91 virtual OperationType getButtonState(QMouseEvent* theEvent);
93 OperationType myOperation;
94 OCCViewer_Viewer* myModel;
95 OCCViewer_ViewPort3d* myViewPort;
104 bool myEventStarted; // set when transformation is in process
106 bool myDrawRect; // set when a rect is used for selection or magnify
107 bool myEnableDrawMode;
108 bool myPaintersRedrawing; // set to draw with external painters
114 ActionsMap myActionsMap;
120 #pragma warning( default:4251 )