SpatialTree

Implementation of QuadTree and OcTree, with loose bounds and without Loose octree requires from type T to have member pos and radius, it can be function or variable.

struct SpatialTree (
ubyte dimension
T
bool loose = false
ubyte maxLevel = 8
) {}

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

Point
alias Point = float[dimension]
Undocumented in source.
QuadAllocator
alias QuadAllocator = AllocatorList!((n) => ContiguousFreeList!(Mallocator, 0, unbounded)(4096, allocationSize), Mallocator)
Undocumented in source.
isLoose
alias isLoose = loose
Undocumented in source.

Functions

add
void add(Point pos, T data)

////////////////////// // Add functions ///// //////////////////////

addToQuad
void addToQuad(Point pos, T data, Node* quad, float halfSize, ubyte level)
Undocumented in source. Be warned that the author may not have intended to support it.
allocateQuads
void allocateQuads(Node* quad, int level)

////////////////////// / Helper functions /// //////////////////////

clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
initialize
void initialize()
Undocumented in source. Be warned that the author may not have intended to support it.
remove
void remove(Point posRemove, T data)
Undocumented in source. Be warned that the author may not have intended to support it.
updatePositions
void updatePositions()
Undocumented in source. Be warned that the author may not have intended to support it.
visitAll
int visitAll(int delegate(Point pos, Node* quad, float halfSize, int level) visitor)

////////////////////// / Visit functions //// //////////////////////

visitAll
int visitAll(int delegate(Point pos, Node* quad, float halfSize, int level) visitor, Point pos, Node* quad, float halfSize, int level)
Undocumented in source. Be warned that the author may not have intended to support it.
visitAllDataIn
void visitAllDataIn(void delegate(ref T data) visitor, Point downLeft, Point upRight)
Undocumented in source. Be warned that the author may not have intended to support it.
visitAllNodesIn
void visitAllNodesIn(int delegate(Point pos, Node* quad, float halfSize, int level) visitor, Point downLeft, Point upRight)
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

allocationSize
enum allocationSize;
Undocumented in source.
nodesNumInArray
enum nodesNumInArray;
Undocumented in source.

Static functions

circleInBox
bool circleInBox(Point left, Point right, Point pos, float radius)
Undocumented in source. Be warned that the author may not have intended to support it.
circleNotInBox
bool circleNotInBox(Point left, Point right, Point pos, float radius)
Undocumented in source. Be warned that the author may not have intended to support it.
directionToIndex
uint directionToIndex(bool[Point.length] dir)
Undocumented in source. Be warned that the author may not have intended to support it.
hasChildren
bool hasChildren(Node* node, int level)
Undocumented in source. Be warned that the author may not have intended to support it.
hasElements
bool hasElements(int level)
Undocumented in source. Be warned that the author may not have intended to support it.
inBox
bool inBox(Point left, Point right, Point myLeft, Point myRight)
Undocumented in source. Be warned that the author may not have intended to support it.
indexToDirection
bool[Point.length] indexToDirection(uint index)
Undocumented in source. Be warned that the author may not have intended to support it.
notInBox
bool notInBox(Point left, Point right, Point myLeft, Point myRight)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Node
struct Node
Undocumented in source.

Variables

allocator
QuadAllocator allocator;
Undocumented in source.
root
Node root;
Undocumented in source.
size
float size;
Undocumented in source.

Meta