[Paraview] Modifying (and python-wrapping) vtkPVProcessModulePythonHelper

Berk Geveci berk.geveci at kitware.com
Thu Aug 9 13:21:50 EDT 2007


> I am looking forward to see the documentation and the new changes.
> (Hope I will not have to rewrite my project from scratch. :-)

I am starting to work on the documentation. I hope to have something
by next week. The idea is to make it easier for people to write python
scripts for paraview. So, part of the work is to augment the python
functionality, other part is to make it simpler and nicer to use. Here
are two scripts that will produce identical results:

================= old
import paraview

paraview.ActiveConnection = paraview.Connect()
pm = paraview.pyProxyManager()
s = pm.CreateProxy("sources", "SphereSource")
s.SetRadius(5)
center = s.GetCenter()
center[1] = 2
s.SetCenter(center)

================ new
from paraview import servermanager

servermanager.Connect()
s = servermanager.sources.SphereSource()
s.Radius = 5
s.Center[1] = 2

Furthermore, the new module allows things like
help(servermanager.sources.SphereSource) to get the documentation.

So, switching to the new module will require changing code due to API
changes but in the long run, it will make coding easier.

-berk

> On 08/08/07, Berk Geveci <berk.geveci at kitware.com> wrote:
> > That class is not wrapped and is not a good candidate to add methods
> > accessible in Python. vtkProcessModule is probably a better place.
> > What are you trying to add?
> > By the way, I am completely re-writing the python modules (the old one
> > will stay, I am not touching that). I will have documentation
> > available very soon.
> >
> > -berk
> >
> >
> > On 8/8/07, Milan Frank <milan.frank at gmail.com> wrote:
> > > Hi,
> > >
> > > I am trying to add few methods into the vtkPVProcessModulePythonHelper
> > > class and make them accessible from Python. Unfortunately, the new
> > > (simple) methods, I have added, are not visible from python.
> > >
> > > I suppose, this particular class is not explicitly specified for
> > > python wrapping. Where should I add it?
> > >
> > > I tried to add it in the same way as I have already added numerous
> > > classes from VTK directory. It seems it does not work for classes
> > > outside of the VTK directory. I am getting error message: "Do not know
> > > how to build .../vtkPVProcessModulePythonHelper.h". (I have not forgot
> > > to add "${PARAVIEW_SOURCE_DIR}/Utilities/VTKPythonWrapping/Executable"
> > > path into the INCLUDE_DIRECTORIES.)
> > >
> > > Any hints would be much appreciated,
> > > Milan.
> > > _______________________________________________
> > > ParaView mailing list
> > > ParaView at paraview.org
> > > http://www.paraview.org/mailman/listinfo/paraview
> > >
> >
>


More information about the ParaView mailing list