9#ifndef IMPALGEBRA_STANDARD_GRIDS_H
10#define IMPALGEBRA_STANDARD_GRIDS_H
12#include <IMP/algebra/algebra_config.h>
17IMPALGEBRA_BEGIN_NAMESPACE
21#define IMP_ALGEBRA_SWIG_GRID_METHODS(D, Q) \
22 GridIndexD<D> add_voxel(const ExtendedGridIndexD<D> &i, const Q &q); \
23 Q __getitem__(const GridIndexD<D> i) const; \
24 void __setitem__(const GridIndexD<D> &i, const Q &q); \
25 Q __getitem__(const VectorD<D> i) const; \
26 void __setitem__(const VectorD<D> &i, const Q &q); \
27 BoundingBoxD<D> get_bounding_box(ExtendedGridIndexD<D> v) const; \
28 BoundingBoxD<D> get_bounding_box() const
31#define IMP_ALGEBRA_SWIG_GRID_METHODS(D, VT)
36template <
int D,
class VT>
37struct SparseUnboundedGridD
38 :
public GridD<D, SparseGridStorageD<D, VT, UnboundedGridRangeD<D>>, VT,
39 DefaultEmbeddingD<D>> {
42 SparseUnboundedGridD(
double side,
const VectorD<D> &origin, VT def = VT())
43 : P(side, origin, def) {}
44 SparseUnboundedGridD() {}
45 IMP_ALGEBRA_SWIG_GRID_METHODS(D, VT);
55 :
public GridD<3, DenseGridStorageD<3, VT>, VT, DefaultEmbeddingD<3>> {
60 IMP_ALGEBRA_SWIG_GRID_METHODS(3, VT);
63template <
int D,
class VT>
65 :
public GridD<D, DenseGridStorageD<D, VT>, VT, DefaultEmbeddingD<D>> {
69 DenseGridD(
const VectorD<D> &sides,
const BoundingBoxD<D> &bb, VT def = VT())
70 : P(sides, bb, def) {}
72 IMP_ALGEBRA_SWIG_GRID_METHODS(D, VT);
79 :
public GridD<3, SparseGridStorageD<3, VT, BoundedGridRangeD<3>>, VT,
80 DefaultEmbeddingD<3>> {
85 SparseGrid3D(
int xd,
int yd,
int zd,
const BoundingBoxD<3> &bb, VT def = VT())
86 : P(xd, yd, zd, bb, def) {}
88 IMP_ALGEBRA_SWIG_GRID_METHODS(3, VT);
94struct SparseUnboundedGrid3D
95 :
public GridD<3, SparseGridStorageD<3, VT, UnboundedGridRangeD<3>>, VT,
96 DefaultEmbeddingD<3>> {
99 SparseUnboundedGrid3D(
double side,
const Vector3D &origin, VT def = VT())
100 : P(side, origin, def) {}
101 SparseUnboundedGrid3D(
const Vector3D &sides,
const Vector3D &origin, VT def = VT())
102 : P(sides, origin, def) {}
103 SparseUnboundedGrid3D() {}
104 IMP_ALGEBRA_SWIG_GRID_METHODS(3, VT);
108struct DenseFloatLogGridKD :
public GridD<-1, DenseGridStorageD<-1, float>,
109 float, LogEmbeddingD<-1>> {
112 IMP_ALGEBRA_SWIG_GRID_METHODS(-1,
float);
116struct DenseIntLogGrid3D
117 :
public GridD<3, DenseGridStorageD<3, int>, int, LogEmbeddingD<3>> {
120 IMP_ALGEBRA_SWIG_GRID_METHODS(3,
int);
123IMPALGEBRA_END_NAMESPACE
A class to represent a voxel grid.
A Cartesian vector in D-dimensions.
An axis-aligned bounding box.
Embed a grid as an evenly spaced axis aligned grid.
A voxel grid in d-dimensional space.
GridD(const Ints counts, const BoundingBoxD< D > &bb, VT default_value=VT())
Embeddings that map grid indexes to points in space.
A class to represent a voxel grid.
Dense and sparse storage of the voxel data in a grid.
IMP::Vector< Int > Ints
Standard way to pass a bunch of Int values.