gusimplewhiteboard
VisionFieldFeatures.hpp
Go to the documentation of this file.
1/*
2 * file VisionFieldFeatures.hpp
3 *
4 * This file was generated by classgenerator from vision_field_features.gen.
5 * DO NOT CHANGE MANUALLY!
6 *
7 * Copyright © 2021 Eugene Gilmore. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer in the documentation and/or other materials
19 * provided with the distribution.
20 *
21 * 3. All advertising materials mentioning features or use of this
22 * software must display the following acknowledgement:
23 *
24 * This product includes software developed by Eugene Gilmore.
25 *
26 * 4. Neither the name of the author nor the names of contributors
27 * may be used to endorse or promote products derived from this
28 * software without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
34 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
37 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
38 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
39 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 *
42 * -----------------------------------------------------------------------
43 * This program is free software; you can redistribute it and/or
44 * modify it under the above terms or under the terms of the GNU
45 * General Public License as published by the Free Software Foundation;
46 * either version 2 of the License, or (at your option) any later version.
47 *
48 * This program is distributed in the hope that it will be useful,
49 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 * GNU General Public License for more details.
52 *
53 * You should have received a copy of the GNU General Public License
54 * along with this program; if not, see http://www.gnu.org/licenses/
55 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
56 * Fifth Floor, Boston, MA 02110-1301, USA.
57 *
58 */
59
60#ifndef guWhiteboard_VisionFieldFeatures_h
61#define guWhiteboard_VisionFieldFeatures_h
62
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
64#include <cstdlib>
65#include <string.h>
66#include <sstream>
67#endif
68
69#include <gu_util.h>
71
72#undef guWhiteboard_VisionFieldFeatures_DEFINED
73#define guWhiteboard_VisionFieldFeatures_DEFINED
74
75#undef VisionFieldFeatures_DEFINED
76#define VisionFieldFeatures_DEFINED
77
78#include "VisionFieldFeature.h"
79
80namespace guWhiteboard {
81
86
87 private:
88
92 void init(const struct wb_vision_field_feature t_fieldCorner[8] = NULLPTR, const struct wb_vision_field_feature t_fieldIntersection[8] = NULLPTR, const struct wb_vision_field_feature t_fieldCrosses[3] = NULLPTR, uint8_t t_numCorners = 0, uint8_t t_numIntersections = 0, uint8_t t_numCrosses = 0, uint16_t t_res_width = 0, uint16_t t_res_height = 0) {
93 if (t_fieldCorner != NULLPTR) {
95 } else {
98 }
99 if (t_fieldIntersection != NULLPTR) {
101 } else {
104 }
105 if (t_fieldCrosses != NULLPTR) {
107 } else {
110 }
111 set_numCorners(t_numCorners);
112 set_numIntersections(t_numIntersections);
113 set_numCrosses(t_numCrosses);
114 set_res_width(t_res_width);
115 set_res_height(t_res_height);
116 }
117
118 public:
119
123 VisionFieldFeatures(const struct wb_vision_field_feature t_fieldCorner[8] = NULLPTR, const struct wb_vision_field_feature t_fieldIntersection[8] = NULLPTR, const struct wb_vision_field_feature t_fieldCrosses[3] = NULLPTR, uint8_t t_numCorners = 0, uint8_t t_numIntersections = 0, uint8_t t_numCrosses = 0, uint16_t t_res_width = 0, uint16_t t_res_height = 0) {
124 this->init(t_fieldCorner, t_fieldIntersection, t_fieldCrosses, t_numCorners, t_numIntersections, t_numCrosses, t_res_width, t_res_height);
125 }
126
131 this->init(t_other.fieldCorner(), t_other.fieldIntersection(), t_other.fieldCrosses(), t_other.numCorners(), t_other.numIntersections(), t_other.numCrosses(), t_other.res_width(), t_other.res_height());
132 }
133
138 this->init(t_other.fieldCorner, t_other.fieldIntersection, t_other.fieldCrosses, t_other.numCorners, t_other.numIntersections, t_other.numCrosses, t_other.res_width, t_other.res_height);
139 }
140
145 this->init(t_other.fieldCorner(), t_other.fieldIntersection(), t_other.fieldCrosses(), t_other.numCorners(), t_other.numIntersections(), t_other.numCrosses(), t_other.res_width(), t_other.res_height());
146 return *this;
147 }
148
153 this->init(t_other.fieldCorner, t_other.fieldIntersection, t_other.fieldCrosses, t_other.numCorners, t_other.numIntersections, t_other.numCrosses, t_other.res_width, t_other.res_height);
154 return *this;
155 }
156
157 bool operator ==(const VisionFieldFeatures &t_other) const
158 {
159 if (!(numCorners() == t_other.numCorners()
160 && numIntersections() == t_other.numIntersections()
161 && numCrosses() == t_other.numCrosses()
162 && res_width() == t_other.res_width()
163 && res_height() == t_other.res_height()))
164 {
165 return false;
166 }
167 for (int fieldCorner_0_index = 0; fieldCorner_0_index < 8; fieldCorner_0_index++)
168 {
169 if (!(VisionFieldFeature(fieldCorner(fieldCorner_0_index)) == VisionFieldFeature(t_other.fieldCorner(fieldCorner_0_index)))) return false;
170 }
171 for (int fieldIntersection_0_index = 0; fieldIntersection_0_index < 8; fieldIntersection_0_index++)
172 {
173 if (!(VisionFieldFeature(fieldIntersection(fieldIntersection_0_index)) == VisionFieldFeature(t_other.fieldIntersection(fieldIntersection_0_index)))) return false;
174 }
175 for (int fieldCrosses_0_index = 0; fieldCrosses_0_index < 3; fieldCrosses_0_index++)
176 {
177 if (!(VisionFieldFeature(fieldCrosses(fieldCrosses_0_index)) == VisionFieldFeature(t_other.fieldCrosses(fieldCrosses_0_index)))) return false;
178 }
179 return true;
180 }
181
182 bool operator !=(const VisionFieldFeatures &t_other) const
183 {
184 return !(*this == t_other);
185 }
186
187 bool operator ==(const wb_vision_field_features &t_other) const
188 {
189 return *this == VisionFieldFeatures(t_other);
190 }
191
192 bool operator !=(const wb_vision_field_features &t_other) const
193 {
194 return !(*this == t_other);
195 }
196
198 {
199 return static_cast<const VisionFieldFeature *>(&(wb_vision_field_features::fieldCorner[0]));
200 }
201
202 size_t fieldCorner_size() const
203 {
205 }
206
208 {
209 return const_cast<VisionFieldFeature &>(static_cast<const VisionFieldFeature &>(wb_vision_field_features::fieldCorner[t_i]));
210 }
211
212 const VisionFieldFeature & fieldCorner(int t_i) const
213 {
214 return static_cast<const VisionFieldFeature &>(wb_vision_field_features::fieldCorner[t_i]);
215 }
216
217 void set_fieldCorner(const VisionFieldFeature *t_newValue)
218 {
220 }
221
222 void set_fieldCorner(const VisionFieldFeature &t_newValue, int t_i)
223 {
225 }
226
228 {
229 return static_cast<const VisionFieldFeature *>(&(wb_vision_field_features::fieldIntersection[0]));
230 }
231
233 {
235 }
236
238 {
239 return const_cast<VisionFieldFeature &>(static_cast<const VisionFieldFeature &>(wb_vision_field_features::fieldIntersection[t_i]));
240 }
241
243 {
244 return static_cast<const VisionFieldFeature &>(wb_vision_field_features::fieldIntersection[t_i]);
245 }
246
248 {
250 }
251
252 void set_fieldIntersection(const VisionFieldFeature &t_newValue, int t_i)
253 {
255 }
256
258 {
259 return static_cast<const VisionFieldFeature *>(&(wb_vision_field_features::fieldCrosses[0]));
260 }
261
262 size_t fieldCrosses_size() const
263 {
265 }
266
268 {
269 return const_cast<VisionFieldFeature &>(static_cast<const VisionFieldFeature &>(wb_vision_field_features::fieldCrosses[t_i]));
270 }
271
272 const VisionFieldFeature & fieldCrosses(int t_i) const
273 {
274 return static_cast<const VisionFieldFeature &>(wb_vision_field_features::fieldCrosses[t_i]);
275 }
276
277 void set_fieldCrosses(const VisionFieldFeature *t_newValue)
278 {
280 }
281
282 void set_fieldCrosses(const VisionFieldFeature &t_newValue, int t_i)
283 {
285 }
286
287 uint8_t & numCorners()
288 {
290 }
291
292 const uint8_t & numCorners() const
293 {
295 }
296
297 void set_numCorners(const uint8_t &t_newValue)
298 {
300 }
301
303 {
305 }
306
307 const uint8_t & numIntersections() const
308 {
310 }
311
312 void set_numIntersections(const uint8_t &t_newValue)
313 {
315 }
316
317 uint8_t & numCrosses()
318 {
320 }
321
322 const uint8_t & numCrosses() const
323 {
325 }
326
327 void set_numCrosses(const uint8_t &t_newValue)
328 {
330 }
331
332 uint16_t & res_width()
333 {
335 }
336
337 const uint16_t & res_width() const
338 {
340 }
341
342 void set_res_width(const uint16_t &t_newValue)
343 {
345 }
346
347 uint16_t & res_height()
348 {
350 }
351
352 const uint16_t & res_height() const
353 {
355 }
356
357 void set_res_height(const uint16_t &t_newValue)
358 {
360 }
361
362#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
366 VisionFieldFeatures(const std::string &t_str) {
367 this->init();
368 this->from_string(t_str);
369 }
370
371 std::string description() {
372#ifdef USE_WB_VISION_FIELD_FEATURES_C_CONVERSION
374 wb_vision_field_features_description(this, buffer, sizeof(buffer));
375 std::string descr = buffer;
376 return descr;
377#else
378 std::ostringstream ss;
379 bool fieldCorner_first = true;
380 ss << "fieldCorner={";
381 for (int i = 0; i < VISION_FIELD_FEATURES_FIELDCORNER_ARRAY_SIZE; i++) {
382 ss << (fieldCorner_first ? "" : ", ") << "{" << VisionFieldFeature(this->fieldCorner(i)).description() << "}";
383 fieldCorner_first = false;
384 }
385 ss << "}";
386 ss << ", ";
387 bool fieldIntersection_first = true;
388 ss << "fieldIntersection={";
390 ss << (fieldIntersection_first ? "" : ", ") << "{" << VisionFieldFeature(this->fieldIntersection(i)).description() << "}";
391 fieldIntersection_first = false;
392 }
393 ss << "}";
394 ss << ", ";
395 bool fieldCrosses_first = true;
396 ss << "fieldCrosses={";
397 for (int i = 0; i < VISION_FIELD_FEATURES_FIELDCROSSES_ARRAY_SIZE; i++) {
398 ss << (fieldCrosses_first ? "" : ", ") << "{" << VisionFieldFeature(this->fieldCrosses(i)).description() << "}";
399 fieldCrosses_first = false;
400 }
401 ss << "}";
402 ss << ", ";
403 ss << "numCorners=" << static_cast<unsigned>(this->numCorners());
404 ss << ", ";
405 ss << "numIntersections=" << static_cast<unsigned>(this->numIntersections());
406 ss << ", ";
407 ss << "numCrosses=" << static_cast<unsigned>(this->numCrosses());
408 ss << ", ";
409 ss << "res_width=" << static_cast<unsigned>(this->res_width());
410 ss << ", ";
411 ss << "res_height=" << static_cast<unsigned>(this->res_height());
412 return ss.str();
413#endif
414 }
415
416 std::string to_string() {
417#ifdef USE_WB_VISION_FIELD_FEATURES_C_CONVERSION
419 wb_vision_field_features_to_string(this, buffer, sizeof(buffer));
420 std::string toString = buffer;
421 return toString;
422#else
423 std::ostringstream ss;
424 bool fieldCorner_first = true;
425 ss << "{";
426 for (int i = 0; i < VISION_FIELD_FEATURES_FIELDCORNER_ARRAY_SIZE; i++) {
427 ss << (fieldCorner_first ? "" : ", ") << "{" << VisionFieldFeature(this->fieldCorner(i)).to_string() << "}";
428 fieldCorner_first = false;
429 }
430 ss << "}";
431 ss << ", ";
432 bool fieldIntersection_first = true;
433 ss << "{";
435 ss << (fieldIntersection_first ? "" : ", ") << "{" << VisionFieldFeature(this->fieldIntersection(i)).to_string() << "}";
436 fieldIntersection_first = false;
437 }
438 ss << "}";
439 ss << ", ";
440 bool fieldCrosses_first = true;
441 ss << "{";
442 for (int i = 0; i < VISION_FIELD_FEATURES_FIELDCROSSES_ARRAY_SIZE; i++) {
443 ss << (fieldCrosses_first ? "" : ", ") << "{" << VisionFieldFeature(this->fieldCrosses(i)).to_string() << "}";
444 fieldCrosses_first = false;
445 }
446 ss << "}";
447 ss << ", ";
448 ss << static_cast<unsigned>(this->numCorners());
449 ss << ", ";
450 ss << static_cast<unsigned>(this->numIntersections());
451 ss << ", ";
452 ss << static_cast<unsigned>(this->numCrosses());
453 ss << ", ";
454 ss << static_cast<unsigned>(this->res_width());
455 ss << ", ";
456 ss << static_cast<unsigned>(this->res_height());
457 return ss.str();
458#endif
459 }
460
461#ifdef USE_WB_VISION_FIELD_FEATURES_C_CONVERSION
462 void from_string(const std::string &t_str) {
463 wb_vision_field_features_from_string(this, t_str.c_str());
464#else
465 void from_string(const std::string &t_str) {
466 char * str_cstr = const_cast<char *>(t_str.c_str());
467 size_t temp_length = strlen(str_cstr);
468 int length = (temp_length <= INT_MAX) ? static_cast<int>(static_cast<ssize_t>(temp_length)) : -1;
469 if (length < 1 || length > VISION_FIELD_FEATURES_DESC_BUFFER_SIZE) {
470 return;
471 }
472 char var_str_buffer[VISION_FIELD_FEATURES_DESC_BUFFER_SIZE + 1];
473 char* var_str = &var_str_buffer[0];
474 char key_buffer[18];
475 char* key = &key_buffer[0];
476 int bracecount = 0;
477 int lastBrace = -1;
478 int startVar = 0;
479 int index = 0;
480 int startKey = 0;
481 int endKey = -1;
482 int varIndex = 0;
483 if (index == 0 && str_cstr[0] == '{') {
484 index = 1;
485 }
486 startVar = index;
487 startKey = startVar;
488 do {
489 for (int i = index; i < length; i++) {
490 index = i + 1;
491 if (bracecount == 0 && str_cstr[i] == '=') {
492 endKey = i - 1;
493 startVar = index;
494 continue;
495 }
496 if (bracecount == 0 && isspace(str_cstr[i])) {
497 startVar = index;
498 if (endKey == -1) {
499 startKey = index;
500 }
501 continue;
502 }
503 if (bracecount == 0 && str_cstr[i] == ',') {
504 index = i - 1;
505 break;
506 }
507 if (str_cstr[i] == '{') {
508 bracecount++;
509 if (bracecount == 1) {
510 lastBrace = i;
511 }
512 continue;
513 }
514 if (str_cstr[i] == '}') {
515 bracecount--;
516 if (bracecount < 0) {
517 index = i - 1;
518 break;
519 }
520 }
521 if (i == length - 1) {
522 index = i;
523 }
524 }
525 if (endKey >= startKey && endKey - startKey < length) {
526 strncpy(key, str_cstr + startKey, static_cast<size_t>((endKey - startKey) + 1));
527 key[(endKey - startKey) + 1] = 0;
528 } else {
529 key[0] = 0;
530 }
531 strncpy(var_str, str_cstr + startVar, static_cast<size_t>((index - startVar) + 1));
532 var_str[(index - startVar) + 1] = 0;
533 bracecount = 0;
534 index += 2;
535 startVar = index;
536 startKey = startVar;
537 endKey = -1;
538 if (strlen(key) > 0) {
539 if (0 == strcmp("fieldCorner", key)) {
540 varIndex = 0;
541 } else if (0 == strcmp("fieldIntersection", key)) {
542 varIndex = 1;
543 } else if (0 == strcmp("fieldCrosses", key)) {
544 varIndex = 2;
545 } else if (0 == strcmp("numCorners", key)) {
546 varIndex = 3;
547 } else if (0 == strcmp("numIntersections", key)) {
548 varIndex = 4;
549 } else if (0 == strcmp("numCrosses", key)) {
550 varIndex = 5;
551 } else if (0 == strcmp("res_width", key)) {
552 varIndex = 6;
553 } else if (0 == strcmp("res_height", key)) {
554 varIndex = 7;
555 } else {
556 varIndex = -1;
557 }
558 }
559 switch (varIndex) {
560 case -1: { break; }
561 case 0:
562 {
563 int restartIndex = index;
564 index = lastBrace + 1;
565 startVar = index;
566 startKey = startVar;
567 endKey = -1;
568 bracecount = 0;
569 for (int fieldCorner_0_index = 0; fieldCorner_0_index < VISION_FIELD_FEATURES_FIELDCORNER_ARRAY_SIZE; fieldCorner_0_index++) {
570 for (int i = index; i < length; i++) {
571 index = i + 1;
572 if (bracecount == 0 && str_cstr[i] == '=') {
573 endKey = i - 1;
574 startVar = index;
575 continue;
576 }
577 if (bracecount == 0 && isspace(str_cstr[i])) {
578 startVar = index;
579 if (endKey == -1) {
580 startKey = index;
581 }
582 continue;
583 }
584 if (bracecount == 0 && str_cstr[i] == ',') {
585 index = i - 1;
586 break;
587 }
588 if (str_cstr[i] == '{') {
589 bracecount++;
590 continue;
591 }
592 if (str_cstr[i] == '}') {
593 bracecount--;
594 if (bracecount < 0) {
595 index = i - 1;
596 break;
597 }
598 }
599 if (i == length - 1) {
600 index = i;
601 }
602 }
603 if (endKey >= startKey && endKey - startKey < length) {
604 strncpy(key, str_cstr + startKey, static_cast<size_t>((endKey - startKey) + 1));
605 key[(endKey - startKey) + 1] = 0;
606 } else {
607 key[0] = 0;
608 }
609 strncpy(var_str, str_cstr + startVar, static_cast<size_t>((index - startVar) + 1));
610 var_str[(index - startVar) + 1] = 0;
611 bracecount = 0;
612 index += 2;
613 startVar = index;
614 startKey = startVar;
615 endKey = -1;
616 VisionFieldFeature fieldCorner_0_temp = VisionFieldFeature();
617 fieldCorner_0_temp.from_string(var_str);
618 struct wb_vision_field_feature fieldCorner_0 = fieldCorner_0_temp;
619 this->set_fieldCorner(fieldCorner_0, fieldCorner_0_index);
620 }
621 index = restartIndex;
622 break;
623 }
624 case 1:
625 {
626 int restartIndex = index;
627 index = lastBrace + 1;
628 startVar = index;
629 startKey = startVar;
630 endKey = -1;
631 bracecount = 0;
632 for (int fieldIntersection_0_index = 0; fieldIntersection_0_index < VISION_FIELD_FEATURES_FIELDINTERSECTION_ARRAY_SIZE; fieldIntersection_0_index++) {
633 for (int i = index; i < length; i++) {
634 index = i + 1;
635 if (bracecount == 0 && str_cstr[i] == '=') {
636 endKey = i - 1;
637 startVar = index;
638 continue;
639 }
640 if (bracecount == 0 && isspace(str_cstr[i])) {
641 startVar = index;
642 if (endKey == -1) {
643 startKey = index;
644 }
645 continue;
646 }
647 if (bracecount == 0 && str_cstr[i] == ',') {
648 index = i - 1;
649 break;
650 }
651 if (str_cstr[i] == '{') {
652 bracecount++;
653 continue;
654 }
655 if (str_cstr[i] == '}') {
656 bracecount--;
657 if (bracecount < 0) {
658 index = i - 1;
659 break;
660 }
661 }
662 if (i == length - 1) {
663 index = i;
664 }
665 }
666 if (endKey >= startKey && endKey - startKey < length) {
667 strncpy(key, str_cstr + startKey, static_cast<size_t>((endKey - startKey) + 1));
668 key[(endKey - startKey) + 1] = 0;
669 } else {
670 key[0] = 0;
671 }
672 strncpy(var_str, str_cstr + startVar, static_cast<size_t>((index - startVar) + 1));
673 var_str[(index - startVar) + 1] = 0;
674 bracecount = 0;
675 index += 2;
676 startVar = index;
677 startKey = startVar;
678 endKey = -1;
679 VisionFieldFeature fieldIntersection_0_temp = VisionFieldFeature();
680 fieldIntersection_0_temp.from_string(var_str);
681 struct wb_vision_field_feature fieldIntersection_0 = fieldIntersection_0_temp;
682 this->set_fieldIntersection(fieldIntersection_0, fieldIntersection_0_index);
683 }
684 index = restartIndex;
685 break;
686 }
687 case 2:
688 {
689 int restartIndex = index;
690 index = lastBrace + 1;
691 startVar = index;
692 startKey = startVar;
693 endKey = -1;
694 bracecount = 0;
695 for (int fieldCrosses_0_index = 0; fieldCrosses_0_index < VISION_FIELD_FEATURES_FIELDCROSSES_ARRAY_SIZE; fieldCrosses_0_index++) {
696 for (int i = index; i < length; i++) {
697 index = i + 1;
698 if (bracecount == 0 && str_cstr[i] == '=') {
699 endKey = i - 1;
700 startVar = index;
701 continue;
702 }
703 if (bracecount == 0 && isspace(str_cstr[i])) {
704 startVar = index;
705 if (endKey == -1) {
706 startKey = index;
707 }
708 continue;
709 }
710 if (bracecount == 0 && str_cstr[i] == ',') {
711 index = i - 1;
712 break;
713 }
714 if (str_cstr[i] == '{') {
715 bracecount++;
716 continue;
717 }
718 if (str_cstr[i] == '}') {
719 bracecount--;
720 if (bracecount < 0) {
721 index = i - 1;
722 break;
723 }
724 }
725 if (i == length - 1) {
726 index = i;
727 }
728 }
729 if (endKey >= startKey && endKey - startKey < length) {
730 strncpy(key, str_cstr + startKey, static_cast<size_t>((endKey - startKey) + 1));
731 key[(endKey - startKey) + 1] = 0;
732 } else {
733 key[0] = 0;
734 }
735 strncpy(var_str, str_cstr + startVar, static_cast<size_t>((index - startVar) + 1));
736 var_str[(index - startVar) + 1] = 0;
737 bracecount = 0;
738 index += 2;
739 startVar = index;
740 startKey = startVar;
741 endKey = -1;
742 VisionFieldFeature fieldCrosses_0_temp = VisionFieldFeature();
743 fieldCrosses_0_temp.from_string(var_str);
744 struct wb_vision_field_feature fieldCrosses_0 = fieldCrosses_0_temp;
745 this->set_fieldCrosses(fieldCrosses_0, fieldCrosses_0_index);
746 }
747 index = restartIndex;
748 break;
749 }
750 case 3:
751 {
752 this->set_numCorners(static_cast<uint8_t>(atoi(var_str)));
753 break;
754 }
755 case 4:
756 {
757 this->set_numIntersections(static_cast<uint8_t>(atoi(var_str)));
758 break;
759 }
760 case 5:
761 {
762 this->set_numCrosses(static_cast<uint8_t>(atoi(var_str)));
763 break;
764 }
765 case 6:
766 {
767 this->set_res_width(static_cast<uint16_t>(atoi(var_str)));
768 break;
769 }
770 case 7:
771 {
772 this->set_res_height(static_cast<uint16_t>(atoi(var_str)));
773 break;
774 }
775 }
776 if (varIndex >= 0) {
777 varIndex++;
778 }
779 } while(index < length);
780#endif
781 }
782#endif
783 };
784
785}
786
787#endif
Provides a C++ wrapper around wb_vision_field_feature.
void from_string(const std::string &t_str)
Provides a C++ wrapper around wb_vision_field_features.
void set_fieldCorner(const VisionFieldFeature *t_newValue)
VisionFieldFeatures(const VisionFieldFeatures &t_other)
Copy Constructor.
void set_fieldIntersection(const VisionFieldFeature *t_newValue)
VisionFieldFeature & fieldIntersection(int t_i)
VisionFieldFeature & fieldCrosses(int t_i)
VisionFieldFeatures(const struct wb_vision_field_features &t_other)
Copy Constructor.
void set_res_width(const uint16_t &t_newValue)
bool operator==(const VisionFieldFeatures &t_other) const
VisionFieldFeatures(const struct wb_vision_field_feature t_fieldCorner[8]=NULLPTR, const struct wb_vision_field_feature t_fieldIntersection[8]=NULLPTR, const struct wb_vision_field_feature t_fieldCrosses[3]=NULLPTR, uint8_t t_numCorners=0, uint8_t t_numIntersections=0, uint8_t t_numCrosses=0, uint16_t t_res_width=0, uint16_t t_res_height=0)
Create a new VisionFieldFeatures.
void set_fieldIntersection(const VisionFieldFeature &t_newValue, int t_i)
VisionFieldFeatures(const std::string &t_str)
String Constructor.
const VisionFieldFeature * fieldCrosses() const
void set_numCorners(const uint8_t &t_newValue)
void set_fieldCrosses(const VisionFieldFeature &t_newValue, int t_i)
const VisionFieldFeature * fieldCorner() const
const VisionFieldFeature & fieldCrosses(int t_i) const
void from_string(const std::string &t_str)
const VisionFieldFeature & fieldCorner(int t_i) const
void set_numCrosses(const uint8_t &t_newValue)
VisionFieldFeatures & operator=(const VisionFieldFeatures &t_other)
Copy Assignment Operator.
void set_res_height(const uint16_t &t_newValue)
const VisionFieldFeature & fieldIntersection(int t_i) const
const uint8_t & numIntersections() const
bool operator!=(const VisionFieldFeatures &t_other) const
void set_fieldCorner(const VisionFieldFeature &t_newValue, int t_i)
VisionFieldFeature & fieldCorner(int t_i)
void set_fieldCrosses(const VisionFieldFeature *t_newValue)
void set_numIntersections(const uint8_t &t_newValue)
const VisionFieldFeature * fieldIntersection() const
/file APM_Interface.h
WHITEBOARD_POSTER_STRING_CONVERSION.
Posting by Vision of the field corners, T-Intersections and crosses that have been seen.
uint8_t numCrosses
Numer of Crosses in this message.
uint8_t numCorners
Number of corners in this message.
uint16_t res_width
The resolution width.
struct wb_vision_field_feature fieldIntersection[8]
Location of T-Intersections on the field.
uint8_t numIntersections
Number of T-Intersections in this message.
struct wb_vision_field_feature fieldCorner[8]
Location of corners on the field.
uint16_t res_height
The resolution height.
struct wb_vision_field_feature fieldCrosses[3]
Location of T-Intersections on the field.
struct wb_vision_field_features * wb_vision_field_features_from_string(struct wb_vision_field_features *self, const char *str)
Convert from a string.
const char * wb_vision_field_features_to_string(const struct wb_vision_field_features *self, char *toString, size_t bufferSize)
Convert to a string.
const char * wb_vision_field_features_description(const struct wb_vision_field_features *self, char *descString, size_t bufferSize)
Convert to a description string.
#define VISION_FIELD_FEATURES_FIELDCORNER_ARRAY_SIZE
WHITEBOARD_POSTER_STRING_CONVERSION.
#define VISION_FIELD_FEATURES_DESC_BUFFER_SIZE
#define VISION_FIELD_FEATURES_FIELDCROSSES_ARRAY_SIZE
#define VISION_FIELD_FEATURES_TO_STRING_BUFFER_SIZE
#define VISION_FIELD_FEATURES_FIELDINTERSECTION_ARRAY_SIZE