0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / RWStepBasic / RWStepBasic_RWActionMethod.cxx
1 // Created on: 1999-11-26
2 // Created by: Andrey BETENEV
3 // Copyright (c) 1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
18
19 #include <Interface_Check.hxx>
20 #include <Interface_EntityIterator.hxx>
21 #include <RWStepBasic_RWActionMethod.hxx>
22 #include <StepBasic_ActionMethod.hxx>
23 #include <StepData_StepReaderData.hxx>
24 #include <StepData_StepWriter.hxx>
25
26 //=======================================================================
27 //function : RWStepBasic_RWActionMethod
28 //purpose  : 
29 //=======================================================================
30 RWStepBasic_RWActionMethod::RWStepBasic_RWActionMethod ()
31 {
32 }
33
34 //=======================================================================
35 //function : ReadStep
36 //purpose  : 
37 //=======================================================================
38
39 void RWStepBasic_RWActionMethod::ReadStep (const Handle(StepData_StepReaderData)& data,
40                                            const Standard_Integer num,
41                                            Handle(Interface_Check)& ach,
42                                            const Handle(StepBasic_ActionMethod) &ent) const
43 {
44   // Check number of parameters
45   if ( ! data->CheckNbParams(num,4,ach,"action_method") ) return;
46
47   // Own fields of ActionMethod
48
49   Handle(TCollection_HAsciiString) aName;
50   data->ReadString (num, 1, "name", ach, aName);
51
52   Handle(TCollection_HAsciiString) aDescription;
53   Standard_Boolean hasDescription = Standard_True;
54   if ( data->IsParamDefined (num,2) ) {
55     data->ReadString (num, 2, "description", ach, aDescription);
56   }
57   else {
58     hasDescription = Standard_False;
59   }
60
61   Handle(TCollection_HAsciiString) aConsequence;
62   data->ReadString (num, 3, "consequence", ach, aConsequence);
63
64   Handle(TCollection_HAsciiString) aPurpose;
65   data->ReadString (num, 4, "purpose", ach, aPurpose);
66
67   // Initialize entity
68   ent->Init(aName,
69             hasDescription,
70             aDescription,
71             aConsequence,
72             aPurpose);
73 }
74
75 //=======================================================================
76 //function : WriteStep
77 //purpose  : 
78 //=======================================================================
79
80 void RWStepBasic_RWActionMethod::WriteStep (StepData_StepWriter& SW,
81                                             const Handle(StepBasic_ActionMethod) &ent) const
82 {
83
84   // Own fields of ActionMethod
85
86   SW.Send (ent->Name());
87
88   if ( ent->HasDescription() ) {
89     SW.Send (ent->Description());
90   }
91   else SW.SendUndef();
92
93   SW.Send (ent->Consequence());
94
95   SW.Send (ent->Purpose());
96 }
97
98 //=======================================================================
99 //function : Share
100 //purpose  : 
101 //=======================================================================
102
103 void RWStepBasic_RWActionMethod::Share (const Handle(StepBasic_ActionMethod) &,
104                                         Interface_EntityIterator&) const
105 {
106   // Own fields of ActionMethod
107 }