Skip to content
Snippets Groups Projects
Commit c6298aa5 authored by Alexis Girault's avatar Alexis Girault
Browse files

Merge branch 'improve-render-clock' into 'master'

Improve render clock

`VTKInteractorStyle::CreateRepeatingTimer` would call
`VTKInteractorStyle::OnTimer` then sleep for the period
given in ms after calling `OnTimer` again. This isn't
adapted for rendering at a uniform frame rate, because
the time spent within the `OnTimer` function is not
taken into account in the sleep time.

By using `OneShotTimer`, we can manipulate when to
render the next frame: in (period - time spent) ms
if the time spent in `OnTimer` is smaller than the period
time, or right away (period of 0 ms) if the time spent
is over the target period (late frame).

An interface is added in the `VTKInteractorStyle`,
wrapped in the `VTKViewer`, to set the target frame rate.

Also added a commit to use `DATA_DIR` defined in the Sandbox example to easily change the data directory for each user on their own machine. Any local change to the `DATA_DIR` value should not be committed in the future.

See merge request !114
parents f6a80eab e0956c3c
Branches vercmp
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment