IMP  2.1.1
The Integrative Modeling Platform
standard_grids.h
Go to the documentation of this file.
1 /**
2  * \file IMP/algebra/standard_grids.h
3  * \brief A class to represent a voxel grid.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPALGEBRA_STANDARD_GRIDS_H
10 #define IMPALGEBRA_STANDARD_GRIDS_H
11 
12 #include <IMP/algebra/algebra_config.h>
13 #include "GridD.h"
14 #include "grid_ranges.h"
15 #include "grid_storages.h"
16 #include "grid_embeddings.h"
17 IMPALGEBRA_BEGIN_NAMESPACE
18 
19 // They are created with %template in swig to get around inclusion order issues
20 #ifndef SWIG
21 
22 /** A sparse, infinite grid of values. In python SparseUnboundedIntGrid3D
23  is provided.*/
24 template <int D, class VT>
26  : public GridD<D, SparseGridStorageD<D, VT, UnboundedGridRangeD<D> >, VT,
27  DefaultEmbeddingD<D> > {
30  SparseUnboundedGridD(double side, const VectorD<D> &origin, VT def = VT())
31  : P(side, origin, def) {}
33  SparseUnboundedGridD(double side, unsigned int d, const VT &def = VT())
34  : P(side, d, def) {}
35 };
36 
37 /** A dense grid of values. In python DenseFloatGrid3D and DenseDoubleGrid3D are
38  provided. See IMP_GRID3D_FOREACH_VOXEL() for a useful macro when operating
39  on all voxels of the grid.
40 */
41 template <class VT>
43  : public GridD<3, DenseGridStorageD<3, VT>, VT, DefaultEmbeddingD<3> > {
45  DenseGrid3D(double side, const BoundingBoxD<3> &bb, VT def = VT())
46  : P(side, bb, def) {}
47  DenseGrid3D(int xd, int yd, int zd, const BoundingBoxD<3> &bb, VT def = VT())
48  : P(xd, yd, zd, bb, def) {}
49  DenseGrid3D() {}
50 };
51 
52 /** A sparse grid of values. In python SparseIntGrid3D is provided.*/
53 template <class VT>
55  : public GridD<3, SparseGridStorageD<3, VT, BoundedGridRangeD<3> >, VT,
56  DefaultEmbeddingD<3> > {
59  SparseGrid3D(double side, const BoundingBoxD<3> &bb, VT def = VT())
60  : P(side, bb, def) {}
61  SparseGrid3D(int xd, int yd, int zd, const BoundingBoxD<3> &bb, VT def = VT())
62  : P(xd, yd, zd, bb, def) {}
63  SparseGrid3D() {}
64 };
65 
66 /** A sparse, infinite grid of values. In python SparseUnboundedIntGrid3D
67  is provided.*/
68 template <class VT>
70  : public GridD<3, SparseGridStorageD<3, VT, UnboundedGridRangeD<3> >, VT,
71  DefaultEmbeddingD<3> > {
74  SparseUnboundedGrid3D(double side, const Vector3D &origin, VT def = VT())
75  : P(side, origin, def) {}
77 };
78 
79 #endif
80 
81 IMPALGEBRA_END_NAMESPACE
82 
83 #endif /* IMPALGEBRA_STANDARD_GRIDS_H */
A class to represent a voxel grid.
A class to represent a voxel grid.
A voxel grid in d-dimensional space space.
Definition: GridD.h:78
A Cartesian vector in D-dimensions.
Definition: VectorD.h:48
A class to represent a voxel grid.
A class to represent a voxel grid.