[vtk-developers] hast table in VTK

Brad King brad.king at kitware.com
Mon Dec 13 10:51:46 EST 2004


Moreland, Kenneth wrote:
> There must be some miscommunication here, because the class I'm
> describing works exactly the same as the Hashtable class that has been
> distributed with Java since the language's creation.  The features I
> describe are not only possible, but often useful.

After discussing this with other developers at Kitware we have decided 
not to introduce such an API into the top of VTK.

> Here is a toy example.  Let's say I want to keep a collection (that is,
> a set, not a map) of faces in a mesh with some special property.  As I
> do some computation on the mesh, I want to quickly check to see if the
> face I'm working on is part of this set.  I should be able to do this by
> storing a bunch of objects in the hashtable (perhaps vtkPolygon objects)
> that identify the faces by their point ids.  As I do my computation, I
> could easily make two objects that describe the same face.  Therefore, I
> want two of these objects to be "equal" if they describe the same face
> even if they are in different locations in memory.

If you are storing cells in a hash table indexed by connectivity then 
vtkObject's are much too heavy to be fast for this purpose.  You'll want 
to use a customized hash-table with small hand-written structures 
storing the connectivity.

-Brad



More information about the vtk-developers mailing list