b311480e |
1 | // Created on: 2002-12-12 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 2002-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 |
7fd59977 |
21 | |
22 | #include <RWStepFEA_RWNodeWithSolutionCoordinateSystem.ixx> |
23 | #include <StepRepr_HArray1OfRepresentationItem.hxx> |
24 | #include <StepRepr_RepresentationItem.hxx> |
25 | |
26 | //======================================================================= |
27 | //function : RWStepFEA_RWNodeWithSolutionCoordinateSystem |
28 | //purpose : |
29 | //======================================================================= |
30 | |
31 | RWStepFEA_RWNodeWithSolutionCoordinateSystem::RWStepFEA_RWNodeWithSolutionCoordinateSystem () |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : ReadStep |
37 | //purpose : |
38 | //======================================================================= |
39 | |
40 | void RWStepFEA_RWNodeWithSolutionCoordinateSystem::ReadStep (const Handle(StepData_StepReaderData)& data, |
41 | const Standard_Integer num, |
42 | Handle(Interface_Check)& ach, |
43 | const Handle(StepFEA_NodeWithSolutionCoordinateSystem) &ent) const |
44 | { |
45 | // Check number of parameters |
46 | if ( ! data->CheckNbParams(num,4,ach,"node_with_solution_coordinate_system") ) return; |
47 | |
48 | // Inherited fields of Representation |
49 | |
50 | Handle(TCollection_HAsciiString) aRepresentation_Name; |
51 | data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name); |
52 | |
53 | Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items; |
54 | Standard_Integer sub2 = 0; |
55 | if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) { |
56 | Standard_Integer nb0 = data->NbParams(sub2); |
57 | aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0); |
58 | Standard_Integer num2 = sub2; |
59 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
60 | Handle(StepRepr_RepresentationItem) anIt0; |
61 | data->ReadEntity (num2, i0, "representation_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0); |
62 | aRepresentation_Items->SetValue(i0, anIt0); |
63 | } |
64 | } |
65 | |
66 | Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems; |
67 | data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems); |
68 | |
69 | // Inherited fields of NodeRepresentation |
70 | |
71 | Handle(StepFEA_FeaModel) aNodeRepresentation_ModelRef; |
72 | data->ReadEntity (num, 4, "node_representation.model_ref", ach, STANDARD_TYPE(StepFEA_FeaModel), aNodeRepresentation_ModelRef); |
73 | |
74 | // Initialize entity |
75 | ent->Init(aRepresentation_Name, |
76 | aRepresentation_Items, |
77 | aRepresentation_ContextOfItems, |
78 | aNodeRepresentation_ModelRef); |
79 | } |
80 | |
81 | //======================================================================= |
82 | //function : WriteStep |
83 | //purpose : |
84 | //======================================================================= |
85 | |
86 | void RWStepFEA_RWNodeWithSolutionCoordinateSystem::WriteStep (StepData_StepWriter& SW, |
87 | const Handle(StepFEA_NodeWithSolutionCoordinateSystem) &ent) const |
88 | { |
89 | |
90 | // Inherited fields of Representation |
91 | |
92 | SW.Send (ent->StepRepr_Representation::Name()); |
93 | |
94 | SW.OpenSub(); |
95 | for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) { |
96 | Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1); |
97 | SW.Send (Var0); |
98 | } |
99 | SW.CloseSub(); |
100 | |
101 | SW.Send (ent->StepRepr_Representation::ContextOfItems()); |
102 | |
103 | // Inherited fields of NodeRepresentation |
104 | |
105 | SW.Send (ent->StepFEA_NodeRepresentation::ModelRef()); |
106 | } |
107 | |
108 | //======================================================================= |
109 | //function : Share |
110 | //purpose : |
111 | //======================================================================= |
112 | |
113 | void RWStepFEA_RWNodeWithSolutionCoordinateSystem::Share (const Handle(StepFEA_NodeWithSolutionCoordinateSystem) &ent, |
114 | Interface_EntityIterator& iter) const |
115 | { |
116 | |
117 | // Inherited fields of Representation |
118 | |
119 | for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) { |
120 | Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1); |
121 | iter.AddItem (Var0); |
122 | } |
123 | |
124 | iter.AddItem (ent->StepRepr_Representation::ContextOfItems()); |
125 | |
126 | // Inherited fields of NodeRepresentation |
127 | |
128 | iter.AddItem (ent->StepFEA_NodeRepresentation::ModelRef()); |
129 | } |