toaPlot.h
1 /***************************************************************************
2  *
3  * Copyright (C) 2003 by Aidan Hotan
4  * Licensed under the Academic Free License version 2.1
5  *
6  ***************************************************************************/
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <vector>
10 
11 #include <qhbox.h>
12 #include <qpushbutton.h>
13 
14 #include "qpgplot.h"
15 
16 class wrapper {
17 
18  public:
19 
20  wrapper();
21 
22  double x;
23  double y;
24  double ex;
25  double ey;
26 
27  int ci;
28  int dot;
29 
30  int id;
31 };
32 
33 class toaPlot: public QPgplot {
34 
35  Q_OBJECT
36 
37  public:
38 
39  enum AxisQuantity { None, ResidualMicro, ResidualMilliTurns,
40  TOA_MJD, BinaryPhase, ObsFreq, DayOfYear,
41  ErrorMicro, SignalToNoise, Bandwidth,
42  DispersionMeasure, Duration, ParallacticAngle,
43  PointNumber };
44 
45  toaPlot ( QWidget *parent=0, const char *name=0 );
46 
47  // define pure virtual methods of QtPgplot base class
48  void plotter ();
49  void handleEvent (float x, float y, char ch);
50 
51  void setPoints (AxisQuantity, AxisQuantity, std::vector<wrapper>, bool, bool);
52 
53  public slots:
54 
55  void xzoomer ();
56  void yzoomer ();
57  void ptselector ();
58  void xselector ();
59  void yselector ();
60  void boxzoomer ();
61  void boxselector ();
62 
63  void autoscale ();
64  void autobin (int nbin = 10);
65 
66  signals:
67 
68  void selected (int);
69  void selected (std::vector<int>);
70  void ineednewdata ();
71 
72  protected:
73 
74  // Information about data display
75 
76  std::vector<wrapper> data;
77 
78  float xmin, xmax, ymin, ymax;
79  AxisQuantity xq, yq;
80 
81  bool logx;
82  bool logy;
83 
84  int mode;
85  int task;
86 
87  // Interactivity buffers
88  unsigned clicks;
89 
90  float x1;
91  float x2;
92  float y1;
93  float y2;
94 };
95 
96 
97 
98 
const ScalarMath pow(const ScalarMath &x, const ScalarMath &y)
const ScalarMath sqrt(const ScalarMath &x)

Generated using doxygen 1.8.17