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 <RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext.hxx>
18 #include <StepData_StepReaderData.hxx>
19 #include <StepData_StepWriter.hxx>
20 #include <StepGeom_GeometricRepresentationContext.hxx>
21 #include <StepGeom_GeometricRepresentationContextAndParametricRepresentationContext.hxx>
23 RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext::RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext () {}
25 void RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext::ReadStep
26 (const Handle(StepData_StepReaderData)& data,
27 const Standard_Integer num0,
28 Handle(Interface_Check)& ach,
29 const Handle(StepGeom_GeometricRepresentationContextAndParametricRepresentationContext)& ent) const
32 Standard_Integer num = num0;
35 // --- Instance of plex componant GeometricRepresentationContext ---
37 if (!data->CheckNbParams(num,1,ach,"geometric_representation_context")) return;
39 // --- field : coordinateSpaceDimension ---
41 Standard_Integer aCoordinateSpaceDimension;
42 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
43 data->ReadInteger (num,1,"coordinate_space_dimension",ach,aCoordinateSpaceDimension);
45 num = data->NextForComplex(num);
47 // --- Instance of plex componant ParametricRepresentationContext ---
49 if (!data->CheckNbParams(num,0,ach,"parametric_representation_context")) return;
51 num = data->NextForComplex(num);
53 // --- Instance of common supertype RepresentationContext ---
55 if (!data->CheckNbParams(num,2,ach,"representation_context")) return;
57 // --- field : contextIdentifier ---
60 Handle(TCollection_HAsciiString) aContextIdentifier;
61 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
62 data->ReadString (num,1,"context_identifier",ach,aContextIdentifier);
63 // --- field : contextType ---
66 Handle(TCollection_HAsciiString) aContextType;
67 //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
68 data->ReadString (num,2,"context_type",ach,aContextType);
70 //--- Initialisation of the red entity ---
72 ent->Init(aContextIdentifier,aContextType,aCoordinateSpaceDimension);
76 void RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext::WriteStep
77 (StepData_StepWriter& SW,
78 const Handle(StepGeom_GeometricRepresentationContextAndParametricRepresentationContext)& ent) const
81 // --- Instance of plex componant GeometricRepresentationContext ---
83 SW.StartEntity("GEOMETRIC_REPRESENTATION_CONTEXT");
84 // --- field : coordinateSpaceDimension ---
86 SW.Send(ent->CoordinateSpaceDimension());
88 // --- Instance of plex componant ParametricRepresentationContext ---
90 SW.StartEntity("PARAMETRIC_REPRESENTATION_CONTEXT");
92 // --- Instance of common supertype RepresentationContext ---
94 SW.StartEntity("REPRESENTATION_CONTEXT");
95 // --- field : contextIdentifier ---
97 SW.Send(ent->ContextIdentifier());
98 // --- field : contextType ---
100 SW.Send(ent->ContextType());
104 void RWStepGeom_RWGeometricRepresentationContextAndParametricRepresentationContext::Share(const Handle(StepGeom_GeometricRepresentationContextAndParametricRepresentationContext)& , Interface_EntityIterator& ) const