[Paraview] Pruned output for extract block

Paul Edwards paul.m.edwards at gmail.com
Thu Feb 18 09:45:05 EST 2010


Hi,

What is the reason for pruning the structure in the "Extract Block" filter
when there is only one child item?  I output the following structure from
the custom reader:

   - output (multi-block dataset)
      - zone 1 (multi-block dataset)
         - volume (unstructured grid)
         - boundaries (multi-block dataset)
            - blade (poly data)
            - hub (poly data)
            - case (poly data)
         - zone 2 (multi-block dataset)
         - volume (unstructured grid)
         - boundaries (multi-block dataset)
            - blade (poly data)
            - hub (poly data)
            - case (poly data)

If I were to extract both the blades then the resulting structured would be:

   - output (multi-block dataset)
      - blade (poly data)
      - blade (poly data)

This has now lost all the information from the original structure.

Commenting out the section for the case when there is only one child item
fixes this for me:

8<--------------------------------------------------------------------------------------------------
Index: ./VTK/Graphics/vtkExtractBlock.cxx
===================================================================
RCS file: /cvsroot/ParaView3/ParaView3/VTK/Graphics/vtkExtractBlock.cxx,v
retrieving revision 1.6
diff -r1.6 vtkExtractBlock.cxx
239,251c239,251
<         vtkMultiBlockDataSet* prunedBlock =
vtkMultiBlockDataSet::SafeDownCast(block);
<         if (prunedBlock && prunedBlock->GetNumberOfBlocks()==1)
<           {
<           // shrink redundant branches.
<           clone->SetBlock(index, prunedBlock->GetBlock(0));
<           if (prunedBlock->HasMetaData(static_cast<unsigned int>(0)))
<             {
<             clone->GetMetaData(index)->Copy(prunedBlock->GetMetaData(
<                 static_cast<unsigned int>(0)));
<             }
<           }
<         else
<           {
---
> //        vtkMultiBlockDataSet* prunedBlock =
vtkMultiBlockDataSet::SafeDownCast(block);
> //        if (prunedBlock && prunedBlock->GetNumberOfBlocks()==1)
> //          {
> //          // shrink redundant branches.
> //          clone->SetBlock(index, prunedBlock->GetBlock(0));
> //          if (prunedBlock->HasMetaData(static_cast<unsigned int>(0)))
> //            {
> //            clone->GetMetaData(index)->Copy(prunedBlock->GetMetaData(
> //                static_cast<unsigned int>(0)));
> //            }
> //          }
> //        else
> //          {
257c257
<           }
---
> //          }
-------------------------------------------------------------------------------------------------->8

Could this case be removed in the main CVS or is there a good reason for
keeping it?  (maybe an option could be added for it....)

Thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100218/f5631baa/attachment-0001.htm>


More information about the ParaView mailing list