18 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
26 double cubicPackRadius
34 m_cubicPackRadius(cubicPackRadius),
35 m_particleGeneratorPtr(particleGeneratorPtr),
36 m_pParticleGenerator(particleGeneratorPtr.get())
40 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
45 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
49 return *m_pParticleGenerator;
52 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
56 return *m_pParticleGenerator;
59 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
65 m_pParticleGenerator = &particleGenerator;
69 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
75 m_particleGeneratorPtr = particleGeneratorPtr;
76 m_pParticleGenerator = m_particleGeneratorPtr.get();
79 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
83 return m_cubicPackRadius;
86 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
93 return getParticleGenerator().getParticle(point, radius);
96 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
102 return getParticleGenerator().getParticle(point);
105 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
112 getCandidateParticle(pointIt.
next(), getCubicPackingRadius());
113 if (this->particleFitsInBBoxWithNeighbours(candidate)) {
114 this->createAndInsertParticle(candidate);
119 template <
typename TmplParticleGenerator,
typename TmplBoxPackerBase>
123 generateCubicPacking();
Inherited::ParticlePoolPtr ParticlePoolPtr
Definition: CubicBoxPacker.h:39
bool hasNext() const
Definition: GridIterator.h:207
virtual void generate()
Definition: CubicBoxPacker.hpp:121
boost::shared_ptr< ParticleGenerator > ParticleGeneratorPtr
Definition: CubicBoxPacker.h:32
BoundingBox getBBox(const std::string &arg)
Definition: Main.cpp:24
Definition: CheckPointable.cpp:16
Inherited::Particle Particle
Definition: CubicBoxPacker.h:35
void setParticleGenerator(ParticleGenerator &particleGenerator)
Definition: CubicBoxPacker.hpp:61
TmplBoxPackerBase Inherited
Definition: CubicBoxPacker.h:33
double getCubicPackingRadius() const
Definition: CubicBoxPacker.hpp:81
3D bounding box
Definition: BoundingBox.h:27
TmplParticleGenerator ParticleGenerator
Definition: CubicBoxPacker.h:31
Inherited::NTablePtr NTablePtr
Definition: CubicBoxPacker.h:37
const ParticleGenerator & getParticleGenerator() const
Definition: CubicBoxPacker.hpp:47
std::vector< bool > BoolVector
Definition: BlockGenerator.h:28
virtual ~CubicBoxPacker()
Definition: CubicBoxPacker.hpp:41
CubicBoxPacker(ParticleGeneratorPtr particleGeneratorPtr, ParticlePoolPtr particlePoolPtr, NTablePtr nTablePtr, const BoundingBox &bBox, const BoolVector &periodicDimensions, double tolerance, double cubicPackRadius)
Definition: CubicBoxPacker.hpp:19
Vec3 next()
Definition: GridIterator.h:255
void generateCubicPacking()
Definition: CubicBoxPacker.hpp:107
Definition: GridIterator.h:28
Particle getCandidateParticle(const Vec3 &point)
Definition: CubicBoxPacker.hpp:98