VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Properties
VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell > Class Template Reference

Hiearchical spatial cell which contains more sub nodes. More...

Inheritance diagram for VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >:

List of all members.

## Public Member Functions
virtual ISpatialIndex | GetSubNodeIndex (int index)
| Returns spatial index for subnode.
abstract ISpatialCell< TObject > | GetSubNode (int index)
| Returns subnode with specified integer index.
virtual ISpatialCell< TObject > | GetSubNode (ref ISpatialIndex index)
| Returns this or subnode with specified spatial index (unlike GetNode doesn't move up in hiearchy)
override int | GetObjectCount (ulong CollisionGroup=UInt64.MaxValue)
| Returns number of all objects in the node (and subnodes) with specified collision group.
override int | GetObjectCount (ref ISpatialIndex index, ulong CollisionGroup=UInt64.MaxValue)
| Returns number of all objects in the node (and subnodes) with specified collision group on speficied spatialindex.
override bool | RemoveObject (TObject obj)
| Removes objects from indexer (including subnodes)
override void | AddObject (TObject obj, bool force=false)
| Adds object to spatialindexer (to any subnode), should set it's data (cell and spatial index)
override void | AddObject (TObject obj, ref ISpatialIndex index, bool force=false)
| Adds object to spatial indexer on specified index (should move objects internal index to new index)
override ISpatialCell< TObject > | MoveObject (TObject obj, ref ISpatialIndex newindex)
| Moves object to new index.
## Properties
ISpatialCell< TObject > | Root`[get, set]`
| Root of the spatial indexer (owner of the spatial cell list / tree)
abstract int | SubNodeCount`[get]`
| Number of the subnodes in indexer for hiearchical indexing.
virtual int | TotalSubNodeCount`[get]`
| Total number of the subnodes in indexer for hiearchical indexing.

## Detailed Description

### template<TObject, TSubCell>
class VisiMath::Collisions::HierarchicalSpatialCell< TObject, TSubCell >

Hiearchical spatial cell which contains more sub nodes.

Type Constraints

  TObject | : | ISpatialyIndexable |

## Member Function Documentation

template<TObject , TSubCell >

override void VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.AddObject | ( | TObject | obj,
|  | bool | force = `false`
| ) |  | `[virtual]`

Adds object to spatialindexer (to any subnode), should set it's data (cell and spatial index)

Parameters:

  obj | Object to add
  force | If true, will place object directly in the node, won't search for better fit

Reimplemented from VisiMath.Collisions.SpatialCell< TObject >.

template<TObject , TSubCell >

override void VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.AddObject | ( | TObject | obj,
|  | ref ISpatialIndex | index,
|  | bool | force = `false`
| ) |  | `[virtual]`

Adds object to spatial indexer on specified index (should move objects internal index to new index)

Parameters:

  obj | object to add
  index | Index

Reimplemented from VisiMath.Collisions.SpatialCell< TObject >.

template<TObject , TSubCell >

override int VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.GetObjectCount | ( | ref ISpatialIndex | index,
|  | ulong | CollisionGroup = `UInt64.MaxValue`
| ) |  |

Returns number of all objects in the node (and subnodes) with specified collision group on speficied spatialindex.

Parameters:

  CollisionGroup | Collision group flags
  index | Spatial index to check

Returns:
  Number of object

template<TObject , TSubCell >

override int VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.GetObjectCount | ( | ulong | CollisionGroup = `UInt64.MaxValue` | ) |

Returns number of all objects in the node (and subnodes) with specified collision group.

Parameters:

  CollisionGroup | Collision group flags

Returns:
  Number of object

template<TObject , TSubCell >

abstract ISpatialCell<TObject> VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.GetSubNode | ( | int | index | ) | `[pure virtual]`

Returns subnode with specified integer index.

Parameters:

  index | index of the subnode (valid are 0 to SubNodeCount

Returns:
  Subnode

Implements VisiMath.Collisions.IHierarchicalSpatialCell< TObject >.

Implemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >.

template<TObject , TSubCell >

virtual ISpatialCell<TObject> VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.GetSubNode | ( | ref ISpatialIndex | index | ) | `[virtual]`

Returns this or subnode with specified spatial index (unlike GetNode doesn't move up in hiearchy)

Parameters:

  index | Spatial index

Returns:
  Subnode containg index or this

Implements VisiMath.Collisions.IHierarchicalSpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >.

template<TObject , TSubCell >

virtual ISpatialIndex VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.GetSubNodeIndex | ( | int | index | ) | `[virtual]`

Returns spatial index for subnode.

Parameters:

  index | index of the subnode (valid are 0 to SubNodeCount

Returns:
  Spatial index

Implements VisiMath.Collisions.IHierarchicalSpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >.

template<TObject , TSubCell >

override ISpatialCell<TObject> VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.MoveObject | ( | TObject | obj,
|  | ref ISpatialIndex | newindex
| ) |  | `[virtual]`

Moves object to new index.

Parameters:

  obj | Object to move
  newindex | New spatial index

Returns:
  New spatial portion where the object was moved

Reimplemented from VisiMath.Collisions.SpatialCell< TObject >.

template<TObject , TSubCell >

override bool VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.RemoveObject | ( | TObject | obj | ) | `[virtual]`

Removes objects from indexer (including subnodes)

Parameters:

  obj | Object to remove

Returns:
  True if object removed

Reimplemented from VisiMath.Collisions.SpatialCell< TObject >.

## Property Documentation

template<TObject , TSubCell >

ISpatialCell<TObject> VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.Root`[get, set]`

Root of the spatial indexer (owner of the spatial cell list / tree)

Implements VisiMath.Collisions.IHierarchicalSpatialCell< TObject >.

template<TObject , TSubCell >

abstract int VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.SubNodeCount`[get]`

Number of the subnodes in indexer for hiearchical indexing.

Implements VisiMath.Collisions.IHierarchicalSpatialCell< TObject >.

Reimplemented in VisiMath.Collisions.Grid2D< TObject, TGridCell >.

template<TObject , TSubCell >

virtual int VisiMath.Collisions.HierarchicalSpatialCell< TObject, TSubCell >.TotalSubNodeCount`[get]`

Total number of the subnodes in indexer for hiearchical indexing.

Implements VisiMath.Collisions.IHierarchicalSpatialCell< TObject >.

The documentation for this class was generated from the following file:

- SpatialCell.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events