<div class="gmail_quote">On Wed, Nov 11, 2009 at 2:22 PM, 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Nov 10, 2009 at 11:29 PM, Karthik Krishnan<br>
<div><div></div><div class="h5"><<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>> wrote:<br>
> On Wed, Nov 4, 2009 at 2:21 PM, David Doria <<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>><br>
<br>
> something like :<br>
><br>
>   vtkPlane::ComputeBestFittingPlane( vtkPoints *points )<br>
>      {<br>
>      ...<br>
>      }<br>
><br>
>   vtkPlane::ComputeBestFittingPlane( vtkDataSet *dataset )<br>
>      {<br>
>      ...<br>
>      }<br>
><br>
><br>
> Apart from the unnecessary copy, things look good.<br>
><br>
<br>
</div></div>Can we address the problem more directly and add a method to get a<br>
vtkPoints from a vtkDataSet? This seems like a reasonable thing to be<br>
able to do, do you agree?<br></blockquote><div><br>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.<br><br>vtkDataSet has other subclasses as well, such as vtkImageData, vtkHyperOctree, vtkRectilinearGrid. <br>
<br>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.<br>
<br>So in the interest of backward compatibility, I unfortunately don't agree.<br><br>Thanks<br>--<br>karthik<br></div></div>