-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
iCanvas.h
154 lines (133 loc) · 4.29 KB
/
iCanvas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#ifndef ICANVAS_H
#define ICANVAS_H
// File modified by Deepak Samuel on 25 Sep 2019
#include <TCanvas.h>
#include <QWidget>
#include <TH1F.h>
#include <TVirtualX.h>
#include <TRootCanvas.h>
#include <TCanvas.h>
#include <TVirtualX.h>
#include <TSystem.h>
#include <TApplication.h>
#include <TFormula.h>
#include <TFrame.h>
#include <TTimer.h>
#include <QDebug>
#include <QPushButton>
#include <QLayout>
#include <QTimer>
#include <QPaintEvent>
#include <QResizeEvent>
#include <QMouseEvent>
#include <QShowEvent>
#include <QColorDialog>
#include <QIcon>
#include <QApplication>
#include <QClipboard>
#include <QMenu>
#include <TClass.h>
#include <TList.h>
#include <TApplication.h>
#include <TMethodCall.h>
#include <TDataMember.h>
#include <TMethodCall.h>
class QPaintEvent;
class QResizeEvent;
class QMouseEvent;
class QPushButton;
class QTimer;
class TCanvas;
class TRootCanvas;
class iCanvas : public QWidget
{
Q_OBJECT
public:
explicit iCanvas(QWidget *parent = 0);
static int canvasN;
virtual ~iCanvas()
{
delete fCanvas;
delete fRootTimer;
// delete colorDialog;
}
TCanvas* GetCanvas() {return fCanvas;}
TVirtualPad* GetPad(int n){return fCanvas->GetPad(n);}
void cd(int n);
void SavePlot(QString filename, QString extension);
bool closed; // flag to indicate that the canvas is closed
void Refresh();
void CheckAvailableMethods(TObject* obj);
void HighlightObject(QString objectName);
int GetLineColor(TObject *object);
int GetMarkerColor(TObject *object);
QStringList GetListofFittableObjects();
protected:
TCanvas *fCanvas;
QTimer *fRootTimer;
QMenu *canvasMenu;
QMenu *markerStylesMenu;
QMenu *lineStylesMenu;
QMenu *lineSizeMenu;
QMenu *markerSizeMenu;
QMenu *fillStylesMenu;
static QColorDialog *colorDialog;
static QStringList markerNames;
static QStringList lineNames;
static QStringList fillNames;
static bool logX;
static bool logY;
static bool gridX;
static bool gridY;
bool disableMenus;
static bool highlight;
signals:
public slots:
void HandleRootEvents();
virtual void mouseMoveEvent( QMouseEvent *e );
virtual void mousePressEvent( QMouseEvent *e );
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void mouseReleaseEvent( QMouseEvent *e );
virtual void wheelEvent(QWheelEvent *e);
virtual void paintEvent( QPaintEvent *e );
virtual void resizeEvent( QResizeEvent *e );
// void showFitModule();
void showLineColorDialog();
void showFillColorDialog();
void showMarkerColorDialog();
void setColor(QColor color);
void setMarker();
void setMarkerSize();
void setLineSize();
void setLineStyle();
void setFillStyle();
void setLogX(bool val);
void setLogY(bool val);
void setGridX(bool val);
void setGridY(bool val);
void Highlight(QString objectId);
virtual void closeEvent(QCloseEvent *);
void copyPad();
private:
TObject* lastObject;// object where the menu was executed
TObject* highlightObject;
QString colorMethod;// string to tell which method is to be executed: SetLineColor, SetFillColor..
QAction* objectNameAction;
QAction* copytoClipBoardAction;
// QAction* fitAction;
QAction* lineColorAction;
QAction* fillColorAction;
QAction* fillStyleAction;
QAction* markerColorAction;
QAction* markerStyleAction;
QAction* lineStyleAction;
QAction* markerSizeAction;
QAction* lineSizeAction;
// QAction* fontStyleAction;
QAction* enableLogX;
QAction* enableLogY;
QAction* enableGridX;
QAction* enableGridY;
int timerEventN;
};
#endif // ICANVAS_H