Open Babel  3.0
transform3d.h
Go to the documentation of this file.
1 /**********************************************************************
2 transform3d.h - Handle 3D transformations in space groups.
3 
4 Copyright (C) 2007 by Jean Bréfort
5 
6 This file is part of the Open Babel project.
7 For more information, see <http://openbabel.org/>
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 ***********************************************************************/
19 
20 #ifndef OB_TRANSFORM_3D_H
21 #define OB_TRANSFORM_3D_H
22 
24 #include <list>
25 #include <string>
26 
27 namespace OpenBabel
28 {
29 
35  class OBAPI transform3d: private matrix3x3, private vector3
36  {
37  public:
39  {
40  }
41 
42  transform3d(const matrix3x3 &m, const vector3 &v): matrix3x3(m), vector3(v)
43  {
44  Normalize();
45  }
46 
47  transform3d(double s): matrix3x3(s), vector3()
48  {
49  }
50 
52  transform3d(vector3 row1,vector3 row2,vector3 row3,vector3 translation):
53  matrix3x3(row1, row2, row3), vector3(translation)
54  {
55  Normalize();
56  }
57 
59 
60  transform3d(double d[3][3], double t[3]): matrix3x3(d), vector3(t)
61  {
62  Normalize();
63  }
64 
65  vector3 operator *(const vector3 &) const;
66 
67  transform3d operator *(const transform3d &) const;
68 
69  std::string DescribeAsString() const;
70  std::string DescribeAsValues() const;
71 
72  void Normalize();
73  };
74 
75  typedef std::list<transform3d*>::const_iterator transform3dIterator;
76 
77 }
78 
79 #endif // OB_TRANSFORM_3D_H
80 
transform3d(double s)
Definition: transform3d.h:47
transform3d(void)
Definition: transform3d.h:38
transform3d(double d[3][3], double t[3])
Constructs a matrix from a 3x3-array of doubles.
Definition: transform3d.h:60
Handle 3D transformations, such as space group definitions.
Definition: transform3d.h:35
Represents a vector in 3-dimensional real space.
Definition: vector3.h:44
Represents a real 3x3 matrix.
Definition: matrix3x3.h:42
std::list< transform3d * >::const_iterator transform3dIterator
Definition: transform3d.h:75
transform3d(vector3 row1, vector3 row2, vector3 row3, vector3 translation)
Constructs a matrix from row vectors.
Definition: transform3d.h:52
transform3d(const matrix3x3 &m, const vector3 &v)
Definition: transform3d.h:42
vector3 operator*(const double &c, const vector3 &v)
Multiplication with a scalar.
Definition: vector3.h:330
Handle 3D Rotation matrix.
Global namespace for all Open Babel code.
Definition: alias.h:22