39 const unsigned int NULL_NODE = 0xffffffff;
71 AABB(
const std::vector<double>&,
const std::vector<double>&);
198 Tree(
unsigned int dimension_= 3,
double skinThickness_ = 0.05,
unsigned int nParticles = 16);
217 Tree(
unsigned int,
double,
const std::vector<bool>&,
const std::vector<double>&,
unsigned int nParticles = 16);
223 void setPeriodicity(
const std::vector<bool>&);
229 void setBoxSize(
const std::vector<double>&);
241 void insertParticle(
unsigned int, std::vector<double>&,
double);
253 void insertParticle(
unsigned int, std::vector<double>&, std::vector<double>&);
259 void removeParticle(
unsigned int);
274 bool updateParticle(
unsigned int, std::vector<double>&,
double);
287 bool updateParticle(
unsigned int, std::vector<double>&, std::vector<double>&);
296 std::vector<unsigned int> query(
unsigned int);
308 std::vector<unsigned int> query(
unsigned int,
const AABB&);
317 std::vector<unsigned int> query(
const AABB&);
323 const AABB& getAABB(
unsigned int);
329 unsigned int getHeight()
const;
335 unsigned int getNodeCount()
const;
342 unsigned int computeMaximumBalance()
const;
349 double computeSurfaceAreaRatio()
const;
352 void validate()
const;
362 std::vector<Node> nodes;
365 unsigned int nodeCount;
368 unsigned int nodeCapacity;
371 unsigned int freeList;
374 unsigned int dimension;
380 double skinThickness;
383 std::vector<bool> periodicity;
386 std::vector<double> boxSize;
389 std::vector<double> negMinImage;
392 std::vector<double> posMinImage;
395 std::map<unsigned int, unsigned int> particleMap;
401 unsigned int allocateNode();
407 void freeNode(
unsigned int);
413 void insertLeaf(
unsigned int);
419 void removeLeaf(
unsigned int);
425 unsigned int balance(
unsigned int);
431 unsigned int computeHeight()
const;
440 unsigned int computeHeight(
unsigned int)
const;
446 void validateStructure(
unsigned int)
const;
452 void validateMetrics(
unsigned int)
const;
458 void periodicBoundaries(std::vector<double>&);
470 bool minimumImage(std::vector<double>&, std::vector<double>&);
bool contains(const AABB &) const
Test whether the AABB is contained within this one.
Definition: AABB.cc:93
std::vector< double > computeCentre()
Compute the centre of the AABB.
Definition: AABB.cc:130
unsigned int parent
Index of the parent node.
Definition: AABB.h:152
std::vector< double > lowerBound
Lower bound of AABB in each dimension.
Definition: AABB.h:119
unsigned int right
Index of the right-hand child.
Definition: AABB.h:161
AABB()
Constructor.
Definition: AABB.cc:31
bool overlaps(const AABB &) const
Test whether the AABB overlaps this one.
Definition: AABB.cc:106
double computeSurfaceArea() const
Compute the surface area of the box.
Definition: AABB.cc:50
unsigned int left
Index of the left-hand child.
Definition: AABB.h:158
void merge(const AABB &, const AABB &)
Merge two AABBs into this one.
Definition: AABB.cc:75
A node of the AABB tree.
Definition: AABB.h:143
double getSurfaceArea() const
Get the surface area of the box.
Definition: AABB.cc:70
std::vector< double > upperBound
Upper bound of AABB in each dimension.
Definition: AABB.h:122
unsigned int particle
The index of the particle that the node contains (leaf nodes only).
Definition: AABB.h:167
std::vector< double > centre
The position of the AABB centre.
Definition: AABB.h:125
AABB aabb
The fattened axis-aligned bounding box.
Definition: AABB.h:149
int height
Height of the node. This is 0 for a leaf and -1 for a free node.
Definition: AABB.h:164
void setDimension(unsigned int)
Set the dimensionality of the AABB.
Definition: AABB.cc:140
double surfaceArea
The AABB's surface area.
Definition: AABB.h:128
The axis-aligned bounding box object.
Definition: AABB.h:52
The dynamic AABB tree.
Definition: AABB.h:184
unsigned int next
Index of the next node.
Definition: AABB.h:155