ATLAS Offline Software
Loading...
Searching...
No Matches
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
22class VP1GraphicsView : public QGraphicsView {
23
24 Q_OBJECT
25
26public:
27
32
33 VP1GraphicsView ( QWidget * parent = 0 );
34 VP1GraphicsView ( QGraphicsScene * scene, QWidget * parent = 0 );
35
36 //Get interaction mode:
38 Mode mode() const;
39
40public 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
79public:
80 virtual ~VP1GraphicsView();
81
82protected:
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 );
93private:
94
95 class Imp;
97 class HighLightItem;
98 friend class HighLightItem;
100
101private Q_SLOTS:
102 void updateZoomAnimation();
103};
104
105#endif
void setMode(const Mode &)
void keyPressEvent(QKeyEvent *)
VP1GraphicsView(QWidget *parent=0)
void mouseReleaseEvent(QMouseEvent *)
void setAnimatedZoomSteps(int)
void setZoomFactorOnSeek(double)
void addItemCollection(VP1GraphicsItemCollection *)
void setDisallowMovable(VP1GraphicsItemCollection *, const bool &disallow=true)
void drawItems(QPainter *painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[])
void mouseMoveEvent(QMouseEvent *)
void initiateAnimatedZoomTo(QRectF)
void drawForeground(QPainter *painter, const QRectF &rect)
void removeItemCollection(VP1GraphicsItemCollection *)
void mousePressEvent(QMouseEvent *)
void mouseDoubleClickEvent(QMouseEvent *event)
void seekToPoint(QPointF)
void emitSelectionChanged(VP1GraphicsItemCollection *)
void scaleView(qreal scaleFactor)
void setDisallowInteractions(VP1GraphicsItemCollection *, const bool &disallow=true)
void wheelEvent(QWheelEvent *)
void setAnimatedZoomTime(double)