OpenNI 1.0.0
XnContext.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002 *                                                                            *
00003 *  OpenNI 1.0 Alpha                                                          *
00004 *  Copyright (C) 2010 PrimeSense Ltd.                                        *
00005 *                                                                            *
00006 *  This file is part of OpenNI.                                              *
00007 *                                                                            *
00008 *  OpenNI is free software: you can redistribute it and/or modify            *
00009 *  it under the terms of the GNU Lesser General Public License as published  *
00010 *  by the Free Software Foundation, either version 3 of the License, or      *
00011 *  (at your option) any later version.                                       *
00012 *                                                                            *
00013 *  OpenNI is distributed in the hope that it will be useful,                 *
00014 *  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00015 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the              *
00016 *  GNU Lesser General Public License for more details.                       *
00017 *                                                                            *
00018 *  You should have received a copy of the GNU Lesser General Public License  *
00019 *  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.            *
00020 *                                                                            *
00021 *****************************************************************************/
00022 
00023 
00024 
00025 
00026 #ifndef __XN_CONTEXT_H__
00027 #define __XN_CONTEXT_H__
00028 
00082 //---------------------------------------------------------------------------
00083 // Includes
00084 //---------------------------------------------------------------------------
00085 #include <XnTypes.h>
00086 #include <XnQueries.h>
00087 #include <XnPrdNodeInfoList.h>
00088 
00089 //---------------------------------------------------------------------------
00090 // Functions
00091 //---------------------------------------------------------------------------
00092 
00105 XN_C_API XnStatus xnInit(XnContext** ppContext);
00106 
00114 XN_C_API XnStatus xnContextRunXmlScriptFromFile(XnContext* pContext, const XnChar* strFileName, XnEnumerationErrors* pErrors);
00115 
00123 XN_C_API XnStatus xnContextRunXmlScript(XnContext* pContext, const XnChar* xmlScript, XnEnumerationErrors* pErrors);
00124 
00132 XN_C_API XnStatus xnInitFromXmlFile(const XnChar* strFileName, XnContext** ppContext, XnEnumerationErrors* pErrors);
00133 
00140 XN_C_API XnStatus xnContextOpenFileRecording(XnContext* pContext, const XnChar* strFileName);
00141 
00148 XN_C_API void xnShutdown(XnContext* pContext);
00149 
00150 // @}
00151 
00167 XN_C_API XnStatus xnEnumerateProductionTrees(
00168     XnContext* pContext,
00169     XnProductionNodeType Type, 
00170     const XnNodeQuery* pQuery,
00171     XnNodeInfoList** ppTreesList,
00172     XnEnumerationErrors* pErrors
00173     );
00174 
00183 XN_C_API XnStatus xnCreateProductionTree(
00184      XnContext* pContext,
00185      XnNodeInfo* pTree,
00186      XnNodeHandle* phNode
00187      );
00188 
00200 XN_C_API XnStatus xnCreateAnyProductionTree(
00201     XnContext* pContext,
00202     XnProductionNodeType type,
00203     XnNodeQuery* pQuery,
00204     XnNodeHandle* phNode,
00205     XnEnumerationErrors* pErrors
00206     );
00207 
00219 XN_C_API XnStatus xnCreateMockNode(
00220     XnContext* pContext, 
00221     XnProductionNodeType type,
00222     const XnChar* strName,
00223     XnNodeHandle* phNode
00224     );
00225 
00237 XN_C_API XnStatus xnCreateMockNodeBasedOn(
00238     XnContext* pContext,
00239     XnNodeHandle hOriginalNode,
00240     const XnChar* strName,
00241     XnNodeHandle* phMockNode
00242     );
00243 
00249 XN_C_API XnStatus xnProductionNodeAddRef(XnNodeHandle hNode);
00250 
00257 XN_C_API XnStatus XN_API_DEPRECATED("Please use xnProductionNodeAddRef() instead.") xnRefProductionNode(XnNodeHandle hNode);
00258 
00265 XN_C_API void xnProductionNodeRelease(XnNodeHandle hNode);
00266 
00274 XN_C_API void XN_API_DEPRECATED("Please use xnProductionNodeRelease() instead.") xnUnrefProductionNode(XnNodeHandle hNode);
00275 
00283 XN_C_API XnStatus xnEnumerateExistingNodes(XnContext* pContext, XnNodeInfoList** ppList);
00284 
00293 XN_C_API XnStatus xnEnumerateExistingNodesByType(XnContext* pContext, XnProductionNodeType type, XnNodeInfoList** ppList);
00294 
00302 XN_C_API XnStatus xnFindExistingNodeByType(
00303     XnContext* pContext,
00304     XnProductionNodeType type,
00305     XnNodeHandle* phNode
00306     );
00307 
00317 XN_C_API XnStatus xnGetNodeHandleByName(
00318     XnContext* pContext,
00319     const XnChar* strInstanceName,
00320     XnNodeHandle* phNode
00321     );
00322 
00323 // @}
00324 
00335 XN_C_API XnStatus xnWaitAndUpdateAll(XnContext* pContext);
00336 
00343 XN_C_API XnStatus xnWaitOneUpdateAll(XnContext* pContext, XnNodeHandle hNode);
00344 
00350 XN_C_API XnStatus xnWaitAnyUpdateAll(XnContext* pContext);
00351 
00358 XN_C_API XnStatus xnWaitNoneUpdateAll(XnContext* pContext);
00359 
00365 XN_C_API XnStatus xnStartGeneratingAll(XnContext* pContext);
00366 
00372 XN_C_API XnStatus xnStopGeneratingAll(XnContext* pContext);
00373 
00381 XN_C_API XnStatus xnSetGlobalMirror(XnContext* pContext, XnBool bMirror);
00382 
00388 XN_C_API XnBool xnGetGlobalMirror(XnContext* pContext);
00389 
00397 XN_C_API XnStatus xnGetGlobalErrorState(XnContext* pContext);
00398 
00407 XN_C_API XnStatus xnRegisterToGlobalErrorStateChange
00408     (XnContext* pContext, XnErrorStateChangedHandler handler,
00409     void* pCookie, XnCallbackHandle* phCallback);
00410 
00417 XN_C_API void xnUnregisterFromGlobalErrorStateChange
00418     (XnContext* pContext, XnCallbackHandle hCallback);
00419 
00421 
00424 #endif // __XN_CONTEXT_H__