7fd59977 |
1 | // File: StepElement_ElementAspectMember.cxx |
2 | // Created: Tue Dec 10 18:12:58 2002 |
3 | // Author: data exchange team |
4 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0 |
5 | // Copyright: Open CASCADE 2002 |
6 | |
7 | #include <StepElement_ElementAspectMember.ixx> |
8 | #include <TCollection_HAsciiString.hxx> |
9 | |
10 | static Standard_CString aElementVolume = "ELEMENT_VOLUME"; |
11 | static Standard_CString aVolume3dFace = "VOLUME_3D_FACE"; |
12 | static Standard_CString aVolume2dFace = "VOLUME_2D_FACE"; |
13 | static Standard_CString aVolume3dEdge = "VOLUME_3D_EDGE"; |
14 | static Standard_CString aVolume2dEdge = "VOLUME_2D_EDGE"; |
15 | static Standard_CString aSurface3dFace = "SURFACE_3D_FACE"; |
16 | static Standard_CString aSurface2dFace = "SURFACE_2D_FACE"; |
17 | static Standard_CString aSurface3dEdge = "SURFACE_3D_EDGE"; |
18 | static Standard_CString aSurface2dEdge = "SURFACE_2D_EDGE"; |
19 | static Standard_CString aCurveEdge = "CURVE_EDGE"; |
20 | |
21 | //======================================================================= |
22 | //function : StepElement_ElementAspectMember |
23 | //purpose : |
24 | //======================================================================= |
25 | |
26 | StepElement_ElementAspectMember::StepElement_ElementAspectMember () : mycase(0) |
27 | { |
28 | } |
29 | |
30 | //======================================================================= |
31 | //function : HasName |
32 | //purpose : |
33 | //======================================================================= |
34 | |
35 | Standard_Boolean StepElement_ElementAspectMember::HasName() const |
36 | { |
37 | return mycase >0; |
38 | } |
39 | |
40 | //======================================================================= |
41 | //function : Name |
42 | //purpose : |
43 | //======================================================================= |
44 | |
45 | Standard_CString StepElement_ElementAspectMember::Name() const |
46 | { |
47 | switch(mycase) { |
48 | case 1 : return aElementVolume; |
49 | case 2 : return aVolume3dFace; |
50 | case 3 : return aVolume2dFace; |
51 | case 4 : return aVolume3dEdge; |
52 | case 5 : return aVolume2dEdge; |
53 | case 6 : return aSurface3dFace; |
54 | case 7 : return aSurface2dFace; |
55 | case 8 : return aSurface3dEdge; |
56 | case 9 : return aSurface2dEdge; |
57 | case 10 : return aCurveEdge; |
58 | default : break; |
59 | } |
60 | return ""; |
61 | } |
62 | |
63 | //======================================================================= |
64 | //function : CompareNames |
65 | //purpose : |
66 | //======================================================================= |
67 | |
68 | static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &numen) |
69 | { |
70 | Standard_Integer thecase =0; |
71 | if (!name || name[0] == '\0') thecase = 0; |
72 | else if(!strcmp (name,aElementVolume)) { |
73 | thecase = 1; |
74 | numen = 1; |
75 | } |
76 | else if(!strcmp (name,aVolume3dFace)) thecase = 2; |
77 | else if(!strcmp (name,aVolume2dFace)) thecase = 3; |
78 | else if(!strcmp (name,aVolume3dEdge)) thecase = 4; |
79 | else if(!strcmp (name,aVolume2dEdge)) thecase = 5; |
80 | else if(!strcmp (name,aSurface3dFace)) thecase = 6; |
81 | else if(!strcmp (name,aSurface2dFace)) thecase = 7; |
82 | else if(!strcmp (name,aSurface3dEdge)) thecase = 8; |
83 | else if(!strcmp (name,aSurface2dEdge)) thecase = 9; |
84 | else if(!strcmp (name,aCurveEdge)) { |
85 | thecase = 10; |
86 | numen = 1; |
87 | } |
88 | return thecase; |
89 | } |
90 | |
91 | //======================================================================= |
92 | //function : SetName |
93 | //purpose : |
94 | //======================================================================= |
95 | |
96 | Standard_Boolean StepElement_ElementAspectMember::SetName(const Standard_CString name) |
97 | { |
98 | Standard_Integer numit =0; |
99 | mycase = CompareNames(name,numit); |
100 | if(numit) SetInteger(numit); |
101 | return (mycase >0); |
102 | } |
103 | |
104 | //======================================================================= |
105 | //function : Matches |
106 | //purpose : |
107 | //======================================================================= |
108 | |
109 | Standard_Boolean StepElement_ElementAspectMember::Matches(const Standard_CString name) const |
110 | { |
111 | Standard_Integer numit =0; |
112 | Standard_Integer thecase = CompareNames(name,numit); |
113 | return (mycase==thecase); |
114 | } |