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/VMD.h"
15#include <memory>
16
17namespace Mantid {
18namespace API {
20DECLARE_SINGLE_VALUE_PARAMETER(InDimParameter, size_t)
22DECLARE_SINGLE_VALUE_PARAMETER(OutDimParameter, size_t)
23
24
31class MANTID_API_DLL CoordTransform {
32public:
33 CoordTransform(const size_t inD, const size_t outD);
34 virtual ~CoordTransform() = default;
35
37 virtual std::string toXMLString() const = 0;
38 virtual void apply(const coord_t *inputVector, coord_t *outVector) const = 0;
39 virtual CoordTransform *clone() const = 0;
40 virtual std::string id() const = 0;
41
43 Mantid::Kernel::VMD applyVMD(const Mantid::Kernel::VMD &inputVector) const;
44
46 size_t getInD() const { return inD; };
47
49 size_t getOutD() const { return outD; };
50
54 throw std::runtime_error("This coordinate transformation does not have an "
55 "equivalent affine matrix.");
56 }
57
58protected:
60 size_t inD;
61
63 size_t outD;
64};
65
66// Helper typedef for a shared pointer of this type.
67using CoordTransform_sptr = std::shared_ptr<CoordTransform>;
68
69// Helper typdef for a const shared pointer of this type.
70using CoordTransform_const_sptr = std::shared_ptr<const CoordTransform>;
71
72} // namespace API
73} // 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