本文整理汇总了C++中XnActualGeneralProperty类的典型用法代码示例。如果您正苦于以下问题:C++ XnActualGeneralProperty类的具体用法?C++ XnActualGeneralProperty怎么用?C++ XnActualGeneralProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XnActualGeneralProperty类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: End
XnStatus XnActualPropertiesHash::Add(XnUInt32 propertyId, const XnChar* strName, const OniGeneralBuffer& gbValue)
{
XnStatus nRetVal = XN_STATUS_OK;
Iterator it = End();
if (XN_STATUS_OK == Find(propertyId, it))
{
return XN_STATUS_DEVICE_PROPERTY_ALREADY_EXISTS;
}
// create buffer
OniGeneralBuffer gbNew;
nRetVal = XnGeneralBufferAlloc(&gbNew, gbValue.dataSize);
XN_IS_STATUS_OK(nRetVal);
// copy content
xnOSMemCopy(gbNew.data, gbValue.data, gbValue.dataSize);
// create property
XnActualGeneralProperty* pProp;
XN_VALIDATE_NEW(pProp, XnActualGeneralProperty, propertyId, strName, gbNew, NULL, m_strName);
pProp->SetAsBufferOwner(TRUE);
// and add it to the hash
nRetVal = m_Hash.Set(propertyId, pProp);
if (nRetVal != XN_STATUS_OK)
{
XN_DELETE(pProp);
return (nRetVal);
}
return (XN_STATUS_OK);
}
开发者ID:1170390,项目名称:OpenNI2,代码行数:34,代码来源:XnActualPropertiesHash.cpp
示例2: FreeProperty
XnStatus XnActualPropertyFactory::FreeProperty(XnProperty* pProperty)
{
if (pProperty->GetType() == XN_PROPERTY_TYPE_GENERAL)
{
XnActualGeneralProperty* pGenProp = (XnActualGeneralProperty*)pProperty;
xnOSFree(pGenProp->GetValue().pData);
}
XN_DELETE(pProperty);
return (XN_STATUS_OK);
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:12,代码来源:XnActualPropertyFactory.cpp
示例3: XnPropertySetCloneModule
XN_DDK_API XnStatus XnPropertySetCloneModule(const XnPropertySet* pSource, XnPropertySet* pDest, const XnChar* strModule, const XnChar* strNewName)
{
XnStatus nRetVal = XN_STATUS_OK;
XnActualPropertiesHash* pModuleProps = NULL;
nRetVal = pSource->pData->Get(strModule, pModuleProps);
XN_IS_STATUS_OK(nRetVal);
nRetVal = XnPropertySetAddModule(pDest, strNewName);
XN_IS_STATUS_OK(nRetVal);
for (XnActualPropertiesHash::ConstIterator it = pModuleProps->Begin(); it != pModuleProps->End(); ++it)
{
XnProperty* pProp = it->Value();
switch (pProp->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pIntProp = (XnActualIntProperty*)pProp;
nRetVal = XnPropertySetAddIntProperty(pDest, strNewName, pIntProp->GetName(), pIntProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pRealProp = (XnActualRealProperty*)pProp;
nRetVal = XnPropertySetAddRealProperty(pDest, strNewName, pRealProp->GetName(), pRealProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pStrProp = (XnActualStringProperty*)pProp;
nRetVal = XnPropertySetAddStringProperty(pDest, strNewName, pStrProp->GetName(), pStrProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pGenProp = (XnActualGeneralProperty*)pProp;
nRetVal = XnPropertySetAddGeneralProperty(pDest, strNewName, pGenProp->GetName(), &pGenProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_DDK, "Unknown property type: %d", pProp->GetType());
}
}
return (XN_STATUS_OK);
}
开发者ID:02031991,项目名称:Sensor,代码行数:51,代码来源:XnPropertySet.cpp
示例4: switch
XnStatus XnDataPacker::WritePropertySetProperties(const XnPropertySet* pSet)
{
XnStatus nRetVal = XN_STATUS_OK;
for (XnPropertySetData::Iterator it = pSet->pData->Begin(); it != pSet->pData->End(); ++it)
{
XnActualPropertiesHash* pModule = it->Value();
for (XnActualPropertiesHash::ConstIterator itProp = pModule->Begin(); itProp != pModule->End(); ++itProp)
{
switch (itProp->Value()->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pProp = (XnActualIntProperty*)itProp->Value();
nRetVal = WritePropertyImpl(pProp->GetModule(), pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pProp = (XnActualRealProperty*)itProp->Value();
nRetVal = WritePropertyImpl(pProp->GetModule(), pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pProp = (XnActualStringProperty*)itProp->Value();
nRetVal = WritePropertyImpl(pProp->GetModule(), pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pProp = (XnActualGeneralProperty*)itProp->Value();
nRetVal = WritePropertyImpl(pProp->GetModule(), pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_DDK, "Unknown property type: %d", itProp->Value()->GetType());
}
}
}
StartWritingIntenalObject(XN_PACKED_PROPERTY_SET_PROPERTIES_END_MARKER);
EndWritingInternalObject();
return (XN_STATUS_OK);
}
开发者ID:githubgzc,项目名称:Sensor,代码行数:50,代码来源:XnDataPacker.cpp
示例5: XN_LOG_WARNING_RETURN
XnStatus XnDeviceModuleHolder::UnsafeSetProperty(const XnProperty* pRequest, XnProperty* pProp)
{
XnStatus nRetVal = XN_STATUS_OK;
if (pRequest->GetType() != pProp->GetType())
{
XN_LOG_WARNING_RETURN(XN_STATUS_DEVICE_PROPERTY_BAD_TYPE, XN_MASK_DDK, "Property '%s' has the wrong type!", pRequest->GetName());
}
switch (pRequest->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pActualRequest = (XnActualIntProperty*)pRequest;
XnActualIntProperty* pActualProp = (XnActualIntProperty*)pProp;
nRetVal = pActualProp->UnsafeUpdateValue(pActualRequest->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pActualRequest = (XnActualRealProperty*)pRequest;
XnActualRealProperty* pActualProp = (XnActualRealProperty*)pProp;
nRetVal = pActualProp->UnsafeUpdateValue(pActualRequest->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pActualRequest = (XnActualStringProperty*)pRequest;
XnActualStringProperty* pActualProp = (XnActualStringProperty*)pProp;
nRetVal = pActualProp->UnsafeUpdateValue(pActualRequest->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pActualRequest = (XnActualGeneralProperty*)pRequest;
XnActualGeneralProperty* pActualProp = (XnActualGeneralProperty*)pProp;
nRetVal = pActualProp->UnsafeUpdateValue(pActualRequest->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_DDK, "Unknown property type: %d\n", pRequest->GetType());
} // switch
return (XN_STATUS_OK);
}
开发者ID:DogfishLab88,项目名称:debian-openni-sensor-avin2-sensorkinect,代码行数:49,代码来源:XnDeviceModuleHolder.cpp
示例6: XnPropertySetEnumeratorGetGeneralValue
XN_DDK_API XnStatus XnPropertySetEnumeratorGetGeneralValue(const XnPropertySetEnumerator* pEnumerator, XnGeneralBuffer* pgbValue)
{
XN_VALIDATE_INPUT_PTR(pEnumerator);
XN_VALIDATE_OUTPUT_PTR(pgbValue);
XnProperty* pPropBase = pEnumerator->itProp->Value();
if (pPropBase->GetType() != XN_PROPERTY_TYPE_GENERAL)
{
return XN_STATUS_DEVICE_PROPERTY_BAD_TYPE;
}
XnActualGeneralProperty* pProp = (XnActualGeneralProperty*)pPropBase;
*pgbValue = pProp->GetValue();
return (XN_STATUS_OK);
}
开发者ID:02031991,项目名称:Sensor,代码行数:16,代码来源:XnPropertySet.cpp
示例7: Clear
XnStatus XnActualPropertiesHash::CopyFrom(const XnActualPropertiesHash& other)
{
XnStatus nRetVal = XN_STATUS_OK;
Clear();
strncpy(m_strName, other.m_strName, XN_DEVICE_MAX_STRING_LENGTH);
for (ConstIterator it = other.Begin(); it != other.End(); ++it)
{
switch (it->Value()->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pProp = (XnActualIntProperty*)it->Value();
nRetVal = Add(pProp->GetId(), pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pProp = (XnActualRealProperty*)it->Value();
nRetVal = Add(pProp->GetId(), pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pProp = (XnActualStringProperty*)it->Value();
nRetVal = Add(pProp->GetId(), pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pProp = (XnActualGeneralProperty*)it->Value();
nRetVal = Add(pProp->GetId(), pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_DDK, "Unknown property type: %d\n", it->Value()->GetType());
}
}
return (XN_STATUS_OK);
}
开发者ID:1170390,项目名称:OpenNI2,代码行数:46,代码来源:XnActualPropertiesHash.cpp
示例8: switch
XnStatus XnDeviceModule::UnsafeBatchConfig(const XnActualPropertiesHash& props)
{
XnStatus nRetVal = XN_STATUS_OK;
for (XnActualPropertiesHash::ConstIterator it = props.Begin(); it != props.End(); ++it)
{
XnProperty* pRequestProp = it->Value();
switch (pRequestProp->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pProp = (XnActualIntProperty*)pRequestProp;
nRetVal = UnsafeUpdateProperty(pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pProp = (XnActualRealProperty*)pRequestProp;
nRetVal = UnsafeUpdateProperty(pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pProp = (XnActualStringProperty*)pRequestProp;
nRetVal = UnsafeUpdateProperty(pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pProp = (XnActualGeneralProperty*)pRequestProp;
nRetVal = UnsafeUpdateProperty(pProp->GetName(), pProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_DDK, "Unknown property type: %d\n", pRequestProp->GetType());
} // type switch
} // props loop
return (XN_STATUS_OK);
}
开发者ID:DogfishLab88,项目名称:debian-openni-sensor-avin2-sensorkinect,代码行数:44,代码来源:XnDeviceModule.cpp
示例9: streamLocker
XnStatus XnServerSession::OnPropertyChanged(const XnProperty* pProp)
{
XnStatus nRetVal = XN_STATUS_OK;
XnAutoCSLocker streamLocker(m_hStreamsLock);
SessionStream* pStream = NULL;
nRetVal = FindStreamByServerName(pProp->GetModule(), &pStream);
XN_IS_STATUS_OK(nRetVal);
// send message
m_pLogger->DumpMessage("PropChange", 0, m_nID, pProp->GetName());
XnAutoCSLocker commLocker(m_hCommLock);
switch (pProp->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pActualProp = (XnActualIntProperty*)pProp;
nRetVal = m_privateOutgoingPacker.WriteProperty(pStream->strClientStreamName, pProp->GetName(), pActualProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pActualProp = (XnActualRealProperty*)pProp;
nRetVal = m_privateOutgoingPacker.WriteProperty(pStream->strClientStreamName, pProp->GetName(), pActualProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pActualProp = (XnActualStringProperty*)pProp;
nRetVal = m_privateOutgoingPacker.WriteProperty(pStream->strClientStreamName, pProp->GetName(), pActualProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pActualProp = (XnActualGeneralProperty*)pProp;
nRetVal = m_privateOutgoingPacker.WriteProperty(pStream->strClientStreamName, pProp->GetName(), pActualProp->GetValue());
XN_IS_STATUS_OK(nRetVal);
break;
}
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_SENSOR_SERVER, "Unknown property type: %d", pProp->GetType());
}
return (XN_STATUS_OK);
}
开发者ID:RikeshThapa,项目名称:VirtueX,代码行数:50,代码来源:XnServerSession.cpp
示例10: switch
XnStatus XnDeviceModuleHolder::CreateProperty(XnProperty* pRequestProp)
{
XnStatus nRetVal = XN_STATUS_OK;
XnProperty* pNewProp = NULL;
switch (pRequestProp->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pProp = (XnActualIntProperty*)pRequestProp;
XN_VALIDATE_NEW(pNewProp, XnActualIntProperty, pProp->GetName(), pProp->GetValue());
break;
}
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pProp = (XnActualRealProperty*)pRequestProp;
XN_VALIDATE_NEW(pNewProp, XnActualRealProperty, pProp->GetName(), pProp->GetValue());
break;
}
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pProp = (XnActualStringProperty*)pRequestProp;
XN_VALIDATE_NEW(pNewProp, XnActualStringProperty, pProp->GetName(), pProp->GetValue());
break;
}
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pProp = (XnActualGeneralProperty*)pRequestProp;
// create new buffer
XnGeneralBuffer gbNew;
nRetVal = XnGeneralBufferAlloc(&gbNew, pProp->GetValue().nDataSize);
XN_IS_STATUS_OK(nRetVal);
// copy content
xnOSMemCopy(gbNew.pData, pProp->GetValue().pData, pProp->GetValue().nDataSize);
XnActualGeneralProperty* pNewGeneralProp = NULL;
XN_VALIDATE_NEW(pNewGeneralProp, XnActualGeneralProperty, pProp->GetName(), gbNew);
pNewGeneralProp->SetAsBufferOwner(TRUE);
pNewProp = pNewGeneralProp;
break;
}
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_DDK, "Unknown property type: %d\n", pRequestProp->GetType());
} // switch
// add the property to the module
nRetVal = m_pModule->AddProperty(pNewProp);
if (nRetVal != XN_STATUS_OK)
{
XN_DELETE(pNewProp);
return (nRetVal);
}
// and add it to the list of allocated ones (so we'll delete it afterwards)
m_Allocated.AddLast(pNewProp);
return XN_STATUS_OK;
}
开发者ID:DogfishLab88,项目名称:debian-openni-sensor-avin2-sensorkinect,代码行数:61,代码来源:XnDeviceModuleHolder.cpp
示例11: return
XnStatus XnFileDevice::HandleNewStream(const XnChar *strType, const XnChar *strName, const XnActualPropertiesHash *pInitialValues)
{
XnStatus nRetVal = XN_STATUS_OK;
// check if we need to ignore that (stream was not removed upon Rewind).
XnNodeInfoMap::Iterator it = m_ignoreNewNodes.End();
if (m_ignoreNewNodes.Find(strName, it) == XN_STATUS_OK)
{
// ignore
return (XN_STATUS_OK);
}
XnProductionNodeType type = GetNodeType(strType);
if (type == -1)
{
XN_LOG_WARNING_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_FILE, "Invalid node type: %s", strType);
}
// find compression type
XnActualIntProperty* pComp = NULL;
nRetVal = pInitialValues->Get(XN_STREAM_PROPERTY_COMPRESSION, (XnProperty*&)pComp);
XN_IS_STATUS_OK(nRetVal);
XnCodecID codecID = XnCodec::GetCodecIDFromCompressionFormat((XnCompressionFormats)pComp->GetValue());
if (codecID == XN_CODEC_NULL)
{
XN_LOG_WARNING_RETURN(XN_STATUS_CORRUPT_FILE, XN_MASK_FILE, "Invalid compression type: %llu", pComp->GetValue());
}
// notify we have a new node
nRetVal = m_pNotifications->OnNodeAdded(m_pNotificationsCookie, strName, type, codecID);
XN_IS_STATUS_OK(nRetVal);
// we support the mirror capability
nRetVal = m_pNotifications->OnNodeIntPropChanged(m_pNotificationsCookie, strName, XN_CAPABILITY_MIRROR, 1);
XN_IS_STATUS_OK(nRetVal);
// we support the extended serialization capability
nRetVal = m_pNotifications->OnNodeIntPropChanged(m_pNotificationsCookie, strName, XN_CAPABILITY_EXTENDED_SERIALIZATION, 1);
XN_IS_STATUS_OK(nRetVal);
// now write state
for (XnActualPropertiesHash::ConstIterator it = pInitialValues->Begin(); it != pInitialValues->End(); ++it)
{
XnProperty* pProp = it->Value();
switch (pProp->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pIntProp = (XnActualIntProperty*)pProp;
nRetVal = HandleIntProperty(strName, pProp->GetName(), pIntProp->GetValue());
}
break;
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pRealProp = (XnActualRealProperty*)pProp;
nRetVal = HandleRealProperty(strName, pProp->GetName(), pRealProp->GetValue());
}
break;
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pStrProp = (XnActualStringProperty*)pProp;
nRetVal = HandleStringProperty(strName, pProp->GetName(), pStrProp->GetValue());
}
break;
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pGenProp = (XnActualGeneralProperty*)pProp;
nRetVal = HandleGeneralProperty(strName, pProp->GetName(), pGenProp->GetValue());
}
break;
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_FILE, "Unknown property type: %d", pProp->GetType());
}
XN_IS_STATUS_OK(nRetVal);
}
// at this stage, a node should exist with this name
xn::ProductionNode node;
nRetVal = m_context.GetProductionNodeByName(strName, node);
XN_IS_STATUS_OK(nRetVal);
// S2D & RW
if (type == XN_NODE_TYPE_DEPTH)
{
nRetVal = UpdateS2DTables(xn::DepthGenerator(node));
XN_IS_STATUS_OK(nRetVal);
nRetVal = UpdateRWData(xn::DepthGenerator(node));
XN_IS_STATUS_OK(nRetVal);
}
// notify end-of-state
nRetVal = m_pNotifications->OnNodeStateReady(m_pNotificationsCookie, strName);
XN_IS_STATUS_OK(nRetVal);
// add it to the map
XnNodeInfo nodeInfo = {0};
//.........这里部分代码省略.........
开发者ID:RikeshThapa,项目名称:VirtueX,代码行数:101,代码来源:XnFileDevice.cpp
示例12: BCInit
//.........这里部分代码省略.........
nRetVal = XnPropertySetDataAttachModule(pSet->pData, strName, pStreamProps);
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PACKED_INT_PROPERTY:
{
XnChar strModule[XN_DEVICE_MAX_STRING_LENGTH];
XnChar strProp[XN_DEVICE_MAX_STRING_LENGTH];
XnUInt64 nValue;
nRetVal = GetDataPacker()->ReadProperty(strModule, strProp, &nValue);
XN_IS_STATUS_OK(nRetVal);
XnActualPropertiesHash* pModule = NULL;
nRetVal = pSet->pData->Get(strModule, pModule);
XN_IS_STATUS_OK(nRetVal);
XnProperty* pProp = NULL;
nRetVal = pModule->Get(strProp, pProp);
XN_IS_STATUS_OK(nRetVal);
XnActualIntProperty* pIntProp = (XnActualIntProperty*)pProp;
nRetVal = pIntProp->UnsafeUpdateValue(nValue);
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PACKED_REAL_PROPERTY:
{
XnChar strModule[XN_DEVICE_MAX_STRING_LENGTH];
XnChar strProp[XN_DEVICE_MAX_STRING_LENGTH];
XnDouble dValue;
nRetVal = GetDataPacker()->ReadProperty(strModule, strProp, &dValue);
XN_IS_STATUS_OK(nRetVal);
XnActualPropertiesHash* pModule;
nRetVal = pSet->pData->Get(strModule, pModule);
XN_IS_STATUS_OK(nRetVal);
XnProperty* pProp;
nRetVal = pModule->Get(strProp, pProp);
XN_IS_STATUS_OK(nRetVal);
XnActualRealProperty* pRealProp = (XnActualRealProperty*)pProp;
nRetVal = pRealProp->UnsafeUpdateValue(dValue);
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PACKED_STRING_PROPERTY:
{
XnChar strModule[XN_DEVICE_MAX_STRING_LENGTH];
XnChar strProp[XN_DEVICE_MAX_STRING_LENGTH];
XnChar strValue[XN_DEVICE_MAX_STRING_LENGTH];
nRetVal = GetDataPacker()->ReadProperty(strModule, strProp, strValue);
XN_IS_STATUS_OK(nRetVal);
XnActualPropertiesHash* pModule;
nRetVal = pSet->pData->Get(strModule, pModule);
XN_IS_STATUS_OK(nRetVal);
XnProperty* pProp;
nRetVal = pModule->Get(strProp, pProp);
XN_IS_STATUS_OK(nRetVal);
XnActualStringProperty* pStringProp = (XnActualStringProperty*)pProp;
nRetVal = pStringProp->UnsafeUpdateValue(strValue);
XN_IS_STATUS_OK(nRetVal);
break;
}
case XN_PACKED_GENERAL_PROPERTY:
{
XnChar strModule[XN_DEVICE_MAX_STRING_LENGTH];
XnChar strProp[XN_DEVICE_MAX_STRING_LENGTH];
XnGeneralBuffer gbValue;
nRetVal = GetDataPacker()->ReadProperty(strModule, strProp, &gbValue);
XN_IS_STATUS_OK(nRetVal);
XnActualPropertiesHash* pModule;
nRetVal = pSet->pData->Get(strModule, pModule);
XN_IS_STATUS_OK(nRetVal);
XnProperty* pProp;
nRetVal = pModule->Get(strProp, pProp);
XN_IS_STATUS_OK(nRetVal);
XnActualGeneralProperty* pIntProp = (XnActualGeneralProperty*)pProp;
nRetVal = pIntProp->UnsafeUpdateValue(gbValue);
XN_IS_STATUS_OK(nRetVal);
break;
}
default:
// reached end of initial state. go back to beginning of this object
nRetVal = GetIOStream()->Seek(nPositionBefore);
XN_IS_STATUS_OK(nRetVal);
// stop reading
bStateEnd = TRUE;
}
} // objects loop
return (XN_STATUS_OK);
}
开发者ID:RikeshThapa,项目名称:VirtueX,代码行数:101,代码来源:XnDeviceFileReader.cpp
示例13: XN_PROPERTY_SET_CREATE_ON_STACK
XnStatus XnSensorProductionNode::NotifyExState(XnNodeNotifications* pNotifications, void* pCookie)
{
XnStatus nRetVal = XN_STATUS_OK;
// get all properties
XN_PROPERTY_SET_CREATE_ON_STACK(props);
nRetVal = m_pSensor->GetAllProperties(&props, FALSE, GetModuleName());
XN_IS_STATUS_OK(nRetVal);
XnActualPropertiesHash* pPropsHash = props.pData->begin().Value();
// filter properties (remove the ones already exposed as OpenNI interfaces)
FilterProperties(pPropsHash);
const XnChar* astrIntProps[200] = {0};
const XnChar* astrRealProps[200] = {0};
const XnChar* astrStringProps[200] = {0};
const XnChar* astrGeneralProps[200] = {0};
XnUInt32 nIntProps = 0;
XnUInt32 nRealProps = 0;
XnUInt32 nStringProps = 0;
XnUInt32 nGeneralProps = 0;
// enumerate over properties
for (XnActualPropertiesHash::Iterator it = pPropsHash->begin(); it != pPropsHash->end(); ++it)
{
XnProperty* pProp = it.Value();
switch (pProp->GetType())
{
case XN_PROPERTY_TYPE_INTEGER:
{
XnActualIntProperty* pIntProp = (XnActualIntProperty*)pProp;
pNotifications->OnNodeIntPropChanged(pCookie, GetInstanceName(), pProp->GetName(), pIntProp->GetValue());
astrIntProps[nIntProps++] = pProp->GetName();
}
break;
case XN_PROPERTY_TYPE_REAL:
{
XnActualRealProperty* pRealProp = (XnActualRealProperty*)pProp;
pNotifications->OnNodeRealPropChanged(pCookie, GetInstanceName(), pProp->GetName(), pRealProp->GetValue());
astrRealProps[nRealProps++] = pProp->GetName();
}
break;
case XN_PROPERTY_TYPE_STRING:
{
XnActualStringProperty* pStrProp = (XnActualStringProperty*)pProp;
pNotifications->OnNodeStringPropChanged(pCookie, GetInstanceName(), pProp->GetName(), pStrProp->GetValue());
astrStringProps[nStringProps++] = pProp->GetName();
}
break;
case XN_PROPERTY_TYPE_GENERAL:
{
XnActualGeneralProperty* pGenProp = (XnActualGeneralProperty*)pProp;
pNotifications->OnNodeGeneralPropChanged(pCookie, GetInstanceName(), pProp->GetName(), pGenProp->GetValue().nDataSize, pGenProp->GetValue().pData);
astrGeneralProps[nGeneralProps++] = pProp->GetName();
}
break;
default:
XN_LOG_WARNING_RETURN(XN_STATUS_ERROR, XN_MASK_DEVICE_SENSOR, "Unknown property type: %d", pProp->GetType());
}
}
// TODO: also register to these properties, and if changed, notify.
// store notifications object
m_pNotifications = pNotifications;
m_pCookie = pCookie;
return (XN_STATUS_OK);
}
开发者ID:AlpinistPanda,项目名称:SensorKinect,代码行数:72,代码来源:XnSensorProductionNode.cpp
注:本文中的XnActualGeneralProperty类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论