[vtk-developers] BestFitPlane function for vtkPlane

David Doria daviddoria+vtk at gmail.com
Thu Nov 12 08:13:34 EST 2009


> 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
>

I changed everything (BestFitFromPoints and CenterOfMass) to take a
vtkDataSet as input. I also changed all local variables to start with
lower case letters. Here is the latest version of everything. All
tests still pass.

http://www.rpi.edu/~doriad/VTK_List/vtkPlane/vtkPlane.zip

Thanks,

David



More information about the vtk-developers mailing list