0031014: Inspectors - variables for Qt in CMake
[occt.git] / src / IGESDefs / IGESDefs_Protocol.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
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>
27
28 IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_Protocol,IGESData_Protocol)
29
30 static int THE_IGESDefs_Protocol_deja = 0;
31
32 static Handle(Standard_Type) atype1,atype2,atype3,atype4,atype5,atype6,atype7;
33
34 IGESDefs_Protocol::IGESDefs_Protocol()
35 {
36   if (THE_IGESDefs_Protocol_deja)
37   {
38     return;
39   }
40
41   THE_IGESDefs_Protocol_deja = 1;
42   atype1 = STANDARD_TYPE(IGESDefs_AssociativityDef);
43   atype2 = STANDARD_TYPE(IGESDefs_AttributeDef);
44   atype3 = STANDARD_TYPE(IGESDefs_AttributeTable);
45   atype4 = STANDARD_TYPE(IGESDefs_GenericData);
46   atype5 = STANDARD_TYPE(IGESDefs_MacroDef);
47   atype6 = STANDARD_TYPE(IGESDefs_TabularData);
48   atype7 = STANDARD_TYPE(IGESDefs_UnitsData);
49 }
50
51     Standard_Integer IGESDefs_Protocol::NbResources () const
52       {  return 1;  }
53
54     Handle(Interface_Protocol) IGESDefs_Protocol::Resource
55   (const Standard_Integer /*num*/) const
56 {
57   Handle(Interface_Protocol) res = IGESGraph::Protocol();
58   return res;
59 }
60
61     Standard_Integer IGESDefs_Protocol::TypeNumber
62   (const Handle(Standard_Type)& atype) const
63 {
64   if      (atype == atype1) return 1;
65   else if (atype == atype2) return 2;
66   else if (atype == atype3) return 3;
67   else if (atype == atype4) return 4;
68   else if (atype == atype5) return 5;
69   else if (atype == atype6) return 6;
70   else if (atype == atype7) return 7;
71   return 0;
72 }