UPlot.h
Go to the documentation of this file.
1 // Taken from UtiLite library r186 [www.utilite.googlecode.com]
2 
3 /*
4 * utilite is a cross-platform library with
5 * useful utilities for fast and small developing.
6 * Copyright (C) 2010 Mathieu Labbe
7 *
8 * utilite is free library: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * utilite is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef UPLOT_H_
23 #define UPLOT_H_
24 
25 //#include "utilite/UtiLiteExp.h" // DLL export/import defines
26 
27 #include <QFrame>
28 #include <QtCore/QList>
29 #include <QtCore/QMap>
30 #include <QtGui/QPen>
31 #include <QtGui/QBrush>
32 #include <QGraphicsEllipseItem>
33 #include <QtCore/QMutex>
34 #include <QLabel>
35 #include <QPushButton>
36 #include <QtCore/QTime>
37 
38 class QGraphicsView;
39 class QGraphicsScene;
40 class QGraphicsItem;
41 class QFormLayout;
42 
47 class UPlotItem : public QGraphicsEllipseItem
48 {
49 public:
53  UPlotItem(qreal dataX, qreal dataY, qreal width=2);
57  UPlotItem(const QPointF & data, qreal width=2);
58  virtual ~UPlotItem();
59 
60 public:
63  void setData(const QPointF & data);
64 
65  UPlotItem * nextItem() const {return _nextItem;}
66  UPlotItem * previousItem() const {return _previousItem;};
67  const QPointF & data() const {return _data;}
68 
69 protected:
70  virtual void hoverEnterEvent(QGraphicsSceneHoverEvent * event);
71  virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent * event);
72  virtual void focusInEvent(QFocusEvent * event);
73  virtual void focusOutEvent(QFocusEvent * event);
74  virtual void keyReleaseEvent(QKeyEvent * keyEvent);
75 
76  virtual void showDescription(bool shown);
77 
78 private:
79  QPointF _data;
80  QGraphicsTextItem * _text;
83 };
84 
85 class UPlot;
86 
90 class UPlotCurve : public QObject
91 {
92  Q_OBJECT
93 
94 public:
98  UPlotCurve(const QString & name, QObject * parent = 0);
102  UPlotCurve(const QString & name, const QVector<UPlotItem *> data, QObject * parent = 0);
106  UPlotCurve(const QString & name, const QVector<float> & x, const QVector<float> & y, QObject * parent = 0);
107  virtual ~UPlotCurve();
108 
112  const QPen & pen() const {return _pen;}
116  const QBrush & brush() const {return _brush;}
117 
121  void setPen(const QPen & pen);
125  void setBrush(const QBrush & brush);
126 
130  QString name() const {return _name;}
134  int itemsSize() const;
135  QPointF getItemData(int index);
136  bool isVisible() const {return _visible;}
137  void setData(QVector<UPlotItem*> & data); // take the ownership
138  void setData(const QVector<float> & x, const QVector<float> & y);
139  void setData(const std::vector<float> & x, const std::vector<float> & y);
140  void setData(const QVector<float> & y);
141  void setData(const std::vector<float> & y);
142  void getData(QVector<float> & x, QVector<float> & y) const; // only call in Qt MainThread
143  void draw(QPainter * painter);
144 
145 public Q_SLOTS:
150  virtual void clear();
155  void setVisible(bool visible);
160  void setXIncrement(float increment);
165  void setXStart(float val);
170  void addValue(UPlotItem * data); // take the ownership
176  void addValue(float y);
181  void addValue(float x, float y);
188  void addValue(const QString & y);
194  void addValues(QVector<UPlotItem *> & data); // take the ownership
199  void addValues(const QVector<float> & xs, const QVector<float> & ys);
205  void addValues(const QVector<float> & ys);
206  void addValues(const QVector<int> & ys); // for convenience
212  void addValues(const std::vector<float> & ys); // for convenience
213  void addValues(const std::vector<int> & ys); // for convenience
214 
215 Q_SIGNALS:
220  void dataChanged(const UPlotCurve *);
221 
222 protected:
223  friend class UPlot;
224  void attach(UPlot * plot);
225  void detach(UPlot * plot);
226  void updateMinMax();
227  const QVector<float> & getMinMax() const {return _minMax;}
228  int removeItem(int index);
229  void _addValue(UPlotItem * data);;
230  virtual bool isMinMaxValid() const {return _minMax.size();}
231  virtual void update(float scaleX, float scaleY, float offsetX, float offsetY, float xDir, float yDir, bool allDataKept);
232  QList<QGraphicsItem *> _items;
234 
235 private:
236  void removeItem(UPlotItem * item);
237 
238 private:
239  QString _name;
240  QPen _pen;
241  QBrush _brush;
242  float _xIncrement;
243  float _xStart;
244  bool _visible;
246  QVector<float> _minMax; // minX, maxX, minY, maxY
247 };
248 
249 
254 {
255  Q_OBJECT
256 
257 public:
261  UPlotCurveThreshold(const QString & name, float thesholdValue, Qt::Orientation orientation = Qt::Horizontal, QObject * parent = 0);
262  virtual ~UPlotCurveThreshold();
263 
264 public Q_SLOTS:
268  void setThreshold(float threshold);
272  void setOrientation(Qt::Orientation orientation);
273 
274 protected:
275  friend class UPlot;
276  virtual void update(float scaleX, float scaleY, float offsetX, float offsetY, float xDir, float yDir, bool allDataKept);
277  virtual bool isMinMaxValid() const {return false;}
278 
279 private:
280  Qt::Orientation _orientation;
281 };
282 
286 class UPlotAxis : public QWidget
287 {
288 public:
292  UPlotAxis(Qt::Orientation orientation = Qt::Horizontal, float min=0, float max=1, QWidget * parent = 0);
293  virtual ~UPlotAxis();
294 
295 public:
300  void setAxis(float & min, float & max);
304  int border() const {return _border;}
308  int step() const {return _step;}
312  int count() const {return _count;}
316  void setReversed(bool reversed); // Vertical :bottom->up, horizontal :right->left
317 
318 protected:
319  virtual void paintEvent(QPaintEvent * event);
320 
321 private:
322  Qt::Orientation _orientation;
323  float _min;
324  float _max;
325  int _count;
326  int _step;
327  bool _reversed;
329  int _border;
330 };
331 
332 
336 class UPlotLegendItem : public QPushButton
337 {
338  Q_OBJECT
339 
340 public:
344  UPlotLegendItem(const UPlotCurve * curve, QWidget * parent = 0);
345  virtual ~UPlotLegendItem();
346  const UPlotCurve * curve() const {return _curve;}
347 
348 Q_SIGNALS:
349  void legendItemRemoved(const UPlotCurve *);
350 
351 protected:
352  virtual void contextMenuEvent(QContextMenuEvent * event);
353 
354 private:
356  QMenu * _menu;
357  QAction * _aChangeText;
358  QAction * _aResetText;
359  QAction * _aRemoveCurve;
360  QAction * _aCopyToClipboard;
361 };
362 
366 class UPlotLegend : public QWidget
367 {
368  Q_OBJECT
369 
370 public:
374  UPlotLegend(QWidget * parent = 0);
375  virtual ~UPlotLegend();
376 
377  void setFlat(bool on);
378  bool isFlat() const {return _flat;}
379  void addItem(const UPlotCurve * curve);
380  QPixmap createSymbol(const QPen & pen, const QBrush & brush);
381  bool remove(const UPlotCurve * curve);
382 
383 public Q_SLOTS:
384  void removeLegendItem(const UPlotCurve * curve);
385 
386 Q_SIGNALS:
387  void legendItemRemoved(const UPlotCurve * curve);
388  void legendItemToggled(const UPlotCurve * curve, bool toggled);
389 
390 protected:
391  virtual void contextMenuEvent(QContextMenuEvent * event);
392 
393 private Q_SLOTS:
394  void redirectToggled(bool);
395 
396 private:
397  bool _flat;
398  QMenu * _menu;
399  QAction * _aUseFlatButtons;
400 };
401 
402 
406 class UOrientableLabel : public QLabel
407 {
408  Q_OBJECT
409 
410 public:
414  UOrientableLabel(const QString & text, Qt::Orientation orientation = Qt::Horizontal, QWidget * parent = 0);
415  virtual ~UOrientableLabel();
419  Qt::Orientation orientation() const {return _orientation;}
423  void setOrientation(Qt::Orientation orientation);
424  QSize sizeHint() const;
425  QSize minimumSizeHint() const;
426 protected:
427  virtual void paintEvent(QPaintEvent* event);
428 private:
429  Qt::Orientation _orientation;
430 };
431 
462 class UPlot : public QWidget
463 {
464  Q_OBJECT
465 
466 public:
470  UPlot(QWidget * parent = 0);
471  virtual ~UPlot();
472 
476  UPlotCurve * addCurve(const QString & curveName, const QColor & color = QColor());
480  bool addCurve(UPlotCurve * curve, bool ownershipTransferred = true);
484  QStringList curveNames();
485  bool contains(const QString & curveName);
486  void removeCurves();
490  UPlotCurveThreshold * addThreshold(const QString & name, float value, Qt::Orientation orientation = Qt::Horizontal);
491  QString title() const {return this->objectName();}
492  QPen getRandomPenColored();
493  void showLegend(bool shown);
494  void showGrid(bool shown);
495  void showRefreshRate(bool shown);
496  void keepAllData(bool kept);
497  void showXAxis(bool shown) {_horizontalAxis->setVisible(shown);}
498  void showYAxis(bool shown) {_verticalAxis->setVisible(shown);}
499  void setVariableXAxis() {_fixedAxis[0] = false;}
500  void setVariableYAxis() {_fixedAxis[1] = false;}
501  void setFixedXAxis(float x1, float x2);
502  void setFixedYAxis(float y1, float y2);
503  void setMaxVisibleItems(int maxVisibleItems);
504  void setTitle(const QString & text);
505  void setXLabel(const QString & text);
506  void setYLabel(const QString & text, Qt::Orientation orientation = Qt::Vertical);
507  void setWorkingDirectory(const QString & workingDirectory);
508  void setGraphicsView(bool on);
509  QRectF sceneRect() const;
510 
511 public Q_SLOTS:
516  void removeCurve(const UPlotCurve * curve);
517  void showCurve(const UPlotCurve * curve, bool shown);
518  void updateAxis(); //reset axis and recompute it with all curves minMax
523  void clearData();
524 
525 private Q_SLOTS:
526  void captureScreen();
527  void updateAxis(const UPlotCurve * curve);
528 
529 protected:
530  virtual void contextMenuEvent(QContextMenuEvent * event);
531  virtual void paintEvent(QPaintEvent * event);
532  virtual void resizeEvent(QResizeEvent * event);
533 
534 private:
535  friend class UPlotCurve;
536  void addItem(QGraphicsItem * item);
537 
538 private:
539  void replot(QPainter * painter);
540  bool updateAxis(float x, float y);
541  bool updateAxis(float x1, float x2, float y1, float y2);
542  void setupUi();
543  void createActions();
544  void createMenus();
546 
547 private:
549  QGraphicsView * _view;
550  QGraphicsItem * _sceneRoot;
552  float _axisMaximums[4]; // {x1->x2, y1->y2}
553  bool _axisMaximumsSet[4]; // {x1->x2, y1->y2}
554  bool _fixedAxis[2];
559  QList<QGraphicsLineItem *> hGridLines;
560  QList<QGraphicsLineItem *> vGridLines;
561  QList<UPlotCurve*> _curves;
562  QLabel * _title;
563  QLabel * _xLabel;
565  QLabel * _refreshRate;
571 
572  QMenu * _menu;
573  QAction * _aShowLegend;
574  QAction * _aShowGrid;
575  QAction * _aKeepAllData;
576  QAction * _aLimit0;
577  QAction * _aLimit10;
578  QAction * _aLimit50;
579  QAction * _aLimit100;
580  QAction * _aLimit500;
581  QAction * _aLimit1000;
582  QAction * _aLimitCustom;
583  QAction * _aAddVerticalLine;
585  QAction * _aChangeTitle;
586  QAction * _aChangeXLabel;
587  QAction * _aChangeYLabel;
588  QAction * _aYLabelVertical;
589  QAction * _aShowRefreshRate;
590  QAction * _aSaveFigure;
592  QAction * _aClearData;
593  QAction * _aGraphicsView;
594 };
595 
596 #endif /* UPLOT_H_ */
UPlotLegend::_flat
bool _flat
Definition: UPlot.h:397
UPlotLegendItem::UPlotLegendItem
UPlotLegendItem(const UPlotCurve *curve, QWidget *parent=0)
Definition: UPlot.cpp:1268
UPlotItem::_data
QPointF _data
Definition: UPlot.h:79
UPlot::addItem
void addItem(QGraphicsItem *item)
Definition: UPlot.cpp:2420
UPlot::replot
void replot(QPainter *painter)
Definition: UPlot.cpp:1814
UPlotCurve::_addValue
void _addValue(UPlotItem *data)
Definition: UPlot.cpp:365
UPlot::_curves
QList< UPlotCurve * > _curves
Definition: UPlot.h:561
UPlotAxis::paintEvent
virtual void paintEvent(QPaintEvent *event)
Definition: UPlot.cpp:1224
UPlotItem::setNextItem
void setNextItem(UPlotItem *nextItem)
Definition: UPlot.cpp:104
UOrientableLabel::_orientation
Qt::Orientation _orientation
Definition: UPlot.h:429
UPlotLegend
Definition: UPlot.h:366
UPlotItem::UPlotItem
UPlotItem(qreal dataX, qreal dataY, qreal width=2)
Definition: UPlot.cpp:53
UOrientableLabel::setOrientation
void setOrientation(Qt::Orientation orientation)
Definition: UPlot.cpp:1497
min
int min(int a, int b)
UPlotCurve::getData
void getData(QVector< float > &x, QVector< float > &y) const
Definition: UPlot.cpp:929
UPlotCurve::_name
QString _name
Definition: UPlot.h:239
UPlotItem
Definition: UPlot.h:47
UPlotCurveThreshold::update
virtual void update(float scaleX, float scaleY, float offsetX, float offsetY, float xDir, float yDir, bool allDataKept)
Definition: UPlot.cpp:1020
UPlotAxis::border
int border() const
Definition: UPlot.h:304
UPlot::_aKeepAllData
QAction * _aKeepAllData
Definition: UPlot.h:575
UPlotLegendItem
Definition: UPlot.h:336
UPlot::_aClearData
QAction * _aClearData
Definition: UPlot.h:592
UPlotLegendItem::curve
const UPlotCurve * curve() const
Definition: UPlot.h:346
UPlotCurveThreshold::setOrientation
void setOrientation(Qt::Orientation orientation)
Definition: UPlot.cpp:1000
UPlot::_sceneRoot
QGraphicsItem * _sceneRoot
Definition: UPlot.h:550
UPlotCurve::pen
const QPen & pen() const
Definition: UPlot.h:112
UPlotItem::nextItem
UPlotItem * nextItem() const
Definition: UPlot.h:65
UPlot::_xLabel
QLabel * _xLabel
Definition: UPlot.h:563
UPlotCurveThreshold::UPlotCurveThreshold
UPlotCurveThreshold(const QString &name, float thesholdValue, Qt::Orientation orientation=Qt::Horizontal, QObject *parent=0)
Definition: UPlot.cpp:950
UPlotCurve::_visible
bool _visible
Definition: UPlot.h:244
UPlot::showGrid
void showGrid(bool shown)
Definition: UPlot.cpp:2436
UPlot::setFixedXAxis
void setFixedXAxis(float x1, float x2)
Definition: UPlot.cpp:1969
UPlotLegend::legendItemToggled
void legendItemToggled(const UPlotCurve *curve, bool toggled)
UPlotLegend::~UPlotLegend
virtual ~UPlotLegend()
Definition: UPlot.cpp:1362
UPlotCurve::setXStart
void setXStart(float val)
Definition: UPlot.cpp:806
UPlotLegendItem::~UPlotLegendItem
virtual ~UPlotLegendItem()
Definition: UPlot.cpp:1287
UPlotAxis::_min
float _min
Definition: UPlot.h:323
UPlot::_fixedAxis
bool _fixedAxis[2]
Definition: UPlot.h:554
UPlotLegendItem::_aResetText
QAction * _aResetText
Definition: UPlot.h:358
UPlot::createMenus
void createMenus()
Definition: UPlot.cpp:1691
UPlotCurve::setData
void setData(QVector< UPlotItem * > &data)
Definition: UPlot.cpp:811
UOrientableLabel::minimumSizeHint
QSize minimumSizeHint() const
Definition: UPlot.cpp:1489
UPlot::setupUi
void setupUi()
Definition: UPlot.cpp:1587
UPlot::_aChangeYLabel
QAction * _aChangeYLabel
Definition: UPlot.h:587
UPlot::_refreshRate
QLabel * _refreshRate
Definition: UPlot.h:565
UPlotLegend::redirectToggled
void redirectToggled(bool)
Definition: UPlot.cpp:1452
UPlotCurve::draw
void draw(QPainter *painter)
Definition: UPlot.cpp:735
UPlot::_verticalAxis
UPlotAxis * _verticalAxis
Definition: UPlot.h:555
UPlotCurve::attach
void attach(UPlot *plot)
Definition: UPlot.cpp:293
UPlot::_aGraphicsView
QAction * _aGraphicsView
Definition: UPlot.h:593
UPlot::_graphicsViewHolder
QWidget * _graphicsViewHolder
Definition: UPlot.h:551
UPlot::showYAxis
void showYAxis(bool shown)
Definition: UPlot.h:498
UOrientableLabel::UOrientableLabel
UOrientableLabel(const QString &text, Qt::Orientation orientation=Qt::Horizontal, QWidget *parent=0)
Definition: UPlot.cpp:1470
UPlotCurve::name
QString name() const
Definition: UPlot.h:130
UPlot::_aAddVerticalLine
QAction * _aAddVerticalLine
Definition: UPlot.h:583
UPlotCurve::UPlotCurve
UPlotCurve(const QString &name, QObject *parent=0)
Definition: UPlot.cpp:246
UPlotLegendItem::_curve
const UPlotCurve * _curve
Definition: UPlot.h:355
UPlotItem::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *keyEvent)
Definition: UPlot.cpp:210
UPlotItem::hoverEnterEvent
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Definition: UPlot.cpp:175
UPlot::removeCurves
void removeCurves()
Definition: UPlot.cpp:2506
UPlotCurve::removeItem
int removeItem(int index)
Definition: UPlot.cpp:560
UPlotLegend::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event)
Definition: UPlot.cpp:1443
UPlot::setFixedYAxis
void setFixedYAxis(float y1, float y2)
Definition: UPlot.cpp:1976
UPlotCurve::isVisible
bool isVisible() const
Definition: UPlot.h:136
UPlotAxis::setReversed
void setReversed(bool reversed)
Definition: UPlot.cpp:1085
UPlot::_aLimit100
QAction * _aLimit100
Definition: UPlot.h:579
UPlot::showRefreshRate
void showRefreshRate(bool shown)
Definition: UPlot.cpp:2442
UOrientableLabel::paintEvent
virtual void paintEvent(QPaintEvent *event)
Definition: UPlot.cpp:1512
UPlotLegend::isFlat
bool isFlat() const
Definition: UPlot.h:378
UPlotCurve::dataChanged
void dataChanged(const UPlotCurve *)
UPlotItem::_nextItem
UPlotItem * _nextItem
Definition: UPlot.h:82
UPlot::curveNames
QStringList curveNames()
Definition: UPlot.cpp:1784
UPlot::_horizontalAxis
UPlotAxis * _horizontalAxis
Definition: UPlot.h:556
UPlotAxis::step
int step() const
Definition: UPlot.h:308
UPlotItem::setData
void setData(const QPointF &data)
Definition: UPlot.cpp:99
UPlot::_aShowRefreshRate
QAction * _aShowRefreshRate
Definition: UPlot.h:589
UPlot::UPlot
UPlot(QWidget *parent=0)
Definition: UPlot.cpp:1543
UPlotCurve::getItemData
QPointF getItemData(int index)
Definition: UPlot.cpp:777
UPlot::_aShowGrid
QAction * _aShowGrid
Definition: UPlot.h:574
UPlot::setVariableYAxis
void setVariableYAxis()
Definition: UPlot.h:500
UPlotAxis::count
int count() const
Definition: UPlot.h:312
UPlot::_aLimitCustom
QAction * _aLimitCustom
Definition: UPlot.h:582
UPlotCurve::setBrush
void setBrush(const QBrush &brush)
Definition: UPlot.cpp:654
UPlotCurveThreshold
Definition: UPlot.h:253
UPlot::_yLabel
UOrientableLabel * _yLabel
Definition: UPlot.h:564
UPlotAxis::_count
int _count
Definition: UPlot.h:325
UPlot::getRandomPenColored
QPen getRandomPenColored()
Definition: UPlot.cpp:1809
UPlot::_refreshIntervalTime
QTime _refreshIntervalTime
Definition: UPlot.h:567
UPlotLegend::remove
bool remove(const UPlotCurve *curve)
Definition: UPlot.cpp:1421
UPlotItem::data
const QPointF & data() const
Definition: UPlot.h:67
UPlotCurve::_items
QList< QGraphicsItem * > _items
Definition: UPlot.h:232
UPlot::clearData
void clearData()
Definition: UPlot.cpp:2351
UOrientableLabel
Definition: UPlot.h:406
UPlotLegend::UPlotLegend
UPlotLegend(QWidget *parent=0)
Definition: UPlot.cpp:1344
UPlotAxis::_step
int _step
Definition: UPlot.h:326
UPlot::_aAddHorizontalLine
QAction * _aAddHorizontalLine
Definition: UPlot.h:584
UPlotCurve::_plot
UPlot * _plot
Definition: UPlot.h:233
UPlotCurveThreshold::_orientation
Qt::Orientation _orientation
Definition: UPlot.h:280
UPlotAxis::_max
float _max
Definition: UPlot.h:324
UPlotCurve::_xIncrement
float _xIncrement
Definition: UPlot.h:242
UPlotAxis::_reversed
bool _reversed
Definition: UPlot.h:327
UPlotCurve::_brush
QBrush _brush
Definition: UPlot.h:241
UPlot::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
Definition: UPlot.cpp:2098
UPlot::_workingDirectory
QString _workingDirectory
Definition: UPlot.h:566
UPlotLegendItem::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event)
Definition: UPlot.cpp:1291
UPlotLegendItem::legendItemRemoved
void legendItemRemoved(const UPlotCurve *)
UPlotCurve::_minMax
QVector< float > _minMax
Definition: UPlot.h:246
UPlotAxis::_orientation
Qt::Orientation _orientation
Definition: UPlot.h:322
UPlot::contains
bool contains(const QString &curveName)
Definition: UPlot.cpp:1797
UPlot::addCurve
UPlotCurve * addCurve(const QString &curveName, const QColor &color=QColor())
Definition: UPlot.cpp:1724
UPlotCurve::itemsSize
int itemsSize() const
Definition: UPlot.cpp:772
UPlot::_aLimit10
QAction * _aLimit10
Definition: UPlot.h:577
UPlotCurve::~UPlotCurve
virtual ~UPlotCurve()
Definition: UPlot.cpp:281
UPlot::setXLabel
void setXLabel(const QString &text)
Definition: UPlot.cpp:2396
UPlotLegendItem::_aRemoveCurve
QAction * _aRemoveCurve
Definition: UPlot.h:359
UPlotLegend::removeLegendItem
void removeLegendItem(const UPlotCurve *curve)
Definition: UPlot.cpp:1435
UPlot::addThreshold
UPlotCurveThreshold * addThreshold(const QString &name, float value, Qt::Orientation orientation=Qt::Horizontal)
Definition: UPlot.cpp:2365
UPlotCurve::brush
const QBrush & brush() const
Definition: UPlot.h:116
UPlotCurve::_xStart
float _xStart
Definition: UPlot.h:243
UPlot::paintEvent
virtual void paintEvent(QPaintEvent *event)
Definition: UPlot.cpp:2075
UPlot::_legend
UPlotLegend * _legend
Definition: UPlot.h:548
UPlotLegend::_menu
QMenu * _menu
Definition: UPlot.h:398
UPlot::_view
QGraphicsView * _view
Definition: UPlot.h:549
UPlotLegend::createSymbol
QPixmap createSymbol(const QPen &pen, const QBrush &brush)
Definition: UPlot.cpp:1409
UPlot::~UPlot
virtual ~UPlot()
Definition: UPlot.cpp:1578
UPlot::createActions
void createActions()
Definition: UPlot.cpp:1640
UPlotCurve::addValue
void addValue(UPlotItem *data)
Definition: UPlot.cpp:416
UPlotLegend::legendItemRemoved
void legendItemRemoved(const UPlotCurve *curve)
UPlotCurve::_pen
QPen _pen
Definition: UPlot.h:240
UPlot::_maxVisibleItems
int _maxVisibleItems
Definition: UPlot.h:558
UPlotCurve::detach
void detach(UPlot *plot)
Definition: UPlot.cpp:310
UPlot::_aChangeTitle
QAction * _aChangeTitle
Definition: UPlot.h:585
UPlot::updateAxis
void updateAxis()
Definition: UPlot.cpp:2049
UPlot::_aLimit1000
QAction * _aLimit1000
Definition: UPlot.h:581
UPlotAxis
Definition: UPlot.h:286
UPlot::removeCurve
void removeCurve(const UPlotCurve *curve)
Definition: UPlot.cpp:2516
UPlot::setGraphicsView
void setGraphicsView(bool on)
Definition: UPlot.cpp:2453
UPlot::setTitle
void setTitle(const QString &text)
Definition: UPlot.cpp:2385
UPlotLegend::_aUseFlatButtons
QAction * _aUseFlatButtons
Definition: UPlot.h:399
UPlotAxis::setAxis
void setAxis(float &min, float &max)
Definition: UPlot.cpp:1096
UPlotCurve
Definition: UPlot.h:90
UPlot::_aYLabelVertical
QAction * _aYLabelVertical
Definition: UPlot.h:588
UPlotItem::focusOutEvent
virtual void focusOutEvent(QFocusEvent *event)
Definition: UPlot.cpp:204
UPlotCurve::setVisible
void setVisible(bool visible)
Definition: UPlot.cpp:792
UPlot::setVariableXAxis
void setVariableXAxis()
Definition: UPlot.h:499
UPlotItem::focusInEvent
virtual void focusInEvent(QFocusEvent *event)
Definition: UPlot.cpp:198
UPlot::_title
QLabel * _title
Definition: UPlot.h:562
UPlotLegend::setFlat
void setFlat(bool on)
Definition: UPlot.cpp:1369
UPlotItem::_previousItem
UPlotItem * _previousItem
Definition: UPlot.h:81
UPlotItem::setPreviousItem
void setPreviousItem(UPlotItem *previousItem)
Definition: UPlot.cpp:116
UPlotCurve::setXIncrement
void setXIncrement(float increment)
Definition: UPlot.cpp:801
UPlot::showXAxis
void showXAxis(bool shown)
Definition: UPlot.h:497
UPlot::setMaxVisibleItems
void setMaxVisibleItems(int maxVisibleItems)
Definition: UPlot.cpp:2465
UPlot::vGridLines
QList< QGraphicsLineItem * > vGridLines
Definition: UPlot.h:560
UPlotItem::showDescription
virtual void showDescription(bool shown)
Definition: UPlot.cpp:128
UPlot::showCurve
void showCurve(const UPlotCurve *curve, bool shown)
Definition: UPlot.cpp:2550
UPlot::setYLabel
void setYLabel(const QString &text, Qt::Orientation orientation=Qt::Vertical)
Definition: UPlot.cpp:2407
UPlotCurveThreshold::~UPlotCurveThreshold
virtual ~UPlotCurveThreshold()
Definition: UPlot.cpp:966
UPlot::_aChangeXLabel
QAction * _aChangeXLabel
Definition: UPlot.h:586
UOrientableLabel::orientation
Qt::Orientation orientation() const
Definition: UPlot.h:419
UPlotItem::hoverLeaveEvent
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Definition: UPlot.cpp:189
UPlot::selectScreenCaptureFormat
void selectScreenCaptureFormat()
Definition: UPlot.cpp:2338
UPlotItem::~UPlotItem
virtual ~UPlotItem()
Definition: UPlot.cpp:82
UPlot::hGridLines
QList< QGraphicsLineItem * > hGridLines
Definition: UPlot.h:559
UPlot::_axisMaximumsSet
bool _axisMaximumsSet[4]
Definition: UPlot.h:553
UOrientableLabel::~UOrientableLabel
virtual ~UOrientableLabel()
Definition: UPlot.cpp:1476
UPlotCurve::isMinMaxValid
virtual bool isMinMaxValid() const
Definition: UPlot.h:230
UPlot::_menu
QMenu * _menu
Definition: UPlot.h:572
UPlot::_aLimit50
QAction * _aLimit50
Definition: UPlot.h:578
UPlot::title
QString title() const
Definition: UPlot.h:491
UPlot::_aLimit0
QAction * _aLimit0
Definition: UPlot.h:576
UPlot::showLegend
void showLegend(bool shown)
Definition: UPlot.cpp:2425
UPlot::_aSaveFigure
QAction * _aSaveFigure
Definition: UPlot.h:590
UPlotCurve::getMinMax
const QVector< float > & getMinMax() const
Definition: UPlot.h:227
UPlotAxis::~UPlotAxis
virtual ~UPlotAxis()
Definition: UPlot.cpp:1077
UPlotCurve::updateMinMax
void updateMinMax()
Definition: UPlot.cpp:328
UPlot::_autoScreenCaptureFormat
QString _autoScreenCaptureFormat
Definition: UPlot.h:570
UPlotLegendItem::_menu
QMenu * _menu
Definition: UPlot.h:356
UPlot::keepAllData
void keepAllData(bool kept)
Definition: UPlot.cpp:2460
UPlot::_aAutoScreenCapture
QAction * _aAutoScreenCapture
Definition: UPlot.h:591
UPlotCurveThreshold::isMinMaxValid
virtual bool isMinMaxValid() const
Definition: UPlot.h:277
UPlot
Definition: UPlot.h:462
UPlotCurve::setPen
void setPen(const QPen &pen)
Definition: UPlot.cpp:645
UPlotLegendItem::_aCopyToClipboard
QAction * _aCopyToClipboard
Definition: UPlot.h:360
UPlot::_refreshStartTime
QTime _refreshStartTime
Definition: UPlot.h:569
UPlot::_penStyleCount
int _penStyleCount
Definition: UPlot.h:557
UPlot::_axisMaximums
float _axisMaximums[4]
Definition: UPlot.h:552
UPlotItem::_text
QGraphicsTextItem * _text
Definition: UPlot.h:80
UPlotCurve::update
virtual void update(float scaleX, float scaleY, float offsetX, float offsetY, float xDir, float yDir, bool allDataKept)
Definition: UPlot.cpp:660
UOrientableLabel::sizeHint
QSize sizeHint() const
Definition: UPlot.cpp:1480
UPlotAxis::_border
int _border
Definition: UPlot.h:329
UPlotLegend::addItem
void addItem(const UPlotCurve *curve)
Definition: UPlot.cpp:1384
UPlot::captureScreen
void captureScreen()
Definition: UPlot.cpp:2314
UPlotItem::previousItem
UPlotItem * previousItem() const
Definition: UPlot.h:66
UPlotCurveThreshold::setThreshold
void setThreshold(float threshold)
Definition: UPlot.cpp:971
UPlotLegendItem::_aChangeText
QAction * _aChangeText
Definition: UPlot.h:357
UPlot::sceneRect
QRectF sceneRect() const
Definition: UPlot.cpp:2501
UPlot::setWorkingDirectory
void setWorkingDirectory(const QString &workingDirectory)
Definition: UPlot.cpp:2302
UPlotCurve::clear
virtual void clear()
Definition: UPlot.cpp:636
UPlot::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event)
Definition: UPlot.cpp:2107
UPlot::_lowestRefreshRate
int _lowestRefreshRate
Definition: UPlot.h:568
UPlot::_aShowLegend
QAction * _aShowLegend
Definition: UPlot.h:573
UPlotCurve::_valuesShown
bool _valuesShown
Definition: UPlot.h:245
UPlot::_aLimit500
QAction * _aLimit500
Definition: UPlot.h:580
UPlotAxis::UPlotAxis
UPlotAxis(Qt::Orientation orientation=Qt::Horizontal, float min=0, float max=1, QWidget *parent=0)
Definition: UPlot.cpp:1058
UPlotAxis::_gradMaxDigits
int _gradMaxDigits
Definition: UPlot.h:328
UPlotCurve::addValues
void addValues(QVector< UPlotItem * > &data)
Definition: UPlot.cpp:461


find_object_2d
Author(s): Mathieu Labbe
autogenerated on Mon Dec 12 2022 03:43:35