1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <IGESBasic_SingularSubfigure.hxx>
16 #include <IGESBasic_SubfigureDef.hxx>
17 #include <IGESData_IGESEntity.hxx>
18 #include <IGESDraw_CircArraySubfigure.hxx>
19 #include <IGESDraw_NetworkSubfigure.hxx>
20 #include <IGESDraw_NetworkSubfigureDef.hxx>
21 #include <IGESDraw_RectArraySubfigure.hxx>
22 #include <IGESSelect_SelectBypassSubfigure.hxx>
23 #include <Interface_EntityIterator.hxx>
24 #include <Interface_Graph.hxx>
25 #include <Interface_InterfaceError.hxx>
26 #include <Interface_Macros.hxx>
27 #include <Standard_Transient.hxx>
28 #include <Standard_Type.hxx>
29 #include <TCollection_AsciiString.hxx>
31 IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_SelectBypassSubfigure,IFSelect_SelectExplore)
33 IGESSelect_SelectBypassSubfigure::IGESSelect_SelectBypassSubfigure
34 (const Standard_Integer level)
35 : IFSelect_SelectExplore (level) { }
38 Standard_Boolean IGESSelect_SelectBypassSubfigure::Explore
39 (const Standard_Integer /*level*/, const Handle(Standard_Transient)& ent,
40 const Interface_Graph& /*G*/, Interface_EntityIterator& explored) const
42 DeclareAndCast(IGESData_IGESEntity,igesent,ent);
43 if (igesent.IsNull()) return Standard_False;
44 Standard_Integer igt = igesent->TypeNumber();
48 DeclareAndCast(IGESBasic_SubfigureDef,subf,ent);
49 if (subf.IsNull()) return Standard_True;
50 Standard_Integer i,nb = subf->NbEntities();
51 for (i = 1; i <= nb; i ++) explored.AddItem (subf->AssociatedEntity(i));
55 DeclareAndCast(IGESBasic_SingularSubfigure,subf,ent);
56 explored.AddItem (subf->Subfigure());
61 DeclareAndCast(IGESDraw_NetworkSubfigureDef,subf,ent);
62 if (subf.IsNull()) return Standard_True;
63 Standard_Integer i,nb = subf->NbEntities();
64 for (i = 1; i <= nb; i ++) explored.AddItem (subf->Entity(i));
68 DeclareAndCast(IGESDraw_NetworkSubfigure,subf,ent);
69 explored.AddItem (subf->SubfigureDefinition());
74 DeclareAndCast(IGESDraw_RectArraySubfigure,subf,ent);
75 explored.AddItem (subf->BaseEntity());
78 DeclareAndCast(IGESDraw_CircArraySubfigure,subf,ent);
79 explored.AddItem (subf->BaseEntity());
82 // Si c est pas tout ca, c est un objet de base et on le prend tel quel
87 TCollection_AsciiString IGESSelect_SelectBypassSubfigure::ExploreLabel () const
88 { return TCollection_AsciiString ("Content of Subfigures"); }