The Gnome Chemistry Utils  0.12.11
spacegroup.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  * Gnome Chemistry Utils
5  * spacegroup.h - Handle Crystallographic Space Groups.
6  *
7  * Copyright (C) 2007-2010 by Jean Bréfort
8  *
9  * This file was originally part of the Open Babel project.
10  * For more information, see <http://openbabel.sourceforge.net/>
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License as
14  * published by the Free Software Foundation; either version 2 of the
15  * License, or (at your option) any later version.
16 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  */
22 
23 #ifndef GCU_SPACE_GROUP_H
24 #define GCU_SPACE_GROUP_H
25 
26 #include "macros.h"
27 #include <string>
28 #include <list>
29 
30 namespace gcu
31 {
32 
33 class Transform3d;
34 class Vector;
35 
42 {
43 public:
47  SpaceGroup();
51  ~SpaceGroup();
52 
60  void AddTransform(const std::string &s);
61 
69  std::list<Vector> Transform (Vector const &v) const;
70 
77  Transform3d const *GetFirstTransform (std::list <Transform3d*>::const_iterator &i) const;
83  Transform3d const *GetNextTransform (std::list <Transform3d*>::const_iterator &i) const;
84 
85  // static methods
86  /* The name might be either a HM or Hall name */
95  static SpaceGroup const *GetSpaceGroup (char const *name);
104  static SpaceGroup const *GetSpaceGroup (std::string const &name);
110  static SpaceGroup const *GetSpaceGroup (unsigned id);
116  static std::list <SpaceGroup const *> &GetSpaceGroups (unsigned id);
122  static SpaceGroup const *Find (SpaceGroup* group);
130  void RegisterSpaceGroup (int nb = 0, ...);
131 
139  bool operator ==(const SpaceGroup &group) const;
146  int operator!=(const SpaceGroup &group) const {return !((*this) == group);}
150  bool IsValid() const;
154  unsigned GetTransformsNumber () const {return m_Transforms.size ();}
155 
156 private:
157  std::list<Transform3d*> m_Transforms;
158 
170 GCU_PROP (std::string, HMName)
182 GCU_PROP (std::string, HallName)
194 GCU_PROP (unsigned, Id)
195 };
196 
197 }
198 
199 #endif // GCU_SPACE_GROUP_H
200