CompressedQuadTreeNode class

A node in the compressed quadtree data structure

Constructors

CompressedQuadTreeNode(Rectangle boundary, [int depth = 0, CompressedPath? compressedPath])
Constructor with boundary, depth and optional compression path

Properties

boundary Rectangle
The spatial boundary covered by this node.
final
children Map<Quadrant, CompressedQuadTreeNode>
The mapping of child quadrants to their corresponding sub-nodes.
final
compressedPath CompressedPath?
The compressed path information, if this node is part of a compressed segment.
final
depth int
The depth level of this node in the quadtree.
final
hashCode int
The hash code for this object.
no setterinherited
hasOnlyOneChild bool
no setter
isCompressed bool
no setter
isLeaf bool
no setter
particles List<QuadTreeParticle>
The list of particles currently stored within this node.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clears all particles and children from this node
getAllParticles([List<QuadTreeParticle>? allParticles]) List<QuadTreeParticle>
Collects all particles in this subtree
getChildBoundary(Quadrant quadrant) Rectangle
Gets the boundary rectangle for a child quadrant
getStats() Map<String, dynamic>
Gathers statistics about the tree structure
insert(QuadTreeParticle particle) bool
Inserts a particle into the tree with path compression optimization Returns true if insertion was successful
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optimizeMemory() → void
Optimizes memory usage by removing empty leaf nodes
queryCircle(double centerX, double centerY, double radius, [List<QuadTreeParticle>? found]) List<QuadTreeParticle>
Queries particles within a circular area
queryRange(Rectangle range, [List<QuadTreeParticle>? found]) List<QuadTreeParticle>
Queries particles within a rectangular area
rebalance() → void
Rebalances the tree by rebuilding its structure
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

maxDepth → const int
maxParticles → const int
minParticlesForCompression → const int