Mantid
Loading...
Searching...
No Matches
PointGroup.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 "MantidGeometry/DllConfig.h"
10#include "MantidKernel/Matrix.h"
11#include "MantidKernel/V3D.h"
12#ifndef Q_MOC_RUN
13#include <memory>
14#endif
15#include <map>
16#include <set>
17#include <string>
18#include <vector>
19
22
23namespace Mantid {
24namespace Geometry {
25
31class MANTID_GEOMETRY_DLL PointGroup : public Group {
32public:
33 enum class CrystalSystem { Triclinic, Monoclinic, Orthorhombic, Tetragonal, Hexagonal, Trigonal, Cubic };
34
35 enum class LatticeSystem { Triclinic, Monoclinic, Orthorhombic, Tetragonal, Hexagonal, Rhombohedral, Cubic };
36
37 PointGroup(const std::string &symbolHM, const Group &group, const std::string &description = "");
39 std::string getName() const { return m_name; }
41 std::string getSymbol() const;
42
43 CrystalSystem crystalSystem() const { return m_crystalSystem; }
44 LatticeSystem latticeSystem() const { return m_latticeSystem; }
45
47 bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
48
50 std::vector<Kernel::V3D> getEquivalents(const Kernel::V3D &hkl) const;
52 Kernel::V3D getReflectionFamily(const Kernel::V3D &hkl) const;
53
54protected:
55 std::vector<Kernel::V3D> getAllEquivalents(const Kernel::V3D &hkl) const;
56
57 CrystalSystem getCrystalSystemFromGroup() const;
58 LatticeSystem getLatticeSystemFromCrystalSystemAndGroup(const CrystalSystem &crystalSystem) const;
59
60 std::string m_symbolHM;
61 std::string m_name;
64};
65
67using PointGroup_sptr = std::shared_ptr<PointGroup>;
68
69MANTID_GEOMETRY_DLL std::vector<PointGroup_sptr> getAllPointGroups();
70
71MANTID_GEOMETRY_DLL
72std::string getCrystalSystemAsString(const PointGroup::CrystalSystem &crystalSystem);
73
74MANTID_GEOMETRY_DLL
75PointGroup::CrystalSystem getCrystalSystemFromString(const std::string &crystalSystem);
76
77MANTID_GEOMETRY_DLL
78std::string getLatticeSystemAsString(const PointGroup::LatticeSystem &latticeSystem);
79
80MANTID_GEOMETRY_DLL
81PointGroup::LatticeSystem getLatticeSystemFromString(const std::string &latticeSystem);
82
83MANTID_GEOMETRY_DLL std::ostream &operator<<(std::ostream &stream, const PointGroup &self);
84
87struct MANTID_GEOMETRY_DLL CrystalSystemComparator {
88 bool operator()(const PointGroup::CrystalSystem &lhs, const PointGroup::CrystalSystem &rhs) const;
89};
90
91using PointGroupCrystalSystemMap = std::multimap<PointGroup::CrystalSystem, PointGroup_sptr, CrystalSystemComparator>;
92
94
95} // namespace Geometry
96} // namespace Mantid
const std::vector< double > & rhs
The class Group represents a set of symmetry operations (or symmetry group).
Definition: Group.h:135
A class containing the Point Groups for a crystal.
Definition: PointGroup.h:31
std::string getName() const
Name of the point group.
Definition: PointGroup.h:39
LatticeSystem latticeSystem() const
Definition: PointGroup.h:44
CrystalSystem m_crystalSystem
Definition: PointGroup.h:62
LatticeSystem m_latticeSystem
Definition: PointGroup.h:63
CrystalSystem crystalSystem() const
Definition: PointGroup.h:43
Class for 3D vectors.
Definition: V3D.h:34
MANTID_GEOMETRY_DLL PointGroup::LatticeSystem getLatticeSystemFromString(const std::string &latticeSystem)
Returns the lattice system enum that corresponds to the supplied string or throws an invalid_argument...
Definition: PointGroup.cpp:284
std::shared_ptr< PointGroup > PointGroup_sptr
Shared pointer to a PointGroup.
Definition: PointGroup.h:67
std::multimap< PointGroup::CrystalSystem, PointGroup_sptr, CrystalSystemComparator > PointGroupCrystalSystemMap
Definition: PointGroup.h:91
MANTID_GEOMETRY_DLL std::string getLatticeSystemAsString(const PointGroup::LatticeSystem &latticeSystem)
Returns the supplied LatticeSystem as a string.
Definition: PointGroup.cpp:263
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
Definition: PointGroup.cpp:312
MANTID_GEOMETRY_DLL PointGroup::CrystalSystem getCrystalSystemFromString(const std::string &crystalSystem)
Returns the crystal system enum that corresponds to the supplied string or throws an invalid_argument...
Definition: PointGroup.cpp:240
MANTID_GEOMETRY_DLL std::string getCrystalSystemAsString(const PointGroup::CrystalSystem &crystalSystem)
Return a human-readable string for the given crystal system.
Definition: PointGroup.cpp:219
MANTID_GEOMETRY_DLL std::vector< PointGroup_sptr > getAllPointGroups()
Definition: PointGroup.cpp:195
MANTID_GEOMETRY_DLL PointGroupCrystalSystemMap getPointGroupsByCrystalSystem()
Returns a multimap with crystal system as key and point groups as values.
Definition: PointGroup.cpp:206
Helper class which provides the Collimation Length for SANS instruments.
This is necessary to make the map work with older compilers.
Definition: PointGroup.h:87