Changeset 2267
- Timestamp:
- Jan 23, 2006, 3:07:17 PM (19 years ago)
- Location:
- inundation/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/vtk_realtime_visualiser.py
r2266 r2267 52 52 self.idle = threading.Event() 53 53 self.redraw_ready = threading.Event() 54 self.unpaused = threading.Event() 55 self.unpaused.set() 54 56 55 57 # Internal use - storage of vtk objects … … 106 108 107 109 self.quitButton = Tkinter.Button(self.root, text='Quit', command=self.shutdown) 108 self.quitButton.pack(side=Tkinter.BOTTOM) 110 self.quitButton.pack(side=Tkinter.RIGHT) 111 112 self.pauseButton = Tkinter.Button(self.root, text='Pause', command=self.unpaused.clear) 113 self.pauseButton.pack(side=Tkinter.LEFT) 114 115 self.resumeButton = Tkinter.Button(self.root, text='Resume', command=self.unpaused.set) 116 self.resumeButton.pack(side=Tkinter.LEFT) 109 117 110 118 def add_axes(self): … … 142 150 else: 143 151 scale = self.default_scale_z 144 145 self.grids[q] = make_vtkpoints(self.N_tri, 146 self.N_vert, 147 scale, 148 self.domain.quantities[q].vertex_values, 149 self.vert_index, 150 self.domain.triangles) 152 ############################################################# 153 # Disabled the make_vtkpoints call because the extension is 154 # difficult to get to link under windows 155 ############################################################# 156 #self.grids[q] = make_vtkpoints(self.N_tri, 157 # self.N_vert, 158 # scale, 159 # self.domain.quantities[q].vertex_values, 160 # self.vert_index, 161 # self.domain.triangles) 162 #grid = self.grids[q] 163 ############################################################# 164 165 qty_index = zeros(self.N_vert, Float) 166 for n in range(self.N_tri): 167 for v in range(3): 168 qty_index[self.domain.triangles[n][v]] = self.domain.quantities[q].vertex_values[n][v] 169 170 self.grids[q] = vtk.vtkPoints() 151 171 grid = self.grids[q] 152 ################################################### 153 # Obsoleted by vtk_visualiser_ext and make_vtkpoints 154 ################################################### 155 #qty_index = zeros(self.N_vert, Float) 156 #for n in range(self.N_tri): 157 # for v in range(3): 158 # qty_index[self.domain.triangles[n][v]] = self.domain.quantities[q].vertex_values[n][v] 159 #self.grids[q] = vtk.vtkPoints() 160 #grid = self.grids[q] 161 #for v in range(self.N_vert): 162 # grid.InsertNextPoint(self.vert_index[v][0], 163 # self.vert_index[v][1], 164 # qty_index[v] * scale) 165 ################################################### 172 173 for v in range(self.N_vert): 174 grid.InsertNextPoint(self.vert_index[v][0], 175 self.vert_index[v][1], 176 qty_index[v] * scale) 166 177 167 178 # Can't recycle vtkPolyData objects: Apparently they behave … … 211 222 self.domain.visualise = False 212 223 self.idle.set() 224 self.unpaused.set() 213 225 self.root.withdraw() 214 226 self.root.quit() -
inundation/pyvolution/vtk_visualiser_ext.cpp
r2266 r2267 1 /* 2 * Additional functions used by the VTK visualiser 3 * currently not used, since it is a pain to link on windows 4 * 5 */ 6 1 7 #include "Python.h" 2 8 #include "Numeric/arrayobject.h"
Note: See TracChangeset
for help on using the changeset viewer.