The Gnome Chemistry Utils  0.13.7
spacegroup.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 /*
00004  * Gnome Chemistry Utils
00005  * spacegroup.h - Handle Crystallographic Space Groups.
00006  *
00007  * Copyright (C) 2007-2012 by Jean Bréfort
00008  *
00009  * This file was originally part of the Open Babel project.
00010  * For more information, see <http://openbabel.sourceforge.net/>
00011  *
00012  * This program is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU General Public License as
00014  * published by the Free Software Foundation; either version 3 of the
00015  * License, or (at your option) any later version.
00016 
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  */
00022 
00023 #ifndef GCU_SPACE_GROUP_H
00024 #define GCU_SPACE_GROUP_H
00025 
00026 #include "macros.h"
00027 #include <string>
00028 #include <list>
00029 
00030 namespace gcu
00031 {
00032 
00033 class Transform3d;
00034 class Vector;
00035 
00041 class SpaceGroup
00042 {
00043 friend class SpaceGroupPrivate;
00044 public:
00048         SpaceGroup();
00052         ~SpaceGroup();
00053 
00061         void AddTransform(const std::string &s);
00062 
00070         std::list<Vector> Transform (Vector const &v) const;
00071 
00078         Transform3d const *GetFirstTransform (std::list <Transform3d*>::const_iterator &i) const;
00084         Transform3d const *GetNextTransform (std::list <Transform3d*>::const_iterator &i) const;
00085 
00086         // static methods
00087         /* The name might be either a HM or Hall name */
00096         static SpaceGroup const *GetSpaceGroup (char const *name);
00105         static SpaceGroup const *GetSpaceGroup (std::string const &name);
00111         static SpaceGroup const *GetSpaceGroup (unsigned id);
00117         static std::list <SpaceGroup const *> &GetSpaceGroups (unsigned id);
00123         static SpaceGroup const *Find (SpaceGroup* group);
00131         void RegisterSpaceGroup (int nb = 0, ...);
00132 
00140         bool operator ==(const SpaceGroup &group) const;
00147         int operator!=(const SpaceGroup &group) const {return !((*this) == group);}
00151         bool IsValid() const;
00155         unsigned GetTransformsNumber () const {return m_Transforms.size ();}
00156 
00157 private:
00158         std::list<Transform3d*> m_Transforms;
00159 
00171 GCU_PROP (std::string, HMName)
00183 GCU_PROP (std::string, HallName)
00195 GCU_PROP (unsigned, Id)
00200 GCU_RO_PROP (unsigned, CoordinateAlternative)
00201 };
00202 
00203 }
00204 
00205 #endif // GCU_SPACE_GROUP_H
00206