15 class QwtPlotShapeItem;
17 class QwtPlotLegendItem;
110 explicit SimFigure(QWidget *parent =
nullptr);
113 int plot(QVector<double> &, QVector<double> &,
LineType lt = LineType::Solid, QColor col = Qt::red,
Marker mk =
Marker::None);
114 int scatter(QVector<double> &, QVector<double> &, QColor col = Qt::blue,
Marker mk = Marker::Circle);
120 void grid(
bool mayor=
true,
bool minor=
true);
122 void legend(QList<QString> labels,
Location loc=Location::South);
124 void showLegend(
bool =
true);
125 bool legendVisible(
void);
128 void clearSelection(
void);
139 void setXLabel(QString lbl);
140 void setYLabel(QString lbl);
141 void setXLim(
double xmin,
double xmax);
142 void setYLim(
double ymin,
double ymax);
145 void setXlimits(
double xmin,
double xmax) {setXLim(xmin,xmax);};
148 void setYlimits(
double ymin,
double ymax) {setYLim(ymin,ymax);};
149 void setLabelFontSize(
int);
150 void setTitle(QString title);
151 void setTitleFontSize(
int);
156 double minX() {
return m_xmin; };
160 double maxX() {
return m_xmax; };
164 double minY() {
return m_ymin; };
168 double maxY() {
return m_ymax; };
170 int lineWidth(
int ID);
171 void setLineWidth(
int ID,
int wd);
173 double lineWidthF(
int ID);
174 void setLineWidthF(
int ID,
double wd);
179 QColor lineColor(
int ID);
180 void setLineColor(
int ID, QColor color);
183 int markerSize(
int ID);
184 void setMarker(
int ID,
Marker mk,
int size=10);
190 void axisTypeChanged(
void);
193 void on_picker_activated (
bool on);
194 void on_picker_selected (
const QPolygon &polygon);
195 void on_picker_appended (
const QPoint &pos);
196 void on_picker_moved (
const QPoint &pos);
197 void on_picker_removed (
const QPoint &pos);
198 void on_picker_changed (
const QPolygon &selection);
199 void showAxisControls(
bool show);
203 void curve_selected(
int ID);
206 void select(QwtPlotItem *);
207 void setLineStyle(QwtPlotCurve *,
LineType lt);
208 void setLineColor(QwtPlotCurve *, QColor color);
209 void setMarker(QwtPlotCurve *curve,
Marker mk,
int size);
210 QwtPlotItem* itemAt(
const QPoint& pos )
const;
212 void refreshGrid(
void);
218 QwtPlotPicker *m_picker;
219 QwtPlotZoomer *m_zoomer =
nullptr;
220 QwtPlotLegendItem *m_legend;
221 QMap<QwtPlotCurve *, int> m_plotInvMap;
222 QMap<QwtPlotItem *, int> m_itemInvMap;
224 QVector<QwtPlotCurve *> m_curves;
227 double m_xmin = 1.e20;
228 double m_xmax = 1.e-20;
229 double m_ymin = 1.e20;
230 double m_ymax = 1.e-20;
232 double m_data_xmin = 1.e20;
233 double m_data_xmax = 1.e-20;
234 double m_data_ymin = 1.e20;
235 double m_data_ymax = 1.e-20;
241 QwtPlotItem *
object =
nullptr;
244 bool m_showMajorGrid =
true;
245 bool m_showMinorGrid =
true;
248 #endif // SIMFIGURE_H