1 #ifndef OCCVIEWER_VIEWWIDGET_H
2 #define OCCVIEWER_VIEWWIDGET_H
4 #include "CurveCreator_Macro.hxx"
5 #include <Basics_OCCTVersion.hxx>
7 #include <OCCViewer_ViewWindow.h>
9 #include <QtxMultiAction.h>
11 #include <V3d_Viewer.hxx>
12 #include <AIS_InteractiveContext.hxx>
13 #include <AIS_Trihedron.hxx>
14 #include <TopoDS_Shape.hxx>
20 class OCCViewer_ViewPort3d;
24 class Handle(V3d_Viewer);
27 #pragma warning ( disable:4251 )
30 // ---------------- OCC view widget --------
31 class CURVECREATOR_EXPORT OCCViewer_ViewWidget : public QFrame
36 OCCViewer_ViewWidget(QWidget* parent);
37 ~OCCViewer_ViewWidget();
39 bool eventFilter(QObject* watched, QEvent* e);
42 void Display(const TopoDS_Shape shape, const bool theShaded,
43 const QColor& shapeColor);
56 enum OperationType{ NOTHING, FITALLVIEW, WINDOWFIT, ZOOMVIEW, PANVIEW, PANGLOBAL,
62 void activateWindowFit();
63 void activateRotation();
64 void activatePanning();
65 void activateGlPanning();
66 OperationType getButtonState(QMouseEvent* theEvent);
67 void viewerFitAll(const bool theUpdate = true);
69 void vpMousePressEvent (QMouseEvent* theEvent);
70 void vpMouseReleaseEvent(QMouseEvent* theEvent);
71 void vpMouseMoveEvent (QMouseEvent* theEvent);
75 bool transformRequested() { return myOperation != NOTHING; }
76 bool setTransformRequested (OperationType op);
77 void clearViewer(const bool theUpdate = true);
79 typedef enum { FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId, TrihId,
80 FrontId, BackId, TopId, BottomId, LeftId, RightId, None } ButtonsType;
81 typedef QMap<ButtonsType, QtxAction*> ActionsMap;
84 OCCViewer_ViewPort3d* myViewPort;
85 Handle(V3d_Viewer) myV3dViewer;
86 #if OCC_VERSION_LARGE <= 0x06060000
87 Handle(V3d_Viewer) myV3dCollector;
89 Handle(AIS_InteractiveContext) myAISContext;
90 Handle(AIS_Trihedron) myTrihedron;
92 QtxMultiAction *myZoomBtns, *myPanBtns, *myProjBtns;
94 OperationType myOperation;
107 OCCViewer_ViewWindow::RotationPointType myCurrPointType;
108 gp_Pnt mySelectedPoint;
109 bool myShowTrihedron;