b311480e |
1 | // Created on: 2002-12-10 |
2 | // Created by: data exchange team |
973c2be1 |
3 | // Copyright (c) 2002-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0 |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <Standard_Type.hxx> |
19 | #include <StepElement_MeasureOrUnspecifiedValueMember.hxx> |
7fd59977 |
20 | #include <TCollection_HAsciiString.hxx> |
21 | |
92efcf78 |
22 | IMPLEMENT_STANDARD_RTTIEXT(StepElement_MeasureOrUnspecifiedValueMember,StepData_SelectNamed) |
23 | |
7fd59977 |
24 | static Standard_CString aContextDependedMeasure = "CONTEXT_DEPENDENT_MEASURE"; |
25 | static Standard_CString anUnspecifiedValue = "UNSPECIFIED_VALUE"; |
26 | |
27 | //======================================================================= |
28 | //function : StepElement_MeasureOrUnspecifiedValueMember |
29 | //purpose : |
30 | //======================================================================= |
31 | |
32 | StepElement_MeasureOrUnspecifiedValueMember::StepElement_MeasureOrUnspecifiedValueMember () : mycase(0) |
33 | { |
34 | } |
35 | |
36 | //======================================================================= |
37 | //function : HasName |
38 | //purpose : |
39 | //======================================================================= |
40 | |
41 | Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::HasName() const |
42 | { |
43 | return mycase >0; |
44 | } |
45 | |
46 | //======================================================================= |
47 | //function : Name |
48 | //purpose : |
49 | //======================================================================= |
50 | |
51 | Standard_CString StepElement_MeasureOrUnspecifiedValueMember::Name() const |
52 | { |
53 | switch(mycase) { |
54 | case 1 : return aContextDependedMeasure; |
55 | case 2 : return anUnspecifiedValue; |
56 | default : break; |
57 | } |
58 | return ""; |
59 | } |
60 | |
61 | //======================================================================= |
62 | //function : CompareNames |
63 | //purpose : |
64 | //======================================================================= |
65 | |
35e08fe8 |
66 | static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &/*numen*/) |
7fd59977 |
67 | { |
68 | Standard_Integer thecase =0; |
69 | if (!name || name[0] == '\0') thecase = 0; |
70 | else if(!strcmp (name,aContextDependedMeasure)) { |
71 | thecase = 1; |
72 | } |
73 | else if(!strcmp (name,anUnspecifiedValue)) { |
74 | thecase = 2; |
75 | } |
76 | return thecase; |
77 | } |
78 | |
79 | //======================================================================= |
80 | //function : SetName |
81 | //purpose : |
82 | //======================================================================= |
83 | |
84 | Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::SetName(const Standard_CString name) |
85 | { |
86 | Standard_Integer numit =0; |
87 | mycase = CompareNames(name,numit); |
88 | if(numit) SetInteger(numit); |
89 | return (mycase >0); |
90 | } |
91 | |
92 | //======================================================================= |
93 | //function : Matches |
94 | //purpose : |
95 | //======================================================================= |
96 | |
97 | Standard_Boolean StepElement_MeasureOrUnspecifiedValueMember::Matches(const Standard_CString name) const |
98 | { |
99 | Standard_Integer numit =0; |
100 | Standard_Integer thecase = CompareNames(name,numit); |
101 | return (mycase==thecase); |
102 | } |