0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / RWStepShape / RWStepShape_RWRightCircularCylinder.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
14#include <RWStepShape_RWRightCircularCylinder.ixx>
15#include <StepGeom_Axis1Placement.hxx>
16
17
18#include <Interface_EntityIterator.hxx>
19
20
21#include <StepShape_RightCircularCylinder.hxx>
22
23
24RWStepShape_RWRightCircularCylinder::RWStepShape_RWRightCircularCylinder () {}
25
26void RWStepShape_RWRightCircularCylinder::ReadStep
27 (const Handle(StepData_StepReaderData)& data,
28 const Standard_Integer num,
29 Handle(Interface_Check)& ach,
30 const Handle(StepShape_RightCircularCylinder)& ent) const
31{
32
33
34 // --- Number of Parameter Control ---
35
36 if (!data->CheckNbParams(num,4,ach,"right_circular_cylinder")) 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_Axis1Placement) aPosition;
47 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
48 data->ReadEntity(num, 2,"position", ach, STANDARD_TYPE(StepGeom_Axis1Placement), aPosition);
49
50 // --- own field : height ---
51
52 Standard_Real aHeight;
53 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
54 data->ReadReal (num,3,"height",ach,aHeight);
55
56 // --- own field : radius ---
57
58 Standard_Real aRadius;
59 //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
60 data->ReadReal (num,4,"radius",ach,aRadius);
61
62 //--- Initialisation of the read entity ---
63
64
65 ent->Init(aName, aPosition, aHeight, aRadius);
66}
67
68
69void RWStepShape_RWRightCircularCylinder::WriteStep
70 (StepData_StepWriter& SW,
71 const Handle(StepShape_RightCircularCylinder)& ent) const
72{
73
74 // --- inherited field name ---
75
76 SW.Send(ent->Name());
77
78 // --- own field : position ---
79
80 SW.Send(ent->Position());
81
82 // --- own field : height ---
83
84 SW.Send(ent->Height());
85
86 // --- own field : radius ---
87
88 SW.Send(ent->Radius());
89}
90
91
92void RWStepShape_RWRightCircularCylinder::Share(const Handle(StepShape_RightCircularCylinder)& ent, Interface_EntityIterator& iter) const
93{
94
95 iter.GetOneItem(ent->Position());
96}
97