34 newAxis->m_values.clear();
35 newAxis->m_values.resize(
length);
63 throw std::domain_error(
"setValue method cannot be used on a TextAxis.");
71 for (
size_t i = 0; i <
length(); i++) {
85 const auto *spec2 =
dynamic_cast<const TextAxis *
>(&axis2);
89 return std::equal(
m_values.begin(),
m_values.end(), spec2->m_values.begin());
115 return boost::lexical_cast<double>(
m_values.front());
116 }
catch (boost::bad_lexical_cast &) {
124 return boost::lexical_cast<double>(
m_values.back());
125 }
catch (boost::bad_lexical_cast &) {
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Class to represent the axis of a workspace.
virtual std::size_t length() const =0
Get the length of the axis.
Base MatrixWorkspace Abstract Class.
Class to represent a text axis of a workspace.
Axis * clone(const MatrixWorkspace *const parentWorkspace) override
Virtual constructor.
double getMax() const override
returns max value defined on axis
double getMin() const override
returns min value defined on axis
std::vector< std::string > m_values
A vector holding the axis values for the axis.
void setValue(const std::size_t &index, const double &value) override
Set the value at the specified index.
std::size_t length() const override
Get the length of the axis.
size_t indexOfValue(const double value) const override
Returns the value that has been passed to it as a size_t.
double operator()(const std::size_t &index, const std::size_t &verticalIndex=0) const override
Get a value at the specified index.
void setLabel(const std::size_t &index, const std::string &lbl)
Set the label at the given index.
std::string label(const std::size_t &index) const override
Get the label at the specified index.
TextAxis(const std::size_t &length)
Constructor.
bool operator==(const Axis &) const override
Check if two axis defined as spectra or numeric axis are equivalent.
Exception for index errors.
size_t MANTID_KERNEL_DLL indexOfValueFromCenters(const std::vector< double > &bin_centers, const double value)
Gets the bin of a value from a vector of bin centers and throws exception if out of range.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.