[vtkusers] updating vtkPolyData

David E DeMarle dave.demarle at kitware.com
Thu Dec 4 05:50:18 EST 2008


Yes.

Source->filterA->...->filterZ->Mapper->Actor->Renderer->RenderWindow
Source is upstream, RenderWindow is downstream.

Nothing downstream will be affected by Modifications upstream until
downstream is Updated.
Update is called when RenderWindow Render happens for instance.

Updates can take a long time, so doing the updates lazily is a good
idea. Consider if you want to change parameters of and therefore
Modify ten different algorithms (or one algorithm ten times). With
lazy updates the pipeline only has to flow once instead of 10 times.

When Update is called, the pipeline looks all the way upstream and
then Updates far enough back to reach all of the Modified's, but no
further. So if filterM was modified, and RenderWindow Render happened,
filter's M through Z, as well as the Mapper, Actor, Renderer and
RenderWindow would each be updated in turn, but filters L through A
and the Source would not Update.

If you have merging pipelines,
source1-->filter1-----\____render
source2-->filter2-----/
the updates will travel down one or both pipelines as needed to reach
all of the modified things wherever they may be.

If you have diverging pipelines,
                                  /------render1
source--->filter------<
                                  \------render2
you have to make sure that both downstreams are updated to see the
change upstream, or they will look different until something causes a
render.










On Wed, Dec 3, 2008 at 9:21 PM, Paul Harris <harris.pc at gmail.com> wrote:
> No I didn't... do I have to?
>
> What if the data is connected to two mappers and two QVtkWidgets ?  Or
> none?  Do I need to remember what data is connected to which renderers and
> then manually call Render() ?
>
> thanks,
> Paul
>
> 2008/12/3 Amy Squillacote <ahs at cfdrc.com>
>>
>> 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
>>
>>
>
>
> _______________________________________________
> 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
>
>



-- 
David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109



More information about the vtkusers mailing list