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 | // |
973c2be1 |
7 | // This library is free software; you can redistribute it and / or modify it |
8 | // under the terms of the GNU Lesser General Public version 2.1 as published |
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 | |
18 | #include <StepElement_VolumeElementPurposeMember.ixx> |
19 | #include <TCollection_HAsciiString.hxx> |
20 | |
21 | static Standard_CString EVEP = "ENUMERATED_VOLUME_ELEMENT_PURPOSE"; |
22 | static Standard_CString ADEP = "APPLICATION_DEFINED_ELEMENT_PURPOSE"; |
23 | |
24 | |
25 | //======================================================================= |
26 | //function : StepElement_VolumeElementPurposeMember |
27 | //purpose : |
28 | //======================================================================= |
29 | |
30 | StepElement_VolumeElementPurposeMember::StepElement_VolumeElementPurposeMember () : mycase(0) |
31 | { |
32 | } |
33 | |
34 | //======================================================================= |
35 | //function : HasName |
36 | //purpose : |
37 | //======================================================================= |
38 | |
39 | Standard_Boolean StepElement_VolumeElementPurposeMember::HasName() const |
40 | { |
41 | return mycase >0; |
42 | } |
43 | |
44 | //======================================================================= |
45 | //function : Name |
46 | //purpose : |
47 | //======================================================================= |
48 | |
49 | Standard_CString StepElement_VolumeElementPurposeMember::Name() const |
50 | { |
51 | switch(mycase) { |
52 | case 1 : return EVEP; |
53 | case 2 : return ADEP; |
54 | default : break; |
55 | } |
56 | return ""; |
57 | } |
58 | |
59 | //======================================================================= |
60 | //function : CompareNames |
61 | //purpose : |
62 | //======================================================================= |
63 | |
35e08fe8 |
64 | static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &/*numen*/) |
7fd59977 |
65 | { |
66 | Standard_Integer thecase =0; |
67 | if (!name || name[0] == '\0') thecase = 0; |
68 | else if(!strcmp (name,EVEP)) { |
69 | thecase = 1; |
70 | } |
71 | else if(!strcmp (name,ADEP)) { |
72 | thecase = 1; |
73 | } |
74 | return thecase; |
75 | } |
76 | |
77 | //======================================================================= |
78 | //function : SetName |
79 | //purpose : |
80 | //======================================================================= |
81 | |
82 | Standard_Boolean StepElement_VolumeElementPurposeMember::SetName(const Standard_CString name) |
83 | { |
84 | Standard_Integer numit =0; |
85 | mycase = CompareNames(name,numit); |
86 | if(numit) SetInteger(numit); |
87 | return (mycase >0); |
88 | } |
89 | |
90 | //======================================================================= |
91 | //function : Matches |
92 | //purpose : |
93 | //======================================================================= |
94 | |
95 | Standard_Boolean StepElement_VolumeElementPurposeMember::Matches(const Standard_CString name) const |
96 | { |
97 | Standard_Integer numit =0; |
98 | Standard_Integer thecase = CompareNames(name,numit); |
99 | return (mycase==thecase); |
100 | } |