[vtkusers] updating vtkPolyData
Amy Squillacote
ahs at cfdrc.com
Wed Dec 3 09:43:44 EST 2008
Paul,
Did you try calling "Render" after you updated your dataset?
- Amy
Paul Harris wrote:
> 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
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
--
Amy Squillacote Phone: (256) 726-4839
Computer Scientist Fax: (256) 726-4806
CFD Research Corporation Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL 35805
More information about the vtkusers
mailing list