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

Function xnRemoveNeededNode

Source/OpenNI/XnOpenNI.cpp:3408–3438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3406}
3407
3408XN_C_API XnStatus xnRemoveNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode)
3409{
3410 XnStatus nRetVal = XN_STATUS_OK;
3411
3412 XN_VALIDATE_INPUT_PTR(hInstance);
3413 XN_VALIDATE_INPUT_PTR(hNeededNode);
3414
3415 // find it in the list
3416 XnNodeInfoList* pNeededNodes = xnNodeInfoGetNeededNodes(hInstance->pNodeInfo);
3417
3418 for (XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pNeededNodes);
3419 xnNodeInfoListIteratorIsValid(it);
3420 it = xnNodeInfoListGetNext(it))
3421 {
3422 XnNodeInfo* pNeeded = xnNodeInfoListGetCurrent(it);
3423 if (pNeeded->hNode == hNeededNode)
3424 {
3425 // remove it
3426 nRetVal = xnNodeInfoListRemove(pNeededNodes, it);
3427 XN_IS_STATUS_OK(nRetVal);
3428
3429 // and dec ref it
3430 xnProductionNodeRelease(hNeededNode);
3431
3432 return (XN_STATUS_OK);
3433 }
3434 }
3435
3436 // if we got here, it wasn't found
3437 return (XN_STATUS_INVALID_OPERATION);
3438}
3439
3440//---------------------------------------------------------------------------
3441// Device

Calls 4

xnNodeInfoListGetCurrentFunction · 0.85
xnNodeInfoListRemoveFunction · 0.85
xnProductionNodeReleaseFunction · 0.85

Tested by

no test coverage detected