22 #ifndef __XN_CPP_WRAPPER_H__
23 #define __XN_CPP_WRAPPER_H__
123 Version(XnUInt8 nMajor, XnUInt8 nMinor, XnUInt16 nMaintenance, XnUInt32 nBuild)
125 m_version.
nMajor = nMajor;
126 m_version.
nMinor = nMinor;
128 m_version.
nBuild = nBuild;
283 inline const XnUInt8*
Data()
const {
return *m_ppData; }
288 inline const XnUInt8*&
Data() {
return *m_ppData; }
309 if (nBytes > m_nAllocatedSize)
318 m_nAllocatedSize = nBytes;
332 if (m_nAllocatedSize != 0)
336 m_nAllocatedSize = 0;
351 const XnUInt8* pOrigData = *m_ppData;
356 if (pOrigData != NULL)
375 const XnUInt8** m_ppData;
376 XnUInt32 m_nAllocatedSize;
412 inline XnUInt32
XRes()
const {
return m_map.
Res.
X; }
425 inline XnUInt32
YRes()
const {
return m_map.
Res.
Y; }
496 inline XnUInt32
FPS()
const {
return m_map.
nFPS; }
572 if (pExternalBuffer == NULL)
582 Data() = pExternalBuffer;
608 template<
class _pixelType>
612 inline Map(_pixelType*& pData, XnUInt32& nXRes, XnUInt32 &nYRes) :
613 m_pData(pData), m_nXRes(nXRes), m_nYRes(nYRes)
623 inline XnUInt32
XRes()
const {
return m_nXRes; }
631 inline XnUInt32
YRes()
const {
return m_nYRes; }
646 XN_ASSERT(nIndex < (m_nXRes * m_nYRes));
647 return m_pData[nIndex];
662 XN_ASSERT(nIndex < (m_nXRes *m_nYRes));
663 return m_pData[nIndex];
674 inline const _pixelType&
operator()(XnUInt32 x, XnUInt32 y)
const
676 XN_ASSERT(x < m_nXRes && y < m_nYRes);
677 return m_pData[y*m_nXRes + x];
689 XN_ASSERT(x < m_nXRes && y < m_nYRes);
690 return m_pData[y*m_nXRes + x];
696 Map& operator=(
const Map&);
698 _pixelType*& m_pData;
794 return ReAdjust(nXRes, nYRes, pExternalBuffer);
875 return m_writableDepthMap;
885 XN_ASSERT(nIndex < (
XRes()*
YRes()));
886 return Data()[nIndex];
897 XN_ASSERT(x <
XRes() && y <
YRes());
1252 return ReAdjust(nXRes, nYRes, pExternalBuffer);
1314 XN_ASSERT(nIndex < (
XRes()*
YRes()));
1315 return Data()[nIndex];
1326 XN_ASSERT(x <
XRes() && y <
YRes());
1486 return ReAdjust(nXRes, nYRes, pExternalBuffer);
1565 XN_ASSERT(nIndex < (
XRes()*
YRes()));
1566 return Data()[nIndex];
1582 XN_ASSERT(x <
XRes() && y <
YRes());
1583 return (*
this)[y*
XRes() + x];
1728 if (m_hNode == hNode)
1735 if (m_hNode != NULL)
1772 inline XnStatus XN_API_DEPRECATED(
"Please use AddRef() instead.") Ref() {
return AddRef(); }
1773 inline void XN_API_DEPRECATED(
"Please use Release() instead.") Unref() {
Release(); }
1780 static void XN_CALLBACK_TYPE ContextShuttingDownCallback(
XnContext* ,
void* pCookie)
1783 pThis->m_hNode = NULL;
1812 SetUnderlyingObject(pInfo);
1822 SetUnderlyingObject(other.m_pInfo);
1830 SetUnderlyingObject(NULL);
1840 SetUnderlyingObject(other.m_pInfo);
1946 inline void SetUnderlyingObject(
XnNodeInfo* pInfo);
1950 XnBool m_bOwnerOfNode;
2133 XnBool m_bAllocated;
2234 UpdateInternalObject(it);
2247 m_Info = NodeInfo(NULL);
2261 m_bAllocated =
TRUE;
2292 m_bAllocated =
TRUE;
2312 return xnNodeInfoListAddEx(m_pList, &description, strCreationInfo, pList, pAdditionalData, pFreeHandler);
2413 inline void FreeImpl()
2418 m_bAllocated =
FALSE;
2424 XnBool m_bAllocated;
2547 inline void GetRange(XnInt32& nMin, XnInt32& nMax, XnInt32& nStep, XnInt32& nDefault, XnBool& bIsAutoSupported)
const
2593 const XnChar* m_strCap;
5138 inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize,
const XnUInt8* pImageMap)
5530 GestureCookie* pGestureCookie;
5532 pGestureCookie->recognizedHandler = RecognizedCB;
5533 pGestureCookie->progressHandler = ProgressCB;
5534 pGestureCookie->pUserCookie = pCookie;
5543 hCallback = pGestureCookie;
5557 GestureCookie* pGestureCookie = (GestureCookie*)hCallback;
5630 GestureIntermediateStageCompletedCookie* pGestureCookie;
5632 pGestureCookie->handler = handler;
5633 pGestureCookie->pUserCookie = pCookie;
5642 hCallback = pGestureCookie;
5656 GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)hCallback;
5694 GestureReadyForNextIntermediateStageCookie* pGestureCookie;
5696 pGestureCookie->handler = handler;
5697 pGestureCookie->pUserCookie = pCookie;
5706 hCallback = pGestureCookie;
5720 GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)hCallback;
5726 inline XnStatus XN_API_DEPRECATED(
"Use GetAllActiveGestures() instead") GetActiveGestures(XnChar*& astrGestures, XnUInt16& nGestures)
const
5730 inline XnStatus XN_API_DEPRECATED(
"Use EnumerateAllGestures() instead") EnumerateGestures(XnChar*& astrGestures, XnUInt16& nGestures)
const
5737 typedef struct GestureCookie
5745 static void XN_CALLBACK_TYPE GestureRecognizedCallback(
XnNodeHandle hNode,
const XnChar* strGesture,
const XnPoint3D* pIDPosition,
const XnPoint3D* pEndPosition,
void* pCookie)
5747 GestureCookie* pGestureCookie = (GestureCookie*)pCookie;
5749 if (pGestureCookie->recognizedHandler != NULL)
5751 pGestureCookie->recognizedHandler(gen, strGesture, pIDPosition, pEndPosition, pGestureCookie->pUserCookie);
5755 static void XN_CALLBACK_TYPE GestureProgressCallback(
XnNodeHandle hNode,
const XnChar* strGesture,
const XnPoint3D* pPosition, XnFloat fProgress,
void* pCookie)
5757 GestureCookie* pGestureCookie = (GestureCookie*)pCookie;
5759 if (pGestureCookie->progressHandler != NULL)
5761 pGestureCookie->progressHandler(gen, strGesture, pPosition, fProgress, pGestureCookie->pUserCookie);
5765 typedef struct GestureIntermediateStageCompletedCookie
5770 } GestureIntermediateStageCompletedCookie;
5772 static void XN_CALLBACK_TYPE GestureIntermediateStageCompletedCallback(
XnNodeHandle hNode,
const XnChar* strGesture,
const XnPoint3D* pPosition,
void* pCookie)
5774 GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)pCookie;
5776 if (pGestureCookie->handler != NULL)
5778 pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
5782 typedef struct GestureReadyForNextIntermediateStageCookie
5787 } GestureReadyForNextIntermediateStageCookie;
5789 static void XN_CALLBACK_TYPE GestureReadyForNextIntermediateStageCallback(
XnNodeHandle hNode,
const XnChar* strGesture,
const XnPoint3D* pPosition,
void* pCookie)
5791 GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)pCookie;
5793 if (pGestureCookie->handler != NULL)
5795 pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
5926 HandTouchingFOVEdgeCookie* pHandCookie;
5928 pHandCookie->handler = handler;
5929 pHandCookie->pUserCookie = pCookie;
5938 hCallback = pHandCookie;
5952 HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)hCallback;
5957 typedef struct HandTouchingFOVEdgeCookie
5962 } HandTouchingFOVEdgeCookie;
5966 HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)pCookie;
5968 if (pHandCookie->handler != NULL)
5970 pHandCookie->handler(cap, user, pPosition, fTime, eDir, pHandCookie->pUserCookie);
6149 HandCookie* pHandCookie;
6151 pHandCookie->createHandler = CreateCB;
6152 pHandCookie->updateHandler = UpdateCB;
6153 pHandCookie->destroyHandler = DestroyCB;
6154 pHandCookie->pUserCookie = pCookie;
6163 hCallback = pHandCookie;
6177 HandCookie* pHandCookie = (HandCookie*)hCallback;
6280 typedef struct HandCookie
6291 HandCookie* pHandCookie = (HandCookie*)pCookie;
6293 if (pHandCookie->createHandler != NULL)
6295 pHandCookie->createHandler(gen, user, pPosition, fTime, pHandCookie->pUserCookie);
6300 HandCookie* pHandCookie = (HandCookie*)pCookie;
6302 if (pHandCookie->updateHandler != NULL)
6304 pHandCookie->updateHandler(gen, user, pPosition, fTime, pHandCookie->pUserCookie);
6307 static void XN_CALLBACK_TYPE HandDestroyCB(
XnNodeHandle hNode,
XnUserID user, XnFloat fTime,
void* pCookie)
6309 HandCookie* pHandCookie = (HandCookie*)pCookie;
6311 if (pHandCookie->destroyHandler != NULL)
6313 pHandCookie->destroyHandler(gen, user, fTime, pHandCookie->pUserCookie);
6877 CalibrationStartCookie* pCalibrationCookie;
6879 pCalibrationCookie->handler = handler;
6880 pCalibrationCookie->pUserCookie = pCookie;
6887 hCallback = pCalibrationCookie;
6903 CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)hCallback;
6945 CalibrationInProgressCookie* pSkeletonCookie;
6947 pSkeletonCookie->handler = handler;
6948 pSkeletonCookie->pUserCookie = pCookie;
6957 hCallback = pSkeletonCookie;
6971 CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)hCallback;
7008 CalibrationCompleteCookie* pSkeletonCookie;
7010 pSkeletonCookie->handler = handler;
7011 pSkeletonCookie->pUserCookie = pCookie;
7020 hCallback = pSkeletonCookie;
7034 CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)hCallback;
7040 XN_API_DEPRECATED(
"Use the overload with one argument - the bState parameter is useless")
7050 SkeletonCookie* pSkeletonCookie;
7052 pSkeletonCookie->startHandler = CalibrationStartCB;
7053 pSkeletonCookie->endHandler = CalibrationEndCB;
7054 pSkeletonCookie->pUserCookie = pCookie;
7056 #pragma warning (push)
7057 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
7059 #pragma warning (pop)
7066 hCallback = pSkeletonCookie;
7071 inline void XN_API_DEPRECATED(
"Please use UnregisterFromCalibrationStart/Complete") UnregisterCalibrationCallbacks(
XnCallbackHandle hCallback)
7073 SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)hCallback;
7074 #pragma warning (push)
7075 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
7077 #pragma warning (pop)
7083 typedef struct SkeletonCookie
7091 static void XN_CALLBACK_TYPE CalibrationStartBundleCallback(
XnNodeHandle hNode,
XnUserID user,
void* pCookie)
7093 SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
7095 if (pSkeletonCookie->startHandler != NULL)
7097 pSkeletonCookie->startHandler(cap, user, pSkeletonCookie->pUserCookie);
7101 static void XN_CALLBACK_TYPE CalibrationEndBundleCallback(
XnNodeHandle hNode,
XnUserID user, XnBool bSuccess,
void* pCookie)
7103 SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
7105 if (pSkeletonCookie->endHandler != NULL)
7107 pSkeletonCookie->endHandler(cap, user, bSuccess, pSkeletonCookie->pUserCookie);
7111 typedef struct CalibrationStartCookie
7116 } CalibrationStartCookie;
7118 static void XN_CALLBACK_TYPE CalibrationStartCallback(
XnNodeHandle hNode,
XnUserID user,
void* pCookie)
7120 CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)pCookie;
7122 if (pCalibrationCookie->handler != NULL)
7124 pCalibrationCookie->handler(cap, user, pCalibrationCookie->pUserCookie);
7128 typedef struct CalibrationInProgressCookie
7133 } CalibrationInProgressCookie;
7137 CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)pCookie;
7139 if (pSkeletonCookie->handler != NULL)
7141 pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
7145 typedef struct CalibrationCompleteCookie
7150 } CalibrationCompleteCookie;
7154 CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)pCookie;
7156 if (pSkeletonCookie->handler != NULL)
7158 pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
7307 PoseDetectionCookie* pPoseCookie;
7309 pPoseCookie->handler = handler;
7310 pPoseCookie->pPoseCookie = pCookie;
7318 hCallback = pPoseCookie;
7334 PoseDetectionCookie* pPoseCookie;
7336 pPoseCookie->handler = handler;
7337 pPoseCookie->pPoseCookie = pCookie;
7345 hCallback = pPoseCookie;
7357 PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
7370 PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
7419 PoseInProgressCookie* pPoseCookie;
7421 pPoseCookie->handler = handler;
7422 pPoseCookie->pPoseCookie = pCookie;
7431 hCallback = pPoseCookie;
7445 PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)hCallback;
7451 inline XnStatus XN_API_DEPRECATED(
"Use GetAllAvailablePoses() instead") GetAvailablePoses(XnChar** pstrPoses, XnUInt32& nPoses)
const
7460 PoseCookie* pPoseCookie;
7462 pPoseCookie->startHandler = PoseStartCB;
7463 pPoseCookie->endHandler = PoseEndCB;
7464 pPoseCookie->pPoseCookie = pCookie;
7466 #pragma warning (push)
7467 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
7469 #pragma warning (pop)
7476 hCallback = pPoseCookie;
7481 inline void XN_API_DEPRECATED(
"Please use UnregisterFromPoseDetected/UnregisterFromOutOfPose instead") UnregisterFromPoseCallbacks(
XnCallbackHandle hCallback)
7483 PoseCookie* pPoseCookie = (PoseCookie*)hCallback;
7484 #pragma warning (push)
7485 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
7487 #pragma warning (pop)
7493 typedef struct PoseCookie
7501 static void XN_CALLBACK_TYPE PoseDetectionStartBundleCallback(
XnNodeHandle hNode,
const XnChar* strPose,
XnUserID user,
void* pCookie)
7503 PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
7505 if (pPoseCookie->startHandler != NULL)
7507 pPoseCookie->startHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
7511 static void XN_CALLBACK_TYPE PoseDetectionStartEndBundleCallback(
XnNodeHandle hNode,
const XnChar* strPose,
XnUserID user,
void* pCookie)
7513 PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
7515 if (pPoseCookie->endHandler != NULL)
7517 pPoseCookie->endHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
7520 typedef struct PoseDetectionCookie
7525 } PoseDetectionCookie;
7526 static void XN_CALLBACK_TYPE PoseDetectionCallback(
XnNodeHandle hNode,
const XnChar* strPose,
XnUserID user,
void* pCookie)
7528 PoseDetectionCookie* pPoseDetectionCookie = (PoseDetectionCookie*)pCookie;
7530 if (pPoseDetectionCookie->handler != NULL)
7532 pPoseDetectionCookie->handler(cap, strPose, user, pPoseDetectionCookie->pPoseCookie);
7536 typedef struct PoseInProgressCookie
7541 } PoseInProgressCookie;
7545 PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)pCookie;
7547 if (pPoseCookie->handler != NULL)
7549 pPoseCookie->handler(cap, strPose, user, poseErrors, pPoseCookie->pPoseCookie);
7796 UserCookie* pUserCookie;
7798 pUserCookie->newHandler = NewUserCB;
7799 pUserCookie->lostHandler = LostUserCB;
7800 pUserCookie->pUserCookie = pCookie;
7809 hCallback = pUserCookie;
7823 UserCookie* pUserCookie = (UserCookie*)hCallback;
7903 UserSingleCookie* pUserCookie;
7905 pUserCookie->handler = handler;
7906 pUserCookie->pUserCookie = pCookie;
7915 hCallback = pUserCookie;
7929 UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
7947 UserSingleCookie* pUserCookie;
7949 pUserCookie->handler = handler;
7950 pUserCookie->pUserCookie = pCookie;
7959 hCallback = pUserCookie;
7973 UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
7979 typedef struct UserCookie
7989 UserCookie* pUserCookie = (UserCookie*)pCookie;
7991 if (pUserCookie->newHandler != NULL)
7993 pUserCookie->newHandler(gen, user, pUserCookie->pUserCookie);
7997 static void XN_CALLBACK_TYPE LostUserCallback(
XnNodeHandle hNode,
XnUserID user,
void* pCookie)
7999 UserCookie* pUserCookie = (UserCookie*)pCookie;
8001 if (pUserCookie->lostHandler != NULL)
8003 pUserCookie->lostHandler(gen, user, pUserCookie->pUserCookie);
8007 typedef struct UserSingleCookie
8014 static void XN_CALLBACK_TYPE UserSingleCallback(
XnNodeHandle hNode,
XnUserID user,
void* pCookie)
8016 UserSingleCookie* pUserCookie = (UserSingleCookie*)pCookie;
8018 if (pUserCookie->handler != NULL)
8020 pUserCookie->handler(gen, user, pUserCookie->pUserCookie);
8202 inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize,
const XnUInt8* pAudioBuffer)
8242 inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize,
const void* pData)
8283 inline XnStatus EncodeData(
const void* pSrc, XnUInt32 nSrcSize,
void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten)
const
8292 inline XnStatus DecodeData(
const void* pSrc, XnUInt32 nSrcSize,
void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten)
const
8443 return m_it == other.m_it;
8453 return m_it != other.m_it;
8540 m_bAllocated =
FALSE;
8551 XnBool m_bAllocated;
8631 inline Context() : m_pContext(NULL), m_bUsingDeprecatedAPI(
FALSE), m_bAllocated(
FALSE), m_hShuttingDownCallback(NULL) {}
8649 inline Context(
const Context& other) : m_pContext(NULL), m_bUsingDeprecatedAPI(
FALSE), m_bAllocated(
FALSE), m_hShuttingDownCallback(NULL)
8714 m_bAllocated =
TRUE;
8739 nRetVal =
xnContextRunXmlScriptEx(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
8800 m_bAllocated =
TRUE;
8958 nRetVal =
xnEnumerateProductionTrees(m_pContext, Type, pInternalQuery, &pList, pErrors == NULL ? NULL : pErrors->GetUnderlying());
9005 nRetVal =
xnCreateAnyProductionTree(m_pContext, type, pInternalQuery, &hNode, pErrors == NULL ? NULL : pErrors->GetUnderlying());
9245 NodeCreationCookie* pCreationCookie;
9247 pCreationCookie->pFunc = handler;
9248 pCreationCookie->pCookie = pCookie;
9250 nRetVal =
xnRegisterToNodeCreation(m_pContext, NodeCreationCallback, pCreationCookie, &pCreationCookie->hUnderlyingCallback);
9253 hCallback = pCreationCookie;
9267 NodeCreationCookie* pCreationCookie = (NodeCreationCookie*)hCallback;
9285 NodeDestructionCookie* pDestructionCookie;
9287 pDestructionCookie->pFunc = handler;
9288 pDestructionCookie->pCookie = pCookie;
9290 nRetVal =
xnRegisterToNodeDestruction(m_pContext, NodeDestructionCallback, pDestructionCookie, &pDestructionCookie->hUnderlyingCallback);
9293 hCallback = pDestructionCookie;
9307 NodeDestructionCookie* pDestructionCookie = (NodeDestructionCookie*)hCallback;
9464 if (m_pContext == pContext)
9469 if (m_pContext != NULL)
9471 if (m_bUsingDeprecatedAPI && m_bAllocated)
9484 if (pContext != NULL)
9494 m_pContext = pContext;
9501 if (pContext != NULL)
9510 m_bUsingDeprecatedAPI =
TRUE;
9511 #pragma warning (push)
9512 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9513 return xnContextRunXmlScript(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying());
9514 #pragma warning (pop)
9517 inline XnStatus XN_API_DEPRECATED(
"Use other overload!")
RunXmlScriptFromFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
9519 m_bUsingDeprecatedAPI =
TRUE;
9520 #pragma warning (push)
9521 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9523 #pragma warning (pop)
9526 inline XnStatus XN_API_DEPRECATED(
"Use other overload!")
InitFromXmlFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
9529 m_bUsingDeprecatedAPI =
TRUE;
9531 #pragma warning (push)
9532 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9534 #pragma warning (pop)
9538 m_bAllocated =
TRUE;
9545 m_bUsingDeprecatedAPI =
TRUE;
9546 #pragma warning (push)
9547 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9549 #pragma warning (pop)
9552 inline void XN_API_DEPRECATED(
"You may use Release() instead, or count on dtor") Shutdown()
9554 if (m_pContext != NULL)
9556 #pragma warning (push)
9557 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9559 #pragma warning (pop)
9572 Tree.m_bOwnerOfNode =
TRUE;
9579 typedef struct NodeCreationCookie
9584 } NodeCreationCookie;
9586 typedef struct NodeDestructionCookie
9591 } NodeDestructionCookie;
9593 static void XN_CALLBACK_TYPE NodeCreationCallback(
XnContext* pContext,
XnNodeHandle hCreatedNode,
void* pCookie)
9595 NodeCreationCookie* pNodeCreationCookie = (NodeCreationCookie*)pCookie;
9597 ProductionNode createdNode(hCreatedNode);
9598 pNodeCreationCookie->pFunc(context, createdNode, pNodeCreationCookie->pCookie);
9601 static void XN_CALLBACK_TYPE NodeDestructionCallback(
XnContext* pContext,
const XnChar* strDestroyedNodeName,
void* pCookie)
9603 NodeDestructionCookie* pNodeCreationCookie = (NodeDestructionCookie*)pCookie;
9605 pNodeCreationCookie->pFunc(context, strDestroyedNodeName, pNodeCreationCookie->pCookie);
9608 static void XN_CALLBACK_TYPE ContextShuttingDownCallback(
XnContext* ,
void* pCookie)
9611 pThis->m_pContext = NULL;
9615 XnBool m_bUsingDeprecatedAPI;
9616 XnBool m_bAllocated;
9645 inline Resolution(XnUInt32 xRes, XnUInt32 yRes) : m_nXRes(xRes), m_nYRes(yRes)
9679 inline const XnChar*
GetName()
const {
return m_strName; }
9685 const XnChar* m_strName;
9711 if (m_pNeededNodes == NULL)
9717 return *m_pNeededNodes;
9720 inline void NodeInfo::SetUnderlyingObject(
XnNodeInfo* pInfo)
9722 if (m_pNeededNodes != NULL)
9727 m_bOwnerOfNode =
FALSE;
9729 m_pNeededNodes = NULL;
9754 if (m_pInfo == NULL)
9756 return XN_STATUS_INVALID_OPERATION;
10006 return xnFunc(hNode, StateChangedCallback,
this, &m_hCallback);
10011 xnFunc(hNode, m_hCallback);
10021 nRetVal = pTrans->
Register(xnFunc, hNode);
10028 hCallback = pTrans;
10044 typedef struct StateChangeCookie
10049 } StateChangeCookie;
10051 static void XN_CALLBACK_TYPE StateChangedCallback(
XnNodeHandle hNode,
void* pCookie)
10055 pTrans->m_UserHandler(node, pTrans->m_pUserCookie);
10059 void* m_pUserCookie;
10087 hCallback = pTrans;
10100 #endif // __XN_CPP_WRAPPER_H__