[vtkusers] updating vtkPolyData

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


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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081204/dfb03112/attachment.htm>


More information about the vtkusers mailing list