Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | ########## |
---|
3 | # Demonstration of the VTK sww Visualiser |
---|
4 | # Jack Kelly |
---|
5 | # September 2006 |
---|
6 | ########## |
---|
7 | |
---|
8 | # Import the offline visualiser |
---|
9 | from anuga.visualiser import OfflineVisualiser |
---|
10 | from vtk import vtkCubeAxesActor2D |
---|
11 | from Numeric import sqrt |
---|
12 | |
---|
13 | o = OfflineVisualiser("zz0.0.sww") |
---|
14 | |
---|
15 | |
---|
16 | # Specify the height-based-quantities to render. |
---|
17 | # Remember to set dynamic=True for time-varying quantities |
---|
18 | o.render_quantity_height("elevation", zScale=100.0, offset = 5.0, dynamic=False) |
---|
19 | o.render_quantity_height("stage", zScale=100.0, opacity=0.7, dynamic=True) |
---|
20 | |
---|
21 | # Colour the stage: |
---|
22 | o.colour_height_quantity('stage', (lambda q:(q['stage']), -1.5, 1.5)) |
---|
23 | #o.colour_height_quantity('stage', (0,0,0.7)) |
---|
24 | |
---|
25 | #o.colour_height_quantity('stage', (lambda q:sqrt(((q['xmomentum']/(q['stage']-q['elevation'])) ** 2) + |
---|
26 | # ((q['ymomentum']/(q['stage']-q['elevation'])) ** 2)), 0, 0.5)) |
---|
27 | |
---|
28 | # Start the visualiser (in its own thread). |
---|
29 | o.start() |
---|
30 | |
---|
31 | # Wait for the visualiser to terminate before shutting down. |
---|
32 | o.join() |
---|
Note: See
TracBrowser
for help on using the repository browser.