973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | #include <IGESSelect_SelectBypassSubfigure.ixx> |
15 | #include <IGESData_IGESEntity.hxx> |
16 | #include <IGESBasic_SubfigureDef.hxx> |
17 | #include <IGESBasic_SingularSubfigure.hxx> |
18 | #include <IGESDraw_NetworkSubfigureDef.hxx> |
19 | #include <IGESDraw_NetworkSubfigure.hxx> |
20 | #include <IGESDraw_RectArraySubfigure.hxx> |
21 | #include <IGESDraw_CircArraySubfigure.hxx> |
22 | |
23 | #include <Interface_Macros.hxx> |
24 | |
25 | |
26 | |
b311480e |
27 | IGESSelect_SelectBypassSubfigure::IGESSelect_SelectBypassSubfigure |
7fd59977 |
28 | (const Standard_Integer level) |
29 | : IFSelect_SelectExplore (level) { } |
30 | |
31 | |
32 | Standard_Boolean IGESSelect_SelectBypassSubfigure::Explore |
35e08fe8 |
33 | (const Standard_Integer /*level*/, const Handle(Standard_Transient)& ent, |
34 | const Interface_Graph& /*G*/, Interface_EntityIterator& explored) const |
7fd59977 |
35 | { |
36 | DeclareAndCast(IGESData_IGESEntity,igesent,ent); |
37 | if (igesent.IsNull()) return Standard_False; |
38 | Standard_Integer igt = igesent->TypeNumber(); |
39 | |
40 | // SingularSubfigure |
41 | if (igt == 308) { |
42 | DeclareAndCast(IGESBasic_SubfigureDef,subf,ent); |
43 | if (subf.IsNull()) return Standard_True; |
44 | Standard_Integer i,nb = subf->NbEntities(); |
45 | for (i = 1; i <= nb; i ++) explored.AddItem (subf->AssociatedEntity(i)); |
46 | return Standard_True; |
47 | } |
48 | if (igt == 408) { |
49 | DeclareAndCast(IGESBasic_SingularSubfigure,subf,ent); |
50 | explored.AddItem (subf->Subfigure()); |
51 | } |
52 | |
53 | // NetworkSubfigure |
54 | if (igt == 320) { |
55 | DeclareAndCast(IGESDraw_NetworkSubfigureDef,subf,ent); |
56 | if (subf.IsNull()) return Standard_True; |
57 | Standard_Integer i,nb = subf->NbEntities(); |
58 | for (i = 1; i <= nb; i ++) explored.AddItem (subf->Entity(i)); |
59 | return Standard_True; |
60 | } |
61 | if (igt == 420) { |
62 | DeclareAndCast(IGESDraw_NetworkSubfigure,subf,ent); |
63 | explored.AddItem (subf->SubfigureDefinition()); |
64 | } |
65 | |
66 | // (Pattern)Subfigure |
67 | if (igt == 412) { |
68 | DeclareAndCast(IGESDraw_RectArraySubfigure,subf,ent); |
69 | explored.AddItem (subf->BaseEntity()); |
70 | } |
71 | if (igt == 414) { |
72 | DeclareAndCast(IGESDraw_CircArraySubfigure,subf,ent); |
73 | explored.AddItem (subf->BaseEntity()); |
74 | } |
75 | |
76 | // Si c est pas tout ca, c est un objet de base et on le prend tel quel |
77 | return Standard_True; |
78 | } |
79 | |
80 | |
81 | TCollection_AsciiString IGESSelect_SelectBypassSubfigure::ExploreLabel () const |
82 | { return TCollection_AsciiString ("Content of Subfigures"); } |