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 const std::string &getName() const { return m_name; }
41 const std::string &getSymbol() const;
42
43 CrystalSystem crystalSystem() const { return m_crystalSystem; }
44 LatticeSystem latticeSystem() const { return m_latticeSystem; }
45
46 std::string getLauePointGroupSymbol() const;
47
49 bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
50
52 std::vector<Kernel::V3D> getEquivalents(const Kernel::V3D &hkl) const;
54 Kernel::V3D getReflectionFamily(const Kernel::V3D &hkl) const;
55
56protected:
57 std::vector<Kernel::V3D> getAllEquivalents(const Kernel::V3D &hkl) const;
58
59 CrystalSystem getCrystalSystemFromGroup() const;
60 LatticeSystem getLatticeSystemFromCrystalSystemAndGroup(const CrystalSystem &crystalSystem) const;
61
62 std::string m_symbolHM;
63 std::string m_name;
66};
67
69using PointGroup_sptr = std::shared_ptr<PointGroup>;
70
71MANTID_GEOMETRY_DLL std::vector<PointGroup_sptr> getAllPointGroups();
72
73MANTID_GEOMETRY_DLL
74std::string getCrystalSystemAsString(const PointGroup::CrystalSystem &crystalSystem);
75
76MANTID_GEOMETRY_DLL
77PointGroup::CrystalSystem getCrystalSystemFromString(const std::string &crystalSystem);
78
79MANTID_GEOMETRY_DLL
80std::string getLatticeSystemAsString(const PointGroup::LatticeSystem &latticeSystem);
81
82MANTID_GEOMETRY_DLL
83PointGroup::LatticeSystem getLatticeSystemFromString(const std::string &latticeSystem);
84
85MANTID_GEOMETRY_DLL std::ostream &operator<<(std::ostream &stream, const PointGroup &self);
86
89struct MANTID_GEOMETRY_DLL CrystalSystemComparator {
90 bool operator()(const PointGroup::CrystalSystem &lhs, const PointGroup::CrystalSystem &rhs) const;
91};
92
93using PointGroupCrystalSystemMap = std::multimap<PointGroup::CrystalSystem, PointGroup_sptr, CrystalSystemComparator>;
94
96
97} // namespace Geometry
98} // 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
const 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:64
LatticeSystem m_latticeSystem
Definition PointGroup.h:65
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...
std::shared_ptr< PointGroup > PointGroup_sptr
Shared pointer to a PointGroup.
Definition PointGroup.h:69
std::multimap< PointGroup::CrystalSystem, PointGroup_sptr, CrystalSystemComparator > PointGroupCrystalSystemMap
Definition PointGroup.h:93
MANTID_GEOMETRY_DLL std::string getLatticeSystemAsString(const PointGroup::LatticeSystem &latticeSystem)
Returns the supplied LatticeSystem as a string.
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
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...
MANTID_GEOMETRY_DLL std::string getCrystalSystemAsString(const PointGroup::CrystalSystem &crystalSystem)
Return a human-readable string for the given crystal system.
MANTID_GEOMETRY_DLL std::vector< PointGroup_sptr > getAllPointGroups()
MANTID_GEOMETRY_DLL PointGroupCrystalSystemMap getPointGroupsByCrystalSystem()
Returns a multimap with crystal system as key and point groups as values.
Helper class which provides the Collimation Length for SANS instruments.
This is necessary to make the map work with older compilers.
Definition PointGroup.h:89