Mantid
Loading...
Searching...
No Matches
QLab.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
12//----------------------------------------------------------------------------------------------
15QLab::QLab() : m_unit(new Mantid::Kernel::InverseAngstromsUnit) {}
16
17const std::string QLab::QLabName = "QLab";
18
20 // Forward request on
21 return m_unit->getUnitLabel();
22}
23
24const Kernel::MDUnit &QLab::getMDUnit() const { return *m_unit; }
25
26bool QLab::setMDUnit(const Mantid::Kernel::MDUnit & /*newUnit*/) { return false; }
27
28bool QLab::canConvertTo(const Mantid::Kernel::MDUnit &otherUnit) const {
29 /*
30 Inter frame conversion is possible, but requires additional information.
31 Forbidden for time being.
32 */
33 return *this->m_unit == otherUnit;
34}
35
36std::string QLab::name() const { return QLab::QLabName; }
37
38QLab *QLab::clone() const { return new QLab; }
39
42}
43
44bool QLab::isQ() const { return true; }
45
46bool QLab::isSameType(const MDFrame &frame) const {
47 auto isSameType = true;
48 try {
49 const auto &tmp = dynamic_cast<const QLab &>(frame);
51 } catch (std::bad_cast &) {
52 isSameType = false;
53 }
54 return isSameType;
55}
56
57} // 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
QLab : Q in the lab frame MDFrame.
Definition: QLab.h:21
bool setMDUnit(const Mantid::Kernel::MDUnit &newUnit) override
Definition: QLab.cpp:26
std::string name() const override
Definition: QLab.cpp:36
QLab()
Constructor.
Definition: QLab.cpp:15
const std::unique_ptr< const Mantid::Kernel::MDUnit > m_unit
Fixed to be inverse angstroms.
Definition: QLab.h:39
Mantid::Kernel::UnitLabel getUnitLabel() const override
Definition: QLab.cpp:19
bool isSameType(const MDFrame &frame) const override
Definition: QLab.cpp:46
const Mantid::Kernel::MDUnit & getMDUnit() const override
Definition: QLab.cpp:24
bool canConvertTo(const Mantid::Kernel::MDUnit &otherUnit) const override
Definition: QLab.cpp:28
bool isQ() const override
Definition: QLab.cpp:44
Mantid::Kernel::SpecialCoordinateSystem equivalientSpecialCoordinateSystem() const override
Definition: QLab.cpp:40
static const std::string QLabName
Definition: QLab.h:35
QLab * clone() const override
Definition: QLab.cpp:38
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.