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 | |
15 | #include <IGESDefs_AssociativityDef.hxx> |
7fd59977 |
16 | #include <IGESDefs_AttributeDef.hxx> |
7fd59977 |
17 | #include <IGESDefs_AttributeTable.hxx> |
42cf5bc1 |
18 | #include <IGESDefs_GenericData.hxx> |
19 | #include <IGESDefs_MacroDef.hxx> |
20 | #include <IGESDefs_Protocol.hxx> |
21 | #include <IGESDefs_TabularData.hxx> |
22 | #include <IGESDefs_UnitsData.hxx> |
23 | #include <IGESGraph.hxx> |
24 | #include <IGESGraph_Protocol.hxx> |
25 | #include <Interface_Protocol.hxx> |
26 | #include <Standard_Type.hxx> |
7fd59977 |
27 | |
92efcf78 |
28 | IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_Protocol,IGESData_Protocol) |
29 | |
7fd59977 |
30 | static int deja = 0; |
31 | static Handle(Standard_Type) atype1,atype2,atype3,atype4,atype5,atype6,atype7; |
32 | |
33 | IGESDefs_Protocol::IGESDefs_Protocol () |
34 | { |
35 | if (deja) return; deja = 1; |
36 | atype1 = STANDARD_TYPE(IGESDefs_AssociativityDef); |
37 | atype2 = STANDARD_TYPE(IGESDefs_AttributeDef); |
38 | atype3 = STANDARD_TYPE(IGESDefs_AttributeTable); |
39 | atype4 = STANDARD_TYPE(IGESDefs_GenericData); |
40 | atype5 = STANDARD_TYPE(IGESDefs_MacroDef); |
41 | atype6 = STANDARD_TYPE(IGESDefs_TabularData); |
42 | atype7 = STANDARD_TYPE(IGESDefs_UnitsData); |
43 | } |
44 | |
45 | Standard_Integer IGESDefs_Protocol::NbResources () const |
46 | { return 1; } |
47 | |
48 | Handle(Interface_Protocol) IGESDefs_Protocol::Resource |
35e08fe8 |
49 | (const Standard_Integer /*num*/) const |
7fd59977 |
50 | { |
51 | Handle(Interface_Protocol) res = IGESGraph::Protocol(); |
52 | return res; |
53 | } |
54 | |
55 | Standard_Integer IGESDefs_Protocol::TypeNumber |
56 | (const Handle(Standard_Type)& atype) const |
57 | { |
58 | if (atype == atype1) return 1; |
59 | else if (atype == atype2) return 2; |
60 | else if (atype == atype3) return 3; |
61 | else if (atype == atype4) return 4; |
62 | else if (atype == atype5) return 5; |
63 | else if (atype == atype6) return 6; |
64 | else if (atype == atype7) return 7; |
65 | return 0; |
66 | } |