Integration of OCCT 6.5.0 from SVN
[occt.git] / src / StepElement / StepElement_VolumeElementPurpose.cxx
CommitLineData
7fd59977 1// File: StepElement_VolumeElementPurpose.cxx
2// Created: Tue Dec 10 18:13:05 2002
3// Author: data exchange team
4// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
5// Copyright: Open CASCADE 2002
6
7#include <StepElement_VolumeElementPurpose.ixx>
8#include <StepElement_VolumeElementPurposeMember.hxx>
9#include <TCollection_HAsciiString.hxx>
10
11//=======================================================================
12//function : StepElement_VolumeElementPurpose
13//purpose :
14//=======================================================================
15
16StepElement_VolumeElementPurpose::StepElement_VolumeElementPurpose ()
17{
18}
19
20//=======================================================================
21//function : CaseNum
22//purpose :
23//=======================================================================
24
25Standard_Integer StepElement_VolumeElementPurpose::CaseNum (const Handle(Standard_Transient)& ent) const
26{
27 return 0;
28}
29
30//=======================================================================
31//function : CaseMem
32//purpose :
33//=======================================================================
34
35Standard_Integer StepElement_VolumeElementPurpose::CaseMem (const Handle(StepData_SelectMember)& ent) const
36{
37 if(ent.IsNull()) return 0;
38 if(ent->Matches("EnumeratedVolumeElementPurpose")) return 1;
39 else if(ent->Matches("ApplicationDefinedElementPurpose")) return 2;
40 else return 0;
41}
42
43//=======================================================================
44//function : NewMember
45//purpose :
46//=======================================================================
47
48Handle(StepData_SelectMember) StepElement_VolumeElementPurpose::NewMember() const
49{
50 return new StepElement_VolumeElementPurposeMember;
51}
52
53//=======================================================================
54//function : SetEnumeratedVolumeElementPurpose
55//purpose :
56//=======================================================================
57
58void StepElement_VolumeElementPurpose::SetEnumeratedVolumeElementPurpose (const StepElement_EnumeratedVolumeElementPurpose val)
59{
60 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
61 if(SelMem.IsNull()) return;
62 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("EnumeratedVolumeElementPurpose");
63 SelMem->SetName(name->ToCString());
64 SelMem->SetEnum((Standard_Integer)val);
65}
66
67//=======================================================================
68//function : EnumeratedVolumeElementPurpose
69//purpose :
70//=======================================================================
71
72StepElement_EnumeratedVolumeElementPurpose StepElement_VolumeElementPurpose::EnumeratedVolumeElementPurpose () const
73{
74 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
75 if(SelMem.IsNull()) return StepElement_StressDisplacement;
76 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
77 name->AssignCat(SelMem->Name());
78 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("EnumeratedVolumeElementPurpose");
79 if(name->IsDifferent(nameitem)) return StepElement_StressDisplacement;
80 Standard_Integer numit = SelMem->Enum();
81 StepElement_EnumeratedVolumeElementPurpose val;
82 switch(numit) {
83 case 1 : val = StepElement_StressDisplacement; break;
84 default : return StepElement_StressDisplacement;break;
85 }
86 return val;
87}
88
89//=======================================================================
90//function : SetApplicationDefinedElementPurpose
91//purpose :
92//=======================================================================
93
94void StepElement_VolumeElementPurpose::SetApplicationDefinedElementPurpose (const Handle(TCollection_HAsciiString) &val)
95{
96 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
97 if(SelMem.IsNull()) return;
98 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ApplicationDefinedElementPurpose");
99 SelMem->SetName(name->ToCString());
100 SelMem->SetString(val->ToCString());
101}
102
103//=======================================================================
104//function : ApplicationDefinedElementPurpose
105//purpose :
106//=======================================================================
107
108Handle(TCollection_HAsciiString) StepElement_VolumeElementPurpose::ApplicationDefinedElementPurpose () const
109{
110 Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value());
111 if(SelMem.IsNull()) return 0;
112 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
113 name->AssignCat(SelMem->Name());
114 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ApplicationDefinedElementPurpose");
115 if(name->IsDifferent(nameitem)) return 0;
116 Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString;
117 val->AssignCat(SelMem->String());
118 return val;
119}