• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ XnDeviceModule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中XnDeviceModule的典型用法代码示例。如果您正苦于以下问题:C++ XnDeviceModule类的具体用法?C++ XnDeviceModule怎么用?C++ XnDeviceModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XnDeviceModule类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: XN_VALIDATE_INPUT_PTR

XnStatus XnDeviceBase::UnregisterFromPropertyChange(const XnChar* Module, const XnChar* PropertyName, XnCallbackHandle hCallback)
{
	XnStatus nRetVal = XN_STATUS_OK;
	
	XN_VALIDATE_INPUT_PTR(Module);
	XN_VALIDATE_INPUT_PTR(PropertyName);
	XN_VALIDATE_INPUT_PTR(hCallback);

	XnPropertyCallback* pRealCookie = (XnPropertyCallback*)hCallback;

	XnDeviceModule* pModule;
	nRetVal = FindModule(Module, &pModule);
	XN_IS_STATUS_OK(nRetVal);

	// first unregister it from property
	nRetVal = pModule->UnregisterFromOnPropertyValueChanged(PropertyName, pRealCookie->hCallback);
	XN_IS_STATUS_OK(nRetVal);

	XnValue val = pRealCookie;
	XnList::Iterator it = m_PropertyCallbacks.Find(val);
	if (it != m_PropertyCallbacks.end())
	{
		m_PropertyCallbacks.Remove(it);
	}

	// now free the memory
	XN_DELETE(pRealCookie);

	return (XN_STATUS_OK);
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:30,代码来源:XnDeviceBase.cpp


示例2: RegisterToProps

XnStatus XnServerSensorInvoker::RegisterToProps(XnPropertySet* pProps)
{
	XnStatus nRetVal = XN_STATUS_OK;
	XnCallbackHandle hDummy = NULL;

	for (XnPropertySetData::Iterator itMod = pProps->pData->Begin(); itMod != pProps->pData->End(); ++itMod)
	{
		XnActualPropertiesHash* pHash = itMod->Value();

		XnDeviceModule* pModule;
		nRetVal = m_sensor.FindModule(itMod->Key(), &pModule);
		XN_IS_STATUS_OK(nRetVal);

		for (XnActualPropertiesHash::Iterator itProp = pHash->Begin(); itProp != pHash->End(); ++itProp)
		{
			XnProperty* pProp;
			nRetVal = pModule->GetProperty(itProp->Key(), &pProp);
			XN_IS_STATUS_OK(nRetVal);

			// no need to keep the handle. We only want to unregister when the stream is destroyed, and then
			// it happens anyway.
			nRetVal = pProp->OnChangeEvent().Register(PropertyChangedCallback, this, hDummy);
			XN_IS_STATUS_OK(nRetVal);
		}
	}

	return (XN_STATUS_OK);
}
开发者ID:DogfishLab88,项目名称:debian-openni-sensor-avin2-sensorkinect,代码行数:28,代码来源:XnServerSensorInvoker.cpp


示例3: XN_IS_STATUS_OK

XnStatus XnSensor::CreateDeviceModule(XnDeviceModuleHolder** ppModuleHolder)
{
	XnStatus nRetVal = XN_STATUS_OK;
	
	nRetVal = XnDeviceBase::CreateDeviceModule(ppModuleHolder);
	XN_IS_STATUS_OK(nRetVal);

	// add sensor properties
	XnDeviceModule* pModule = (*ppModuleHolder)->GetModule();
	XnProperty* pProps[] = 
	{ 
		&m_ErrorState, &m_ResetSensorOnStartup, &m_Interface, &m_ReadFromEP1,
		&m_ReadFromEP2, &m_ReadFromEP3, &m_ReadData, &m_NumberOfBuffers, &m_FirmwareParam, 
		&m_CmosBlankingUnits, &m_CmosBlankingTime, &m_Reset, &m_FirmwareMode, &m_Version, 
		&m_FixedParam, &m_FrameSync, &m_CloseStreamsOnShutdown, &m_InstancePointer, &m_ID,
		&m_USBPath, &m_DeviceName, &m_VendorSpecificData,
	};

	nRetVal = pModule->AddProperties(pProps, sizeof(pProps)/sizeof(XnProperty*));
	if (nRetVal != XN_STATUS_OK)
	{
		DestroyModule(*ppModuleHolder);
		*ppModuleHolder = NULL;
		return (nRetVal);
	}

	// configure it from global file
	if (m_strGlobalConfigFile[0] != '\0')
	{
		nRetVal = pModule->LoadConfigFromFile(m_strGlobalConfigFile);
		XN_IS_STATUS_OK(nRetVal);
	}
	
	return (XN_STATUS_OK);
}
开发者ID:AlpinistPanda,项目名称:SensorKinect,代码行数:35,代码来源:XnSensor.cpp


示例4: RegisterToPropertyChange

XnStatus XnDeviceBase::RegisterToPropertyChange(const XnChar* Module, const XnChar* PropertyName, XnDeviceOnPropertyChangedEventHandler Handler, void* pCookie, XnCallbackHandle* phCallback)
{
	XnStatus nRetVal = XN_STATUS_OK;
	
	XnDeviceModule* pModule;
	nRetVal = FindModule(Module, &pModule);
	XN_IS_STATUS_OK(nRetVal);

	XnPropertyCallback* pRealCookie;
	XN_VALIDATE_NEW(pRealCookie, XnPropertyCallback, GetDeviceHandle(), Module, PropertyName, Handler, pCookie);

	// register
	nRetVal = pModule->RegisterForOnPropertyValueChanged(PropertyName, PropertyValueChangedCallback, pRealCookie, &pRealCookie->hCallback);
	if (nRetVal != XN_STATUS_OK)
	{
		XN_DELETE(pRealCookie);
		return (nRetVal);
	}

	m_PropertyCallbacks.AddLast(pRealCookie);

	*phCallback = pRealCookie;
	
	return (XN_STATUS_OK);
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:25,代码来源:XnDeviceBase.cpp


示例5: GetProperty

XnStatus XnDeviceBase::GetProperty(const XnChar* ModuleName, const XnChar* PropertyName, const XnGeneralBuffer& gbValue)
{
	XnStatus nRetVal = XN_STATUS_OK;

	XnDeviceModule* pModule;
	nRetVal = FindModule(ModuleName, &pModule);
	XN_IS_STATUS_OK(nRetVal);

	nRetVal = pModule->GetProperty(PropertyName, gbValue);
	XN_IS_STATUS_OK(nRetVal);

	return XN_STATUS_OK;
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:13,代码来源:XnDeviceBase.cpp


示例6: SetProperty

XnStatus XnDeviceBase::SetProperty(const XnChar* ModuleName, const XnChar* PropertyName, const XnChar* csValue)
{
	XnStatus nRetVal = XN_STATUS_OK;

	XnDeviceModule* pModule;
	nRetVal = FindModule(ModuleName, &pModule);
	XN_IS_STATUS_OK(nRetVal);

	nRetVal = pModule->SetProperty(PropertyName, csValue);
	XN_IS_STATUS_OK(nRetVal);

	return (XN_STATUS_OK);
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:13,代码来源:XnDeviceBase.cpp


示例7: GetPropertyType

XnStatus XnDeviceBase::GetPropertyType(const XnChar* ModuleName, const XnChar* PropertyName, XnPropertyType* pnType)
{
	XnStatus nRetVal = XN_STATUS_OK;

	XnDeviceModule* pModule;
	nRetVal = FindModule(ModuleName, &pModule);
	XN_IS_STATUS_OK(nRetVal);

	nRetVal = pModule->GetPropertyType(PropertyName, pnType);
	XN_IS_STATUS_OK(nRetVal);

	return (XN_STATUS_OK);
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:13,代码来源:XnDeviceBase.cpp


示例8: SetProperty

XnStatus XnDeviceBase::SetProperty(const XnChar* ModuleName, XnUInt32 propertyId, const OniGeneralBuffer& gbValue)
{
    XnStatus nRetVal = XN_STATUS_OK;

    XnDeviceModule* pModule;
    nRetVal = FindModule(ModuleName, &pModule);
    XN_IS_STATUS_OK(nRetVal);

    nRetVal = pModule->SetProperty(propertyId, gbValue);
    XN_IS_STATUS_OK(nRetVal);

    return (XN_STATUS_OK);
}
开发者ID:higuchi-yuuki,项目名称:OpenNI2,代码行数:13,代码来源:XnDeviceBase.cpp


示例9: ConfigureModuleFromGlobalFile

XnStatus XnSensor::ConfigureModuleFromGlobalFile(const XnChar* strModule, const XnChar* strSection /* = NULL */)
{
	XnStatus nRetVal = XN_STATUS_OK;

	XnDeviceModule* pModule;
	nRetVal = FindModule(strModule, &pModule);
	XN_IS_STATUS_OK(nRetVal);

	nRetVal = pModule->LoadConfigFromFile(m_strGlobalConfigFile, strSection);
	XN_IS_STATUS_OK(nRetVal);

	return (XN_STATUS_OK);
}
开发者ID:AlpinistPanda,项目名称:SensorKinect,代码行数:13,代码来源:XnSensor.cpp


示例10: GetProperty

XnStatus XnDeviceBase::GetProperty(const XnChar* ModuleName, XnUInt32 propertyId, XnChar* csValue)
{
    XnStatus nRetVal = XN_STATUS_OK;

    XnDeviceModule* pModule;
    nRetVal = FindModule(ModuleName, &pModule);
    XN_IS_STATUS_OK(nRetVal);

    nRetVal = pModule->GetProperty(propertyId, csValue);
    XN_IS_STATUS_OK(nRetVal);

    return XN_STATUS_OK;
}
开发者ID:higuchi-yuuki,项目名称:OpenNI2,代码行数:13,代码来源:XnDeviceBase.cpp


示例11: HandleGeneralProperty

XnStatus XnStreamReaderDevice::HandleGeneralProperty(const XnChar* strModule, const XnChar* strName, const XnGeneralBuffer& gbValue)
{
	XnStatus nRetVal = XN_STATUS_OK;

	// find module
	XnDeviceModule* pModule;
	nRetVal = FindModule(strModule, &pModule);
	XN_IS_STATUS_OK(nRetVal);

	// update prop
	nRetVal = pModule->UnsafeUpdateProperty(strName, gbValue);
	XN_IS_STATUS_OK(nRetVal);

	return (XN_STATUS_OK);
}
开发者ID:linjason,项目名称:Scene-Matching,代码行数:15,代码来源:XnStreamReaderDevice.cpp


示例12: AddModule

XnStatus XnDeviceBase::AddModule(XnDeviceModuleHolder* pModuleHolder)
{
    XnDeviceModule* pModule = pModuleHolder->GetModule();

    // make sure module doesn't exist yet
    if (m_Modules.Find(pModule->GetName()) != m_Modules.End())
    {
        xnLogError(XN_MASK_DEVICE, "A module with the name %s already exists!", pModule->GetName());
        return XN_STATUS_ERROR;
    }

    // add it to the list
    XnStatus nRetVal = m_Modules.Set(pModule->GetName(), pModuleHolder);
    XN_IS_STATUS_OK(nRetVal);

    return XN_STATUS_OK;
}
开发者ID:higuchi-yuuki,项目名称:OpenNI2,代码行数:17,代码来源:XnDeviceBase.cpp


示例13: XN_VALIDATE_INPUT_PTR

XnStatus XnDeviceBase::BatchConfig(const XnPropertySet* pChangeSet)
{
    XnStatus nRetVal = XN_STATUS_OK;

    XN_VALIDATE_INPUT_PTR(pChangeSet);

    for (XnPropertySetData::ConstIterator itModule = pChangeSet->pData->Begin(); itModule != pChangeSet->pData->End(); ++itModule)
    {
        // find this module
        XnDeviceModule* pModule = NULL;
        nRetVal = FindModule(itModule->Key(), &pModule);
        XN_IS_STATUS_OK(nRetVal);

        nRetVal = pModule->BatchConfig(*itModule->Value());
        XN_IS_STATUS_OK(nRetVal);
    }

    return (XN_STATUS_OK);
}
开发者ID:higuchi-yuuki,项目名称:OpenNI2,代码行数:19,代码来源:XnDeviceBase.cpp


示例14: return

XnStatus XnStreamReaderDevice::HandleIntProperty(const XnChar *strModule, const XnChar *strName, XnUInt64 nValue)
{
	XnStatus nRetVal = XN_STATUS_OK;
	
	// ignore some properties
	if (strcmp(strModule, XN_MODULE_NAME_DEVICE) == 0 && strcmp(strName, XN_MODULE_PROPERTY_PRIMARY_STREAM) == 0)
	{
		return (XN_STATUS_OK);
	}

	// find module
	XnDeviceModule* pModule;
	nRetVal = FindModule(strModule, &pModule);
	XN_IS_STATUS_OK(nRetVal);

	// update prop
	nRetVal = pModule->UnsafeUpdateProperty(strName, nValue);
	XN_IS_STATUS_OK(nRetVal);
	
	return (XN_STATUS_OK);
}
开发者ID:linjason,项目名称:Scene-Matching,代码行数:21,代码来源:XnStreamReaderDevice.cpp


示例15: XN_IS_STATUS_OK

XnStatus XnSensorClient::CreateDeviceModule(XnDeviceModuleHolder** ppModuleHolder)
{
	XnStatus nRetVal = XN_STATUS_OK;

	nRetVal = XnDeviceBase::CreateDeviceModule(ppModuleHolder);
	XN_IS_STATUS_OK(nRetVal);

	// add sensor properties
	XnDeviceModule* pModule = (*ppModuleHolder)->GetModule();
	XnProperty* pProps[] = { &m_InstancePointer, &m_ErrorState };

	nRetVal = pModule->AddProperties(pProps, sizeof(pProps)/sizeof(XnProperty*));
	if (nRetVal != XN_STATUS_OK)
	{
		DestroyModule(*ppModuleHolder);
		*ppModuleHolder = NULL;
		return (nRetVal);
	}

	return (XN_STATUS_OK);
}
开发者ID:GunioRobot,项目名称:OpenNI,代码行数:21,代码来源:XnSensorClient.cpp


示例16: DoesPropertyExist

XnStatus XnDeviceBase::DoesPropertyExist(const XnChar* ModuleName, const XnChar* PropertyName, XnBool* pbDoesExist)
{
	XnStatus nRetVal = XN_STATUS_OK;

	*pbDoesExist = FALSE;

	XnDeviceModule* pModule;
	nRetVal = FindModule(ModuleName, &pModule);
	if (nRetVal == XN_STATUS_DEVICE_MODULE_NOT_FOUND)
	{
		return XN_STATUS_OK;
	}
	else
	{
		XN_IS_STATUS_OK(nRetVal);
	}

	nRetVal = pModule->DoesPropertyExist(PropertyName, pbDoesExist);
	XN_IS_STATUS_OK(nRetVal);

	return (XN_STATUS_OK);
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:22,代码来源:XnDeviceBase.cpp


示例17: XN_IS_STATUS_OK

XnStatus XnDeviceFileReader::CreateDeviceModule(XnDeviceModuleHolder** ppModuleHolder)
{
	XnStatus nRetVal = XN_STATUS_OK;

	nRetVal = XnStreamReaderDevice::CreateDeviceModule(ppModuleHolder);
	XN_IS_STATUS_OK(nRetVal);

	XnDeviceModule* pModule = (*ppModuleHolder)->GetModule();

	// add sensor properties
	XnProperty* pProps[] = { &m_FrameDelay, &m_InstancePointer };

	nRetVal = pModule->AddProperties(pProps, sizeof(pProps)/sizeof(XnProperty*));
	if (nRetVal != XN_STATUS_OK)
	{
		DestroyModule(*ppModuleHolder);
		*ppModuleHolder = NULL;
		return (nRetVal);
	}

	return (XN_STATUS_OK);
}
开发者ID:RikeshThapa,项目名称:VirtueX,代码行数:22,代码来源:XnDeviceFileReader.cpp


示例18: CreateModule

XnStatus XnDeviceBase::CreateDeviceModule(XnDeviceModuleHolder** ppModuleHolder)
{
    XnStatus nRetVal = XN_STATUS_OK;

    // create module
    nRetVal = CreateModule(XN_MODULE_NAME_DEVICE, ppModuleHolder);
    XN_IS_STATUS_OK(nRetVal);

    XnDeviceModule* pModule = (*ppModuleHolder)->GetModule();

    // add device properties
    XnProperty* pProps[] = { &m_DeviceMirror };

    nRetVal = pModule->AddProperties(pProps, sizeof(pProps)/sizeof(XnProperty*));
    if (nRetVal != XN_STATUS_OK)
    {
        DestroyModule(*ppModuleHolder);
        *ppModuleHolder = NULL;
        return (nRetVal);
    }

    return XN_STATUS_OK;
}
开发者ID:higuchi-yuuki,项目名称:OpenNI2,代码行数:23,代码来源:XnDeviceBase.cpp


示例19: CreateModule

XnStatus XnDeviceBase::CreateDeviceModule(XnDeviceModuleHolder** ppModuleHolder)
{
	XnStatus nRetVal = XN_STATUS_OK;

	// create module
	nRetVal = CreateModule(XN_MODULE_NAME_DEVICE, ppModuleHolder);
	XN_IS_STATUS_OK(nRetVal);

	XnDeviceModule* pModule = (*ppModuleHolder)->GetModule();

	// add device properties
	XnProperty* pProps[] = { &m_ReadWriteMode, &m_SharingMode, &m_PrimaryStream, &m_DeviceMirror, 
		&m_SDKVersionProp, &m_HighResTimestamps, &m_DeviceName };

	nRetVal = pModule->AddProperties(pProps, sizeof(pProps)/sizeof(XnProperty*));
	if (nRetVal != XN_STATUS_OK)
	{
		DestroyModule(*ppModuleHolder);
		*ppModuleHolder = NULL;
		return (nRetVal);
	}

	return XN_STATUS_OK;
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:24,代码来源:XnDeviceBase.cpp


示例20: SetLockStateCallback

XnStatus XnDeviceModule::SetLockStateCallback(XnActualIntProperty* /*pSender*/, XnUInt64 nValue, void* pCookie)
{
	XnDeviceModule* pThis = (XnDeviceModule*)pCookie;
	return pThis->SetLockState(nValue != FALSE);
}
开发者ID:DogfishLab88,项目名称:debian-openni-sensor-avin2-sensorkinect,代码行数:5,代码来源:XnDeviceModule.cpp



注:本文中的XnDeviceModule类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ XnDeviceModuleHolder类代码示例发布时间:2022-05-31
下一篇:
C++ XnBuffer类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap