[vtkusers] vtkPointLocator reinitialization/deletion problem

Mark Gooding mark.gooding at gmail.com
Wed Feb 14 06:36:57 EST 2007


Hi all,

I have written a function in which a vtkPointLocator is initialized and built.

if(ptlocator==NULL){ptlocator =
vtkPointLocator::New();}else{ptlocator->Initialize();}
ptlocator->SetDataSet(some vtkImageData);
ptlocator->BuildLocator();

ptlocator is a member variable of the class as the point locator is
used elsewhere in the class  to... find points!

The first time I call the function everything is happy: ptlocator
built, points found. However the second time I call the function I get
an exception as a result of   ptlocator->Initialize(). The exception
occurs within vtkPointLocator::FreeSearchStructure() when deleting the
HashTable elements. The same problem occurs if I try deleting
ptlocator.

Any thoughts as to where I'm going wrong?

Mark



More information about the vtkusers mailing list