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