##

PlotCurve.hh
Go to the documentation of this file.
/*
* Copyright (C) 2016 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_PLOT_PLOTCURVE_HH_
#define GAZEBO_GUI_PLOT_PLOTCURVE_HH_
#include <memory>
#include <string>
#include <vector>
#include <ignition/math/Vector2.hh>
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
class QwtPlotCurve;
namespace gazebo
{
namespace gui
{
// Forward declare private data class
class PlotCurvePrivate;
class IncrementalPlot;
class GZ_GUI_VISIBLE PlotCurve
{
public: explicit PlotCurve(const std::string &_label);
public: ~PlotCurve();
public: void AddPoint(const ignition::math::Vector2d &_pt);
public: void AddPoints(const std::vector<ignition::math::Vector2d> &_pt);
public: void Clear();
public: void Attach(IncrementalPlot *_plot);
public: void Detach();
public: void SetLabel(const std::string &_label);
public: std::string Label() const;
public: void SetId(const unsigned int _id);
public: unsigned int Id() const;
public: void SetActive(const bool _active);
public: bool Active() const;
public: void SetAge(const unsigned int _age);
public: unsigned int Age() const;
public: unsigned int Size() const;
public: ignition::math::Vector2d Min();
public: ignition::math::Vector2d Max();
public: ignition::math::Vector2d Point(const unsigned int _index) const;
public: std::vector<ignition::math::Vector2d> Points() const;
public: QwtPlotCurve *Curve();
private: std::unique_ptr<PlotCurvePrivate> dataPtr;
};
}
}
#endif
gazebo::gui::PlotCurve::PlotCurve
PlotCurve(const std::string &_label)
Constructor.
gazebo::gui::PlotCurve::Max
ignition::math::Vector2d Max()
Get the max x and y values of this curve.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::PlotCurve::SetActive
void SetActive(const bool _active)
Set whether the curve should be active.
gazebo::gui::PlotCurve::SetAge
void SetAge(const unsigned int _age)
Set the age of the curve.
system.hh
gazebo::gui::PlotCurve::~PlotCurve
~PlotCurve()
Destructor.
gazebo::gui::PlotCurve::SetLabel
void SetLabel(const std::string &_label)
Set the curve label.
gazebo::gui::PlotCurve::Size
unsigned int Size() const
Get the number of data points in the curve.
gazebo::gui::PlotCurve::Active
bool Active() const
Get whether the curve is active.
gazebo::gui::PlotCurve::Clear
void Clear()
Clear all data from the curve.
gazebo::gui::PlotCurve::Label
std::string Label() const
Get the curve label.
gazebo::gui::PlotCurve::Point
ignition::math::Vector2d Point(const unsigned int _index) const
Get a point in the curve.
gazebo::gui::PlotCurve
Plot Curve data.
Definition: PlotCurve.hh:41
gazebo::gui::PlotCurve::Age
unsigned int Age() const
Get the age of the curve.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::IncrementalPlot
A plotting widget that handles incremental addition of data.
Definition: IncrementalPlot.hh:46
gazebo::gui::PlotCurve::Curve
QwtPlotCurve * Curve()
gazebo::gui::PlotCurve::AddPoints
void AddPoints(const std::vector< ignition::math::Vector2d > &_pt)
Add points to the curve.
gazebo::gui::PlotCurve::Attach
void Attach(IncrementalPlot *_plot)
Attach the curve to a plot.
gazebo::gui::PlotCurve::Points
std::vector< ignition::math::Vector2d > Points() const
Return all the sample points in the curve.
gazebo::gui::PlotCurve::Detach
void Detach()
Detach the curve from the plot.
gazebo::gui::PlotCurve::Min
ignition::math::Vector2d Min()
Get the min x and y values of this curve.
gazebo::gui::PlotCurve::SetId
void SetId(const unsigned int _id)
Set the curve id.
gazebo::gui::PlotCurve::Id
unsigned int Id() const
Get the curve id.
gazebo::gui::PlotCurve::AddPoint
void AddPoint(const ignition::math::Vector2d &_pt)
Add a point to the curve.