[vtk-developers] BestFitPlane function for vtkPlane

Karthik Krishnan karthik.krishnan at kitware.com
Thu Nov 12 01:17:46 EST 2009


On Wed, Nov 11, 2009 at 2:22 PM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Tue, Nov 10, 2009 at 11:29 PM, Karthik Krishnan
> <karthik.krishnan at kitware.com> wrote:
> > On Wed, Nov 4, 2009 at 2:21 PM, David Doria <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> >
>
> > something like :
> >
> >   vtkPlane::ComputeBestFittingPlane( vtkPoints *points )
> >      {
> >      ...
> >      }
> >
> >   vtkPlane::ComputeBestFittingPlane( vtkDataSet *dataset )
> >      {
> >      ...
> >      }
> >
> >
> > Apart from the unnecessary copy, things look good.
> >
>
> Can we address the problem more directly and add a method to get a
> vtkPoints from a vtkDataSet? This seems like a reasonable thing to be
> able to do, do you agree?
>

One cannot get a vtkPoints from a vtkDataSet, without explicitly copying
them. Its an internal variable only for a specific type of vtkDataset : a
vtkPointSet.

vtkDataSet has other subclasses as well, such as vtkImageData,
vtkHyperOctree, vtkRectilinearGrid.

To be honest, this should operate on just subclasses of vtkPointSet. It
makes no sense to compute the best fit plane for any other type of
vtkDataSet. That would however be an API change, rederiving
vtkTextureMapToPlane from vtkPointSetAlgorithm instead of
vtkDataSetAlgorithm, preventing users from setting other types of vtkDataSet
as input.

So in the interest of backward compatibility, I unfortunately don't agree.

Thanks
--
karthik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091112/ad485c19/attachment.html>


More information about the vtk-developers mailing list