60#ifndef guWhiteboard_PixelCoordinateLine_h
61#define guWhiteboard_PixelCoordinateLine_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_PixelCoordinateLine_DEFINED
73#define guWhiteboard_PixelCoordinateLine_DEFINED
75#undef PixelCoordinateLine_DEFINED
76#define PixelCoordinateLine_DEFINED
80#include <guunits/guunits.h>
81#include <gucoordinates/gucoordinates.h>
84#include <guunits/guunits.h>
85#include <gucoordinates/gucoordinates.h>
110 this->init(t_start, t_end);
117 this->init(t_other.
start(), t_other.
end());
124 this->init(t_other.
start, t_other.
end);
131 this->init(t_other.
start(), t_other.
end());
139 this->init(t_other.
start, t_other.
end);
151 return !(*
this == t_other);
161 return !(*
this == t_other);
194#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
204#ifdef USE_WB_PIXEL_COORDINATE_LINE_C_CONVERSION
207 std::string descr = buffer;
210 std::ostringstream ss;
219#ifdef USE_WB_PIXEL_COORDINATE_LINE_C_CONVERSION
222 std::string toString = buffer;
225 std::ostringstream ss;
233#ifdef USE_WB_PIXEL_COORDINATE_LINE_C_CONVERSION
238 char * str_cstr =
const_cast<char *
>(t_str.c_str());
239 size_t temp_length = strlen(str_cstr);
240 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
245 char* var_str = &var_str_buffer[0];
247 char* key = &key_buffer[0];
254 if (index == 0 && str_cstr[0] ==
'{') {
260 for (
int i = index; i < length; i++) {
262 if (bracecount == 0 && str_cstr[i] ==
'=') {
267 if (bracecount == 0 && isspace(str_cstr[i])) {
274 if (bracecount == 0 && str_cstr[i] ==
',') {
278 if (str_cstr[i] ==
'{') {
282 if (str_cstr[i] ==
'}') {
284 if (bracecount < 0) {
289 if (i == length - 1) {
293 if (endKey >= startKey && endKey - startKey < length) {
294 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
295 key[(endKey - startKey) + 1] = 0;
299 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
300 var_str[(index - startVar) + 1] = 0;
306 if (strlen(key) > 0) {
307 if (0 == strcmp(
"start", key)) {
309 }
else if (0 == strcmp(
"end", key)) {
335 }
while(index < length);
Provides a C++ wrapper around wb_pixel_coordinate.
std::string description()
void from_string(const std::string &t_str)
GU::PixelCoordinate pixelCoordinate(const uint16_t resWidth, const uint16_t resHeight)
Provides a C++ wrapper around wb_pixel_coordinate_line.
PixelCoordinate & start()
PixelCoordinateLine(const std::string &t_str)
String Constructor.
bool operator==(const PixelCoordinateLine &t_other) const
std::string description()
const PixelCoordinate & end() const
bool operator!=(const PixelCoordinateLine &t_other) const
void set_start(const PixelCoordinate &t_newValue)
void set_end(const PixelCoordinate &t_newValue)
PixelCoordinateLine(const struct wb_pixel_coordinate_line &t_other)
Copy Constructor.
const PixelCoordinate & start() const
void from_string(const std::string &t_str)
PixelCoordinateLine & operator=(const PixelCoordinateLine &t_other)
Copy Assignment Operator.
GU::PixelCoordinate startPixelCoordinate(const uint16_t resWidth, const uint16_t resHeight)
WHITEBOARD_POSTER_STRING_CONVERSION.
PixelCoordinateLine(const PixelCoordinateLine &t_other)
Copy Constructor.
PixelCoordinateLine(struct wb_pixel_coordinate t_start=wb_pixel_coordinate(), struct wb_pixel_coordinate t_end=wb_pixel_coordinate())
Create a new PixelCoordinateLine.
GU::PixelCoordinate endPixelCoordinate(const uint16_t resWidth, const uint16_t resHeight)
WHITEBOARD_POSTER_STRING_CONVERSION.
struct wb_pixel_coordinate end
End point of the line.
struct wb_pixel_coordinate start
Start point of the line.
WHITEBOARD_POSTER_STRING_CONVERSION.
struct wb_pixel_coordinate_line * wb_pixel_coordinate_line_from_string(struct wb_pixel_coordinate_line *self, const char *str)
Convert from a string.
const char * wb_pixel_coordinate_line_to_string(const struct wb_pixel_coordinate_line *self, char *toString, size_t bufferSize)
Convert to a string.
const char * wb_pixel_coordinate_line_description(const struct wb_pixel_coordinate_line *self, char *descString, size_t bufferSize)
Convert to a description string.
#define PIXEL_COORDINATE_LINE_TO_STRING_BUFFER_SIZE
#define PIXEL_COORDINATE_LINE_DESC_BUFFER_SIZE