0023258: Missing parenthesis
[occt.git] / src / RWStepVisual / RWStepVisual_RWCurveStyle.cxx
CommitLineData
b311480e 1// Copyright (c) 1999-2012 OPEN CASCADE SAS
2//
3// The content of this file is subject to the Open CASCADE Technology Public
4// License Version 6.5 (the "License"). You may not use the content of this file
5// except in compliance with the License. Please obtain a copy of the License
6// at http://www.opencascade.org and read it completely before using this file.
7//
8// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10//
11// The Original Code and all software distributed under the License is
12// distributed on an "AS IS" basis, without warranty of any kind, and the
13// Initial Developer hereby disclaims all such warranties, including without
14// limitation, any warranties of merchantability, fitness for a particular
15// purpose or non-infringement. Please see the License for the specific terms
16// and conditions governing the rights and limitations under the License.
17
7fd59977 18#include <RWStepVisual_RWCurveStyle.ixx>
19#include <StepVisual_CurveStyleFontSelect.hxx>
20#include <StepBasic_SizeSelect.hxx>
21#include <StepVisual_Colour.hxx>
22#include <Interface_EntityIterator.hxx>
23#include <StepVisual_CurveStyle.hxx>
24//#include <StepBasic_SizeMember.hxx>
25
26
27//=======================================================================
28//function : RWStepVisual_RWCurveStyle
29//purpose :
30//=======================================================================
31
32RWStepVisual_RWCurveStyle::RWStepVisual_RWCurveStyle()
33{
34}
35
36
37//=======================================================================
38//function : ReadStep
39//purpose :
40//=======================================================================
41
42void RWStepVisual_RWCurveStyle::ReadStep(const Handle(StepData_StepReaderData)& data,
43 const Standard_Integer num,
44 Handle(Interface_Check)& ach,
45 const Handle(StepVisual_CurveStyle)& ent) const
46{
47
48 // --- Number of Parameter Control ---
49 if (!data->CheckNbParams(num,4,ach,"curve_style")) return;
50
51 // --- own field : name ---
52 Handle(TCollection_HAsciiString) aName;
53
54 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
55 data->ReadString (num,1,"name",ach,aName);
56
57 // --- own field : curveFont ---
58 // idem RWStepVisual_BooleanOperand.
59 // doit etre remis a niveau avant utilisation
60 StepVisual_CurveStyleFontSelect aCurveFont;
61 data->ReadEntity(num,2,"curve_font",ach,aCurveFont);
62
63 // --- own field : curveWidth ---
64 StepBasic_SizeSelect aCurveWidth;
65 data->ReadEntity(num,3,"curve_width",ach,aCurveWidth);
66// Handle(StepBasic_SizeMember) memb = new StepBasic_SizeMember;
67// data->ReadMember(num,3,"curve_width",ach,memb);
68// if ( ! memb->HasName() ) {
69// ach->AddWarning("Parameter #3 (curve_width) is not a POSITIVE_LENGTH_MEASURE");
70// memb->SetName ( "POSITIVE_LENGTH_MEASURE" );
71// }
72// aCurveWidth.SetValue(memb);
73
74 // --- own field : curveColour ---
75 Handle(StepVisual_Colour) aCurveColour;
76
77 //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
78 data->ReadEntity(num, 4,"curve_colour", ach, STANDARD_TYPE(StepVisual_Colour), aCurveColour);
79
80 //--- Initialisation of the read entity ---
81 ent->Init(aName, aCurveFont, aCurveWidth, aCurveColour);
82}
83
84
85//=======================================================================
86//function : WriteStep
87//purpose :
88//=======================================================================
89
90void RWStepVisual_RWCurveStyle::WriteStep(StepData_StepWriter& SW,
91 const Handle(StepVisual_CurveStyle)& ent) const
92{
93
94 // --- own field : name ---
95 SW.Send(ent->Name());
96
97 // --- own field : curveFont ---
98 SW.Send(ent->CurveFont().Value());
99
100 // --- own field : curveWidth ---
101 SW.Send(ent->CurveWidth().Value());
102
103 // --- own field : curveColour ---
104 SW.Send(ent->CurveColour());
105}
106
107
108//=======================================================================
109//function : Share
110//purpose :
111//=======================================================================
112
113void RWStepVisual_RWCurveStyle::Share(const Handle(StepVisual_CurveStyle)& ent,
114 Interface_EntityIterator& iter) const
115{
116 iter.GetOneItem(ent->CurveFont().Value());
117 iter.GetOneItem(ent->CurveColour());
118}
119