GEMC  2.3
Geant4 Monte-Carlo Framework
graph.h
Go to the documentation of this file.
1 #ifndef graph_H
2 #define graph_H 1
3 
4 // Qt headers
5 #include <QtWidgets>
6 
7 // C++ headers
8 #include <string>
9 using namespace std;
10 
11 
12 // Class definition
13 class graph : public QGraphicsView
14 {
15  // metaobject required for non-qt slots
16  Q_OBJECT
17 
18  public:
19  graph(QWidget *parent = 0);
20  ~graph(){;}
21 
22  QGraphicsScene *scene;
23 
24  int xorig, yorig; // origin of the axis
25  int xaxil, yaxil; // axis length
26  int nticksx, nticksy;
27 
28  double xmin, ymin; // graph minima
29  double xmax, ymax; // graph maxima
30  double dx, dy; // data deltas
31  int fixedAxis; // if 1, limits are provided by user
32 
33  double inside; // how much inside the ticks line will be
34  double DX, DY; // graph deltas
35 
36  double axisPenWidth, dataPenWidth;
37 
38  void setAxis(int a, int b, int c, int d, int e, int f){xorig = a; yorig = b; xaxil = c; yaxil = d; nticksx = e; nticksy=f;}
39  void setInside(double a, double b, double c){inside = a; DX = xaxil-a*b; DY = yaxil-a*c;}
40  void setDataAxisLimits(vector<double>, vector<double>);
41  void setPensWidth(int a, int b){axisPenWidth = a; dataPenWidth = b;}
42  void setFixedAxis(int xmi, int xma, int ymi, int yma);
43 
44  map<int, QPen> pcolors;
45 
46  void plots_bg(string xtit, string ytit, vector<double> x, vector<double> y, string title); // draw axis, ticks and labels
47  void plot_graph(vector<double> x, vector<double> y, vector<int> pid);
48  void plotLabel(string, int, double, double, int);
49 
50 };
51 
52 
53 #endif
int yaxil
Definition: graph.h:25
double DY
Definition: graph.h:34
QGraphicsScene * scene
Definition: graph.h:22
STL namespace.
double dataPenWidth
Definition: graph.h:36
double ymax
Definition: graph.h:29
void setAxis(int a, int b, int c, int d, int e, int f)
Definition: graph.h:38
void setInside(double a, double b, double c)
Definition: graph.h:39
double inside
Definition: graph.h:33
int fixedAxis
Definition: graph.h:31
~graph()
Definition: graph.h:20
Definition: graph.h:13
map< int, QPen > pcolors
Definition: graph.h:44
int yorig
Definition: graph.h:24
double dy
Definition: graph.h:30
double ymin
Definition: graph.h:28
int nticksy
Definition: graph.h:26
void setPensWidth(int a, int b)
Definition: graph.h:41