60#ifndef guWhiteboard_VisionLine_h
61#define guWhiteboard_VisionLine_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_VisionLine_DEFINED
73#define guWhiteboard_VisionLine_DEFINED
75#undef VisionLine_DEFINED
76#define VisionLine_DEFINED
103 this->init(t_lineEdgeTop, t_lineEdgeBottom);
144 return !(*
this == t_other);
154 return !(*
this == t_other);
187#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
197#ifdef USE_WB_VISION_LINE_C_CONVERSION
200 std::string descr = buffer;
203 std::ostringstream ss;
212#ifdef USE_WB_VISION_LINE_C_CONVERSION
215 std::string toString = buffer;
218 std::ostringstream ss;
226#ifdef USE_WB_VISION_LINE_C_CONVERSION
231 char * str_cstr =
const_cast<char *
>(t_str.c_str());
232 size_t temp_length = strlen(str_cstr);
233 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
238 char* var_str = &var_str_buffer[0];
240 char* key = &key_buffer[0];
247 if (index == 0 && str_cstr[0] ==
'{') {
253 for (
int i = index; i < length; i++) {
255 if (bracecount == 0 && str_cstr[i] ==
'=') {
260 if (bracecount == 0 && isspace(str_cstr[i])) {
267 if (bracecount == 0 && str_cstr[i] ==
',') {
271 if (str_cstr[i] ==
'{') {
275 if (str_cstr[i] ==
'}') {
277 if (bracecount < 0) {
282 if (i == length - 1) {
286 if (endKey >= startKey && endKey - startKey < length) {
287 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
288 key[(endKey - startKey) + 1] = 0;
292 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
293 var_str[(index - startVar) + 1] = 0;
299 if (strlen(key) > 0) {
300 if (0 == strcmp(
"lineEdgeTop", key)) {
302 }
else if (0 == strcmp(
"lineEdgeBottom", key)) {
328 }
while(index < length);
Provides a C++ wrapper around wb_pixel_coordinate_line.
std::string description()
void from_string(const std::string &t_str)
Provides a C++ wrapper around wb_vision_line.
const PixelCoordinateLine & lineEdgeTop() const
VisionLine & operator=(const VisionLine &t_other)
Copy Assignment Operator.
VisionLine(const struct wb_vision_line &t_other)
Copy Constructor.
void from_string(const std::string &t_str)
PixelCoordinateLine & lineEdgeBottom()
PixelCoordinateLine & lineEdgeTop()
void set_lineEdgeTop(const PixelCoordinateLine &t_newValue)
std::string description()
bool operator!=(const VisionLine &t_other) const
VisionLine(struct wb_pixel_coordinate_line t_lineEdgeTop=wb_pixel_coordinate_line(), struct wb_pixel_coordinate_line t_lineEdgeBottom=wb_pixel_coordinate_line())
Create a new VisionLine.
VisionLine(const VisionLine &t_other)
Copy Constructor.
VisionLine(const std::string &t_str)
String Constructor.
const PixelCoordinateLine & lineEdgeBottom() const
bool operator==(const VisionLine &t_other) const
void set_lineEdgeBottom(const PixelCoordinateLine &t_newValue)
WHITEBOARD_POSTER_STRING_CONVERSION.
WHITEBOARD_POSTER_STRING_CONVERSION.
struct wb_pixel_coordinate_line lineEdgeTop
line object representing the top edge of an SPL line.
struct wb_pixel_coordinate_line lineEdgeBottom
line object representing the bottom edge of an SPL line.
const char * wb_vision_line_description(const struct wb_vision_line *self, char *descString, size_t bufferSize)
Convert to a description string.
const char * wb_vision_line_to_string(const struct wb_vision_line *self, char *toString, size_t bufferSize)
Convert to a string.
struct wb_vision_line * wb_vision_line_from_string(struct wb_vision_line *self, const char *str)
Convert from a string.
#define VISION_LINE_DESC_BUFFER_SIZE
#define VISION_LINE_TO_STRING_BUFFER_SIZE