本文整理汇总了C++中MDWSDescription::getFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ MDWSDescription::getFrame方法的具体用法?C++ MDWSDescription::getFrame怎么用?C++ MDWSDescription::getFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MDWSDescription
的用法示例。
在下文中一共展示了MDWSDescription::getFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createEmptyEventWS
void MDEventWSWrapper::createEmptyEventWS(const MDWSDescription &description) {
boost::shared_ptr<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>>
ws = boost::shared_ptr<
DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>>(
new DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>());
auto numBins = description.getNBins();
size_t nBins(10); // HACK. this means we have 10 bins artificially. This can't
// be right.
// Give all the dimensions
for (size_t d = 0; d < nd; d++) {
if (!numBins.empty())
nBins = numBins[d];
Geometry::MDHistoDimension *dim = NULL;
if (d < 3 && description.isQ3DMode()) {
// We should have frame and scale information that we can use correctly
// for our Q dimensions.
auto mdFrame = description.getFrame(d);
dim = new Geometry::MDHistoDimension(
description.getDimNames()[d], description.getDimIDs()[d], *mdFrame,
Mantid::coord_t(description.getDimMin()[d]),
Mantid::coord_t(description.getDimMax()[d]), nBins);
} else {
Mantid::Geometry::GeneralFrame frame(description.getDimNames()[d],
description.getDimUnits()[d]);
dim = new Geometry::MDHistoDimension(
description.getDimNames()[d], description.getDimIDs()[d], frame,
Mantid::coord_t(description.getDimMin()[d]),
Mantid::coord_t(description.getDimMax()[d]), nBins);
}
ws->addDimension(Geometry::MDHistoDimension_sptr(dim));
}
ws->initialize();
m_Workspace = ws;
}