0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / StepElement / StepElement_SurfaceElementPurpose.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//
d5f74e42 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
973c2be1 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
42cf5bc1 18#include <Standard_Transient.hxx>
19#include <StepData_SelectMember.hxx>
20#include <StepElement_SurfaceElementPurpose.hxx>
7fd59977 21#include <StepElement_SurfaceElementPurposeMember.hxx>
22#include <TCollection_HAsciiString.hxx>
23
24//=======================================================================
25//function : StepElement_SurfaceElementPurpose
26//purpose :
27//=======================================================================
7fd59977 28StepElement_SurfaceElementPurpose::StepElement_SurfaceElementPurpose ()
29{
30}
31
32//=======================================================================
33//function : CaseNum
34//purpose :
35//=======================================================================
36
35e08fe8 37Standard_Integer StepElement_SurfaceElementPurpose::CaseNum (const Handle(Standard_Transient)& /*ent*/) const
7fd59977 38{
39 return 0;
40}
41
42//=======================================================================
43//function : CaseMem
44//purpose :
45//=======================================================================
46
47Standard_Integer StepElement_SurfaceElementPurpose::CaseMem (const Handle(StepData_SelectMember)& ent) const
48{
49 if(ent.IsNull()) return 0;
50 if(ent->Matches("EnumeratedSurfaceElementPurpose")) return 1;
51 else if(ent->Matches("ApplicationDefinedElementPurpose")) return 2;
52 else return 0;
53}
54
55//=======================================================================
56//function : NewMember
57//purpose :
58//=======================================================================
59
60Handle(StepData_SelectMember) StepElement_SurfaceElementPurpose::NewMember() const
61{
62 return new StepElement_SurfaceElementPurposeMember;
63}
64
65//=======================================================================
66//function : SetEnumeratedSurfaceElementPurpose
67//purpose :
68//=======================================================================
69
70void StepElement_SurfaceElementPurpose::SetEnumeratedSurfaceElementPurpose (const StepElement_EnumeratedSurfaceElementPurpose val)
71{
72 Handle(StepElement_SurfaceElementPurposeMember) SelMem = Handle(StepElement_SurfaceElementPurposeMember)::DownCast(Value());
73 if(SelMem.IsNull()) return;
74 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("EnumeratedSurfaceElementPurpose");
75 SelMem->SetName(name->ToCString());
76 SelMem->SetEnum((Standard_Integer)val);
77}
78
79//=======================================================================
80//function : EnumeratedSurfaceElementPurpose
81//purpose :
82//=======================================================================
83
84StepElement_EnumeratedSurfaceElementPurpose StepElement_SurfaceElementPurpose::EnumeratedSurfaceElementPurpose () const
85{
86 Handle(StepElement_SurfaceElementPurposeMember) SelMem = Handle(StepElement_SurfaceElementPurposeMember)::DownCast(Value());
87 if(SelMem.IsNull()) return StepElement_MembraneDirect;
88 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
89 name->AssignCat(SelMem->Name());
90 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("EnumeratedSurfaceElementPurpose");
91 if(name->IsDifferent(nameitem)) return StepElement_MembraneDirect;
92 Standard_Integer numit = SelMem->Enum();
93 StepElement_EnumeratedSurfaceElementPurpose val;
94 switch(numit) {
95 case 1 : val = StepElement_MembraneDirect; break;
96 case 2 : val = StepElement_MembraneShear; break;
97 case 3 : val = StepElement_BendingDirect; break;
98 case 4 : val = StepElement_BendingTorsion; break;
99 case 5 : val = StepElement_NormalToPlaneShear; break;
100 default : return StepElement_MembraneDirect;break;
101 }
102 return val;
103}
104
105//=======================================================================
106//function : SetApplicationDefinedElementPurpose
107//purpose :
108//=======================================================================
109
110void StepElement_SurfaceElementPurpose::SetApplicationDefinedElementPurpose (const Handle(TCollection_HAsciiString) &val)
111{
112 Handle(StepElement_SurfaceElementPurposeMember) SelMem = Handle(StepElement_SurfaceElementPurposeMember)::DownCast(Value());
113 if(SelMem.IsNull()) return;
114 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ApplicationDefinedElementPurpose");
115 SelMem->SetName(name->ToCString());
116 SelMem->SetString(val->ToCString());
117}
118
119//=======================================================================
120//function : ApplicationDefinedElementPurpose
121//purpose :
122//=======================================================================
123
124Handle(TCollection_HAsciiString) StepElement_SurfaceElementPurpose::ApplicationDefinedElementPurpose () const
125{
126 Handle(StepElement_SurfaceElementPurposeMember) SelMem = Handle(StepElement_SurfaceElementPurposeMember)::DownCast(Value());
127 if(SelMem.IsNull()) return 0;
128 Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
129 name->AssignCat(SelMem->Name());
130 Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ApplicationDefinedElementPurpose");
131 if(name->IsDifferent(nameitem)) return 0;
132 Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString;
133 val->AssignCat(SelMem->String());
134 return val;
135}