C# Class MIConvexHull.ObjectManager

A helper class for object allocation/storage. This helps the GC a lot as it prevents the creation of about 75% of new face objects (in the case of ConvexFaceInternal). In the case of FaceConnectors and DefferedFaces, the difference is even higher (in most cases O(1) vs O(number of created faces)).
Afficher le fichier Open project: gusmanb/MIConvexHull Class Usage Examples

Méthodes publiques

Méthode Description
DepositConnector ( FaceConnector connector ) : void

Store a face connector in the "embedded" linked list.

DepositDeferredFace ( DeferredFace face ) : void

Deposit the deferred face.

DepositFace ( int faceIndex ) : void

Return the face to the pool for later use.

DepositVertexBuffer ( IndexBuffer buffer ) : void

Deposit the index buffer.

GetConnector ( ) : FaceConnector

Get an unused face connector. If none is available, create it.

GetDeferredFace ( ) : DeferredFace

Get the deferred face.

GetFace ( ) : int

Return index of an unused face or creates a new one.

GetVertexBuffer ( ) : IndexBuffer

Get a store index buffer or create a new instance.

ObjectManager ( ConvexHullInternal hull ) : System

Create the manager.

Private Methods

Méthode Description
CreateFace ( ) : int

Create a new face and put it in the pool.

ReallocateFacePool ( ) : void

Reallocate the face pool, including the AffectedFaceFlags

Method Details

DepositConnector() public méthode

Store a face connector in the "embedded" linked list.
public DepositConnector ( FaceConnector connector ) : void
connector FaceConnector
Résultat void

DepositDeferredFace() public méthode

Deposit the deferred face.
public DepositDeferredFace ( DeferredFace face ) : void
face DeferredFace
Résultat void

DepositFace() public méthode

Return the face to the pool for later use.
public DepositFace ( int faceIndex ) : void
faceIndex int
Résultat void

DepositVertexBuffer() public méthode

Deposit the index buffer.
public DepositVertexBuffer ( IndexBuffer buffer ) : void
buffer IndexBuffer
Résultat void

GetConnector() public méthode

Get an unused face connector. If none is available, create it.
public GetConnector ( ) : FaceConnector
Résultat FaceConnector

GetDeferredFace() public méthode

Get the deferred face.
public GetDeferredFace ( ) : DeferredFace
Résultat DeferredFace

GetFace() public méthode

Return index of an unused face or creates a new one.
public GetFace ( ) : int
Résultat int

GetVertexBuffer() public méthode

Get a store index buffer or create a new instance.
public GetVertexBuffer ( ) : IndexBuffer
Résultat IndexBuffer

ObjectManager() public méthode

Create the manager.
public ObjectManager ( ConvexHullInternal hull ) : System
hull ConvexHullInternal
Résultat System