Changeset 3548


Ignore:
Timestamp:
Sep 7, 2006, 4:49:11 PM (18 years ago)
Author:
jack
Message:

Animation support added to the offline visualiser.

Location:
anuga_core/source/anuga/visualiser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/visualiser/offline.py

    r3538 r3548  
    2626        for i in range(self.maxFrameNumber + 1): # maxFrameNumber is zero indexed.
    2727            self.vtk_heightQuantityCache.append({})
     28
     29        self.paused = False
     30        self.tk_root.after(100, self.animateForward)
    2831
    2932    def setup_grid(self):
     
    129132
    130133    def pauseResume(self):
    131         print "Pause/Resume"
     134        if self.paused is True:
     135            self.tk_pauseResume.config(text="Pause")
     136            self.paused = False
     137            self.tk_root.after(100, self.animateForward)
     138        else:
     139            self.tk_pauseResume.config(text="Resume")
     140            self.paused = True
    132141
    133142    def forward(self):
     
    142151            self.frameNumber = self.maxFrameNumber
    143152        self.redraw_quantities(True)
     153
     154    def animateForward(self):
     155        if self.paused is not True:
     156            self.forward()
     157            self.tk_root.after(100, self.animateForward)
  • anuga_core/source/anuga/visualiser/visualiser.py

    r3547 r3548  
    2727        self.vtk_polyData = {}
    2828
     29        self.setup_gui()
     30
    2931    def run(self):
    30         self.setup_gui()
    3132        self.setup_grid()
    3233        # Draw Height Quantities
Note: See TracChangeset for help on using the changeset viewer.