[vtk-developers] KdTree FindPointsWithinRadius
David Doria
daviddoria+vtk at gmail.com
Thu Sep 2 12:55:57 EDT 2010
On Thu, Aug 26, 2010 at 8:14 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:
> 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.
>>
>>
> 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.
>
> I have added this type of convenience function
> for FindClosestPoint, FindClosestNPoints, and FindPointsWithinRadius.
>
> The code is here:
> repo: git at github.com:daviddoria/daviddoria-vtk.git
> branch: VTK-KdTree
>
> I added tests for all of the subclasses to exercise the new (and old)
> functions:
> Filter/Testing/Cxx/TestKdTreePointLocator.cxx
> Filter/Testing/Cxx/TestOctreePointLocator.cxx
> Filter/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
> Filter/Testing/Cxx/TestPointLocator.cxx
>
> A potential problem with your proposed implementation is that it assumes
>> the vtkDataSet is a vtkPointSet, which may not be true.
>>
>> It looks like vtkDataSet also implements a GetPoint(vtkIdType, double*)
> function, so I changed it to cast to a vtkDataSet instead of a vtkPointSet.
>
>
>> I definitely agree that the proposed api is convenient, but it doesn't add
>> new power to the class.
>>
>>
> Yes, they are indeed convenience functions! I'm all for making things more
> convenient :)
>
> Please let me know what you think.
>
> Thanks,
>
> David
>
Did anyone get a chance to look at this?
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100902/0f02bcf2/attachment.html>
More information about the vtk-developers
mailing list