コード例 #1
0
ファイル: XnXmlConfig.cpp プロジェクト: yosilove/OpenNI
XN_C_API XnStatus xnContextRunXmlScriptFromFile(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors)
{
	XnStatus nRetVal = XN_STATUS_OK;
	
	TiXmlDocument doc;
	nRetVal = xnXmlLoadDocument(doc, strFileName);
	printf("XnXMLConfig.xnContextRunXmlScriptFromFileL: Load document\n");
	XN_IS_STATUS_OK(nRetVal);
	
	TiXmlElement* pRootElem = doc.RootElement();
	if (pRootElem != NULL)
	{
		printf("XnXMLConfig.xnContextRunXmlScriptFromFile: call xnLoadLicednsesFromXML\n");
		nRetVal = xnLoadLicensesFromXml(pContext, pRootElem);
		XN_IS_STATUS_OK(nRetVal);
		printf("XnXMLConfig.xnContextRunXmlScriptFromFile: Loaded licenses.\n");
		printf("XnXMLConfig.xnContextRunXmlScriptFromFile: call xnConfigureCreateNodes()\n");
		nRetVal = xnConfigureCreateNodes(pContext, pRootElem, pErrors);
		printf("XnXMLConfig.xnContextRunXmlScriptFromFile: called xnConfigureCreateNodes()\n");
		XN_IS_STATUS_OK(nRetVal);
	}
	else {
		printf("Porting to mac, cannot load xml document: %s", strFileName);
	}

	return (XN_STATUS_OK);
}
コード例 #2
0
ファイル: XnXmlScriptNode.cpp プロジェクト: Clebeson/OpenNI
XnStatus RunXmlScriptImpl(XnContext* pContext, TiXmlDocument* pDoc, XnNodeInfoList* pCreatedNodes, XnEnumerationErrors* pErrors)
{
	XnStatus nRetVal = XN_STATUS_OK;

	TiXmlElement* pRootElem = pDoc->RootElement();
	if (pRootElem != NULL)
	{
		nRetVal = xnLoadLicensesFromXml(pContext, pRootElem);
		XN_IS_STATUS_OK(nRetVal);

		nRetVal = xnConfigureCreateNodes(pContext, pRootElem, pCreatedNodes, pErrors);
		XN_IS_STATUS_OK(nRetVal);
	}

	return (XN_STATUS_OK);
}