Fawkes API  Fawkes Development Version
skel_drawer.h
1 
2 /***************************************************************************
3  * skel_drawer.h - OpenNI Visualization: 3D skeleton drawer
4  *
5  * Created: Sat Apr 02 19:56:55 2011
6  * Copyright 2006-2011 Tim Niemueller [www.niemueller.de]
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.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_OPENNI_PCLVIEWER_SKEL_DRAWER_H_
24 #define _PLUGINS_OPENNI_PCLVIEWER_SKEL_DRAWER_H_
25 
26 #include <interfaces/HumanSkeletonInterface.h>
27 #include <interfaces/HumanSkeletonProjectionInterface.h>
28 #include <interfaces/ObjectPositionInterface.h>
29 #include <plugins/openni/utils/types.h>
30 
32 {
33 public:
34  /** Print state enum. */
35  typedef enum {
36  PRINT_NONE, /**< Print neither ID nor state */
37  PRINT_ID, /**< Print only ID */
38  PRINT_ID_STATE /**< Print ID and state */
39  } PrintState;
40 
41  SkelGuiSkeletonDrawer3D(fawkes::openni::UserMap &users, fawkes::openni::HandMap &hands);
42 
43  void draw();
44 
45  void toggle_print_state();
46  void set_print_state(PrintState state);
47 
48 private:
49  void print_string(void *font, char *str);
50  void draw_limb(float *p1, float conf1, float *p2, float conf2);
51  void draw_user(fawkes::openni::UserInfo &user);
52  void draw_circle(unsigned int id, float *p, float radius);
53 
54 private:
55  fawkes::openni::UserMap &users_;
56  fawkes::openni::HandMap &hands_;
57 
58  PrintState print_state_;
59 };
60 
61 #endif
Print neither ID nor state.
Definition: skel_drawer.h:36
Draw body skeleton using OpenGL (3D).
Definition: skel_drawer.h:31
void draw()
Draw skeletons.
void set_print_state(PrintState state)
Set print state.
PrintState
Print state enum.
Definition: skel_drawer.h:35
SkelGuiSkeletonDrawer3D(fawkes::openni::UserMap &users, fawkes::openni::HandMap &hands)
Constructor.
Definition: skel_drawer.cpp:46
void toggle_print_state()
Toggle the printing state.
User info to pass to draw_skeletons().
Definition: types.h:37