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

Function xnConfigureNodeFromXml

Source/OpenNI/XnXmlScriptNode.cpp:446–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446XnStatus xnConfigureNodeFromXml(XnNodeHandle hNode, const TiXmlElement* pNode)
447{
448 XnStatus nRetVal = XN_STATUS_OK;
449
450 const TiXmlElement* pConfig = pNode->FirstChildElement("Configuration");
451 if (pConfig == NULL)
452 {
453 return (XN_STATUS_OK);
454 }
455
456 XnBool bLock = FALSE;
457 const XnChar* strLock = pConfig->Attribute("lock");
458 if (strLock != NULL)
459 {
460 xnXmlReadBoolAttribute(pConfig, "lock", &bLock);
461 }
462
463 XnLockHandle hLock = 0;
464
465 if (bLock)
466 {
467 nRetVal = xnLockNodeForChanges(hNode, &hLock);
468 XN_IS_STATUS_OK(nRetVal);
469
470 nRetVal = xnLockedNodeStartChanges(hNode, hLock);
471 XN_IS_STATUS_OK(nRetVal);
472 }
473
474 const TiXmlElement* pOpcode = pConfig->FirstChildElement();
475 while (pOpcode != NULL)
476 {
477 nRetVal = xnConfigureSetOpcode(hNode, pOpcode);
478 XN_IS_STATUS_OK(nRetVal);
479
480 pOpcode = pOpcode->NextSiblingElement();
481 }
482
483 if (bLock)
484 {
485 nRetVal = xnLockedNodeEndChanges(hNode, hLock);
486 }
487
488 return (XN_STATUS_OK);
489}
490
491static XnBool xnVersionGetNext(XnChar* strCurrent, XnChar** pstrNext)
492{

Callers 1

xnConfigureCreateNodesFunction · 0.85

Calls 8

xnXmlReadBoolAttributeFunction · 0.85
xnLockNodeForChangesFunction · 0.85
xnLockedNodeStartChangesFunction · 0.85
xnConfigureSetOpcodeFunction · 0.85
xnLockedNodeEndChangesFunction · 0.85
AttributeMethod · 0.80
FirstChildElementMethod · 0.45
NextSiblingElementMethod · 0.45

Tested by

no test coverage detected