本文整理汇总了C++中mantid::geometry::IMDDimension_const_sptr::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ IMDDimension_const_sptr::getName方法的具体用法?C++ IMDDimension_const_sptr::getName怎么用?C++ IMDDimension_const_sptr::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid::geometry::IMDDimension_const_sptr
的用法示例。
在下文中一共展示了IMDDimension_const_sptr::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exec
//----------------------------------------------------------------------------------------------
/// Run the algorithm
void QueryMDWorkspace::exec() {
// Extract the required normalisation.
std::string strNormalisation = getPropertyValue("Normalisation");
MDNormalization requestedNormalisation = whichNormalisation(strNormalisation);
IMDWorkspace_sptr input = getProperty("InputWorkspace");
const bool transformCoordsToOriginal = getProperty("TransformCoordsToOriginal");
// Define a table workspace with a specific column schema.
ITableWorkspace_sptr output = WorkspaceFactory::Instance().createTable();
const std::string signalColumnName = "Signal/" + strNormalisation;
const std::string errorColumnName = "Error/" + strNormalisation;
output->addColumn("double", signalColumnName);
output->addColumn("double", errorColumnName);
output->addColumn("int", "Number of Events");
const size_t ndims = input->getNumDims();
for (size_t index = 0; index < ndims; ++index) {
Mantid::Geometry::IMDDimension_const_sptr dim = input->getDimension(index);
std::string dimInUnit = dim->getName() + "/" + dim->getUnits().ascii();
output->addColumn("double", dimInUnit);
// Magic numbers required to configure the X axis.
output->getColumn(dimInUnit)->setPlotType(1);
}
// Magic numbers required to configure the Y axis.
output->getColumn(signalColumnName)->setPlotType(2);
output->getColumn(errorColumnName)->setPlotType(5);
IMDIterator *it = input->createIterator();
it->setNormalization(requestedNormalisation);
bool bLimitRows = getProperty("LimitRows");
int maxRows = 0;
if (bLimitRows) {
maxRows = getProperty("MaximumRows");
}
// Use the iterator to loop through each MDBoxBase and create a row for each
// entry.
int rowCounter = 0;
Progress progress(this, 0, 1, int64_t(input->getNPoints()));
while (true) {
size_t cellIndex = 0;
output->appendRow();
output->cell<double>(rowCounter, cellIndex++) = it->getNormalizedSignal();
output->cell<double>(rowCounter, cellIndex++) = it->getNormalizedError();
output->cell<int>(rowCounter, cellIndex++) = int(it->getNumEvents());
VMD center = it->getCenter();
const size_t numberOriginal = input->getNumberTransformsToOriginal();
if (transformCoordsToOriginal && numberOriginal > 0) {
const size_t index = numberOriginal - 1;
CoordTransform const *transform = input->getTransformToOriginal(index);
VMD temp = transform->applyVMD(center);
center = temp;
}
for (size_t index = 0; index < ndims; ++index) {
output->cell<double>(rowCounter, cellIndex++) = center[index];
}
progress.report();
if (!it->next() || (bLimitRows && ((rowCounter + 1) >= maxRows))) {
break;
}
rowCounter++;
}
setProperty("OutputWorkspace", output);
delete it;
//
IMDEventWorkspace_sptr mdew;
CALL_MDEVENT_FUNCTION(this->getBoxData, input);
}
示例2: setYDim
/** Set the labels for the Y dimensions
* @param dim : IMDDimension */
void XYLimitsDialog::setYDim(Mantid::Geometry::IMDDimension_const_sptr dim)
{
ui.lblYName->setText( QString::fromStdString(dim->getName()) );
ui.lblYUnits->setText( QString::fromStdString(dim->getUnits()) );
}
示例3: setXDim
/** Set the labels for the X dimensions
* @param dim : IMDDimension */
void XYLimitsDialog::setXDim(Mantid::Geometry::IMDDimension_const_sptr dim) {
ui.lblXName->setText(QString::fromStdString(dim->getName()));
ui.lblXUnits->setText(toQStringInternal(dim->getUnits().utf8()));
}