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();
52 void activateWindowFit();
53 void activateRotation();
54 void activatePanning();
55 void activateGlobalPanning();
57 void onMemorizeView();
59 void onTrihedronShow();
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,
72 typedef QMap<int, QtxAction*> ActionsMap;
76 /* Transformation selected but not started yet */
77 bool transformRequested() const { return ( myOperation != NOTHING ); }
78 void setTransformRequested ( OperationType op );
80 /* Transformation is selected and already started */
81 bool transformInProcess() const { return myEventStarted; }
82 void setTransformInProcess( bool bOn ) { myEventStarted = bOn; }
84 void vpMousePressEvent(QMouseEvent* theEvent);
85 void vpMouseReleaseEvent(QMouseEvent* theEvent);
86 void vpMouseMoveEvent(QMouseEvent* theEvent);
94 virtual OperationType getButtonState(QMouseEvent* theEvent);
96 OperationType myOperation;
97 OCCViewer_Viewer* myModel;
98 OCCViewer_ViewPort3d* myViewPort;
107 bool myEventStarted; // set when transformation is in process
109 bool myDrawRect; // set when a rect is used for selection or magnify
110 bool myEnableDrawMode;
111 bool myPaintersRedrawing; // set to draw with external painters
117 ActionsMap myActionsMap;
123 #pragma warning( default:4251 )