Loading...
Searching...
No Matches
spacegroup.h
Go to the documentation of this file.
/**********************************************************************
spacegroup.h - Handle Crystallographic Space Groups.
Copyright (C) 2007 by Jean Bréfort
This file is part of the Open Babel project.
For more information, see <http://openbabel.org/>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef OB_SPACE_GROUP_H
#define OB_SPACE_GROUP_H
#include <openbabel/math/transform3d.h>
#include <string>
#include <list>
namespace OpenBabel
{
class OBAPI SpaceGroup
{
public:
SpaceGroup();
~SpaceGroup();
void SetHMName(const char *name);
void SetHallName(const char *name)
{ m_Hall = name; }
void SetId(unsigned n)
{ m_id = n; }
void AddTransform(const std::string &s);
const std::string & GetHMName() const
{ return m_HM;}
const std::string & GetHallName()const
{ return m_Hall;}
unsigned GetId() const
{ return m_id; }
unsigned int GetOriginAlternative() const
{ return m_OriginAlternative; }
std::list<vector3> Transform(const vector3 &v) const;
transform3d const * BeginTransform(transform3dIterator &i) const;
transform3d const * NextTransform(transform3dIterator &i) const;
// static methods
/* The name might be either a HM or Hall name */
static const SpaceGroup * GetSpaceGroup (char const *name);
static const SpaceGroup * GetSpaceGroup (const std::string &name);
static const SpaceGroup * GetSpaceGroup (unsigned id);
static const SpaceGroup * Find (SpaceGroup* group);
/* Use it if the space group is unknown (might happen if no database has
been loaded or if the HM name is not usual. */
// Unfortunately, this seems to confuse the SWIG parser
// Fortunately, it's not needed for the scripting bindings,
// since this is internal code
#ifndef SWIG
void RegisterSpaceGroup (int nb = 0, ...);
#endif
bool operator ==(const SpaceGroup &) const;
int operator!=(const SpaceGroup &other) const
{
return !((*this) == other);
}
bool IsValid() const;
const int HEXAGONAL_ORIGIN;
private:
std::string m_HM;
std::string m_Hall;
unsigned int m_id;
unsigned int m_OriginAlternative;
std::list<transform3d*> m_transforms;
};
}
#endif // OB_SPACE_GROUP_H
OpenBabel::SpaceGroup
Handle crystallographic space group symmetry.
Definition spacegroup.h:36
OpenBabel::SpaceGroup::GetHMName
const std::string & GetHMName() const
Definition spacegroup.h:48
OpenBabel::SpaceGroup::HEXAGONAL_ORIGIN
const int HEXAGONAL_ORIGIN
Definition spacegroup.h:83
OpenBabel::SpaceGroup::GetId
unsigned GetId() const
Definition spacegroup.h:52
OpenBabel::SpaceGroup::SetHMName
void SetHMName(const char *name)
Definition spacegroup.cpp:154
OpenBabel::SpaceGroup::SpaceGroup
SpaceGroup()
Definition spacegroup.cpp:142
OpenBabel::SpaceGroup::SetId
void SetId(unsigned n)
Definition spacegroup.h:44
OpenBabel::SpaceGroup::operator!=
int operator!=(const SpaceGroup &other) const
Definition spacegroup.h:77
OpenBabel::SpaceGroup::SetHallName
void SetHallName(const char *name)
Definition spacegroup.h:42
OpenBabel::SpaceGroup::GetOriginAlternative
unsigned int GetOriginAlternative() const
Definition spacegroup.h:54
OpenBabel::SpaceGroup::GetHallName
const std::string & GetHallName() const
Definition spacegroup.h:50
OpenBabel::transform3d
Handle 3D transformations, such as space group definitions.
Definition transform3d.h:36
OpenBabel::vector3
Represents a vector in 3-dimensional real space.
Definition vector3.h:45
OpenBabel
Global namespace for all Open Babel code.
Definition alias.h:23
OpenBabel::transform3dIterator
std::list< transform3d * >::const_iterator transform3dIterator
Definition transform3d.h:75
transform3d.h
Handle 3D transformations in space groups.