Mantid
Loading...
Searching...
No Matches
CoordTransform.h
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 +
7#pragma once
8
9#include "MantidAPI/DllConfig.h"
13#include "MantidKernel/Matrix.h"
14#include "MantidKernel/System.h"
15#include "MantidKernel/VMD.h"
16#include <memory>
17
18namespace Mantid {
19namespace API {
21DECLARE_SINGLE_VALUE_PARAMETER(InDimParameter, size_t)
23DECLARE_SINGLE_VALUE_PARAMETER(OutDimParameter, size_t)
24
25
32class MANTID_API_DLL CoordTransform {
33public:
34 CoordTransform(const size_t inD, const size_t outD);
35 virtual ~CoordTransform() = default;
36
38 virtual std::string toXMLString() const = 0;
39 virtual void apply(const coord_t *inputVector, coord_t *outVector) const = 0;
40 virtual CoordTransform *clone() const = 0;
41 virtual std::string id() const = 0;
42
44 Mantid::Kernel::VMD applyVMD(const Mantid::Kernel::VMD &inputVector) const;
45
47 size_t getInD() const { return inD; };
48
50 size_t getOutD() const { return outD; };
51
55 throw std::runtime_error("This coordinate transformation does not have an "
56 "equivalent affine matrix.");
57 }
58
59protected:
61 size_t inD;
62
64 size_t outD;
65};
66
67// Helper typedef for a shared pointer of this type.
68using CoordTransform_sptr = std::shared_ptr<CoordTransform>;
69
70// Helper typdef for a const shared pointer of this type.
71using CoordTransform_const_sptr = std::shared_ptr<const CoordTransform>;
72
73} // namespace API
74} // namespace Mantid
#define DECLARE_SINGLE_VALUE_PARAMETER(classname, type_)
Unique SingleValueParameter Declaration for InputNDimensions.
size_t inD
Input number of dimensions.
virtual std::string id() const =0
virtual ~CoordTransform()=default
size_t outD
Output number of dimensions.
virtual Mantid::Kernel::Matrix< coord_t > makeAffineMatrix() const
virtual void apply(const coord_t *inputVector, coord_t *outVector) const =0
virtual CoordTransform * clone() const =0
virtual std::string toXMLString() const =0
Pure abstract methods to be implemented.
Numerical Matrix class.
Definition: Matrix.h:42
std::shared_ptr< CoordTransform > CoordTransform_sptr
std::shared_ptr< const CoordTransform > CoordTransform_const_sptr
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
Definition: MDTypes.h:27