12#include <boost/python/class.hpp>
13#include <boost/python/copy_const_reference.hpp>
14#include <boost/python/enum.hpp>
15#include <boost/python/list.hpp>
16#include <boost/python/operators.hpp>
17#include <boost/python/register_ptr_to_python.hpp>
18#include <boost/python/scope.hpp>
19#include <boost/python/self.hpp>
31boost::python::list getEquivalentPositions(
const SpaceGroup &self,
const object &point) {
34 boost::python::list pythonEquivalents;
35 for (
const auto &equivalent : equivalents) {
36 pythonEquivalents.append(equivalent);
39 return pythonEquivalents;
42bool isAllowedReflection(
const SpaceGroup &self,
const object &hkl) {
53std::string __repr__implementation(
const SpaceGroup &self) {
55 ss <<
"SpaceGroupFactory.createSpaceGroup(\"";
63 register_ptr_to_python<std::shared_ptr<SpaceGroup>>();
65 class_<SpaceGroup, boost::noncopyable, bases<Group>>(
"SpaceGroup", no_init)
67 .def(
"getHMSymbol", &
SpaceGroup::hmSymbol, arg(
"self"), return_value_policy<copy_const_reference>())
68 .def(
"getEquivalentPositions", &getEquivalentPositions, (arg(
"self"), arg(
"point")),
69 "Returns an array with all symmetry equivalents of the supplied "
71 .def(
"isAllowedReflection", &isAllowedReflection, (arg(
"self"), arg(
"hkl")),
72 "Returns True if the supplied reflection is allowed with respect to "
73 "space group symmetry operations.")
75 "Returns true if the metric of the cell "
76 "is compatible with the space group.")
78 .def(
"getSiteSymmetryGroup", &getSiteSymmetryGroup, (arg(
"self"), arg(
"position")),
79 "Returns the site symmetry group for supplied point coordinates.")
81 .def(
"__repr__", &__repr__implementation);
#define GET_POINTER_SPECIALIZATION(TYPE)
The class Group represents a set of symmetry operations (or symmetry group).
A class for representing space groups, inheriting from Group.
PointGroup_sptr getPointGroup() const
Returns the point group of the space group.
bool isAllowedReflection(const Kernel::V3D &hkl) const
Returns whether the given reflection is allowed or not in this space group.
Group_const_sptr getSiteSymmetryGroup(const Kernel::V3D &position) const
Returns the site symmetry group.
const std::string & hmSymbol() const
Returns the stored Hermann-Mauguin symbol.
bool isAllowedUnitCell(const UnitCell &cell) const
Convenience function for checking compatibility of a cell metric with the space group,...
size_t number() const
Returns the stored space group number.
std::vector< T > getEquivalentPositions(const T &position) const
std::shared_ptr< Group > Group_sptr
Takes a Python object and if it supports indexing and is of length 3 then it will attempt to convert ...