great thanks Utkarsh, I now understand how the indexes work there.<br>but I still don't know how to build my extractblock filter.<br>I mean to set the "Indices" property of the extractblock filter without using the GUI.<br>
I know we can get properties from vtkSMProxy::GetProperty<br>but I don't find a way to set them. <br><br>I thank you in advance<br><br>Papa<br><br><div class="gmail_quote">2011/6/29 Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@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;">You can get access to the composite dataset information using the data<br>
information (vtkPVDataInformation::GetCompositeDataInformation()). To<br>
find the number of blocks 1 level deep, simply do:<br>
<br>
dataInfo->GetCompositeDataInformation()->GetNumberOfChildren().<br>
<br>
Determining the index for each of those children can be a little<br>
tricky. The index of a node is the position of that node in a<br>
pre-order traversal of that tree. So you the index of root is 0, while<br>
that of it's first child is 1. However for the second child you have<br>
to count the number of nodes in the entire subtree from Child0 and<br>
then and that to the index of Child0 i.e. ( index of left sibling +<br>
number of nodes in sub-tree rooted at left sibling).<br>
<br>
vtkPVCompositeDataInformation itself provides access to the data<br>
information of the child nodes, so using that you can traverse the<br>
entire composite data tree structure. You can also use<br>
vtkPVCompositeDataInformationIterator to traverse the tree.<br>
vtkPVCompositeDataInformationIterator provides a GetFlatIndex() API to<br>
obtain the index for any particular node.<br>
<br>
Utkarsh<br>
<br>
2011/6/28 papa ndéné NDIAYE <<a href="mailto:pnwireframe@gmail.com">pnwireframe@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi all,<br>
><br>
> I have a reader that produces a multiblock dataset and<br>
> want to add a GUI plug-in that applies the extract block filter<br>
> just changing the index to have all blocks (one level deep) extracted in<br>
> different objects.<br>
> I think about a loop calling the createfilter method of the builder with<br>
> "extractblock".<br>
> do you know how to get the number of blocks and how to set the index of the<br>
> block i want to extract without using the GUI?<br>
><br>
> thanks!!<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <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:<br>
> <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>
><br>
</blockquote></div><br>