Salome HOME
Copyright update 2022
[modules/gui.git] / src / GraphicsView / GraphicsView_ViewPort.h
index 7617e347b73699fa2a3bc092b0dffe4b7aa9479f..913f1f3e0359201142dc46bf4f8f9f7b8b76ed2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -25,6 +25,7 @@
 #include "GraphicsView_Defs.h"
 
 #include <QGraphicsView>
+#include <QPainterPath>
 
 class QGridLayout;
 class QRubberBand;
@@ -55,7 +56,9 @@ public:
     DraggingByMiddleButton = 0x0010,
     ImmediateContextMenu   = 0x0020,
     ImmediateSelection     = 0x0040,
-    Sketching              = 0x0080
+    Sketching              = 0x0080,
+
+    GlobalWheelScaling     = 0x0100
   };
   Q_DECLARE_FLAGS( InteractionFlags, InteractionFlag )
 
@@ -94,7 +97,7 @@ public:
   QImage                           dumpView( bool theWholeScene = false,
                                              QSizeF theSize = QSizeF() );
 
-  bool                             dumpViewToPSFormat(const QString& fileName);
+  bool                             dumpViewToFormat(const QString& fileName, const QString& format);
 
 public:
   // scene
@@ -161,6 +164,12 @@ public:
 
   void                             applyTransform();
 
+  int                              zoomCoeff() const { return myZoomCoeff; }
+  void                             setZoomCoeff( const int& theZoomCoeff );
+
+  bool                             isUnlimitedPanning() const { return myUnlimitedPanning; }
+  void                             setUnlimitedPanning( const bool& theValue );
+
   // block status
   BlockStatus                      currentBlock();
 
@@ -202,6 +211,9 @@ public:
   // dragging
   bool                             isDragging() { return myIsDragging; }
 
+  bool                             isDraggingSelectedByLeftButton() const { return myDraggingSelectedByLeftButton; }
+  void                             setDraggingSelectedByLeftButton( const bool& theValue );
+
   // pulling
   bool                             startPulling( const QPointF& );
   void                             drawPulling( const QPointF& );
@@ -297,6 +309,10 @@ private:
   bool                             myIsTransforming;
   QTransform                       myCurrentTransform;
 
+  bool                             myUnlimitedPanning;
+  Qt::ScrollBarPolicy              myHBarPolicy;
+  Qt::ScrollBarPolicy              myVBarPolicy;
+
   // highlighting
   GraphicsView_Object*             myHighlightedObject;
   double                           myHighlightX;
@@ -324,6 +340,7 @@ private:
   int                              myIsDragging;
   QPointF                          myDragPosition;
   bool                             myIsDragPositionInitialized;
+  bool                             myDraggingSelectedByLeftButton;
 
   // pulling
   bool                             myIsPulling;
@@ -331,6 +348,9 @@ private:
 
   // cursor
   QCursor                          myStoredCursor;
+
+  // zoom diagonal coefficient
+  int                              myZoomCoeff;
 };
 
 Q_DECLARE_OPERATORS_FOR_FLAGS( GraphicsView_ViewPort::InteractionFlags )