[vtkusers] Performance Query

john_kendrick at huntsman.com john_kendrick at huntsman.com
Thu Jun 21 16:23:59 EDT 2001


Hi

I have been using vtk to write a viewer capable of
displaying a molecular model.  I am using the tcl/tk
wrappers.  The molecule is represented by a number of sphere sources
at different coordinates for the atoms and the bonds are represented
by a lineSources with tube filters around each line.

Although performance is adequate for a single molecule.  I started
to write a script which would display a vibration of the molecule.
I tried to do this
by taking a snapshot of the sphere positions at different times during
the vibration and creating all the actors representing the spheres and
bonds during the whole time sequence.  To create a smooth image I
need about 20 time steps and at each time step I need 49 spheres and
98 tubes.

I was surprised by the time it takes to build the pipeline.
The time required to add a new time slice ( to add 49 spheres and 98 tubes)
increases as the algorithm proceeds.  For example the first time slice
takes 67760 and 168838 microseconds respectively to add the first
set of spheres and tubes.  The 9th time slice is taking 234362 and 513654
microseconds.  I thought I could live with this if I only had to build the
pipeline once.   For instance having looked at one type of vibration, to
look at another I simply modify the coordinates of the actors.  This
works, in that the time for modifying the pipeline is constant for each
time
slice, but it is still about 15 times longer than the time taken to put the
first
time slice into the pipeline.

The timings apply to a 2 processor 500Mhz PIII with 512MB memory.

I am achieving animation of the timeslices by deleting all actors in the
renderer and adding the actors for the current time slice.  Once this has
been done,  I put a keypress event onto the end of event queue.  The
key press event is handled by incrementing the time slice and then
deleting actors in the renderer and adding  the actors for the new time
slice.  I was also going to try creating a renderer for each time slice
and simply swapping.  The trick of adding to the event queue, works
well as I am able to interact with the image, rotate and pan, during the
animation.  The only problem is that when  leave the focus of the
window, the animation stops.  By keeping track of the activity I can
restart the animation when the focus reenters the window.

Sorry this is so long.  I would be grateful for any comments on how to do
this
more efficiently.  Should I for instance by modifying a single set
of sphere and tube positions at each time step, rather than building a
set of actors and sources for each time slice.

Thanks for any help


IMPORTANT NOTICE
This email is confidential, may be legally privileged, and is for the
intended recipient only.  Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offence.  Please delete if obtained in error and email confirmation to the
sender.

Visit our corporate website at http://www.huntsman.com






More information about the vtkusers mailing list