[vtkusers] How to estimate render time

Massimo Bortolato massimo.bortolato at gmail.com
Tue Dec 11 10:01:34 EST 2012


Thank you!
Very useful!
Massimo



-----Messaggio originale----- 
From: David Doria
Sent: Tuesday, December 11, 2012 1:38 PM
To: Massimo Bortolato
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] How to estimate render time

On Tue, Dec 11, 2012 at 5:11 AM, Massimo Bortolato
<massimo.bortolato at gmail.com> wrote:
> Hi all,
>
> I have my program slow in executing vtkRenderWindow::Render() (or maybe
> vtkRenderer::Render() ??) so I wonder if there is any event I can listen 
> to
> to avoid the application looking freezed (for example I’d like to show a
> progress bar...)
>
> Thankyou in advance!
> Massimo

In vtkFrameRateWidget that we wrote a long time ago:
https://github.com/daviddoria/vtkFrameRateWidget/blob/master/vtkFrameRateWidget.cxx

there are some clues as to how you can do this. The renderer's
EndEvent can be connected to a function.

this->Renderer->AddObserver(vtkCommand::EndEvent , this,
&vtkFrameRateWidget::RenderCallback);

Then I would use a Qt progress bar in "marquee" mode (just scrolling
back and forth until you tell it to stop,
http://programmingexamples.net/wiki/Qt/Widgets/ProgressBarMarquee)
since I don't think you can know how long it will actually take.

Good luck,

David 




More information about the vtkusers mailing list