Nuitrack  1.6.0
3D Skeleton Tracking Middleware
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Groups Pages
UserFrame.h
1 #ifndef NUITRACK_USERFRAME_H_
2 #define NUITRACK_USERFRAME_H_
3 
4 #include <vector>
5 
6 #include "nuitrack/types/Frame.h"
7 #include "nuitrack/types/User.h"
8 #include "nuitrack/capi/UserTracker_CAPI.h"
9 
10 namespace tdv
11 {
12 namespace nuitrack
13 {
14 
27 class UserFrame : public Frame<UserFrame, uint16_t>
28 {
29 public:
31  UserFrame(UserTrackerData* pimpl)
32  {
33  _pimpl = pimpl;
34  nuitrack_AddUserTrackerDataRef(pimpl);
35  }
36 
37  virtual ~UserFrame()
38  {
39  nuitrack_DestroyUserTrackerData(_pimpl);
40  }
41 
47  const std::vector<User> getUsers() const
48  {
49  UserTrackerData* dataHolder = _pimpl;
50 
51  std::vector<User> usersVector;
52 
53  size_t numUsers = nuitrack_GetUserFrameNumUsers(dataHolder);
54 
55  for(size_t i = 0; i < numUsers; i++)
56  {
57  User user;
58  nuitrack_GetUserFrameUser(dataHolder, i, &user);
59  usersVector.push_back(user);
60  }
61 
62  return usersVector;
63  }
64 
68  int getRows() const
69  {
70  return nuitrack_GetUserFrameRows(_pimpl);
71  }
72 
76  int getCols() const
77  {
78  return nuitrack_GetUserFrameCols(_pimpl);
79  }
80 
84  uint64_t getID() const
85  {
86  return nuitrack_GetUserFrameID(_pimpl);
87  }
88 
92  const DataType* getData() const
93  {
94  return nuitrack_GetUserFrameData(_pimpl);
95  }
96 
97  uint64_t getTimestamp() const
98  {
99  return nuitrack_GetUserFrameTimestamp(_pimpl);
100  }
101 
107  const Vector3 getFloor() const
108  {
109  Vector3 floor;
110  nuitrack_GetUserFrameFloor(_pimpl, &floor);
111  return floor;
112  }
113 
119  const Vector3 getFloorNormal() const
120  {
121  Vector3 floorNormal;
122  nuitrack_GetUserFrameFloorNormal(_pimpl, &floorNormal);
123  return floorNormal;
124  }
125 
126 private:
127  UserTrackerData* _pimpl;
128 
129 };
130 
131 
132 }
133 }
134 
135 #endif /* NUITRACK_USERFRAME_H_ */
UserFrame(UserTrackerData *pimpl)
Definition: UserFrame.h:31
int getCols() const
Returns the number of columns in the user frame.
Definition: UserFrame.h:76
Represents a user map with information about the floor.
Definition: UserFrame.h:27
uint64_t getTimestamp() const
Returns the data timestamp in microseconds.
Definition: UserFrame.h:97
Represents a generalized frame.
Definition: Frame.h:15
const Vector3 getFloor() const
Get point of floor.
Definition: UserFrame.h:107
Definition: Vector3.h:9
uint64_t getID() const
Returns the user frame ID.
Definition: UserFrame.h:84
const std::vector< User > getUsers() const
Returns additional information about detected users.
Definition: UserFrame.h:47
Stores information about a detected user.
Definition: User.h:15
const DataType * getData() const
Returns the user frame data.
Definition: UserFrame.h:92
const Vector3 getFloorNormal() const
Get normal of floor.
Definition: UserFrame.h:119
int getRows() const
Returns the number of rows in the user frame.
Definition: UserFrame.h:68