[vtkusers] vtkAppendPolyDate: Replacing appended data

Martin Baumann mailsgetlost at web.de
Tue Sep 19 09:35:16 EDT 2006


Hi,

I use a vtkAppendPolyData object in a loop that collects data that is
produced within the loop.
I had problems to make the vtkAppendPolyData object hold the data of all
loops without replacing the old data with the data of the latest loop.

My Code:

1. Version
    // begin loop
    // calculating _ptrace
    _appender->AddInput(_ptrace->GetParticleTraces());
    _appender->Update();
    // end loop
This didn't work in my case.

2. Version
    // begin loop
    // calculating _ptrace
    vtkPolyData* temp = vtkPolyData::New();
    temp->ShallowCopy(_ptrace->GetParticleTraces());
    _appender->AddInput(temp);
    _appender->Update();
    temp->Delete();
    // end loop
This worked in my case. But ShallowCopy does only copy the references of
the original object, as far as I know.

My questions:

Why does Version 1 replace added data?
What would be the best way to append data without replacing old data?

Regards, M.B.



More information about the vtkusers mailing list