<HTML>
<HEAD>
<TITLE>Re: [vtk-developers] vtkPoints as input to a filter?</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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.<BR>
<BR>
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.<BR>
<BR>
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.<BR>
<BR>
-Ken<BR>
<BR>
On 2/5/10 10:33 AM, "David Gobbi" <<a href="david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>But David D. brings up a good point. A lot of the VTK filters should<BR>
be much more generic than they are. Any vtkPolyData filter that only<BR>
operates on the points should be changed to take vtkPointSet instead.<BR>
Likewise, any filter that only operates on scalars should take<BR>
vtkDataSet.<BR>
<BR>
For example, the classes vtkImageMapToColors and vtkImageShiftScale<BR>
have a whole bunch of unnecessary image-specific code in them. These<BR>
operations should be simplified, genericised, and made to work the<BR>
scalars of any vtkDataSet. Or, in fact, on any array stored in the<BR>
data.<BR>
<BR>
David<BR>
<BR>
<BR>
On Fri, Feb 5, 2010 at 10:06 AM, Bill Lorensen <<a href="bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<BR>
> There is an AppendData.<BR>
><BR>
> On Fri, Feb 5, 2010 at 11:55 AM, David Doria <<a href="daviddoria+vtk@gmail.com">daviddoria+vtk@gmail.com</a>> wrote:<BR>
>> On Fri, Feb 5, 2010 at 11:48 AM, Moreland, Kenneth <<a href="kmorel@sandia.gov">kmorel@sandia.gov</a>><BR>
>> wrote:<BR>
>>><BR>
>>> Then use a vtkPolyData or vktUnstructuredGrid with no cells.<BR>
>>><BR>
>>> -Ken<BR>
>><BR>
>> The reason I ask is that it seems like there is no vtkAppendUnstructuredGrid<BR>
>> or vtkAppendPointSet, only vtkAppendPolyData. Is there a reason for this?<BR>
>> The output should be the same type as the inputs if the input types are all<BR>
>> the same. If the inputs are different types, the output should be the "most<BR>
>> general" type of vtkPointSet.<BR>
>> Does something like this already exist? Or should we add it?<BR>
>> Thanks,<BR>
>><BR>
>> David<BR>
>> _______________________________________________<BR>
>> Powered by www.kitware.com<BR>
>><BR>
>> Visit other Kitware open-source projects at<BR>
>> <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
>><BR>
>> Follow this link to subscribe/unsubscribe:<BR>
>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><BR>
>><BR>
>><BR>
>><BR>
> _______________________________________________<BR>
> Powered by www.kitware.com<BR>
><BR>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
><BR>
> Follow this link to subscribe/unsubscribe:<BR>
> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><BR>
><BR>
><BR>
_______________________________________________<BR>
Powered by www.kitware.com<BR>
<BR>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
<BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><BR>
<BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>