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_VolumeElementPurpose.hxx>
21 #include <StepElement_VolumeElementPurposeMember.hxx>
22 #include <TCollection_HAsciiString.hxx>
24 //=======================================================================
25 //function : StepElement_VolumeElementPurpose
27 //=======================================================================
28 StepElement_VolumeElementPurpose::StepElement_VolumeElementPurpose ()
32 //=======================================================================
35 //=======================================================================
37 Standard_Integer StepElement_VolumeElementPurpose::CaseNum (const Handle(Standard_Transient)& /*ent*/) const
42 //=======================================================================
45 //=======================================================================
47 Standard_Integer StepElement_VolumeElementPurpose::CaseMem (const Handle(StepData_SelectMember)& ent) const
49 if(ent.IsNull()) return 0;
50 if(ent->Matches("EnumeratedVolumeElementPurpose")) return 1;
51 else if(ent->Matches("ApplicationDefinedElementPurpose")) return 2;
55 //=======================================================================
56 //function : NewMember
58 //=======================================================================
60 Handle(StepData_SelectMember) StepElement_VolumeElementPurpose::NewMember() const
62 return new StepElement_VolumeElementPurposeMember;
65 //=======================================================================
66 //function : SetEnumeratedVolumeElementPurpose
68 //=======================================================================
70 void StepElement_VolumeElementPurpose::SetEnumeratedVolumeElementPurpose (const StepElement_EnumeratedVolumeElementPurpose val)
72 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
73 if(SelMem.IsNull()) return;
74 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("EnumeratedVolumeElementPurpose");
75 SelMem->SetName(name->ToCString());
76 SelMem->SetEnum((Standard_Integer)val);
79 //=======================================================================
80 //function : EnumeratedVolumeElementPurpose
82 //=======================================================================
84 StepElement_EnumeratedVolumeElementPurpose StepElement_VolumeElementPurpose::EnumeratedVolumeElementPurpose () const
86 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
87 if(SelMem.IsNull()) return StepElement_StressDisplacement;
88 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
89 name->AssignCat(SelMem->Name());
90 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("EnumeratedVolumeElementPurpose");
91 if(name->IsDifferent(nameitem)) return StepElement_StressDisplacement;
92 Standard_Integer numit = SelMem->Enum();
93 StepElement_EnumeratedVolumeElementPurpose val;
95 case 1 : val = StepElement_StressDisplacement; break;
96 default : return StepElement_StressDisplacement;break;
101 //=======================================================================
102 //function : SetApplicationDefinedElementPurpose
104 //=======================================================================
106 void StepElement_VolumeElementPurpose::SetApplicationDefinedElementPurpose (const Handle(TCollection_HAsciiString) &val)
108 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
109 if(SelMem.IsNull()) return;
110 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ApplicationDefinedElementPurpose");
111 SelMem->SetName(name->ToCString());
112 SelMem->SetString(val->ToCString());
115 //=======================================================================
116 //function : ApplicationDefinedElementPurpose
118 //=======================================================================
120 Handle(TCollection_HAsciiString) StepElement_VolumeElementPurpose::ApplicationDefinedElementPurpose () const
122 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
123 if(SelMem.IsNull()) return 0;
124 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
125 name->AssignCat(SelMem->Name());
126 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ApplicationDefinedElementPurpose");
127 if(name->IsDifferent(nameitem)) return 0;
128 Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString;
129 val->AssignCat(SelMem->String());