Mantid
Loading...
Searching...
No Matches
QSample.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
9
10namespace Mantid::Geometry {
11
12const std::string QSample::QSampleName = "QSample";
13
14//----------------------------------------------------------------------------------------------
17QSample::QSample() : m_unit(new Mantid::Kernel::InverseAngstromsUnit) {}
18
19Kernel::UnitLabel QSample::getUnitLabel() const { return m_unit->getUnitLabel(); }
20
21const Kernel::MDUnit &QSample::getMDUnit() const { return *m_unit; }
22
23bool QSample::setMDUnit(const Mantid::Kernel::MDUnit & /*newUnit*/) { return false; }
24
25bool QSample::canConvertTo(const Kernel::MDUnit &otherUnit) const { return this->getMDUnit() == otherUnit; }
26
27std::string QSample::name() const { return QSampleName; }
28
29QSample *QSample::clone() const { return new QSample; }
30
33}
34
35bool QSample::isQ() const { return true; }
36
37bool QSample::isSameType(const MDFrame &frame) const {
38 auto isSameType = true;
39 try {
40 const auto &tmp = dynamic_cast<const QSample &>(frame);
42 } catch (std::bad_cast &) {
43 isSameType = false;
44 }
45 return isSameType;
46}
47
48} // namespace Mantid::Geometry
gsl_vector * tmp
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
MDFrame : The coordinate frame for a dimension, or set of dimensions in a multidimensional workspace.
Definition: MDFrame.h:22
QSample : Q in the sample frame.
Definition: QSample.h:21
std::string name() const override
Definition: QSample.cpp:27
bool isSameType(const MDFrame &frame) const override
Definition: QSample.cpp:37
bool isQ() const override
Definition: QSample.cpp:35
bool canConvertTo(const Kernel::MDUnit &otherUnit) const override
Definition: QSample.cpp:25
bool setMDUnit(const Mantid::Kernel::MDUnit &newUnit) override
Definition: QSample.cpp:23
Mantid::Kernel::SpecialCoordinateSystem equivalientSpecialCoordinateSystem() const override
Definition: QSample.cpp:31
Kernel::UnitLabel getUnitLabel() const override
Definition: QSample.cpp:19
const Kernel::MDUnit & getMDUnit() const override
Definition: QSample.cpp:21
const std::unique_ptr< const Mantid::Kernel::InverseAngstromsUnit > m_unit
immutable unit for qlab.
Definition: QSample.h:37
QSample * clone() const override
Definition: QSample.cpp:29
static const std::string QSampleName
Definition: QSample.h:23
QSample()
Constructor.
Definition: QSample.cpp:17
Inverse Angstroms unit.
Definition: MDUnit.h:51
MDUnit : Unit type for multidimensional data types.
Definition: MDUnit.h:20
A base-class for the a class that is able to return unit labels in different representations.
Definition: UnitLabel.h:20
SpecialCoordinateSystem
Special coordinate systems for Q3D.
Helper class which provides the Collimation Length for SANS instruments.