Dear friends of Mayavi, dear Prabhu,
We would like to plot some data (say a vector field on a mesh) using
Mayavi while a simulation computes the time development of that field.
In particular, every now and then we would like to update the data that is
displayed in the mayavi window. (We can do this and if there is interest I
can email out a very basic example showing hows this can be done; just let
me know).
So the idea is this (assuming we have a simulation that computers the
time development of a vector field):
(i) fire up mayavi and display initial vectorfield
(ii) start simulation for n simulation time steps
(iii) update the data in mayavi so that the display window shows the most
recent data
(iv) carry on with simulation for n simulation time steps
(v) go back to (iii).
All this is working, but(!) while our simulation carries on (step (iv)),
we can't interact with the Mayavi window. In particular, we can't zoom in
and out and rotate the scene.
This is what I would like to be able to do.
Any suggestions?
I provide two small examples that (I believe) demonstrate the underlying
difficulty. Here is the first one:
import mayavi
my_mayavi = mayavi.mayavi()
my_mayavi.open_vtk('heart.vtk')
my_mayavi.load_module('SurfaceMap')
import time
time.sleep(60)
This just opens a mayavi window and displays a surface map of the scalar
data in the 'heart.vtk' data set that comes with Mayavi. Note the last
line: The sleep command imitates our simulation running, i.e. there is
some other activity going on before we update the data in the mayavi
windows (this last part is not represented in the program above). While
the sleep command is running, the MAyavi windows is displayed, but one
cannot interact with it. This is the problem we'd like to solve.
There is a 'solution' to the small problem presented here (but it doesn't
solve the big problem with the interactive display of real-time simulation
data):
import mayavi
my_mayavi = mayavi.mayavi()
my_mayavi.open_vtk('heart.vtk')
my_mayavi.load_module('SurfaceMap')
raw_input()
This program (identical to the one above, apart from the last two lines),
allows to interact with Mayavi once the raw_input() command has been
reached. However, we can't use this for our simulation, because we want to
compute stuff instead of waiting for thhe user to respond to raw_input().
Any suggestion welcome. If there is no simple solution to this, I'd like
to hear that, too.
Many thanks,
Hans
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users