diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroup.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroup.h index be4401900d0fac0d87f1e9921aa847fe8071e47b..35c4879f71fe702b7391ead9b3b9e545bd07ec85 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroup.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroup.h @@ -35,7 +35,7 @@ public: }; PointGroup(const std::string &symbolHM, const Group &group, - const std::string &name); + const std::string &description = ""); PointGroup(const PointGroup &other); PointGroup &operator=(const PointGroup &other); diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroupFactory.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroupFactory.h index 0ef149166039285da77b980da2eadaf93cbc943d..36c9c583dbea2ff8d866ea1fdc32a1345d414fcf 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroupFactory.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroupFactory.h @@ -14,12 +14,14 @@ namespace Geometry { class MANTID_GEOMETRY_DLL PointGroupGenerator { public: PointGroupGenerator(const std::string &hmSymbol, - const std::string &generatorInformation); + const std::string &generatorInformation, + const std::string &description); ~PointGroupGenerator() {} inline std::string getHMSymbol() const { return m_hmSymbol; } inline std::string getGeneratorString() const { return m_generatorString; } + inline std::string getDescription() const { return m_description; } PointGroup_sptr getPrototype(); @@ -32,6 +34,7 @@ private: std::string m_hmSymbol; std::string m_generatorString; + std::string m_description; PointGroup_sptr m_prototype; }; @@ -87,7 +90,8 @@ public: getPointGroupSymbols(const PointGroup::CrystalSystem &crystalSystem) const; void subscribePointGroup(const std::string &hmSymbol, - const std::string &generatorString); + const std::string &generatorString, + const std::string &description); /// Unsubscribes a point group from the factory void unsubscribePointGroup(const std::string &hmSymbol) { @@ -135,13 +139,13 @@ PointGroupFactory; #define PGF_CONCAT_IMPL(x, y) x##y #define PGF_CONCAT(x, y) PGF_CONCAT_IMPL(x, y) -#define DECLARE_POINTGROUP(hmSymbol, generators) \ +#define DECLARE_POINTGROUP(hmSymbol, generators, description) \ namespace { \ - Mantid::Kernel::RegistrationHelper \ - PGF_CONCAT(register_pointgroup, \ - __COUNTER__)(((Mantid::Geometry::PointGroupFactory::Instance() \ - .subscribePointGroup(hmSymbol, generators)), \ - 0)); \ + Mantid::Kernel::RegistrationHelper PGF_CONCAT(register_pointgroup, \ + __COUNTER__)( \ + ((Mantid::Geometry::PointGroupFactory::Instance().subscribePointGroup( \ + hmSymbol, generators, description)), \ + 0)); \ } #endif /* MANTID_GEOMETRY_POINTGROUPFACTORY_H_ */ diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp index 65251f4fb8654b696b8fbf85d4b00135dd4ba8c7..ecbe2174f8dddfcd11dac99450e73bb156ee666a 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp @@ -66,13 +66,12 @@ bool PointGroup::groupHasNoTranslations(const Group &group) const { /// Protected constructor - can not be used directly. PointGroup::PointGroup(const std::string &symbolHM, const Group &group, - const std::string &name) - : Group(group), m_symbolHM(symbolHM), m_name(name) { -} + const std::string &description) + : Group(group), m_symbolHM(symbolHM), + m_name(symbolHM + " (" + description + ")") {} PointGroup::PointGroup(const PointGroup &other) - : Group(other), m_symbolHM(other.m_symbolHM), m_name(other.m_name) { -} + : Group(other), m_symbolHM(other.m_symbolHM), m_name(other.m_name) {} PointGroup &PointGroup::operator=(const PointGroup &other) { Group::operator=(other); diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/PointGroupFactory.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/PointGroupFactory.cpp index 81f745e9277a6fb870934ade7789744e5f06fbb8..01e1d076de97080ed453e2c7321937cbd8a7775f 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/PointGroupFactory.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/PointGroupFactory.cpp @@ -33,7 +33,7 @@ std::vector<std::string> PointGroupFactoryImpl::getAllPointGroupSymbols() const { std::vector<std::string> pointGroups; - for (auto it = m_crystalSystemMap.begin(); it != m_crystalSystemMap.end(); + for (auto it = m_generatorMap.begin(); it != m_generatorMap.end(); ++it) { pointGroups.push_back(it->first); } @@ -59,14 +59,15 @@ std::vector<std::string> PointGroupFactoryImpl::getPointGroupSymbols( void PointGroupFactoryImpl::subscribePointGroup(const std::string &hmSymbol, - const std::string &generatorString) { + const std::string &generatorString, + const std::string &description) { if (isSubscribed(hmSymbol)) { throw std::invalid_argument( "Point group with this symbol is already registered."); } - PointGroupGenerator_sptr generator = - boost::make_shared<PointGroupGenerator>(hmSymbol, generatorString); + PointGroupGenerator_sptr generator = boost::make_shared<PointGroupGenerator>( + hmSymbol, generatorString, description); subscribe(generator); } @@ -157,8 +158,10 @@ PointGroupFactoryImpl::removeFromCrystalSystemMap(const std::string &hmSymbol) { } PointGroupGenerator::PointGroupGenerator( - const std::string &hmSymbol, const std::string &generatorInformation) - : m_hmSymbol(hmSymbol), m_generatorString(generatorInformation) {} + const std::string &hmSymbol, const std::string &generatorInformation, + const std::string &description) + : m_hmSymbol(hmSymbol), m_generatorString(generatorInformation), + m_description(description) {} PointGroup_sptr PointGroupGenerator::getPrototype() { if (!hasValidPrototype()) { @@ -177,24 +180,26 @@ PointGroup_sptr PointGroupGenerator::generatePrototype() { "Could not create group from supplied symmetry operations."); } - return boost::make_shared<PointGroup>(m_hmSymbol, *generatingGroup, ""); + return boost::make_shared<PointGroup>(m_hmSymbol, *generatingGroup, + m_description); } -DECLARE_POINTGROUP("1", "x,y,z") -DECLARE_POINTGROUP("-1", "-x,-y,-z") -DECLARE_POINTGROUP("2/m", "-x,y,-z; x,-y,z") -DECLARE_POINTGROUP("112/m", "-x,-y,z; x,y,-z") -DECLARE_POINTGROUP("mmm", "x,-y,-z; -x,y,-z; x,y,-z") -DECLARE_POINTGROUP("4/m", "-y,x,z; x,y,-z") -DECLARE_POINTGROUP("4/mmm", "-y,x,z; x,y,-z; x,-y,-z") -DECLARE_POINTGROUP("-3", "-y,x-y,z; -x,-y,-z") -DECLARE_POINTGROUP("-3m1", "-y,x-y,z; -x,-y,-z; -x,y-x,z") -DECLARE_POINTGROUP("-31m", "-y,x-y,z; -x,-y,-z; -x,y-x,z") -DECLARE_POINTGROUP("6/m", "x-y,x,z; -x,-y,-z") -DECLARE_POINTGROUP("6/mmm", "x-y,x,z; x-y,-y,-z; x,y,-z") -DECLARE_POINTGROUP("m-3", "z,x,y; -x,-y,z; x,-y,z; -x,-y,-z") -DECLARE_POINTGROUP("m-3m", "z,x,y; -y,x,z; x,-y,z; -x,-y,-z") - +DECLARE_POINTGROUP("1", "x,y,z", "Triclinic") +DECLARE_POINTGROUP("-1", "-x,-y,-z", "Triclinic") +DECLARE_POINTGROUP("2/m", "-x,y,-z; x,-y,z", "Monoclinic, unique axis b") +DECLARE_POINTGROUP("112/m", "-x,-y,z; x,y,-z", "Monoclinic, unique axis c") +DECLARE_POINTGROUP("mmm", "x,-y,-z; -x,y,-z; x,y,-z", "Orthorombic") +DECLARE_POINTGROUP("4/m", "-y,x,z; x,y,-z", "Tetragonal") +DECLARE_POINTGROUP("4/mmm", "-y,x,z; x,y,-z; x,-y,-z", "Tetragonal") +DECLARE_POINTGROUP("-3", "-y,x-y,z; -x,-y,-z", "Trigonal - Hexagonal") +DECLARE_POINTGROUP("-3m1", "-y,x-y,z; -x,-y,-z; -x,y-x,z", + "Trigonal - Rhombohedral") +DECLARE_POINTGROUP("-31m", "-y,x-y,z; -x,-y,-z; -x,y-x,z", + "Trigonal - Rhombohedral") +DECLARE_POINTGROUP("6/m", "x-y,x,z; -x,-y,-z", "Hexagonal") +DECLARE_POINTGROUP("6/mmm", "x-y,x,z; x-y,-y,-z; x,y,-z", "Hexagonal") +DECLARE_POINTGROUP("m-3", "z,x,y; -x,-y,z; x,-y,z; -x,-y,-z", "Cubic") +DECLARE_POINTGROUP("m-3m", "z,x,y; -y,x,z; x,-y,z; -x,-y,-z", "Cubic") } // namespace Geometry } // namespace Mantid