Salome HOME
updated copyright message
[modules/gui.git] / src / GraphicsView / GraphicsView_ViewPort.h
index 518598dd4f2f8b7ea117003d9818c85887257076..f6f0b1339a2812a992bf8f03b3c095dc713b22c4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2023  CEA, EDF, 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 )
 
@@ -84,6 +87,7 @@ public:
   void                             addItem( QGraphicsItem* theItem );
   bool                             isItemAdded( QGraphicsItem* theItem );
   void                             removeItem( QGraphicsItem* theItem );
+  void                             clearItems();
 
   enum SortType { NoSorting, SelectedFirst, SortByZLevel };
   GraphicsView_ObjectList          getObjects( SortType theSortType = NoSorting ) const;
@@ -93,6 +97,8 @@ public:
   QImage                           dumpView( bool theWholeScene = false,
                                              QSizeF theSize = QSizeF() );
 
+  bool                             dumpViewToFormat(const QString& fileName, const QString& format);
+
 public:
   // scene
   void                             setSceneGap( double theSceneGap );
@@ -158,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();
 
@@ -199,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& );
@@ -294,6 +309,10 @@ private:
   bool                             myIsTransforming;
   QTransform                       myCurrentTransform;
 
+  bool                             myUnlimitedPanning;
+  Qt::ScrollBarPolicy              myHBarPolicy;
+  Qt::ScrollBarPolicy              myVBarPolicy;
+
   // highlighting
   GraphicsView_Object*             myHighlightedObject;
   double                           myHighlightX;
@@ -321,6 +340,7 @@ private:
   int                              myIsDragging;
   QPointF                          myDragPosition;
   bool                             myIsDragPositionInitialized;
+  bool                             myDraggingSelectedByLeftButton;
 
   // pulling
   bool                             myIsPulling;
@@ -328,6 +348,9 @@ private:
 
   // cursor
   QCursor                          myStoredCursor;
+
+  // zoom diagonal coefficient
+  int                              myZoomCoeff;
 };
 
 Q_DECLARE_OPERATORS_FOR_FLAGS( GraphicsView_ViewPort::InteractionFlags )