python - Updating Points of TVTK Dataset in MayaVI (without flushing pipeline) -


I want to use for the visualization of elusive large simulation data I, which Vitike Ustrcchard grid (or even Tivitike Anstrkted grid) Has been saved as. After loading the grid, I want to update the grid points quickly using the node array without changing anything else in the model.

So far, I update the points and then call the modified () - method, which flies the entire pipeline and thus makes the visualization very slow. My question is now: Is there a chance to update the digits in the VTK dataset without reloading the entire pipeline?

I am visualizing using symptoms; My code looks like made simpler:

  Import numpy enthought.traits.api import HasTraits, range, example, see imported enthite.traits.ui.api, Item, HGroup, HSplit as N on_trait_change P, enthought.mayavi.core.ui.mayavi_scene import enthought.mayavi import enthought.tvtk.api import tvtk from enthought mlab enthought.tvtk from enthought.mayavi.tools.mlab_scene_model import MlabSceneModel from MayaviScene. pyface.scene_editor import enthought.tvtk.pyface.scene_editor import VSplit from SceneEditor SceneEditor class Visu (HasTraits) .mayavi.modules.surface imported surface: timestep = range (50,l00,50) points = tvtk.Points () ugrid = tvtk. UnstructuredGrid () View = Example (MlabSceneModel, ()) View Shy = (see item ( "Views", editor = SceneEditor (scene_class = MayaviScene), height = 250, width = 300, show_label = true), HGroup ( '_', 'Timestep'), resizable = true) @ on_trait_change ( 'scene.activated') def ini (self): filename = 'original3dplot' reader = tvtk.LSDyn aReader (file_name = file name) reader.update () self.ugrid = reader.get_output () self.surface = Self.scene.mlab.pipeline.surface (self.ugrid) @on_trait_change ('timestep') def update_visu (auto): update_coord = np.loadtxt ('newcoordinates' + str (self.timestep)) self.pts.from_array ( Update_coord) self.ugrid.points = self.pts self.ugrid.modified () view = VISU () visualization.configure_traits ()  


Comments