Skip to content

Commit

Permalink
Refs #11355 Port getDimensionExtents
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Jeffery committed Mar 26, 2015
1 parent 8888e69 commit 8167eb8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Code/Mantid/Framework/MDAlgorithms/src/CutMD.cpp
@@ -1,10 +1,22 @@
#include "MantidMDAlgorithms/CutMD.h"
#include "MantidAPI/IMDEventWorkspace.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/System.h"

using namespace Mantid::API;
using namespace Mantid::Kernel;

namespace {
std::pair<double, double> getDimensionExtents(IMDEventWorkspace_sptr ws,
size_t index) {
if (!ws)
throw std::runtime_error(
"Invalid workspace passed to getDimensionExtents.");
auto dim = ws->getDimension(index);
return std::make_pair(dim->getMinimum(), dim->getMaximum());
}
} // anonymous namespace

namespace Mantid {
namespace MDAlgorithms {

Expand Down

0 comments on commit 8167eb8

Please sign in to comment.