7fd59977 |
1 | #include <RWStepVisual_RWCurveStyle.ixx> |
2 | #include <StepVisual_CurveStyleFontSelect.hxx> |
3 | #include <StepBasic_SizeSelect.hxx> |
4 | #include <StepVisual_Colour.hxx> |
5 | #include <Interface_EntityIterator.hxx> |
6 | #include <StepVisual_CurveStyle.hxx> |
7 | //#include <StepBasic_SizeMember.hxx> |
8 | |
9 | |
10 | //======================================================================= |
11 | //function : RWStepVisual_RWCurveStyle |
12 | //purpose : |
13 | //======================================================================= |
14 | |
15 | RWStepVisual_RWCurveStyle::RWStepVisual_RWCurveStyle() |
16 | { |
17 | } |
18 | |
19 | |
20 | //======================================================================= |
21 | //function : ReadStep |
22 | //purpose : |
23 | //======================================================================= |
24 | |
25 | void RWStepVisual_RWCurveStyle::ReadStep(const Handle(StepData_StepReaderData)& data, |
26 | const Standard_Integer num, |
27 | Handle(Interface_Check)& ach, |
28 | const Handle(StepVisual_CurveStyle)& ent) const |
29 | { |
30 | |
31 | // --- Number of Parameter Control --- |
32 | if (!data->CheckNbParams(num,4,ach,"curve_style")) return; |
33 | |
34 | // --- own field : name --- |
35 | Handle(TCollection_HAsciiString) aName; |
36 | |
37 | //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed |
38 | data->ReadString (num,1,"name",ach,aName); |
39 | |
40 | // --- own field : curveFont --- |
41 | // idem RWStepVisual_BooleanOperand. |
42 | // doit etre remis a niveau avant utilisation |
43 | StepVisual_CurveStyleFontSelect aCurveFont; |
44 | data->ReadEntity(num,2,"curve_font",ach,aCurveFont); |
45 | |
46 | // --- own field : curveWidth --- |
47 | StepBasic_SizeSelect aCurveWidth; |
48 | data->ReadEntity(num,3,"curve_width",ach,aCurveWidth); |
49 | // Handle(StepBasic_SizeMember) memb = new StepBasic_SizeMember; |
50 | // data->ReadMember(num,3,"curve_width",ach,memb); |
51 | // if ( ! memb->HasName() ) { |
52 | // ach->AddWarning("Parameter #3 (curve_width) is not a POSITIVE_LENGTH_MEASURE"); |
53 | // memb->SetName ( "POSITIVE_LENGTH_MEASURE" ); |
54 | // } |
55 | // aCurveWidth.SetValue(memb); |
56 | |
57 | // --- own field : curveColour --- |
58 | Handle(StepVisual_Colour) aCurveColour; |
59 | |
60 | //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed |
61 | data->ReadEntity(num, 4,"curve_colour", ach, STANDARD_TYPE(StepVisual_Colour), aCurveColour); |
62 | |
63 | //--- Initialisation of the read entity --- |
64 | ent->Init(aName, aCurveFont, aCurveWidth, aCurveColour); |
65 | } |
66 | |
67 | |
68 | //======================================================================= |
69 | //function : WriteStep |
70 | //purpose : |
71 | //======================================================================= |
72 | |
73 | void RWStepVisual_RWCurveStyle::WriteStep(StepData_StepWriter& SW, |
74 | const Handle(StepVisual_CurveStyle)& ent) const |
75 | { |
76 | |
77 | // --- own field : name --- |
78 | SW.Send(ent->Name()); |
79 | |
80 | // --- own field : curveFont --- |
81 | SW.Send(ent->CurveFont().Value()); |
82 | |
83 | // --- own field : curveWidth --- |
84 | SW.Send(ent->CurveWidth().Value()); |
85 | |
86 | // --- own field : curveColour --- |
87 | SW.Send(ent->CurveColour()); |
88 | } |
89 | |
90 | |
91 | //======================================================================= |
92 | //function : Share |
93 | //purpose : |
94 | //======================================================================= |
95 | |
96 | void RWStepVisual_RWCurveStyle::Share(const Handle(StepVisual_CurveStyle)& ent, |
97 | Interface_EntityIterator& iter) const |
98 | { |
99 | iter.GetOneItem(ent->CurveFont().Value()); |
100 | iter.GetOneItem(ent->CurveColour()); |
101 | } |
102 | |