0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / RWStepShape / RWStepShape_RWOrientedFace.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
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
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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #include <RWStepShape_RWOrientedFace.ixx>
15 #include <StepShape_Face.hxx>
16 #include <StepShape_HArray1OfFaceBound.hxx>
17 #include <StepShape_FaceBound.hxx>
18
19
20 #include <Interface_EntityIterator.hxx>
21
22
23 #include <StepShape_OrientedFace.hxx>
24
25
26 RWStepShape_RWOrientedFace::RWStepShape_RWOrientedFace () {}
27
28 void RWStepShape_RWOrientedFace::ReadStep
29         (const Handle(StepData_StepReaderData)& data,
30          const Standard_Integer num,
31          Handle(Interface_Check)& ach,
32          const Handle(StepShape_OrientedFace)& ent) const
33 {
34
35
36         // --- Number of Parameter Control ---
37
38         if (!data->CheckNbParams(num,4,ach,"oriented_face")) return;
39
40         // --- inherited field : name ---
41
42         Handle(TCollection_HAsciiString) aName;
43         //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
44         data->ReadString (num,1,"name",ach,aName);
45
46         // --- inherited field : bounds ---
47         // --- this field is redefined ---
48         //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
49         data->CheckDerived(num,2,"bounds",ach,Standard_False);
50
51         // --- own field : faceElement ---
52
53         Handle(StepShape_Face) aFaceElement;
54         //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
55         data->ReadEntity(num, 3,"face_element", ach, STANDARD_TYPE(StepShape_Face), aFaceElement);
56
57         // --- own field : orientation ---
58
59         Standard_Boolean aOrientation;
60         //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
61         data->ReadBoolean (num,4,"orientation",ach,aOrientation);
62
63         //--- Initialisation of the read entity ---
64
65
66         ent->Init(aName, aFaceElement, aOrientation);
67 }
68
69
70 void RWStepShape_RWOrientedFace::WriteStep
71         (StepData_StepWriter& SW,
72          const Handle(StepShape_OrientedFace)& ent) const
73 {
74
75         // --- inherited field name ---
76
77         SW.Send(ent->Name());
78
79         // --- inherited field bounds ---
80
81         SW.SendDerived();
82
83         // --- own field : faceElement ---
84
85         SW.Send(ent->FaceElement());
86
87         // --- own field : orientation ---
88
89         SW.SendBoolean(ent->Orientation());
90 }
91
92
93 void RWStepShape_RWOrientedFace::Share(const Handle(StepShape_OrientedFace)& ent, Interface_EntityIterator& iter) const
94 {
95
96         iter.GetOneItem(ent->FaceElement());
97 }
98