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_EntityIterator.hxx>
16 #include <RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext.hxx>
17 #include <StepData_StepReaderData.hxx>
18 #include <StepData_StepWriter.hxx>
19 #include <StepGeom_GeometricRepresentationContextAndParametricRepresentationContext.hxx>
21 RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext::RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext () {}
23 void RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext::ReadStep
24 (const Handle(StepData_StepReaderData)& data,
25 const Standard_Integer num0,
26 Handle(Interface_Check)& ach,
27 const Handle(StepGeom_GeometricRepresentationContextAndParametricRepresentationContext)& ent) const
30 Standard_Integer num = num0;
33 // --- Instance of plex component GeometricRepresentationContext ---
35 if (!data->CheckNbParams(num,1,ach,"geometric_representation_context")) return;
37 // --- field : coordinateSpaceDimension ---
39 Standard_Integer aCoordinateSpaceDimension;
40 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
41 data->ReadInteger (num,1,"coordinate_space_dimension",ach,aCoordinateSpaceDimension);
43 num = data->NextForComplex(num);
45 // --- Instance of plex component ParametricRepresentationContext ---
47 if (!data->CheckNbParams(num,0,ach,"parametric_representation_context")) return;
49 num = data->NextForComplex(num);
51 // --- Instance of common supertype RepresentationContext ---
53 if (!data->CheckNbParams(num,2,ach,"representation_context")) return;
55 // --- field : contextIdentifier ---
58 Handle(TCollection_HAsciiString) aContextIdentifier;
59 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
60 data->ReadString (num,1,"context_identifier",ach,aContextIdentifier);
61 // --- field : contextType ---
64 Handle(TCollection_HAsciiString) aContextType;
65 //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
66 data->ReadString (num,2,"context_type",ach,aContextType);
68 //--- Initialisation of the red entity ---
70 ent->Init(aContextIdentifier,aContextType,aCoordinateSpaceDimension);
74 void RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext::WriteStep
75 (StepData_StepWriter& SW,
76 const Handle(StepGeom_GeometricRepresentationContextAndParametricRepresentationContext)& ent) const
79 // --- Instance of plex component GeometricRepresentationContext ---
81 SW.StartEntity("GEOMETRIC_REPRESENTATION_CONTEXT");
82 // --- field : coordinateSpaceDimension ---
84 SW.Send(ent->CoordinateSpaceDimension());
86 // --- Instance of plex component ParametricRepresentationContext ---
88 SW.StartEntity("PARAMETRIC_REPRESENTATION_CONTEXT");
90 // --- Instance of common supertype RepresentationContext ---
92 SW.StartEntity("REPRESENTATION_CONTEXT");
93 // --- field : contextIdentifier ---
95 SW.Send(ent->ContextIdentifier());
96 // --- field : contextType ---
98 SW.Send(ent->ContextType());
102 void RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext::Share(const Handle(StepGeom_GeometricRepresentationContextAndParametricRepresentationContext)& , Interface_EntityIterator& ) const