本文整理汇总了C++中WorkspaceGroup_sptr::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ WorkspaceGroup_sptr::getName方法的具体用法?C++ WorkspaceGroup_sptr::getName怎么用?C++ WorkspaceGroup_sptr::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorkspaceGroup_sptr
的用法示例。
在下文中一共展示了WorkspaceGroup_sptr::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* Groups together a vector of workspaces. This is done "manually", since the
* workspaces being passed will be outside of the ADS and so the GroupWorkspaces
* alg is not an option here.
*
* @param wsList :: the list of workspaces to group
*/
API::WorkspaceGroup_sptr
Load::groupWsList(const std::vector<API::Workspace_sptr> &wsList) {
auto group = boost::make_shared<WorkspaceGroup>();
for (const auto &ws : wsList) {
WorkspaceGroup_sptr isGroup =
boost::dynamic_pointer_cast<WorkspaceGroup>(ws);
// If the ws to add is already a group, then add its children individually.
if (isGroup) {
std::vector<std::string> childrenNames = isGroup->getNames();
size_t count = 1;
for (auto childName = childrenNames.begin();
childName != childrenNames.end(); ++childName, ++count) {
Workspace_sptr childWs = isGroup->getItem(*childName);
isGroup->remove(*childName);
// childWs->setName(isGroup->getName() + "_" +
// boost::lexical_cast<std::string>(count));
group->addWorkspace(childWs);
}
// Remove the old group from the ADS
AnalysisDataService::Instance().remove(isGroup->getName());
} else {
group->addWorkspace(ws);
}
}
return group;
}
示例2: processViewImg
void TomographyIfacePresenter::processViewImg() {
std::string ip = m_view->showImagePath();
QString suf = QFileInfo(QString::fromStdString(ip)).suffix();
// This is not so great, as we check extensions and not really file
// content/headers, as it should be.
if ((0 == QString::compare(suf, "fit", Qt::CaseInsensitive)) ||
(0 == QString::compare(suf, "fits", Qt::CaseInsensitive))) {
WorkspaceGroup_sptr wsg = m_model->loadFITSImage(ip);
if (!wsg)
return;
MatrixWorkspace_sptr ws =
boost::dynamic_pointer_cast<MatrixWorkspace>(wsg->getItem(0));
if (!ws)
return;
m_view->showImage(ws);
// clean-up container group workspace
if (wsg)
AnalysisDataService::Instance().remove(wsg->getName());
} else if ((0 == QString::compare(suf, "tif", Qt::CaseInsensitive)) ||
(0 == QString::compare(suf, "tiff", Qt::CaseInsensitive)) ||
(0 == QString::compare(suf, "png", Qt::CaseInsensitive))) {
m_view->showImage(ip);
} else {
m_view->userWarning(
"Failed to load image - format issue",
"Could not load image because the extension of the file " + ip +
", suffix: " + suf.toStdString() +
" does not correspond to FITS or TIFF files.");
}
}