1 #ifndef OCCVIEWER_VIEWWIDGET_H
2 #define OCCVIEWER_VIEWWIDGET_H
4 #include "CurveCreator_Macro.hxx"
6 #include <OCCViewer_ViewWindow.h>
8 #include <QtxMultiAction.h>
10 #include <V3d_Viewer.hxx>
11 #include <AIS_InteractiveContext.hxx>
12 #include <AIS_Trihedron.hxx>
13 #include <TopoDS_Shape.hxx>
19 class OCCViewer_ViewPort3d;
23 class Handle(V3d_Viewer);
26 #pragma warning ( disable:4251 )
29 // ---------------- OCC view widget --------
30 class CURVECREATOR_EXPORT OCCViewer_ViewWidget : public QFrame
35 OCCViewer_ViewWidget(QWidget* parent);
36 ~OCCViewer_ViewWidget();
38 bool eventFilter(QObject* watched, QEvent* e);
41 void Display(const TopoDS_Shape shape, const bool theShaded,
42 const QColor& shapeColor);
55 enum OperationType{ NOTHING, FITALLVIEW, WINDOWFIT, ZOOMVIEW, PANVIEW, PANGLOBAL,
61 void activateWindowFit();
62 void activateRotation();
63 void activatePanning();
64 void activateGlPanning();
65 OperationType getButtonState(QMouseEvent* theEvent);
66 void viewerFitAll(const bool theUpdate = true);
68 void vpMousePressEvent (QMouseEvent* theEvent);
69 void vpMouseReleaseEvent(QMouseEvent* theEvent);
70 void vpMouseMoveEvent (QMouseEvent* theEvent);
74 bool transformRequested() { return myOperation != NOTHING; }
75 bool setTransformRequested (OperationType op);
76 void clearViewer(const bool theUpdate = true);
78 typedef enum { FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId, TrihId,
79 FrontId, BackId, TopId, BottomId, LeftId, RightId, None } ButtonsType;
80 typedef QMap<ButtonsType, QtxAction*> ActionsMap;
83 OCCViewer_ViewPort3d* myViewPort;
84 Handle(V3d_Viewer) myV3dViewer;
85 #if OCC_VERSION_LARGE <= 0x06060000
86 Handle(V3d_Viewer) myV3dCollector;
88 Handle(AIS_InteractiveContext) myAISContext;
89 Handle(AIS_Trihedron) myTrihedron;
91 QtxMultiAction *myZoomBtns, *myPanBtns, *myProjBtns;
93 OperationType myOperation;
106 OCCViewer_ViewWindow::RotationPointType myCurrPointType;
107 gp_Pnt mySelectedPoint;
108 bool myShowTrihedron;