1 // File: OCCViewer_ViewWidget.h
2 // Created: 26 Jul 2012
3 // Author: Natalia ERMOLAEVA
6 #ifndef OCCVIEWER_VIEWWIDGET_H
7 #define OCCVIEWER_VIEWWIDGET_H
9 #include "CurveCreator_Macro.hxx"
15 #include <QtxAction.h>
16 #include <QtxMultiAction.h>
18 #include <OCCViewer_ViewWindow.h>
19 #include <V3d_Viewer.hxx>
20 #include <AIS_InteractiveContext.hxx>
21 #include <AIS_Trihedron.hxx>
22 #include <TopoDS_Shape.hxx>
24 class OCCViewer_ViewPort3d;
28 class Handle(V3d_Viewer);
31 #pragma warning ( disable:4251 )
34 // ---------------- OCC view widget --------
35 class CURVECREATOR_EXPORT OCCViewer_ViewWidget : public QFrame
40 OCCViewer_ViewWidget(QWidget* parent);
41 ~OCCViewer_ViewWidget();
43 bool eventFilter(QObject* watched, QEvent* e);
46 void Display(const TopoDS_Shape shape, const bool theShaded,
47 const QColor& shapeColor);
60 enum OperationType{ NOTHING, FITALLVIEW, WINDOWFIT, ZOOMVIEW, PANVIEW, PANGLOBAL,
66 void activateWindowFit();
67 void activateRotation();
68 void activatePanning();
69 void activateGlPanning();
70 OperationType getButtonState(QMouseEvent* theEvent);
71 void viewerFitAll(const bool theUpdate = true);
73 void vpMousePressEvent (QMouseEvent* theEvent);
74 void vpMouseReleaseEvent(QMouseEvent* theEvent);
75 void vpMouseMoveEvent (QMouseEvent* theEvent);
79 bool transformRequested() { return myOperation != NOTHING; }
80 bool setTransformRequested (OperationType op);
81 void clearViewer(const bool theUpdate = true);
83 typedef enum { FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId, TrihId,
84 FrontId, BackId, TopId, BottomId, LeftId, RightId, None } ButtonsType;
85 typedef QMap<ButtonsType, QtxAction*> ActionsMap;
88 OCCViewer_ViewPort3d* myViewPort;
89 Handle(V3d_Viewer) myV3dViewer;
90 #if OCC_VERSION_LARGE <= 0x06060000
91 Handle(V3d_Viewer) myV3dCollector;
93 Handle(AIS_InteractiveContext) myAISContext;
94 Handle(AIS_Trihedron) myTrihedron;
96 QtxMultiAction *myZoomBtns, *myPanBtns, *myProjBtns;
98 OperationType myOperation;
100 ActionsMap myButsMap;
111 OCCViewer_ViewWindow::RotationPointType myCurrPointType;
112 gp_Pnt mySelectedPoint;
113 bool myShowTrihedron;