The Gnome Chemistry Utils  0.14.0
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-2012 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 3 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 friend class SpaceGroupPrivate;
44 public:
48  SpaceGroup();
52  ~SpaceGroup();
53 
61  void AddTransform(const std::string &s);
62 
70  std::list<Vector> Transform (Vector const &v) const;
71 
78  Transform3d const *GetFirstTransform (std::list <Transform3d*>::const_iterator &i) const;
84  Transform3d const *GetNextTransform (std::list <Transform3d*>::const_iterator &i) const;
85 
86  // static methods
87  /* The name might be either a HM or Hall name */
96  static SpaceGroup const *GetSpaceGroup (char const *name);
105  static SpaceGroup const *GetSpaceGroup (std::string const &name);
111  static SpaceGroup const *GetSpaceGroup (unsigned id);
117  static std::list <SpaceGroup const *> &GetSpaceGroups (unsigned id);
123  static SpaceGroup const *Find (SpaceGroup* group);
131  void RegisterSpaceGroup (int nb = 0, ...);
132 
140  bool operator ==(const SpaceGroup &group) const;
147  int operator!=(const SpaceGroup &group) const {return !((*this) == group);}
151  bool IsValid() const;
155  unsigned GetTransformsNumber () const {return m_Transforms.size ();}
156 
157 private:
158  std::list<Transform3d*> m_Transforms;
159 
171 GCU_PROP (std::string, HMName)
183 GCU_PROP (std::string, HallName)
195 GCU_PROP (unsigned, Id)
200 GCU_RO_PROP (unsigned, CoordinateAlternative)
201 };
202 
203 }
204 
205 #endif // GCU_SPACE_GROUP_H
206