0028643: Coding rules - eliminate GCC compiler warnings -Wmisleading-indentation
[occt.git] / src / IGESDimen / IGESDimen_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 <IGESDimen_AngularDimension.hxx>
16 #include <IGESDimen_BasicDimension.hxx>
17 #include <IGESDimen_CenterLine.hxx>
18 #include <IGESDimen_CurveDimension.hxx>
19 #include <IGESDimen_DiameterDimension.hxx>
20 #include <IGESDimen_DimensionDisplayData.hxx>
21 #include <IGESDimen_DimensionedGeometry.hxx>
22 #include <IGESDimen_DimensionTolerance.hxx>
23 #include <IGESDimen_DimensionUnits.hxx>
24 #include <IGESDimen_FlagNote.hxx>
25 #include <IGESDimen_GeneralLabel.hxx>
26 #include <IGESDimen_GeneralNote.hxx>
27 #include <IGESDimen_GeneralSymbol.hxx>
28 #include <IGESDimen_LeaderArrow.hxx>
29 #include <IGESDimen_LinearDimension.hxx>
30 #include <IGESDimen_NewDimensionedGeometry.hxx>
31 #include <IGESDimen_NewGeneralNote.hxx>
32 #include <IGESDimen_OrdinateDimension.hxx>
33 #include <IGESDimen_PointDimension.hxx>
34 #include <IGESDimen_Protocol.hxx>
35 #include <IGESDimen_RadiusDimension.hxx>
36 #include <IGESDimen_Section.hxx>
37 #include <IGESDimen_SectionedArea.hxx>
38 #include <IGESDimen_WitnessLine.hxx>
39 #include <IGESGeom.hxx>
40 #include <IGESGeom_Protocol.hxx>
41 #include <IGESGraph.hxx>
42 #include <IGESGraph_Protocol.hxx>
43 #include <Interface_Protocol.hxx>
44 #include <Standard_Type.hxx>
45
46 IMPLEMENT_STANDARD_RTTIEXT(IGESDimen_Protocol,IGESData_Protocol)
47
48 static int THE_IGESDimen_Protocol_deja = 0;
49
50 static 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;
53
54 IGESDimen_Protocol::IGESDimen_Protocol()
55 {
56   if (THE_IGESDimen_Protocol_deja)
57   {
58     return;
59   }
60
61   THE_IGESDimen_Protocol_deja = 1;
62   atype01 = STANDARD_TYPE(IGESDimen_AngularDimension);
63   atype02 = STANDARD_TYPE(IGESDimen_BasicDimension);
64   atype03 = STANDARD_TYPE(IGESDimen_CenterLine);
65   atype04 = STANDARD_TYPE(IGESDimen_CurveDimension);
66   atype05 = STANDARD_TYPE(IGESDimen_DiameterDimension);
67   atype06 = STANDARD_TYPE(IGESDimen_DimensionDisplayData);
68   atype07 = STANDARD_TYPE(IGESDimen_DimensionTolerance);
69   atype08 = STANDARD_TYPE(IGESDimen_DimensionUnits);
70   atype09 = STANDARD_TYPE(IGESDimen_DimensionedGeometry);
71   atype10 = STANDARD_TYPE(IGESDimen_FlagNote);
72   atype11 = STANDARD_TYPE(IGESDimen_GeneralLabel);
73   atype12 = STANDARD_TYPE(IGESDimen_GeneralNote);
74   atype13 = STANDARD_TYPE(IGESDimen_GeneralSymbol);
75   atype14 = STANDARD_TYPE(IGESDimen_LeaderArrow);
76   atype15 = STANDARD_TYPE(IGESDimen_LinearDimension);
77   atype16 = STANDARD_TYPE(IGESDimen_NewDimensionedGeometry);
78   atype17 = STANDARD_TYPE(IGESDimen_NewGeneralNote);
79   atype18 = STANDARD_TYPE(IGESDimen_OrdinateDimension);
80   atype10 = STANDARD_TYPE(IGESDimen_PointDimension);
81   atype20 = STANDARD_TYPE(IGESDimen_RadiusDimension);
82   atype21 = STANDARD_TYPE(IGESDimen_Section);
83   atype22 = STANDARD_TYPE(IGESDimen_SectionedArea);
84   atype23 = STANDARD_TYPE(IGESDimen_WitnessLine);
85 }
86
87     Standard_Integer IGESDimen_Protocol::NbResources () const
88       {  return 2;  }
89
90     Handle(Interface_Protocol) IGESDimen_Protocol::Resource
91   (const Standard_Integer num) const
92 {
93   Handle(Interface_Protocol) res;
94   if (num == 1) res = IGESGraph::Protocol();
95   if (num == 2) res = IGESGeom::Protocol();
96   return res;
97 }
98
99     Standard_Integer IGESDimen_Protocol::TypeNumber
100   (const Handle(Standard_Type)& atype) const
101 {
102   if      (atype == atype01) return  1;
103   else if (atype == atype02) return  2;
104   else if (atype == atype03) return  3;
105   else if (atype == atype04) return  4;
106   else if (atype == atype05) return  5;
107   else if (atype == atype06) return  6;
108   else if (atype == atype07) return  7;
109   else if (atype == atype08) return  8;
110   else if (atype == atype09) return  9;
111   else if (atype == atype10) return 10;
112   else if (atype == atype11) return 11;
113   else if (atype == atype12) return 12;
114   else if (atype == atype13) return 13;
115   else if (atype == atype14) return 14;
116   else if (atype == atype15) return 15;
117   else if (atype == atype16) return 16;
118   else if (atype == atype17) return 17;
119   else if (atype == atype18) return 18;
120   else if (atype == atype19) return 19;
121   else if (atype == atype20) return 20;
122   else if (atype == atype21) return 21;
123   else if (atype == atype22) return 22;
124   else if (atype == atype23) return 23;
125   return 0;
126 }