Section: Visualization Toolkit Common Classes
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.
To create an instance of class vtkPriorityQueue, simply invoke its constructor as follows
obj = vtkPriorityQueue
obj
is an instance of the vtkPriorityQueue class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkPriorityQueue = obj.NewInstance ()
vtkPriorityQueue = obj.SafeDownCast (vtkObject o)
obj.Allocate (vtkIdType sz, vtkIdType ext)
- Allocate initial space for priority queue.
obj.Insert (double priority, vtkIdType id)
- Insert id with priority specified. The id is generally an
index like a point id or cell id.
vtkIdType = obj.Pop (vtkIdType location)
- Same as above but simplified for easier wrapping into interpreted
languages.
vtkIdType = obj.Peek (vtkIdType location)
- Peek into the queue without actually removing anything. Returns the
id.
double = obj.DeleteId (vtkIdType id)
- Delete entry in queue with specified id. Returns priority value
associated with that id; or VTK_DOUBLE_MAX if not in queue.
double = obj.GetPriority (vtkIdType id)
- Get the priority of an entry in the queue with specified id. Returns
priority value of that id or VTK_DOUBLE_MAX if not in queue.
vtkIdType = obj.GetNumberOfItems ()
- Return the number of items in this queue.
obj.Reset ()
- Empty the queue but without releasing memory. This avoids the
overhead of memory allocation/deletion.