0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / RWStepRepr / RWStepRepr_RWStructuralResponsePropertyDefinitionRepresentation.cxx
1 // Created on: 2002-12-15
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
17
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepRepr_RWStructuralResponsePropertyDefinitionRepresentation.hxx>
21 #include <StepData_StepReaderData.hxx>
22 #include <StepData_StepWriter.hxx>
23 #include <StepRepr_PropertyDefinition.hxx>
24 #include <StepRepr_Representation.hxx>
25 #include <StepRepr_StructuralResponsePropertyDefinitionRepresentation.hxx>
26
27 //=======================================================================
28 //function : RWStepRepr_RWStructuralResponsePropertyDefinitionRepresentation
29 //purpose  : 
30 //=======================================================================
31 RWStepRepr_RWStructuralResponsePropertyDefinitionRepresentation::RWStepRepr_RWStructuralResponsePropertyDefinitionRepresentation ()
32 {
33 }
34
35 //=======================================================================
36 //function : ReadStep
37 //purpose  : 
38 //=======================================================================
39
40 void RWStepRepr_RWStructuralResponsePropertyDefinitionRepresentation::ReadStep (const Handle(StepData_StepReaderData)& data,
41                                                                                 const Standard_Integer num,
42                                                                                 Handle(Interface_Check)& ach,
43                                                                                 const Handle(StepRepr_StructuralResponsePropertyDefinitionRepresentation) &ent) const
44 {
45   // Check number of parameters
46   if ( ! data->CheckNbParams(num,2,ach,"structural_response_property_definition_representation") ) return;
47
48   // Inherited fields of PropertyDefinitionRepresentation
49
50   Handle(StepRepr_PropertyDefinition) aPropertyDefinitionRepresentation_Definition;
51   data->ReadEntity (num, 1, "property_definition_representation.definition", ach, STANDARD_TYPE(StepRepr_PropertyDefinition), aPropertyDefinitionRepresentation_Definition);
52
53   Handle(StepRepr_Representation) aPropertyDefinitionRepresentation_UsedRepresentation;
54   data->ReadEntity (num, 2, "property_definition_representation.used_representation", ach, STANDARD_TYPE(StepRepr_Representation), aPropertyDefinitionRepresentation_UsedRepresentation);
55
56   //skl 15.12.2002
57   StepRepr_RepresentedDefinition aRepresentedDefinition;
58   aRepresentedDefinition.SetValue(aPropertyDefinitionRepresentation_Definition);
59
60   // Initialize entity
61   ent->Init(/*aPropertyDefinitionRepresentation_Definition*/aRepresentedDefinition,
62             aPropertyDefinitionRepresentation_UsedRepresentation);
63 }
64
65 //=======================================================================
66 //function : WriteStep
67 //purpose  : 
68 //=======================================================================
69
70 void RWStepRepr_RWStructuralResponsePropertyDefinitionRepresentation::WriteStep (StepData_StepWriter& SW,
71                                                                                  const Handle(StepRepr_StructuralResponsePropertyDefinitionRepresentation) &ent) const
72 {
73
74   // Inherited fields of PropertyDefinitionRepresentation
75
76   SW.Send (ent->StepRepr_PropertyDefinitionRepresentation::Definition().Value());
77
78   SW.Send (ent->StepRepr_PropertyDefinitionRepresentation::UsedRepresentation());
79 }
80
81 //=======================================================================
82 //function : Share
83 //purpose  : 
84 //=======================================================================
85
86 void RWStepRepr_RWStructuralResponsePropertyDefinitionRepresentation::Share (const Handle(StepRepr_StructuralResponsePropertyDefinitionRepresentation) &ent,
87                                                                              Interface_EntityIterator& iter) const
88 {
89
90   // Inherited fields of PropertyDefinitionRepresentation
91
92   iter.AddItem (ent->StepRepr_PropertyDefinitionRepresentation::Definition().Value());
93
94   iter.AddItem (ent->StepRepr_PropertyDefinitionRepresentation::UsedRepresentation());
95 }