[vtkusers] Porting from 4.2 to 5.4 - behaviour of vtkDataSetToDataSetFilter filters

John Platt jcplatt at dsl.pipex.com
Thu Oct 15 09:53:05 EDT 2009


Hi,

If my recollection is correct, in VTK 4.2, filters which took vtkDataSet as input and produced an output type = input type, warned when the input type changed because the output had to be deleted and re-created to match the input.

e.g.

    f = vtkMergeDataObjectFilter::New();
    f->SetInput( vtkPolyData );
    f->SetInput( vtkUnstructuredGrid );  // delete 'old' vtkPolyData output and create 'new'  vtkUnstructuredGrid output
In VTK 5.4, these filters are now derived from vtkDataSetAlgorithm. The problem (I think) I have is, doing

    f->SetInput( vtkPolyData );
    f->SetInput( vtkUnstructuredGrid );
    vtkDataSet* ds1 = f->GetOutput();
    f->Update();
    vtkDataSet* ds2 = f->GetOutput();

gives 2 different objects for ds1 & ds2 (ds1 is corrupt). Also, I cannot see any warning that the output from the first SetInput() will be deleted.

Can anyone confirm if this is the expected behaviour?

Many thanks for any help.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091015/0aa94cd6/attachment.htm>


More information about the vtkusers mailing list