11#include "MantidGeometry/DllConfig.h"
42 : m_name(
std::move(name)), m_dimensionId(
std::move(ID)), m_frame(frame.clone()),
m_min(min),
m_max(max),
43 m_numBins(numBins), m_binWidth((max - min) / static_cast<
coord_t>(numBins)) {
45 throw std::invalid_argument(
"Error making MDHistoDimension. Cannot have "
46 "dimension with min > max");
54 : m_name(other->
getName()), m_dimensionId(other->getDimensionId()), m_frame(other->getMDFrame().clone()),
55 m_min(other->getMinimum()),
m_max(other->getMaximum()), m_numBins(other->getNBins()),
56 m_binWidth(other->getBinWidth()) {}
59 std::string
getName()
const override {
return m_name; }
84 size_t getNBins()
const override {
return m_numBins; }
90 std::string toXMLString()
const override;
105 throw std::invalid_argument(
"Error making MDHistoDimension. Cannot have "
106 "dimension with min > max");
std::map< DeltaEMode::Type, std::string > index
std::string getName(const IMDDimension &self)
The class describes one dimension of multidimensional dataset representing an orthogonal dimension an...
MDFrame : The coordinate frame for a dimension, or set of dimensions in a multidimensional workspace.
virtual MDFrame * clone() const =0
void setRange(size_t nBins, coord_t min, coord_t max) override
Change the extents and number of bins.
MDHistoDimension(std::string name, std::string ID, const MDFrame &frame, coord_t min, coord_t max, size_t numBins)
Constructor for simple MDHistoDimension.
coord_t getMaximum() const override
Returns the maximum extent of this dimension.
coord_t getMinimum() const override
Returns the minimum extent of this dimension.
Geometry::MDFrame_uptr m_frame
Multidimensional frame.
size_t getNBoundaries() const override
number of bin boundaries (axis points)
coord_t getBinWidth() const override
Return the width of one bin.
coord_t getX(size_t index) const override
Get coordinate for index;.
std::string m_dimensionId
ID string.
const MDFrame & getMDFrame() const override
Return the md frame.
const Kernel::UnitLabel getUnits() const override
Return the units of the dimension as a string.
size_t m_numBins
Number of bins.
const Kernel::MDUnit & getMDUnits() const override
Returns the unit.
void setMDFrame(const MDFrame &frame)
Set the MDFrame.
std::string getName() const override
Return the name of the dimension as can be displayed along the axis.
coord_t m_min
Extent of dimension.
coord_t m_max
Extent of dimension.
coord_t m_binWidth
Calculated bin size.
const std::string & getDimensionId() const override
Short name which identify the dimension among other dimension.
size_t getNBins() const override
number of bins dimension have (an integrated has one).
MDHistoDimension(const IMDDimension *other)
copy constructor
MDUnit : Unit type for multidimensional data types.
A base-class for the a class that is able to return unit labels in different representations.
std::unique_ptr< MDFrame > MDFrame_uptr
std::shared_ptr< MDHistoDimension > MDHistoDimension_sptr
Shared pointer to a MDHistoDimension.
std::shared_ptr< const MDHistoDimension > MDHistoDimension_const_sptr
Shared pointer to a const MDHistoDimension.
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...