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 | |
18 | #include <StepFEA_DegreeOfFreedomMember.ixx> |
19 | #include <TCollection_HAsciiString.hxx> |
20 | |
21 | static Standard_CString anEnumeratedCurveElementFreedom = "ENUMERATED_DEGREE_OF_FREEDOM"; |
22 | static Standard_CString anApplicationDefinedDegreeOfFreedom ="APPLICATION_DEFINED_DEGREE_OF_FREEDOM"; |
23 | |
24 | //======================================================================= |
25 | //function : StepFEA_DegreeOfFreedomMember |
26 | //purpose : |
27 | //======================================================================= |
28 | |
29 | StepFEA_DegreeOfFreedomMember::StepFEA_DegreeOfFreedomMember () : mycase(0) |
30 | { |
31 | } |
32 | |
33 | //======================================================================= |
34 | //function : HasName |
35 | //purpose : |
36 | //======================================================================= |
37 | |
38 | Standard_Boolean StepFEA_DegreeOfFreedomMember::HasName() const |
39 | { |
40 | return mycase >0; |
41 | } |
42 | |
43 | //======================================================================= |
44 | //function : Name |
45 | //purpose : |
46 | //======================================================================= |
47 | |
48 | Standard_CString StepFEA_DegreeOfFreedomMember::Name() const |
49 | { |
50 | switch(mycase) { |
51 | case 1 : return anEnumeratedCurveElementFreedom; |
52 | case 2 : return anApplicationDefinedDegreeOfFreedom; |
53 | default : break; |
54 | } |
55 | return ""; |
56 | } |
57 | |
58 | //======================================================================= |
59 | //function : CompareNames |
60 | //purpose : |
61 | //======================================================================= |
62 | |
35e08fe8 |
63 | static Standard_Integer CompareNames(const Standard_CString name,Standard_Integer &/*numen*/) |
7fd59977 |
64 | { |
65 | Standard_Integer thecase =0; |
66 | if (!name || name[0] == '\0') thecase = 0; |
67 | else if(!strcmp (name,anEnumeratedCurveElementFreedom)) { |
68 | thecase = 1; |
69 | } |
70 | else if(!strcmp (name,anApplicationDefinedDegreeOfFreedom)) { |
71 | thecase = 2; |
72 | } |
73 | /*if (!name || name[0] == '\0') thecase = 0; |
74 | else if(!strcmp (name,"XTranslation")) { |
75 | thecase = 1; |
76 | numen = 1; |
77 | } |
78 | else if(!strcmp (name,"YTranslation")) { |
79 | thecase = 1; |
80 | numen = 2; |
81 | } |
82 | else if(!strcmp (name,"ZTranslation")) { |
83 | thecase = 1; |
84 | numen = 3; |
85 | } |
86 | else if(!strcmp (name,"XRotation")) { |
87 | thecase = 1; |
88 | numen = 4; |
89 | } |
90 | else if(!strcmp (name,"YRotation")) { |
91 | thecase = 1; |
92 | numen = 5; |
93 | } |
94 | else if(!strcmp (name,"ZRotation")) { |
95 | thecase = 1; |
96 | numen = 6; |
97 | } |
98 | else if(!strcmp (name,"Warp")) { |
99 | thecase = 1; |
100 | numen = 7; |
101 | } |
102 | else if(!strcmp (name,"None")) { |
103 | thecase = 1; |
104 | numen = 8; |
105 | } |
106 | else if(!strcmp (name,"ApplicationDefinedDegreeOfFreedom")) thecase = 2;*/ |
107 | return thecase; |
108 | } |
109 | |
110 | //======================================================================= |
111 | //function : SetName |
112 | //purpose : |
113 | //======================================================================= |
114 | |
115 | Standard_Boolean StepFEA_DegreeOfFreedomMember::SetName(const Standard_CString name) |
116 | { |
117 | Standard_Integer numit =0; |
118 | mycase = CompareNames(name,numit); |
119 | if(numit) SetInteger(numit); |
120 | return (mycase >0); |
121 | } |
122 | |
123 | //======================================================================= |
124 | //function : Matches |
125 | //purpose : |
126 | //======================================================================= |
127 | |
128 | Standard_Boolean StepFEA_DegreeOfFreedomMember::Matches(const Standard_CString name) const |
129 | { |
130 | Standard_Integer numit =0; |
131 | Standard_Integer thecase =CompareNames(name,numit); |
132 | return (mycase==thecase); |
133 | } |