Mantid
Loading...
Searching...
No Matches
NullCoordTransform.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::API {
11
15NullCoordTransform::NullCoordTransform(size_t ndims) : Mantid::API::CoordTransform(ndims, ndims), m_ndims(ndims) {}
16
18
22std::string NullCoordTransform::toXMLString() const { throw std::runtime_error("Not Implemented"); }
23
28std::string NullCoordTransform::id() const { return "NullCoordTransform"; }
29
35void NullCoordTransform::apply(const Mantid::coord_t *inputVector, Mantid::coord_t *outVector) const {
36 for (size_t i = 0; i < m_ndims; i++) {
37 outVector[i] = inputVector[i];
38 }
39}
40} // namespace Mantid::API
Unique SingleValueParameter Declaration for InputNDimensions.
NullCoordTransform : A transform that sets the outVector to have the same values as the inputVector.
std::string toXMLString() const override
Serialize to a string.
size_t m_ndims
Number of dimensions.
void apply(const Mantid::coord_t *inputVector, Mantid::coord_t *outVector) const override
Apply the transformation.
CoordTransform * clone() const override
std::string id() const override
Coordinate transform id.
NullCoordTransform(size_t ndims=3)
Constructor.
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