Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_ChildIterator.cxx
1 //  File   : SALOMEDSImpl_ChildIterator.cxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5
6 #include "SALOMEDSImpl_ChildIterator.hxx"
7 #include "SALOMEDSImpl_Study.hxx"
8
9 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_ChildIterator, MMgt_TShared )
10 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_ChildIterator, MMgt_TShared )
11
12 SALOMEDSImpl_ChildIterator::SALOMEDSImpl_ChildIterator(const Handle(SALOMEDSImpl_SObject)& theSO)
13 {
14   _so  = theSO;
15   _it = TDF_ChildIterator(_so->GetLabel());
16 }
17
18 SALOMEDSImpl_ChildIterator::SALOMEDSImpl_ChildIterator(const TDF_Label& theLabel)
19 {
20   _so  = SALOMEDSImpl_Study::SObject(theLabel);
21   _it = TDF_ChildIterator(theLabel);
22 }
23
24 void SALOMEDSImpl_ChildIterator::Init()
25 {
26   _it.Initialize(_so->GetLabel(), Standard_False);
27 }
28
29 void SALOMEDSImpl_ChildIterator::Init(const TDF_Label& theLabel)
30 {
31   _it.Initialize(theLabel, Standard_False);
32 }
33
34 void SALOMEDSImpl_ChildIterator::InitEx(bool theAllLevels)
35 {
36   _it.Initialize(_so->GetLabel(), theAllLevels);
37 }
38
39 void SALOMEDSImpl_ChildIterator::InitEx(const TDF_Label& theLabel, bool theAllLevels)
40 {
41   _it.Initialize(theLabel, theAllLevels);
42 }
43
44 bool SALOMEDSImpl_ChildIterator::More()
45 {
46   return _it.More();
47 }
48
49 void SALOMEDSImpl_ChildIterator::Next() 
50 {
51   _it.Next();
52 }
53
54 Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_ChildIterator::Value()
55 {
56   return SALOMEDSImpl_Study::SObject(_it.Value());
57 }
58
59 TDF_Label SALOMEDSImpl_ChildIterator::Label()
60 {
61   return _it.Value();
62 }