1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Interface_Check.hxx>
16 #include <Interface_EntityIterator.hxx>
17 #include <RWStepVisual_RWCurveStyle.hxx>
18 #include <StepBasic_SizeSelect.hxx>
19 #include <StepData_StepReaderData.hxx>
20 #include <StepData_StepWriter.hxx>
21 #include <StepVisual_Colour.hxx>
22 #include <StepVisual_CurveStyle.hxx>
23 #include <StepVisual_CurveStyleFontSelect.hxx>
25 //#include <StepBasic_SizeMember.hxx>
26 //=======================================================================
27 //function : RWStepVisual_RWCurveStyle
29 //=======================================================================
30 RWStepVisual_RWCurveStyle::RWStepVisual_RWCurveStyle()
35 //=======================================================================
38 //=======================================================================
40 void RWStepVisual_RWCurveStyle::ReadStep(const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num,
42 Handle(Interface_Check)& ach,
43 const Handle(StepVisual_CurveStyle)& ent) const
46 // --- Number of Parameter Control ---
47 if (!data->CheckNbParams(num,4,ach,"curve_style")) return;
49 // --- own field : name ---
50 Handle(TCollection_HAsciiString) aName;
52 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
53 data->ReadString (num,1,"name",ach,aName);
55 // --- own field : curveFont ---
56 // idem RWStepVisual_BooleanOperand.
57 // doit etre remis a niveau avant utilisation
58 StepVisual_CurveStyleFontSelect aCurveFont;
59 data->ReadEntity(num,2,"curve_font",ach,aCurveFont);
61 // --- own field : curveWidth ---
62 StepBasic_SizeSelect aCurveWidth;
63 data->ReadEntity(num,3,"curve_width",ach,aCurveWidth);
64 // Handle(StepBasic_SizeMember) memb = new StepBasic_SizeMember;
65 // data->ReadMember(num,3,"curve_width",ach,memb);
66 // if ( ! memb->HasName() ) {
67 // ach->AddWarning("Parameter #3 (curve_width) is not a POSITIVE_LENGTH_MEASURE");
68 // memb->SetName ( "POSITIVE_LENGTH_MEASURE" );
70 // aCurveWidth.SetValue(memb);
72 // --- own field : curveColour ---
73 Handle(StepVisual_Colour) aCurveColour;
75 //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
76 data->ReadEntity(num, 4,"curve_colour", ach, STANDARD_TYPE(StepVisual_Colour), aCurveColour);
78 //--- Initialisation of the read entity ---
79 ent->Init(aName, aCurveFont, aCurveWidth, aCurveColour);
83 //=======================================================================
84 //function : WriteStep
86 //=======================================================================
88 void RWStepVisual_RWCurveStyle::WriteStep(StepData_StepWriter& SW,
89 const Handle(StepVisual_CurveStyle)& ent) const
92 // --- own field : name ---
95 // --- own field : curveFont ---
96 SW.Send(ent->CurveFont().Value());
98 // --- own field : curveWidth ---
99 SW.Send(ent->CurveWidth().Value());
101 // --- own field : curveColour ---
102 SW.Send(ent->CurveColour());
106 //=======================================================================
109 //=======================================================================
111 void RWStepVisual_RWCurveStyle::Share(const Handle(StepVisual_CurveStyle)& ent,
112 Interface_EntityIterator& iter) const
114 iter.GetOneItem(ent->CurveFont().Value());
115 iter.GetOneItem(ent->CurveColour());