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 <IGESGraph_Protocol.ixx> |
19 | |
20 | #include <IGESGraph_LineFontDefPattern.hxx> |
21 | #include <IGESGraph_Color.hxx> |
22 | #include <IGESGraph_LineFontPredefined.hxx> |
23 | #include <IGESGraph_DefinitionLevel.hxx> |
24 | #include <IGESGraph_LineFontDefTemplate.hxx> |
25 | #include <IGESGraph_DrawingSize.hxx> |
26 | #include <IGESGraph_NominalSize.hxx> |
27 | #include <IGESGraph_DrawingUnits.hxx> |
28 | #include <IGESGraph_Pick.hxx> |
29 | #include <IGESGraph_TextDisplayTemplate.hxx> |
30 | #include <IGESGraph_HighLight.hxx> |
31 | #include <IGESGraph_TextFontDef.hxx> |
32 | #include <IGESGraph_IntercharacterSpacing.hxx> |
33 | #include <IGESGraph_UniformRectGrid.hxx> |
34 | |
35 | #include <IGESBasic.hxx> |
36 | #include <IGESBasic_Protocol.hxx> |
37 | |
38 | static int deja = 0; |
39 | static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06, |
40 | atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14; |
41 | |
42 | IGESGraph_Protocol::IGESGraph_Protocol () |
43 | { |
44 | if (deja) return; deja = 1; |
45 | atype01 = STANDARD_TYPE(IGESGraph_Color); |
46 | atype02 = STANDARD_TYPE(IGESGraph_DefinitionLevel); |
47 | atype03 = STANDARD_TYPE(IGESGraph_DrawingSize); |
48 | atype04 = STANDARD_TYPE(IGESGraph_DrawingUnits); |
49 | atype05 = STANDARD_TYPE(IGESGraph_HighLight); |
50 | atype06 = STANDARD_TYPE(IGESGraph_IntercharacterSpacing); |
51 | atype07 = STANDARD_TYPE(IGESGraph_LineFontDefPattern); |
52 | atype08 = STANDARD_TYPE(IGESGraph_LineFontPredefined); |
53 | atype09 = STANDARD_TYPE(IGESGraph_LineFontDefTemplate); |
54 | atype10 = STANDARD_TYPE(IGESGraph_NominalSize); |
55 | atype11 = STANDARD_TYPE(IGESGraph_Pick); |
56 | atype12 = STANDARD_TYPE(IGESGraph_TextDisplayTemplate); |
57 | atype13 = STANDARD_TYPE(IGESGraph_TextFontDef); |
58 | atype14 = STANDARD_TYPE(IGESGraph_UniformRectGrid); |
59 | } |
60 | |
61 | Standard_Integer IGESGraph_Protocol::NbResources () const |
62 | { return 1; } |
63 | |
64 | Handle(Interface_Protocol) IGESGraph_Protocol::Resource |
35e08fe8 |
65 | (const Standard_Integer /*num*/) const |
7fd59977 |
66 | { |
67 | Handle(Interface_Protocol) res = IGESBasic::Protocol();; |
68 | return res; |
69 | } |
70 | |
71 | Standard_Integer IGESGraph_Protocol::TypeNumber |
72 | (const Handle(Standard_Type)& atype) const |
73 | { |
74 | if (atype == atype01) return 1; |
75 | else if (atype == atype02) return 2; |
76 | else if (atype == atype03) return 3; |
77 | else if (atype == atype04) return 4; |
78 | else if (atype == atype05) return 5; |
79 | else if (atype == atype06) return 6; |
80 | else if (atype == atype07) return 7; |
81 | else if (atype == atype08) return 8; |
82 | else if (atype == atype09) return 9; |
83 | else if (atype == atype10) return 10; |
84 | else if (atype == atype11) return 11; |
85 | else if (atype == atype12) return 12; |
86 | else if (atype == atype13) return 13; |
87 | else if (atype == atype14) return 14; |
88 | return 0; |
89 | } |