Mantid
Loading...
Searching...
No Matches
TextAxis.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Axis.h"
13#include "MantidAPI/DllConfig.h"
14
15#ifndef Q_MOC_RUN
16#include <boost/lexical_cast.hpp>
17#include <memory>
18#endif
19
20#include <string>
21#include <vector>
22
23namespace Mantid {
24namespace API {
25//----------------------------------------------------------------------
26// Forward declaration
27//----------------------------------------------------------------------
28class MatrixWorkspace;
29
35class MANTID_API_DLL TextAxis : public Axis {
36public:
37 TextAxis(const std::size_t &length);
38 Axis *clone(const MatrixWorkspace *const parentWorkspace) override;
39 Axis *clone(const std::size_t length, const MatrixWorkspace *const parentWorkspace) override;
40 std::size_t length() const override { return m_values.size(); }
42 bool isText() const override { return true; }
44 double operator()(const std::size_t &index, const std::size_t &verticalIndex = 0) const override;
46 void setValue(const std::size_t &index, const double &value) override;
47 size_t indexOfValue(const double value) const override;
48
49 bool operator==(const TextAxis &) const;
50 bool operator==(const Axis &) const override;
52 std::string label(const std::size_t &index) const override;
54 void setLabel(const std::size_t &index, const std::string &lbl);
56 double getMin() const override;
58 double getMax() const override;
59
60private:
62 std::vector<std::string> m_values;
63 bool compareToTextAxis(const TextAxis &axis2) const;
64};
65
66} // namespace API
67} // namespace Mantid
double value
The value of the point.
Definition FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
Class to represent the axis of a workspace.
Definition Axis.h:28
Base MatrixWorkspace Abstract Class.
Class to represent a text axis of a workspace.
Definition TextAxis.h:35
bool isText() const override
If this is a TextAxis, always return true for this class.
Definition TextAxis.h:42
std::vector< std::string > m_values
A vector holding the axis values for the axis.
Definition TextAxis.h:62
std::size_t length() const override
Get the length of the axis.
Definition TextAxis.h:40
Helper class which provides the Collimation Length for SANS instruments.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)