本文整理汇总了C++中XnActualPropertiesHash::Remove方法的典型用法代码示例。如果您正苦于以下问题:C++ XnActualPropertiesHash::Remove方法的具体用法?C++ XnActualPropertiesHash::Remove怎么用?C++ XnActualPropertiesHash::Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XnActualPropertiesHash
的用法示例。
在下文中一共展示了XnActualPropertiesHash::Remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetInitialState
XnStatus XnFileDevice::SetInitialState(XnPropertySet* pSet)
{
XnStatus nRetVal = XN_STATUS_OK;
// Fix state (remove some properties that we don't wish to reflect in reader device)
XnActualPropertiesHash* pDeviceModule = NULL;
if (XN_STATUS_OK == pSet->pData->Get(XN_MODULE_NAME_DEVICE, pDeviceModule))
{
pDeviceModule->Remove(XN_MODULE_PROPERTY_READ_WRITE_MODE);
pDeviceModule->Remove(XN_MODULE_PROPERTY_PRIMARY_STREAM);
// check for timestamps resolution
XnActualIntProperty* pIntProp = NULL;
if (XN_STATUS_OK == pDeviceModule->Get(XN_MODULE_PROPERTY_HIGH_RES_TIMESTAMPS, (XnProperty*&)pIntProp))
{
m_bHighresTimestamps = (pIntProp->GetValue() == TRUE);
}
}
// TODO: create DEVICE node
// now create the rest of the modules and streams (DEVICE was already created)
XnPropertySetData* pPropSetData = pSet->pData;
for (XnPropertySetData::ConstIterator it = pPropSetData->Begin(); it != pPropSetData->End(); ++it)
{
// ignore module DEVICE
if (strcmp(XN_MODULE_NAME_DEVICE, it->Key()) == 0)
{
continue;
}
// check if this is a stream
XnActualPropertiesHash::ConstIterator itProp = it->Value()->End();
if (XN_STATUS_OK == it->Value()->Find(XN_STREAM_PROPERTY_TYPE, itProp))
{
XnActualStringProperty* pTypeProp = (XnActualStringProperty*)itProp->Value();
nRetVal = HandleNewStream(pTypeProp->GetValue(), it->Key(), it->Value());
XN_IS_STATUS_OK(nRetVal);
}
} // modules loop
return (XN_STATUS_OK);
}
示例2: XnPropertySetRemoveProperty
XnStatus XnPropertySetRemoveProperty(XnPropertySet* pSet, const XnChar* strModuleName, XnUInt32 propertyId)
{
XnStatus nRetVal = XN_STATUS_OK;
XN_VALIDATE_INPUT_PTR(pSet);
XN_VALIDATE_INPUT_PTR(strModuleName);
// get module
XnActualPropertiesHash* pModule = NULL;
nRetVal = pSet->pData->Get(strModuleName, pModule);
XN_IS_STATUS_OK(nRetVal);
// remove the property
nRetVal = pModule->Remove(propertyId);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例3: Rewind
XnStatus XnDeviceFileReader::Rewind()
{
XnStatus nRetVal = XN_STATUS_OK;
// go back to start of stream
nRetVal = GetIOStream()->Seek(XN_DEVICE_FILE_MAGIC_LEN);
XN_IS_STATUS_OK(nRetVal);
// read initial state
XN_PROPERTY_SET_CREATE_ON_STACK(state);
nRetVal = ReadInitialState(&state);
XN_IS_STATUS_OK(nRetVal);
// first handle current streams. remove or reset them
XnDeviceModuleHolderList streams;
nRetVal = GetStreamsList(streams);
XN_IS_STATUS_OK(nRetVal);
for (XnDeviceModuleHolderList::Iterator it = streams.Begin(); it != streams.End(); ++it)
{
XnDeviceModuleHolder* pHolder = *it;
if (m_bStreamsCollectionChanged)
{
// we need to destroy all streams, and recreate them later
nRetVal = DestroyStream(pHolder->GetModule()->GetName());
XN_IS_STATUS_OK(nRetVal);
}
else
{
// just reset frame ID
XnStreamReaderStream* pStream = (XnStreamReaderStream*)pHolder->GetModule();
pStream->Reset();
}
}
// if we need, recreate streams
if (m_bStreamsCollectionChanged)
{
nRetVal = CreateStreams(&state);
XN_IS_STATUS_OK(nRetVal);
}
// now set state.
for (XnPropertySetData::Iterator it = state.pData->Begin(); it != state.pData->End(); ++it)
{
const XnChar* strName = it->Key();
XnActualPropertiesHash* pHash = it->Value();
// fix it first
if (strcmp(strName, XN_MODULE_NAME_DEVICE) == 0)
{
pHash->Remove(XN_MODULE_PROPERTY_READ_WRITE_MODE);
pHash->Remove(XN_MODULE_PROPERTY_PRIMARY_STREAM);
}
XnDeviceModule* pModule;
nRetVal = FindModule(strName, &pModule);
XN_IS_STATUS_OK(nRetVal);
nRetVal = pModule->UnsafeBatchConfig(*pHash);
XN_IS_STATUS_OK(nRetVal);
}
ResetLastTimestampAndFrame();
m_nReferenceTimestamp = 0;
m_nReferenceTime = 0;
m_bStreamsCollectionChanged = FALSE;
return (XN_STATUS_OK);
}
示例4: SetInitialState
XnStatus XnStreamReaderDevice::SetInitialState(const XnDeviceConfig* pDeviceConfig, XnPropertySet* pSet)
{
XnStatus nRetVal = XN_STATUS_OK;
// Fix state (remove some properties that we don't wish to reflect in reader device)
XnActualPropertiesHash* pDeviceModule = NULL;
if (XN_STATUS_OK == pSet->pData->Get(XN_MODULE_NAME_DEVICE, pDeviceModule))
{
pDeviceModule->Remove(XN_MODULE_PROPERTY_READ_WRITE_MODE);
pDeviceModule->Remove(XN_MODULE_PROPERTY_PRIMARY_STREAM);
}
// now init base using this state (this will also create module DEVICE)
XnDeviceConfig initConfig;
initConfig.cpConnectionString = pDeviceConfig->cpConnectionString;
initConfig.DeviceMode = pDeviceConfig->DeviceMode;
initConfig.pInitialValues = pSet;
initConfig.SharingMode = pDeviceConfig->SharingMode;
nRetVal = XnStreamDevice::InitImpl(&initConfig);
XN_IS_STATUS_OK(nRetVal);
// now create the rest of the modules and streams (DEVICE was already created)
XnPropertySetData* pPropSetData = pSet->pData;
for (XnPropertySetData::ConstIterator it = pPropSetData->begin(); it != pPropSetData->end(); ++it)
{
// ignore module DEVICE
if (strcmp(XN_MODULE_NAME_DEVICE, it.Key()) == 0)
{
continue;
}
// check if this is a stream
XnActualPropertiesHash::ConstIterator itProp = it.Value()->end();
if (XN_STATUS_OK == it.Value()->Find(XN_STREAM_PROPERTY_TYPE, itProp))
{
XnActualStringProperty* pTypeProp = (XnActualStringProperty*)itProp.Value();
nRetVal = HandleNewStream(pTypeProp->GetValue(), it.Key(), it.Value());
XN_IS_STATUS_OK(nRetVal);
}
else
{
// this is module. create it
XnDeviceModuleHolder* pHolder = NULL;
nRetVal = CreateModule(it.Key(), &pHolder);
XN_IS_STATUS_OK(nRetVal);
// set its props
nRetVal = pHolder->Init(it.Value());
if (nRetVal != XN_STATUS_OK)
{
DestroyModule(pHolder);
return (nRetVal);
}
// and add it
nRetVal = AddModule(pHolder);
if (nRetVal != XN_STATUS_OK)
{
DestroyModule(pHolder);
return (nRetVal);
}
}
} // modules loop
return (XN_STATUS_OK);
}