0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / IGESDraw / IGESDraw_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.hxx>
16 #include <IGESDimen_Protocol.hxx>
17 #include <IGESDraw_CircArraySubfigure.hxx>
18 #include <IGESDraw_ConnectPoint.hxx>
19 #include <IGESDraw_Drawing.hxx>
20 #include <IGESDraw_DrawingWithRotation.hxx>
21 #include <IGESDraw_LabelDisplay.hxx>
22 #include <IGESDraw_NetworkSubfigure.hxx>
23 #include <IGESDraw_NetworkSubfigureDef.hxx>
24 #include <IGESDraw_PerspectiveView.hxx>
25 #include <IGESDraw_Planar.hxx>
26 #include <IGESDraw_Protocol.hxx>
27 #include <IGESDraw_RectArraySubfigure.hxx>
28 #include <IGESDraw_SegmentedViewsVisible.hxx>
29 #include <IGESDraw_View.hxx>
30 #include <IGESDraw_ViewsVisible.hxx>
31 #include <IGESDraw_ViewsVisibleWithAttr.hxx>
32 #include <Interface_Protocol.hxx>
33 #include <Standard_Type.hxx>
34
35 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_Protocol,IGESData_Protocol)
36
37 static int THE_IGESDraw_Protocol_deja = 0;
38 static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
39   atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14;
40
41 IGESDraw_Protocol::IGESDraw_Protocol()
42 {
43   if (THE_IGESDraw_Protocol_deja)
44   {
45     return;
46   }
47
48   THE_IGESDraw_Protocol_deja = 1;
49   atype01 = STANDARD_TYPE(IGESDraw_CircArraySubfigure);
50   atype02 = STANDARD_TYPE(IGESDraw_ConnectPoint);
51   atype03 = STANDARD_TYPE(IGESDraw_Drawing);
52   atype04 = STANDARD_TYPE(IGESDraw_DrawingWithRotation);
53   atype05 = STANDARD_TYPE(IGESDraw_LabelDisplay);
54   atype06 = STANDARD_TYPE(IGESDraw_NetworkSubfigure);
55   atype07 = STANDARD_TYPE(IGESDraw_NetworkSubfigureDef);
56   atype08 = STANDARD_TYPE(IGESDraw_PerspectiveView);
57   atype09 = STANDARD_TYPE(IGESDraw_Planar);
58   atype10 = STANDARD_TYPE(IGESDraw_RectArraySubfigure);
59   atype11 = STANDARD_TYPE(IGESDraw_SegmentedViewsVisible);
60   atype12 = STANDARD_TYPE(IGESDraw_View);
61   atype13 = STANDARD_TYPE(IGESDraw_ViewsVisible);
62   atype14 = STANDARD_TYPE(IGESDraw_ViewsVisibleWithAttr);
63 }
64
65     Standard_Integer IGESDraw_Protocol::NbResources () const
66       {  return 1;  }
67
68     Handle(Interface_Protocol) IGESDraw_Protocol::Resource
69   (const Standard_Integer /*num*/) const
70 {
71   Handle(Interface_Protocol) res = IGESDimen::Protocol();;
72   return res;
73 }
74
75     Standard_Integer IGESDraw_Protocol::TypeNumber
76   (const Handle(Standard_Type)& atype) const
77 {
78   if      (atype == atype01) return  1;
79   else if (atype == atype02) return  2;
80   else if (atype == atype03) return  3;
81   else if (atype == atype04) return  4;
82   else if (atype == atype05) return  5;
83   else if (atype == atype06) return  6;
84   else if (atype == atype07) return  7;
85   else if (atype == atype08) return  8;
86   else if (atype == atype09) return  9;
87   else if (atype == atype10) return 10;
88   else if (atype == atype11) return 11;
89   else if (atype == atype12) return 12;
90   else if (atype == atype13) return 13;
91   else if (atype == atype14) return 14;
92   return 0;
93 }