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