From: Mario Valle (
Date: Wed Nov 30 2005 - 04:01:49 CST

Huge improvement! Thanks.
Could the graphics page
be updated with delete all?
Now the relevant code is
     # defer screen update
     display update off

     # delete an existing surface
     graphics $mol delete all

     # add triangles
     graphics $mol color $comp
     foreach line [split $data \n] {
         if {$line == ""} break
         eval graphics $mol trinorm $line

     # update the display
     display update on

Thanks again!

Axel Kohlmeyer wrote:
> On Tue, 29 Nov 2005, Mario Valle wrote:
> MV> In a small plugin I'm developing I need to create a different surface for each animation step.
> MV>
> MV> The surfaces are create using a bunch of graphics $mol trinorm ... calls.
> MV> At each animation step I need to delete the surface created in the previous step before
> MV> recreating the new one. Unfortunately this step slows down considerably the animation.
> MV>
> MV> The only method I have found is:
> MV> # delete an existing surface
> MV> set glist [graphics $mol list]
> MV> foreach gitem $glist {graphics $mol delete $gitem}
> MV>
> MV> Is there any more efficient method?
> at least for the deleting you can do
> graphics $mol delete all
> which should reduce the overhead.
> if you need to update only part of the graphics, you can save those
> graphics ids while creating them, and then just use that list
> of graphics ids to delete and recreate them. as in:
> MV> I create the graphics inside the Top molecule. Maybe it is faster to create the graphics
> MV> inside a new molecule and then deleting it at each animation step. Unfortunately using
> MV> this setup I have strange scaling and translation of the resulting surface.
> hmmm, perhaps a suitable workaround would be to load each frame into
> a different molecule and then use a script to hide/unhide them. as in:
> axel.
> MV>
> MV> Thanks for your help!
> MV> mario
> MV>
> MV>

Ing. Mario Valle
Visualization Group                              |
Swiss National Supercomputing Centre (CSCS)      | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82