37 #if QT_VERSION >= 0x040000
39 typedef QRectF QwtDoubleRect;
55 GuiPlot(QWidget *parent,
bool fixed_size=
false,
int width=_ARRAY_WIDGET_WIDTH_-20,
int height=_ARRAY_WIDGET_HEIGHT_-20);
58 void set_x_axis_label(
const char *xAxisLabel,
bool omit=
false);
59 void set_y_axis_label(
const char *yAxisLabelLeft,
const char *yAxisLabelRight=0);
61 long insert_curve(
bool use_right_y_axis=
false,
bool draw_spikes=
false,
bool baseline=
false);
63 long insert_marker(
const char* label,
double x,
bool outline=
false,
bool horizontal=
false,
bool animate=
false);
65 void remove_marker(
long id);
67 void set_marker_pos(
long id,
double x);
70 void set_curve_data(
long curveid,
const double* x,
const double* y,
int n,
bool symbol=
false);
76 void autoscale_y(
double& maxBound);
78 void rescale_y(
double maxBound);
82 void remove_markers();
84 double get_x(
int x_pixel)
const;
85 double get_y(
int y_pixel,
bool right_axes=
false)
const;
87 long closest_curve(
int x,
int y,
int& dist)
const;
89 void highlight_curve(
long id,
bool flag);
91 void set_x_axis_scale(
double lbound,
double ubound);
92 void set_y_axis_scale(
double lbound,
double ubound,
bool right_axes=
false);
94 void set_curve_pen(
long id,
const char* color,
int width=1);
96 void set_rect_outline_style();
97 void set_line_outline_style(
bool horizontal);
99 void enable_axes(
bool flag);
100 void enable_grid(
bool flag);
102 void print(QPainter* painter,
const QRect& rect)
const;
105 QWidget* get_widget();
108 void plotMousePressed(
const QMouseEvent&);
109 void plotMouseReleased(
const QMouseEvent&);
110 void plotMouseMoved(
const QMouseEvent&);
113 void emit_plotMousePressed(
const QMouseEvent& qme);
114 void emit_plotMouseReleased(
const QMouseEvent& qme);
115 void emit_plotMouseMoved(
const QMouseEvent& qme);
119 friend class GuiPlotPicker;
121 void set_axis_label(
int axisId,
const char* label,
bool omit,
int alignment);
125 GuiPlotPicker* picker;
129 QwtPlotCurve* get_curve(
long id);
130 QwtPlotMarker* get_marker(
long id);
134 STD_map<long,QwtPlotCurve*> curve_map;
135 STD_map<long,QwtPlotMarker*> marker_map;
137 QwtPlotGrid* plotgrid;
139 int canvas_framewidth;
141 long baseline_id_cache;
157 void set_range(
double min,
double max);
159 void set_value(
double newval);
161 QWidget* get_widget();
164 void valueChanged(
double);
167 void emit_valueChanged(
double newval);