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 <RWStepRepr_RWShapeRepresentationRelationshipWithTransformation.hxx>
18 #include <StepData_StepReaderData.hxx>
19 #include <StepData_StepWriter.hxx>
20 #include <StepRepr_Representation.hxx>
21 #include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
22 #include <StepRepr_Transformation.hxx>
24 RWStepRepr_RWShapeRepresentationRelationshipWithTransformation::RWStepRepr_RWShapeRepresentationRelationshipWithTransformation () {}
26 void RWStepRepr_RWShapeRepresentationRelationshipWithTransformation::ReadStep
27 (const Handle(StepData_StepReaderData)& data,
28 const Standard_Integer num0,
29 Handle(Interface_Check)& ach,
30 const Handle(StepRepr_ShapeRepresentationRelationshipWithTransformation)& ent) const
34 // REPR_RLTS,REPR_RLTS_WITH_TR,SHAPE_REPR_RLTS
35 // But same fields as RepresentationRelationshipWithTransformation
37 // --- Instance of plex componant RepresentationRelationship ---
39 Standard_Integer num = 0; // num0;
40 data->NamedForComplex("REPRESENTATION_RELATIONSHIP", "RPRRLT",num0,num,ach);
42 // --- Number of Parameter Control ---
44 if (!data->CheckNbParams(num,4,ach,"representation_relationship")) return;
46 // --- inherited field : name ---
48 Handle(TCollection_HAsciiString) aName;
49 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
50 data->ReadString (num,1,"name",ach,aName);
52 // --- inherited field : description ---
54 Handle(TCollection_HAsciiString) aDescription;
55 if (data->IsParamDefined (num,2)) { //abv 08.10.99 TRJ2
56 data->ReadString (num,2,"description",ach,aDescription);
59 // --- inherited field : rep1 ---
61 Handle(StepRepr_Representation) aRep1;
62 //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
63 data->ReadEntity(num, 3,"rep_1", ach, STANDARD_TYPE(StepRepr_Representation), aRep1);
65 // --- inherited field : rep2 ---
67 Handle(StepRepr_Representation) aRep2;
68 //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
69 data->ReadEntity(num, 4,"rep_2", ach, STANDARD_TYPE(StepRepr_Representation), aRep2);
71 // --- Instance of plex componant RepresentationRelationshipWithTransformation ---
73 data->NamedForComplex("REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION", "RRWT",num0,num,ach);
74 if (!data->CheckNbParams(num,1,ach,"representation_relationship_with_transformation")) return;
76 // --- own field : transformation_operator
78 StepRepr_Transformation aTrans;
79 //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed
80 data->ReadEntity(num,1,"transformation_operator",ach,aTrans);
82 // --- Instance of plex componant ShapeRepresentationRelationship ---
84 data->NamedForComplex("SHAPE_REPRESENTATION_RELATIONSHIP", "SHRPRL",num0,num,ach);
85 if (!data->CheckNbParams(num,0,ach,"shape_representation_relationship")) return;
87 //--- Initialisation of the read entity ---
90 ent->Init(aName, aDescription, aRep1, aRep2, aTrans);
94 void RWStepRepr_RWShapeRepresentationRelationshipWithTransformation::WriteStep
95 (StepData_StepWriter& SW,
96 const Handle(StepRepr_ShapeRepresentationRelationshipWithTransformation)& ent) const
98 // --- Instance of plex componant RepresentationRelationship ---
100 SW.StartEntity ("REPRESENTATION_RELATIONSHIP");
102 // --- inherited field : name ---
104 SW.Send(ent->Name());
106 // --- inherited field : description ---
108 SW.Send(ent->Description());
110 // --- inherited field : rep1 ---
112 SW.Send(ent->Rep1());
114 // --- inherited field : rep2 ---
116 SW.Send(ent->Rep2());
119 // --- Instance of plex componant RepresentationRelationshipWithTransformation ---
120 SW.StartEntity ("REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION");
122 SW.Send(ent->TransformationOperator().Value());
124 // --- Instance of plex componant ShapeRepresentationRelationship ---
126 SW.StartEntity ("SHAPE_REPRESENTATION_RELATIONSHIP");
130 void RWStepRepr_RWShapeRepresentationRelationshipWithTransformation::Share(const Handle(StepRepr_ShapeRepresentationRelationshipWithTransformation)& ent, Interface_EntityIterator& iter) const
133 iter.GetOneItem(ent->Rep1());
135 iter.GetOneItem(ent->Rep2());
137 iter.GetOneItem(ent->TransformationOperator().Value());