ISpatialEntityTrait

Description

interface Tinman.Terrain.Util.ISpatialEntityTrait
<TEntity in val>
<TBounds val>

Type trait for structures that provide the semantic of spatial tree node entities.

Public / Methods

Bounds


[Pure]
public method Bounds → (1)

entity in : TEntity

The spatial entity.

returns → TBounds

The bounding box of entity in.

Computes the bounding box of the given entity.

Bounds​Intersect


[Pure]
public method BoundsIntersect → (2)

entity in : TEntity

The spatial entity.

bounds in : TBounds

The axis-aligned bounds.

returns → int32

-1 if entity in and bounds in are disjoint.
0 if entity in and bounds in intersect.
1 if bounds in fully contains entity in.
2 if entity in fully contains bounds in or if it would not be advantageous to distribute entity in any further down the spatial tree.

Checks if the given spatial entity intersects with the specified bounds.

This method is only called when a spatial entity is being added to the tree. Use Prepare to pre-compute coefficients.

Equals


[Pure]
public method Equals → (2)

in : TEntity

First entity.

in : TEntity

Second entity.

returns → bool

true if the entities are equal, false if not.

Checks if the given spatial entities are equal.

Two spatial entities are considered to be equal if BoundsIntersect returns the same value for both entities, given any bounds.

Opposite


[Pure]
public method Opposite → (2)

in : TEntity

First entity.

in : TEntity

Second entity.

returns → bool

true if the entities represent a shared spatial feature, false if not.

Checks if the given spatial entities represent a shared spatial feature, for example an edge that is shared by two polygons.

Prepare


public method Prepare → (1)

entity in : TEntity

The spatial entity.

returns → bool

true if entity in has been prepared for being added,
false if entity in cannot be added (for example, degenerated geometry).

The given spatial entity is about to be added to the spatial tree.