[vtk-developers] vtkPoints as input to a filter?

David Doria daviddoria+vtk at gmail.com
Fri Feb 5 16:24:55 EST 2010


On Fri, Feb 5, 2010 at 2:43 PM, Moreland, Kenneth <kmorel at sandia.gov> wrote:

>  In general and in principle I wholeheartedly agree.  I find it very
> frustrating to have a filter that does just want I want but that I cannot
> use because it is pointlessly implemented for a particular subclass I am not
> using.
>
> However, I do not think that applies to the append filter.  vtkAppendFilter
> necessarily writes everything out to an unstructured grid regardless of its
> input.  This is because vtkUnstructuredGrid can hold any of the elements
> thrown at it.  It will happily take a group of vtkPolyData objects, but the
> output will still be converted to vtkUnstructuredGrid.  Because you often
> want to merge a bunch of vtkPolyDatas into another vtkPolyData, there is a
> special filter to do this.
>
> It is not practical to change the behavior of vtkAppendFilter to try to
> follow the input because the behavior would become less predictable.  What
> happens if you combine a vtkPolyData with a vtkUnstructuredGrid.  What if
> you combine a vtkPolyData with a vtkImageData?  What if the image is 2D?
>  3D?  What if you combine two vtkImageDatas?  The logic becomes non-trivial
> and the behavior of the filter would become frustratingly non-obvious.
>
> -Ken
>


Pat - it is working now, thanks.

Ken - agreed. Variable output type could get confusing. My thought was to
just have it be the data type of the "most complicated" input data type, but
no need for this, just making it unstructured grid is ok.

My concern is just that it seems awkward to have to put my vtkPoints into a
container to pass it to a filter that is going to operate only only the
points.

vtkPoints* points = vtkPoints::New();
// ... fill points...

Currently one must do this:
vtkUnstructuredGrid* ug = vtkUnstructuredGrid::New(); //could also use
polydata here
ug->SetPoints(points);
vtkMyFilter* filter = vtkMyFilter::New();
filter->SetInput(ug);

Instead of just this:

vtkMyFilter* filter = vtkMyFilter::New();
filter->SetInput(points);

I guess the way things are setup there is no hope of changing this?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100205/f3d70b61/attachment.html>


More information about the vtk-developers mailing list