b311480e |
1 | // Created on: 1999-11-26 |
2 | // Created by: Andrey BETENEV |
3 | // Copyright (c) 1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
b311480e |
16 | |
7fd59977 |
17 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0 |
7fd59977 |
18 | |
42cf5bc1 |
19 | #include <Interface_EntityIterator.hxx> |
20 | #include <RWStepBasic_RWAction.hxx> |
21 | #include <StepBasic_Action.hxx> |
ec357c5c |
22 | #include <StepBasic_ActionMethod.hxx> |
42cf5bc1 |
23 | #include <StepData_StepReaderData.hxx> |
24 | #include <StepData_StepWriter.hxx> |
7fd59977 |
25 | |
26 | //======================================================================= |
27 | //function : RWStepBasic_RWAction |
28 | //purpose : |
29 | //======================================================================= |
7fd59977 |
30 | RWStepBasic_RWAction::RWStepBasic_RWAction () |
31 | { |
32 | } |
33 | |
34 | //======================================================================= |
35 | //function : ReadStep |
36 | //purpose : |
37 | //======================================================================= |
38 | |
39 | void RWStepBasic_RWAction::ReadStep (const Handle(StepData_StepReaderData)& data, |
40 | const Standard_Integer num, |
41 | Handle(Interface_Check)& ach, |
42 | const Handle(StepBasic_Action) &ent) const |
43 | { |
44 | // Check number of parameters |
45 | if ( ! data->CheckNbParams(num,3,ach,"action") ) return; |
46 | |
47 | // Own fields of Action |
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(StepBasic_ActionMethod) aChosenMethod; |
62 | data->ReadEntity (num, 3, "chosen_method", ach, STANDARD_TYPE(StepBasic_ActionMethod), aChosenMethod); |
63 | |
64 | // Initialize entity |
65 | ent->Init(aName, |
66 | hasDescription, |
67 | aDescription, |
68 | aChosenMethod); |
69 | } |
70 | |
71 | //======================================================================= |
72 | //function : WriteStep |
73 | //purpose : |
74 | //======================================================================= |
75 | |
76 | void RWStepBasic_RWAction::WriteStep (StepData_StepWriter& SW, |
77 | const Handle(StepBasic_Action) &ent) const |
78 | { |
79 | |
80 | // Own fields of Action |
81 | |
82 | SW.Send (ent->Name()); |
83 | |
84 | if ( ent->HasDescription() ) { |
85 | SW.Send (ent->Description()); |
86 | } |
87 | else SW.SendUndef(); |
88 | |
89 | SW.Send (ent->ChosenMethod()); |
90 | } |
91 | |
92 | //======================================================================= |
93 | //function : Share |
94 | //purpose : |
95 | //======================================================================= |
96 | |
97 | void RWStepBasic_RWAction::Share (const Handle(StepBasic_Action) &ent, |
98 | Interface_EntityIterator& iter) const |
99 | { |
100 | |
101 | // Own fields of Action |
102 | |
103 | iter.AddItem (ent->ChosenMethod()); |
104 | } |