Fawkes API  Fawkes Development Version
HumanSkeletonProjectionInterface.cpp
1 
2 /***************************************************************************
3  * HumanSkeletonProjectionInterface.cpp - Fawkes BlackBoard Interface - HumanSkeletonProjectionInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2007-2011 Tim Niemueller
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <interfaces/HumanSkeletonProjectionInterface.h>
25 
26 #include <core/exceptions/software.h>
27 
28 #include <cstring>
29 #include <cstdlib>
30 
31 namespace fawkes {
32 
33 /** @class HumanSkeletonProjectionInterface <interfaces/HumanSkeletonProjectionInterface.h>
34  * HumanSkeletonProjectionInterface Fawkes BlackBoard Interface.
35  *
36  This interface provides projections of the 3D position coordinates into the 2D image of
37  the acquiring camera. Instances shall always be associated with a HumanSkeletonInterface
38  with the same ID. This interface is particularly useful for RGBD cameras.
39 
40  * @ingroup FawkesInterfaces
41  */
42 
43 
44 
45 /** Constructor */
46 HumanSkeletonProjectionInterface::HumanSkeletonProjectionInterface() : Interface()
47 {
48  data_size = sizeof(HumanSkeletonProjectionInterface_data_t);
49  data_ptr = malloc(data_size);
50  data = (HumanSkeletonProjectionInterface_data_t *)data_ptr;
51  data_ts = (interface_data_ts_t *)data_ptr;
52  memset(data_ptr, 0, data_size);
53  add_fieldinfo(IFT_FLOAT, "horizontal_fov", 1, &data->horizontal_fov, "");
54  add_fieldinfo(IFT_FLOAT, "vertical_fov", 1, &data->vertical_fov, "");
55  add_fieldinfo(IFT_UINT32, "res_x", 1, &data->res_x, "");
56  add_fieldinfo(IFT_UINT32, "res_y", 1, &data->res_y, "");
57  add_fieldinfo(IFT_UINT16, "max_depth", 1, &data->max_depth, "");
58  add_fieldinfo(IFT_FLOAT, "proj_com", 2, &data->proj_com, "");
59  add_fieldinfo(IFT_FLOAT, "proj_head", 2, &data->proj_head, "");
60  add_fieldinfo(IFT_FLOAT, "proj_neck", 2, &data->proj_neck, "");
61  add_fieldinfo(IFT_FLOAT, "proj_torso", 2, &data->proj_torso, "");
62  add_fieldinfo(IFT_FLOAT, "proj_waist", 2, &data->proj_waist, "");
63  add_fieldinfo(IFT_FLOAT, "proj_left_collar", 2, &data->proj_left_collar, "");
64  add_fieldinfo(IFT_FLOAT, "proj_left_shoulder", 2, &data->proj_left_shoulder, "");
65  add_fieldinfo(IFT_FLOAT, "proj_left_elbow", 2, &data->proj_left_elbow, "");
66  add_fieldinfo(IFT_FLOAT, "proj_left_wrist", 2, &data->proj_left_wrist, "");
67  add_fieldinfo(IFT_FLOAT, "proj_left_hand", 2, &data->proj_left_hand, "");
68  add_fieldinfo(IFT_FLOAT, "proj_left_fingertip", 2, &data->proj_left_fingertip, "");
69  add_fieldinfo(IFT_FLOAT, "proj_right_collar", 2, &data->proj_right_collar, "");
70  add_fieldinfo(IFT_FLOAT, "proj_right_shoulder", 2, &data->proj_right_shoulder, "");
71  add_fieldinfo(IFT_FLOAT, "proj_right_elbow", 2, &data->proj_right_elbow, "");
72  add_fieldinfo(IFT_FLOAT, "proj_right_wrist", 2, &data->proj_right_wrist, "");
73  add_fieldinfo(IFT_FLOAT, "proj_right_hand", 2, &data->proj_right_hand, "");
74  add_fieldinfo(IFT_FLOAT, "proj_right_fingertip", 2, &data->proj_right_fingertip, "");
75  add_fieldinfo(IFT_FLOAT, "proj_left_hip", 2, &data->proj_left_hip, "");
76  add_fieldinfo(IFT_FLOAT, "proj_left_knee", 2, &data->proj_left_knee, "");
77  add_fieldinfo(IFT_FLOAT, "proj_left_ankle", 2, &data->proj_left_ankle, "");
78  add_fieldinfo(IFT_FLOAT, "proj_left_foot", 2, &data->proj_left_foot, "");
79  add_fieldinfo(IFT_FLOAT, "proj_right_hip", 2, &data->proj_right_hip, "");
80  add_fieldinfo(IFT_FLOAT, "proj_right_knee", 2, &data->proj_right_knee, "");
81  add_fieldinfo(IFT_FLOAT, "proj_right_ankle", 2, &data->proj_right_ankle, "");
82  add_fieldinfo(IFT_FLOAT, "proj_right_foot", 2, &data->proj_right_foot, "");
83  unsigned char tmp_hash[] = {0x71, 0xb2, 0x40, 0x3e, 0xa, 0x85, 0xd5, 0xcc, 0x77, 0xeb, 0xf2, 0xf1, 0xa9, 0x9c, 0xec, 0xf3};
84  set_hash(tmp_hash);
85 }
86 
87 /** Destructor */
88 HumanSkeletonProjectionInterface::~HumanSkeletonProjectionInterface()
89 {
90  free(data_ptr);
91 }
92 /* Methods */
93 /** Get horizontal_fov value.
94  * Opening angle in radians.
95  * @return horizontal_fov value
96  */
97 float
98 HumanSkeletonProjectionInterface::horizontal_fov() const
99 {
100  return data->horizontal_fov;
101 }
102 
103 /** Get maximum length of horizontal_fov value.
104  * @return length of horizontal_fov value, can be length of the array or number of
105  * maximum number of characters for a string
106  */
107 size_t
108 HumanSkeletonProjectionInterface::maxlenof_horizontal_fov() const
109 {
110  return 1;
111 }
112 
113 /** Set horizontal_fov value.
114  * Opening angle in radians.
115  * @param new_horizontal_fov new horizontal_fov value
116  */
117 void
118 HumanSkeletonProjectionInterface::set_horizontal_fov(const float new_horizontal_fov)
119 {
120  data->horizontal_fov = new_horizontal_fov;
121  data_changed = true;
122 }
123 
124 /** Get vertical_fov value.
125  * Opening angle in radians.
126  * @return vertical_fov value
127  */
128 float
129 HumanSkeletonProjectionInterface::vertical_fov() const
130 {
131  return data->vertical_fov;
132 }
133 
134 /** Get maximum length of vertical_fov value.
135  * @return length of vertical_fov value, can be length of the array or number of
136  * maximum number of characters for a string
137  */
138 size_t
139 HumanSkeletonProjectionInterface::maxlenof_vertical_fov() const
140 {
141  return 1;
142 }
143 
144 /** Set vertical_fov value.
145  * Opening angle in radians.
146  * @param new_vertical_fov new vertical_fov value
147  */
148 void
149 HumanSkeletonProjectionInterface::set_vertical_fov(const float new_vertical_fov)
150 {
151  data->vertical_fov = new_vertical_fov;
152  data_changed = true;
153 }
154 
155 /** Get res_x value.
156  * X resolution (number of columns in frame).
157  * @return res_x value
158  */
159 uint32_t
160 HumanSkeletonProjectionInterface::res_x() const
161 {
162  return data->res_x;
163 }
164 
165 /** Get maximum length of res_x value.
166  * @return length of res_x value, can be length of the array or number of
167  * maximum number of characters for a string
168  */
169 size_t
170 HumanSkeletonProjectionInterface::maxlenof_res_x() const
171 {
172  return 1;
173 }
174 
175 /** Set res_x value.
176  * X resolution (number of columns in frame).
177  * @param new_res_x new res_x value
178  */
179 void
180 HumanSkeletonProjectionInterface::set_res_x(const uint32_t new_res_x)
181 {
182  data->res_x = new_res_x;
183  data_changed = true;
184 }
185 
186 /** Get res_y value.
187  * Y resolution (number of rows in frame).
188  * @return res_y value
189  */
190 uint32_t
191 HumanSkeletonProjectionInterface::res_y() const
192 {
193  return data->res_y;
194 }
195 
196 /** Get maximum length of res_y value.
197  * @return length of res_y value, can be length of the array or number of
198  * maximum number of characters for a string
199  */
200 size_t
201 HumanSkeletonProjectionInterface::maxlenof_res_y() const
202 {
203  return 1;
204 }
205 
206 /** Set res_y value.
207  * Y resolution (number of rows in frame).
208  * @param new_res_y new res_y value
209  */
210 void
211 HumanSkeletonProjectionInterface::set_res_y(const uint32_t new_res_y)
212 {
213  data->res_y = new_res_y;
214  data_changed = true;
215 }
216 
217 /** Get max_depth value.
218  * Maximum depth value.
219  * @return max_depth value
220  */
221 uint16_t
222 HumanSkeletonProjectionInterface::max_depth() const
223 {
224  return data->max_depth;
225 }
226 
227 /** Get maximum length of max_depth value.
228  * @return length of max_depth value, can be length of the array or number of
229  * maximum number of characters for a string
230  */
231 size_t
232 HumanSkeletonProjectionInterface::maxlenof_max_depth() const
233 {
234  return 1;
235 }
236 
237 /** Set max_depth value.
238  * Maximum depth value.
239  * @param new_max_depth new max_depth value
240  */
241 void
242 HumanSkeletonProjectionInterface::set_max_depth(const uint16_t new_max_depth)
243 {
244  data->max_depth = new_max_depth;
245  data_changed = true;
246 }
247 
248 /** Get proj_com value.
249  * Center of mass.
250  * @return proj_com value
251  */
252 float *
253 HumanSkeletonProjectionInterface::proj_com() const
254 {
255  return data->proj_com;
256 }
257 
258 /** Get proj_com value at given index.
259  * Center of mass.
260  * @param index index of value
261  * @return proj_com value
262  * @exception Exception thrown if index is out of bounds
263  */
264 float
265 HumanSkeletonProjectionInterface::proj_com(unsigned int index) const
266 {
267  if (index > 2) {
268  throw Exception("Index value %u out of bounds (0..2)", index);
269  }
270  return data->proj_com[index];
271 }
272 
273 /** Get maximum length of proj_com value.
274  * @return length of proj_com value, can be length of the array or number of
275  * maximum number of characters for a string
276  */
277 size_t
278 HumanSkeletonProjectionInterface::maxlenof_proj_com() const
279 {
280  return 2;
281 }
282 
283 /** Set proj_com value.
284  * Center of mass.
285  * @param new_proj_com new proj_com value
286  */
287 void
288 HumanSkeletonProjectionInterface::set_proj_com(const float * new_proj_com)
289 {
290  memcpy(data->proj_com, new_proj_com, sizeof(float) * 2);
291  data_changed = true;
292 }
293 
294 /** Set proj_com value at given index.
295  * Center of mass.
296  * @param new_proj_com new proj_com value
297  * @param index index for of the value
298  */
299 void
300 HumanSkeletonProjectionInterface::set_proj_com(unsigned int index, const float new_proj_com)
301 {
302  if (index > 2) {
303  throw Exception("Index value %u out of bounds (0..2)", index);
304  }
305  data->proj_com[index] = new_proj_com;
306  data_changed = true;
307 }
308 /** Get proj_head value.
309  * Head position vector.
310  * @return proj_head value
311  */
312 float *
313 HumanSkeletonProjectionInterface::proj_head() const
314 {
315  return data->proj_head;
316 }
317 
318 /** Get proj_head value at given index.
319  * Head position vector.
320  * @param index index of value
321  * @return proj_head value
322  * @exception Exception thrown if index is out of bounds
323  */
324 float
325 HumanSkeletonProjectionInterface::proj_head(unsigned int index) const
326 {
327  if (index > 2) {
328  throw Exception("Index value %u out of bounds (0..2)", index);
329  }
330  return data->proj_head[index];
331 }
332 
333 /** Get maximum length of proj_head value.
334  * @return length of proj_head value, can be length of the array or number of
335  * maximum number of characters for a string
336  */
337 size_t
338 HumanSkeletonProjectionInterface::maxlenof_proj_head() const
339 {
340  return 2;
341 }
342 
343 /** Set proj_head value.
344  * Head position vector.
345  * @param new_proj_head new proj_head value
346  */
347 void
348 HumanSkeletonProjectionInterface::set_proj_head(const float * new_proj_head)
349 {
350  memcpy(data->proj_head, new_proj_head, sizeof(float) * 2);
351  data_changed = true;
352 }
353 
354 /** Set proj_head value at given index.
355  * Head position vector.
356  * @param new_proj_head new proj_head value
357  * @param index index for of the value
358  */
359 void
360 HumanSkeletonProjectionInterface::set_proj_head(unsigned int index, const float new_proj_head)
361 {
362  if (index > 2) {
363  throw Exception("Index value %u out of bounds (0..2)", index);
364  }
365  data->proj_head[index] = new_proj_head;
366  data_changed = true;
367 }
368 /** Get proj_neck value.
369  * Neck position vector.
370  * @return proj_neck value
371  */
372 float *
373 HumanSkeletonProjectionInterface::proj_neck() const
374 {
375  return data->proj_neck;
376 }
377 
378 /** Get proj_neck value at given index.
379  * Neck position vector.
380  * @param index index of value
381  * @return proj_neck value
382  * @exception Exception thrown if index is out of bounds
383  */
384 float
385 HumanSkeletonProjectionInterface::proj_neck(unsigned int index) const
386 {
387  if (index > 2) {
388  throw Exception("Index value %u out of bounds (0..2)", index);
389  }
390  return data->proj_neck[index];
391 }
392 
393 /** Get maximum length of proj_neck value.
394  * @return length of proj_neck value, can be length of the array or number of
395  * maximum number of characters for a string
396  */
397 size_t
398 HumanSkeletonProjectionInterface::maxlenof_proj_neck() const
399 {
400  return 2;
401 }
402 
403 /** Set proj_neck value.
404  * Neck position vector.
405  * @param new_proj_neck new proj_neck value
406  */
407 void
408 HumanSkeletonProjectionInterface::set_proj_neck(const float * new_proj_neck)
409 {
410  memcpy(data->proj_neck, new_proj_neck, sizeof(float) * 2);
411  data_changed = true;
412 }
413 
414 /** Set proj_neck value at given index.
415  * Neck position vector.
416  * @param new_proj_neck new proj_neck value
417  * @param index index for of the value
418  */
419 void
420 HumanSkeletonProjectionInterface::set_proj_neck(unsigned int index, const float new_proj_neck)
421 {
422  if (index > 2) {
423  throw Exception("Index value %u out of bounds (0..2)", index);
424  }
425  data->proj_neck[index] = new_proj_neck;
426  data_changed = true;
427 }
428 /** Get proj_torso value.
429  * Torso position vector.
430  * @return proj_torso value
431  */
432 float *
433 HumanSkeletonProjectionInterface::proj_torso() const
434 {
435  return data->proj_torso;
436 }
437 
438 /** Get proj_torso value at given index.
439  * Torso position vector.
440  * @param index index of value
441  * @return proj_torso value
442  * @exception Exception thrown if index is out of bounds
443  */
444 float
445 HumanSkeletonProjectionInterface::proj_torso(unsigned int index) const
446 {
447  if (index > 2) {
448  throw Exception("Index value %u out of bounds (0..2)", index);
449  }
450  return data->proj_torso[index];
451 }
452 
453 /** Get maximum length of proj_torso value.
454  * @return length of proj_torso value, can be length of the array or number of
455  * maximum number of characters for a string
456  */
457 size_t
458 HumanSkeletonProjectionInterface::maxlenof_proj_torso() const
459 {
460  return 2;
461 }
462 
463 /** Set proj_torso value.
464  * Torso position vector.
465  * @param new_proj_torso new proj_torso value
466  */
467 void
468 HumanSkeletonProjectionInterface::set_proj_torso(const float * new_proj_torso)
469 {
470  memcpy(data->proj_torso, new_proj_torso, sizeof(float) * 2);
471  data_changed = true;
472 }
473 
474 /** Set proj_torso value at given index.
475  * Torso position vector.
476  * @param new_proj_torso new proj_torso value
477  * @param index index for of the value
478  */
479 void
480 HumanSkeletonProjectionInterface::set_proj_torso(unsigned int index, const float new_proj_torso)
481 {
482  if (index > 2) {
483  throw Exception("Index value %u out of bounds (0..2)", index);
484  }
485  data->proj_torso[index] = new_proj_torso;
486  data_changed = true;
487 }
488 /** Get proj_waist value.
489  * Waist position vector.
490  * @return proj_waist value
491  */
492 float *
493 HumanSkeletonProjectionInterface::proj_waist() const
494 {
495  return data->proj_waist;
496 }
497 
498 /** Get proj_waist value at given index.
499  * Waist position vector.
500  * @param index index of value
501  * @return proj_waist value
502  * @exception Exception thrown if index is out of bounds
503  */
504 float
505 HumanSkeletonProjectionInterface::proj_waist(unsigned int index) const
506 {
507  if (index > 2) {
508  throw Exception("Index value %u out of bounds (0..2)", index);
509  }
510  return data->proj_waist[index];
511 }
512 
513 /** Get maximum length of proj_waist value.
514  * @return length of proj_waist value, can be length of the array or number of
515  * maximum number of characters for a string
516  */
517 size_t
518 HumanSkeletonProjectionInterface::maxlenof_proj_waist() const
519 {
520  return 2;
521 }
522 
523 /** Set proj_waist value.
524  * Waist position vector.
525  * @param new_proj_waist new proj_waist value
526  */
527 void
528 HumanSkeletonProjectionInterface::set_proj_waist(const float * new_proj_waist)
529 {
530  memcpy(data->proj_waist, new_proj_waist, sizeof(float) * 2);
531  data_changed = true;
532 }
533 
534 /** Set proj_waist value at given index.
535  * Waist position vector.
536  * @param new_proj_waist new proj_waist value
537  * @param index index for of the value
538  */
539 void
540 HumanSkeletonProjectionInterface::set_proj_waist(unsigned int index, const float new_proj_waist)
541 {
542  if (index > 2) {
543  throw Exception("Index value %u out of bounds (0..2)", index);
544  }
545  data->proj_waist[index] = new_proj_waist;
546  data_changed = true;
547 }
548 /** Get proj_left_collar value.
549  *
550  Left position vector.
551  * @return proj_left_collar value
552  */
553 float *
554 HumanSkeletonProjectionInterface::proj_left_collar() const
555 {
556  return data->proj_left_collar;
557 }
558 
559 /** Get proj_left_collar value at given index.
560  *
561  Left position vector.
562  * @param index index of value
563  * @return proj_left_collar value
564  * @exception Exception thrown if index is out of bounds
565  */
566 float
567 HumanSkeletonProjectionInterface::proj_left_collar(unsigned int index) const
568 {
569  if (index > 2) {
570  throw Exception("Index value %u out of bounds (0..2)", index);
571  }
572  return data->proj_left_collar[index];
573 }
574 
575 /** Get maximum length of proj_left_collar value.
576  * @return length of proj_left_collar value, can be length of the array or number of
577  * maximum number of characters for a string
578  */
579 size_t
580 HumanSkeletonProjectionInterface::maxlenof_proj_left_collar() const
581 {
582  return 2;
583 }
584 
585 /** Set proj_left_collar value.
586  *
587  Left position vector.
588  * @param new_proj_left_collar new proj_left_collar value
589  */
590 void
591 HumanSkeletonProjectionInterface::set_proj_left_collar(const float * new_proj_left_collar)
592 {
593  memcpy(data->proj_left_collar, new_proj_left_collar, sizeof(float) * 2);
594  data_changed = true;
595 }
596 
597 /** Set proj_left_collar value at given index.
598  *
599  Left position vector.
600  * @param new_proj_left_collar new proj_left_collar value
601  * @param index index for of the value
602  */
603 void
604 HumanSkeletonProjectionInterface::set_proj_left_collar(unsigned int index, const float new_proj_left_collar)
605 {
606  if (index > 2) {
607  throw Exception("Index value %u out of bounds (0..2)", index);
608  }
609  data->proj_left_collar[index] = new_proj_left_collar;
610  data_changed = true;
611 }
612 /** Get proj_left_shoulder value.
613  *
614  Left shoulder position vector.
615  * @return proj_left_shoulder value
616  */
617 float *
618 HumanSkeletonProjectionInterface::proj_left_shoulder() const
619 {
620  return data->proj_left_shoulder;
621 }
622 
623 /** Get proj_left_shoulder value at given index.
624  *
625  Left shoulder position vector.
626  * @param index index of value
627  * @return proj_left_shoulder value
628  * @exception Exception thrown if index is out of bounds
629  */
630 float
631 HumanSkeletonProjectionInterface::proj_left_shoulder(unsigned int index) const
632 {
633  if (index > 2) {
634  throw Exception("Index value %u out of bounds (0..2)", index);
635  }
636  return data->proj_left_shoulder[index];
637 }
638 
639 /** Get maximum length of proj_left_shoulder value.
640  * @return length of proj_left_shoulder value, can be length of the array or number of
641  * maximum number of characters for a string
642  */
643 size_t
644 HumanSkeletonProjectionInterface::maxlenof_proj_left_shoulder() const
645 {
646  return 2;
647 }
648 
649 /** Set proj_left_shoulder value.
650  *
651  Left shoulder position vector.
652  * @param new_proj_left_shoulder new proj_left_shoulder value
653  */
654 void
655 HumanSkeletonProjectionInterface::set_proj_left_shoulder(const float * new_proj_left_shoulder)
656 {
657  memcpy(data->proj_left_shoulder, new_proj_left_shoulder, sizeof(float) * 2);
658  data_changed = true;
659 }
660 
661 /** Set proj_left_shoulder value at given index.
662  *
663  Left shoulder position vector.
664  * @param new_proj_left_shoulder new proj_left_shoulder value
665  * @param index index for of the value
666  */
667 void
668 HumanSkeletonProjectionInterface::set_proj_left_shoulder(unsigned int index, const float new_proj_left_shoulder)
669 {
670  if (index > 2) {
671  throw Exception("Index value %u out of bounds (0..2)", index);
672  }
673  data->proj_left_shoulder[index] = new_proj_left_shoulder;
674  data_changed = true;
675 }
676 /** Get proj_left_elbow value.
677  *
678  Left elbow position vector.
679  * @return proj_left_elbow value
680  */
681 float *
682 HumanSkeletonProjectionInterface::proj_left_elbow() const
683 {
684  return data->proj_left_elbow;
685 }
686 
687 /** Get proj_left_elbow value at given index.
688  *
689  Left elbow position vector.
690  * @param index index of value
691  * @return proj_left_elbow value
692  * @exception Exception thrown if index is out of bounds
693  */
694 float
695 HumanSkeletonProjectionInterface::proj_left_elbow(unsigned int index) const
696 {
697  if (index > 2) {
698  throw Exception("Index value %u out of bounds (0..2)", index);
699  }
700  return data->proj_left_elbow[index];
701 }
702 
703 /** Get maximum length of proj_left_elbow value.
704  * @return length of proj_left_elbow value, can be length of the array or number of
705  * maximum number of characters for a string
706  */
707 size_t
708 HumanSkeletonProjectionInterface::maxlenof_proj_left_elbow() const
709 {
710  return 2;
711 }
712 
713 /** Set proj_left_elbow value.
714  *
715  Left elbow position vector.
716  * @param new_proj_left_elbow new proj_left_elbow value
717  */
718 void
719 HumanSkeletonProjectionInterface::set_proj_left_elbow(const float * new_proj_left_elbow)
720 {
721  memcpy(data->proj_left_elbow, new_proj_left_elbow, sizeof(float) * 2);
722  data_changed = true;
723 }
724 
725 /** Set proj_left_elbow value at given index.
726  *
727  Left elbow position vector.
728  * @param new_proj_left_elbow new proj_left_elbow value
729  * @param index index for of the value
730  */
731 void
732 HumanSkeletonProjectionInterface::set_proj_left_elbow(unsigned int index, const float new_proj_left_elbow)
733 {
734  if (index > 2) {
735  throw Exception("Index value %u out of bounds (0..2)", index);
736  }
737  data->proj_left_elbow[index] = new_proj_left_elbow;
738  data_changed = true;
739 }
740 /** Get proj_left_wrist value.
741  *
742  Left wrist position vector.
743  * @return proj_left_wrist value
744  */
745 float *
746 HumanSkeletonProjectionInterface::proj_left_wrist() const
747 {
748  return data->proj_left_wrist;
749 }
750 
751 /** Get proj_left_wrist value at given index.
752  *
753  Left wrist position vector.
754  * @param index index of value
755  * @return proj_left_wrist value
756  * @exception Exception thrown if index is out of bounds
757  */
758 float
759 HumanSkeletonProjectionInterface::proj_left_wrist(unsigned int index) const
760 {
761  if (index > 2) {
762  throw Exception("Index value %u out of bounds (0..2)", index);
763  }
764  return data->proj_left_wrist[index];
765 }
766 
767 /** Get maximum length of proj_left_wrist value.
768  * @return length of proj_left_wrist value, can be length of the array or number of
769  * maximum number of characters for a string
770  */
771 size_t
772 HumanSkeletonProjectionInterface::maxlenof_proj_left_wrist() const
773 {
774  return 2;
775 }
776 
777 /** Set proj_left_wrist value.
778  *
779  Left wrist position vector.
780  * @param new_proj_left_wrist new proj_left_wrist value
781  */
782 void
783 HumanSkeletonProjectionInterface::set_proj_left_wrist(const float * new_proj_left_wrist)
784 {
785  memcpy(data->proj_left_wrist, new_proj_left_wrist, sizeof(float) * 2);
786  data_changed = true;
787 }
788 
789 /** Set proj_left_wrist value at given index.
790  *
791  Left wrist position vector.
792  * @param new_proj_left_wrist new proj_left_wrist value
793  * @param index index for of the value
794  */
795 void
796 HumanSkeletonProjectionInterface::set_proj_left_wrist(unsigned int index, const float new_proj_left_wrist)
797 {
798  if (index > 2) {
799  throw Exception("Index value %u out of bounds (0..2)", index);
800  }
801  data->proj_left_wrist[index] = new_proj_left_wrist;
802  data_changed = true;
803 }
804 /** Get proj_left_hand value.
805  *
806  Left hand position vector.
807  * @return proj_left_hand value
808  */
809 float *
810 HumanSkeletonProjectionInterface::proj_left_hand() const
811 {
812  return data->proj_left_hand;
813 }
814 
815 /** Get proj_left_hand value at given index.
816  *
817  Left hand position vector.
818  * @param index index of value
819  * @return proj_left_hand value
820  * @exception Exception thrown if index is out of bounds
821  */
822 float
823 HumanSkeletonProjectionInterface::proj_left_hand(unsigned int index) const
824 {
825  if (index > 2) {
826  throw Exception("Index value %u out of bounds (0..2)", index);
827  }
828  return data->proj_left_hand[index];
829 }
830 
831 /** Get maximum length of proj_left_hand value.
832  * @return length of proj_left_hand value, can be length of the array or number of
833  * maximum number of characters for a string
834  */
835 size_t
836 HumanSkeletonProjectionInterface::maxlenof_proj_left_hand() const
837 {
838  return 2;
839 }
840 
841 /** Set proj_left_hand value.
842  *
843  Left hand position vector.
844  * @param new_proj_left_hand new proj_left_hand value
845  */
846 void
847 HumanSkeletonProjectionInterface::set_proj_left_hand(const float * new_proj_left_hand)
848 {
849  memcpy(data->proj_left_hand, new_proj_left_hand, sizeof(float) * 2);
850  data_changed = true;
851 }
852 
853 /** Set proj_left_hand value at given index.
854  *
855  Left hand position vector.
856  * @param new_proj_left_hand new proj_left_hand value
857  * @param index index for of the value
858  */
859 void
860 HumanSkeletonProjectionInterface::set_proj_left_hand(unsigned int index, const float new_proj_left_hand)
861 {
862  if (index > 2) {
863  throw Exception("Index value %u out of bounds (0..2)", index);
864  }
865  data->proj_left_hand[index] = new_proj_left_hand;
866  data_changed = true;
867 }
868 /** Get proj_left_fingertip value.
869  *
870  Left fingertip position vector.
871  * @return proj_left_fingertip value
872  */
873 float *
874 HumanSkeletonProjectionInterface::proj_left_fingertip() const
875 {
876  return data->proj_left_fingertip;
877 }
878 
879 /** Get proj_left_fingertip value at given index.
880  *
881  Left fingertip position vector.
882  * @param index index of value
883  * @return proj_left_fingertip value
884  * @exception Exception thrown if index is out of bounds
885  */
886 float
887 HumanSkeletonProjectionInterface::proj_left_fingertip(unsigned int index) const
888 {
889  if (index > 2) {
890  throw Exception("Index value %u out of bounds (0..2)", index);
891  }
892  return data->proj_left_fingertip[index];
893 }
894 
895 /** Get maximum length of proj_left_fingertip value.
896  * @return length of proj_left_fingertip value, can be length of the array or number of
897  * maximum number of characters for a string
898  */
899 size_t
900 HumanSkeletonProjectionInterface::maxlenof_proj_left_fingertip() const
901 {
902  return 2;
903 }
904 
905 /** Set proj_left_fingertip value.
906  *
907  Left fingertip position vector.
908  * @param new_proj_left_fingertip new proj_left_fingertip value
909  */
910 void
911 HumanSkeletonProjectionInterface::set_proj_left_fingertip(const float * new_proj_left_fingertip)
912 {
913  memcpy(data->proj_left_fingertip, new_proj_left_fingertip, sizeof(float) * 2);
914  data_changed = true;
915 }
916 
917 /** Set proj_left_fingertip value at given index.
918  *
919  Left fingertip position vector.
920  * @param new_proj_left_fingertip new proj_left_fingertip value
921  * @param index index for of the value
922  */
923 void
924 HumanSkeletonProjectionInterface::set_proj_left_fingertip(unsigned int index, const float new_proj_left_fingertip)
925 {
926  if (index > 2) {
927  throw Exception("Index value %u out of bounds (0..2)", index);
928  }
929  data->proj_left_fingertip[index] = new_proj_left_fingertip;
930  data_changed = true;
931 }
932 /** Get proj_right_collar value.
933  *
934  Right collar position vector.
935  * @return proj_right_collar value
936  */
937 float *
938 HumanSkeletonProjectionInterface::proj_right_collar() const
939 {
940  return data->proj_right_collar;
941 }
942 
943 /** Get proj_right_collar value at given index.
944  *
945  Right collar position vector.
946  * @param index index of value
947  * @return proj_right_collar value
948  * @exception Exception thrown if index is out of bounds
949  */
950 float
951 HumanSkeletonProjectionInterface::proj_right_collar(unsigned int index) const
952 {
953  if (index > 2) {
954  throw Exception("Index value %u out of bounds (0..2)", index);
955  }
956  return data->proj_right_collar[index];
957 }
958 
959 /** Get maximum length of proj_right_collar value.
960  * @return length of proj_right_collar value, can be length of the array or number of
961  * maximum number of characters for a string
962  */
963 size_t
964 HumanSkeletonProjectionInterface::maxlenof_proj_right_collar() const
965 {
966  return 2;
967 }
968 
969 /** Set proj_right_collar value.
970  *
971  Right collar position vector.
972  * @param new_proj_right_collar new proj_right_collar value
973  */
974 void
975 HumanSkeletonProjectionInterface::set_proj_right_collar(const float * new_proj_right_collar)
976 {
977  memcpy(data->proj_right_collar, new_proj_right_collar, sizeof(float) * 2);
978  data_changed = true;
979 }
980 
981 /** Set proj_right_collar value at given index.
982  *
983  Right collar position vector.
984  * @param new_proj_right_collar new proj_right_collar value
985  * @param index index for of the value
986  */
987 void
988 HumanSkeletonProjectionInterface::set_proj_right_collar(unsigned int index, const float new_proj_right_collar)
989 {
990  if (index > 2) {
991  throw Exception("Index value %u out of bounds (0..2)", index);
992  }
993  data->proj_right_collar[index] = new_proj_right_collar;
994  data_changed = true;
995 }
996 /** Get proj_right_shoulder value.
997  *
998  Right shoulder position vector.
999  * @return proj_right_shoulder value
1000  */
1001 float *
1002 HumanSkeletonProjectionInterface::proj_right_shoulder() const
1003 {
1004  return data->proj_right_shoulder;
1005 }
1006 
1007 /** Get proj_right_shoulder value at given index.
1008  *
1009  Right shoulder position vector.
1010  * @param index index of value
1011  * @return proj_right_shoulder value
1012  * @exception Exception thrown if index is out of bounds
1013  */
1014 float
1015 HumanSkeletonProjectionInterface::proj_right_shoulder(unsigned int index) const
1016 {
1017  if (index > 2) {
1018  throw Exception("Index value %u out of bounds (0..2)", index);
1019  }
1020  return data->proj_right_shoulder[index];
1021 }
1022 
1023 /** Get maximum length of proj_right_shoulder value.
1024  * @return length of proj_right_shoulder value, can be length of the array or number of
1025  * maximum number of characters for a string
1026  */
1027 size_t
1028 HumanSkeletonProjectionInterface::maxlenof_proj_right_shoulder() const
1029 {
1030  return 2;
1031 }
1032 
1033 /** Set proj_right_shoulder value.
1034  *
1035  Right shoulder position vector.
1036  * @param new_proj_right_shoulder new proj_right_shoulder value
1037  */
1038 void
1039 HumanSkeletonProjectionInterface::set_proj_right_shoulder(const float * new_proj_right_shoulder)
1040 {
1041  memcpy(data->proj_right_shoulder, new_proj_right_shoulder, sizeof(float) * 2);
1042  data_changed = true;
1043 }
1044 
1045 /** Set proj_right_shoulder value at given index.
1046  *
1047  Right shoulder position vector.
1048  * @param new_proj_right_shoulder new proj_right_shoulder value
1049  * @param index index for of the value
1050  */
1051 void
1052 HumanSkeletonProjectionInterface::set_proj_right_shoulder(unsigned int index, const float new_proj_right_shoulder)
1053 {
1054  if (index > 2) {
1055  throw Exception("Index value %u out of bounds (0..2)", index);
1056  }
1057  data->proj_right_shoulder[index] = new_proj_right_shoulder;
1058  data_changed = true;
1059 }
1060 /** Get proj_right_elbow value.
1061  *
1062  Right elbow position vector.
1063  * @return proj_right_elbow value
1064  */
1065 float *
1066 HumanSkeletonProjectionInterface::proj_right_elbow() const
1067 {
1068  return data->proj_right_elbow;
1069 }
1070 
1071 /** Get proj_right_elbow value at given index.
1072  *
1073  Right elbow position vector.
1074  * @param index index of value
1075  * @return proj_right_elbow value
1076  * @exception Exception thrown if index is out of bounds
1077  */
1078 float
1079 HumanSkeletonProjectionInterface::proj_right_elbow(unsigned int index) const
1080 {
1081  if (index > 2) {
1082  throw Exception("Index value %u out of bounds (0..2)", index);
1083  }
1084  return data->proj_right_elbow[index];
1085 }
1086 
1087 /** Get maximum length of proj_right_elbow value.
1088  * @return length of proj_right_elbow value, can be length of the array or number of
1089  * maximum number of characters for a string
1090  */
1091 size_t
1092 HumanSkeletonProjectionInterface::maxlenof_proj_right_elbow() const
1093 {
1094  return 2;
1095 }
1096 
1097 /** Set proj_right_elbow value.
1098  *
1099  Right elbow position vector.
1100  * @param new_proj_right_elbow new proj_right_elbow value
1101  */
1102 void
1103 HumanSkeletonProjectionInterface::set_proj_right_elbow(const float * new_proj_right_elbow)
1104 {
1105  memcpy(data->proj_right_elbow, new_proj_right_elbow, sizeof(float) * 2);
1106  data_changed = true;
1107 }
1108 
1109 /** Set proj_right_elbow value at given index.
1110  *
1111  Right elbow position vector.
1112  * @param new_proj_right_elbow new proj_right_elbow value
1113  * @param index index for of the value
1114  */
1115 void
1116 HumanSkeletonProjectionInterface::set_proj_right_elbow(unsigned int index, const float new_proj_right_elbow)
1117 {
1118  if (index > 2) {
1119  throw Exception("Index value %u out of bounds (0..2)", index);
1120  }
1121  data->proj_right_elbow[index] = new_proj_right_elbow;
1122  data_changed = true;
1123 }
1124 /** Get proj_right_wrist value.
1125  *
1126  Right wrist position vector.
1127  * @return proj_right_wrist value
1128  */
1129 float *
1130 HumanSkeletonProjectionInterface::proj_right_wrist() const
1131 {
1132  return data->proj_right_wrist;
1133 }
1134 
1135 /** Get proj_right_wrist value at given index.
1136  *
1137  Right wrist position vector.
1138  * @param index index of value
1139  * @return proj_right_wrist value
1140  * @exception Exception thrown if index is out of bounds
1141  */
1142 float
1143 HumanSkeletonProjectionInterface::proj_right_wrist(unsigned int index) const
1144 {
1145  if (index > 2) {
1146  throw Exception("Index value %u out of bounds (0..2)", index);
1147  }
1148  return data->proj_right_wrist[index];
1149 }
1150 
1151 /** Get maximum length of proj_right_wrist value.
1152  * @return length of proj_right_wrist value, can be length of the array or number of
1153  * maximum number of characters for a string
1154  */
1155 size_t
1156 HumanSkeletonProjectionInterface::maxlenof_proj_right_wrist() const
1157 {
1158  return 2;
1159 }
1160 
1161 /** Set proj_right_wrist value.
1162  *
1163  Right wrist position vector.
1164  * @param new_proj_right_wrist new proj_right_wrist value
1165  */
1166 void
1167 HumanSkeletonProjectionInterface::set_proj_right_wrist(const float * new_proj_right_wrist)
1168 {
1169  memcpy(data->proj_right_wrist, new_proj_right_wrist, sizeof(float) * 2);
1170  data_changed = true;
1171 }
1172 
1173 /** Set proj_right_wrist value at given index.
1174  *
1175  Right wrist position vector.
1176  * @param new_proj_right_wrist new proj_right_wrist value
1177  * @param index index for of the value
1178  */
1179 void
1180 HumanSkeletonProjectionInterface::set_proj_right_wrist(unsigned int index, const float new_proj_right_wrist)
1181 {
1182  if (index > 2) {
1183  throw Exception("Index value %u out of bounds (0..2)", index);
1184  }
1185  data->proj_right_wrist[index] = new_proj_right_wrist;
1186  data_changed = true;
1187 }
1188 /** Get proj_right_hand value.
1189  *
1190  Right hand position vector.
1191  * @return proj_right_hand value
1192  */
1193 float *
1194 HumanSkeletonProjectionInterface::proj_right_hand() const
1195 {
1196  return data->proj_right_hand;
1197 }
1198 
1199 /** Get proj_right_hand value at given index.
1200  *
1201  Right hand position vector.
1202  * @param index index of value
1203  * @return proj_right_hand value
1204  * @exception Exception thrown if index is out of bounds
1205  */
1206 float
1207 HumanSkeletonProjectionInterface::proj_right_hand(unsigned int index) const
1208 {
1209  if (index > 2) {
1210  throw Exception("Index value %u out of bounds (0..2)", index);
1211  }
1212  return data->proj_right_hand[index];
1213 }
1214 
1215 /** Get maximum length of proj_right_hand value.
1216  * @return length of proj_right_hand value, can be length of the array or number of
1217  * maximum number of characters for a string
1218  */
1219 size_t
1220 HumanSkeletonProjectionInterface::maxlenof_proj_right_hand() const
1221 {
1222  return 2;
1223 }
1224 
1225 /** Set proj_right_hand value.
1226  *
1227  Right hand position vector.
1228  * @param new_proj_right_hand new proj_right_hand value
1229  */
1230 void
1231 HumanSkeletonProjectionInterface::set_proj_right_hand(const float * new_proj_right_hand)
1232 {
1233  memcpy(data->proj_right_hand, new_proj_right_hand, sizeof(float) * 2);
1234  data_changed = true;
1235 }
1236 
1237 /** Set proj_right_hand value at given index.
1238  *
1239  Right hand position vector.
1240  * @param new_proj_right_hand new proj_right_hand value
1241  * @param index index for of the value
1242  */
1243 void
1244 HumanSkeletonProjectionInterface::set_proj_right_hand(unsigned int index, const float new_proj_right_hand)
1245 {
1246  if (index > 2) {
1247  throw Exception("Index value %u out of bounds (0..2)", index);
1248  }
1249  data->proj_right_hand[index] = new_proj_right_hand;
1250  data_changed = true;
1251 }
1252 /** Get proj_right_fingertip value.
1253  *
1254  Right fingertip position vector.
1255  * @return proj_right_fingertip value
1256  */
1257 float *
1258 HumanSkeletonProjectionInterface::proj_right_fingertip() const
1259 {
1260  return data->proj_right_fingertip;
1261 }
1262 
1263 /** Get proj_right_fingertip value at given index.
1264  *
1265  Right fingertip position vector.
1266  * @param index index of value
1267  * @return proj_right_fingertip value
1268  * @exception Exception thrown if index is out of bounds
1269  */
1270 float
1271 HumanSkeletonProjectionInterface::proj_right_fingertip(unsigned int index) const
1272 {
1273  if (index > 2) {
1274  throw Exception("Index value %u out of bounds (0..2)", index);
1275  }
1276  return data->proj_right_fingertip[index];
1277 }
1278 
1279 /** Get maximum length of proj_right_fingertip value.
1280  * @return length of proj_right_fingertip value, can be length of the array or number of
1281  * maximum number of characters for a string
1282  */
1283 size_t
1284 HumanSkeletonProjectionInterface::maxlenof_proj_right_fingertip() const
1285 {
1286  return 2;
1287 }
1288 
1289 /** Set proj_right_fingertip value.
1290  *
1291  Right fingertip position vector.
1292  * @param new_proj_right_fingertip new proj_right_fingertip value
1293  */
1294 void
1295 HumanSkeletonProjectionInterface::set_proj_right_fingertip(const float * new_proj_right_fingertip)
1296 {
1297  memcpy(data->proj_right_fingertip, new_proj_right_fingertip, sizeof(float) * 2);
1298  data_changed = true;
1299 }
1300 
1301 /** Set proj_right_fingertip value at given index.
1302  *
1303  Right fingertip position vector.
1304  * @param new_proj_right_fingertip new proj_right_fingertip value
1305  * @param index index for of the value
1306  */
1307 void
1308 HumanSkeletonProjectionInterface::set_proj_right_fingertip(unsigned int index, const float new_proj_right_fingertip)
1309 {
1310  if (index > 2) {
1311  throw Exception("Index value %u out of bounds (0..2)", index);
1312  }
1313  data->proj_right_fingertip[index] = new_proj_right_fingertip;
1314  data_changed = true;
1315 }
1316 /** Get proj_left_hip value.
1317  *
1318  Left hip position vector.
1319  * @return proj_left_hip value
1320  */
1321 float *
1322 HumanSkeletonProjectionInterface::proj_left_hip() const
1323 {
1324  return data->proj_left_hip;
1325 }
1326 
1327 /** Get proj_left_hip value at given index.
1328  *
1329  Left hip position vector.
1330  * @param index index of value
1331  * @return proj_left_hip value
1332  * @exception Exception thrown if index is out of bounds
1333  */
1334 float
1335 HumanSkeletonProjectionInterface::proj_left_hip(unsigned int index) const
1336 {
1337  if (index > 2) {
1338  throw Exception("Index value %u out of bounds (0..2)", index);
1339  }
1340  return data->proj_left_hip[index];
1341 }
1342 
1343 /** Get maximum length of proj_left_hip value.
1344  * @return length of proj_left_hip value, can be length of the array or number of
1345  * maximum number of characters for a string
1346  */
1347 size_t
1348 HumanSkeletonProjectionInterface::maxlenof_proj_left_hip() const
1349 {
1350  return 2;
1351 }
1352 
1353 /** Set proj_left_hip value.
1354  *
1355  Left hip position vector.
1356  * @param new_proj_left_hip new proj_left_hip value
1357  */
1358 void
1359 HumanSkeletonProjectionInterface::set_proj_left_hip(const float * new_proj_left_hip)
1360 {
1361  memcpy(data->proj_left_hip, new_proj_left_hip, sizeof(float) * 2);
1362  data_changed = true;
1363 }
1364 
1365 /** Set proj_left_hip value at given index.
1366  *
1367  Left hip position vector.
1368  * @param new_proj_left_hip new proj_left_hip value
1369  * @param index index for of the value
1370  */
1371 void
1372 HumanSkeletonProjectionInterface::set_proj_left_hip(unsigned int index, const float new_proj_left_hip)
1373 {
1374  if (index > 2) {
1375  throw Exception("Index value %u out of bounds (0..2)", index);
1376  }
1377  data->proj_left_hip[index] = new_proj_left_hip;
1378  data_changed = true;
1379 }
1380 /** Get proj_left_knee value.
1381  *
1382  Left knee position vector.
1383  * @return proj_left_knee value
1384  */
1385 float *
1386 HumanSkeletonProjectionInterface::proj_left_knee() const
1387 {
1388  return data->proj_left_knee;
1389 }
1390 
1391 /** Get proj_left_knee value at given index.
1392  *
1393  Left knee position vector.
1394  * @param index index of value
1395  * @return proj_left_knee value
1396  * @exception Exception thrown if index is out of bounds
1397  */
1398 float
1399 HumanSkeletonProjectionInterface::proj_left_knee(unsigned int index) const
1400 {
1401  if (index > 2) {
1402  throw Exception("Index value %u out of bounds (0..2)", index);
1403  }
1404  return data->proj_left_knee[index];
1405 }
1406 
1407 /** Get maximum length of proj_left_knee value.
1408  * @return length of proj_left_knee value, can be length of the array or number of
1409  * maximum number of characters for a string
1410  */
1411 size_t
1412 HumanSkeletonProjectionInterface::maxlenof_proj_left_knee() const
1413 {
1414  return 2;
1415 }
1416 
1417 /** Set proj_left_knee value.
1418  *
1419  Left knee position vector.
1420  * @param new_proj_left_knee new proj_left_knee value
1421  */
1422 void
1423 HumanSkeletonProjectionInterface::set_proj_left_knee(const float * new_proj_left_knee)
1424 {
1425  memcpy(data->proj_left_knee, new_proj_left_knee, sizeof(float) * 2);
1426  data_changed = true;
1427 }
1428 
1429 /** Set proj_left_knee value at given index.
1430  *
1431  Left knee position vector.
1432  * @param new_proj_left_knee new proj_left_knee value
1433  * @param index index for of the value
1434  */
1435 void
1436 HumanSkeletonProjectionInterface::set_proj_left_knee(unsigned int index, const float new_proj_left_knee)
1437 {
1438  if (index > 2) {
1439  throw Exception("Index value %u out of bounds (0..2)", index);
1440  }
1441  data->proj_left_knee[index] = new_proj_left_knee;
1442  data_changed = true;
1443 }
1444 /** Get proj_left_ankle value.
1445  *
1446  Left ankle position vector.
1447  * @return proj_left_ankle value
1448  */
1449 float *
1450 HumanSkeletonProjectionInterface::proj_left_ankle() const
1451 {
1452  return data->proj_left_ankle;
1453 }
1454 
1455 /** Get proj_left_ankle value at given index.
1456  *
1457  Left ankle position vector.
1458  * @param index index of value
1459  * @return proj_left_ankle value
1460  * @exception Exception thrown if index is out of bounds
1461  */
1462 float
1463 HumanSkeletonProjectionInterface::proj_left_ankle(unsigned int index) const
1464 {
1465  if (index > 2) {
1466  throw Exception("Index value %u out of bounds (0..2)", index);
1467  }
1468  return data->proj_left_ankle[index];
1469 }
1470 
1471 /** Get maximum length of proj_left_ankle value.
1472  * @return length of proj_left_ankle value, can be length of the array or number of
1473  * maximum number of characters for a string
1474  */
1475 size_t
1476 HumanSkeletonProjectionInterface::maxlenof_proj_left_ankle() const
1477 {
1478  return 2;
1479 }
1480 
1481 /** Set proj_left_ankle value.
1482  *
1483  Left ankle position vector.
1484  * @param new_proj_left_ankle new proj_left_ankle value
1485  */
1486 void
1487 HumanSkeletonProjectionInterface::set_proj_left_ankle(const float * new_proj_left_ankle)
1488 {
1489  memcpy(data->proj_left_ankle, new_proj_left_ankle, sizeof(float) * 2);
1490  data_changed = true;
1491 }
1492 
1493 /** Set proj_left_ankle value at given index.
1494  *
1495  Left ankle position vector.
1496  * @param new_proj_left_ankle new proj_left_ankle value
1497  * @param index index for of the value
1498  */
1499 void
1500 HumanSkeletonProjectionInterface::set_proj_left_ankle(unsigned int index, const float new_proj_left_ankle)
1501 {
1502  if (index > 2) {
1503  throw Exception("Index value %u out of bounds (0..2)", index);
1504  }
1505  data->proj_left_ankle[index] = new_proj_left_ankle;
1506  data_changed = true;
1507 }
1508 /** Get proj_left_foot value.
1509  *
1510  Left foot position vector.
1511  * @return proj_left_foot value
1512  */
1513 float *
1514 HumanSkeletonProjectionInterface::proj_left_foot() const
1515 {
1516  return data->proj_left_foot;
1517 }
1518 
1519 /** Get proj_left_foot value at given index.
1520  *
1521  Left foot position vector.
1522  * @param index index of value
1523  * @return proj_left_foot value
1524  * @exception Exception thrown if index is out of bounds
1525  */
1526 float
1527 HumanSkeletonProjectionInterface::proj_left_foot(unsigned int index) const
1528 {
1529  if (index > 2) {
1530  throw Exception("Index value %u out of bounds (0..2)", index);
1531  }
1532  return data->proj_left_foot[index];
1533 }
1534 
1535 /** Get maximum length of proj_left_foot value.
1536  * @return length of proj_left_foot value, can be length of the array or number of
1537  * maximum number of characters for a string
1538  */
1539 size_t
1540 HumanSkeletonProjectionInterface::maxlenof_proj_left_foot() const
1541 {
1542  return 2;
1543 }
1544 
1545 /** Set proj_left_foot value.
1546  *
1547  Left foot position vector.
1548  * @param new_proj_left_foot new proj_left_foot value
1549  */
1550 void
1551 HumanSkeletonProjectionInterface::set_proj_left_foot(const float * new_proj_left_foot)
1552 {
1553  memcpy(data->proj_left_foot, new_proj_left_foot, sizeof(float) * 2);
1554  data_changed = true;
1555 }
1556 
1557 /** Set proj_left_foot value at given index.
1558  *
1559  Left foot position vector.
1560  * @param new_proj_left_foot new proj_left_foot value
1561  * @param index index for of the value
1562  */
1563 void
1564 HumanSkeletonProjectionInterface::set_proj_left_foot(unsigned int index, const float new_proj_left_foot)
1565 {
1566  if (index > 2) {
1567  throw Exception("Index value %u out of bounds (0..2)", index);
1568  }
1569  data->proj_left_foot[index] = new_proj_left_foot;
1570  data_changed = true;
1571 }
1572 /** Get proj_right_hip value.
1573  *
1574  Right hip position vector.
1575  * @return proj_right_hip value
1576  */
1577 float *
1578 HumanSkeletonProjectionInterface::proj_right_hip() const
1579 {
1580  return data->proj_right_hip;
1581 }
1582 
1583 /** Get proj_right_hip value at given index.
1584  *
1585  Right hip position vector.
1586  * @param index index of value
1587  * @return proj_right_hip value
1588  * @exception Exception thrown if index is out of bounds
1589  */
1590 float
1591 HumanSkeletonProjectionInterface::proj_right_hip(unsigned int index) const
1592 {
1593  if (index > 2) {
1594  throw Exception("Index value %u out of bounds (0..2)", index);
1595  }
1596  return data->proj_right_hip[index];
1597 }
1598 
1599 /** Get maximum length of proj_right_hip value.
1600  * @return length of proj_right_hip value, can be length of the array or number of
1601  * maximum number of characters for a string
1602  */
1603 size_t
1604 HumanSkeletonProjectionInterface::maxlenof_proj_right_hip() const
1605 {
1606  return 2;
1607 }
1608 
1609 /** Set proj_right_hip value.
1610  *
1611  Right hip position vector.
1612  * @param new_proj_right_hip new proj_right_hip value
1613  */
1614 void
1615 HumanSkeletonProjectionInterface::set_proj_right_hip(const float * new_proj_right_hip)
1616 {
1617  memcpy(data->proj_right_hip, new_proj_right_hip, sizeof(float) * 2);
1618  data_changed = true;
1619 }
1620 
1621 /** Set proj_right_hip value at given index.
1622  *
1623  Right hip position vector.
1624  * @param new_proj_right_hip new proj_right_hip value
1625  * @param index index for of the value
1626  */
1627 void
1628 HumanSkeletonProjectionInterface::set_proj_right_hip(unsigned int index, const float new_proj_right_hip)
1629 {
1630  if (index > 2) {
1631  throw Exception("Index value %u out of bounds (0..2)", index);
1632  }
1633  data->proj_right_hip[index] = new_proj_right_hip;
1634  data_changed = true;
1635 }
1636 /** Get proj_right_knee value.
1637  *
1638  Right knee position vector.
1639  * @return proj_right_knee value
1640  */
1641 float *
1642 HumanSkeletonProjectionInterface::proj_right_knee() const
1643 {
1644  return data->proj_right_knee;
1645 }
1646 
1647 /** Get proj_right_knee value at given index.
1648  *
1649  Right knee position vector.
1650  * @param index index of value
1651  * @return proj_right_knee value
1652  * @exception Exception thrown if index is out of bounds
1653  */
1654 float
1655 HumanSkeletonProjectionInterface::proj_right_knee(unsigned int index) const
1656 {
1657  if (index > 2) {
1658  throw Exception("Index value %u out of bounds (0..2)", index);
1659  }
1660  return data->proj_right_knee[index];
1661 }
1662 
1663 /** Get maximum length of proj_right_knee value.
1664  * @return length of proj_right_knee value, can be length of the array or number of
1665  * maximum number of characters for a string
1666  */
1667 size_t
1668 HumanSkeletonProjectionInterface::maxlenof_proj_right_knee() const
1669 {
1670  return 2;
1671 }
1672 
1673 /** Set proj_right_knee value.
1674  *
1675  Right knee position vector.
1676  * @param new_proj_right_knee new proj_right_knee value
1677  */
1678 void
1679 HumanSkeletonProjectionInterface::set_proj_right_knee(const float * new_proj_right_knee)
1680 {
1681  memcpy(data->proj_right_knee, new_proj_right_knee, sizeof(float) * 2);
1682  data_changed = true;
1683 }
1684 
1685 /** Set proj_right_knee value at given index.
1686  *
1687  Right knee position vector.
1688  * @param new_proj_right_knee new proj_right_knee value
1689  * @param index index for of the value
1690  */
1691 void
1692 HumanSkeletonProjectionInterface::set_proj_right_knee(unsigned int index, const float new_proj_right_knee)
1693 {
1694  if (index > 2) {
1695  throw Exception("Index value %u out of bounds (0..2)", index);
1696  }
1697  data->proj_right_knee[index] = new_proj_right_knee;
1698  data_changed = true;
1699 }
1700 /** Get proj_right_ankle value.
1701  *
1702  Right ankle position vector.
1703  * @return proj_right_ankle value
1704  */
1705 float *
1706 HumanSkeletonProjectionInterface::proj_right_ankle() const
1707 {
1708  return data->proj_right_ankle;
1709 }
1710 
1711 /** Get proj_right_ankle value at given index.
1712  *
1713  Right ankle position vector.
1714  * @param index index of value
1715  * @return proj_right_ankle value
1716  * @exception Exception thrown if index is out of bounds
1717  */
1718 float
1719 HumanSkeletonProjectionInterface::proj_right_ankle(unsigned int index) const
1720 {
1721  if (index > 2) {
1722  throw Exception("Index value %u out of bounds (0..2)", index);
1723  }
1724  return data->proj_right_ankle[index];
1725 }
1726 
1727 /** Get maximum length of proj_right_ankle value.
1728  * @return length of proj_right_ankle value, can be length of the array or number of
1729  * maximum number of characters for a string
1730  */
1731 size_t
1732 HumanSkeletonProjectionInterface::maxlenof_proj_right_ankle() const
1733 {
1734  return 2;
1735 }
1736 
1737 /** Set proj_right_ankle value.
1738  *
1739  Right ankle position vector.
1740  * @param new_proj_right_ankle new proj_right_ankle value
1741  */
1742 void
1743 HumanSkeletonProjectionInterface::set_proj_right_ankle(const float * new_proj_right_ankle)
1744 {
1745  memcpy(data->proj_right_ankle, new_proj_right_ankle, sizeof(float) * 2);
1746  data_changed = true;
1747 }
1748 
1749 /** Set proj_right_ankle value at given index.
1750  *
1751  Right ankle position vector.
1752  * @param new_proj_right_ankle new proj_right_ankle value
1753  * @param index index for of the value
1754  */
1755 void
1756 HumanSkeletonProjectionInterface::set_proj_right_ankle(unsigned int index, const float new_proj_right_ankle)
1757 {
1758  if (index > 2) {
1759  throw Exception("Index value %u out of bounds (0..2)", index);
1760  }
1761  data->proj_right_ankle[index] = new_proj_right_ankle;
1762  data_changed = true;
1763 }
1764 /** Get proj_right_foot value.
1765  *
1766  Right foot position vector.
1767  * @return proj_right_foot value
1768  */
1769 float *
1770 HumanSkeletonProjectionInterface::proj_right_foot() const
1771 {
1772  return data->proj_right_foot;
1773 }
1774 
1775 /** Get proj_right_foot value at given index.
1776  *
1777  Right foot position vector.
1778  * @param index index of value
1779  * @return proj_right_foot value
1780  * @exception Exception thrown if index is out of bounds
1781  */
1782 float
1783 HumanSkeletonProjectionInterface::proj_right_foot(unsigned int index) const
1784 {
1785  if (index > 2) {
1786  throw Exception("Index value %u out of bounds (0..2)", index);
1787  }
1788  return data->proj_right_foot[index];
1789 }
1790 
1791 /** Get maximum length of proj_right_foot value.
1792  * @return length of proj_right_foot value, can be length of the array or number of
1793  * maximum number of characters for a string
1794  */
1795 size_t
1796 HumanSkeletonProjectionInterface::maxlenof_proj_right_foot() const
1797 {
1798  return 2;
1799 }
1800 
1801 /** Set proj_right_foot value.
1802  *
1803  Right foot position vector.
1804  * @param new_proj_right_foot new proj_right_foot value
1805  */
1806 void
1807 HumanSkeletonProjectionInterface::set_proj_right_foot(const float * new_proj_right_foot)
1808 {
1809  memcpy(data->proj_right_foot, new_proj_right_foot, sizeof(float) * 2);
1810  data_changed = true;
1811 }
1812 
1813 /** Set proj_right_foot value at given index.
1814  *
1815  Right foot position vector.
1816  * @param new_proj_right_foot new proj_right_foot value
1817  * @param index index for of the value
1818  */
1819 void
1820 HumanSkeletonProjectionInterface::set_proj_right_foot(unsigned int index, const float new_proj_right_foot)
1821 {
1822  if (index > 2) {
1823  throw Exception("Index value %u out of bounds (0..2)", index);
1824  }
1825  data->proj_right_foot[index] = new_proj_right_foot;
1826  data_changed = true;
1827 }
1828 /* =========== message create =========== */
1829 Message *
1830 HumanSkeletonProjectionInterface::create_message(const char *type) const
1831 {
1832  throw UnknownTypeException("The given type '%s' does not match any known "
1833  "message type for this interface type.", type);
1834 }
1835 
1836 
1837 /** Copy values from other interface.
1838  * @param other other interface to copy values from
1839  */
1840 void
1841 HumanSkeletonProjectionInterface::copy_values(const Interface *other)
1842 {
1843  const HumanSkeletonProjectionInterface *oi = dynamic_cast<const HumanSkeletonProjectionInterface *>(other);
1844  if (oi == NULL) {
1845  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
1846  type(), other->type());
1847  }
1848  memcpy(data, oi->data, sizeof(HumanSkeletonProjectionInterface_data_t));
1849 }
1850 
1851 const char *
1852 HumanSkeletonProjectionInterface::enum_tostring(const char *enumtype, int val) const
1853 {
1854  throw UnknownTypeException("Unknown enum type %s", enumtype);
1855 }
1856 
1857 /* =========== messages =========== */
1858 /** Check if message is valid and can be enqueued.
1859  * @param message Message to check
1860  * @return true if the message is valid, false otherwise.
1861  */
1862 bool
1863 HumanSkeletonProjectionInterface::message_valid(const Message *message) const
1864 {
1865  return false;
1866 }
1867 
1868 /// @cond INTERNALS
1869 EXPORT_INTERFACE(HumanSkeletonProjectionInterface)
1870 /// @endcond
1871 
1872 
1873 } // end namespace fawkes
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:43
HumanSkeletonProjectionInterface Fawkes BlackBoard Interface.
Fawkes library namespace.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
Base class for exceptions in Fawkes.
Definition: exception.h:36
const char * type() const
Get type of interface.
Definition: interface.cpp:635