SpatialTree_Base

Description

abstract class Tinman.Terrain.Util.SpatialTree_Base

Extended by

SpatialTree_Bounds abstract

A generic tree data structure for storing spatial entities.

This abstract base class provides those members that do not depend on any type parameter.

Public / Attributes

Entity​Count


public attribute EntityCount → (get)

value : int32

[>=0]
The number of spatial entities in the tree.

Returns the number of spatial entities that are present in the tree nodes.

The entity count may be higher than the number of entities that have been added to the tree, because the same spatial entity may be present in multiple tree nodes.

Node​Count


public attribute NodeCount → (get)

value : int32

[>=1]
The number of spatial tree nodes.

Returns the number of spatial tree nodes.

Protected / Constructors

Spatial​Tree_​Base


protected constructor SpatialTree_Base → (1)

childCount in : int32

The tree child count.

Creates a new instance of SpatialTree_Base.

Protected / Methods

Entity​Count​Fixed


[Pure]
protected method EntityCountFixed → (1)

node in : int32

The tree node.

returns → int32

The number of contained fixed spatial entities.

Counts the number of fixed spatial entities in the given node in.

Entity​Opposite

2 overloads


[Pure]
protected method EntityOpposite1 → (1)

in : int32

The spatial entity slot.

returns → bool

true if the entity represents a shared spatial feature, false if not.

Does the given spatial entity represent a shared spatial feature, for example an edge that is shared by two polygons?


protected method EntityOpposite2 → (2)

in : int32

The spatial entity slot.

value in : bool

The opposite state to set.

Sets the opposite state of the given entity (see EntityOpposite1).

Node​Entities


[Pure]
protected method NodeEntities → (1)

node in : int32

The tree node.

returns → int32

The number of spatial entities.

Returns the number of spatial entities in the given node.

Protected / Attributes

child​Shift


protected readonly attribute childShift → (int32)

Logarithm of base two of child count.

entity​Capacity


protected attribute entityCapacity → (int32)

Current capacity of spatial entity slot storage.

entity​Count


protected attribute entityCount → (int32)

Number of used spatial entity slots.

entity​Free


protected attribute entityFree → (int32)

First free spatial entity slot.

entity​Next


protected attribute entityNext → (int32 [ ])

Next spatial entity slot.

node​Capacity


protected attribute nodeCapacity → (int32)

Current capacity of tree node slot storage.

node​Children


protected attribute nodeChildren → (int32 [ ])

Child pointers per tree node.

This array is indexed as follows:

nodeChildren[idx * childCount + n] := n-th child

where idx is the tree node index and n is the child node ordinal.

node​Count


protected attribute nodeCount → (int32)

Number of used tree node slots.

node​Fill


protected attribute nodeFill → (int8 [ ])

Number of spatial entities per tree node.

If n=nodeFill[idx] is less than zero, the tree node idx has already been split and its spatial entities have been distributed among its descendants.

If n=nodeFill[idx] is greater than or equal to zero, the tree node is a leaf and n is the number of its spatial entities. The maximum value for n is nodeFillMax.

node​Fill​Max


protected readonly attribute nodeFillMax → (int32)

Maximum number of non-fixed entities per node (always a power of two, minus one).

node​First


protected attribute nodeFirst → (int32 [ ])

First spatial entity per tree node.

If a tree node idx has no spatial entities, nodeFirst[idx] will be -1. If nodeFirst[idx] is greater than or equal to zero, the node is a leaf.

node​Fixed


protected attribute nodeFixed → (int32 [ ])

First fixed spatial entity per tree node.

If a tree node idx has no fixed spatial entities, nodeFixed[idx] will be -1. Leaf node may have fixed spatial entities only if they are at the maximum allowed tree level.

node​Parent


protected attribute nodeParent → (int32 [ ])

Parent pointers per tree node.

This array is indexed as follows:

nodeParent[idx] := parent

where idx is the tree node index.

opposite


protected attribute opposite → (bool [ ])

Does the spatial entity represent both sides of a spatial feature?