[Paraview] Pruned output for extract block

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Mar 23 14:24:15 EDT 2010


FYI, this change has been committed. There's now a new ivar --
MaintainStructure.

/cvsroot/ParaView3/ParaView3/Servers/ServerManager/Resources/filters.xml,v
 <--  Servers/ServerManager/Resources/filters.xml
new revision: 1.388; previous revision: 1.387
/cvsroot/ParaView3/ParaView3/VTK/Graphics/vtkExtractBlock.cxx,v  <--
VTK/Graphics/vtkExtractBlock.cxx
new revision: 1.7; previous revision: 1.6
/cvsroot/ParaView3/ParaView3/VTK/Graphics/vtkExtractBlock.h,v  <--
VTK/Graphics/vtkExtractBlock.h
new revision: 1.3; previous revision: 1.2


Utkarsh

On Thu, Feb 25, 2010 at 11:15 AM, Paul Edwards <paul.m.edwards at gmail.com> wrote:
> I'm terrible with names but.....  If you would like to keep the
> default behavior the same then I would suggest an option to "Maintain
> structure".
> Any good?
> Thanks,
> Paul
>
> On 25 February 2010 15:09, Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
> wrote:
>>
>> Ah I c. I don't think there was any strong reason for trimming the
>> tree down. We can definitely add that as an option as well. Any ideas
>> what to call this new option :)?
>>
>> Utkarsh
>>
>> On Thu, Feb 25, 2010 at 9:57 AM, Paul Edwards <paul.m.edwards at gmail.com>
>> wrote:
>> > Utkarsh,
>> > If you do that you will end up with all the empty blocks in the
>> > structure.
>> >  I would like to just see the extracted blocks without losing the
>> > original
>> > structure.
>> > Regards,
>> > Paul
>> >
>> > On 25 February 2010 14:50, Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
>> > wrote:
>> >>
>> >> Paul,
>> >>
>> >> If you don't want the ExtractBlock filter to prune the output, you can
>> >> always simply uncheck the "Prune Output" checkbox.
>> >>
>> >> Utkarsh
>> >>
>> >> On Thu, Feb 18, 2010 at 9:45 AM, Paul Edwards
>> >> <paul.m.edwards at gmail.com>
>> >> wrote:
>> >> > 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
>> >> > _______________________________________________
>> >> > 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