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>
32bool isEquivalent(
const PointGroup &self,
const object &hkl1,
const object &hkl2) {
36boost::python::list getEquivalents(
const PointGroup &self,
const object &hkl) {
39 boost::python::list pythonEquivalents;
40 for (
const auto &equivalent : equivalents) {
41 pythonEquivalents.append(equivalent);
44 return pythonEquivalents;
51std::string __repr__implementation(
const PointGroup &self) {
53 ss <<
"PointGroupFactory.createPointGroup(\"";
61 register_ptr_to_python<std::shared_ptr<PointGroup>>();
63 scope pointGroupScope = class_<PointGroup, boost::noncopyable>(
"PointGroup", no_init);
65 enum_<PointGroup::CrystalSystem>(
"CrystalSystem")
74 enum_<PointGroup::LatticeSystem>(
"LatticeSystem")
83 class_<PointGroup, boost::noncopyable, bases<Group>>(
"PointGroup", no_init)
84 .def(
"getName", &
PointGroup::getName, arg(
"self"), return_value_policy<copy_const_reference>())
88 .def(
"isEquivalent", &isEquivalent, (arg(
"self"), arg(
"hkl1"), arg(
"hkl2")),
89 "Check whether the two HKLs are symmetrically equivalent.")
90 .def(
"getEquivalents", &getEquivalents, (arg(
"self"), arg(
"hkl")),
91 "Returns an array with all symmetry equivalents of the supplied "
94 .def(
"getReflectionFamily", &getReflectionFamily, (arg(
"self"), arg(
"hkl")),
95 "Returns the same HKL for all symmetry equivalents.")
97 .def(
"__repr__", &__repr__implementation);
#define GET_POINTER_SPECIALIZATION(TYPE)
The class Group represents a set of symmetry operations (or symmetry group).
A class containing the Point Groups for a crystal.
bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const
Return true if the hkls are in same group.
const std::string & getName() const
Name of the point group.
const std::string & getSymbol() const
Hermann-Mauguin symbol.
LatticeSystem latticeSystem() const
std::vector< Kernel::V3D > getEquivalents(const Kernel::V3D &hkl) const
Returns a vector with all equivalent hkls.
std::string getLauePointGroupSymbol() const
CrystalSystem crystalSystem() const
Kernel::V3D getReflectionFamily(const Kernel::V3D &hkl) const
Returns the same hkl for all equivalent hkls.
Takes a Python object and if it supports indexing and is of length 3 then it will attempt to convert ...