Mantid
Loading...
Searching...
No Matches
PeakTransform.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
11#include "MantidKernel/V3D.h"
12#include <boost/regex.hpp>
13#include <memory>
14
15namespace Mantid {
16namespace Geometry {
21class MANTID_GEOMETRY_DLL PeakTransform {
22public:
23 PeakTransform(std::string xPlotLabel, std::string yPlotLabel, const boost::regex &regexOne,
24 const boost::regex &regexTwo, const boost::regex &regexThree);
25 virtual ~PeakTransform() = default;
27 virtual Mantid::Kernel::V3D transform(const Mantid::Kernel::V3D &original) const;
31 Mantid::Kernel::V3D transformBack(const Mantid::Kernel::V3D &transformed) const;
33 boost::regex getFreePeakAxisRegex() const;
35 virtual std::shared_ptr<PeakTransform> clone() const = 0;
37 virtual std::string getFriendlyName() const = 0;
40
41protected:
42 PeakTransform(const PeakTransform &) = default;
43 std::string m_xPlotLabel;
44 std::string m_yPlotLabel;
45 // For mapping/orientation from peak coordinates to plot coordinate
49 // For mapping/orientation from plot coordinates to peak coordinate
53 boost::regex m_FirstRegex;
54 boost::regex m_SecondRegex;
55 boost::regex m_ThirdRegex;
56};
57
59using PeakTransform_sptr = std::shared_ptr<PeakTransform>;
60using PeakTransform_const_sptr = std::shared_ptr<const PeakTransform>;
61
66class PeakTransformException : public std::exception {
67public:
68 PeakTransformException() : std::exception() {}
69};
70} // namespace Geometry
71} // namespace Mantid
Structure describing a single-crystal peak.
Definition: IPeak.h:26
Exceptions occuring when PeakTransformations cannot be formed.
Definition: PeakTransform.h:66
Used to remap coordinates into a form consistent with an axis reordering.
Definition: PeakTransform.h:21
virtual Mantid::Kernel::V3D transformPeak(const Mantid::Geometry::IPeak &peak) const =0
Perform Transform.
PeakTransform(const PeakTransform &)=default
virtual ~PeakTransform()=default
virtual std::string getFriendlyName() const =0
Getter for a friendly name to describe the transform type.
virtual Mantid::Kernel::SpecialCoordinateSystem getCoordinateSystem() const =0
Getter for the special coordinate representation of this transform type.
virtual std::shared_ptr< PeakTransform > clone() const =0
Virtual constructor.
Class for 3D vectors.
Definition: V3D.h:34
std::shared_ptr< PeakTransform > PeakTransform_sptr
Typedef for a PeakTransform wrapped in a shared_pointer.
Definition: PeakTransform.h:59
std::shared_ptr< const PeakTransform > PeakTransform_const_sptr
Definition: PeakTransform.h:60
SpecialCoordinateSystem
Special coordinate systems for Q3D.
Helper class which provides the Collimation Length for SANS instruments.
STL namespace.