[Paraview] ParaViewSocketPlugin

Pat Marion pat.marion at kitware.com
Thu Dec 6 07:57:54 EST 2012


Yes, you can send information back through the socket.  If you're using the
socket to invoke python code, then any string returned by your python code
will be written to the socket.  But, by default the python handler method
doesn't return anything.  If you edit pqPythonSocketHandler.cxx, you can
change the python handler function that is used.  Just put some code like
this at the top of onSocketReadReady():

  PyObject* mainModule = PyImport_AddModule("__main__");
  PyObject* mainDict = PyModule_GetDict(mainModule);
  this->Internal->Callback = PyDict_GetItemString(mainDict, "myFunction");

That will make the socket forward the string to a python function you've
implemented called "myFunction()", and any string returned by that will be
written to the socket.

Pat

On Thu, Dec 6, 2012 at 12:42 AM, Felipe Bordeu
<felipe.bordeu at ec-nantes.fr>wrote:

> hi everybody,
>
> I'm using the great plugin ;) ParaViewSocketPlugin, to control ParaView.
> But now I will like to have some information sent back to the client.  I
> look at the sources but I couldn't figure out the way to do it.
>
> Is this possible, using the plugin (or some minor modifications) ???
>
> Felipe
>
> --
> Felipe Bordeu Weldt
> Ingénieur de Recherche
> ------------------------------**-------
> Tél. : 33 (0)2 40 37 16 57
> Fax. : 33 (0)2 40 74 74 06
> Felipe.Bordeu at ec-nantes.fr
> Institut GeM - UMR CNRS 6183
> École Centrale Nantes
> 1 Rue de La Noë, 44321 Nantes, FRANCE
> ------------------------------**-------
>
> ______________________________**_________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/**ParaView <http://paraview.org/Wiki/ParaView>
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/**mailman/listinfo/paraview<http://www.paraview.org/mailman/listinfo/paraview>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20121206/75771631/attachment.htm>


More information about the ParaView mailing list