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

Function xnXmlReadQuery

Source/OpenNI/XnXmlScriptNode.cpp:547–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547XnStatus xnXmlReadQuery(const TiXmlElement* pQueryElem, XnNodeQuery* pQuery)
548{
549 XnStatus nRetVal = XN_STATUS_OK;
550
551 // vendor
552 const TiXmlElement* pVendor = pQueryElem->FirstChildElement("Vendor");
553 if (pVendor != NULL)
554 {
555 xnNodeQuerySetVendor(pQuery, pVendor->GetText());
556 }
557
558 // name
559 const TiXmlElement* pName = pQueryElem->FirstChildElement("Name");
560 if (pName != NULL)
561 {
562 xnNodeQuerySetName(pQuery, pName->GetText());
563 }
564
565 // Min version
566 const TiXmlElement* pMinVersion = pQueryElem->FirstChildElement("MinVersion");
567 if (pMinVersion != NULL)
568 {
569 XnVersion minVersion;
570 nRetVal = xnReadVersionFromXml(pMinVersion, &minVersion);
571 XN_IS_STATUS_OK(nRetVal);
572
573 xnNodeQuerySetMinVersion(pQuery, &minVersion);
574 }
575
576 // Max version
577 const TiXmlElement* pMaxVersion = pQueryElem->FirstChildElement("MaxVersion");
578 if (pMaxVersion != NULL)
579 {
580 XnVersion maxVersion;
581 nRetVal = xnReadVersionFromXml(pMaxVersion, &maxVersion);
582 XN_IS_STATUS_OK(nRetVal);
583
584 xnNodeQuerySetMaxVersion(pQuery, &maxVersion);
585 }
586
587 // Capabilities
588 const TiXmlElement* pCapabilities = pQueryElem->FirstChildElement("Capabilities");
589 if (pCapabilities != NULL)
590 {
591 const TiXmlElement* pCap = pCapabilities->FirstChildElement("Capability");
592 while (pCap != NULL)
593 {
594 xnNodeQueryAddSupportedCapability(pQuery, pCap->GetText());
595 pCap = pCap->NextSiblingElement("Capability");
596 }
597 }
598
599 // Map Output Modes
600 const TiXmlElement* pOutputModes = pQueryElem->FirstChildElement("MapOutputModes");
601 if (pOutputModes != NULL)
602 {
603 const TiXmlElement* pMode = pOutputModes->FirstChildElement("MapOutputMode");
604 while (pMode != NULL)

Callers 1

xnConfigureCreateNodesFunction · 0.85

Tested by

no test coverage detected