Indeed the VTK online doxygen is very useful. Is there any way in python of getting the name of the class of the object I'm dealing with ? That way I can find the class documentation in the Doxygen ?<br>Thanks again,<br>
Jacques<br><br><div class="gmail_quote">2008/11/13 David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There is probably a python way to get help more easily, but one way to<br>
figure it out is to look at the VTK doxygen documentation for<br>
vtkDataObject and it's subclasses, and realize that all (or almost<br>
all) of the public C++ methods are wrapped into python and therefore<br>
available to use.<br>
<br>
cheers,<br>
Dave<br>
<div><div></div><div class="Wj3C7c"><br>
On 11/13/08, Jacques Papper <<a href="mailto:jacques.papper@gmail.com">jacques.papper@gmail.com</a>> wrote:<br>
> Thanks a lot Utkarsh !<br>
><br>
> It works. I was almost there, but I couldn't figure out a way to expose the<br>
> available interface for each object!<br>
> Where am I supposed to look to figure out that CopyStructure(), and<br>
> NewInstance(), SetBlock() etc ... are functions available ?<br>
><br>
> Kind regards,<br>
> Jacques Papper<br>
><br>
><br>
> 2008/11/13 Utkarsh Ayachit <<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>><br>
><br>
> > Jacques,<br>
> ><br>
> > Couple of ways to solve your problem:<br>
> ><br>
> > * Solution One:<br>
> > If you don't want to deal with the fact that your data is a<br>
> vtkMultiblockDataSet, apply the "Merge Blocks" filter after each of the<br>
> "Extract Block" filters and then connect to the "Programmable Filter" to to<br>
> the output from the "Merge Blocks" and then your current script should work<br>
> just fine. The "Merge Blocks" will convert the vtkMultiBlockDataSet to a<br>
> vtkUnstructuredGrid on which your script is applicable.<br>
> ><br>
> > * Solution Two:<br>
> ><br>
> > input0 = self.GetInputDataObject(0,0)<br>
> > input1 = self.GetInputDataObject(0,1)<br>
> > output = self.GetOutputDataObject(0)<br>
> ><br>
> > input0Block0 = input0.GetBlock(0)<br>
> > input1Block0 = input1.GetBlock(0)<br>
> ><br>
> > output.CopyStructure(input0)<br>
> > outputBlock0 = input0Block0.NewInstance()<br>
> > outputBlock0.CopyStructure(input0Block0)<br>
> > output.SetBlock(0, outputBlock0)<br>
> ><br>
> ><br>
> outputBlock0.GetPointData().AddArray(input0Block0.GetPointData().GetArray("pressure1"))<br>
> ><br>
> outputBlock0.GetPointData().AddArray(input1Block0.GetPointData().GetArray("pressure2"))<br>
> ><br>
> > The above script will work if you are extracting a single block using the<br>
> Extract Block filter. If you want to merge arrays for all the blocks in the<br>
> input you'll have to iterate over the datasets in the vtkMultiblockDataset.<br>
> Take a look at<br>
> ><br>
> <a href="http://www.paraview.org/Wiki/Python_Programmable_Filter#Dealing_with_Composite_Datasets" target="_blank">http://www.paraview.org/Wiki/Python_Programmable_Filter#Dealing_with_Composite_Datasets</a><br>
> ><br>
> > Utkarsh<br>
> ><br>
> ><br>
> > Jacques Papper wrote:<br>
> ><br>
> > ><br>
> > > Here is what I am doing at the moment.<br>
> > > -Load geometry 1<br>
> > > -Extract wing block<br>
> > ><br>
> > > -Load geometry 2<br>
> > > -Extract wing block<br>
> > ><br>
> > > Then use the resample filter with wing1 as input and wing2 as source<br>
> > > (this works)<br>
> > ><br>
> > > The last bit is missing (that is merging the data from wing2 with the<br>
> resampled data)<br>
> > ><br>
> > > Jacques<br>
> > ><br>
> > > 2008/11/13 Berk Geveci <<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a><br>
> <mailto:<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>>><br>
> > ><br>
> > ><br>
> > > Programmable filter can still be made to work. Do the datasets have<br>
> > > multiple parts? I am not sure how resampling would work with multiple<br>
> > > parts. It is impossible to guess which parts map to which parts...<br>
> > ><br>
> > > -berk<br>
> > ><br>
> > > On Thu, Nov 13, 2008 at 8:28 AM, Jacques Papper<br>
> > ><br>
> > > <<a href="mailto:jacques.papper@gmail.com">jacques.papper@gmail.com</a><br>
> <mailto:<a href="mailto:jacques.papper@gmail.com">jacques.papper@gmail.com</a>>> wrote:<br>
> > > > They are multi-block datasets from Ensight Reader.<br>
> > > > Is there another way of dealing with this then ?<br>
> > > > Jacques<br>
> > > ><br>
> > > > 2008/11/13 Berk Geveci <<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a><br>
> > > <mailto:<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>>><br>
> > ><br>
> > > >><br>
> > > >> Are the inputs multi-block datasets by any chance?<br>
> > > >><br>
> > > >><br>
> > > >> -berk<br>
> > > >><br>
> > > >> On Thu, Nov 13, 2008 at 6:03 AM, Jacques Papper<br>
> > ><br>
> > > >> <<a href="mailto:jacques.papper@gmail.com">jacques.papper@gmail.com</a><br>
> <mailto:<a href="mailto:jacques.papper@gmail.com">jacques.papper@gmail.com</a>>> wrote:<br>
> > > >> > Hi Berk,<br>
> > > >> ><br>
> > > >> > I am trying out your suggestion of merging arrays :<br>
> > > >> ><br>
> > > >> > input0 = self.GetInputDataObject(0,0)<br>
> > > >> > input1 = self.GetInputDataObject(0,1)<br>
> > > >> > output = self.GetOutputDataObject(0)<br>
> > > >> ><br>
> > > >> ><br>
> > ><br>
> output.GetPointData().AddArray(input0.GetPointData().GetArray("pressure1"))<br>
> > > >> ><br>
> > > >> ><br>
> > ><br>
> output.GetPointData().AddArray(input1.GetPointData().GetArray("pressure2"))<br>
> > > >> ><br>
> > > >> > but I get the following error message :<br>
> > > >> ><br>
> > > >> > File "<string>", line 2, in <module><br>
> > > >> > File "<string>", line 4, in RequestData<br>
> > > >> > AttributeError: GetPointData<br>
> > > >> ><br>
> > > >> > I also tried just using the programmable filter on one source<br>
> > > and with<br>
> > > >> > the<br>
> > > >> > following code, and I get the same error :<br>
> > > >> ><br>
> > > >> > input0=self.GetInputDataObject(0,0)<br>
> > > >> > input0.GetPointData()<br>
> > > >> ><br>
> > > >> > I am using version 3.4.0<br>
> > > >> ><br>
> > > >> ><br>
> _______________________________________________<br>
> > > >> > ParaView mailing list<br>
> > > >> > <a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a> <mailto:<a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a>><br>
> > ><br>
> > > >> ><br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
> > > >> ><br>
> > > >> ><br>
> > > ><br>
> > > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> ------------------------------------------------------------------------<br>
> > ><br>
> > ><br>
> > > _______________________________________________<br>
> > > ParaView mailing list<br>
> > > <a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a><br>
> > > <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
> > ><br>
> ><br>
><br>
><br>
> _______________________________________________<br>
> ParaView mailing list<br>
> <a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a><br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
><br>
<br>
<br>
</div></div><font color="#888888">--<br>
David E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
28 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-371-3971 x109<br>
</font></blockquote></div><br>