ATLAS Offline Software
Loading...
Searching...
No Matches
VP1EventDisplaySceneView.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*
6 * jira_1
7 * VP1EventDisplaySceneView.h
8 *
9 * Created on: Sep 26, 2013
10 * Author: rbianchi <Riccardo.Maria.Bianchi@cern.ch>
11 *
12 */
13
14#ifndef VP1EVENTDISPLAYSCENEVIEW_H_
15#define VP1EVENTDISPLAYSCENEVIEW_H_
16
17
18#if __GNUC__ >= 14
19// suppress warning seen in qfutureinterface.h
20# pragma GCC diagnostic push
21# pragma GCC diagnostic ignored "-Wtemplate-id-cdtor"
22#endif
23#include <QtGui>
24#if __GNUC__ >= 14
25# pragma GCC diagnostic pop
26#endif
27#include <QFrame>
28#include <QHBoxLayout>
29#include <QVBoxLayout>
30#include <QGraphicsView>
31
32QT_FORWARD_DECLARE_CLASS(QLabel)
33QT_FORWARD_DECLARE_CLASS(QSlider)
34QT_FORWARD_DECLARE_CLASS(QToolButton)
35
37
38
39/*
40 * we create a new class inheriting from QGraphicsView,
41 * to reimplement the wheel event in order to use the wheel
42 * to zoom the image, when used over the zoom sliders
43 */
44class GraphicsView : public QGraphicsView
45{
46 Q_OBJECT
47public:
48 GraphicsView(VP1EventDisplaySceneView *v) : QGraphicsView(), m_view(v) { }
49
50protected:
51 void wheelEvent(QWheelEvent *);
52
53private:
55};
56
57
58
59/*
60 * The QFrame which contains the graphicsView and all other widgets.
61 *
62 * If the 'preview' argument is set to true, then a 'preview' view is built
63 * without rotation sliders and the zoom set to see the whole scene.
64 */
65class VP1EventDisplaySceneView : public QFrame
66{
67 Q_OBJECT
68public:
69 VP1EventDisplaySceneView(const QString &name, bool preview = false, QWidget *parent = 0);
71
72 QGraphicsView *view() const;
73 void setPreviewZoom(qreal xx);
74 void addRenderingFrame();
75 void showRenderingFrame();
76 void hideRenderingFrame();
77
78 public Q_SLOTS:
79 void zoomIn(int level = 1);
80 void zoomOut(int level = 1);
81 void print();
82
83 private Q_SLOTS:
84 void resetView();
86 void setupMatrix();
87 void togglePointerMode();
88 void toggleOpenGL();
89 void toggleAntialiasing();
90 void rotateLeft();
91 void rotateRight();
92
93 private:
95
97
98 QGraphicsRectItem* m_frame;
99 QGraphicsLineItem * m_line;
100
101 QLabel *m_label;
102 QLabel *m_label2;
103
104 QToolButton *m_selectModeButton;
105 QToolButton *m_dragModeButton;
106 QToolButton *m_openGlButton;
107 QToolButton *m_antialiasButton;
108 QToolButton *m_printButton;
109 QToolButton *m_resetButton;
110
111 QVBoxLayout *m_zoomSliderLayout;
112 QSlider *m_zoomSlider;
113 QToolButton *m_zoomInIcon;
114 QToolButton *m_zoomOutIcon;
115
118 QToolButton *m_rotateLeftIcon;
119 QToolButton *m_rotateRightIcon;
120
121};
122
123
124#endif /* VP1EVENTDISPLAYSCENEVIEW_H_ */
void wheelEvent(QWheelEvent *)
VP1EventDisplaySceneView * m_view
GraphicsView(VP1EventDisplaySceneView *v)
VP1EventDisplaySceneView(const QString &name, bool preview=false, QWidget *parent=0)