Changeset 2220


Ignore:
Timestamp:
Jan 18, 2006, 2:11:39 PM (19 years ago)
Author:
steve
Message:

Moving visualisation

Location:
inundation
Files:
66 added
3 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/netherlands.py

    r2215 r2220  
    8383N = 130 #size = 33800
    8484N = 600 #Size = 720000
    85 N = 25
     85N = 20
    8686
    8787
     
    171171
    172172
    173 for t in domain.evolve(yieldstep = 0.005, finaltime = 1.0):
     173for t in domain.evolve(yieldstep = 0.005, finaltime = None):
    174174    domain.write_time()
    175175    #domain.write_boundary()
  • inundation/pyvolution/shallow_water_vtk.py

    r2214 r2220  
    6161
    6262        self.distribute_to_vertices_and_edges()
    63         #s = '''for x in range(5):
    64 #  self.distribute_to_vertices_and_edges()'''
    65 #        global profiler
    66 #        profiler = profiler.runctx(s, globals(), locals())
    6763
    6864        #Initialise real time viz if requested
  • inundation/pyvolution/vtk_realtime_visualiser.py

    r2214 r2220  
    1616    setup: Dictionary mapping quantity name -> boolean.
    1717    if setup[q] is true, draw the quantity when the visualiser starts.
    18    
     18
    1919    updating: Dictionary mapping quantity name -> boolean.
    2020    if updating[q] is true, update the rendering of this quantity each
    2121    timestep.
    22    
     22
    2323    qcolor: Dictionary mapping quantity name -> (float, float, float)
    2424    if the name of a quantity is found in qcolor, the colour specified (in
    2525    (r, g, b) from 0.0 to 1.0) is used for display of that quantity instead of
    2626    (0.5, 0.5, 0.5) (the default)
    27        
     27
    2828    scale_z: Dictionary mapping quantity name -> float
    2929    Override the z scaling of this quantity with the float specified.
     
    5050        self.idle = threading.Event()
    5151        self.redraw_ready = threading.Event()
    52        
     52
    5353        # Internal use - storage of vtk objects
    5454        self.grids = {}
     
    7777        self.range_y = self.max_y - self.min_y
    7878        self.range_xy = max(self.range_x, self.range_y)
    79        
     79
    8080    def run(self):
    8181        self.initialise_gui()
    8282        self.add_axes()
    8383        self.setup_all()
    84         self.root.after(100, self.idle.set)
     84        self.root.after(1, self.idle.set)
    8585        self.root.mainloop()
    8686
     
    8888        """Prepare the GUI for the Visualiser, and set up the
    8989        renderer.
    90        
     90
    9191        """
    9292        # Using the TK VTK widget allows extendability
     
    9595
    9696        # Message handling with after
    97         self.root.after(100, self.redraw)
    98        
     97        self.root.after(1, self.redraw)
     98
    9999        self.renderWidget = vtkTkRenderWidget(self.root, width=400, height=400)
    100100        self.renderWidget.pack(expand='true', fill='both')
     
    105105        self.quitButton = Tkinter.Button(self.root, text='Quit', command=self.shutdown)
    106106        self.quitButton.pack(side=Tkinter.BOTTOM)
    107        
     107
    108108    def add_axes(self):
    109109        """Add axes to this Visualiser
     
    150150        else:
    151151            scale = self.default_scale_z
    152                
     152
    153153        for v in range(self.N_vert):
    154154            grid.InsertNextPoint(self.vert_index[v][0],
     
    161161        self.polydata[q] = vtk.vtkPolyData()
    162162        polydata = self.polydata[q]
    163        
     163
    164164        polydata.SetPoints(grid)
    165165        polydata.SetPolys(self.cells)
     
    193193                if self.updating[q]:
    194194                    self.draw_quantity(q)
    195        
     195
    196196            self.renderWindow.Render()
    197197            self.root.update_idletasks()
Note: See TracChangeset for help on using the changeset viewer.