[Paraview] GUI

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Jun 28 21:06:24 EDT 2011


You can get access to the composite dataset information using the data
information (vtkPVDataInformation::GetCompositeDataInformation()). To
find the number of blocks 1 level deep, simply do:

dataInfo->GetCompositeDataInformation()->GetNumberOfChildren().

Determining the index for each of those children can be a little
tricky. The index of a node is the position of that node in a
pre-order traversal of that tree. So you the index of root is 0, while
that of it's first child is 1. However for the second child you have
to count the number of nodes in the entire subtree from Child0 and
then and that to the index of Child0 i.e. ( index of left sibling +
number of nodes in sub-tree rooted at left sibling).

vtkPVCompositeDataInformation itself provides access to the data
information of the child nodes, so using that you can traverse the
entire composite data tree structure. You can also use
vtkPVCompositeDataInformationIterator to traverse the tree.
vtkPVCompositeDataInformationIterator provides a GetFlatIndex() API to
obtain the index for any particular node.

Utkarsh

2011/6/28 papa ndéné NDIAYE <pnwireframe at gmail.com>:
> Hi all,
>
> I have a reader that produces a multiblock dataset and
> want to add a GUI plug-in that applies the extract block filter
> just changing the index to have all blocks (one level deep) extracted in
> different objects.
> I think about a loop calling the createfilter method of the builder with
> "extractblock".
> do you know how to get the number of blocks and how to set the index of the
> block i want to extract without using the GUI?
>
> thanks!!
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list