ATLAS Offline Software
VP1GraphicsView.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // Header file for class VP1GraphicsView //
8 // //
9 // Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
10 // //
11 // Initial version: April 2007 //
12 // //
14 
15 #ifndef VP1GRAPHICSVIEW_H
16 #define VP1GRAPHICSVIEW_H
17 
18 #include <QGraphicsView>
19 
21 
22 class VP1GraphicsView : public QGraphicsView {
23 
24  Q_OBJECT
25 
26 public:
27 
32 
33  VP1GraphicsView ( QWidget * parent = 0 );
34  VP1GraphicsView ( QGraphicsScene * scene, QWidget * parent = 0 );
35 
36  //Get interaction mode:
38  Mode mode() const;
39 
40 public Q_SLOTS:
41 
42  //What collections to show:
45 
46  //Set interaction mode for the view:
47  void setMode(const Mode&);
48 
49  //Potentially limit the interactive capabilities of given itemcollections:
50  void setDisallowInteractions(VP1GraphicsItemCollection*, const bool& disallow=true );//If true, the ic will act as INERT
51  void setDisallowMovable(VP1GraphicsItemCollection*, const bool& disallow=true );//If true, items will never be movable.
52 
53  //Zoom:
54  void scaleView(qreal scaleFactor);
55  void fitViewToContents();
56  void viewHome();
57  void setHome();
58 
59  //Animated zoom:
60  void initiateAnimatedZoomTo(QRectF);
61  void setAnimatedZoomSteps(int);
62  void setAnimatedZoomTime(double);//ms
63  void setZoomFactorOnSeek(double);
64  void abortZoomAnimation();
65  void seekToPoint(QPointF);
66 
67  //Selections:
68  void clearSelections();
69 
70  //Print:
71  void print();
72  void saveImage();
73 
78 
79 public:
80  virtual ~VP1GraphicsView();
81 
82 protected:
83  void keyPressEvent(QKeyEvent *);
84  void wheelEvent(QWheelEvent *);
85  void mouseDoubleClickEvent(QMouseEvent * event);
86  void mousePressEvent(QMouseEvent *);
87  void mouseReleaseEvent(QMouseEvent *);
88  void mouseMoveEvent(QMouseEvent *);
89  void drawItems(QPainter *painter, int numItems,
90  QGraphicsItem *items[],
91  const QStyleOptionGraphicsItem options[]);
92  void drawForeground ( QPainter * painter, const QRectF & rect );
93 private:
94 
95  class Imp;
96  Imp * m_d;
97  class HighLightItem;
98  friend class HighLightItem;
100 
101 private Q_SLOTS:
102  void updateZoomAnimation();
103 };
104 
105 #endif
VP1GraphicsView::clearSelections
void clearSelections()
Definition: VP1GraphicsView.cxx:673
VP1GraphicsView::updateZoomAnimation
void updateZoomAnimation()
Definition: VP1GraphicsView.cxx:812
VP1GraphicsView::DRAGZOOMHOLD
@ DRAGZOOMHOLD
Definition: VP1GraphicsView.h:37
VP1GraphicsView::drawForeground
void drawForeground(QPainter *painter, const QRectF &rect)
Definition: VP1GraphicsView.cxx:987
VP1GraphicsView::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *)
Definition: VP1GraphicsView.cxx:432
VP1GraphicsView::setAnimatedZoomSteps
void setAnimatedZoomSteps(int)
Definition: VP1GraphicsView.cxx:842
VP1GraphicsView::DRAGZOOM
@ DRAGZOOM
Definition: VP1GraphicsView.h:37
VP1GraphicsView::abortZoomAnimation
void abortZoomAnimation()
Definition: VP1GraphicsView.cxx:825
VP1GraphicsView::drawItems
void drawItems(QPainter *painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[])
Definition: VP1GraphicsView.cxx:1091
VP1GraphicsView::mousePressEvent
void mousePressEvent(QMouseEvent *)
Definition: VP1GraphicsView.cxx:462
VP1GraphicsView::setHome
void setHome()
Definition: VP1GraphicsView.cxx:887
VP1GraphicsView::~VP1GraphicsView
virtual ~VP1GraphicsView()
Definition: VP1GraphicsView.cxx:203
VP1GraphicsView::m_d
Imp * m_d
Definition: VP1GraphicsView.h:95
VP1GraphicsView::keyPressEvent
void keyPressEvent(QKeyEvent *)
Definition: VP1GraphicsView.cxx:244
VP1GraphicsView::PICK
@ PICK
Definition: VP1GraphicsView.h:37
VP1GraphicsView::VP1GraphicsView
VP1GraphicsView(QWidget *parent=0)
Definition: VP1GraphicsView.cxx:135
VP1GraphicsView::SEEK
@ SEEK
Definition: VP1GraphicsView.h:37
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
VP1GraphicsView::addItemCollection
void addItemCollection(VP1GraphicsItemCollection *)
Definition: VP1GraphicsView.cxx:380
VP1GraphicsView::fitViewToContents
void fitViewToContents()
Definition: VP1GraphicsView.cxx:220
VP1GraphicsView::Imp
Definition: VP1GraphicsView.cxx:61
VP1GraphicsView::setDisallowMovable
void setDisallowMovable(VP1GraphicsItemCollection *, const bool &disallow=true)
Definition: VP1GraphicsView.cxx:918
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP1GraphicsView::wheelEvent
void wheelEvent(QWheelEvent *)
Definition: VP1GraphicsView.cxx:229
VP1GraphicsView::emitSelectionChanged
void emitSelectionChanged(VP1GraphicsItemCollection *)
Definition: VP1GraphicsView.cxx:892
python.AtlRunQueryLib.options
options
Definition: AtlRunQueryLib.py:379
VP1GraphicsView::setMode
void setMode(const Mode &)
Definition: VP1GraphicsView.cxx:319
VP1GraphicsView::setDisallowInteractions
void setDisallowInteractions(VP1GraphicsItemCollection *, const bool &disallow=true)
Definition: VP1GraphicsView.cxx:901
VP1GraphicsView::saveImage
void saveImage()
Definition: VP1GraphicsView.cxx:947
VP1GraphicsView::removeItemCollection
void removeItemCollection(VP1GraphicsItemCollection *)
Definition: VP1GraphicsView.cxx:393
VP1GraphicsView::mode
Mode mode() const
Definition: VP1GraphicsView.cxx:374
VP1GraphicsView::viewHome
void viewHome()
Definition: VP1GraphicsView.cxx:865
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
VP1GraphicsView::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *)
Definition: VP1GraphicsView.cxx:559
VP1GraphicsView::setZoomFactorOnSeek
void setZoomFactorOnSeek(double)
Definition: VP1GraphicsView.cxx:859
VP1GraphicsView::mouseDoubleClickEvent
void mouseDoubleClickEvent(QMouseEvent *event)
Definition: VP1GraphicsView.cxx:406
VP1GraphicsView::Mode
Mode
Definition: VP1GraphicsView.h:37
VP1GraphicsView::HighLightItem
Definition: VP1GraphicsView.cxx:122
VP1GraphicsView::setAnimatedZoomTime
void setAnimatedZoomTime(double)
Definition: VP1GraphicsView.cxx:851
VP1GraphicsItemCollection
Definition: VP1GraphicsItemCollection.h:53
VP1GraphicsView::initiateAnimatedZoomTo
void initiateAnimatedZoomTo(QRectF)
Definition: VP1GraphicsView.cxx:780
VP1GraphicsView::seekToPoint
void seekToPoint(QPointF)
Definition: VP1GraphicsView.cxx:770
VP1GraphicsView
Definition: VP1GraphicsView.h:22
VP1GraphicsView::CHANGEVIEW
@ CHANGEVIEW
Definition: VP1GraphicsView.h:37
VP1GraphicsView::scaleView
void scaleView(qreal scaleFactor)
Definition: VP1GraphicsView.cxx:210
VP1GraphicsView::print
void print()
Definition: VP1GraphicsView.cxx:935