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-2008 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 2 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 public:
00044         SpaceGroup();
00045         ~SpaceGroup();
00046 
00047         void AddTransform(const std::string &s);
00048 
00049         std::list<Vector> Transform (Vector const &v) const;
00050 
00051         Transform3d const *GetFirstTransform (std::list <Transform3d*>::const_iterator &i) const;
00052         Transform3d const *GetNextTransform (std::list <Transform3d*>::const_iterator &i) const;
00053 
00054         // static methods
00055         /* The name might be either a HM or Hall name */
00056         static SpaceGroup const *GetSpaceGroup (char const *name);
00057         static SpaceGroup const *GetSpaceGroup (std::string const &name);
00058         static SpaceGroup const *GetSpaceGroup (unsigned id);
00059         static std::list <SpaceGroup const *> &GetSpaceGroups (unsigned id);
00060         static SpaceGroup const *Find (SpaceGroup* group);
00061         /* Use it if the space group is unknown (might happen if no database has
00062         been loaded or if the HM name is not usual. */
00063         void RegisterSpaceGroup (int nb = 0, ...);
00064 
00065         bool operator ==(const SpaceGroup &) const;
00066         int operator!=(const SpaceGroup &other) const
00067         {
00068         return !((*this) == other);
00069         }
00070         bool IsValid() const;
00071         unsigned GetTransformsNumber () const {return m_Transforms.size ();}
00072 
00073 private:
00074         std::list<Transform3d*> m_Transforms;
00075 
00076 GCU_PROP (std::string, HMName)
00077 GCU_PROP (std::string, HallName)
00078 GCU_PROP (unsigned, Id)
00079 };
00080 
00081 }
00082 
00083 #endif // GCU_SPACE_GROUP_H
00084 
Generated by  doxygen 1.6.2-20100208