Class OctreeD<P>
Tree data structure in which each internal node has up to eight children. Octrees are most often used to partition a three-dimensional space by recursively subdividing it into eight octants.
Inheritance
Inherited Members
Namespace: Fusee.Structures
Assembly: Fusee.Structures.dll
Syntax
public abstract class OctreeD<P>
Type Parameters
Name | Description |
---|---|
P | The type of an octants payload. |
Fields
MaxLevel
The maximum level this octree has - corresponds to the maximum number of subdivisions of an Octant. Can be used as subdivision termination condition or be set in the method SubdivTerminationCondition(OctantD<P>).
Declaration
public int MaxLevel
Field Value
Type | Description |
---|---|
System.Int32 |
Root
The root Octant of this Octree.
Declaration
public OctantD<P> Root
Field Value
Type | Description |
---|---|
OctantD<P> |
Methods
GetChildPosition(OctantD<P>, P)
Needed for subdivision - method that provides functionality to determine and return the index (position) of the child a payload item will fall into.
Declaration
protected abstract int GetChildPosition(OctantD<P> octant, P payloadItem)
Parameters
Type | Name | Description |
---|---|---|
OctantD<P> | octant | The octant to subdivide. |
P | payloadItem | The payload item for which the child index is determined. |
Returns
Type | Description |
---|---|
System.Int32 |
HandlePayload(OctantD<P>, OctantD<P>, P)
Needed for subdivision - method that determines what happens to a payload item after the generation of an octants children.
Declaration
protected abstract void HandlePayload(OctantD<P> parent, OctantD<P> child, P payloadItem)
Parameters
Type | Name | Description |
---|---|---|
OctantD<P> | parent | The parent octant. |
OctantD<P> | child | The child octant a payload item falls into. |
P | payloadItem | The payload item. |
Subdivide(OctantD<P>)
Subdivision creates the children of an Octant. Here the payload of an Octant will be iterated and for each item it is determined in which child it will fall. If there isn't a child already it will be created.
Declaration
public virtual void Subdivide(OctantD<P> octant)
Parameters
Type | Name | Description |
---|---|---|
OctantD<P> | octant | The Octant to subdivide. |
SubdivTerminationCondition(OctantD<P>)
Needed for subdivision - Method that returns a condition that terminates the subdivision.
Declaration
protected abstract bool SubdivTerminationCondition(OctantD<P> octant)
Parameters
Type | Name | Description |
---|---|---|
OctantD<P> | octant | The octant to subdivide. |
Returns
Type | Description |
---|---|
System.Boolean |
Traverse(OctantD<P>, Action<OctantD<P>>)
Start traversing (breadth first) from a given node.
Declaration
public void Traverse(OctantD<P> node, Action<OctantD<P>> callback)
Parameters
Type | Name | Description |
---|---|---|
OctantD<P> | node | |
System.Action<OctantD<P>> | callback |
Traverse(Action<OctantD<P>>)
Start traversing (breadth first) from the root node.
Declaration
public void Traverse(Action<OctantD<P>> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Action<OctantD<P>> | callback |