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-2010 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:
00047         SpaceGroup();
00051         ~SpaceGroup();
00052 
00060         void AddTransform(const std::string &s);
00061 
00069         std::list<Vector> Transform (Vector const &v) const;
00070 
00077         Transform3d const *GetFirstTransform (std::list <Transform3d*>::const_iterator &i) const;
00083         Transform3d const *GetNextTransform (std::list <Transform3d*>::const_iterator &i) const;
00084 
00085         // static methods
00086         /* The name might be either a HM or Hall name */
00095         static SpaceGroup const *GetSpaceGroup (char const *name);
00104         static SpaceGroup const *GetSpaceGroup (std::string const &name);
00110         static SpaceGroup const *GetSpaceGroup (unsigned id);
00116         static std::list <SpaceGroup const *> &GetSpaceGroups (unsigned id);
00122         static SpaceGroup const *Find (SpaceGroup* group);
00130         void RegisterSpaceGroup (int nb = 0, ...);
00131 
00139         bool operator ==(const SpaceGroup &group) const;
00146         int operator!=(const SpaceGroup &group) const {return !((*this) == group);}
00150         bool IsValid() const;
00154         unsigned GetTransformsNumber () const {return m_Transforms.size ();}
00155 
00156 private:
00157         std::list<Transform3d*> m_Transforms;
00158 
00170 GCU_PROP (std::string, HMName)
00182 GCU_PROP (std::string, HallName)
00194 GCU_PROP (unsigned, Id)
00195 };
00196 
00197 }
00198 
00199 #endif // GCU_SPACE_GROUP_H
00200 

Generated on Fri Sep 24 15:58:42 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9