[vtkusers] renderWindowInteractor.CreateRepeatingTimer(10)
James Labiak
jim at jslengineeringsoftware.com
Tue Oct 27 16:08:52 EDT 2015
Hello All,
My animation using Java, vtk 6.1, and repeating timer is not respecting
the timer duration. Whether I set it to 10 milliseconds or 10,000, the
animation rate is about 1 frame/sec. The relevant code follows. I have
taken steps to make sure that there appear to be no memory leaks during
the animation. RAM stays constant. (However, a stop button which uses
the stopAction() method followed by an application close is not
completely cleaning up the vtk objects yet, as found through
debug_leaks.) Any suggestions on the repeating timer duration issue
would be appreciated.
Thanks,
Jim
......some other code, then:
this.renderWindowInteractor.Initialize();
this.renderWindowInteractor.AddObserver("TimerEvent", this, "myCallBack");
timerID = this.renderWindowInteractor.CreateRepeatingTimer(10000);
System.out.println("timerID = 0" + timerID);
this.renderWindowInteractor.Start();
public void myCallBack() {
if (visualizationLoop < 150) {
visualizationBegin();
}
if (visualizationLoop == 150) {
this.renderWindowInteractor.DestroyTimer(timerID);
stopAction();
}
private void stopAction() {
this.renderWindowInteractor.DestroyTimer(timerID);
this.renderWindowPanel.GetRenderer().RemoveAllViewProps();
// Proceed with vtk object cleanup, then start GC:
vtkReferenceInformation info = vtkObject.JAVA_OBJECT_MANAGER.gc(true);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151027/4b73c8c8/attachment.html>
More information about the vtkusers
mailing list