← Back to team overview

dolfin team mailing list archive

Re: Plotting works for elasticity demo

 

Garth N. Wells skrev den 26/04-2007 følgende:
> 
> 
> Ola Skavhaug wrote:
> >Garth N. Wells skrev den 26/04-2007 følgende:
> >>
> >>Ola Skavhaug wrote:
> >>>Garth N. Wells skrev den 26/04-2007 følgende:
> >>>
> >>>[snip] 
> >>>
> >>>>Looks like a problem with my VTK-Python bindings. I get
> >>>>
> >>>> >python2.4 -c "import viper; print viper.__file__"
> >>>> Traceback (most recent call last):
> >>>>   File "<string>", line 1, in ?
> >>>>   File "/usr/lib/python2.4/site-packages/viper/__init__.py", line 1, 
> >>>>   in ?
> >>>>     from viper import *
> >>>>   File "/usr/lib/python2.4/site-packages/viper/viper.py", line 10, in  
> >>>>   ?
> >>>>     import vtk
> >>>> ImportError: No module named vtk
> >>>>
> >>>>My python-vtk package is for Python 2.5, whereas I'm using Python 2.4 
> >>>>due to the SWIG bug. If I do
> >>>>
> >>>> python -c "import viper; print viper.__file__"
> >>>>
> >>>>I get
> >>>>
> >>>> /usr/lib/python2.5/site-packages/viper/__init__.pyc
> >>>>
> >>>>Garth
> >>>It looks like you just updated your ubuntu distro to Feisty Fawn. I 
> >>>heared
> >>>that VTK is not properly built for python 2.5 there. Perhaps it is 
> >>>better to
> >>>wait for the packages to be fixed what trying to work out a hack.
> >>>
> >>I have it working now (built the wrappers using Python 2.4, the switched 
> >>to 2.5).
> >>
> >>Viper works great! Is it easy to send a snapshot to a file? Can it be 
> >>called from C++?
> >
> >Sending a snapshot to a file is easy; just press the "i" (for image) key. I
> >added this today (previously the "p" key was used, but that is a vtk 
> >keypress
> >event that cannot be turned off). Pressing "h" will display the 
> >keybindings.
> >
> 
> Are the key bindings all defined by Viper, or are some defined VTK?  If 
> some are VTK, is there a list somewhere?

There are only a few Viper specific key bindings. The rest are default VTK.
I've ripped the exact text from the documentation into the help text that is
displayed when pressing h. See also:

http://www.vtk.org/doc/nightly/html/classvtkInteractorStyle.html

Ola
 
> Garth
> 
> >It should be possible to use Viper from C++, but, in that case, a Python
> >interpreter must be embedded in a library somehow. I have never done this.
> > 
> >Ola
> >
> >>Garth
> >>
> >>
> >>>Ola
> >>>
> >>
> >
> 
> -


References