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