Problem with vtkAppendPolyData

Ken Martin ken.martin at kitware.com
Mon Mar 6 13:16:24 EST 2000


It is actually removing the input and I think the filter should work 
correctly. What is wrong is that the append filter needs to collapse or 
squeeze the input array. The filter has an array of inputs. You add two 
inputs to the array and then delete the first input. That leaves the first 
element of the array as NULL and the second element as a valid input. The 
array size is still two. This is used for some filters where input 1 and 
input 2 have different meanings so we can't just shift input 2 to input 1 
when input 1 is removed. But I will add a method to vtkProcessObject so 
that AppendPolyData can call it and have input 2 shift over into input 1 
when input 1 is removed.

- Thanks
- Ken


At 11:46 PM 3/5/00 -0800, pahsieh at usgs.gov wrote:
>It appears that vtkAppendPolyData in version 3.1 is not
>properly removing input. This is illustrated by the
>following test program:
>
>#include "vtkPolyData.h"
>#include "vtkAppendPolyData.h"
>
>void main()
>{
>      vtkPolyData *pd1 = vtkPolyData::New();
>      vtkPolyData *pd2 = vtkPolyData::New();
>      vtkAppendPolyData *append = vtkAppendPolyData::New();
>      append->AddInput(pd1);
>      append->AddInput(pd2);
>      cout << append->GetNumberOfInputs() << endl;
>      append->RemoveInput(pd1);
>      cout << append->GetNumberOfInputs() << endl;
>}
>
>The output was
>
>2
>2
>
>However, if I comment out append->AddInput(pd2), then the
>output was
>
>1
>0
>
>which is correct.
>
>I am using the "official" (not nightly) release 3.1.
>My apology if this has already been fixed. Thanks.
>
>Paul
>
>
>--------------------------------------------------------------------
>This is the private VTK discussion list. Please keep messages on-topic.
>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at public.kitware.com>. For help, send message body containing
>"info vtkusers" to the same address.
>--------------------------------------------------------------------

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list