PlotManager.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17#ifndef GAZEBO_GUI_PLOT_PLOTMANAGER_HH_
18#define GAZEBO_GUI_PLOT_PLOTMANAGER_HH_
19
20#include <memory>
21#include <string>
22
23#include "gazebo/msgs/msgs.hh"
26#include "gazebo/util/system.hh"
27
29GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, PlotManager)
30
31namespace gazebo
32{
33 namespace gui
34 {
35 // Forward declare private data class
36 class PlotManagerPrivate;
37
38 class PlotWindow;
39
41 class GZ_GUI_VISIBLE PlotManager : public SingletonT<PlotManager>
42 {
44 public: PlotManager();
45
47 public: virtual ~PlotManager();
48
52 public: void OnWorldControl(ConstWorldControlPtr &_data);
53
58 public: void AddIntrospectionCurve(const std::string &_name,
59 PlotCurveWeakPtr _curve);
60
64
69 public: void AddTopicCurve(const std::string &_topic,
70 PlotCurveWeakPtr _curve);
71
74 public: void RemoveTopicCurve(PlotCurveWeakPtr _curve);
75
79 public: void AddWindow(PlotWindow *_window);
80
83 public: void RemoveWindow(PlotWindow *_window);
84
88 public: std::string HumanReadableName(const std::string &_uri) const;
89
91 private: friend class SingletonT<PlotManager>;
92
95 private: std::unique_ptr<PlotManagerPrivate> dataPtr;
96 };
97 }
98}
99#endif
gui
Definition KeyEventHandler.hh:29
gazebo
Definition PlotManager.hh:29
gui
Definition PlotManager.hh:29
default namespace for gazebo
Singleton template class.
Definition SingletonT.hh:34
A class that connects simulation data with the plotting tool.
Definition PlotManager.hh:42
void OnWorldControl(ConstWorldControlPtr &_data)
Callback when a world control message is received.
void AddWindow(PlotWindow *_window)
Add a plot window to the manager.
std::string HumanReadableName(const std::string &_uri) const
Get Human-readable name from uri-formatted variable name.
PlotManager()
Constructor.
void RemoveTopicCurve(PlotCurveWeakPtr _curve)
Remove a topic curve from the manager.
void RemoveIntrospectionCurve(PlotCurveWeakPtr _curve)
Remove an introspection curve from the manager.
void AddIntrospectionCurve(const std::string &_name, PlotCurveWeakPtr _curve)
Add an introspection curve to the manager.
virtual ~PlotManager()
Destructor.
void RemoveWindow(PlotWindow *_window)
Remove a plot window from the manager.
void AddTopicCurve(const std::string &_topic, PlotCurveWeakPtr _curve)
Add a topic curve to the manager.
Plot window.
Definition PlotWindow.hh:37
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition SingletonT.hh:58
std::weak_ptr< PlotCurve > PlotCurveWeakPtr
Definition PlottingTypes.hh:41
Forward declarations for the common classes.
Definition Animation.hh:27