plot_background.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef PLOT_BACKGROUND_H
8 #define PLOT_BACKGROUND_H
9 
10 #include <QBrush>
11 #include "qwt_plot_zoneitem.h"
12 
13 #include "PlotJuggler/plotdata.h"
14 #include "color_map.h"
15 
17 {
18 public:
19  BackgroundColorItem(const PJ::PlotData& data, QString colormap_name);
20 
21  virtual ~BackgroundColorItem() override = default;
22 
23  void setTimeOffset(double* time_offset)
24  {
25  _time_offset = time_offset;
26  }
27 
28  int rtti() const override
29  {
31  }
32 
33  virtual void draw(QPainter* painter, const QwtScaleMap&, const QwtScaleMap&,
34  const QRectF& canvasRect) const override;
35 
36  virtual QRectF boundingRect() const override;
37 
38  QString colormapName() const
39  {
40  return _colormap_name;
41  }
42 
43  QString dataName() const
44  {
45  return _data_name;
46  }
47 
48 private:
50  QString _data_name;
51  QString _colormap_name;
52  double* _time_offset = nullptr;
53 };
54 
55 #endif // PLOT_BACKGROUND_H
virtual void draw(QPainter *painter, const QwtScaleMap &, const QwtScaleMap &, const QRectF &canvasRect) const override
Draw the item.
void setTimeOffset(double *time_offset)
const PJ::PlotData & _data
int rtti() const override
virtual ~BackgroundColorItem() override=default
QString dataName() const
For QwtPlotZoneItem.
BackgroundColorItem(const PJ::PlotData &data, QString colormap_name)
QString colormapName() const
A scale map.
Definition: qwt_scale_map.h:26
virtual QRectF boundingRect() const override
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:66
Definition: format.h:895


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:38