Click or drag to resize

Bin2DT Class

A simple GC-friendly two-dimensional Bin (aka Spatial Grid) implementation. When you're done with the Bin, you should Dispose it so its resources can be freed in their object pool. If you forget this, no harm will be done but memory will be GC'ed.
Inheritance Hierarchy
SystemObject
  Archon.SwissArmyLib.PartitioningBin2DT

Namespace:  Archon.SwissArmyLib.Partitioning
Assembly:  Archon.SwissArmyLib (in Archon.SwissArmyLib.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Bin2D<T> : IDisposable
Request Example View Source

Type Parameters

T
The type of items this Bin will hold.

The Bin2DT type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyCellHeight
Gets the height of cells in the Bin.
Public propertyCellWidth
Gets the width of cells in the Bin.
Public propertyHeight
Gets the height (number of rows) of the Bin.
Public propertyItem
Gets an IEnumerableT for the items in the given cell.
Public propertyOrigin
The coordinate at which this bin's bottom left corner lies.
Public propertyWidth
Gets the width (number of columns) of the Bin.
Top
Methods
  NameDescription
Public methodClear
Removes all items from the Bin.
Public methodDispose
Frees (clears) used resources that can be recycled. Call this when you're done with the Bin.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodInsert
Inserts an item with the given bounds into the Bin.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove(T)
Goes through all cells and removes the specified item if they contain it. If you can you should use Remove(T, Rect) instead.
Public methodRemove(T, Rect)
Removes an item which was inserted with the given bounds from the Bin.
Public methodRetrieve
Gets all items in the Bin that could potentially intersect with the given bounds.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Removes and reinserts an item with new bounds, essentially moving it.
Top
See Also