23 #include <odinpara/ldrtypes.h>
24 #include <odinpara/ldrnumbers.h>
26 #include <odinqt/plot.h>
27 #include <odinqt/ldrwidget.h>
29 #include <odinseq/seqplot.h>
31 #include "odinplot_vtk.h"
34 #define MIN_HEIGHT_PER_CHAN 120
35 #define MIN_WIDTH_PER_CHAN 1000
37 #define CLOSEST_CURVE_MAX 30
38 #define PLOT_SYMBOLS_MAX_RANGE 10
39 #define MAX_HIGHRES_INTERVAL 1000.0
40 #define MAX_MARKER_INTERVAL 400.0
41 #define MAX_START_RANGE 10000
43 #define MAGN_PLOT_PAGE_DURATION 20.0
50 class PlotView :
public QWidget,
public SeqSimFeedbackAbstract {
55 PlotView(
const char* method,
const STD_string& nucleus,
GuiMainWindow* parent);
62 bool simulate(
const STD_string& fidfile,
const STD_string& samplefile,
ProgressMeter* progmeter);
70 void mouseMovedInPlot0(
const QMouseEvent& e) {mouseMovedInPlot(0,e);}
71 void mouseMovedInPlot1(
const QMouseEvent& e) {mouseMovedInPlot(1,e);}
72 void mouseMovedInPlot2(
const QMouseEvent& e) {mouseMovedInPlot(2,e);}
73 void mouseMovedInPlot3(
const QMouseEvent& e) {mouseMovedInPlot(3,e);}
74 void mouseMovedInPlot4(
const QMouseEvent& e) {mouseMovedInPlot(4,e);}
75 void mouseMovedInPlot5(
const QMouseEvent& e) {mouseMovedInPlot(5,e);}
76 void mouseMovedInPlot6(
const QMouseEvent& e) {mouseMovedInPlot(6,e);}
77 void mouseMovedInPlot7(
const QMouseEvent& e) {mouseMovedInPlot(7,e);}
78 void mouseMovedInPlot8(
const QMouseEvent& e) {mouseMovedInPlot(8,e);}
80 void mousePressedInPlot0(
const QMouseEvent& e) {mousePressedInPlot(0,e);}
81 void mousePressedInPlot1(
const QMouseEvent& e) {mousePressedInPlot(1,e);}
82 void mousePressedInPlot2(
const QMouseEvent& e) {mousePressedInPlot(2,e);}
83 void mousePressedInPlot3(
const QMouseEvent& e) {mousePressedInPlot(3,e);}
84 void mousePressedInPlot4(
const QMouseEvent& e) {mousePressedInPlot(4,e);}
85 void mousePressedInPlot5(
const QMouseEvent& e) {mousePressedInPlot(5,e);}
86 void mousePressedInPlot6(
const QMouseEvent& e) {mousePressedInPlot(6,e);}
87 void mousePressedInPlot7(
const QMouseEvent& e) {mousePressedInPlot(7,e);}
88 void mousePressedInPlot8(
const QMouseEvent& e) {mousePressedInPlot(8,e);}
90 void mouseReleasedInPlot0(
const QMouseEvent& e) {mouseReleasedInPlot(0,e);}
91 void mouseReleasedInPlot1(
const QMouseEvent& e) {mouseReleasedInPlot(1,e);}
92 void mouseReleasedInPlot2(
const QMouseEvent& e) {mouseReleasedInPlot(2,e);}
93 void mouseReleasedInPlot3(
const QMouseEvent& e) {mouseReleasedInPlot(3,e);}
94 void mouseReleasedInPlot4(
const QMouseEvent& e) {mouseReleasedInPlot(4,e);}
95 void mouseReleasedInPlot5(
const QMouseEvent& e) {mouseReleasedInPlot(5,e);}
96 void mouseReleasedInPlot6(
const QMouseEvent& e) {mouseReleasedInPlot(6,e);}
97 void mouseReleasedInPlot7(
const QMouseEvent& e) {mouseReleasedInPlot(7,e);}
98 void mouseReleasedInPlot8(
const QMouseEvent& e) {mouseReleasedInPlot(8,e);}
100 void autoscalePlot0() {autoscale_y(0);}
101 void autoscalePlot1() {autoscale_y(1);}
102 void autoscalePlot2() {autoscale_y(2);}
103 void autoscalePlot3() {autoscale_y(3);}
104 void autoscalePlot4() {autoscale_y(4);}
105 void autoscalePlot5() {autoscale_y(5);}
106 void autoscalePlot6() {autoscale_y(6);}
107 void autoscalePlot7() {autoscale_y(7);}
108 void autoscalePlot8() {autoscale_y(8);}
110 void rescalePlot0(
double val) {rescale_y(0,val);}
111 void rescalePlot1(
double val) {rescale_y(1,val);}
112 void rescalePlot2(
double val) {rescale_y(2,val);}
113 void rescalePlot3(
double val) {rescale_y(3,val);}
114 void rescalePlot4(
double val) {rescale_y(4,val);}
115 void rescalePlot5(
double val) {rescale_y(5,val);}
116 void rescalePlot6(
double val) {rescale_y(6,val);}
117 void rescalePlot7(
double val) {rescale_y(7,val);}
118 void rescalePlot8(
double val) {rescale_y(8,val);}
121 void update_x_axes();
125 void hide_and_show();
127 void set_rect_zoom_tool() {set_zoom_tool(rect);}
128 void set_hort_zoom_tool() {set_zoom_tool(horizontal);}
129 void set_vert_zoom_tool() {set_zoom_tool(vertical);}
132 void change_toolbar();
145 void changeMode(
int newmode);
147 void settingsChanged();
149 void save_closest_curve_data();
150 void save_current_channel_data();
153 void setMessage(
const char* text);
158 friend class PlotWindow;
161 double get_x(
int iplot,
int x_pixel);
162 double get_y(
int iplot,
int y_pixel);
165 void mouseMovedInPlot (
int iplot,
const QMouseEvent& e);
166 void mousePressedInPlot (
int iplot,
const QMouseEvent& e);
167 void mouseReleasedInPlot(
int iplot,
const QMouseEvent& e);
169 void set_range_and_update_x_axes(
double min,
double max,
bool discard_scrollbar=
false);
171 void autoscale_all_y();
172 void autoscale_y(
int iplot);
173 void rescale_y(
int iplot,
double val);
176 void get_plot_label(
int iplot, STD_string& label, STD_string& unit)
const;
177 void set_plot_labels(
bool extra_space=
false);
179 void set_curve_pens(
bool thick_lines=
false);
181 void create_baseline();
183 void add_plotcurve(
const Curve4Qwt& curve);
184 void create_plotcurves();
188 void create_markers();
190 void create_plotcurves_and_markers();
193 bool create_timecourses(timecourseMode type);
195 void create_timecourse_markers();
197 void plot_timecourses(timecourseMode type);
206 int plot_pressed,x_pressed,y_pressed;
208 static int lastplot_old;
210 double baseline_x[2];
211 double baseline_y[2];
212 long curveid_baseline[numof_plotchan];
216 int lastplot_closest;
217 int lastcurve_closest;
227 timecourseMode oldmode;
231 GuiPlot* plotter[numof_plotchan];
241 RangeWidget* x_range;
249 enum zoomMode {rect=0, horizontal, vertical, numof_zoomModes};
251 void set_zoom_tool(zoomMode mode);
255 long markid_vertzoom;
256 long markid_hortzoom;
259 STD_map<long,Curve4Qwt> curves_map[numof_plotchan];
261 long timecourse_curve_id[numof_tcmodes][numof_plotchan];
270 VtkMagnPlotter* active_magplot;
273 void plot_vector(
double timepoint,
float M[3],
float* dM);
283 PlotWindow(
const char* method,
const STD_string& nucleus, QWidget *parent);
289 bool simulate(
const STD_string& fidfile,
const STD_string& samplefile,
ProgressMeter* progmeter) {
return view->simulate(fidfile,samplefile,progmeter);}
292 void statusBarMessage(
const char* text);