Ignition Gui

API Reference

1.0.0
ImageDisplay.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 
18 #ifndef IGNITION_GUI_PLUGINS_IMAGEDISPLAY_HH_
19 #define IGNITION_GUI_PLUGINS_IMAGEDISPLAY_HH_
20 
21 #include <memory>
22 #include <ignition/msgs.hh>
23 
24 #include "ignition/gui/Plugin.hh"
25 
26 namespace ignition
27 {
28 namespace gui
29 {
30 namespace plugins
31 {
32  class ImageDisplayPrivate;
33 
41  class ImageDisplay : public Plugin
42  {
43  Q_OBJECT
44 
46  Q_PROPERTY(
48  READ TopicList
49  WRITE SetTopicList
50  NOTIFY TopicListChanged
51  )
52 
53 
54  public: ImageDisplay();
55 
57  public: virtual ~ImageDisplay();
58 
59  // Documentation inherited
60  public: virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem);
61 
63  public slots: void OnRefresh();
64 
66  public slots: void OnTopic(const QString _topic);
67 
71  public: Q_INVOKABLE QStringList TopicList() const;
72 
76  public: Q_INVOKABLE void SetTopicList(const QStringList &_topicList);
77 
79  signals: void TopicListChanged();
80 
82  signals: void newImage();
83 
85  private slots: void ProcessImage();
86 
88  private: void UpdateFromRgbInt8();
89 
91  private: void UpdateFromFloat32();
92 
95  private: void OnImageMsg(const ignition::msgs::Image &_msg);
96 
99  private: std::unique_ptr<ImageDisplayPrivate> dataPtr;
100  };
101 }
102 }
103 }
104 
105 #endif
STL namespace.
Definition: Application.hh:28
virtual void LoadConfig(const tinyxml2::XMLElement *_pluginElem)
Load the plugin with a configuration file. Override this on custom plugins to handle custom configura...
Base class for Ignition GUI plugins.
Definition: Plugin.hh:47
void OnTopic(const QString _topic)
Callback when a new topic is chosen on the combo box.
QStringList topicList
Topic list.
Definition: ImageDisplay.hh:51
Q_INVOKABLE QStringList TopicList() const
Get the topic list as a string, for example &#39;ignition.msgs.StringMsg&#39;.
Definition: Application.hh:33
Q_INVOKABLE void SetTopicList(const QStringList &_topicList)
Set the topic list from a string, for example &#39;ignition.msgs.StringMsg&#39;.