[vtkusers] updating vtkPolyData

Paul Harris harris.pc at gmail.com
Wed Dec 3 08:25:56 EST 2008


Hi all,

This is hopefully a silly question, but how do I "push though" changes made
on a vtkPolyData object?

In context, I have a pipeline set up with a vtkPolyData object attached to a
mapper which renders to a QVtkWidget.

I want to update the contents of that object like so...
vtkPolyData * dataSet = the_pipeline_instance;

      dataSet->Reset();
      dataSet->SetPoints(points.get());
      dataSet->SetVerts(verts.get());
      dataSet->GetPointData()->AddArray(sizes.get());
      dataSet->GetPointData()->AddArray(colours.get());

where points, verts, sizes, colours are all set up prior.

Then I tried to do
dataSet->Modified();
and even
dataSet->Update();

but the rendered image did not change... until i rotated the model.

Do I have to call Update() on the renderer, or the mapper, or the QVtkWidget
?  Doesn't Modified() notify the filters upstream that something has changed
?


and a secondary question, I am using Reset() above, but it mentions that it
does not free memory...
Is there another way I should be replacing the contents of my data object ?

thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081203/ec641e55/attachment.htm>


More information about the vtkusers mailing list