Commit 9aea4242 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added operator to get the priority of a node

parent 41d4f083
......@@ -78,6 +78,7 @@ public:
int Pop(float &priority, int location=0);
float Delete(int id);
float GetPriority(int id);
void Insert(float priority, int id);
int GetNumberOfItems() {return this->MaxId+1;};
......@@ -109,4 +110,19 @@ inline float vtkPriorityQueue::Delete(int id)
return priority;
};
// Description:
// 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.
inline float vtkPriorityQueue::GetPriority(int id)
{
int loc;
if ( id <= this->ItemLocation.GetMaxId() &&
(loc=this->ItemLocation.GetValue(id)) != -1 )
{
return this->Array[loc].priority;
}
return VTK_LARGE_FLOAT;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment