0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / RWStepVisual / RWStepVisual_RWPointStyle.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
7fd59977 14
42cf5bc1 15#include <Interface_Check.hxx>
7fd59977 16#include <Interface_EntityIterator.hxx>
42cf5bc1 17#include <RWStepVisual_RWPointStyle.hxx>
18#include <StepBasic_SizeSelect.hxx>
19#include <StepData_StepReaderData.hxx>
20#include <StepData_StepWriter.hxx>
21#include <StepVisual_Colour.hxx>
22#include <StepVisual_MarkerSelect.hxx>
7fd59977 23#include <StepVisual_PointStyle.hxx>
24
7fd59977 25RWStepVisual_RWPointStyle::RWStepVisual_RWPointStyle () {}
26
27void RWStepVisual_RWPointStyle::ReadStep
28(const Handle(StepData_StepReaderData)& data,
29 const Standard_Integer num,
30 Handle(Interface_Check)& ach,
31 const Handle(StepVisual_PointStyle)& ent) const
32{
33
34
35 // --- Number of Parameter Control ---
36
37 if (!data->CheckNbParams(num,4,ach,"point_style")) return;
38
39 // --- own field : name ---
40
41 Handle(TCollection_HAsciiString) aName;
42 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
43 data->ReadString (num,1,"name",ach,aName);
44
45 // --- own field : marker ---
46 // idem RWStepVisual_RWBooleanResult
47
48 StepVisual_MarkerSelect aMarker;
49 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
50 data->ReadEntity(num,2,"marker",ach,aMarker);
51
52 // --- own field : markerSize ---
53 // idem RWStepVisual_RWBooleanResult
54
55 StepBasic_SizeSelect aMarkerSize;
56 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
57 data->ReadEntity(num,3,"marker_size",ach,aMarkerSize);
58
59 // --- own field : markerColour ---
60
61 Handle(StepVisual_Colour) aMarkerColour;
62 //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
63 data->ReadEntity(num, 4,"marker_colour", ach, STANDARD_TYPE(StepVisual_Colour), aMarkerColour);
64
65 //--- Initialisation of the read entity ---
66
67
68 ent->Init(aName, aMarker, aMarkerSize, aMarkerColour);
69}
70
71
72void RWStepVisual_RWPointStyle::WriteStep
73(StepData_StepWriter& SW,
74 const Handle(StepVisual_PointStyle)& ent) const
75{
76
77 // --- own field : name ---
78 SW.Send(ent->Name());
79
80 // --- own field : marker ---
81 SW.Send(ent->Marker().Value());
82
83 // --- own field : markerSize ---
84 SW.Send(ent->MarkerSize().Value());
85
86 // --- own field : markerColour ---
87 SW.Send(ent->MarkerColour());
88}
89
90
91void RWStepVisual_RWPointStyle::Share(const Handle(StepVisual_PointStyle)& ent, Interface_EntityIterator& iter) const
92{
93
94 if (ent->Marker().CaseNumber() > 0)
95 iter.GetOneItem(ent->Marker().Value());
96 iter.GetOneItem(ent->MarkerColour());
97}
98