973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
7fd59977 |
13 | |
14 | #include <RWStepShape_RWBlock.ixx> |
15 | #include <StepGeom_Axis2Placement3d.hxx> |
16 | |
17 | |
18 | #include <Interface_EntityIterator.hxx> |
19 | |
20 | |
21 | #include <StepShape_Block.hxx> |
22 | |
23 | |
24 | RWStepShape_RWBlock::RWStepShape_RWBlock () {} |
25 | |
26 | void RWStepShape_RWBlock::ReadStep |
27 | (const Handle(StepData_StepReaderData)& data, |
28 | const Standard_Integer num, |
29 | Handle(Interface_Check)& ach, |
30 | const Handle(StepShape_Block)& ent) const |
31 | { |
32 | |
33 | |
34 | // --- Number of Parameter Control --- |
35 | |
36 | if (!data->CheckNbParams(num,5,ach,"block")) return; |
37 | |
38 | // --- inherited field : name --- |
39 | |
40 | Handle(TCollection_HAsciiString) aName; |
41 | //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed |
42 | data->ReadString (num,1,"name",ach,aName); |
43 | |
44 | // --- own field : position --- |
45 | |
46 | Handle(StepGeom_Axis2Placement3d) aPosition; |
47 | //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed |
48 | data->ReadEntity(num, 2,"position", ach, STANDARD_TYPE(StepGeom_Axis2Placement3d), aPosition); |
49 | |
50 | // --- own field : x --- |
51 | |
52 | Standard_Real aX; |
53 | //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed |
54 | data->ReadReal (num,3,"x",ach,aX); |
55 | |
56 | // --- own field : y --- |
57 | |
58 | Standard_Real aY; |
59 | //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed |
60 | data->ReadReal (num,4,"y",ach,aY); |
61 | |
62 | // --- own field : z --- |
63 | |
64 | Standard_Real aZ; |
65 | //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed |
66 | data->ReadReal (num,5,"z",ach,aZ); |
67 | |
68 | //--- Initialisation of the read entity --- |
69 | |
70 | |
71 | ent->Init(aName, aPosition, aX, aY, aZ); |
72 | } |
73 | |
74 | |
75 | void RWStepShape_RWBlock::WriteStep |
76 | (StepData_StepWriter& SW, |
77 | const Handle(StepShape_Block)& ent) const |
78 | { |
79 | |
80 | // --- inherited field name --- |
81 | |
82 | SW.Send(ent->Name()); |
83 | |
84 | // --- own field : position --- |
85 | |
86 | SW.Send(ent->Position()); |
87 | |
88 | // --- own field : x --- |
89 | |
90 | SW.Send(ent->X()); |
91 | |
92 | // --- own field : y --- |
93 | |
94 | SW.Send(ent->Y()); |
95 | |
96 | // --- own field : z --- |
97 | |
98 | SW.Send(ent->Z()); |
99 | } |
100 | |
101 | |
102 | void RWStepShape_RWBlock::Share(const Handle(StepShape_Block)& ent, Interface_EntityIterator& iter) const |
103 | { |
104 | |
105 | iter.GetOneItem(ent->Position()); |
106 | } |
107 | |