1 // Created on : Sat May 02 12:41:15 2020
2 // Created by: Irina KRYLOVA
3 // Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V3.0
4 // Copyright (c) Open CASCADE 2020
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 #include <RWStepKinematics_RWKinematicPropertyMechanismRepresentation.hxx>
18
19 #include <Interface_EntityIterator.hxx>
20 #include <StepData_StepReaderData.hxx>
21 #include <StepData_StepWriter.hxx>
22 #include <StepKinematics_KinematicPropertyMechanismRepresentation.hxx>
23 #include <StepRepr_RepresentedDefinition.hxx>
24 #include <StepRepr_Representation.hxx>
25 #include <StepKinematics_KinematicLinkRepresentation.hxx>
26
27 //=======================================================================
28 //function : RWStepKinematics_RWKinematicPropertyMechanismRepresentation
29 //purpose :
30 //=======================================================================
RWStepKinematics_RWKinematicPropertyMechanismRepresentation()31 RWStepKinematics_RWKinematicPropertyMechanismRepresentation::RWStepKinematics_RWKinematicPropertyMechanismRepresentation() {}
32
33
34 //=======================================================================
35 //function : ReadStep
36 //purpose :
37 //=======================================================================
ReadStep(const Handle (StepData_StepReaderData)& theData,const Standard_Integer theNum,Handle (Interface_Check)& theArch,const Handle (StepKinematics_KinematicPropertyMechanismRepresentation)& theEnt) const38 void RWStepKinematics_RWKinematicPropertyMechanismRepresentation::ReadStep (const Handle(StepData_StepReaderData)& theData,
39 const Standard_Integer theNum,
40 Handle(Interface_Check)& theArch,
41 const Handle(StepKinematics_KinematicPropertyMechanismRepresentation)& theEnt) const
42 {
43 // Check number of parameters
44 if ( ! theData->CheckNbParams(theNum,3,theArch,"kinematic_property_mechanism_representation") ) return;
45
46 // Inherited fields of PropertyDefinitionRepresentation
47
48 StepRepr_RepresentedDefinition aPropertyDefinitionRepresentation_Definition;
49 theData->ReadEntity (theNum, 1, "property_definition_representation.definition", theArch, aPropertyDefinitionRepresentation_Definition);
50
51 Handle(StepRepr_Representation) aPropertyDefinitionRepresentation_UsedRepresentation;
52 theData->ReadEntity (theNum, 2, "property_definition_representation.used_representation", theArch, STANDARD_TYPE(StepRepr_Representation), aPropertyDefinitionRepresentation_UsedRepresentation);
53
54 // Own fields of KinematicPropertyMechanismRepresentation
55
56 Handle(StepKinematics_KinematicLinkRepresentation) aBase;
57 theData->ReadEntity (theNum, 3, "base", theArch, STANDARD_TYPE(StepKinematics_KinematicLinkRepresentation), aBase);
58
59 // Initialize entity
60 theEnt->Init(aPropertyDefinitionRepresentation_Definition,
61 aPropertyDefinitionRepresentation_UsedRepresentation,
62 aBase);
63 }
64
65 //=======================================================================
66 //function : WriteStep
67 //purpose :
68 //=======================================================================
WriteStep(StepData_StepWriter & theSW,const Handle (StepKinematics_KinematicPropertyMechanismRepresentation)& theEnt) const69 void RWStepKinematics_RWKinematicPropertyMechanismRepresentation::WriteStep (StepData_StepWriter& theSW,
70 const Handle(StepKinematics_KinematicPropertyMechanismRepresentation)& theEnt) const
71 {
72
73 // Own fields of PropertyDefinitionRepresentation
74
75 theSW.Send (theEnt->Definition().Value());
76
77 theSW.Send (theEnt->UsedRepresentation());
78
79 // Own fields of KinematicPropertyMechanismRepresentation
80
81 theSW.Send (theEnt->Base());
82 }
83
84 //=======================================================================
85 //function : Share
86 //purpose :
87 //=======================================================================
Share(const Handle (StepKinematics_KinematicPropertyMechanismRepresentation)& theEnt,Interface_EntityIterator & iter) const88 void RWStepKinematics_RWKinematicPropertyMechanismRepresentation::Share (const Handle(StepKinematics_KinematicPropertyMechanismRepresentation)& theEnt,
89 Interface_EntityIterator& iter) const
90 {
91
92 // Inherited fields of PropertyDefinitionRepresentation
93
94 iter.AddItem (theEnt->StepRepr_PropertyDefinitionRepresentation::Definition().Value());
95
96 iter.AddItem (theEnt->StepRepr_PropertyDefinitionRepresentation::UsedRepresentation());
97
98 // Own fields of KinematicPropertyMechanismRepresentation
99
100 iter.AddItem (theEnt->Base());
101 }
102