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

Moreland, Kenneth kmorel at sandia.gov
Fri Feb 5 14:43:33 EST 2010


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

On 2/5/10 10:33 AM, "David Gobbi" <david.gobbi at gmail.com> wrote:

But David D. brings up a good point.  A lot of the VTK filters should
be much more generic than they are.  Any vtkPolyData filter that only
operates on the points should be changed to take vtkPointSet instead.
Likewise, any filter that only operates on scalars should take
vtkDataSet.

For example, the classes vtkImageMapToColors and vtkImageShiftScale
have a whole bunch of unnecessary image-specific code in them.  These
operations should be simplified, genericised, and made to work the
scalars of any vtkDataSet.  Or, in fact, on any array stored in the
data.

   David


On Fri, Feb 5, 2010 at 10:06 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> There is an AppendData.
>
> On Fri, Feb 5, 2010 at 11:55 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
>> On Fri, Feb 5, 2010 at 11:48 AM, Moreland, Kenneth <kmorel at sandia.gov>
>> wrote:
>>>
>>> Then use a vtkPolyData or vktUnstructuredGrid with no cells.
>>>
>>> -Ken
>>
>> The reason I ask is that it seems like there is no vtkAppendUnstructuredGrid
>> or vtkAppendPointSet, only vtkAppendPolyData. Is there a reason for this?
>> The output should be the same type as the inputs if the input types are all
>> the same. If the inputs are different types, the output should be the "most
>> general" type of vtkPointSet.
>> Does something like this already exist? Or should we add it?
>> Thanks,
>>
>> David
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>>
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers





   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel

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


More information about the vtk-developers mailing list