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 
29 GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, PlotManager)
30 
31 namespace 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 
63  public: void RemoveIntrospectionCurve(PlotCurveWeakPtr _curve);
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: PlotManager.hh:29
Forward declarations for the common classes.
Definition: Animation.hh:26
Singleton template class.
Definition: SingletonT.hh:33
Plot window.
Definition: PlotWindow.hh:36
A class that connects simulation data with the plotting tool.
Definition: PlotManager.hh:41
std::weak_ptr< PlotCurve > PlotCurveWeakPtr
Definition: PlottingTypes.hh:41
default namespace for gazebo
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61