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 <IGESDefs_AssociativityDef.hxx>
16 #include <IGESDefs_AttributeDef.hxx>
17 #include <IGESDefs_AttributeTable.hxx>
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>
28 IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_Protocol,IGESData_Protocol)
31 static Handle(Standard_Type) atype1,atype2,atype3,atype4,atype5,atype6,atype7;
33 IGESDefs_Protocol::IGESDefs_Protocol ()
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);
45 Standard_Integer IGESDefs_Protocol::NbResources () const
48 Handle(Interface_Protocol) IGESDefs_Protocol::Resource
49 (const Standard_Integer /*num*/) const
51 Handle(Interface_Protocol) res = IGESGraph::Protocol();
55 Standard_Integer IGESDefs_Protocol::TypeNumber
56 (const Handle(Standard_Type)& atype) const
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;