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_CurveElementPurposeMember.hxx> |
7fd59977 |
20 | #include <TCollection_HAsciiString.hxx> |
21 | |
92efcf78 |
22 | IMPLEMENT_STANDARD_RTTIEXT(StepElement_CurveElementPurposeMember,StepData_SelectNamed) |
23 | |
7fd59977 |
24 | static Standard_CString ECEP = "ENUMERATED_CURVE_ELEMENT_PURPOSE"; |
25 | static Standard_CString ADEP = "APPLICATION_DEFINED_ELEMENT_PURPOSE"; |
26 | |
27 | |
28 | //======================================================================= |
29 | //function : StepElement_CurveElementPurposeMember |
30 | //purpose : |
31 | //======================================================================= |
32 | |
33 | StepElement_CurveElementPurposeMember::StepElement_CurveElementPurposeMember () : mycase(0) |
34 | { |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : HasName |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | Standard_Boolean StepElement_CurveElementPurposeMember::HasName() const |
43 | { |
44 | return mycase >0; |
45 | } |
46 | |
47 | //======================================================================= |
48 | //function : Name |
49 | //purpose : |
50 | //======================================================================= |
51 | |
52 | Standard_CString StepElement_CurveElementPurposeMember::Name() const |
53 | { |
54 | switch(mycase) { |
55 | case 1 : return ECEP; |
56 | case 2 : return ADEP; |
57 | default : break; |
58 | } |
59 | return ""; |
60 | } |
61 | |
62 | //======================================================================= |
63 | //function : CompareNames |
64 | //purpose : |
65 | //======================================================================= |
66 | |
35e08fe8 |
67 | static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &/*numen*/) |
7fd59977 |
68 | { |
69 | Standard_Integer thecase =0; |
70 | if (!name || name[0] == '\0') thecase = 0; |
71 | else if(!strcmp (name,ECEP)) { |
72 | thecase = 1; |
73 | } |
74 | else if(!strcmp (name,ADEP)) { |
75 | thecase = 2; |
76 | } |
77 | return thecase; |
78 | } |
79 | |
80 | //======================================================================= |
81 | //function : SetName |
82 | //purpose : |
83 | //======================================================================= |
84 | |
85 | Standard_Boolean StepElement_CurveElementPurposeMember::SetName(const Standard_CString name) |
86 | { |
87 | Standard_Integer numit =0; |
88 | mycase = CompareNames(name,numit); |
89 | if(numit) SetInteger(numit); |
90 | return (mycase >0); |
91 | } |
92 | |
93 | //======================================================================= |
94 | //function : Matches |
95 | //purpose : |
96 | //======================================================================= |
97 | |
98 | Standard_Boolean StepElement_CurveElementPurposeMember::Matches(const Standard_CString name) const |
99 | { |
100 | Standard_Integer numit =0; |
101 | Standard_Integer thecase = CompareNames(name,numit); |
102 | return (mycase==thecase); |
103 | } |