1 // Created on: 2002-12-10
2 // Created by: data exchange team
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
20 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
22 #include <StepElement_MeasureOrUnspecifiedValue.ixx>
23 #include <StepElement_MeasureOrUnspecifiedValueMember.hxx>
24 #include <TCollection_HAsciiString.hxx>
26 static Standard_CString aCDM = "CONTEXT_DEPENDENT_MEASURE";
27 static Standard_CString anUV = "UNSPECIFIED_VALUE";
30 //=======================================================================
31 //function : StepElement_MeasureOrUnspecifiedValue
33 //=======================================================================
35 StepElement_MeasureOrUnspecifiedValue::StepElement_MeasureOrUnspecifiedValue ()
39 //=======================================================================
42 //=======================================================================
44 Standard_Integer StepElement_MeasureOrUnspecifiedValue::CaseNum (const Handle(Standard_Transient)& ent) const
49 //=======================================================================
52 //=======================================================================
54 Standard_Integer StepElement_MeasureOrUnspecifiedValue::CaseMem (const Handle(StepData_SelectMember)& ent) const
56 if(ent.IsNull()) return 0;
57 if(ent->Matches(aCDM)) return 1;
58 else if(ent->Matches(anUV)) return 2;
62 //=======================================================================
63 //function : NewMember
65 //=======================================================================
67 Handle(StepData_SelectMember) StepElement_MeasureOrUnspecifiedValue::NewMember() const
69 return new StepElement_MeasureOrUnspecifiedValueMember;
72 //=======================================================================
73 //function : SetContextDependentMeasure
75 //=======================================================================
77 void StepElement_MeasureOrUnspecifiedValue::SetContextDependentMeasure (const Standard_Real val)
79 Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value());
80 if(SelMem.IsNull()) return;
81 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("CONTEXT_DEPENDENT_MEASURE");
82 SelMem->SetName(name->ToCString());
86 //=======================================================================
87 //function : ContextDependentMeasure
89 //=======================================================================
91 Standard_Real StepElement_MeasureOrUnspecifiedValue::ContextDependentMeasure () const
93 Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value());
94 if(SelMem.IsNull()) return 0;
95 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
96 name->AssignCat(SelMem->Name());
97 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("CONTEXT_DEPENDENT_MEASURE");
98 if(name->IsDifferent(nameitem)) return 0;
99 Standard_Real val = SelMem->Real();
103 //=======================================================================
104 //function : SetUnspecifiedValue
106 //=======================================================================
108 void StepElement_MeasureOrUnspecifiedValue::SetUnspecifiedValue (const StepElement_UnspecifiedValue val)
110 Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value());
111 if(SelMem.IsNull()) return;
112 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("UNSPECIFIED_VALUE");
113 SelMem->SetName(name->ToCString());
114 SelMem->SetEnum((Standard_Integer)val);
117 //=======================================================================
118 //function : UnspecifiedValue
120 //=======================================================================
122 StepElement_UnspecifiedValue StepElement_MeasureOrUnspecifiedValue::UnspecifiedValue () const
124 Handle(StepElement_MeasureOrUnspecifiedValueMember) SelMem = Handle(StepElement_MeasureOrUnspecifiedValueMember)::DownCast(Value());
125 if(SelMem.IsNull()) return StepElement_Unspecified;
126 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
127 name->AssignCat(SelMem->Name());
128 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("UNSPECIFIED_VALUE");
129 if(name->IsDifferent(nameitem)) return StepElement_Unspecified;
130 Standard_Integer numit = SelMem->Enum();
131 StepElement_UnspecifiedValue val;
133 case 1 : val = StepElement_Unspecified; break;
134 default : return StepElement_Unspecified;break;