0024428: Implementation of LGPL license
[occt.git] / src / StepElement / StepElement_VolumeElementPurpose.cxx
CommitLineData
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//
973c2be1 7// This library is free software; you can redistribute it and / or modify it
8// under the terms of the GNU Lesser General Public 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.
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_VolumeElementPurpose.ixx>
19#include <StepElement_VolumeElementPurposeMember.hxx>
20#include <TCollection_HAsciiString.hxx>
21
22//=======================================================================
23//function : StepElement_VolumeElementPurpose
24//purpose :
25//=======================================================================
26
27StepElement_VolumeElementPurpose::StepElement_VolumeElementPurpose ()
28{
29}
30
31//=======================================================================
32//function : CaseNum
33//purpose :
34//=======================================================================
35
35e08fe8 36Standard_Integer StepElement_VolumeElementPurpose::CaseNum (const Handle(Standard_Transient)& /*ent*/) const
7fd59977 37{
38 return 0;
39}
40
41//=======================================================================
42//function : CaseMem
43//purpose :
44//=======================================================================
45
46Standard_Integer StepElement_VolumeElementPurpose::CaseMem (const Handle(StepData_SelectMember)& ent) const
47{
48 if(ent.IsNull()) return 0;
49 if(ent->Matches("EnumeratedVolumeElementPurpose")) return 1;
50 else if(ent->Matches("ApplicationDefinedElementPurpose")) return 2;
51 else return 0;
52}
53
54//=======================================================================
55//function : NewMember
56//purpose :
57//=======================================================================
58
59Handle(StepData_SelectMember) StepElement_VolumeElementPurpose::NewMember() const
60{
61 return new StepElement_VolumeElementPurposeMember;
62}
63
64//=======================================================================
65//function : SetEnumeratedVolumeElementPurpose
66//purpose :
67//=======================================================================
68
69void StepElement_VolumeElementPurpose::SetEnumeratedVolumeElementPurpose (const StepElement_EnumeratedVolumeElementPurpose val)
70{
71 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
72 if(SelMem.IsNull()) return;
73 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("EnumeratedVolumeElementPurpose");
74 SelMem->SetName(name->ToCString());
75 SelMem->SetEnum((Standard_Integer)val);
76}
77
78//=======================================================================
79//function : EnumeratedVolumeElementPurpose
80//purpose :
81//=======================================================================
82
83StepElement_EnumeratedVolumeElementPurpose StepElement_VolumeElementPurpose::EnumeratedVolumeElementPurpose () const
84{
85 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
86 if(SelMem.IsNull()) return StepElement_StressDisplacement;
87 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
88 name->AssignCat(SelMem->Name());
89 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("EnumeratedVolumeElementPurpose");
90 if(name->IsDifferent(nameitem)) return StepElement_StressDisplacement;
91 Standard_Integer numit = SelMem->Enum();
92 StepElement_EnumeratedVolumeElementPurpose val;
93 switch(numit) {
94 case 1 : val = StepElement_StressDisplacement; break;
95 default : return StepElement_StressDisplacement;break;
96 }
97 return val;
98}
99
100//=======================================================================
101//function : SetApplicationDefinedElementPurpose
102//purpose :
103//=======================================================================
104
105void StepElement_VolumeElementPurpose::SetApplicationDefinedElementPurpose (const Handle(TCollection_HAsciiString) &val)
106{
107 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
108 if(SelMem.IsNull()) return;
109 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ApplicationDefinedElementPurpose");
110 SelMem->SetName(name->ToCString());
111 SelMem->SetString(val->ToCString());
112}
113
114//=======================================================================
115//function : ApplicationDefinedElementPurpose
116//purpose :
117//=======================================================================
118
119Handle(TCollection_HAsciiString) StepElement_VolumeElementPurpose::ApplicationDefinedElementPurpose () const
120{
121 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
122 if(SelMem.IsNull()) return 0;
123 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
124 name->AssignCat(SelMem->Name());
125 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ApplicationDefinedElementPurpose");
126 if(name->IsDifferent(nameitem)) return 0;
127 Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString;
128 val->AssignCat(SelMem->String());
129 return val;
130}