本文整理汇总了C++中xn::NodeInfoList::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeInfoList::IsEmpty方法的具体用法?C++ NodeInfoList::IsEmpty怎么用?C++ NodeInfoList::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xn::NodeInfoList
的用法示例。
在下文中一共展示了NodeInfoList::IsEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumerateProductionTrees
XnStatus XnExportedSensorGenerator::EnumerateProductionTrees(xn::Context& context, xn::NodeInfoList& TreesList, xn::EnumerationErrors* pErrors)
{
XnStatus nRetVal = XN_STATUS_OK;
XnProductionNodeDescription Description;
GetDescription(&Description);
// perform a query to be sure the device we'll find is the same one exported from this DLL.
xn::Query query;
query.SetVendor(XN_VENDOR_PRIMESENSE);
query.SetName(XN_DEVICE_NAME);
query.SetMinVersion(Description.Version);
query.SetMaxVersion(Description.Version);
nRetVal = context.AutoEnumerateOverSingleInput(TreesList, Description, NULL, XN_NODE_TYPE_DEVICE, pErrors, &query);
XN_IS_STATUS_OK(nRetVal);
if (!m_bIsAvailableInLowBand)
{
xn::NodeInfoList::Iterator it = TreesList.Begin();
while (it != TreesList.End())
{
xn::NodeInfoList::Iterator curr = it;
it++;
xn::NodeInfo node = *curr;
// take sensor node
xn::NodeInfo sensorNode = *node.GetNeededNodes().Begin();
XnBool bIsLowBand;
nRetVal = XnSensorIO::IsSensorLowBandwidth(sensorNode.GetCreationInfo(), &bIsLowBand);
XN_IS_STATUS_OK(nRetVal);
if (bIsLowBand)
{
// sensor is low band
nRetVal = TreesList.Remove(curr);
XN_IS_STATUS_OK(nRetVal);
}
}
if (TreesList.IsEmpty())
{
return XN_STATUS_NO_NODE_PRESENT;
}
}
return (XN_STATUS_OK);
}
示例2: EnumerateProductionTrees
XnStatus XnExportedSensorImageGenerator::EnumerateProductionTrees(xn::Context& context, xn::NodeInfoList& TreesList, xn::EnumerationErrors* pErrors)
{
XnStatus nRetVal = XN_STATUS_OK;
nRetVal = XnExportedSensorGenerator::EnumerateProductionTrees(context, TreesList, pErrors);
XN_IS_STATUS_OK(nRetVal);
XnStringToBoolHash Devices;
// make sure device has image CMOS
xn::NodeInfoList::Iterator it = TreesList.Begin();
while (it != TreesList.End())
{
xn::NodeInfoList::Iterator curr = it;
it++;
xn::NodeInfo node = *curr;
// take sensor node
xn::NodeInfo sensorNode = *node.GetNeededNodes().Begin();
XnBool bHasImageCMOS = TRUE;
if (XN_STATUS_OK != Devices.Get(sensorNode.GetCreationInfo(), bHasImageCMOS))
{
// wasn't checked yet. check it now
xn::Device sensor;
nRetVal = sensorNode.GetInstance(sensor);
XN_IS_STATUS_OK(nRetVal);
XnBool bShouldCreated = (!sensor.IsValid());
if (bShouldCreated)
{
nRetVal = context.CreateProductionTree(sensorNode);
XN_IS_STATUS_OK(nRetVal);
nRetVal = sensorNode.GetInstance(sensor);
XN_IS_STATUS_OK(nRetVal);
}
// This is an ugly patch to find out if this sensor has an image CMOS. It will be fixed
// in future firmwares so we can just ask.
XnCmosBlankingUnits units;
units.nCmosID = XN_CMOS_TYPE_IMAGE;
nRetVal = sensor.GetGeneralProperty(XN_MODULE_PROPERTY_CMOS_BLANKING_UNITS, sizeof(units), &units);
if (nRetVal != XN_STATUS_OK || units.nUnits == 0)
{
// Failed. this means no image CMOS
bHasImageCMOS = FALSE;
}
if (bShouldCreated)
{
sensor.Release();
}
// add to checked list
Devices.Set(sensorNode.GetCreationInfo(), bHasImageCMOS);
}
if (!bHasImageCMOS)
{
// remove it from enumeration
nRetVal = TreesList.Remove(curr);
XN_IS_STATUS_OK(nRetVal);
}
}
if (TreesList.IsEmpty())
{
return XN_STATUS_NO_NODE_PRESENT;
}
return (XN_STATUS_OK);
}