[Paraview] pvpython and vtk classes and functions to create objects

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Jun 14 15:36:27 EDT 2016


Yes, you just need to import the appropriate module in python.
e.g.

 @exportRpc("my.test.rpc")
    def myTestRPCFunction(self):

        from paraview.vtk.vtkIOImage import vtkImageReader2Factory
        reader = vtkImageReader2Factory.CreateImageReader(filename)

        from paraview.vtk.vtkFiltersTexture import vtkTextureMapToPlane
        texturePlane.SetInputConnection(reader.GetOutputPort())

        ....

        return 0

On Sun, Jun 5, 2016 at 7:45 PM, Rodrigo Pelorosso
<rodrigo.pelorosso at gmail.com> wrote:
> Hi!
>
> Is there a way to use python VTK functions and classes in paraview?  I'm
> using paraview through paraviewweb and I've created an RPC that I can call
> from the client to run paraview python code:
>
> @exportRpc("my.test.rpc")
>     def myTestRPCFunction(self):
>         return 0
>
> I would like to create, inside this RPC, a plane with a texture applied.
> Searching the mailing list I found this thread,
>
> https://cmake.org/pipermail/paraview/2011-April/020848.html
>
> were someone's trying to accomplish this from a reader written in C++, but I
> would really like to do something like that inside my RPC, is that possible?
>
> Thank you!
> Rodrigo
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>


More information about the ParaView mailing list