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#include "MantidKernel/Unit.h"
15
16#ifndef Q_MOC_RUN
17#include <boost/lexical_cast.hpp>
18#include <memory>
19#endif
20
21#include <string>
22#include <vector>
23
24namespace Mantid {
25namespace API {
26//----------------------------------------------------------------------
27// Forward declaration
28//----------------------------------------------------------------------
29class MatrixWorkspace;
30
36class MANTID_API_DLL TextAxis : public Axis {
37public:
38 TextAxis(const std::size_t &length);
39 Axis *clone(const MatrixWorkspace *const parentWorkspace) override;
40 Axis *clone(const std::size_t length, const MatrixWorkspace *const parentWorkspace) override;
41 std::size_t length() const override { return m_values.size(); }
43 bool isText() const override { return true; }
45 double operator()(const std::size_t &index, const std::size_t &verticalIndex = 0) const override;
47 void setValue(const std::size_t &index, const double &value) override;
48 size_t indexOfValue(const double value) const override;
49
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};
64
65} // namespace API
66} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Class to represent the axis of a workspace.
Definition: Axis.h:30
Base MatrixWorkspace Abstract Class.
Class to represent a text axis of a workspace.
Definition: TextAxis.h:36
bool isText() const override
If this is a TextAxis, always return true for this class.
Definition: TextAxis.h:43
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:41
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)