|
Mantid
|
#include <MDHistoDimension.h>
Public Member Functions | |
| coord_t | getBinWidth () const override |
| Return the width of one bin. | |
| const std::string & | getDimensionId () const override |
| Short name which identify the dimension among other dimension. | |
| coord_t | getMaximum () const override |
| Returns the maximum extent of this dimension. | |
| const MDFrame & | getMDFrame () const override |
| Return the md frame. | |
| const Kernel::MDUnit & | getMDUnits () const override |
| Returns the unit. | |
| coord_t | getMinimum () const override |
| Returns the minimum extent of this dimension. | |
| std::string | getName () const override |
| Return the name of the dimension as can be displayed along the axis. | |
| size_t | getNBins () const override |
| number of bins dimension have (an integrated has one). | |
| size_t | getNBoundaries () const override |
| number of bin boundaries (axis points) | |
| const Kernel::UnitLabel | getUnits () const override |
| Return the units of the dimension as a string. | |
| coord_t | getX (size_t index) const override |
| Get coordinate for index;. | |
| MDHistoDimension (const IMDDimension *other) | |
| copy constructor | |
| MDHistoDimension (std::string name, std::string ID, const MDFrame &frame, coord_t min, coord_t max, size_t numBins) | |
| Constructor for simple MDHistoDimension. | |
| void | setMDFrame (const MDFrame &frame) |
| Set the MDFrame. | |
| void | setName (std::string name) |
| Set the name of the dimension. | |
| void | setRange (size_t nBins, coord_t min, coord_t max) override |
| Change the extents and number of bins. | |
| void | setUnits (const Kernel::UnitLabel &units) |
| Set the units of the dimension by relabelling its frame's unit. | |
| std::string | toXMLString () const override |
| Dimensions must be xml serializable. | |
Public Member Functions inherited from Mantid::Geometry::IMDDimension | |
| virtual bool | getIsIntegrated () const |
| bool | operator!= (const IMDDimension &) const |
| bool | operator== (const IMDDimension &) const |
| virtual | ~IMDDimension ()=default |
| Destructor. | |
Private Attributes | |
| coord_t | m_binWidth |
| Calculated bin size. | |
| std::string | m_dimensionId |
| ID string. | |
| Geometry::MDFrame_uptr | m_frame |
| Multidimensional frame. | |
| coord_t | m_max |
| Extent of dimension. | |
| coord_t | m_min |
| Extent of dimension. | |
| std::string | m_name |
| Name. | |
| size_t | m_numBins |
| Number of bins. | |
A very simple implementation of a IMDDimension, describing the limits and number of bins in a dimension.
Definition at line 28 of file MDHistoDimension.h.
|
inline |
Constructor for simple MDHistoDimension.
| name | :: full name of the axis |
| ID | :: identifier string |
| frame | :: MDFrame |
| min | :: minimum extent |
| max | :: maximum extent |
| numBins | :: number of bins (evenly spaced) |
Definition at line 38 of file MDHistoDimension.h.
|
inline |
copy constructor
| other | :: other IMDDimension |
Definition at line 50 of file MDHistoDimension.h.
|
inlineoverridevirtual |
Return the width of one bin.
Reimplemented from Mantid::Geometry::IMDDimension.
Definition at line 93 of file MDHistoDimension.h.
|
inlineoverridevirtual |
Short name which identify the dimension among other dimension.
A dimension can be usually found by its ID and various various method exist to manipulate set of dimensions by their names.
Implements Mantid::Geometry::IMDDimension.
Definition at line 71 of file MDHistoDimension.h.
Referenced by toXMLString().
|
inlineoverridevirtual |
Returns the maximum extent of this dimension.
Implements Mantid::Geometry::IMDDimension.
Definition at line 74 of file MDHistoDimension.h.
References m_max.
Referenced by toXMLString().
|
inlineoverridevirtual |
Return the md frame.
Implements Mantid::Geometry::IMDDimension.
Definition at line 59 of file MDHistoDimension.h.
Referenced by toXMLString().
|
inlineoverridevirtual |
Returns the unit.
Implements Mantid::Geometry::IMDDimension.
Definition at line 65 of file MDHistoDimension.h.
|
inlineoverridevirtual |
Returns the minimum extent of this dimension.
Implements Mantid::Geometry::IMDDimension.
Definition at line 77 of file MDHistoDimension.h.
References m_min.
Referenced by toXMLString().
|
inlineoverridevirtual |
Return the name of the dimension as can be displayed along the axis.
Implements Mantid::Geometry::IMDDimension.
Definition at line 56 of file MDHistoDimension.h.
Referenced by toXMLString().
|
inlineoverridevirtual |
number of bins dimension have (an integrated has one).
A axis directed along dimension would have getNBins+1 axis points.
Implements Mantid::Geometry::IMDDimension.
Definition at line 81 of file MDHistoDimension.h.
Referenced by toXMLString().
|
inlineoverridevirtual |
number of bin boundaries (axis points)
Implements Mantid::Geometry::IMDDimension.
Definition at line 84 of file MDHistoDimension.h.
|
inlineoverridevirtual |
Return the units of the dimension as a string.
Implements Mantid::Geometry::IMDDimension.
Definition at line 62 of file MDHistoDimension.h.
Referenced by toXMLString().
|
inlineoverridevirtual |
Get coordinate for index;.
Implements Mantid::Geometry::IMDDimension.
Definition at line 90 of file MDHistoDimension.h.
|
inline |
Set the MDFrame.
This method was added in order to set the correct MDFrame information on workspaces which are loaded from legacy files. This is currently being used by SetMDFrame. Except for legacy corrections you should not have to use of this method. If you think you do, it is advisible to consolut with other Mantid team members before using it.
| frame,: | a reference to a new MDFrame |
Definition at line 119 of file MDHistoDimension.h.
References Mantid::Geometry::MDFrame::clone().
|
inline |
Set the name of the dimension.
| name | :: the new name to display along the axis |
Definition at line 124 of file MDHistoDimension.h.
References name.
|
inlineoverridevirtual |
Change the extents and number of bins.
| nBins | :: number of bins |
| min | :: extents minimum |
| max | :: extents maximum |
Implements Mantid::Geometry::IMDDimension.
Definition at line 100 of file MDHistoDimension.h.
| void Mantid::Geometry::MDHistoDimension::setUnits | ( | const Kernel::UnitLabel & | units | ) |
Set the units of the dimension by relabelling its frame's unit.
The unit is owned by the dimension's MDFrame, so this only works for frames whose unit can be changed (HKL and general frames). Frames with a fixed unit (QSample, QLab, unknown) throw. For an HKL frame the label must be either "r.l.u." or an inverse-Angstrom-style label of the form "in <value> A^-1"; any other label is rejected rather than silently reverted. A reciprocal lattice unit is used for Q frames so the workspace's special coordinate system continues to be detected.
| units | :: the new unit label |
| std::invalid_argument | if the frame or the label does not support the change |
Definition at line 27 of file MDHistoDimension.cpp.
References Mantid::Kernel::UnitLabel::ascii(), m_frame, and m_name.
|
overridevirtual |
Dimensions must be xml serializable.
Implements Mantid::Geometry::IMDDimension.
Definition at line 61 of file MDHistoDimension.cpp.
References getDimensionId(), Mantid::Geometry::IMDDimension::getIsIntegrated(), getMaximum(), getMDFrame(), getMinimum(), getName(), getNBins(), getUnits(), and name.
|
private |
Calculated bin size.
Definition at line 160 of file MDHistoDimension.h.
|
private |
ID string.
Definition at line 145 of file MDHistoDimension.h.
|
private |
Multidimensional frame.
Definition at line 148 of file MDHistoDimension.h.
Referenced by setUnits().
|
private |
Extent of dimension.
Definition at line 154 of file MDHistoDimension.h.
|
private |
Extent of dimension.
Definition at line 151 of file MDHistoDimension.h.
|
private |
|
private |
Number of bins.
Definition at line 157 of file MDHistoDimension.h.