<html><head><style> body {height: 100%; color:#000000; font-size:12pt; font-family:Times New Roman;}</style></head><body>Thank you very much Seb,<br>&nbsp;&nbsp; Indeed, I found in<br>&nbsp;&nbsp; /ParaView/install/lib/Paraview-3.14/site-packages/paraview/<br>&nbsp; lots of .py file which define the usage of ServerManager, specially servermanager.py.<br>&nbsp; ......... And it's 100% like your advice.<br><br>&nbsp; Have a nice day Seb :)<br><br>----- Original Message -----<br>From: Sebastien Jourdain &lt;sebastien.jourdain@kitware.com&gt;<br>To: Tuan Ha Tran &lt;tuan-ha.tran@insa-lyon.fr&gt;<br>Cc: paraview-developers@paraview.org, paraview@paraview.org<br>Sent: Fri, 08 Jun 2012 15:12:17 +0200 (CEST)<br>Subject: Re: [Paraview] Write xml for ParaView Plugin<br><br>Hi Tuan,<br><br>the ParaView UI and those things are two different things. There is no<br>matching at all.<br>What you can look at is inside the Python shell.<br><br>You create the proxy, and basically every property will be expose like<br>proxy.PropertyName.<br>In fact, you have the completion inside ParaView python shell to help you out.<br>Or if you prefer, you can do dir(proxy).<br>Moreover, if you use ParaViewWeb and a JavaScript console like in<br>firebug, you do have the completion as well.<br><br>proxy.set${PropertyName}( ... )<br>proxy.get${PropertyName}()<br><br>But as I said before, you need to trigger a manual update for<br>information property otherwise you will get the latest cached value or<br>the default value that you set in the XML.<br><br>Seb<br><br><br>On Fri, Jun 8, 2012 at 6:36 AM, Tuan Ha Tran <tuan-ha.tran@insa-lyon.fr> wrote:<br>&gt; Hi Seb,<br>&gt; &nbsp; I wonder if you can precise some details for me.<br>&gt; &nbsp; With information_only="1", we can tell ParaView at this property is not<br>&gt; more than a value. I do agree with you.<br>&gt; &nbsp; But where can we find this property? Does it appear somewhere so we can<br>&gt; have a look at it? I think that it will appear in the "Properties" tab, but<br>&gt; there is nothing.<br>&gt; &nbsp; So, I guess that the property may appear in the "Information tab" (below<br>&gt; the Pipeline Brower where we can find "Properties, Display and<br>&gt; Information")?<br>&gt;<br>&gt; &nbsp; Thank you very much indeed.<br>&gt;<br>&gt;<br>&gt;<br>&gt; ----- Original Message -----<br>&gt; From: Tuan Ha Tran <tuan-ha.tran@insa-lyon.fr><br>&gt; To: Sebastien Jourdain <sebastien.jourdain@kitware.com><br>&gt; Cc: paraview-developers@paraview.org, paraview@paraview.org<br>&gt; Sent: Thu, 07 Jun 2012 22:28:14 +0200 (CEST)<br>&gt; Subject: Re: [Paraview] Write xml for ParaView Plugin<br>&gt;<br>&gt; Seb,<br>&gt; &nbsp;&nbsp;&nbsp; It really what I'm looking for. I really appreciate your reply. Thank<br>&gt; you very much indeed.<br>&gt; &nbsp;&nbsp;&nbsp; I think that could help me a lot with my workings.<br>&gt; &nbsp; &nbsp; I'll give you feedbacks asap.<br>&gt; &nbsp; &nbsp; Thank you again.<br>&gt;<br>&gt;<br>&gt; ----- Original Message -----<br>&gt; From: Sebastien Jourdain <sebastien.jourdain@kitware.com><br>&gt; To: Tuan Ha Tran <tuan-ha.tran@insa-lyon.fr><br>&gt; Cc: paraview@paraview.org, paraview-developers@paraview.org<br>&gt; Sent: Thu, 07 Jun 2012 21:59:27 +0200 (CEST)<br>&gt; Subject: Re: [Paraview] Write xml for ParaView Plugin<br>&gt;<br>&gt; Hi Tuan,<br>&gt;<br>&gt; a ParaView proxy is a wrapper class that allow ParaView to abstract<br>&gt; the real location of the vtkObject that are managed by those proxies.<br>&gt; Even though you are using ParaView as a single process, its design is<br>&gt; to also work on cluster or super computer.<br>&gt;<br>&gt; Saying that, a proxy is either a regular proxy which just wrap a<br>&gt; vtkObject using properties, or it can be a sourceProxy. A source proxy<br>&gt; only handle vtkAlgorithm sub-classes which is basically any pipeline<br>&gt; filter from VTK that use OutputPort and Connection. Those sourceProxy<br>&gt; are use to compose the pipeline.<br>&gt;<br>&gt; In order to control its vtkObject a proxy use an XML descriptor that<br>&gt; name the concrete vtk class to use and list all the methods that we<br>&gt; want to be exposed into ParaView in order to control that concrete<br>&gt; object.<br>&gt; Those properties are usually use to set some values to the vtkObject<br>&gt; itself. Or eventually query the vtkObject and retrieve those values.<br>&gt; But there is no way to set and get at the same time. This is precisely<br>&gt; why you need to provide the voi (and not you ROI like I wrote) as a<br>&gt; property (unless you are using a SourceProxy and you get it from your<br>&gt; vtkAlgorithm) and get the computation result from another information<br>&gt; property.<br>&gt;<br>&gt; If that helps, you can look at that definition and the<br>&gt; vtkPVRayCastPickingHelper.h file.<br>&gt; We set a bunch of property and then we use an information property to<br>&gt; get the result of a computation. Look were we create that<br>&gt; PickingHelper and how we use it...<br>&gt;<br>&gt; + + class="vtkPVRayCastPickingHelper" processes="dataserver"&gt;<br>&gt; +<br>&gt; + Proxy used to pick a point of a surface mesh.<br>&gt; +<br>&gt; + + command="SetPointA"<br>&gt; + number_of_elements="3"<br>&gt; + default_values="0.0 0.0 0.0"&gt;<br>&gt; +<br>&gt; + + command="SetPointB"<br>&gt; + number_of_elements="3"<br>&gt; + default_values="0.0 0.0 1.0"&gt;<br>&gt; +<br>&gt; + + command="GetIntersection" information_only="1" number_of_elements="3"<br>&gt; + default_values="0.0 0.0 0.0"&gt;<br>&gt; +<br>&gt; +<br>&gt; + + command="SetInput"&gt;<br>&gt; +<br>&gt; + The input from which the selection is extracted.<br>&gt; +<br>&gt; +<br>&gt; + + command="SetSelection"&gt;<br>&gt; +<br>&gt; + The selection that is used to reduced the input.<br>&gt; +<br>&gt; +<br>&gt; +<br>&gt;<br>&gt; Hope this help,<br>&gt;<br>&gt; Seb<br>&gt;<br>&gt; On Thu, Jun 7, 2012 at 3:30 AM, Tuan Ha Tran wrote:<br>&gt;&gt; Hi Seb,<br>&gt;&gt; &nbsp; &nbsp;Thank you for your reply.<br>&gt;&gt; &nbsp; &nbsp;I'm sorry that I don't quite understand your instructions. I'm really<br>&gt;&gt; new<br>&gt;&gt; to ParaView.<br>&gt;&gt; &nbsp; &nbsp;With my little knowledge in ParaView, I'll try to understand as follow<br>&gt;&gt; :<br>&gt;&gt; &nbsp; &nbsp;- First, I have to write my .xml file with a tab that have "function"<br>&gt;&gt; declaration? So how to declare these values cause I don't understand the<br>&gt;&gt; exemples in the *.xml file (filters, writers; etc.)<br>&gt;&gt; &nbsp; &nbsp;- And then by the declaration as your instructions about<br>&gt;&gt; information_only<br>&gt;&gt; yesterday?<br>&gt;&gt;<br>&gt;&gt; &nbsp; &nbsp;Can you be a little more&nbsp;explicit? What is ROI?<br>&gt;&gt;<br>&gt;&gt; &nbsp; &nbsp;Thank you very much for your kindness.<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; ----- Original Message -----<br>&gt;&gt; From: Sebastien Jourdain<br>&gt;&gt; To: Tuan Ha Tran<br>&gt;&gt; Cc: paraview@paraview.org, paraview-developers@paraview.org<br>&gt;&gt; Sent: Thu, 07 Jun 2012 01:28:38 +0200 (CEST)<br>&gt;&gt; Subject: Re: [Paraview] Write xml for ParaView Plugin<br>&gt;&gt;<br>&gt;&gt; You should do that in two step.<br>&gt;&gt;<br>&gt;&gt; On property on your proxy where you set the ROI.<br>&gt;&gt; And one information property where you calculate...<br>&gt;&gt;<br>&gt;&gt; Seb<br>&gt;&gt;<br>&gt;&gt; On Wed, Jun 6, 2012 at 11:17 AM, Tuan Ha Tran wrote:<br>&gt;&gt;&gt; Hi everybody,<br>&gt;&gt;&gt; I'm writing some .xml ServerManager file for a ParaView Plugin.<br>&gt;&gt;&gt; Our class have a function likes this :<br>&gt;&gt;&gt; double calculate(vtkImagedata* voi) that return a double value calculated<br>&gt;&gt;&gt; from the vtkImageData.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I loaded the plugin into Paraview. I use the Python Shell and when I call<br>&gt;&gt;&gt; myReturnedValue = MyFilter.calculate(proxy) (proxy is a vtkImageData<br>&gt;&gt;&gt; type),<br>&gt;&gt;&gt; I always have the following error : AttributeError : 'function' object<br>&gt;&gt;&gt; has<br>&gt;&gt;&gt; no attribute 'calculate'<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I searched in the filters.xml and found something mention about function.<br>&gt;&gt;&gt; I<br>&gt;&gt;&gt; wonder if we can use these descriptions to access to the function (this<br>&gt;&gt;&gt; function is nothing similar to any vtk function, don't override any of<br>&gt;&gt;&gt; them). I think that I have to add something like 'function = calculate'<br>&gt;&gt;&gt; so<br>&gt;&gt;&gt; that the function is recognized in ParaView as well as Python but I can't<br>&gt;&gt;&gt; find any exemple.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Do you have any idea? Thank you in advance.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; Powered by www.kitware.com<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Visit other Kitware open-source projects at<br>&gt;&gt;&gt; http://www.kitware.com/opensource/opensource.html<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>&gt;&gt;&gt; http://paraview.org/Wiki/ParaView<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Follow this link to subscribe/unsubscribe:<br>&gt;&gt;&gt; http://www.paraview.org/mailman/listinfo/paraview<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;<br><br></tuan-ha.tran@insa-lyon.fr></sebastien.jourdain@kitware.com></sebastien.jourdain@kitware.com></tuan-ha.tran@insa-lyon.fr></tuan-ha.tran@insa-lyon.fr></body></html>