Changeset 2196
- Timestamp:
- Jan 10, 2006, 5:10:54 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/vtk_realtime_visualiser.py
r2195 r2196 11 11 12 12 """A VTK-powered visualiser, designed to replace the VPython one. 13 Intended to be run in its own thread 13 Intended to be run in its own thread. 14 15 Customisation options for the visualiser are as follows: 16 17 setup: Dictionary mapping quantity name -> boolean. 18 if setup[q] is true, draw the quantity when the visualiser starts. 19 20 updating: Dictionary mapping quantity name -> boolean. 21 if updating[q] is true, update the rendering of this quantity each 22 timestep. 23 24 qcolor: Dictionary mapping quantity name -> (float, float, float) 25 if the name of a quantity is found in qcolor, the colour specified (in 26 (r, g, b) from 0.0 to 1.0) is used for display of that quantity instead of 27 (0.5, 0.5, 0.5) (the default) 28 29 scale_z: Dictionary mapping quantity name -> float 30 Override the z scaling of this quantity with the float specified. 31 32 default_scale_z: float 33 multiply all z coordinates by this amount unless an overriding value 34 exists in scale_z. 14 35 """ 15 36 16 37 def __init__(self, domain, default_scale_z=1.0, rect=None, title='Test'): 17 38 threading.Thread.__init__(self) 18 # Initialise data structures. coloring,setup and updating are maps39 # Initialise data structures. setup and updating are maps 19 40 # quantity name -> boolean, setup means to render it, 20 41 # update means to update with time. 21 42 # qcolor maps quantity name -> (float, float, float): the colour (r, g, b) 22 # to render a quantity.23 43 self.setup = {} 24 44 self.updating = {} 25 self.coloring = {}26 45 self.qcolor = {} 27 46 self.scale_z = {} … … 30 49 self.vertices = domain.vertex_coordinates 31 50 51 # Message queue 32 52 self.messages = Queue() 33 53 … … 42 62 self.setup[x] = False 43 63 self.updating[x] = False 44 self.qcolor[x] = (0.0, 0.0, 0.0)45 self.coloring[x] = False46 64 47 65 # Bounding box. … … 158 176 actor.SetMapper(mapper) 159 177 160 if self. coloring[q] is True:178 if self.qcolor.has_key(q): 161 179 actor.GetProperty().SetColor(self.qcolor[q]) 162 180 else:
Note: See TracChangeset
for help on using the changeset viewer.