0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / TNaming / TNaming_UsedShapes.cxx
CommitLineData
b311480e 1// Created on: 1997-02-18
2// Created by: Yves FRICAUD
3// Copyright (c) 1997-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <TNaming_UsedShapes.ixx>
18
19#include <TDF_DeltaOnAddition.hxx>
20#include <TNaming_DataMapIteratorOfDataMapOfShapePtrRefShape.hxx>
21#include <TNaming_RefShape.hxx>
997cf5f2 22#include <TNaming_PtrNode.hxx>
7fd59977 23#define BUC60862
24
25#ifdef BUC60862
26#include <TopoDS_Shape.hxx>
27#endif
28
29#define BUC60921 //SRN 15/05/01 : Fixes the memory leak due to pointer to RefShape is not deleted
30
31//=======================================================================
32//function : GetID
33//purpose :
34//=======================================================================
35
36const Standard_GUID& TNaming_UsedShapes::GetID()
37{
38 static Standard_GUID TNaming_UsedShapesID("c4ef4201-568f-11d1-8940-080009dc3333");
39 return TNaming_UsedShapesID;
40}
41
42//=======================================================================
43//function :
44//purpose :
45//=======================================================================
46
47TNaming_UsedShapes::TNaming_UsedShapes()
48{
49}
50
51
52//=======================================================================
53//function : Destroy
54//purpose :
55//=======================================================================
56
57void TNaming_UsedShapes::Destroy()
58{
7fd59977 59 myMap.Clear();
60}
61
62//=======================================================================
63//function : BackupCopy
64//purpose : No Backup
65//=======================================================================
66
67Handle(TDF_Attribute) TNaming_UsedShapes::BackupCopy() const
68{
69 Handle(TNaming_UsedShapes) Att;
70 return Att;
71}
72
73//=======================================================================
74//function : BeforeRemoval
75//purpose :
76//=======================================================================
77
78void TNaming_UsedShapes::BeforeRemoval()
79{
80#ifdef BUC60921
81 Destroy();
82#else
83 myMap.Clear();
84#endif
85}
86
87
88//=======================================================================
89//function : AfterUndo
90//purpose : After application of a TDF_Delta.
91//=======================================================================
92
93Standard_Boolean TNaming_UsedShapes::AfterUndo
94(const Handle(TDF_AttributeDelta)& anAttDelta,
35e08fe8 95 const Standard_Boolean /*forceIt*/)
7fd59977 96{
97 if (anAttDelta->IsKind(STANDARD_TYPE(TDF_DeltaOnAddition))) {
98 anAttDelta->Attribute()->BeforeRemoval();
99 }
100 return Standard_True;
101}
102
103//=======================================================================
104//function : DeltaOnAddition
105//purpose : no delta
106//=======================================================================
107
108Handle(TDF_DeltaOnAddition) TNaming_UsedShapes::DeltaOnAddition() const
109{
110 Handle(TDF_DeltaOnAddition) aDelta;
111 return aDelta;
112}
113//=======================================================================
114//function : DeltaOnRemoval
115//purpose : no delta
116//=======================================================================
117
118Handle(TDF_DeltaOnRemoval) TNaming_UsedShapes::DeltaOnRemoval() const
119{
120 Handle(TDF_DeltaOnRemoval) aDelta;
121 return aDelta;
122}
123
124//=======================================================================
125//function : Restore
126//purpose :
127//=======================================================================
128
35e08fe8 129void TNaming_UsedShapes::Restore(const Handle(TDF_Attribute)& /*anAttribute*/)
7fd59977 130{
131}
132
133//=======================================================================
134//function : NewEmpty
135//purpose :
136//=======================================================================
137
138Handle(TDF_Attribute) TNaming_UsedShapes::NewEmpty () const
139{
140 return new TNaming_UsedShapes();
141}
142
143//=======================================================================
144//function : Paste
145//purpose :
146//=======================================================================
147
35e08fe8 148void TNaming_UsedShapes::Paste(const Handle(TDF_Attribute)&,
149 const Handle(TDF_RelocationTable)&) const
7fd59977 150{
151}
152
153//=======================================================================
154//function : Dump
155//purpose :
156//=======================================================================
157
158Standard_OStream& TNaming_UsedShapes::Dump(Standard_OStream& anOS) const
159{
160#ifdef BUC60862
161 anOS<<"The content of UsedShapes attribute:"<<endl;
162 TNaming_DataMapIteratorOfDataMapOfShapePtrRefShape itr(myMap);
163 for (; itr.More(); itr.Next()) {
164 anOS<<" ";
165 TopAbs::Print(itr.Key().ShapeType(),anOS);
166 anOS<<" ";
167 itr.Value()->Label().EntryDump(anOS);
168 anOS << " Key_TShape = " <<itr.Key().TShape()->This();
169 anOS << " Value_TShape = " <<itr.Value()->Shape().TShape()->This();
170 anOS<<endl;
171 }
172#endif
173 return anOS;
174}
175
176//=======================================================================
177//function : References
178//purpose :
179//=======================================================================
180
35e08fe8 181void TNaming_UsedShapes::References(const Handle(TDF_DataSet)& ) const
7fd59977 182{
183}