[vtkusers] vtkDataObjectTreeIterator getting level

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Oct 21 16:10:14 EDT 2015


Not directly. You can make the iterator not traverse subtree (using
TraverseSubTreeOff) and then do a breadth-first traversal yourself
through recursive calls and keeping track of the depth.

Utkarsh

On Wed, Oct 21, 2015 at 4:29 AM, RIVERA ROLDAN, Jorge Orlando
<Orlando.RIVERA at mtu.de> wrote:
> Hi
>
> I have   a MultiBlockDataSet  and I am using a  vtkDataObjectTreeIerator  to go through  the tree
> Getting the index is not a problem with GetCurrentFlatIndex , is there a straight way to get the level?
> I could iterate to obtain the level, but  in that case  using  the for  in ( A) will be of less use, I think
>
> --VTKMBDS   idx=0  level=0
> -----VTKMBDS idx=1  level=1
> ----------VTKMBDS idx=2  level=2
> ------------- grid idx=3  level=3
> ------------- grid idx=3  level=3
> -----VTKMBDS idx=4  level=2 ...
>
> (A)
>     for (iter->InitTraversal();
>           !iter->IsDoneWithTraversal();
>           iter->GoToNextItem())  {
>                  idx=     iter->GetCurrentFlatIndex();
>                  level=?
> }
>
> Thanks
> --
> MTU Aero Engines AG
> Vorstand/Board of Management: Reiner Winkler, Vorsitzender/CEO; Dr. Rainer Martens, Michael Schreyoegg
> Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Klaus Eberhardt
> Sitz der Gesellschaft/Registered Office: Muenchen
> Handelsregister/Commercial Register: Muenchen HRB 157206
>
> Diese E-Mail sowie ihre Anhaenge enthalten MTU-eigene vertrauliche oder rechtlich geschuetzte Informationen.
> Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte den Absender und loeschen Sie diese
> E-Mail sowie die Anhaenge. Das unbefugte Speichern, Kopieren oder Weiterleiten ist nicht gestattet.
>
> This e-mail and any attached documents are proprietary to MTU, confidential or protected by law.
> If you are not the intended recipient, please advise the sender and delete this message and its attachments.
> Any unauthorised storing, copying or distribution is prohibited.
> _______________________________________________
> 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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list