2 // File : GEOMDS_Explorer.cxx
4 // Author : Yves FRICAUD
7 // Copyright : OPEN CASCADE
11 #include "GEOMDS_Explorer.ixx"
13 #include <TNaming_NamedShape.hxx>
14 #include <TNaming_Tool.hxx>
15 #include <TDataStd_Name.hxx>
18 //=======================================================================
19 //function : GEOMDS_Explorer
21 //=======================================================================
23 GEOMDS_Explorer::GEOMDS_Explorer(const TDF_Label& Main) : myChildIterator(Main)
28 //=======================================================================
31 //=======================================================================
33 Standard_Boolean GEOMDS_Explorer::More()
35 if (!myChildIterator.More())
37 Handle(TDataStd_Name) Att;
38 Handle(TNaming_NamedShape) NS;
39 TDF_Label L = myChildIterator.Value();
40 if (( L.FindAttribute(TDataStd_Name::GetID(),Att) ) ||
41 (L.FindAttribute(TNaming_NamedShape::GetID(),NS))
44 // myChildIterator.Next();
48 if (!myChildIterator.More())
50 TDF_Label L = myChildIterator.Value();
51 Handle(TNaming_NamedShape) NS;
52 for (TDF_ChildIterator it2(L); it2.More(); it2.Next()) {
53 TDF_Label L2 = it2.Value();
54 if (L2.FindAttribute(TNaming_NamedShape::GetID(),NS)) {
57 myChildIterator.Next();
64 //=======================================================================
67 //=======================================================================
69 void GEOMDS_Explorer::Next()
71 myChildIterator.Next();
75 //=======================================================================
78 //=======================================================================
80 TopoDS_Shape GEOMDS_Explorer::Shape() const
82 Handle(TNaming_NamedShape) NS;
83 TDF_Label L = myChildIterator.Value();
84 L.FindAttribute(TNaming_NamedShape::GetID(),NS);
85 TopoDS_Shape S = TNaming_Tool::GetShape(NS);
89 //=======================================================================
92 //=======================================================================
94 TCollection_ExtendedString GEOMDS_Explorer::Name() const
96 TDF_Label L = myChildIterator.Value();
97 Handle(TDataStd_Name) Att;
98 if ( L.FindAttribute(TDataStd_Name::GetID(),Att) )
99 //L.FindAttribute(TDataStd_Name::GetID(),Att);
102 return TCollection_ExtendedString();