Mantid
Loading...
Searching...
No Matches
UnknownFrame.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 +
8
9namespace Mantid::Geometry {
10
11UnknownFrame::UnknownFrame(std::unique_ptr<Kernel::MDUnit> unit) : m_unit(unit.release()) {}
12
13UnknownFrame::UnknownFrame(const Kernel::UnitLabel &unit) : m_unit(new Mantid::Kernel::LabelUnit(unit)) {}
14
15const std::string UnknownFrame::UnknownFrameName = "Unknown frame";
16
17bool UnknownFrame::canConvertTo(const Mantid::Kernel::MDUnit & /*otherUnit*/) const {
18 return false; // Cannot convert since it is unknown
19}
20
21bool UnknownFrame::setMDUnit(const Mantid::Kernel::MDUnit & /*newUnit*/) { return false; }
22
23std::string UnknownFrame::name() const { return UnknownFrameName; }
24
26
28
31}
32
33UnknownFrame *UnknownFrame::clone() const { return new UnknownFrame(std::unique_ptr<Kernel::MDUnit>(m_unit->clone())); }
34
35bool UnknownFrame::isQ() const { return false; }
36
37bool UnknownFrame::isSameType(const MDFrame &frame) const {
38 auto isSameType = true;
39 try {
40 const auto &tmp = dynamic_cast<const UnknownFrame &>(frame);
42 } catch (std::bad_cast &) {
43 isSameType = false;
44 }
45 return isSameType;
46}
47} // 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
UnknownFrame : Unknown MDFrame.
Definition: UnknownFrame.h:21
const std::unique_ptr< Mantid::Kernel::MDUnit > m_unit
Label unit.
Definition: UnknownFrame.h:39
Mantid::Kernel::SpecialCoordinateSystem equivalientSpecialCoordinateSystem() const override
const Mantid::Kernel::MDUnit & getMDUnit() const override
bool canConvertTo(const Mantid::Kernel::MDUnit &otherUnit) const override
static const std::string UnknownFrameName
Definition: UnknownFrame.h:35
UnknownFrame(std::unique_ptr< Kernel::MDUnit > unit)
std::string name() const override
bool setMDUnit(const Mantid::Kernel::MDUnit &newUnit) override
bool isSameType(const MDFrame &frame) const override
bool isQ() const override
UnknownFrame * clone() const override
Mantid::Kernel::UnitLabel getUnitLabel() const override
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.