In vtkPoints.h, there is<br>virtual void Initialize();<br><br>In the implementation, the function looks like this:<br>void vtkPoints::Initialize()<br>{<br> this->Data->Initialize();<br>}<br><br>Again, in vtkPoints.h there is a member variable:<br>
vtkDataArray *Data;<br><br>I looked in vtkDataArray.h , but there is no Initialize() function. vtkDataArray is derived from vtkAbstractArray, so I looked at vtkAbstractArray.h. vtkAbstractArray.h has a pure virtual function Initialize(). So where is the Initialize() function that is getting called from vtkPoints?<br>
<br>The reason I started digging into this is the following:<br><br>I had a situation like this:<br><br>vtkPoints* MyPoints = vtkPoints::New();<br>for(i = 0; i < 1000; i++)<br>{<br> MyFunction(MyPoints);<br>}<br><br>MyPoints->Delete();<br>
----------<br><br>void MyFunction(vtkPoints* MyPoints)<br>{<br>MyPoints->Initialize();<br>//fill MyPoints with points<br>//do some nearest neighbor lookups using a KDTree<br>}<br><br>I was finding that after a few hundred iterations I was getting some bizarre results.<br>
<br>I changed the process to look like this:<br><br>
for(i = 0; i < 1000; i++)<br>
MyFunction();<br>
<br>------<br>
void MyFunction()<br>
{<br>vtkPoints* MyPoints = vtkPoints::New();<br><br>
//fill MyPoints with points<br>
//do some nearest neighbor lookups using a KDTree<br>MyPoints->Delete();<br>
}<br><br>and it works fine through the entire loop.<br><br>I thought these should be identical - am I missing something?<br><br clear="all">Thanks,<br><br>David<br>