Documentation for vtkPriorityQueue

vtkPriorityQueue - an list of ids arranged in priority order

Super Class: vtkObject

Description:

vtkPriorityQueue is a general object for creating and manipulating lists of object ids (e.g., point or cell ids). Object ids are sorted acccording to a user-specified priority, where entries at the top of the queue have the smallest values. This implementation provides a feature beyond the usual ability to insert and retrieve (or pop) values from the queue. It is also possible to pop any item in the queue given its id number. This allows you to delete entries in the queue which can useful for reinserting an item into the queue.

 

Caveats:

This implementation is a variation of the priority queue described in "Data Structures & Algorithms" by Aho, Hopcroft, Ullman. It creates a balanced, partially ordered binary tree implemented as an ordered array. This avoids the overhead associated with parent/child pointers, and frequent memory allocation and deallocation.

 

Methods:

void vtkPriorityQueue ()
void vtkPriorityQueue (const int ,const int )
void vtkPriorityQueue ()
static vtkPriorityQueue *New ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
int Pop (float & ,int )
float DeleteId (int )
float GetPriority (int )
void Insert (float ,int )
int GetNumberOfItems ()
void Reset ()
vtkPriorityItem *Resize (const int )

 

Detailed Method Descriptions:

Instantiate priority queue with default size and extension size of 1000.

void vtkPriorityQueue ()

Instantiate priority queue with specified size and amount to extend queue (if reallocation required).

void vtkPriorityQueue (const int ,const int )

Removes item at specified location from tree; then reorders and balances tree. The location == 0 is the root of the tree.

int Pop (float & ,int )

Delete entry in queue with specified id. Returns priority value associated with that id; or VTK_LARGE_FLOAT if not in queue.

float DeleteId (int )

Get the priority of an entry in the queue with specified id. Returns priority value of that id or VTK_LARGE_FLOAT if not in queue.

float GetPriority (int )

Insert id with priority specified.

void Insert (float ,int )

Return the number of items in this queue.

int GetNumberOfItems ()

Reset all of the entries in the queue so they don not have a priority

void Reset ()