[vtkusers] vtkPolyDataMapper - Updating (pre-computing) data before adding it to the pipeline
bill.lorensen at gmail.com
Wed Jun 23 11:24:21 EDT 2010
Time each piece of your pipeline by doing a ->Update() on each piece.
Enclose the Update() with timing code.
Also, be sure to compile your code with a build type of Release. If
you have built it with debug, it can make a significant performance
On Wed, Jun 23, 2010 at 9:23 AM, Barth, Sebastian
<sebastian.barth at iosb.fraunhofer.de> wrote:
> Hello Bill and thanks for your interest,
> I thought that the mapper does create (and cache) graphical primitives for simple rendering from its input data and that this is the part of my pipeline that needs most of the time (about 2 seconds). Because of this long time I want to pre-compute the vtkPolyData (maybe in a different thread). When I have called mapper->Update() while the mapper was not a part of the rendering pipeline, the mapper didn't need these 2 seconds (I measeared not even 1ms).
> I now have put the mapper into the pipeline and tried to measure an mapper->Update() again: I still did not measure the 2 seconds. That means, that I was wrong and not the mapper does need these 2 seconds. It's another part of the pipeline.
> When I have updated the pipeline after changing the vtkPolyData with renderWindow->Render() this update needs 2 seconds. After this I can change the camera as I want, without getting again the 2 seconds until I change the vtkPolyData again!
> So, what is the part of the pipeline I have to pre-compute to avoid these 2 seconds? How?
> In later situations I even get a data with a bigger size that will need about 6 seconds to update. A window that freezes for 6 seconds is unacceptable. I do need the ability to interact with the window (camera changes) within these 6 seconds.
> I hope you or someone else can give me a hint!
> Thanks a lot,
> -----Ursprüngliche Nachricht-----
> Von: Bill Lorensen [mailto:bill.lorensen at gmail.com]
> Gesendet: Mittwoch, 23. Juni 2010 14:30
> An: Barth, Sebastian
> Cc: vtkusers at vtk.org
> Betreff: Re: [vtkusers] vtkPolyDataMapper - Updating (pre-computing) data before adding it to the pipeline
> mapper->Update() should work.
> How do you know it is not working? Try mapper->GetBounds() before and
> after the Update.
> On Wed, Jun 23, 2010 at 6:33 AM, Barth, Sebastian
> <sebastian.barth at iosb.fraunhofer.de> wrote:
>> Hello again vtkusers,
>> I've a vtkPolyData and a vtkPolyDataMapper, which is using the vtkPolyData as input.
>> There is no actor on the pipeline that is connected to the vtkPolyDataMapper: The two objects aren't part of the pipeline, yet.
>> At the earliest when I have connected the vtkPolyDataMapper through any vtkActor to the pipeline and updated it (Update()), the mapper computes its data.
>> How can I "pre-compute" the data of the mapper to get a faster inclusion into the pipeline?
>> I need this because of a very big vtkPolyData (Update() needs about two seconds)!
>> I've tried mapper->Update() before I connect the mapper to the pipeline, but this seems to do nothing until the mapper is not a part of the pipeline.
>> I'm maybe looking at the wrong thing. Please correct me!
>> Thanks a lot for your help!
>> Sebastian Barth
>> Powered by www.kitware.com
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
More information about the vtkusers