Mantid
Loading...
Searching...
No Matches
PointGroupFactory.cpp
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 +
10
11#include <boost/python/class.hpp>
12
13using namespace Mantid::Geometry;
14using namespace boost::python;
15
16namespace {
17PointGroup_sptr getPointGroupFromSpaceGroup(PointGroupFactoryImpl &self, const SpaceGroup &group) {
18 return self.createPointGroupFromSpaceGroup(group);
19}
20
21PointGroup_sptr getPointGroupFromSpaceGroupSymbol(PointGroupFactoryImpl &self, const std::string &group) {
22 return self.createPointGroupFromSpaceGroup(SpaceGroupFactory::Instance().createSpaceGroup(group));
23}
24} // namespace
25
27
28 class_<PointGroupFactoryImpl, boost::noncopyable>("PointGroupFactoryImpl", no_init)
29 .def("isSubscribed", &PointGroupFactoryImpl::isSubscribed, (arg("self"), arg("hmSymbol")),
30 "Returns true of the point group with the given symbol is "
31 "subscribed.")
32 .def("createPointGroup", &PointGroupFactoryImpl::createPointGroup, (arg("self"), arg("hmSymbol")),
33 "Creates a point group if registered.")
34 .def("createPointGroupFromSpaceGroup", &getPointGroupFromSpaceGroup, (arg("self"), arg("group")),
35 "Creates the point group that corresponds to the given space group.")
36 .def("createPointGroupFromSpaceGroupSymbol", &getPointGroupFromSpaceGroupSymbol, (arg("self"), arg("group")),
37 "Creates a point group directly from the space group symbol.")
38 .def("getAllPointGroupSymbols", &PointGroupFactoryImpl::getAllPointGroupSymbols, arg("self"),
39 "Returns all registered point group symbols.")
40 .def("getPointGroupSymbols", &PointGroupFactoryImpl::getPointGroupSymbols, (arg("self"), arg("crystalsystem")),
41 "Returns all point groups registered for the given crystal system.")
42 .def("Instance", &PointGroupFactory::Instance, return_value_policy<reference_existing_object>(),
43 "Returns a reference to the PointGroupFactory singleton")
44 .staticmethod("Instance");
45}
void export_PointGroupFactory()
bool isSubscribed(const std::string &hmSymbol) const
PointGroup_sptr createPointGroupFromSpaceGroup(const SpaceGroup_const_sptr &spaceGroup)
PointGroup_sptr createPointGroup(const std::string &hmSymbol)
Creates a PointGroup object from its Hermann-Mauguin symbol.
std::vector< std::string > getAllPointGroupSymbols() const
Returns the Hermann-Mauguin symbols of all registered point groups.
std::vector< std::string > getPointGroupSymbols(const PointGroup::CrystalSystem &crystalSystem)
Returns the Hermann-Mauguin symbols of all point groups that belong to a certain crystal system.
A class for representing space groups, inheriting from Group.
Definition: SpaceGroup.h:46
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< PointGroup > PointGroup_sptr
Shared pointer to a PointGroup.
Definition: PointGroup.h:67