12#include <boost/python/class.hpp>
13#include <boost/python/enum.hpp>
14#include <boost/python/list.hpp>
15#include <boost/python/operators.hpp>
16#include <boost/python/register_ptr_to_python.hpp>
17#include <boost/python/scope.hpp>
18#include <boost/python/self.hpp>
30boost::python::list getEquivalentPositions(
const SpaceGroup &self,
const object &point) {
33 boost::python::list pythonEquivalents;
34 for (
const auto &equivalent : equivalents) {
35 pythonEquivalents.append(equivalent);
38 return pythonEquivalents;
41bool isAllowedReflection(
const SpaceGroup &self,
const object &hkl) {
52std::string __repr__implementation(
const SpaceGroup &self) {
54 ss <<
"SpaceGroupFactory.createSpaceGroup(\"";
62 register_ptr_to_python<std::shared_ptr<SpaceGroup>>();
64 class_<SpaceGroup, boost::noncopyable, bases<Group>>(
"SpaceGroup", no_init)
67 .def(
"getEquivalentPositions", &getEquivalentPositions, (arg(
"self"), arg(
"point")),
68 "Returns an array with all symmetry equivalents of the supplied "
70 .def(
"isAllowedReflection", &isAllowedReflection, (arg(
"self"), arg(
"hkl")),
71 "Returns True if the supplied reflection is allowed with respect to "
72 "space group symmetry operations.")
74 "Returns true if the metric of the cell "
75 "is compatible with the space group.")
77 .def(
"getSiteSymmetryGroup", &getSiteSymmetryGroup, (arg(
"self"), arg(
"position")),
78 "Returns the site symmetry group for supplied point coordinates.")
80 .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.
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 ...