Fawkes API  Fawkes Development Version
worldinfo_viewer.h
1 
2 /***************************************************************************
3  * worldinfo_viewer.h - World Info Viewer
4  *
5  * Created: Wed April 09 20:09:01 2008
6  * Copyright 2008 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __TOOLS_WORLDINFO_VIEWER_WORLDINFO_VIEWER_H_
24 #define __TOOLS_WORLDINFO_VIEWER_WORLDINFO_VIEWER_H_
25 
26 #include <gtkmm.h>
27 #include <cairomm/context.h>
28 
29 class FieldView;
30 namespace fawkes {
31  class WorldInfoDataContainer;
32 }
33 
34 class WorldInfoViewer : public Gtk::Window
35 {
36  public:
37  WorldInfoViewer(Glib::RefPtr<Gtk::Builder> builder,
38  fawkes::WorldInfoDataContainer* data_container );
39  virtual ~WorldInfoViewer();
40 
41  Gtk::Window& get_window() const;
42 
43  bool update();
44  void gamestate_changed();
45 
46  private:
47  class RobotRecord : public Gtk::TreeModelColumnRecord
48  {
49  public:
50  RobotRecord()
51  {
52  add(hostname);
53  add(fqdn);
54  add(show_pose);
55  add(show_ball);
56  add(show_opponents);
57  }
58 
59  /// @cond INTERNALS
60  Gtk::TreeModelColumn<Glib::ustring> hostname;
61  Gtk::TreeModelColumn<Glib::ustring> fqdn;
62  Gtk::TreeModelColumn<bool> show_pose;
63  Gtk::TreeModelColumn<bool> show_ball;
64  Gtk::TreeModelColumn<bool> show_opponents;
65  /// @endcond
66  };
67 
68  // signal handlers
69  void on_show_pose_toggled( const Glib::ustring& path );
70  void on_show_ball_toggled( const Glib::ustring& path );
71  void on_show_opponents_toggled( const Glib::ustring& path );
72 
73  Gtk::Window* m_wnd_main;
74  Gtk::VBox* m_vbx_field;
75  Gtk::TreeView* m_trv_robots;
76  Gtk::Statusbar* m_stb_status;
77 
78  unsigned int m_stb_message_id;
79 
80  FieldView* m_field_view;
81 
82  RobotRecord m_robot_record;
83  Glib::RefPtr<Gtk::ListStore> m_robots_list;
84 
85  fawkes::WorldInfoDataContainer* m_data_container;
86 
87  unsigned int m_robot_id;
88  std::map<Glib::ustring, unsigned int> m_robots;
89  std::map<unsigned int, Gtk::TreeModel::Row> m_list_entries;
90 };
91 
92 #endif /* __TOOLS_WORLDINFO_VIEWER_WORLDINFO_VIEWER_H_ */
Data container to store and exchange worldinfo data.
Main class of the WorldInfoViewer application.
Fawkes library namespace.
Drawing widget that draws an (MSL-) soccer field with robots, opponents, and balls.
Definition: field_view.h:33