b311480e |
1 | // Created on: 2002-12-10 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 2002-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0 |
7fd59977 |
21 | |
22 | #include <StepElement_ElementAspectMember.ixx> |
23 | #include <TCollection_HAsciiString.hxx> |
24 | |
25 | static Standard_CString aElementVolume = "ELEMENT_VOLUME"; |
26 | static Standard_CString aVolume3dFace = "VOLUME_3D_FACE"; |
27 | static Standard_CString aVolume2dFace = "VOLUME_2D_FACE"; |
28 | static Standard_CString aVolume3dEdge = "VOLUME_3D_EDGE"; |
29 | static Standard_CString aVolume2dEdge = "VOLUME_2D_EDGE"; |
30 | static Standard_CString aSurface3dFace = "SURFACE_3D_FACE"; |
31 | static Standard_CString aSurface2dFace = "SURFACE_2D_FACE"; |
32 | static Standard_CString aSurface3dEdge = "SURFACE_3D_EDGE"; |
33 | static Standard_CString aSurface2dEdge = "SURFACE_2D_EDGE"; |
34 | static Standard_CString aCurveEdge = "CURVE_EDGE"; |
35 | |
36 | //======================================================================= |
37 | //function : StepElement_ElementAspectMember |
38 | //purpose : |
39 | //======================================================================= |
40 | |
41 | StepElement_ElementAspectMember::StepElement_ElementAspectMember () : mycase(0) |
42 | { |
43 | } |
44 | |
45 | //======================================================================= |
46 | //function : HasName |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | Standard_Boolean StepElement_ElementAspectMember::HasName() const |
51 | { |
52 | return mycase >0; |
53 | } |
54 | |
55 | //======================================================================= |
56 | //function : Name |
57 | //purpose : |
58 | //======================================================================= |
59 | |
60 | Standard_CString StepElement_ElementAspectMember::Name() const |
61 | { |
62 | switch(mycase) { |
63 | case 1 : return aElementVolume; |
64 | case 2 : return aVolume3dFace; |
65 | case 3 : return aVolume2dFace; |
66 | case 4 : return aVolume3dEdge; |
67 | case 5 : return aVolume2dEdge; |
68 | case 6 : return aSurface3dFace; |
69 | case 7 : return aSurface2dFace; |
70 | case 8 : return aSurface3dEdge; |
71 | case 9 : return aSurface2dEdge; |
72 | case 10 : return aCurveEdge; |
73 | default : break; |
74 | } |
75 | return ""; |
76 | } |
77 | |
78 | //======================================================================= |
79 | //function : CompareNames |
80 | //purpose : |
81 | //======================================================================= |
82 | |
83 | static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &numen) |
84 | { |
85 | Standard_Integer thecase =0; |
86 | if (!name || name[0] == '\0') thecase = 0; |
87 | else if(!strcmp (name,aElementVolume)) { |
88 | thecase = 1; |
89 | numen = 1; |
90 | } |
91 | else if(!strcmp (name,aVolume3dFace)) thecase = 2; |
92 | else if(!strcmp (name,aVolume2dFace)) thecase = 3; |
93 | else if(!strcmp (name,aVolume3dEdge)) thecase = 4; |
94 | else if(!strcmp (name,aVolume2dEdge)) thecase = 5; |
95 | else if(!strcmp (name,aSurface3dFace)) thecase = 6; |
96 | else if(!strcmp (name,aSurface2dFace)) thecase = 7; |
97 | else if(!strcmp (name,aSurface3dEdge)) thecase = 8; |
98 | else if(!strcmp (name,aSurface2dEdge)) thecase = 9; |
99 | else if(!strcmp (name,aCurveEdge)) { |
100 | thecase = 10; |
101 | numen = 1; |
102 | } |
103 | return thecase; |
104 | } |
105 | |
106 | //======================================================================= |
107 | //function : SetName |
108 | //purpose : |
109 | //======================================================================= |
110 | |
111 | Standard_Boolean StepElement_ElementAspectMember::SetName(const Standard_CString name) |
112 | { |
113 | Standard_Integer numit =0; |
114 | mycase = CompareNames(name,numit); |
115 | if(numit) SetInteger(numit); |
116 | return (mycase >0); |
117 | } |
118 | |
119 | //======================================================================= |
120 | //function : Matches |
121 | //purpose : |
122 | //======================================================================= |
123 | |
124 | Standard_Boolean StepElement_ElementAspectMember::Matches(const Standard_CString name) const |
125 | { |
126 | Standard_Integer numit =0; |
127 | Standard_Integer thecase = CompareNames(name,numit); |
128 | return (mycase==thecase); |
129 | } |