| 2363 | } |
| 2364 | |
| 2365 | static XnStatus xnUpdateTreeImpl(const XnNodeInfo* pNode) |
| 2366 | { |
| 2367 | XnStatus nRetVal = XN_STATUS_OK; |
| 2368 | |
| 2369 | // check if it was already updated |
| 2370 | if (!pNode->hNode->bWasVisited) |
| 2371 | { |
| 2372 | // not updated. start with input nodes |
| 2373 | for (XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pNode->pNeededTrees); |
| 2374 | xnNodeInfoListIteratorIsValid(it); |
| 2375 | it = xnNodeInfoListGetNext(it)) |
| 2376 | { |
| 2377 | XnNodeInfo* pChildInfo = xnNodeInfoListGetCurrent(it); |
| 2378 | nRetVal = xnUpdateTreeImpl(pChildInfo); |
| 2379 | XN_IS_STATUS_OK(nRetVal); |
| 2380 | } |
| 2381 | |
| 2382 | // and now update root (only if it's a generator) |
| 2383 | if (pNode->hNode->pModuleInstance->pLoaded->pInterface->HierarchyType.IsSet(XN_NODE_TYPE_GENERATOR)) |
| 2384 | { |
| 2385 | // when wait is not requested, we only update nodes that have new data |
| 2386 | if (xnIsNewDataAvailable(pNode->hNode, NULL)) |
| 2387 | { |
| 2388 | nRetVal = xnUpdateDataImpl(pNode->hNode); |
| 2389 | XN_IS_STATUS_OK(nRetVal); |
| 2390 | } |
| 2391 | } |
| 2392 | // If it's a recorder, record |
| 2393 | else if (pNode->hNode->pModuleInstance->pLoaded->pInterface->HierarchyType.IsSet(XN_NODE_TYPE_RECORDER)) |
| 2394 | { |
| 2395 | nRetVal = xnRecord(pNode->hNode); |
| 2396 | XN_IS_STATUS_OK(nRetVal); |
| 2397 | } |
| 2398 | |
| 2399 | pNode->hNode->bWasVisited = TRUE; |
| 2400 | } |
| 2401 | |
| 2402 | return (XN_STATUS_OK); |
| 2403 | } |
| 2404 | |
| 2405 | // Updates the entire graph (if pSubGraph is NULL), or just the sub graph starting from the pSubGraph node |
| 2406 | static XnStatus xnUpdateGraph(XnContext* pContext, const XnNodeInfo* pSubGraph) |
no test coverage detected