00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __INTERFACES_VISUALDISPLAY2DINTERFACE_H_
00025 #define __INTERFACES_VISUALDISPLAY2DINTERFACE_H_
00026
00027 #include <interface/interface.h>
00028 #include <interface/message.h>
00029 #include <interface/field_iterator.h>
00030
00031 namespace fawkes {
00032
00033 class VisualDisplay2DInterface : public Interface
00034 {
00035
00036 INTERFACE_MGMT_FRIENDS(VisualDisplay2DInterface)
00037
00038 public:
00039
00040
00041
00042
00043
00044 typedef enum {
00045 LS_SOLID ,
00046 LS_DASHED ,
00047 LS_DOTTED ,
00048 LS_DASH_DOTTED
00049 } LineStyle;
00050 const char * tostring_LineStyle(LineStyle value) const;
00051
00052
00053
00054
00055
00056
00057
00058 typedef enum {
00059 CENTERED ,
00060 NORTH ,
00061 EAST ,
00062 SOUTH ,
00063 WEST ,
00064 NORTH_EAST ,
00065 SOUTH_EAST ,
00066 SOUTH_WEST ,
00067 NORTH_WEST
00068 } Anchor;
00069 const char * tostring_Anchor(Anchor value) const;
00070
00071 private:
00072 #pragma pack(push,4)
00073
00074 typedef struct {
00075 int64_t timestamp_sec;
00076 int64_t timestamp_usec;
00077 uint32_t counter;
00078 } VisualDisplay2DInterface_data_t;
00079 #pragma pack(pop)
00080
00081 VisualDisplay2DInterface_data_t *data;
00082
00083 public:
00084
00085 class AddCartLineMessage : public Message
00086 {
00087 private:
00088 #pragma pack(push,4)
00089
00090 typedef struct {
00091 int64_t timestamp_sec;
00092 int64_t timestamp_usec;
00093 float x[2];
00094 float y[2];
00095
00096 LineStyle style;
00097 uint8_t color[4];
00098 } AddCartLineMessage_data_t;
00099 #pragma pack(pop)
00100
00101 AddCartLineMessage_data_t *data;
00102
00103 public:
00104 AddCartLineMessage(const float * ini_x, const float * ini_y, const LineStyle ini_style, const uint8_t * ini_color);
00105 AddCartLineMessage();
00106 ~AddCartLineMessage();
00107
00108 AddCartLineMessage(const AddCartLineMessage *m);
00109
00110 float * x() const;
00111 float x(unsigned int index) const;
00112 void set_x(unsigned int index, const float new_x);
00113 void set_x(const float * new_x);
00114 size_t maxlenof_x() const;
00115 float * y() const;
00116 float y(unsigned int index) const;
00117 void set_y(unsigned int index, const float new_y);
00118 void set_y(const float * new_y);
00119 size_t maxlenof_y() const;
00120 LineStyle style() const;
00121 void set_style(const LineStyle new_style);
00122 size_t maxlenof_style() const;
00123 uint8_t * color() const;
00124 uint8_t color(unsigned int index) const;
00125 void set_color(unsigned int index, const uint8_t new_color);
00126 void set_color(const uint8_t * new_color);
00127 size_t maxlenof_color() const;
00128 virtual Message * clone() const;
00129 };
00130
00131 class AddCartCircleMessage : public Message
00132 {
00133 private:
00134 #pragma pack(push,4)
00135
00136 typedef struct {
00137 int64_t timestamp_sec;
00138 int64_t timestamp_usec;
00139 float x;
00140 float y;
00141 float radius;
00142 LineStyle style;
00143 uint8_t color[4];
00144 } AddCartCircleMessage_data_t;
00145 #pragma pack(pop)
00146
00147 AddCartCircleMessage_data_t *data;
00148
00149 public:
00150 AddCartCircleMessage(const float ini_x, const float ini_y, const float ini_radius, const LineStyle ini_style, const uint8_t * ini_color);
00151 AddCartCircleMessage();
00152 ~AddCartCircleMessage();
00153
00154 AddCartCircleMessage(const AddCartCircleMessage *m);
00155
00156 float x() const;
00157 void set_x(const float new_x);
00158 size_t maxlenof_x() const;
00159 float y() const;
00160 void set_y(const float new_y);
00161 size_t maxlenof_y() const;
00162 float radius() const;
00163 void set_radius(const float new_radius);
00164 size_t maxlenof_radius() const;
00165 LineStyle style() const;
00166 void set_style(const LineStyle new_style);
00167 size_t maxlenof_style() const;
00168 uint8_t * color() const;
00169 uint8_t color(unsigned int index) const;
00170 void set_color(unsigned int index, const uint8_t new_color);
00171 void set_color(const uint8_t * new_color);
00172 size_t maxlenof_color() const;
00173 virtual Message * clone() const;
00174 };
00175
00176 class AddCartRectMessage : public Message
00177 {
00178 private:
00179 #pragma pack(push,4)
00180
00181 typedef struct {
00182 int64_t timestamp_sec;
00183 int64_t timestamp_usec;
00184 float x;
00185 float y;
00186 float width;
00187 float height;
00188 LineStyle style;
00189 uint8_t color[4];
00190 } AddCartRectMessage_data_t;
00191 #pragma pack(pop)
00192
00193 AddCartRectMessage_data_t *data;
00194
00195 public:
00196 AddCartRectMessage(const float ini_x, const float ini_y, const float ini_width, const float ini_height, const LineStyle ini_style, const uint8_t * ini_color);
00197 AddCartRectMessage();
00198 ~AddCartRectMessage();
00199
00200 AddCartRectMessage(const AddCartRectMessage *m);
00201
00202 float x() const;
00203 void set_x(const float new_x);
00204 size_t maxlenof_x() const;
00205 float y() const;
00206 void set_y(const float new_y);
00207 size_t maxlenof_y() const;
00208 float width() const;
00209 void set_width(const float new_width);
00210 size_t maxlenof_width() const;
00211 float height() const;
00212 void set_height(const float new_height);
00213 size_t maxlenof_height() const;
00214 LineStyle style() const;
00215 void set_style(const LineStyle new_style);
00216 size_t maxlenof_style() const;
00217 uint8_t * color() const;
00218 uint8_t color(unsigned int index) const;
00219 void set_color(unsigned int index, const uint8_t new_color);
00220 void set_color(const uint8_t * new_color);
00221 size_t maxlenof_color() const;
00222 virtual Message * clone() const;
00223 };
00224
00225 class AddCartTextMessage : public Message
00226 {
00227 private:
00228 #pragma pack(push,4)
00229
00230 typedef struct {
00231 int64_t timestamp_sec;
00232 int64_t timestamp_usec;
00233 float x;
00234 float y;
00235 char text[128];
00236 Anchor anchor;
00237
00238 float size;
00239 uint8_t color[4];
00240 } AddCartTextMessage_data_t;
00241 #pragma pack(pop)
00242
00243 AddCartTextMessage_data_t *data;
00244
00245 public:
00246 AddCartTextMessage(const float ini_x, const float ini_y, const char * ini_text, const Anchor ini_anchor, const float ini_size, const uint8_t * ini_color);
00247 AddCartTextMessage();
00248 ~AddCartTextMessage();
00249
00250 AddCartTextMessage(const AddCartTextMessage *m);
00251
00252 float x() const;
00253 void set_x(const float new_x);
00254 size_t maxlenof_x() const;
00255 float y() const;
00256 void set_y(const float new_y);
00257 size_t maxlenof_y() const;
00258 char * text() const;
00259 void set_text(const char * new_text);
00260 size_t maxlenof_text() const;
00261 Anchor anchor() const;
00262 void set_anchor(const Anchor new_anchor);
00263 size_t maxlenof_anchor() const;
00264 float size() const;
00265 void set_size(const float new_size);
00266 size_t maxlenof_size() const;
00267 uint8_t * color() const;
00268 uint8_t color(unsigned int index) const;
00269 void set_color(unsigned int index, const uint8_t new_color);
00270 void set_color(const uint8_t * new_color);
00271 size_t maxlenof_color() const;
00272 virtual Message * clone() const;
00273 };
00274
00275 class DeleteObjectMessage : public Message
00276 {
00277 private:
00278 #pragma pack(push,4)
00279
00280 typedef struct {
00281 int64_t timestamp_sec;
00282 int64_t timestamp_usec;
00283 uint32_t object_id;
00284
00285 } DeleteObjectMessage_data_t;
00286 #pragma pack(pop)
00287
00288 DeleteObjectMessage_data_t *data;
00289
00290 public:
00291 DeleteObjectMessage(const uint32_t ini_object_id);
00292 DeleteObjectMessage();
00293 ~DeleteObjectMessage();
00294
00295 DeleteObjectMessage(const DeleteObjectMessage *m);
00296
00297 uint32_t object_id() const;
00298 void set_object_id(const uint32_t new_object_id);
00299 size_t maxlenof_object_id() const;
00300 virtual Message * clone() const;
00301 };
00302
00303 class DeleteAllMessage : public Message
00304 {
00305 private:
00306 #pragma pack(push,4)
00307
00308 typedef struct {
00309 int64_t timestamp_sec;
00310 int64_t timestamp_usec;
00311 } DeleteAllMessage_data_t;
00312 #pragma pack(pop)
00313
00314 DeleteAllMessage_data_t *data;
00315
00316 public:
00317 DeleteAllMessage();
00318 ~DeleteAllMessage();
00319
00320 DeleteAllMessage(const DeleteAllMessage *m);
00321
00322 virtual Message * clone() const;
00323 };
00324
00325 virtual bool message_valid(const Message *message) const;
00326 private:
00327 VisualDisplay2DInterface();
00328 ~VisualDisplay2DInterface();
00329
00330 public:
00331
00332 uint32_t counter() const;
00333 void set_counter(const uint32_t new_counter);
00334 size_t maxlenof_counter() const;
00335 virtual Message * create_message(const char *type) const;
00336
00337 virtual void copy_values(const Interface *other);
00338 virtual const char * enum_tostring(const char *enumtype, int val) const;
00339
00340 };
00341
00342 }
00343
00344 #endif