Klamp't  0.8.1
RobotTestGUI.h
1 #ifndef ROBOTTESTGUI
2 #define ROBOTTESTGUI
3 
4 #include "WorldGUI.h"
5 #include "View/RobotPoseWidget.h"
6 #include "View/ObjectPoseWidget.h"
7 #include "Sensing/Sensor.h"
8 #include "GLUIGUI.h"
9 #include <fstream>
10 using namespace Math3D;
11 using namespace GLDraw;
12 
51 {
52 public:
53  Robot* robot;
54  //internal state
55  int cur_link,cur_driver;
56  vector<bool> self_colliding;
57  //temp: sensors storage
58  RobotSensors robotSensors;
59 
60  int pose_ik,pose_objects;
61  vector<RobotPoseWidget> robotWidgets;
62  vector<RigidObjectPoseWidget> objectWidgets;
63  WidgetSet allWidgets;
64  GLDraw::Widget* lastActiveWidget;
65  int draw_geom,draw_bbs,draw_com,draw_frame,draw_expanded,draw_sensors;
66  int draw_self_collision_tests;
67  int output_ros, ros_status;
68 
69  vector<GLDisplayList> originalDisplayLists,expandedDisplayLists;
70 
72  virtual void Start();
73  void UpdateConfig();
74  virtual void RenderWorld();
75  virtual bool OnQuit();
76  virtual bool OnButtonPress(const string& button);
77  virtual bool OnButtonToggle(const string& button,int checked);
78  virtual bool OnCommand(const string& cmd,const string& args);
79  virtual void DoPassiveMouseMove(int x, int y);
80  virtual void BeginDrag(int x,int y,int button,int modifiers);
81  virtual void EndDrag(int x,int y,int button,int modifiers);
82  virtual void DoFreeDrag(int dx,int dy,int button);
83  void SetDrawExpanded(int value);
84 };
85 
86 #if HAVE_GLUI
87 
88 #if defined (__APPLE__) || defined (MACOSX)
89 #include <GL/glui.h>
90 #else
91 #include <GL/glui.h>
92 #endif //__APPLE__ || MACOSX
93 
94 class GLUIRobotTestGUI : public GLUIGUI
95 {
96  public:
97  RobotWorld* world;
98  Robot* robot;
99  //GUI state
100  GLUI* glui;
101  GLUI_Spinner* link_spinner, *link_value_spinner;
102  GLUI_Listbox* link_listbox;
103  GLUI_StaticText* link_info;
104  GLUI_Spinner* driver_spinner, *driver_value_spinner;
105  GLUI_Listbox* driver_listbox;
106  GLUI_StaticText* driver_info;
107  int cur_link,cur_driver;
108 
109  GLUIRobotTestGUI(GenericBackendBase* backend,RobotWorld* world,int w=800,int h=600);
110  virtual bool Initialize();
111  virtual void Handle_Control(int id);
112  virtual bool OnCommand(const string& cmd,const string& args);
113  void UpdateGUI();
114 };
115 #endif //HAVE_GLUI
116 #endif //ROBOTTESTGUI
The main robot type used in RobotSim.
Definition: Robot.h:79
A base class for GLUI GUIs.
Definition: GLUIGUI.h:18
The main world class containing multiple robots, objects, and static geometries (terrains). Lights and other viewport information may also be stored here.
Definition: World.h:20
RobotTest program.
Definition: RobotTestGUI.h:50
A generic gui with a RobotWorld which allows clicking on entities and loading files.
Definition: WorldGUI.h:21
Common robot posing routines.
A set of sensors for the robot.
Definition: Sensor.h:106
Definition: GenericGUI.h:84