Fawkes API  Fawkes Development Version
skel_drawer.h
1 
2 /***************************************************************************
3  * skel_drawer.h - Skeleton Visualization GUI: skeleton drawer
4  *
5  * Created: Wed Mar 02 11:33:29 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_SKELGUI_SKEL_DRAWER_H_
24 #define __PLUGINS_OPENNI_SKELGUI_SKEL_DRAWER_H_
25 
26 #include <plugins/openni/utils/types.h>
27 
28 #include <interfaces/HumanSkeletonInterface.h>
29 #include <interfaces/HumanSkeletonProjectionInterface.h>
30 #include <interfaces/ObjectPositionInterface.h>
31 
33 {
34  public:
35  /** Print state enum. */
36  typedef enum {
37  PRINT_NONE, /**< Print neither ID nor state */
38  PRINT_ID, /**< Print only ID */
39  PRINT_ID_STATE /**< Print ID and state */
40  } PrintState;
41 
42  SkelGuiSkeletonDrawer(fawkes::openni::UserMap &users,
43  fawkes::openni::HandMap &hands);
44 
45  void draw();
46 
47  void toggle_print_state();
48  void set_print_state(PrintState state);
49 
50  private:
51  void print_string(void *font, char *str);
52  void draw_limb(float *proj1, float conf1, float *proj2, float conf2);
53  void draw_user(fawkes::openni::UserInfo &user);
54  void draw_circle(unsigned int id, float *proj, float radius);
55 
56  private:
57  fawkes::openni::UserMap &__users;
58  fawkes::openni::HandMap &__hands;
59 
60  PrintState __print_state;
61 };
62 
63 #endif
void toggle_print_state()
Toggle the printing state.
Draw body skeleton using OpenGL.
Definition: skel_drawer.h:32
void draw()
Draw skeletons.
SkelGuiSkeletonDrawer(fawkes::openni::UserMap &users, fawkes::openni::HandMap &hands)
Constructor.
Definition: skel_drawer.cpp:47
Print neither ID nor state.
Definition: skel_drawer.h:37
void set_print_state(PrintState state)
Set print state.
PrintState
Print state enum.
Definition: skel_drawer.h:36
User info to pass to draw_skeletons().
Definition: types.h:41