<br><div class="gmail_quote">On Thu, Aug 26, 2010 at 8:14 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
vtkKdTreePointLocator is a leaf class that implements the vtkAbstractPointLocator interface. It would be best if new interface methods were be added at the abstract layer and then implemented in each leaf class.<br><br>
</blockquote>
<div><br></div></div><div>Good point. Even better than that, the abstract class can provide the implementation because all it does is setup the parameters to call a pure virtual function. This means that the logic of changing parameters is done at the abstract level, then the appropriate "inner function" is called depending on the subclass.</div>
<div><br></div><div>I have added this type of convenience function for FindClosestPoint, FindClosestNPoints, and FindPointsWithinRadius.</div><div><br></div><div>The code is here:</div><div><div class="im"><div style="font-family:arial, sans-serif;border-collapse:collapse">
repo: git@github.com:daviddoria/daviddoria-vtk.git</div><div style="font-family:arial, sans-serif;border-collapse:collapse">branch: VTK-KdTree</div><div style="font-family:arial, sans-serif;border-collapse:collapse">
<br></div></div><div style="font-family:arial, sans-serif;border-collapse:collapse">I added tests for all of the subclasses to exercise the new (and old) functions:</div><div style="font-family:arial, sans-serif;border-collapse:collapse">
Filter/Testing/Cxx/TestKdTreePointLocator.cxx </div><div style="font-family:arial, sans-serif;border-collapse:collapse">Filter/Testing/Cxx/TestOctreePointLocator.cxx<span style="border-collapse:separate;font-family:arial"> </span></div>
</div><div style="font-family:arial, sans-serif;border-collapse:collapse"><span style="border-collapse:separate;font-family:arial"><span style="font-family:arial, sans-serif;border-collapse:collapse">Filter/Testing/Cxx/TestIncrementalOctreePointLocator.cxx<span style="border-collapse:separate;font-family:arial"> </span></span></span></div>
<div style="font-family:arial, sans-serif;border-collapse:collapse"><span style="border-collapse:separate;font-family:arial"><span style="font-family:arial, sans-serif;border-collapse:collapse"><span style="border-collapse:separate;font-family:arial"><span style="font-family:arial, sans-serif;border-collapse:collapse">Filter/Testing/Cxx/TestPointLocator.cxx<span style="border-collapse:separate;font-family:arial"> </span></span></span></span></span></div>
<div class="im">
<div style="font-family:arial, sans-serif;font-size:12.5px;border-collapse:collapse"><span style="border-collapse:separate;font-family:arial;font-size:small"><span style="font-family:arial, sans-serif;font-size:12.5px;border-collapse:collapse"><span style="border-collapse:separate;font-family:arial;font-size:small"><span style="font-family:arial, sans-serif;font-size:12.5px;border-collapse:collapse"><span style="border-collapse:separate;font-family:arial;font-size:small"><br>
</span></span></span></span></span></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
A potential problem with your proposed implementation is that it assumes the vtkDataSet is a vtkPointSet, which may not be true. <br><br></blockquote></div><div>It looks like vtkDataSet also implements a GetPoint(vtkIdType, double*) function, so I changed it to cast to a vtkDataSet instead of a vtkPointSet.</div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
I definitely agree that the proposed api is convenient, but it doesn't add new power to the class.<br><font color="#888888"></font><br></blockquote><div> </div></div><div>Yes, they are indeed convenience functions! I'm all for making things more convenient :)</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Please let me know what you think.</div><div class="gmail_quote"><br></div>Thanks,<br><font color="#888888"><br><div>David</div>
</font></blockquote></div><br><div>Did anyone get a chance to look at this?</div><div><br>David</div>