<!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 &eacute;crit&nbsp;:
    <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&nbsp; in insertion mode.<br>
      Initially, I was using succesfully a code looking like:<br>
      <br>
      <i>vtkSmartPointer&lt;vtkPointLocator&gt; pointLocator =
        vtkSmartPointer&lt;vtkPointLocator&gt;::New();<br>
        pointLocator-&gt;SetDataSet( myVTKPolyData );<br>
        pointLocator-&gt;Update();&nbsp;&nbsp;&nbsp; pointLocator-&gt;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 -&gt;InsertNextPoint( ) method.<br>
      My code now looks like:<br>
      <br>
      <i>vtkSmartPointer&lt;vtkPointLocator&gt; pointLocator =
        vtkSmartPointer&lt;vtkPointLocator&gt;::New();<br>
        vtkSmartPointer&lt;vtkPoints&gt; tmpPts =
        vtkSmartPointer&lt;vtkPoints&gt;::New();<br>
      </i><i>pointLocator-&gt;InitPointInsertion(tmpPts, bounds);<br>
        for (int i=0 ; i&lt;listPts.size() ; i++) {<br>
        &nbsp;&nbsp;&nbsp; pointLocator-&gt;InsertNextPoint( tmpmyVTKPolyData
        mesh-&gt;GetPoint(listPts(i)) );<br>
        }<br>
        pointLocator-&gt;Update();&nbsp;&nbsp;&nbsp; pointLocator-&gt;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&nbsp; <i>pid = pointLocator-&gt;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>