BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IAxis.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Base/Axis/IAxis.cpp
6 //! @brief Implements class IAxis.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #include "Base/Axis/IAxis.h"
16 #include "Base/Types/Exceptions.h"
17 
18 bool IAxis::equals(const IAxis& other) const
19 {
20  return getName() == other.getName();
21 }
22 
23 std::vector<double> IAxis::getBinCenters() const
24 {
25  throw Exceptions::NotImplementedException("IAxis::getBinCenters() -> Error. Not implemented.");
26 }
27 
28 std::vector<double> IAxis::getBinBoundaries() const
29 {
31  "IAxis::getBinBoundaries() -> Error. Not implemented.");
32 }
33 
34 IAxis* IAxis::createClippedAxis(double /* left */, double /* right */) const
35 {
37  "IAxis::createClippedAxis() -> Error. Not implemented.");
38 }
39 
40 bool IAxis::contains(double value) const
41 {
42  return value >= getMin() && value < getMax();
43 }
Defines many exception classes in namespace Exceptionss.
Defines class IAxis.
Interface for one-dimensional axes.
Definition: IAxis.h:25
virtual IAxis * createClippedAxis(double left, double right) const
Creates a new clipped axis.
Definition: IAxis.cpp:34
virtual bool contains(double value) const
Returns true if axis contains given point.
Definition: IAxis.cpp:40
virtual bool equals(const IAxis &other) const
Definition: IAxis.cpp:18
virtual double getMin() const =0
Returns value of first point of axis.
virtual std::vector< double > getBinCenters() const
Definition: IAxis.cpp:23
virtual double getMax() const =0
Returns value of last point of axis.
std::string getName() const
retrieve the label of the axis
Definition: IAxis.h:40
virtual std::vector< double > getBinBoundaries() const
Definition: IAxis.cpp:28