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_MeasureOrUnspecifiedValueMember.ixx> |
23 | #include <TCollection_HAsciiString.hxx> |
24 | |
25 | |
26 | static Standard_CString aContextDependedMeasure = "CONTEXT_DEPENDENT_MEASURE"; |
27 | static Standard_CString anUnspecifiedValue = "UNSPECIFIED_VALUE"; |
28 | |
29 | //======================================================================= |
30 | //function : StepElement_MeasureOrUnspecifiedValueMember |
31 | //purpose : |
32 | //======================================================================= |
33 | |
34 | StepElement_MeasureOrUnspecifiedValueMember::StepElement_MeasureOrUnspecifiedValueMember () : mycase(0) |
35 | { |
36 | } |
37 | |
38 | //======================================================================= |
39 | //function : HasName |
40 | //purpose : |
41 | //======================================================================= |
42 | |
43 | Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::HasName() const |
44 | { |
45 | return mycase >0; |
46 | } |
47 | |
48 | //======================================================================= |
49 | //function : Name |
50 | //purpose : |
51 | //======================================================================= |
52 | |
53 | Standard_CString StepElement_MeasureOrUnspecifiedValueMember::Name() const |
54 | { |
55 | switch(mycase) { |
56 | case 1 : return aContextDependedMeasure; |
57 | case 2 : return anUnspecifiedValue; |
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,aContextDependedMeasure)) { |
73 | thecase = 1; |
74 | } |
75 | else if(!strcmp (name,anUnspecifiedValue)) { |
76 | thecase = 2; |
77 | } |
78 | return thecase; |
79 | } |
80 | |
81 | //======================================================================= |
82 | //function : SetName |
83 | //purpose : |
84 | //======================================================================= |
85 | |
86 | Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::SetName(const Standard_CString name) |
87 | { |
88 | Standard_Integer numit =0; |
89 | mycase = CompareNames(name,numit); |
90 | if(numit) SetInteger(numit); |
91 | return (mycase >0); |
92 | } |
93 | |
94 | //======================================================================= |
95 | //function : Matches |
96 | //purpose : |
97 | //======================================================================= |
98 | |
99 | Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::Matches(const Standard_CString name) const |
100 | { |
101 | Standard_Integer numit =0; |
102 | Standard_Integer thecase = CompareNames(name,numit); |
103 | return (mycase==thecase); |
104 | } |