本文整理汇总了C++中datacontainerarray::Pointer::addDataContainerBundle方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::addDataContainerBundle方法的具体用法?C++ Pointer::addDataContainerBundle怎么用?C++ Pointer::addDataContainerBundle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datacontainerarray::Pointer
的用法示例。
在下文中一共展示了Pointer::addDataContainerBundle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}