<html><head><style> body {height: 100%; color:#000000; font-size:12pt; font-family:Times New Roman;}</style></head><body>Seb,<br> It really what I'm looking for. I really appreciate your reply. Thank 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>+ <proxy name="PickingHelper" <br="">+ class="vtkPVRayCastPickingHelper" processes="dataserver"><br>+ <documentation><br>+ Proxy used to pick a point of a surface mesh.<br>+ </documentation><br>+ <doublevectorproperty name="PointA" <br="">+ command="SetPointA"<br>+ number_of_elements="3"<br>+ default_values="0.0 0.0 0.0"><br>+ </doublevectorproperty><br>+ <doublevectorproperty name="PointB" <br="">+ command="SetPointB"<br>+ number_of_elements="3"<br>+ default_values="0.0 0.0 1.0"><br>+ </doublevectorproperty><br>+ <doublevectorproperty name="Intersection" <br="">+ command="GetIntersection" information_only="1" number_of_elements="3"<br>+ default_values="0.0 0.0 0.0"><br>+ </doublevectorproperty><br>+ <property name="Update" command="ComputeIntersection"></property><br>+ <proxyproperty name="Input" <br="">+ command="SetInput"><br>+ <documentation><br>+ The input from which the selection is extracted.<br>+ </documentation><br>+ </proxyproperty><br>+ <proxyproperty name="Selection" <br="">+ command="SetSelection"><br>+ <documentation><br>+ The selection that is used to reduced the input.<br>+ </documentation><br>+ </proxyproperty><br>+ </proxy><br><br>Hope this help,<br><br>Seb<br><br>On Thu, Jun 7, 2012 at 3:30 AM, Tuan Ha Tran <tuan-ha.tran@insa-lyon.fr> 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 new<br>> to ParaView.<br>> With my little knowledge in ParaView, I'll try to understand as follow :<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 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 <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 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 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' 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></tuan-ha.tran@insa-lyon.fr></sebastien.jourdain@kitware.com></tuan-ha.tran@insa-lyon.fr></body></html>