BinEdgeAxis.h 1.22 KB
Newer Older
1
2
3
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2014 ISIS Rutherford Appleton Laboratory UKRI,
4
5
//   NScD Oak Ridge National Laboratory, European Spallation Source,
//   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8
9
10

#include "MantidAPI/NumericAxis.h"

11
12
namespace Mantid {
namespace API {
13

14
15
/**
Stores numeric values that are assumed to be bin edge values.
16

17
18
19
20
21
22
23
It overrides indexOfValue to search using the values as bin edges are than
centre points
*/
class MANTID_API_DLL BinEdgeAxis : public NumericAxis {
public:
  BinEdgeAxis(const std::size_t &length);
  BinEdgeAxis(const std::vector<double> &edges);
24

25
26
27
  Axis *clone(const MatrixWorkspace *const parentWorkspace) override;
  Axis *clone(const std::size_t length,
              const MatrixWorkspace *const parentWorkspace) override;
28

29
30
31
  std::vector<double> createBinBoundaries() const override;
  void setValue(const std::size_t &index, const double &value) override;
  size_t indexOfValue(const double value) const override;
32

33
34
35
36
private:
  /// Private, undefined copy assignment operator
  const BinEdgeAxis &operator=(const BinEdgeAxis &);
};
37

38
} // namespace API
39
} // namespace Mantid