C# Класс 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)).
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
CreateFace ( ) : int

Create a new face and put it in the pool.

ReallocateFacePool ( ) : void

Reallocate the face pool, including the AffectedFaceFlags

Описание методов

DepositConnector() публичный Метод

Store a face connector in the "embedded" linked list.
public DepositConnector ( FaceConnector connector ) : void
connector FaceConnector
Результат void

DepositDeferredFace() публичный Метод

Deposit the deferred face.
public DepositDeferredFace ( DeferredFace face ) : void
face DeferredFace
Результат void

DepositFace() публичный Метод

Return the face to the pool for later use.
public DepositFace ( int faceIndex ) : void
faceIndex int
Результат void

DepositVertexBuffer() публичный Метод

Deposit the index buffer.
public DepositVertexBuffer ( IndexBuffer buffer ) : void
buffer IndexBuffer
Результат void

GetConnector() публичный Метод

Get an unused face connector. If none is available, create it.
public GetConnector ( ) : FaceConnector
Результат FaceConnector

GetDeferredFace() публичный Метод

Get the deferred face.
public GetDeferredFace ( ) : DeferredFace
Результат DeferredFace

GetFace() публичный Метод

Return index of an unused face or creates a new one.
public GetFace ( ) : int
Результат int

GetVertexBuffer() публичный Метод

Get a store index buffer or create a new instance.
public GetVertexBuffer ( ) : IndexBuffer
Результат IndexBuffer

ObjectManager() публичный Метод

Create the manager.
public ObjectManager ( ConvexHullInternal hull ) : System
hull ConvexHullInternal
Результат System