Back to index

salome-kernel  6.5.0
Public Member Functions | Private Attributes
DF_ChildIterator Class Reference

#include <DF_ChildIterator.hxx>

Collaboration diagram for DF_ChildIterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Standard_EXPORT DF_ChildIterator (const DF_Label &theLabel, bool allLevels=false)
Standard_EXPORT DF_ChildIterator ()
Standard_EXPORT ~DF_ChildIterator ()
Standard_EXPORT void Init (const DF_Label &theLabel, bool allLevels=false)
Standard_EXPORT DF_Label Value ()
Standard_EXPORT bool More ()
Standard_EXPORT void Next ()

Private Attributes

DF_LabelNode_root
DF_LabelNode_current
bool _allLevels

Detailed Description

Definition at line 29 of file DF_ChildIterator.hxx.


Constructor & Destructor Documentation

DF_ChildIterator::DF_ChildIterator ( const DF_Label theLabel,
bool  allLevels = false 
)

Definition at line 23 of file DF_ChildIterator.cxx.

  :_root(NULL), _current(NULL)
{
  Init(theLabel, allLevels);
}

Here is the call graph for this function:

Definition at line 29 of file DF_ChildIterator.cxx.

  :_root(NULL), _current(NULL)
{
}

Definition at line 34 of file DF_ChildIterator.cxx.

{
  _root = NULL;
  _current = NULL;
}

Member Function Documentation

void DF_ChildIterator::Init ( const DF_Label theLabel,
bool  allLevels = false 
)

Definition at line 41 of file DF_ChildIterator.cxx.

{
  _root = theLabel._node;
  _allLevels = allLevels;
  if(_root) _current = _root->_firstChild;
}

Here is the caller graph for this function:

Definition at line 55 of file DF_ChildIterator.cxx.

{
  return _current!=0;
}

Here is the caller graph for this function:

Definition at line 61 of file DF_ChildIterator.cxx.

{
  if(!_allLevels) {
    _current = _current->_next; //Move to the next brother
    return;
  }
  else {
    if(_current->_firstChild) { //Go down to the first child
      _current = _current->_firstChild;
    }
    else {
      if(_current->_next) { //Next Brother
        _current = _current->_next;
      }
      else {
        if(_current->_father && _current->_father != _root) {
          DF_LabelNode *father = _current->_father;
          _current = father->_next;
          if(!_current) {
            while(father && father != _root) {
              father = father->_father;
              if(father->_next) break;
            } 
            if(father == _root) father = NULL;
            if(father) _current = father->_next;
            else _current = NULL;
          }
        }
        else {
          _current = NULL; //We iterate the whole sub tree
        }
      }
    }
  }
}

Here is the caller graph for this function:

Definition at line 49 of file DF_ChildIterator.cxx.

{
  return DF_Label(_current);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 54 of file DF_ChildIterator.hxx.

Definition at line 53 of file DF_ChildIterator.hxx.

Definition at line 52 of file DF_ChildIterator.hxx.


The documentation for this class was generated from the following files: