Salome HOME
Profile object creation.
[modules/hydro.git] / src / HYDROCurveCreator / OCCViewer_ViewWidget.h
index 1c4efc983cf0ac7790e38cb3c75d79317e190821..cbfe37e7f5cb80e0694e3c2019f5c6193bbfea79 100644 (file)
@@ -22,6 +22,7 @@ class QPushButton;
 class QToolBar;
 
 class Handle(V3d_Viewer);
+class Handle(AIS_InteractiveContext);
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
@@ -33,16 +34,29 @@ class CURVECREATOR_EXPORT OCCViewer_ViewWidget : public QFrame
   Q_OBJECT
 
 public:
-  OCCViewer_ViewWidget(QWidget* parent);
+  typedef enum { FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId, TrihId,
+                 FrontId, BackId, TopId, BottomId, LeftId, RightId, None } ButtonsType;
+
+  OCCViewer_ViewWidget(QWidget* parent, const bool isUseMultiAction = true);
   ~OCCViewer_ViewWidget();
 
+  OCCViewer_ViewPort3d* getViewPort();
+  Handle(AIS_InteractiveContext) getAISContext() { return myAISContext; }
+
   bool      eventFilter(QObject* watched, QEvent* e);
 
   void      reset();
   void      Display(const TopoDS_Shape shape, const bool theShaded,
                     const QColor& shapeColor);
 
-private slots:
+  enum Mode2dType { No2dMode, XYPlane, XZPlane, YZPlane};
+
+  void       set2dMode( Mode2dType );
+  Mode2dType get2dMode() const { return my2dMode; }
+
+  QAction*   action( const ButtonsType& theId );
+
+public slots:
   void      onActivated();
   void      onTrihChanged();
   void      onFrontView();
@@ -52,6 +66,11 @@ private slots:
   void      onLeftView();
   void      onRightView();
 
+signals:
+  void      mouseMoving( QMouseEvent* theEvent );
+  void      mousePressed( QMouseEvent* theEvent );
+  void      mouseReleased( QMouseEvent* theEvent );
+
 private:
   enum OperationType{ NOTHING, FITALLVIEW, WINDOWFIT, ZOOMVIEW, PANVIEW, PANGLOBAL,
                       ROTATE };
@@ -76,8 +95,6 @@ private:
   bool setTransformRequested (OperationType op);
   void clearViewer(const bool theUpdate = true);
 
-  typedef enum { FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId, TrihId,
-                 FrontId, BackId, TopId, BottomId, LeftId, RightId, None } ButtonsType;
   typedef QMap<ButtonsType, QtxAction*> ActionsMap;
 
 private:
@@ -107,6 +124,9 @@ private:
   OCCViewer_ViewWindow::RotationPointType myCurrPointType;
   gp_Pnt                mySelectedPoint;
   bool                  myShowTrihedron;
+
+  Mode2dType            my2dMode;
+  bool                  myUseMultiAction;
 };
 
 #endif