本文整理汇总了C++中datacontainerarray::Pointer::getDataContainer方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::getDataContainer方法的具体用法?C++ Pointer::getDataContainer怎么用?C++ Pointer::getDataContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datacontainerarray::Pointer
的用法示例。
在下文中一共展示了Pointer::getDataContainer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PopulateDataContainerComboBox
static void PopulateDataContainerComboBox(AbstractFilter* filter, FilterParameter* filterParameter,
QComboBox* dcCombo, DataContainerArrayProxy& dcaProxy)
{
FilterParameterType* fp = dynamic_cast<FilterParameterType*>(filterParameter);
assert(fp != NULL);
DataContainerArray::Pointer dca = filter->getDataContainerArray();
// Populate the DataContainerArray Combo Box with all the DataContainers
QList<DataContainerProxy> dcList = dcaProxy.dataContainers.values();
QListIterator<DataContainerProxy> iter(dcList);
dcCombo->clear();
QVector<unsigned int> defVec = fp->getDefaultGeometryTypes();
while(iter.hasNext() )
{
DataContainerProxy dcProxy = iter.next();
DataContainer::Pointer dc = dca->getDataContainer(dcProxy.name);
IGeometry::Pointer geom = IGeometry::NullPointer();
uint32_t geomType = 999;
if (NULL != dc.get()) { geom = dc->getGeometry(); }
if (NULL != geom.get()) { geomType = geom->getGeometryType(); }
dcCombo->addItem(dcProxy.name);
if (defVec.isEmpty() == false)
{
if (defVec.contains(geomType) == false)
{
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(dcCombo->model());
if (NULL != model)
{
QStandardItem* item = model->item(dcCombo->findText(dcProxy.name));
if (NULL != item)
{
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
}
}
}
}
}
}
示例2: readDataContainerBundles
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int DataContainerReader::readDataContainerBundles(hid_t fileId, DataContainerArray::Pointer dca)
{
herr_t err = 0;
hid_t dcbGroupId = H5Gopen(fileId, DREAM3D::StringConstants::DataContainerBundleGroupName.toLatin1().constData(), H5P_DEFAULT);
if (dcbGroupId < 0)
{
// NO Bundles are available to read so just return.
// QString ss = QObject::tr("Error opening HDF5 Group '%1' ").arg(DREAM3D::StringConstants::DataContainerBundleGroupName);
// setErrorCondition(-75);
// notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return 0;
}
HDF5ScopedGroupSentinel sentinel(&dcbGroupId, false);
QList<QString> groupNames;
err = QH5Utilities::getGroupObjects(dcbGroupId, H5Utilities::H5Support_GROUP, groupNames);
if (err < 0)
{
QString ss = QObject::tr("Error getting group objects from HDF5 group '%1' ").arg(DREAM3D::StringConstants::DataContainerBundleGroupName);
setErrorCondition(-76);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return err;
}
char sep = 0x1E;
QListIterator<QString> iter(groupNames);
while (iter.hasNext() )
{
QString bundleName = iter.next();
DataContainerBundle::Pointer bundle = DataContainerBundle::New(bundleName);
hid_t bundleId = H5Gopen(dcbGroupId, bundleName.toLatin1().constData(), H5P_DEFAULT);
sentinel.addGroupId(&bundleId); // Make sure this group gets closed
// Read in the Data Container Names
QString dcNames;
err = QH5Lite::readStringDataset(bundleId, DREAM3D::StringConstants::DataContainerNames, dcNames);
if (err < 0)
{
QString ss = QObject::tr("Error reading DataContainer group names from HDF5 group '%1' ").arg(bundleName);
setErrorCondition(-75);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return err;
}
QStringList dcNameList = dcNames.split(QString(sep));
QStringListIterator nameIter(dcNameList);
while(nameIter.hasNext() )
{
QString dcName = nameIter.next();
DataContainer::Pointer dc = dca->getDataContainer(dcName);
if (NULL == dc.get() )
{
qDebug() << "Data Container '" << dcName << "' was NULL" << " " << __FILE__ << "(" << __LINE__ << ")";
}
bundle->addDataContainer(dc);
}
QString metaArrays;
err = QH5Lite::readStringDataset(bundleId, DREAM3D::StringConstants::MetaDataArrays, metaArrays);
if (err < 0)
{
QString ss = QObject::tr("Error reading DataContainerBundle meta data arrays from HDF5 group '%1' ").arg(bundleName);
setErrorCondition(-76);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return err;
}
QStringList metaNameList = metaArrays.split(QString(sep));
bundle->setMetaDataArrays(metaNameList);
dca->addDataContainerBundle(bundle);
}
H5Gclose(dcbGroupId);
dcbGroupId = -1;
return err;
}