14 #ifndef ESYS_LSMNEIGHBOURTABLE_H
15 #define ESYS_LSMNEIGHBOURTABLE_H
17 #include <Foundation/BoundingBox.h>
18 #include <Foundation/StlIterator.h>
19 #include <Geometry/Vec3L.h>
22 #include <boost/shared_array.hpp>
31 template <
class TmplParticle>
35 typedef TmplParticle Particle;
36 typedef std::vector<Particle *> ParticleVector;
46 double getGridSpacing()
const;
48 void resize(
const BoundingBox &bBox,
double gridSpacing);
50 const Vec3L &getDimensions()
const;
54 const Vec3 &getMinPt()
const;
61 int getScalarIndex(
int xIdx,
int yIdx,
int zIdx)
const;
63 int getScalarIndex(
const Vec3L &index)
const;
65 int getScalarIndex(
const Vec3 &pt)
const;
67 const Vec3L &getMinVecIndex()
const;
69 const Vec3L &getMaxVecIndex()
const;
73 ParticleVector getNeighbourVector(
const Vec3 &pt,
double radius)
const;
75 ParticleVector getUniqueNeighbourVector(
const Vec3 &pt,
double radius)
const;
77 ParticleVector getNeighbourVector(
const Vec3 &pt)
const;
79 void insert(Particle *pParticle);
81 void insert(Particle &particle);
92 void insertInTable(Particle *pParticle,
const Vec3L &minIdx,
const Vec3L &maxIdx);
94 void addInserted(Particle *pParticle);
96 int getNumCells()
const;
98 ParticleVector getInsertedParticles()
const;
100 void clearAndRecomputeGrid(
const BoundingBox &bBox,
double gridSpacing);
103 typedef boost::shared_array<ParticleVector> ParticleVectorArrayPtr;
108 double m_gridSpacing;
110 ParticleVector m_insertedParticles;
111 ParticleVectorArrayPtr m_tablePtr;
116 #include "Geometry/NeighbourTable.hpp"