|
Open CASCADE Technology
6.7.1
|
Iterates on the children of a label, at the first
level only. It is possible to ask the iterator to
explore all the sub label levels of the given one,
with the option "allLevels".
More...
#include <TDF_ChildIterator.hxx>
Public Member Functions | |
| TDF_ChildIterator () | |
Creates an empty iterator object to <br> explore the children of a label. | |
| TDF_ChildIterator (const TDF_Label &aLabel, const Standard_Boolean allLevels=Standard_False) | |
Constructs the iterator object defined by <br> the label aLabel. Iterates on the children of the given label. If | |
| void | Initialize (const TDF_Label &aLabel, const Standard_Boolean allLevels=Standard_False) |
Initializes the iteration on the children of the <br>
given label. <br>
If <allLevels> option is set to true, | |
| Standard_Boolean | More () const |
Returns true if a current label is found in the <br> iteration process. | |
| void | Next () |
| Move the current iteration to the next Item. More... | |
| void | NextBrother () |
Moves this iteration to the next brother <br> label. A brother label is one with the same | |
| const TDF_Label | Value () const |
Returns the current label; or, if there is <br>
none, a null label. <br>
| |
Iterates on the children of a label, at the first
level only. It is possible to ask the iterator to
explore all the sub label levels of the given one,
with the option "allLevels".
| TDF_ChildIterator::TDF_ChildIterator | ( | ) |
Creates an empty iterator object to <br>
explore the children of a label.
| TDF_ChildIterator::TDF_ChildIterator | ( | const TDF_Label & | aLabel, |
| const Standard_Boolean | allLevels = Standard_False |
||
| ) |
Constructs the iterator object defined by <br>
the label aLabel. Iterates on the children of the given label. If
<allLevels> option is set to true, it explores not
only the first, but all the sub label levels.
| void TDF_ChildIterator::Initialize | ( | const TDF_Label & | aLabel, |
| const Standard_Boolean | allLevels = Standard_False |
||
| ) |
Initializes the iteration on the children of the <br>
given label. <br>
If <allLevels> option is set to true,
it explores not only the first, but all the sub
label levels.
If allLevels is false, only the first level of
child labels is explored.
In the example below, the label is iterated
using Initialize, More and Next and its
child labels dumped using TDF_Tool::Entry.
Example
void DumpChildren(const
TDF_Label& aLabel)
{
TDF_ChildIterator it;
TCollection_AsciiString es;
for
(it.Initialize(aLabel,Standard_True);
it.More(); it.Next()){
TDF_Tool::Entry(it.Value(),es);
cout << as.ToCString() << endl;
}
}
| Standard_Boolean TDF_ChildIterator::More | ( | ) | const |
Returns true if a current label is found in the <br>
iteration process.
| void TDF_ChildIterator::Next | ( | ) |
Move the current iteration to the next Item.
| void TDF_ChildIterator::NextBrother | ( | ) |
Moves this iteration to the next brother <br>
label. A brother label is one with the same
father as an initial label.
Use this function when the non-empty
constructor or Initialize has allLevels set to
true. The result is that the iteration does not
explore the children of the current label.
This method is interesting only with
"allLevels" behavior, because it avoids to explore
the current label children.
| const TDF_Label TDF_ChildIterator::Value | ( | ) | const |
Returns the current label; or, if there is <br>
none, a null label. <br>
1.8.5