Open Babel  3.0
griddata.h
Go to the documentation of this file.
1 /**********************************************************************
2 griddata.h - Store grids of data linked to a molecule (e.g. Gaussian cube)
3 
4 // Molekel - Molecular Visualization Program
5 // Copyright (C) 2006, 2007 Swiss National Supercomputing Centre (CSCS)
6 
7 Some Portions Copyright (C) 2008 by Marcus D. Hanwell
8 
9 This file is part of the Open Babel project.
10 For more information, see <http://openbabel.org/>
11 
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation version 2 of the License.
15 
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20 ***********************************************************************/
21 
22 #ifndef OB_GRIDDATA_H
23 #define OB_GRIDDATA_H
24 
25 #include <openbabel/babelconfig.h>
26 #include <openbabel/math/vector3.h>
27 #include <openbabel/generic.h>
28 
29 #include <vector>
30 
31 namespace OpenBabel {
32 
33  // Uses private data pointer for ABI compatibility
34  // http://techbase.kde.org/Policies/Library_Code_Policy#D-Pointers
35  class GridDataPrivate;
36 
37  // Class to store values for generic (non axis aligned) grids like Gaussian cube files
38  // Class introduction in griddata.cpp
39  class OBAPI OBGridData : public OBGenericData
40  {
41  public:
43  OBGridData();
44 
46  ~OBGridData();
47 
49  typedef enum { BOHR, ANGSTROM, OTHER } Unit;
50 
52 
53  void GetAxes(double x[3], double y[3], double z[3]) const;
58  vector3 GetXAxis() const;
60  vector3 GetYAxis() const;
62  vector3 GetZAxis() const;
64  void GetAxes(vector3 &v1, vector3 &v2, vector3 &v3) const;
66  void GetNumberOfPoints(int &nx, int &ny, int &nz) const;
68  int GetNumberOfPoints() const;
70  void GetNumberOfSteps(int steps[3]) const;
72  std::vector< double > GetValues() const;
74  double GetValue(int i, int j, int k) const;
76  double GetValue (vector3 pos) const;
78  Unit GetUnit() const;
80  double GetMinValue() const;
82  double GetMaxValue() const;
84  vector3 GetOriginVector() const;
88  void GetOriginVector(double o[3]) const;
90  vector3 GetMaxVector() const;
92  bool GetUnrestricted() const;
94  int GetNumSymmetries() const;
96 
97 
99 
100  void SetNumberOfPoints(int nx, int ny, int nz);
106  void SetLimits(const vector3 &origin, const vector3 &x, const vector3 &y,
107  const vector3 &z);
110  void SetLimits(const double origin[3], const double x[3], const double y[3],
111  const double z[3]);
113  bool SetValue(int i, int j, int k, double val);
115  void SetValues(const std::vector< double >& v);
117  void SetUnit(Unit u);
119  void SetUnrestricted(bool u);
121  void SetNumSymmetries(int s);
123 
124  private:
125  GridDataPrivate *const d;
126 
127  };
128 
129 } // end namespace
130 
131 #endif /*OBGRIDDATA_H_*/
132 
Handle 3D coordinates.
Base class for generic data.
Definition: base.h:188
Unit
Unit of measure for grid spacings.
Definition: griddata.h:49
Represents a vector in 3-dimensional real space.
Definition: vector3.h:44
Handle generic data classes. Custom data for atoms, bonds, etc.
Store values for numeric grids such as orbitals or electrostatic potential.
Definition: griddata.h:39
Global namespace for all Open Babel code.
Definition: alias.h:22