What you are doing to the DataObjectGenerator and Fetch command isn't going to work out. Fetch is creating a copy, it's not giving you access to the real data object.<br><br>Here is a trick you can do, it only works if you are running paraview with a builtin server. A real, true builtin server, not the fancy new mpi builtin server. When client and server share the same memory space, you can use GetClientSideObject() to get the "server side" vtk object belonging to a paraview object.<br>
<br>mb = get_manipulated_vtkmultiblock_from_someplace()<br><br>t = TrivialProducer()<br>filter = t.GetClientSideObject() # filter is a vtkTrivialProducer<br>filter.SetOutput(mb)<br>t.UpdatePipeline()<br><br>Now you can attach paraview filters to the trivial producer.<br>
<br>Pat<br><br><div class="gmail_quote">On Wed, Feb 9, 2011 at 4:59 PM, Tim Gallagher <span dir="ltr"><<a href="mailto:tim.gallagher@gatech.edu">tim.gallagher@gatech.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div style="font-family: Times New Roman; font-size: 12pt; color: rgb(0, 0, 0);">We had looked at the programmable source, but we didn't know how to access the XDMFReader. But, with what you pointed out, it looks like that isn't hard so I'll give it a shot.<br>
<br>Out of curiosity, what is wrong with the approach I was trying? Is it possible to completely copy information from one source in a pipeline into another source in a pipeline and delete the original source? Why does Fetch() show data inside the DataObjectGenerator but no filter can seem to access it?<br>
<br>Thanks for the help,<br><br>Tim<br><br><hr><b>From: </b>"pat marion" <<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>><br><b>To: </b><a href="mailto:gtg085x@mail.gatech.edu" target="_blank">gtg085x@mail.gatech.edu</a><br>
<b>Cc: </b><a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><br><b>Sent: </b>Wednesday, February 9, 2011 4:55:05 PM<br><b>Subject: </b>Re: [Paraview] Scripting and new VTK objects<div><div></div>
<div class="h5"><br><br>Hi Tim,<br><br>Have you looked at the python programmable source? With the python programmable source you can specify python code to run on the server side. You won't be able to use paraview python api though. Instead of<br>
<br>XDMFReader(FileName=...)<br><br>it would look like:<br><br>reader = vtkXDMFReader()<br>reader.SetFileName(...)<br>reader.Update()<br>data = reader.GetOutput()<br><br>You can find examples of the python programmable source:<br>
<br><a href="http://www.paraview.org/Wiki/Python_Programmable_Filter#Generating_Data_.28Programmable_Source.29" target="_blank">http://www.paraview.org/Wiki/Python_Programmable_Filter#Generating_Data_.28Programmable_Source.29</a><br>
<a href="http://www.paraview.org/Wiki/Here_are_some_more_examples_of_simple_ParaView_3_python_filters" target="_blank">http://www.paraview.org/Wiki/Here_are_some_more_examples_of_simple_ParaView_3_python_filters</a>.<br>
<br>Pat<br><br><div class="gmail_quote">On Wed, Feb 9, 2011 at 4:20 PM, Tim Gallagher <span dir="ltr"><<a href="mailto:tim.gallagher@gatech.edu" target="_blank">tim.gallagher@gatech.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
I've searched online at length for this and couldn't find the answer, so hopefully somebody here can help me.<br>
<br>
I am trying to create a new VTK object (vtkMultiBlockDataSet) composed of portions of manipulated data from some other VTK object (in this case, a vtkStructuredGrid). I then want to delete the vtkStructuredGrid object and visualize the new vtkMultiBlockDataSet.<br>
<br>
So, here's the general outline of what I do in a python script:<br>
<br>
newSource = DataGeneratorObject(Program="MB{}")<br>
newSource.UpdatePipeline()<br>
<br>
newData = servermanager.Fetch(newSource)<br>
newData.SetNumberOfBlocks(64)<br>
<br>
for n in range(0,64):<br>
myData = XDMFReader(FileName=...)<br>
myData.UpdatePipeline()<br>
<br>
localData = servermanager.Fetch(myData)<br>
<br>
<manipulate the data><br>
<br>
newData.SetBlock(n,vtk.vtkStructuredGrid())<br>
newData.GetBlock(n).DeepCopy(localData)<br>
<br>
Delete(localData)<br>
Delete(myData)<br>
<br>
newData.DataHasBeenGenerated()<br>
newSource.UpdatePipelineInformation()<br>
newSource.UpdatePipeline()<br>
<br>
With all that done, if I try to apply a filter to newSource, it doesn't work. The data is definitely inside newData -- I can print it out and such, even after I delete the localData (which is why I used DeepCopy).<br>
<br>
But I don't know how to send that data back to the server. Or, maybe I don't need the DataObjectGenerator -- if that's the case, how do I create a local VTK object and then send it to the server to visualize?<br>
<br>
Hopefully that example is clear... I appreciate any help you guys can provide. It would be easiest if I could create my own custom reader, but I can't do that because we use Paraview on a lot of machines that we can't recompile to include the new plugin.<br>
<br>
Thanks,<br>
<br>
Tim<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</blockquote></div><br>
</div></div></div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>