1 // GEOM GEOMDS : implementation of Geometry component data structure and Geometry documents management
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : GEOMDS_Explorer.cxx
25 // Author : Yves FRICAUD
30 #include "GEOMDS_Explorer.ixx"
32 #include <TNaming_NamedShape.hxx>
33 #include <TNaming_Tool.hxx>
34 #include <TDataStd_Name.hxx>
37 //=======================================================================
38 //function : GEOMDS_Explorer
40 //=======================================================================
42 GEOMDS_Explorer::GEOMDS_Explorer(const TDF_Label& Main) : myChildIterator(Main)
47 //=======================================================================
50 //=======================================================================
52 Standard_Boolean GEOMDS_Explorer::More()
54 if (!myChildIterator.More())
56 Handle(TDataStd_Name) Att;
57 Handle(TNaming_NamedShape) NS;
58 TDF_Label L = myChildIterator.Value();
59 if (( L.FindAttribute(TDataStd_Name::GetID(),Att) ) ||
60 (L.FindAttribute(TNaming_NamedShape::GetID(),NS))
63 // myChildIterator.Next();
67 if (!myChildIterator.More())
69 TDF_Label L = myChildIterator.Value();
70 Handle(TNaming_NamedShape) NS;
71 for (TDF_ChildIterator it2(L); it2.More(); it2.Next()) {
72 TDF_Label L2 = it2.Value();
73 if (L2.FindAttribute(TNaming_NamedShape::GetID(),NS)) {
76 myChildIterator.Next();
83 //=======================================================================
86 //=======================================================================
88 void GEOMDS_Explorer::Next()
90 myChildIterator.Next();
94 //=======================================================================
97 //=======================================================================
99 TopoDS_Shape GEOMDS_Explorer::Shape() const
101 Handle(TNaming_NamedShape) NS;
102 TDF_Label L = myChildIterator.Value();
103 L.FindAttribute(TNaming_NamedShape::GetID(),NS);
104 TopoDS_Shape S = TNaming_Tool::GetShape(NS);
108 //=======================================================================
111 //=======================================================================
113 TCollection_ExtendedString GEOMDS_Explorer::Name() const
115 TDF_Label L = myChildIterator.Value();
116 Handle(TDataStd_Name) Att;
117 if ( L.FindAttribute(TDataStd_Name::GetID(),Att) )
118 //L.FindAttribute(TDataStd_Name::GetID(),Att);
121 return TCollection_ExtendedString();