-
Notifications
You must be signed in to change notification settings - Fork 122
/
PointGroup.h
249 lines (217 loc) · 8.48 KB
/
PointGroup.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
#ifndef MANTID_GEOMETRY_POINTGROUP_H_
#define MANTID_GEOMETRY_POINTGROUP_H_
#include "MantidGeometry/DllConfig.h"
#include "MantidKernel/V3D.h"
#include "MantidKernel/Matrix.h"
#ifndef Q_MOC_RUN
# include <boost/shared_ptr.hpp>
#endif
#include <vector>
#include <string>
#include <set>
#include "MantidGeometry/Crystal/SymmetryOperation.h"
namespace Mantid
{
namespace Geometry
{
/** A class containing the Point Groups for a crystal.
*
* @author Vickie Lynch
* @date 2012-02-02
*/
class MANTID_GEOMETRY_DLL PointGroup
{
public:
enum CrystalSystem {
Triclinic,
Monoclinic,
Orthorhombic,
Tetragonal,
Hexagonal,
Trigonal,
Cubic
};
virtual ~PointGroup() {}
/// Name of the point group
virtual std::string getName() = 0;
virtual CrystalSystem crystalSystem() const = 0;
/// Return true if the hkls are in same group
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const = 0;
/// Returns a vector with all equivalent hkls
std::vector<Kernel::V3D> getEquivalents(const Kernel::V3D &hkl) const;
/// Returns the same hkl for all equivalent hkls
Kernel::V3D getReflectionFamily(const Kernel::V3D &hkl) const;
protected:
PointGroup();
void addSymmetryOperation(const SymmetryOperation_const_sptr &symmetryOperation);
std::vector<SymmetryOperation_const_sptr> getSymmetryOperations() const;
std::vector<Kernel::IntMatrix> generateTransformationMatrices(const std::vector<SymmetryOperation_const_sptr> &symmetryOperations);
void setTransformationMatrices(const std::vector<Kernel::IntMatrix> &matrices);
std::set<Kernel::V3D> getEquivalentSet(const Kernel::V3D &hkl) const;
std::vector<SymmetryOperation_const_sptr> m_symmetryOperations;
std::vector<Kernel::IntMatrix> m_transformationMatrices;
};
//------------------------------------------------------------------------
/** -1 (Triclinic) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue1 : public PointGroup
{
public:
PointGroupLaue1();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** 1 2/m 1 (Monoclinic, unique axis b) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue2 : public PointGroup
{
public:
PointGroupLaue2();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** 1 1 2/m (Monoclinic, unique axis c) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue3 : public PointGroup
{
public:
PointGroupLaue3();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** mmm (Orthorombic) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue4 : public PointGroup
{
public:
PointGroupLaue4();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** 4/m (Tetragonal) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue5 : public PointGroup
{
public:
PointGroupLaue5();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** 4/mmm (Tetragonal) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue6 : public PointGroup
{
public:
PointGroupLaue6();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** -3 (Trigonal - Hexagonal) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue7 : public PointGroup
{
public:
PointGroupLaue7();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** -3m1 (Trigonal - Rhombohedral) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue8 : public PointGroup
{
public:
PointGroupLaue8();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** -31m (Trigonal - Rhombohedral) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue9 : public PointGroup
{
public:
PointGroupLaue9();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** 6/m (Hexagonal) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue10 : public PointGroup
{
public:
PointGroupLaue10();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** 6/mmm (Hexagonal) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue11 : public PointGroup
{
public:
PointGroupLaue11();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** m-3 (Cubic) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue12 : public PointGroup
{
public:
PointGroupLaue12();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
//------------------------------------------------------------------------
/** m-3m (Cubic) PointGroup */
class MANTID_GEOMETRY_DLL PointGroupLaue13 : public PointGroup
{
public:
PointGroupLaue13();
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};
/// Shared pointer to a PointGroup
typedef boost::shared_ptr<PointGroup> PointGroup_sptr;
MANTID_GEOMETRY_DLL std::vector<PointGroup_sptr> getAllPointGroups();
typedef std::multimap<PointGroup::CrystalSystem, PointGroup_sptr> PointGroupCrystalSystemMap;
MANTID_GEOMETRY_DLL PointGroupCrystalSystemMap getPointGroupsByCrystalSystem();
} // namespace Mantid
} // namespace Geometry
#endif /* MANTID_GEOMETRY_POINTGROUP_H_ */