60#ifndef guWhiteboard_Input3D_h
61#define guWhiteboard_Input3D_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_Input3D_DEFINED
73#define guWhiteboard_Input3D_DEFINED
76#define Input3D_DEFINED
90 void init(int16_t t_yaw = 0, int16_t t_pitch = 0, int16_t t_roll = 0, int16_t t_power = 0) {
102 Input3D(int16_t t_yaw = 0, int16_t t_pitch = 0, int16_t t_roll = 0, int16_t t_power = 0) {
103 this->init(t_yaw, t_pitch, t_roll, t_power);
138 return yaw() == t_other.
yaw()
146 return !(*
this == t_other);
151 return *
this ==
Input3D(t_other);
156 return !(*
this == t_other);
164 const int16_t &
yaw()
const
219#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
229#ifdef USE_WB_INPUT3D_C_CONVERSION
232 std::string descr = buffer;
235 std::ostringstream ss;
236 ss <<
"yaw=" <<
static_cast<signed>(this->
yaw());
238 ss <<
"pitch=" <<
static_cast<signed>(this->
pitch());
240 ss <<
"roll=" <<
static_cast<signed>(this->
roll());
242 ss <<
"power=" <<
static_cast<signed>(this->
power());
248#ifdef USE_WB_INPUT3D_C_CONVERSION
251 std::string toString = buffer;
254 std::ostringstream ss;
255 ss << static_cast<signed>(this->
yaw());
257 ss << static_cast<signed>(this->
pitch());
259 ss << static_cast<signed>(this->
roll());
261 ss << static_cast<signed>(this->
power());
266#ifdef USE_WB_INPUT3D_C_CONVERSION
271 char * str_cstr =
const_cast<char *
>(t_str.c_str());
272 size_t temp_length = strlen(str_cstr);
273 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
278 char* var_str = &var_str_buffer[0];
280 char* key = &key_buffer[0];
287 if (index == 0 && str_cstr[0] ==
'{') {
293 for (
int i = index; i < length; i++) {
295 if (bracecount == 0 && str_cstr[i] ==
'=') {
300 if (bracecount == 0 && isspace(str_cstr[i])) {
307 if (bracecount == 0 && str_cstr[i] ==
',') {
311 if (str_cstr[i] ==
'{') {
315 if (str_cstr[i] ==
'}') {
317 if (bracecount < 0) {
322 if (i == length - 1) {
326 if (endKey >= startKey && endKey - startKey < length) {
327 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
328 key[(endKey - startKey) + 1] = 0;
332 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
333 var_str[(index - startVar) + 1] = 0;
339 if (strlen(key) > 0) {
340 if (0 == strcmp(
"yaw", key)) {
342 }
else if (0 == strcmp(
"pitch", key)) {
344 }
else if (0 == strcmp(
"roll", key)) {
346 }
else if (0 == strcmp(
"power", key)) {
356 this->
set_yaw(
static_cast<int16_t
>(atoi(var_str)));
361 this->
set_pitch(
static_cast<int16_t
>(atoi(var_str)));
366 this->
set_roll(
static_cast<int16_t
>(atoi(var_str)));
371 this->
set_power(
static_cast<int16_t
>(atoi(var_str)));
378 }
while(index < length);