LogPlayWidget.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_LOG_PLAY_WIDGET_HH_
18 #define _GAZEBO_LOG_PLAY_WIDGET_HH_
19 
20 #include "gazebo/common/Time.hh"
21 #include "gazebo/gui/qt.h"
22 #include "gazebo/gui/TimePanel.hh"
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
27  namespace gui
28  {
29  class LogPlayWidgetPrivate;
30  class LogPlayViewPrivate;
31  class TimePanel;
32 
35  class GAZEBO_VISIBLE LogPlayWidget : public QWidget
36  {
37  Q_OBJECT
38 
41  public: LogPlayWidget(QWidget *_parent = 0);
42 
44  public: virtual ~LogPlayWidget();
45 
48  public: bool IsPaused() const;
49 
53  public: void SetPaused(const bool _paused);
54 
57  public: void EmitSetCurrentTime(const common::Time &_time);
58 
61  public: void EmitSetStartTime(const common::Time &_time);
62 
65  public: void EmitSetEndTime(const common::Time &_time);
66 
68  public slots: void OnPlay();
69 
71  public slots: void OnPause();
72 
74  public slots: void OnStepForward();
75 
77  signals: void ShowPlay();
78 
80  signals: void HidePlay();
81 
83  signals: void ShowPause();
84 
86  signals: void HidePause();
87 
90  signals: void SetCurrentTime(const QString &);
91 
94  signals: void SetEndTime(const QString &);
95 
98  signals: void SetCurrentTime(const common::Time &_time);
99 
102  signals: void SetStartTime(const common::Time &_time);
103 
106  signals: void SetEndTime(const common::Time &_time);
107 
110  private: LogPlayWidgetPrivate *dataPtr;
111  };
112 
115  class GAZEBO_VISIBLE LogPlayView: public QGraphicsView
116  {
117  Q_OBJECT
118 
121  public: LogPlayView(LogPlayWidget *_parent = 0);
122 
125  public slots: void SetCurrentTime(const common::Time &_time);
126 
129  public slots: void SetStartTime(const common::Time &_time);
130 
133  public slots: void SetEndTime(const common::Time &_time);
134 
136  public slots: void DrawTimeline();
137 
140  private: LogPlayViewPrivate *dataPtr;
141  };
142 
145  class GAZEBO_VISIBLE CurrentTimeItem: public QObject,
146  public QGraphicsRectItem
147  {
148  Q_OBJECT
149 
151  public: CurrentTimeItem();
152 
153  // Documentation inherited
154  private: virtual void paint(QPainter *_painter,
155  const QStyleOptionGraphicsItem *_option, QWidget *_widget);
156  };
157  }
158 }
159 
160 #endif
Definition: LogPlayWidgetPrivate.hh:28
Private data for the LogPlayView class.
Definition: LogPlayWidgetPrivate.hh:54
Widget which displays log playback options.
Definition: LogPlayWidget.hh:35
Item which represents the current time within the view.
Definition: LogPlayWidget.hh:145
View for the timeline.
Definition: LogPlayWidget.hh:115
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:39