1 // Created on: 2002-12-10
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
18 #include <Standard_Transient.hxx>
19 #include <StepData_SelectMember.hxx>
20 #include <StepElement_MeasureOrUnspecifiedValue.hxx>
21 #include <StepElement_MeasureOrUnspecifiedValueMember.hxx>
22 #include <TCollection_HAsciiString.hxx>
24 static Standard_CString aCDM = "CONTEXT_DEPENDENT_MEASURE";
25 static Standard_CString anUV = "UNSPECIFIED_VALUE";
28 //=======================================================================
29 //function : StepElement_MeasureOrUnspecifiedValue
31 //=======================================================================
33 StepElement_MeasureOrUnspecifiedValue::StepElement_MeasureOrUnspecifiedValue ()
37 //=======================================================================
40 //=======================================================================
42 Standard_Integer StepElement_MeasureOrUnspecifiedValue::CaseNum (const Handle(Standard_Transient)& /*ent*/) const
47 //=======================================================================
50 //=======================================================================
52 Standard_Integer StepElement_MeasureOrUnspecifiedValue::CaseMem (const Handle(StepData_SelectMember)& ent) const
54 if(ent.IsNull()) return 0;
55 if(ent->Matches(aCDM)) return 1;
56 else if(ent->Matches(anUV)) return 2;
60 //=======================================================================
61 //function : NewMember
63 //=======================================================================
65 Handle(StepData_SelectMember) StepElement_MeasureOrUnspecifiedValue::NewMember() const
67 return new StepElement_MeasureOrUnspecifiedValueMember;
70 //=======================================================================
71 //function : SetContextDependentMeasure
73 //=======================================================================
75 void StepElement_MeasureOrUnspecifiedValue::SetContextDependentMeasure (const Standard_Real val)
77 Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value());
78 if(SelMem.IsNull()) return;
79 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("CONTEXT_DEPENDENT_MEASURE");
80 SelMem->SetName(name->ToCString());
84 //=======================================================================
85 //function : ContextDependentMeasure
87 //=======================================================================
89 Standard_Real StepElement_MeasureOrUnspecifiedValue::ContextDependentMeasure () const
91 Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value());
92 if(SelMem.IsNull()) return 0;
93 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
94 name->AssignCat(SelMem->Name());
95 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("CONTEXT_DEPENDENT_MEASURE");
96 if(name->IsDifferent(nameitem)) return 0;
97 Standard_Real val = SelMem->Real();
101 //=======================================================================
102 //function : SetUnspecifiedValue
104 //=======================================================================
106 void StepElement_MeasureOrUnspecifiedValue::SetUnspecifiedValue (const StepElement_UnspecifiedValue val)
108 Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value());
109 if(SelMem.IsNull()) return;
110 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("UNSPECIFIED_VALUE");
111 SelMem->SetName(name->ToCString());
112 SelMem->SetEnum((Standard_Integer)val);
115 //=======================================================================
116 //function : UnspecifiedValue
118 //=======================================================================
120 StepElement_UnspecifiedValue StepElement_MeasureOrUnspecifiedValue::UnspecifiedValue () const
122 Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value());
123 if(SelMem.IsNull()) return StepElement_Unspecified;
124 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
125 name->AssignCat(SelMem->Name());
126 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("UNSPECIFIED_VALUE");
127 if(name->IsDifferent(nameitem)) return StepElement_Unspecified;
128 Standard_Integer numit = SelMem->Enum();
129 StepElement_UnspecifiedValue val;
131 case 1 : val = StepElement_Unspecified; break;
132 default : return StepElement_Unspecified;break;