24 #include <interfaces/LaserBoxFilterInterface.h>
26 #include <core/exceptions/software.h>
46 LaserBoxFilterInterface::LaserBoxFilterInterface() : Interface()
48 data_size =
sizeof(LaserBoxFilterInterface_data_t);
49 data_ptr = malloc(data_size);
50 data = (LaserBoxFilterInterface_data_t *)data_ptr;
51 data_ts = (interface_data_ts_t *)data_ptr;
52 memset(data_ptr, 0, data_size);
53 add_fieldinfo(IFT_UINT32,
"num_boxes", 1, &data->num_boxes);
54 add_messageinfo(
"CreateNewBoxFilterMessage");
55 unsigned char tmp_hash[] = {0xd5, 0xd3, 0x35, 0xa5, 0xf5, 0xeb, 0xfe, 0xe0, 0x2e, 0x9e, 0xda, 0xa8, 0x77, 0x6f, 0x3, 0x74};
60 LaserBoxFilterInterface::~LaserBoxFilterInterface()
70 LaserBoxFilterInterface::num_boxes()
const
72 return data->num_boxes;
80 LaserBoxFilterInterface::maxlenof_num_boxes()
const
90 LaserBoxFilterInterface::set_num_boxes(
const uint32_t new_num_boxes)
92 data->num_boxes = new_num_boxes;
98 LaserBoxFilterInterface::create_message(
const char *type)
const
100 if ( strncmp(
"CreateNewBoxFilterMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
101 return new CreateNewBoxFilterMessage();
104 "message type for this interface type.", type);
113 LaserBoxFilterInterface::copy_values(
const Interface *other)
115 const LaserBoxFilterInterface *oi = dynamic_cast<const LaserBoxFilterInterface *>(other);
118 type(), other->type());
120 memcpy(data, oi->data,
sizeof(LaserBoxFilterInterface_data_t));
124 LaserBoxFilterInterface::enum_tostring(
const char *enumtype,
int val)
const
126 throw UnknownTypeException(
"Unknown enum type %s", enumtype);
143 LaserBoxFilterInterface::CreateNewBoxFilterMessage::CreateNewBoxFilterMessage(
const double * ini_p1,
const double * ini_p2,
const double * ini_p3,
const double * ini_p4) :
Message(
"CreateNewBoxFilterMessage")
145 data_size =
sizeof(CreateNewBoxFilterMessage_data_t);
148 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
150 memcpy(data->p1, ini_p1,
sizeof(
double) * 2);
151 memcpy(data->p2, ini_p2,
sizeof(
double) * 2);
152 memcpy(data->p3, ini_p3,
sizeof(
double) * 2);
153 memcpy(data->p4, ini_p4,
sizeof(
double) * 2);
162 data_size =
sizeof(CreateNewBoxFilterMessage_data_t);
165 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
187 data = (CreateNewBoxFilterMessage_data_t *)
data_ptr;
212 throw Exception(
"Index value %u out of bounds (0..1)", index);
214 return data->p1[index];
234 memcpy(data->p1, new_p1,
sizeof(
double) * 2);
246 throw Exception(
"Index value %u out of bounds (0..1)", index);
248 data->p1[index] = new_p1;
270 throw Exception(
"Index value %u out of bounds (0..1)", index);
272 return data->p2[index];
292 memcpy(data->p2, new_p2,
sizeof(
double) * 2);
304 throw Exception(
"Index value %u out of bounds (0..1)", index);
306 data->p2[index] = new_p2;
328 throw Exception(
"Index value %u out of bounds (0..1)", index);
330 return data->p3[index];
350 memcpy(data->p3, new_p3,
sizeof(
double) * 2);
362 throw Exception(
"Index value %u out of bounds (0..1)", index);
364 data->p3[index] = new_p3;
386 throw Exception(
"Index value %u out of bounds (0..1)", index);
388 return data->p4[index];
408 memcpy(data->p4, new_p4,
sizeof(
double) * 2);
420 throw Exception(
"Index value %u out of bounds (0..1)", index);
422 data->p4[index] = new_p4;
449 EXPORT_INTERFACE(LaserBoxFilterInterface)