]> SALOME platform Git repositories - modules/geom.git/blob - src/NMTDS/NMTDS_IndexedDataMapOfShapeBndSphere.hxx
Salome HOME
IPAL22903: TC650: Store/Restore last GUI state does not work for Isos
[modules/geom.git] / src / NMTDS / NMTDS_IndexedDataMapOfShapeBndSphere.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _NMTDS_IndexedDataMapOfShapeBndSphere_HeaderFile
21 #define _NMTDS_IndexedDataMapOfShapeBndSphere_HeaderFile
22
23 #ifndef _TCollection_BasicMap_HeaderFile
24 #include <TCollection_BasicMap.hxx>
25 #endif
26 #ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBndSphere_HeaderFile
27 #include <Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBndSphere.hxx>
28 #endif
29 #ifndef _Standard_Integer_HeaderFile
30 #include <Standard_Integer.hxx>
31 #endif
32 #ifndef _Standard_Boolean_HeaderFile
33 #include <Standard_Boolean.hxx>
34 #endif
35
36 class Standard_DomainError;
37 class Standard_OutOfRange;
38 class Standard_NoSuchObject;
39 class TopoDS_Shape;
40 class NMTDS_BndSphere;
41 class TopTools_ShapeMapHasher;
42 class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBndSphere;
43
44 #ifndef _Standard_HeaderFile
45 #include <Standard.hxx>
46 #endif
47 #ifndef _Standard_Macro_HeaderFile
48 #include <Standard_Macro.hxx>
49 #endif
50
51 #include <Basics_OCCTVersion.hxx>
52
53 class NMTDS_IndexedDataMapOfShapeBndSphere  : public TCollection_BasicMap {
54
55 public:
56
57     void* operator new(size_t,void* anAddress) 
58       {
59         return anAddress;
60       }
61     void* operator new(size_t size) 
62       { 
63         return Standard::Allocate(size); 
64       }
65     void  operator delete(void *anAddress) 
66       { 
67         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
68       }
69  // Methods PUBLIC
70  // 
71
72
73 Standard_EXPORT NMTDS_IndexedDataMapOfShapeBndSphere(const Standard_Integer NbBuckets = 1);
74
75
76 Standard_EXPORT   NMTDS_IndexedDataMapOfShapeBndSphere& Assign(const NMTDS_IndexedDataMapOfShapeBndSphere& Other) ;
77   NMTDS_IndexedDataMapOfShapeBndSphere& operator =(const NMTDS_IndexedDataMapOfShapeBndSphere& Other) 
78 {
79   return Assign(Other);
80 }
81
82
83
84 Standard_EXPORT   void ReSize(const Standard_Integer NbBuckets) ;
85
86
87 Standard_EXPORT   void Clear() ;
88 ~NMTDS_IndexedDataMapOfShapeBndSphere()
89 {
90   Clear();
91 }
92
93
94
95 Standard_EXPORT   Standard_Integer Add(const TopoDS_Shape& K,const NMTDS_BndSphere& I) ;
96
97
98 Standard_EXPORT   void Substitute(const Standard_Integer I,const TopoDS_Shape& K,const NMTDS_BndSphere& T) ;
99
100
101 Standard_EXPORT   void RemoveLast() ;
102
103
104 Standard_EXPORT   Standard_Boolean Contains(const TopoDS_Shape& K) const;
105
106
107 Standard_EXPORT  const TopoDS_Shape& FindKey(const Standard_Integer I) const;
108
109
110 Standard_EXPORT  const NMTDS_BndSphere& FindFromIndex(const Standard_Integer I) const;
111  const NMTDS_BndSphere& operator ()(const Standard_Integer I) const
112 {
113   return FindFromIndex(I);
114 }
115
116
117
118 Standard_EXPORT   NMTDS_BndSphere& ChangeFromIndex(const Standard_Integer I) ;
119   NMTDS_BndSphere& operator ()(const Standard_Integer I) 
120 {
121   return ChangeFromIndex(I);
122 }
123
124
125
126 Standard_EXPORT   Standard_Integer FindIndex(const TopoDS_Shape& K) const;
127
128
129 Standard_EXPORT  const NMTDS_BndSphere& FindFromKey(const TopoDS_Shape& K) const;
130
131
132 Standard_EXPORT   NMTDS_BndSphere& ChangeFromKey(const TopoDS_Shape& K) ;
133
134 #if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
135   Standard_EXPORT Standard_Address FindFromKey1 (const TopoDS_Shape& K) const;
136   Standard_EXPORT Standard_Address ChangeFromKey1 (const TopoDS_Shape& K);
137 #endif
138
139 private: 
140
141  // Methods PRIVATE
142  // 
143
144 Standard_EXPORT NMTDS_IndexedDataMapOfShapeBndSphere(const NMTDS_IndexedDataMapOfShapeBndSphere& Other);
145
146 };
147
148 // other Inline functions and methods (like "C++: function call" methods)
149 //
150
151 #endif