PlotTableConfig.h
Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (C) 2015 by Ralf Kaestner                                        *
00003  * ralf.kaestner@gmail.com                                                    *
00004  *                                                                            *
00005  * This program is free software; you can redistribute it and/or modify       *
00006  * it under the terms of the Lesser GNU General Public License as published by*
00007  * the Free Software Foundation; either version 3 of the License, or          *
00008  * (at your option) any later version.                                        *
00009  *                                                                            *
00010  * This program is distributed in the hope that it will be useful,            *
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the               *
00013  * Lesser GNU General Public License for more details.                        *
00014  *                                                                            *
00015  * You should have received a copy of the Lesser GNU General Public License   *
00016  * along with this program. If not, see <http://www.gnu.org/licenses/>.       *
00017  ******************************************************************************/
00018 
00019 #ifndef RQT_MULTIPLOT_PLOT_TABLE_CONFIG_H
00020 #define RQT_MULTIPLOT_PLOT_TABLE_CONFIG_H
00021 
00022 #include <QColor>
00023 #include <QVector>
00024 
00025 #include <rqt_multiplot/Config.h>
00026 #include <rqt_multiplot/PlotConfig.h>
00027 
00028 namespace rqt_multiplot {
00029   class PlotTableConfig :
00030     public Config {
00031   Q_OBJECT
00032   public:
00033     PlotTableConfig(QObject* parent, const QColor& backgroundColor =
00034       Qt::white, const QColor& foregroundColor = Qt::black, size_t
00035       numRows = 1, size_t numColumns = 1, bool linkScale = false,
00036       bool linkCursor = false, bool trackPoints = false);
00037     ~PlotTableConfig();
00038 
00039     void setBackgroundColor(const QColor& color);
00040     const QColor& getBackgroundColor() const;
00041     void setForegroundColor(const QColor& color);
00042     const QColor& getForegroundColor() const;
00043     void setNumPlots(size_t numRows, size_t numColumns);
00044     void setNumRows(size_t numRows);
00045     size_t getNumRows() const;
00046     void setNumColumns(size_t numColumns);
00047     size_t getNumColumns() const;
00048     PlotConfig* getPlotConfig(size_t row, size_t column) const;
00049     void setLinkScale(bool link);
00050     bool isScaleLinked() const;
00051     void setLinkCursor(bool link);
00052     bool isCursorLinked() const;
00053     void setTrackPoints(bool track);
00054     bool arePointsTracked() const;
00055     
00056     void save(QSettings& settings) const;
00057     void load(QSettings& settings);
00058     void reset();
00059     
00060     void write(QDataStream& stream) const;
00061     void read(QDataStream& stream);
00062     
00063     PlotTableConfig& operator=(const PlotTableConfig& src);
00064     
00065   signals:
00066     void backgroundColorChanged(const QColor& color);
00067     void foregroundColorChanged(const QColor& color);
00068     void numPlotsChanged(size_t numRows, size_t numColumns);
00069     void linkScaleChanged(bool link);
00070     void linkCursorChanged(bool link);
00071     void trackPointsChanged(bool track);
00072     
00073   private:
00074     QColor backgroundColor_;
00075     QColor foregroundColor_;
00076     QVector<QVector<PlotConfig*> > plotConfig_;
00077     bool linkScale_;
00078     bool linkCursor_;
00079     bool trackPoints_;
00080     
00081   private slots:
00082     void plotConfigChanged();
00083   };
00084 };
00085 
00086 #endif


rqt_multiplot
Author(s): Ralf Kaestner
autogenerated on Tue May 9 2017 02:16:02