0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / RWStepShape / RWStepShape_RWPointRepresentation.cxx
1 // Created on: 2002-12-12
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 <RWStepShape_RWPointRepresentation.ixx>
19 #include <StepRepr_HArray1OfRepresentationItem.hxx>
20 #include <StepRepr_RepresentationItem.hxx>
21
22 //=======================================================================
23 //function : RWStepShape_RWPointRepresentation
24 //purpose  : 
25 //=======================================================================
26
27 RWStepShape_RWPointRepresentation::RWStepShape_RWPointRepresentation ()
28 {
29 }
30
31 //=======================================================================
32 //function : ReadStep
33 //purpose  : 
34 //=======================================================================
35
36 void RWStepShape_RWPointRepresentation::ReadStep (const Handle(StepData_StepReaderData)& data,
37                                                   const Standard_Integer num,
38                                                   Handle(Interface_Check)& ach,
39                                                   const Handle(StepShape_PointRepresentation) &ent) const
40 {
41   // Check number of parameters
42   if ( ! data->CheckNbParams(num,3,ach,"point_representation") ) return;
43
44   // Inherited fields of Representation
45
46   Handle(TCollection_HAsciiString) aRepresentation_Name;
47   data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
48
49   Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items;
50   Standard_Integer sub2 = 0;
51   if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
52     Standard_Integer nb0 = data->NbParams(sub2);
53     aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
54     Standard_Integer num2 = sub2;
55     for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
56       Handle(StepRepr_RepresentationItem) anIt0;
57       data->ReadEntity (num2, i0, "representation_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0);
58       aRepresentation_Items->SetValue(i0, anIt0);
59     }
60   }
61
62   Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
63   data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
64
65   // Initialize entity
66   ent->Init(aRepresentation_Name,
67             aRepresentation_Items,
68             aRepresentation_ContextOfItems);
69 }
70
71 //=======================================================================
72 //function : WriteStep
73 //purpose  : 
74 //=======================================================================
75
76 void RWStepShape_RWPointRepresentation::WriteStep (StepData_StepWriter& SW,
77                                                    const Handle(StepShape_PointRepresentation) &ent) const
78 {
79
80   // Inherited fields of Representation
81
82   SW.Send (ent->StepRepr_Representation::Name());
83
84   SW.OpenSub();
85   for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
86     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
87     SW.Send (Var0);
88   }
89   SW.CloseSub();
90
91   SW.Send (ent->StepRepr_Representation::ContextOfItems());
92 }
93
94 //=======================================================================
95 //function : Share
96 //purpose  : 
97 //=======================================================================
98
99 void RWStepShape_RWPointRepresentation::Share (const Handle(StepShape_PointRepresentation) &ent,
100                                                Interface_EntityIterator& iter) const
101 {
102
103   // Inherited fields of Representation
104
105   for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
106     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
107     iter.AddItem (Var0);
108   }
109
110   iter.AddItem (ent->StepRepr_Representation::ContextOfItems());
111 }