0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / RWStepGeom / RWStepGeom_RWRectangularTrimmedSurface.cxx
CommitLineData
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
7fd59977 14
42cf5bc1 15#include <Interface_Check.hxx>
7fd59977 16#include <Interface_EntityIterator.hxx>
42cf5bc1 17#include <RWStepGeom_RWRectangularTrimmedSurface.hxx>
18#include <StepData_StepReaderData.hxx>
19#include <StepData_StepWriter.hxx>
7fd59977 20#include <StepGeom_RectangularTrimmedSurface.hxx>
42cf5bc1 21#include <StepGeom_Surface.hxx>
7fd59977 22
23RWStepGeom_RWRectangularTrimmedSurface::RWStepGeom_RWRectangularTrimmedSurface () {}
24
25void RWStepGeom_RWRectangularTrimmedSurface::ReadStep
26 (const Handle(StepData_StepReaderData)& data,
27 const Standard_Integer num,
28 Handle(Interface_Check)& ach,
29 const Handle(StepGeom_RectangularTrimmedSurface)& ent) const
30{
31
32
33 // --- Number of Parameter Control ---
34
35 if (!data->CheckNbParams(num,8,ach,"rectangular_trimmed_surface")) return;
36
37 // --- inherited field : name ---
38
39 Handle(TCollection_HAsciiString) aName;
40 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
41 data->ReadString (num,1,"name",ach,aName);
42
43 // --- own field : basisSurface ---
44
45 Handle(StepGeom_Surface) aBasisSurface;
46 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
47 data->ReadEntity(num, 2,"basis_surface", ach, STANDARD_TYPE(StepGeom_Surface), aBasisSurface);
48
49 // --- own field : u1 ---
50
51 Standard_Real aU1;
52 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
53 data->ReadReal (num,3,"u1",ach,aU1);
54
55 // --- own field : u2 ---
56
57 Standard_Real aU2;
58 //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
59 data->ReadReal (num,4,"u2",ach,aU2);
60
61 // --- own field : v1 ---
62
63 Standard_Real aV1;
64 //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed
65 data->ReadReal (num,5,"v1",ach,aV1);
66
67 // --- own field : v2 ---
68
69 Standard_Real aV2;
70 //szv#4:S4163:12Mar99 `Standard_Boolean stat6 =` not needed
71 data->ReadReal (num,6,"v2",ach,aV2);
72
73 // --- own field : usense ---
74
75 Standard_Boolean aUsense;
76 //szv#4:S4163:12Mar99 `Standard_Boolean stat7 =` not needed
77 data->ReadBoolean (num,7,"usense",ach,aUsense);
78
79 // --- own field : vsense ---
80
81 Standard_Boolean aVsense;
82 //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed
83 data->ReadBoolean (num,8,"vsense",ach,aVsense);
84
85 //--- Initialisation of the read entity ---
86
87
88 ent->Init(aName, aBasisSurface, aU1, aU2, aV1, aV2, aUsense, aVsense);
89}
90
91
92void RWStepGeom_RWRectangularTrimmedSurface::WriteStep
93 (StepData_StepWriter& SW,
94 const Handle(StepGeom_RectangularTrimmedSurface)& ent) const
95{
96
97 // --- inherited field name ---
98
99 SW.Send(ent->Name());
100
101 // --- own field : basisSurface ---
102
103 SW.Send(ent->BasisSurface());
104
105 // --- own field : u1 ---
106
107 SW.Send(ent->U1());
108
109 // --- own field : u2 ---
110
111 SW.Send(ent->U2());
112
113 // --- own field : v1 ---
114
115 SW.Send(ent->V1());
116
117 // --- own field : v2 ---
118
119 SW.Send(ent->V2());
120
121 // --- own field : usense ---
122
123 SW.SendBoolean(ent->Usense());
124
125 // --- own field : vsense ---
126
127 SW.SendBoolean(ent->Vsense());
128}
129
130
131void RWStepGeom_RWRectangularTrimmedSurface::Share(const Handle(StepGeom_RectangularTrimmedSurface)& ent, Interface_EntityIterator& iter) const
132{
133
134 iter.GetOneItem(ent->BasisSurface());
135}
136