0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / IGESSolid / IGESSolid_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 <IGESGeom.hxx>
16 #include <IGESGeom_Protocol.hxx>
17 #include <IGESSolid_Block.hxx>
18 #include <IGESSolid_BooleanTree.hxx>
19 #include <IGESSolid_ConeFrustum.hxx>
20 #include <IGESSolid_ConicalSurface.hxx>
21 #include <IGESSolid_Cylinder.hxx>
22 #include <IGESSolid_CylindricalSurface.hxx>
23 #include <IGESSolid_EdgeList.hxx>
24 #include <IGESSolid_Ellipsoid.hxx>
25 #include <IGESSolid_Face.hxx>
26 #include <IGESSolid_Loop.hxx>
27 #include <IGESSolid_ManifoldSolid.hxx>
28 #include <IGESSolid_PlaneSurface.hxx>
29 #include <IGESSolid_Protocol.hxx>
30 #include <IGESSolid_RightAngularWedge.hxx>
31 #include <IGESSolid_SelectedComponent.hxx>
32 #include <IGESSolid_Shell.hxx>
33 #include <IGESSolid_SolidAssembly.hxx>
34 #include <IGESSolid_SolidInstance.hxx>
35 #include <IGESSolid_SolidOfLinearExtrusion.hxx>
36 #include <IGESSolid_SolidOfRevolution.hxx>
37 #include <IGESSolid_Sphere.hxx>
38 #include <IGESSolid_SphericalSurface.hxx>
39 #include <IGESSolid_ToroidalSurface.hxx>
40 #include <IGESSolid_Torus.hxx>
41 #include <IGESSolid_VertexList.hxx>
42 #include <Interface_Protocol.hxx>
43 #include <Standard_Type.hxx>
44
45 IMPLEMENT_STANDARD_RTTIEXT(IGESSolid_Protocol,IGESData_Protocol)
46
47 static int THE_IGESSolid_Protocol_deja = 0;
48 static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
49   atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,
50   atype16,atype17,atype18,atype19,atype20,atype21,atype22,atype23,atype24;
51
52 IGESSolid_Protocol::IGESSolid_Protocol()
53 {
54   if (THE_IGESSolid_Protocol_deja)
55   {
56     return;
57   }
58   THE_IGESSolid_Protocol_deja = 1;
59   atype01 = STANDARD_TYPE(IGESSolid_Block);
60   atype02 = STANDARD_TYPE(IGESSolid_BooleanTree);
61   atype03 = STANDARD_TYPE(IGESSolid_ConeFrustum);
62   atype04 = STANDARD_TYPE(IGESSolid_ConicalSurface);
63   atype05 = STANDARD_TYPE(IGESSolid_Cylinder);
64   atype06 = STANDARD_TYPE(IGESSolid_CylindricalSurface);
65   atype07 = STANDARD_TYPE(IGESSolid_EdgeList);
66   atype08 = STANDARD_TYPE(IGESSolid_Ellipsoid);
67   atype09 = STANDARD_TYPE(IGESSolid_Face);
68   atype10 = STANDARD_TYPE(IGESSolid_Loop);
69   atype11 = STANDARD_TYPE(IGESSolid_ManifoldSolid);
70   atype12 = STANDARD_TYPE(IGESSolid_PlaneSurface);
71   atype13 = STANDARD_TYPE(IGESSolid_RightAngularWedge);
72   atype14 = STANDARD_TYPE(IGESSolid_SelectedComponent);
73   atype15 = STANDARD_TYPE(IGESSolid_Shell);
74   atype16 = STANDARD_TYPE(IGESSolid_SolidAssembly);
75   atype17 = STANDARD_TYPE(IGESSolid_SolidInstance);
76   atype18 = STANDARD_TYPE(IGESSolid_SolidOfLinearExtrusion);
77   atype19 = STANDARD_TYPE(IGESSolid_SolidOfRevolution);
78   atype20 = STANDARD_TYPE(IGESSolid_Sphere);
79   atype21 = STANDARD_TYPE(IGESSolid_SphericalSurface);
80   atype22 = STANDARD_TYPE(IGESSolid_ToroidalSurface);
81   atype23 = STANDARD_TYPE(IGESSolid_Torus);
82   atype24 = STANDARD_TYPE(IGESSolid_VertexList);
83 }
84
85     Standard_Integer IGESSolid_Protocol::NbResources () const
86       {  return 1;  }
87
88     Handle(Interface_Protocol) IGESSolid_Protocol::Resource
89   (const Standard_Integer /*num*/) const
90 {
91   Handle(Interface_Protocol) res = IGESGeom::Protocol();
92   return res;
93 }
94
95     Standard_Integer IGESSolid_Protocol::TypeNumber
96   (const Handle(Standard_Type)& atype) const
97 {
98   if      (atype == atype01) return  1;
99   else if (atype == atype02) return  2;
100   else if (atype == atype03) return  3;
101   else if (atype == atype04) return  4;
102   else if (atype == atype05) return  5;
103   else if (atype == atype06) return  6;
104   else if (atype == atype07) return  7;
105   else if (atype == atype08) return  8;
106   else if (atype == atype09) return  9;
107   else if (atype == atype10) return 10;
108   else if (atype == atype11) return 11;
109   else if (atype == atype12) return 12;
110   else if (atype == atype13) return 13;
111   else if (atype == atype14) return 14;
112   else if (atype == atype15) return 15;
113   else if (atype == atype16) return 16;
114   else if (atype == atype17) return 17;
115   else if (atype == atype18) return 18;
116   else if (atype == atype19) return 19;
117   else if (atype == atype20) return 20;
118   else if (atype == atype21) return 21;
119   else if (atype == atype22) return 22;
120   else if (atype == atype23) return 23;
121   else if (atype == atype24) return 24;
122   return 0;
123 }