Mantid
Loading...
Searching...
No Matches
SymmetryElement.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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 "MantidGeometry/DllConfig.h"
12#include "MantidKernel/Matrix.h"
13
14#include <gsl/gsl_matrix.h>
15#include <memory>
16
17namespace Mantid {
18namespace Geometry {
19
38class MANTID_GEOMETRY_DLL SymmetryElement {
39public:
40 virtual ~SymmetryElement() = default;
41
42 virtual std::shared_ptr<SymmetryElement> clone() const = 0;
43
45 std::string hmSymbol() const { return m_hmSymbol; }
46
47protected:
48 SymmetryElement(std::string symbol);
49
50 std::string m_hmSymbol;
51};
52
53using SymmetryElement_sptr = std::shared_ptr<SymmetryElement>;
54
60class MANTID_GEOMETRY_DLL SymmetryElementIdentity : public SymmetryElement {
61public:
63
64 SymmetryElement_sptr clone() const override;
65};
66
67using SymmetryElementIdentity_sptr = std::shared_ptr<SymmetryElementIdentity>;
68
75class MANTID_GEOMETRY_DLL SymmetryElementInversion : public SymmetryElement {
76public:
77 SymmetryElementInversion(const V3R &inversionPoint = V3R(0, 0, 0));
78
79 SymmetryElement_sptr clone() const override;
80
82 V3R getInversionPoint() const { return m_inversionPoint; }
83
84protected:
86};
87
88using SymmetryElementInversion_sptr = std::shared_ptr<SymmetryElementInversion>;
89
96class MANTID_GEOMETRY_DLL SymmetryElementTranslation : public SymmetryElement {
97public:
98 SymmetryElementTranslation(const V3R &translation);
99
101 V3R getTranslation() const { return m_translation; }
102
103 SymmetryElement_sptr clone() const override;
104
105protected:
107};
108
109using SymmetryElementTranslation_sptr = std::shared_ptr<SymmetryElementTranslation>;
110
118class MANTID_GEOMETRY_DLL SymmetryElementWithAxis : public SymmetryElement {
119public:
121 V3R getAxis() const { return m_axis; }
122
124 V3R getTranslation() const { return m_translation; }
125
126protected:
127 SymmetryElementWithAxis(const std::string &symbol, const V3R &axis, const V3R &translation);
128
129 void setAxis(const V3R &axis);
130
133};
134
135using SymmetryElementWithAxis_sptr = std::shared_ptr<SymmetryElementWithAxis>;
136
150class MANTID_GEOMETRY_DLL SymmetryElementRotation : public SymmetryElementWithAxis {
151public:
152 enum RotationSense { Positive, Negative, NoRotation };
153
154 SymmetryElementRotation(const std::string &symbol, const V3R &axis, const V3R &translation = V3R(0, 0, 0),
155 const RotationSense &rotationSense = Positive);
156
157 SymmetryElement_sptr clone() const override;
158
160 RotationSense getRotationSense() const { return m_rotationSense; }
161
162protected:
164};
165
166using SymmetryElementRotation_sptr = std::shared_ptr<SymmetryElementRotation>;
167
177class MANTID_GEOMETRY_DLL SymmetryElementMirror : public SymmetryElementWithAxis {
178public:
179 SymmetryElementMirror(const std::string &symbol, const V3R &axis, const V3R &translation = V3R(0, 0, 0));
180
181 SymmetryElement_sptr clone() const override;
182};
183
184using SymmetryElementMirror_sptr = std::shared_ptr<SymmetryElementMirror>;
185
186} // namespace Geometry
187} // namespace Mantid
SymmetryElementIdentity represents the identity.
SymmetryElementInversion represents the inversion.
V3R getInversionPoint() const
Returns the internally stored inversion point.
SymmetryElementMirror represents mirror and glide-planes.
SymmetryElementRotation represents rotation-, rotoinversion- and screw-axes.
RotationSense getRotationSense() const
Returns the internally stored rotation sense.
SymmetryElementTranslation represents translations.
V3R getTranslation() const
Returns the internally stored translation vector.
SymmetryElementWithAxis does not represent any symmetry element directly.
V3R getAxis() const
Returns the internally stored axis.
V3R getTranslation() const
Returns the internally stored translation vector.
SymmetryElement is an interface for representing symmetry elements that occur for example in space an...
virtual ~SymmetryElement()=default
virtual std::shared_ptr< SymmetryElement > clone() const =0
std::string hmSymbol() const
Returns the internally stored Hermann-Mauguin symbol.
std::shared_ptr< SymmetryElementTranslation > SymmetryElementTranslation_sptr
std::shared_ptr< SymmetryElementMirror > SymmetryElementMirror_sptr
std::shared_ptr< SymmetryElementWithAxis > SymmetryElementWithAxis_sptr
std::shared_ptr< SymmetryElementRotation > SymmetryElementRotation_sptr
std::shared_ptr< SymmetryElementIdentity > SymmetryElementIdentity_sptr
std::shared_ptr< SymmetryElementInversion > SymmetryElementInversion_sptr
std::shared_ptr< SymmetryElement > SymmetryElement_sptr
Helper class which provides the Collimation Length for SANS instruments.