Changeset 2196


Ignore:
Timestamp:
Jan 10, 2006, 5:10:54 PM (19 years ago)
Author:
jack
Message:

Removed redundant dictionary
Added large and relevant class docstring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/vtk_realtime_visualiser.py

    r2195 r2196  
    1111
    1212    """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.
    1435    """
    1536
    1637    def __init__(self, domain, default_scale_z=1.0, rect=None, title='Test'):
    1738        threading.Thread.__init__(self)
    18         # Initialise data structures. coloring, setup and updating are maps
     39        # Initialise data structures. setup and updating are maps
    1940        # quantity name -> boolean, setup means to render it,
    2041        # update means to update with time.
    2142        # qcolor maps quantity name -> (float, float, float): the colour (r, g, b)
    22         # to render a quantity.
    2343        self.setup = {}
    2444        self.updating = {}
    25         self.coloring = {}
    2645        self.qcolor = {}
    2746        self.scale_z = {}
     
    3049        self.vertices = domain.vertex_coordinates
    3150
     51        # Message queue
    3252        self.messages = Queue()
    3353
     
    4262            self.setup[x] = False
    4363            self.updating[x] = False
    44             self.qcolor[x] = (0.0, 0.0, 0.0)
    45             self.coloring[x] = False
    4664
    4765        # Bounding box.
     
    158176            actor.SetMapper(mapper)
    159177
    160             if self.coloring[q] is True:
     178            if self.qcolor.has_key(q):
    161179                actor.GetProperty().SetColor(self.qcolor[q])
    162180            else:
Note: See TracChangeset for help on using the changeset viewer.