<div dir="ltr"><div>Why is it so complicated to call a procedure and receive a return value on the client?<br><br></div>I am attaching my attempt (CMakeLists.txt, vtkSquareFun.cxx, vtkSquareFun.h and TestPlugin.xml, each less than 20 lines of code), which basically calculates the square of an argument in vtkSquareFun::eval(double x).<br><br>When I load this plugin in Paraview and open the Python Shell, I can evaluate vtkSquareFun::eval() using a detour by first setting the argument and then getting the result, which is linked to the argument property in TestPlugin.xml:<br><br>fun=servermanager.CreateProxy(<wbr>"test","SquareFun")<br>fun.GetProperty("Arg").<wbr>SetElement(0,999)<br>fun.UpdateVTKObjects()<br>fun.UpdatePropertyInformation(<wbr>)<br>fun.GetProperty("Result").<wbr>GetElement(0)<br><div><div><div><div><div class="gmail_extra">... showing the correct result 998001.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Why can't I simply run the following?<br>fun=servermanager.CreateProxy(<wbr>"test","SquareFun")<br></div><div class="gmail_extra">result=fun.InvokeCommand("<wbr>eval",[999.0])<br><br></div><div class="gmail_extra">Does Paraview really not provide any means of calling a function with arguments and return value within a single client-server communication? All these individual message transfers are a bottleneck in our application. Does the Paraview architecture exclude more universal remote procedure calls, or do you think that one could just augment the available procedures with another procedure that can deliver a set of custom return values?<br><br></div><div class="gmail_extra">Thanks<br></div><div class="gmail_extra">Mario<br><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">2016-12-07 7:34 GMT+01:00 Mario Schreiber <span dir="ltr"><<a href="mailto:schreibermario40@gmail.com" target="_blank">schreibermario40@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Hello,<br></div>I have a use case, where a vtkObject on the server implements a method like<br><br></div>std::string doSomething(std::string arg);<br><br></div>Now, with a proxy prx on the client forĀ that class, I would like to call the remote procedure similar to<br><br></div>result=prx.InvokeCommand("doSo<wbr>mething",[arg])<br><br></div>Is something like this possible?<br></div>I found a very complicated workaround by first defining the arguments as properties, defining the result as information_only property linked to on of the args, then calling "UpdateVTKObjects" to push the arguments and finally "UpdateInformationProperties" to pull the result. Is there an easier solution, possible with a short example?<br><br></div>Thank you<span class="m_-9076177061360779234gmail-HOEnZb"><font color="#888888"><br></font></span></div><span class="m_-9076177061360779234gmail-HOEnZb"><font color="#888888">Mario<br></font></span></div>
</blockquote></div><br></div></div></div></div></div></div>