7fd59977 |
1 | // File: RWStepRepr_RWExtension.cxx |
2 | // Created: Wed Jun 4 14:17:23 2003 |
3 | // Author: Galina KULIKOVA |
4 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 |
5 | // Copyright: Open CASCADE 2002 |
6 | |
7 | #include <RWStepRepr_RWExtension.ixx> |
8 | |
9 | //======================================================================= |
10 | //function : RWStepRepr_RWExtension |
11 | //purpose : |
12 | //======================================================================= |
13 | |
14 | RWStepRepr_RWExtension::RWStepRepr_RWExtension () |
15 | { |
16 | } |
17 | |
18 | //======================================================================= |
19 | //function : ReadStep |
20 | //purpose : |
21 | //======================================================================= |
22 | |
23 | void RWStepRepr_RWExtension::ReadStep (const Handle(StepData_StepReaderData)& data, |
24 | const Standard_Integer num, |
25 | Handle(Interface_Check)& ach, |
26 | const Handle(StepRepr_Extension) &ent) const |
27 | { |
28 | // Check number of parameters |
29 | if ( ! data->CheckNbParams(num,4,ach,"extension") ) return; |
30 | |
31 | // Inherited fields of ShapeAspect |
32 | |
33 | Handle(TCollection_HAsciiString) aShapeAspect_Name; |
34 | data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name); |
35 | |
36 | Handle(TCollection_HAsciiString) aShapeAspect_Description; |
37 | Standard_Boolean hasShapeAspect_Description = Standard_True; |
38 | if ( data->IsParamDefined (num,2) ) { |
39 | data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description); |
40 | } |
41 | else { |
42 | hasShapeAspect_Description = Standard_False; |
43 | } |
44 | |
45 | Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape; |
46 | data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape); |
47 | |
48 | StepData_Logical aShapeAspect_ProductDefinitional; |
49 | data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional); |
50 | |
51 | // Initialize entity |
52 | ent->Init(aShapeAspect_Name, |
53 | aShapeAspect_Description, |
54 | aShapeAspect_OfShape, |
55 | aShapeAspect_ProductDefinitional); |
56 | } |
57 | |
58 | //======================================================================= |
59 | //function : WriteStep |
60 | //purpose : |
61 | //======================================================================= |
62 | |
63 | void RWStepRepr_RWExtension::WriteStep (StepData_StepWriter& SW, |
64 | const Handle(StepRepr_Extension) &ent) const |
65 | { |
66 | |
67 | // Inherited fields of ShapeAspect |
68 | |
69 | SW.Send (ent->StepRepr_ShapeAspect::Name()); |
70 | |
71 | SW.Send (ent->StepRepr_ShapeAspect::Description()); |
72 | |
73 | SW.Send (ent->StepRepr_ShapeAspect::OfShape()); |
74 | |
75 | SW.SendLogical (ent->StepRepr_ShapeAspect::ProductDefinitional()); |
76 | } |
77 | |
78 | //======================================================================= |
79 | //function : Share |
80 | //purpose : |
81 | //======================================================================= |
82 | |
83 | void RWStepRepr_RWExtension::Share (const Handle(StepRepr_Extension) &ent, |
84 | Interface_EntityIterator& iter) const |
85 | { |
86 | |
87 | // Inherited fields of ShapeAspect |
88 | |
89 | iter.AddItem (ent->StepRepr_ShapeAspect::OfShape()); |
90 | } |