Show / Hide Table of Contents

Class Octree<T>

Implements a cubic Octree.

Inheritance
System.Object
Octree<T>
OctreeChunkContainer<T>
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
System.IDisposable
Namespace: Eco.Shared.Voxel
Assembly: Eco.Shared.dll
Syntax
public class Octree<T> : Object, IEnumerable<T>, IEnumerable, IDisposable where T : class
Type Parameters
Name Description
T

The type of data to store in the tree.

Remarks

An octree implemented over cubes indexed by integer values. The tree will automatically grow to accommodate any added entries. Optionally thread-safe. Where ranges are used, they are interpreted as [min,max).

Constructors

Octree(Boolean)

Declaration
public Octree(bool threadSafe = false)
Parameters
Type Name Description
System.Boolean threadSafe

Properties

Count

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

Extents

Declaration
public WorldRange Extents { get; }
Property Value
Type Description
WorldRange

IsThreadSafe

Declaration
public bool IsThreadSafe { get; }
Property Value
Type Description
System.Boolean

Item[Vector3i]

Declaration
public T this[Vector3i pos] { get; set; }
Parameters
Type Name Description
Vector3i pos
Property Value
Type Description
T

Methods

AsArray()

Declaration
public T[] AsArray()
Returns
Type Description
T[]

Clear()

Declaration
public void Clear()

CollectAll(Queue<T>)

Declaration
public int CollectAll(Queue<T> buffer)
Parameters
Type Name Description
System.Collections.Generic.Queue<T> buffer
Returns
Type Description
System.Int32

CollectRange(WorldRange, Queue<T>)

Declaration
public int CollectRange(WorldRange range, Queue<T> buffer)
Parameters
Type Name Description
WorldRange range
System.Collections.Generic.Queue<T> buffer
Returns
Type Description
System.Int32

CollectRangeExclusiveOf(WorldRange, Queue<T>)

Declaration
public int CollectRangeExclusiveOf(WorldRange range, Queue<T> buffer)
Parameters
Type Name Description
WorldRange range
System.Collections.Generic.Queue<T> buffer
Returns
Type Description
System.Int32

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

GetEnumerator()

Declaration
public DisposableUtils.DisposableActionEnumerator<T> GetEnumerator()
Returns
Type Description
DisposableUtils.DisposableActionEnumerator<T>

GetRangeEnumerable(WorldRange)

Declaration
public DisposableUtils.DisposableActionEnumerable<T> GetRangeEnumerable(WorldRange range)
Parameters
Type Name Description
WorldRange range
Returns
Type Description
DisposableUtils.DisposableActionEnumerable<T>

GetRangeExclusiveOfEnumerable(WorldRange)

Declaration
public DisposableUtils.DisposableActionEnumerable<T> GetRangeExclusiveOfEnumerable(WorldRange range)
Parameters
Type Name Description
WorldRange range
Returns
Type Description
DisposableUtils.DisposableActionEnumerable<T>

Set(Vector3i, T)

Declaration
public void Set(Vector3i pos, T obj)
Parameters
Type Name Description
Vector3i pos
T obj

TryGetValue(Vector3i, out T)

Declaration
public bool TryGetValue(Vector3i pos, out T obj)
Parameters
Type Name Description
Vector3i pos
T obj
Returns
Type Description
System.Boolean

Implements

System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable
System.IDisposable

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾