21 #ifndef __XN_CPP_WRAPPER_H__
22 #define __XN_CPP_WRAPPER_H__
122 Version(XnUInt8 nMajor, XnUInt8 nMinor, XnUInt16 nMaintenance, XnUInt32 nBuild)
124 m_version.
nMajor = nMajor;
125 m_version.
nMinor = nMinor;
127 m_version.
nBuild = nBuild;
282 inline const XnUInt8*
Data()
const {
return *m_ppData; }
287 inline const XnUInt8*&
Data() {
return *m_ppData; }
308 if (nBytes > m_nAllocatedSize)
317 m_nAllocatedSize = nBytes;
331 if (m_nAllocatedSize != 0)
335 m_nAllocatedSize = 0;
350 const XnUInt8* pOrigData = *m_ppData;
355 if (pOrigData != NULL)
374 const XnUInt8** m_ppData;
375 XnUInt32 m_nAllocatedSize;
411 inline XnUInt32
XRes()
const {
return m_map.
Res.
X; }
424 inline XnUInt32
YRes()
const {
return m_map.
Res.
Y; }
495 inline XnUInt32
FPS()
const {
return m_map.
nFPS; }
571 if (pExternalBuffer == NULL)
581 Data() = pExternalBuffer;
607 template<
class _pixelType>
611 inline Map(_pixelType*& pData, XnUInt32& nXRes, XnUInt32 &nYRes) :
612 m_pData(pData), m_nXRes(nXRes), m_nYRes(nYRes)
622 inline XnUInt32
XRes()
const {
return m_nXRes; }
630 inline XnUInt32
YRes()
const {
return m_nYRes; }
645 XN_ASSERT(nIndex < (m_nXRes * m_nYRes));
646 return m_pData[nIndex];
661 XN_ASSERT(nIndex < (m_nXRes *m_nYRes));
662 return m_pData[nIndex];
673 inline const _pixelType&
operator()(XnUInt32 x, XnUInt32 y)
const
675 XN_ASSERT(x < m_nXRes && y < m_nYRes);
676 return m_pData[y*m_nXRes + x];
688 XN_ASSERT(x < m_nXRes && y < m_nYRes);
689 return m_pData[y*m_nXRes + x];
695 Map& operator=(
const Map&);
697 _pixelType*& m_pData;
793 return ReAdjust(nXRes, nYRes, pExternalBuffer);
874 return m_writableDepthMap;
884 XN_ASSERT(nIndex < (
XRes()*
YRes()));
885 return Data()[nIndex];
896 XN_ASSERT(x <
XRes() && y <
YRes());
1251 return ReAdjust(nXRes, nYRes, pExternalBuffer);
1313 XN_ASSERT(nIndex < (
XRes()*
YRes()));
1314 return Data()[nIndex];
1325 XN_ASSERT(x <
XRes() && y <
YRes());
1485 return ReAdjust(nXRes, nYRes, pExternalBuffer);
1564 XN_ASSERT(nIndex < (
XRes()*
YRes()));
1565 return Data()[nIndex];
1581 XN_ASSERT(x <
XRes() && y <
YRes());
1582 return (*
this)[y*
XRes() + x];
1727 if (m_hNode == hNode)
1734 if (m_hNode != NULL)
1771 inline XnStatus XN_API_DEPRECATED(
"Please use AddRef() instead.") Ref() {
return AddRef(); }
1772 inline void XN_API_DEPRECATED(
"Please use Release() instead.") Unref() {
Release(); }
1779 static void XN_CALLBACK_TYPE ContextShuttingDownCallback(
XnContext* ,
void* pCookie)
1782 pThis->m_hNode = NULL;
1811 SetUnderlyingObject(pInfo);
1821 SetUnderlyingObject(other.m_pInfo);
1829 SetUnderlyingObject(NULL);
1839 SetUnderlyingObject(other.m_pInfo);
1945 inline void SetUnderlyingObject(
XnNodeInfo* pInfo);
1949 XnBool m_bOwnerOfNode;
2132 XnBool m_bAllocated;
2233 UpdateInternalObject(it);
2246 m_Info = NodeInfo(NULL);
2260 m_bAllocated =
TRUE;
2291 m_bAllocated =
TRUE;
2311 return xnNodeInfoListAddEx(m_pList, &description, strCreationInfo, pList, pAdditionalData, pFreeHandler);
2412 inline void FreeImpl()
2417 m_bAllocated =
FALSE;
2423 XnBool m_bAllocated;
2546 inline void GetRange(XnInt32& nMin, XnInt32& nMax, XnInt32& nStep, XnInt32& nDefault, XnBool& bIsAutoSupported)
const
2592 const XnChar* m_strCap;
5164 inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize,
const XnUInt8* pImageMap)
5556 GestureCookie* pGestureCookie;
5558 pGestureCookie->recognizedHandler = RecognizedCB;
5559 pGestureCookie->progressHandler = ProgressCB;
5560 pGestureCookie->pUserCookie = pCookie;
5569 hCallback = pGestureCookie;
5583 GestureCookie* pGestureCookie = (GestureCookie*)hCallback;
5656 GestureIntermediateStageCompletedCookie* pGestureCookie;
5658 pGestureCookie->handler = handler;
5659 pGestureCookie->pUserCookie = pCookie;
5668 hCallback = pGestureCookie;
5682 GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)hCallback;
5720 GestureReadyForNextIntermediateStageCookie* pGestureCookie;
5722 pGestureCookie->handler = handler;
5723 pGestureCookie->pUserCookie = pCookie;
5732 hCallback = pGestureCookie;
5746 GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)hCallback;
5752 inline XnStatus XN_API_DEPRECATED(
"Use GetAllActiveGestures() instead") GetActiveGestures(XnChar*& astrGestures, XnUInt16& nGestures)
const
5756 inline XnStatus XN_API_DEPRECATED(
"Use EnumerateAllGestures() instead") EnumerateGestures(XnChar*& astrGestures, XnUInt16& nGestures)
const
5763 typedef struct GestureCookie
5771 static void XN_CALLBACK_TYPE GestureRecognizedCallback(
XnNodeHandle hNode,
const XnChar* strGesture,
const XnPoint3D* pIDPosition,
const XnPoint3D* pEndPosition,
void* pCookie)
5773 GestureCookie* pGestureCookie = (GestureCookie*)pCookie;
5775 if (pGestureCookie->recognizedHandler != NULL)
5777 pGestureCookie->recognizedHandler(gen, strGesture, pIDPosition, pEndPosition, pGestureCookie->pUserCookie);
5781 static void XN_CALLBACK_TYPE GestureProgressCallback(
XnNodeHandle hNode,
const XnChar* strGesture,
const XnPoint3D* pPosition, XnFloat fProgress,
void* pCookie)
5783 GestureCookie* pGestureCookie = (GestureCookie*)pCookie;
5785 if (pGestureCookie->progressHandler != NULL)
5787 pGestureCookie->progressHandler(gen, strGesture, pPosition, fProgress, pGestureCookie->pUserCookie);
5791 typedef struct GestureIntermediateStageCompletedCookie
5796 } GestureIntermediateStageCompletedCookie;
5798 static void XN_CALLBACK_TYPE GestureIntermediateStageCompletedCallback(
XnNodeHandle hNode,
const XnChar* strGesture,
const XnPoint3D* pPosition,
void* pCookie)
5800 GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)pCookie;
5802 if (pGestureCookie->handler != NULL)
5804 pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
5808 typedef struct GestureReadyForNextIntermediateStageCookie
5813 } GestureReadyForNextIntermediateStageCookie;
5815 static void XN_CALLBACK_TYPE GestureReadyForNextIntermediateStageCallback(
XnNodeHandle hNode,
const XnChar* strGesture,
const XnPoint3D* pPosition,
void* pCookie)
5817 GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)pCookie;
5819 if (pGestureCookie->handler != NULL)
5821 pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
5952 HandTouchingFOVEdgeCookie* pHandCookie;
5954 pHandCookie->handler = handler;
5955 pHandCookie->pUserCookie = pCookie;
5964 hCallback = pHandCookie;
5978 HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)hCallback;
5983 typedef struct HandTouchingFOVEdgeCookie
5988 } HandTouchingFOVEdgeCookie;
5992 HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)pCookie;
5994 if (pHandCookie->handler != NULL)
5996 pHandCookie->handler(cap, user, pPosition, fTime, eDir, pHandCookie->pUserCookie);
6175 HandCookie* pHandCookie;
6177 pHandCookie->createHandler = CreateCB;
6178 pHandCookie->updateHandler = UpdateCB;
6179 pHandCookie->destroyHandler = DestroyCB;
6180 pHandCookie->pUserCookie = pCookie;
6189 hCallback = pHandCookie;
6203 HandCookie* pHandCookie = (HandCookie*)hCallback;
6306 typedef struct HandCookie
6317 HandCookie* pHandCookie = (HandCookie*)pCookie;
6319 if (pHandCookie->createHandler != NULL)
6321 pHandCookie->createHandler(gen, user, pPosition, fTime, pHandCookie->pUserCookie);
6326 HandCookie* pHandCookie = (HandCookie*)pCookie;
6328 if (pHandCookie->updateHandler != NULL)
6330 pHandCookie->updateHandler(gen, user, pPosition, fTime, pHandCookie->pUserCookie);
6333 static void XN_CALLBACK_TYPE HandDestroyCB(
XnNodeHandle hNode,
XnUserID user, XnFloat fTime,
void* pCookie)
6335 HandCookie* pHandCookie = (HandCookie*)pCookie;
6337 if (pHandCookie->destroyHandler != NULL)
6339 pHandCookie->destroyHandler(gen, user, fTime, pHandCookie->pUserCookie);
6903 CalibrationStartCookie* pCalibrationCookie;
6905 pCalibrationCookie->handler = handler;
6906 pCalibrationCookie->pUserCookie = pCookie;
6913 hCallback = pCalibrationCookie;
6929 CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)hCallback;
6971 CalibrationInProgressCookie* pSkeletonCookie;
6973 pSkeletonCookie->handler = handler;
6974 pSkeletonCookie->pUserCookie = pCookie;
6983 hCallback = pSkeletonCookie;
6997 CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)hCallback;
7034 CalibrationCompleteCookie* pSkeletonCookie;
7036 pSkeletonCookie->handler = handler;
7037 pSkeletonCookie->pUserCookie = pCookie;
7046 hCallback = pSkeletonCookie;
7060 CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)hCallback;
7066 XN_API_DEPRECATED(
"Use the overload with one argument - the bState parameter is useless")
7076 SkeletonCookie* pSkeletonCookie;
7078 pSkeletonCookie->startHandler = CalibrationStartCB;
7079 pSkeletonCookie->endHandler = CalibrationEndCB;
7080 pSkeletonCookie->pUserCookie = pCookie;
7082 #pragma warning (push)
7083 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
7085 #pragma warning (pop)
7092 hCallback = pSkeletonCookie;
7097 inline void XN_API_DEPRECATED(
"Please use UnregisterFromCalibrationStart/Complete") UnregisterCalibrationCallbacks(
XnCallbackHandle hCallback)
7099 SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)hCallback;
7100 #pragma warning (push)
7101 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
7103 #pragma warning (pop)
7109 typedef struct SkeletonCookie
7117 static void XN_CALLBACK_TYPE CalibrationStartBundleCallback(
XnNodeHandle hNode,
XnUserID user,
void* pCookie)
7119 SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
7121 if (pSkeletonCookie->startHandler != NULL)
7123 pSkeletonCookie->startHandler(cap, user, pSkeletonCookie->pUserCookie);
7127 static void XN_CALLBACK_TYPE CalibrationEndBundleCallback(
XnNodeHandle hNode,
XnUserID user, XnBool bSuccess,
void* pCookie)
7129 SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
7131 if (pSkeletonCookie->endHandler != NULL)
7133 pSkeletonCookie->endHandler(cap, user, bSuccess, pSkeletonCookie->pUserCookie);
7137 typedef struct CalibrationStartCookie
7142 } CalibrationStartCookie;
7144 static void XN_CALLBACK_TYPE CalibrationStartCallback(
XnNodeHandle hNode,
XnUserID user,
void* pCookie)
7146 CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)pCookie;
7148 if (pCalibrationCookie->handler != NULL)
7150 pCalibrationCookie->handler(cap, user, pCalibrationCookie->pUserCookie);
7154 typedef struct CalibrationInProgressCookie
7159 } CalibrationInProgressCookie;
7163 CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)pCookie;
7165 if (pSkeletonCookie->handler != NULL)
7167 pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
7171 typedef struct CalibrationCompleteCookie
7176 } CalibrationCompleteCookie;
7180 CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)pCookie;
7182 if (pSkeletonCookie->handler != NULL)
7184 pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
7333 PoseDetectionCookie* pPoseCookie;
7335 pPoseCookie->handler = handler;
7336 pPoseCookie->pPoseCookie = pCookie;
7344 hCallback = pPoseCookie;
7360 PoseDetectionCookie* pPoseCookie;
7362 pPoseCookie->handler = handler;
7363 pPoseCookie->pPoseCookie = pCookie;
7371 hCallback = pPoseCookie;
7383 PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
7396 PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
7445 PoseInProgressCookie* pPoseCookie;
7447 pPoseCookie->handler = handler;
7448 pPoseCookie->pPoseCookie = pCookie;
7457 hCallback = pPoseCookie;
7471 PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)hCallback;
7477 inline XnStatus XN_API_DEPRECATED(
"Use GetAllAvailablePoses() instead") GetAvailablePoses(XnChar** pstrPoses, XnUInt32& nPoses)
const
7486 PoseCookie* pPoseCookie;
7488 pPoseCookie->startHandler = PoseStartCB;
7489 pPoseCookie->endHandler = PoseEndCB;
7490 pPoseCookie->pPoseCookie = pCookie;
7492 #pragma warning (push)
7493 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
7495 #pragma warning (pop)
7502 hCallback = pPoseCookie;
7507 inline void XN_API_DEPRECATED(
"Please use UnregisterFromPoseDetected/UnregisterFromOutOfPose instead") UnregisterFromPoseCallbacks(
XnCallbackHandle hCallback)
7509 PoseCookie* pPoseCookie = (PoseCookie*)hCallback;
7510 #pragma warning (push)
7511 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
7513 #pragma warning (pop)
7519 typedef struct PoseCookie
7527 static void XN_CALLBACK_TYPE PoseDetectionStartBundleCallback(
XnNodeHandle hNode,
const XnChar* strPose,
XnUserID user,
void* pCookie)
7529 PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
7531 if (pPoseCookie->startHandler != NULL)
7533 pPoseCookie->startHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
7537 static void XN_CALLBACK_TYPE PoseDetectionStartEndBundleCallback(
XnNodeHandle hNode,
const XnChar* strPose,
XnUserID user,
void* pCookie)
7539 PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
7541 if (pPoseCookie->endHandler != NULL)
7543 pPoseCookie->endHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
7546 typedef struct PoseDetectionCookie
7551 } PoseDetectionCookie;
7552 static void XN_CALLBACK_TYPE PoseDetectionCallback(
XnNodeHandle hNode,
const XnChar* strPose,
XnUserID user,
void* pCookie)
7554 PoseDetectionCookie* pPoseDetectionCookie = (PoseDetectionCookie*)pCookie;
7556 if (pPoseDetectionCookie->handler != NULL)
7558 pPoseDetectionCookie->handler(cap, strPose, user, pPoseDetectionCookie->pPoseCookie);
7562 typedef struct PoseInProgressCookie
7567 } PoseInProgressCookie;
7571 PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)pCookie;
7573 if (pPoseCookie->handler != NULL)
7575 pPoseCookie->handler(cap, strPose, user, poseErrors, pPoseCookie->pPoseCookie);
7822 UserCookie* pUserCookie;
7824 pUserCookie->newHandler = NewUserCB;
7825 pUserCookie->lostHandler = LostUserCB;
7826 pUserCookie->pUserCookie = pCookie;
7835 hCallback = pUserCookie;
7849 UserCookie* pUserCookie = (UserCookie*)hCallback;
7929 UserSingleCookie* pUserCookie;
7931 pUserCookie->handler = handler;
7932 pUserCookie->pUserCookie = pCookie;
7941 hCallback = pUserCookie;
7955 UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
7973 UserSingleCookie* pUserCookie;
7975 pUserCookie->handler = handler;
7976 pUserCookie->pUserCookie = pCookie;
7985 hCallback = pUserCookie;
7999 UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
8005 typedef struct UserCookie
8015 UserCookie* pUserCookie = (UserCookie*)pCookie;
8017 if (pUserCookie->newHandler != NULL)
8019 pUserCookie->newHandler(gen, user, pUserCookie->pUserCookie);
8023 static void XN_CALLBACK_TYPE LostUserCallback(
XnNodeHandle hNode,
XnUserID user,
void* pCookie)
8025 UserCookie* pUserCookie = (UserCookie*)pCookie;
8027 if (pUserCookie->lostHandler != NULL)
8029 pUserCookie->lostHandler(gen, user, pUserCookie->pUserCookie);
8033 typedef struct UserSingleCookie
8040 static void XN_CALLBACK_TYPE UserSingleCallback(
XnNodeHandle hNode,
XnUserID user,
void* pCookie)
8042 UserSingleCookie* pUserCookie = (UserSingleCookie*)pCookie;
8044 if (pUserCookie->handler != NULL)
8046 pUserCookie->handler(gen, user, pUserCookie->pUserCookie);
8228 inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize,
const XnUInt8* pAudioBuffer)
8268 inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize,
const void* pData)
8309 inline XnStatus EncodeData(
const void* pSrc, XnUInt32 nSrcSize,
void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten)
const
8318 inline XnStatus DecodeData(
const void* pSrc, XnUInt32 nSrcSize,
void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten)
const
8469 return m_it == other.m_it;
8479 return m_it != other.m_it;
8566 m_bAllocated =
FALSE;
8577 XnBool m_bAllocated;
8657 inline Context() : m_pContext(NULL), m_bUsingDeprecatedAPI(
FALSE), m_bAllocated(
FALSE), m_hShuttingDownCallback(NULL) {}
8675 inline Context(
const Context& other) : m_pContext(NULL), m_bUsingDeprecatedAPI(
FALSE), m_bAllocated(
FALSE), m_hShuttingDownCallback(NULL)
8740 m_bAllocated =
TRUE;
8765 nRetVal =
xnContextRunXmlScriptEx(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
8826 m_bAllocated =
TRUE;
8984 nRetVal =
xnEnumerateProductionTrees(m_pContext, Type, pInternalQuery, &pList, pErrors == NULL ? NULL : pErrors->GetUnderlying());
9031 nRetVal =
xnCreateAnyProductionTree(m_pContext, type, pInternalQuery, &hNode, pErrors == NULL ? NULL : pErrors->GetUnderlying());
9271 NodeCreationCookie* pCreationCookie;
9273 pCreationCookie->pFunc = handler;
9274 pCreationCookie->pCookie = pCookie;
9276 nRetVal =
xnRegisterToNodeCreation(m_pContext, NodeCreationCallback, pCreationCookie, &pCreationCookie->hUnderlyingCallback);
9279 hCallback = pCreationCookie;
9293 NodeCreationCookie* pCreationCookie = (NodeCreationCookie*)hCallback;
9311 NodeDestructionCookie* pDestructionCookie;
9313 pDestructionCookie->pFunc = handler;
9314 pDestructionCookie->pCookie = pCookie;
9316 nRetVal =
xnRegisterToNodeDestruction(m_pContext, NodeDestructionCallback, pDestructionCookie, &pDestructionCookie->hUnderlyingCallback);
9319 hCallback = pDestructionCookie;
9333 NodeDestructionCookie* pDestructionCookie = (NodeDestructionCookie*)hCallback;
9490 if (m_pContext == pContext)
9495 if (m_pContext != NULL)
9497 if (m_bUsingDeprecatedAPI && m_bAllocated)
9510 if (pContext != NULL)
9520 m_pContext = pContext;
9527 if (pContext != NULL)
9536 m_bUsingDeprecatedAPI =
TRUE;
9537 #pragma warning (push)
9538 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9539 return xnContextRunXmlScript(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying());
9540 #pragma warning (pop)
9543 inline XnStatus XN_API_DEPRECATED(
"Use other overload!")
RunXmlScriptFromFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
9545 m_bUsingDeprecatedAPI =
TRUE;
9546 #pragma warning (push)
9547 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9549 #pragma warning (pop)
9552 inline XnStatus XN_API_DEPRECATED(
"Use other overload!")
InitFromXmlFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
9555 m_bUsingDeprecatedAPI =
TRUE;
9557 #pragma warning (push)
9558 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9560 #pragma warning (pop)
9564 m_bAllocated =
TRUE;
9571 m_bUsingDeprecatedAPI =
TRUE;
9572 #pragma warning (push)
9573 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9575 #pragma warning (pop)
9578 inline void XN_API_DEPRECATED(
"You may use Release() instead, or count on dtor") Shutdown()
9580 if (m_pContext != NULL)
9582 #pragma warning (push)
9583 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
9585 #pragma warning (pop)
9598 Tree.m_bOwnerOfNode =
TRUE;
9605 typedef struct NodeCreationCookie
9610 } NodeCreationCookie;
9612 typedef struct NodeDestructionCookie
9617 } NodeDestructionCookie;
9619 static void XN_CALLBACK_TYPE NodeCreationCallback(
XnContext* pContext,
XnNodeHandle hCreatedNode,
void* pCookie)
9621 NodeCreationCookie* pNodeCreationCookie = (NodeCreationCookie*)pCookie;
9623 ProductionNode createdNode(hCreatedNode);
9624 pNodeCreationCookie->pFunc(context, createdNode, pNodeCreationCookie->pCookie);
9627 static void XN_CALLBACK_TYPE NodeDestructionCallback(
XnContext* pContext,
const XnChar* strDestroyedNodeName,
void* pCookie)
9629 NodeDestructionCookie* pNodeCreationCookie = (NodeDestructionCookie*)pCookie;
9631 pNodeCreationCookie->pFunc(context, strDestroyedNodeName, pNodeCreationCookie->pCookie);
9634 static void XN_CALLBACK_TYPE ContextShuttingDownCallback(
XnContext* ,
void* pCookie)
9637 pThis->m_pContext = NULL;
9641 XnBool m_bUsingDeprecatedAPI;
9642 XnBool m_bAllocated;
9671 inline Resolution(XnUInt32 xRes, XnUInt32 yRes) : m_nXRes(xRes), m_nYRes(yRes)
9705 inline const XnChar*
GetName()
const {
return m_strName; }
9711 const XnChar* m_strName;
9737 if (m_pNeededNodes == NULL)
9743 return *m_pNeededNodes;
9746 inline void NodeInfo::SetUnderlyingObject(
XnNodeInfo* pInfo)
9748 if (m_pNeededNodes != NULL)
9753 m_bOwnerOfNode =
FALSE;
9755 m_pNeededNodes = NULL;
9780 if (m_pInfo == NULL)
9782 return XN_STATUS_INVALID_OPERATION;
10032 return xnFunc(hNode, StateChangedCallback,
this, &m_hCallback);
10037 xnFunc(hNode, m_hCallback);
10047 nRetVal = pTrans->
Register(xnFunc, hNode);
10054 hCallback = pTrans;
10070 typedef struct StateChangeCookie
10075 } StateChangeCookie;
10077 static void XN_CALLBACK_TYPE StateChangedCallback(
XnNodeHandle hNode,
void* pCookie)
10081 pTrans->m_UserHandler(node, pTrans->m_pUserCookie);
10085 void* m_pUserCookie;
10113 hCallback = pTrans;
10126 #endif // __XN_CPP_WRAPPER_H__