<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>vtkKdTree BuildLocatorFromPoints trouble</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>I am having some trouble with vtkKdTree. I read data in as structured points, turn it into a surface with vtkMarchingContourFilter, and would like to find the nearest point of this surface to a specified point in space. To do this, do I need to get the point data from the contour filter and use BuildLocatorFromPoints, or would I just set the contour filter output as the data set and use BuildLocator; I ask because the manual pages online suggest that vtkIdType vtkKdTree::FindClosestPoint requires the locator be from BuildLocatorFromPoints. If this is the case, should the following work (or better phrased, why doesn't it)?<BR>
vtkKdTree * example = vtkKdTree::New();<BR>
example->BuildLocatorFromPoints(contour->GetOutput()->GetPoints());</FONT>
</P>
</BODY>
</HTML>