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 <StepElement_MeasureOrUnspecifiedValue.ixx> |
19 | #include <StepElement_MeasureOrUnspecifiedValueMember.hxx> |
20 | #include <TCollection_HAsciiString.hxx> |
21 | |
22 | static Standard_CString aCDM = "CONTEXT_DEPENDENT_MEASURE"; |
23 | static Standard_CString anUV = "UNSPECIFIED_VALUE"; |
24 | |
25 | |
26 | //======================================================================= |
27 | //function : StepElement_MeasureOrUnspecifiedValue |
28 | //purpose : |
29 | //======================================================================= |
30 | |
31 | StepElement_MeasureOrUnspecifiedValue::StepElement_MeasureOrUnspecifiedValue () |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : CaseNum |
37 | //purpose : |
38 | //======================================================================= |
39 | |
35e08fe8 |
40 | Standard_Integer StepElement_MeasureOrUnspecifiedValue::CaseNum (const Handle(Standard_Transient)& /*ent*/) const |
7fd59977 |
41 | { |
42 | return 0; |
43 | } |
44 | |
45 | //======================================================================= |
46 | //function : CaseMem |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | Standard_Integer StepElement_MeasureOrUnspecifiedValue::CaseMem (const Handle(StepData_SelectMember)& ent) const |
51 | { |
52 | if(ent.IsNull()) return 0; |
53 | if(ent->Matches(aCDM)) return 1; |
54 | else if(ent->Matches(anUV)) return 2; |
55 | else return 0; |
56 | } |
57 | |
58 | //======================================================================= |
59 | //function : NewMember |
60 | //purpose : |
61 | //======================================================================= |
62 | |
63 | Handle(StepData_SelectMember) StepElement_MeasureOrUnspecifiedValue::NewMember() const |
64 | { |
65 | return new StepElement_MeasureOrUnspecifiedValueMember; |
66 | } |
67 | |
68 | //======================================================================= |
69 | //function : SetContextDependentMeasure |
70 | //purpose : |
71 | //======================================================================= |
72 | |
73 | void StepElement_MeasureOrUnspecifiedValue::SetContextDependentMeasure (const Standard_Real val) |
74 | { |
75 | Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value()); |
76 | if(SelMem.IsNull()) return; |
77 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("CONTEXT_DEPENDENT_MEASURE"); |
78 | SelMem->SetName(name->ToCString()); |
79 | SelMem->SetReal(val); |
80 | } |
81 | |
82 | //======================================================================= |
83 | //function : ContextDependentMeasure |
84 | //purpose : |
85 | //======================================================================= |
86 | |
87 | Standard_Real StepElement_MeasureOrUnspecifiedValue::ContextDependentMeasure () const |
88 | { |
89 | Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value()); |
90 | if(SelMem.IsNull()) return 0; |
91 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
92 | name->AssignCat(SelMem->Name()); |
93 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("CONTEXT_DEPENDENT_MEASURE"); |
94 | if(name->IsDifferent(nameitem)) return 0; |
95 | Standard_Real val = SelMem->Real(); |
96 | return val; |
97 | } |
98 | |
99 | //======================================================================= |
100 | //function : SetUnspecifiedValue |
101 | //purpose : |
102 | //======================================================================= |
103 | |
104 | void StepElement_MeasureOrUnspecifiedValue::SetUnspecifiedValue (const StepElement_UnspecifiedValue val) |
105 | { |
106 | Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value()); |
107 | if(SelMem.IsNull()) return; |
108 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("UNSPECIFIED_VALUE"); |
109 | SelMem->SetName(name->ToCString()); |
110 | SelMem->SetEnum((Standard_Integer)val); |
111 | } |
112 | |
113 | //======================================================================= |
114 | //function : UnspecifiedValue |
115 | //purpose : |
116 | //======================================================================= |
117 | |
118 | StepElement_UnspecifiedValue StepElement_MeasureOrUnspecifiedValue::UnspecifiedValue () const |
119 | { |
120 | Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value()); |
121 | if(SelMem.IsNull()) return StepElement_Unspecified; |
122 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
123 | name->AssignCat(SelMem->Name()); |
124 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("UNSPECIFIED_VALUE"); |
125 | if(name->IsDifferent(nameitem)) return StepElement_Unspecified; |
126 | Standard_Integer numit = SelMem->Enum(); |
127 | StepElement_UnspecifiedValue val; |
128 | switch(numit) { |
129 | case 1 : val = StepElement_Unspecified; break; |
130 | default : return StepElement_Unspecified;break; |
131 | } |
132 | return val; |
133 | } |