MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / DetectOutOfPose

Method DetectOutOfPose

Samples/NiUserSelection/PoseToggleUserSelector.cpp:148–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148XnStatus PoseToggleUserSelector::DetectOutOfPose(XnUserID nUserId)
149{
150 XnUInt64 lastOutOfPoseTime;
151
152 UserSelectionState* pState;
153 XnStatus nRetVal=m_hUsersState.Get(nUserId, pState);
154 if(nRetVal!=XN_STATUS_OK)
155 {
156 return nRetVal;
157 }
158 nRetVal=m_usersOutOfPoseTime.Get(nUserId,lastOutOfPoseTime);
159 if(nRetVal!=XN_STATUS_OK)
160 {
161 return nRetVal;
162 }
163 if(lastOutOfPoseTime!=0)
164 {
165 return XN_STATUS_OK; // we already have a number...
166 }
167 lastOutOfPoseTime=m_pUserGenerator->GetTimestamp();
168 m_usersOutOfPoseTime.Set(nUserId,lastOutOfPoseTime);
169 return XN_STATUS_OK;
170}
171
172void XN_CALLBACK_TYPE PoseToggleUserSelector::OutOfPoseCallback(xn::PoseDetectionCapability& /*capability*/, const XnChar* strPose, XnUserID nUserId,void* pCookie)
173{

Callers 1

OutOfPoseCallbackMethod · 0.80

Calls 3

GetMethod · 0.45
GetTimestampMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected