<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
for some reason, "/" symbols appeared around code inserts in my last
mail.<br>
nothing is commented out in my code.<br>
<br>
Le 25/02/2011 00:37, Remi Blanc a écrit :
<blockquote cite="mid:4D66EBA9.4030007@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi all,<br>
<br>
I have problems using vtkPointLocator in insertion mode.<br>
Initially, I was using succesfully a code looking like:<br>
<br>
<i>vtkSmartPointer<vtkPointLocator> pointLocator =
vtkSmartPointer<vtkPointLocator>::New();<br>
pointLocator->SetDataSet( myVTKPolyData );<br>
pointLocator->Update(); pointLocator->BuildLocator();<br>
</i><br>
and my program was working perfectly well (the aim is to implement
a variant of the Iterative Closest Points, and namely to identify
correspondences between two vtkPolyData)<br>
Now, I need to exclude some parts of the mesh from the
pointLocator, and looked at the ->InsertNextPoint( ) method.<br>
My code now looks like:<br>
<br>
<i>vtkSmartPointer<vtkPointLocator> pointLocator =
vtkSmartPointer<vtkPointLocator>::New();<br>
vtkSmartPointer<vtkPoints> tmpPts =
vtkSmartPointer<vtkPoints>::New();<br>
</i><i>pointLocator->InitPointInsertion(tmpPts, bounds);<br>
for (int i=0 ; i<listPts.size() ; i++) {<br>
pointLocator->InsertNextPoint( tmpmyVTKPolyData
mesh->GetPoint(listPts(i)) );<br>
}<br>
pointLocator->Update(); pointLocator->BuildLocator();<br>
</i> <br>
The code executes, but the rest of my program then completely
fails. I did check the <i>listPts</i> has only valid point ids.<br>
Whenever I call <i>pid = pointLocator->FindClosestPoint(p1)</i>,
I receive absurd results (e.g. pid = 4294967295, or similar
overflow-like value)<br>
<br>
any hints?<br>
Thanks <br>
Remi<br>
</blockquote>
<br>
</body>
</html>