0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / IGESSolid / IGESSolid_Protocol.cxx
CommitLineData
b311480e 1// Copyright (c) 1999-2012 OPEN CASCADE SAS
2//
3// The content of this file is subject to the Open CASCADE Technology Public
4// License Version 6.5 (the "License"). You may not use the content of this file
5// except in compliance with the License. Please obtain a copy of the License
6// at http://www.opencascade.org and read it completely before using this file.
7//
8// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10//
11// The Original Code and all software distributed under the License is
12// distributed on an "AS IS" basis, without warranty of any kind, and the
13// Initial Developer hereby disclaims all such warranties, including without
14// limitation, any warranties of merchantability, fitness for a particular
15// purpose or non-infringement. Please see the License for the specific terms
16// and conditions governing the rights and limitations under the License.
17
7fd59977 18#include <IGESSolid_Protocol.ixx>
19
20#include <IGESSolid_PlaneSurface.hxx>
21#include <IGESSolid_Block.hxx>
22#include <IGESSolid_RightAngularWedge.hxx>
23#include <IGESSolid_BooleanTree.hxx>
24#include <IGESSolid_SelectedComponent.hxx>
25#include <IGESSolid_ConeFrustum.hxx>
26#include <IGESSolid_Shell.hxx>
27#include <IGESSolid_ConicalSurface.hxx>
28#include <IGESSolid_SolidAssembly.hxx>
29#include <IGESSolid_Cylinder.hxx>
30#include <IGESSolid_SolidInstance.hxx>
31#include <IGESSolid_CylindricalSurface.hxx>
32#include <IGESSolid_SolidOfLinearExtrusion.hxx>
33#include <IGESSolid_EdgeList.hxx>
34#include <IGESSolid_SolidOfRevolution.hxx>
35#include <IGESSolid_Ellipsoid.hxx>
36#include <IGESSolid_Sphere.hxx>
37#include <IGESSolid_Face.hxx>
38#include <IGESSolid_SphericalSurface.hxx>
39#include <IGESSolid_ToroidalSurface.hxx>
40#include <IGESSolid_Loop.hxx>
41#include <IGESSolid_Torus.hxx>
42#include <IGESSolid_ManifoldSolid.hxx>
43#include <IGESSolid_VertexList.hxx>
44
45#include <IGESGeom.hxx>
46#include <IGESGeom_Protocol.hxx>
47
48
49static int deja = 0;
50static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
51 atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,
52 atype16,atype17,atype18,atype19,atype20,atype21,atype22,atype23,atype24;
53
54 IGESSolid_Protocol::IGESSolid_Protocol ()
55{
56 if (deja) return; deja = 1;
57 atype01 = STANDARD_TYPE(IGESSolid_Block);
58 atype02 = STANDARD_TYPE(IGESSolid_BooleanTree);
59 atype03 = STANDARD_TYPE(IGESSolid_ConeFrustum);
60 atype04 = STANDARD_TYPE(IGESSolid_ConicalSurface);
61 atype05 = STANDARD_TYPE(IGESSolid_Cylinder);
62 atype06 = STANDARD_TYPE(IGESSolid_CylindricalSurface);
63 atype07 = STANDARD_TYPE(IGESSolid_EdgeList);
64 atype08 = STANDARD_TYPE(IGESSolid_Ellipsoid);
65 atype09 = STANDARD_TYPE(IGESSolid_Face);
66 atype10 = STANDARD_TYPE(IGESSolid_Loop);
67 atype11 = STANDARD_TYPE(IGESSolid_ManifoldSolid);
68 atype12 = STANDARD_TYPE(IGESSolid_PlaneSurface);
69 atype13 = STANDARD_TYPE(IGESSolid_RightAngularWedge);
70 atype14 = STANDARD_TYPE(IGESSolid_SelectedComponent);
71 atype15 = STANDARD_TYPE(IGESSolid_Shell);
72 atype16 = STANDARD_TYPE(IGESSolid_SolidAssembly);
73 atype17 = STANDARD_TYPE(IGESSolid_SolidInstance);
74 atype18 = STANDARD_TYPE(IGESSolid_SolidOfLinearExtrusion);
75 atype19 = STANDARD_TYPE(IGESSolid_SolidOfRevolution);
76 atype20 = STANDARD_TYPE(IGESSolid_Sphere);
77 atype21 = STANDARD_TYPE(IGESSolid_SphericalSurface);
78 atype22 = STANDARD_TYPE(IGESSolid_ToroidalSurface);
79 atype23 = STANDARD_TYPE(IGESSolid_Torus);
80 atype24 = STANDARD_TYPE(IGESSolid_VertexList);
81}
82
83 Standard_Integer IGESSolid_Protocol::NbResources () const
84 { return 1; }
85
86 Handle(Interface_Protocol) IGESSolid_Protocol::Resource
35e08fe8 87 (const Standard_Integer /*num*/) const
7fd59977 88{
89 Handle(Interface_Protocol) res = IGESGeom::Protocol();;
90 return res;
91}
92
93 Standard_Integer IGESSolid_Protocol::TypeNumber
94 (const Handle(Standard_Type)& atype) const
95{
96 if (atype == atype01) return 1;
97 else if (atype == atype02) return 2;
98 else if (atype == atype03) return 3;
99 else if (atype == atype04) return 4;
100 else if (atype == atype05) return 5;
101 else if (atype == atype06) return 6;
102 else if (atype == atype07) return 7;
103 else if (atype == atype08) return 8;
104 else if (atype == atype09) return 9;
105 else if (atype == atype10) return 10;
106 else if (atype == atype11) return 11;
107 else if (atype == atype12) return 12;
108 else if (atype == atype13) return 13;
109 else if (atype == atype14) return 14;
110 else if (atype == atype15) return 15;
111 else if (atype == atype16) return 16;
112 else if (atype == atype17) return 17;
113 else if (atype == atype18) return 18;
114 else if (atype == atype19) return 19;
115 else if (atype == atype20) return 20;
116 else if (atype == atype21) return 21;
117 else if (atype == atype22) return 22;
118 else if (atype == atype23) return 23;
119 else if (atype == atype24) return 24;
120 return 0;
121}