00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 #ifndef _GEOMAlgo_IndexedDataMapOfShapeShapeInfo_HeaderFile 00021 #define _GEOMAlgo_IndexedDataMapOfShapeShapeInfo_HeaderFile 00022 00023 #ifndef _TCollection_BasicMap_HeaderFile 00024 #include <TCollection_BasicMap.hxx> 00025 #endif 00026 #ifndef _Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_HeaderFile 00027 #include <Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx> 00028 #endif 00029 #ifndef _Standard_Integer_HeaderFile 00030 #include <Standard_Integer.hxx> 00031 #endif 00032 #ifndef _Standard_Boolean_HeaderFile 00033 #include <Standard_Boolean.hxx> 00034 #endif 00035 class Standard_DomainError; 00036 class Standard_OutOfRange; 00037 class Standard_NoSuchObject; 00038 class TopoDS_Shape; 00039 class GEOMAlgo_ShapeInfo; 00040 class TopTools_ShapeMapHasher; 00041 class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo; 00042 00043 00044 #ifndef _Standard_HeaderFile 00045 #include <Standard.hxx> 00046 #endif 00047 #ifndef _Standard_Macro_HeaderFile 00048 #include <Standard_Macro.hxx> 00049 #endif 00050 00051 00052 class GEOMAlgo_IndexedDataMapOfShapeShapeInfo : public TCollection_BasicMap { 00053 00054 public: 00055 00056 void* operator new(size_t,void* anAddress) 00057 { 00058 return anAddress; 00059 } 00060 void* operator new(size_t size) 00061 { 00062 return Standard::Allocate(size); 00063 } 00064 void operator delete(void *anAddress) 00065 { 00066 if (anAddress) Standard::Free((Standard_Address&)anAddress); 00067 } 00068 // Methods PUBLIC 00069 // 00070 00071 00072 Standard_EXPORT GEOMAlgo_IndexedDataMapOfShapeShapeInfo(const Standard_Integer NbBuckets = 1); 00073 00074 00075 Standard_EXPORT GEOMAlgo_IndexedDataMapOfShapeShapeInfo& Assign(const GEOMAlgo_IndexedDataMapOfShapeShapeInfo& Other) ; 00076 GEOMAlgo_IndexedDataMapOfShapeShapeInfo& operator =(const GEOMAlgo_IndexedDataMapOfShapeShapeInfo& Other) 00077 { 00078 return Assign(Other); 00079 } 00080 00081 00082 00083 Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; 00084 00085 00086 Standard_EXPORT void Clear() ; 00087 ~GEOMAlgo_IndexedDataMapOfShapeShapeInfo() 00088 { 00089 Clear(); 00090 } 00091 00092 00093 00094 Standard_EXPORT Standard_Integer Add(const TopoDS_Shape& K,const GEOMAlgo_ShapeInfo& I) ; 00095 00096 00097 Standard_EXPORT void Substitute(const Standard_Integer I,const TopoDS_Shape& K,const GEOMAlgo_ShapeInfo& T) ; 00098 00099 00100 Standard_EXPORT void RemoveLast() ; 00101 00102 00103 Standard_EXPORT Standard_Boolean Contains(const TopoDS_Shape& K) const; 00104 00105 00106 Standard_EXPORT const TopoDS_Shape& FindKey(const Standard_Integer I) const; 00107 00108 00109 Standard_EXPORT const GEOMAlgo_ShapeInfo& FindFromIndex(const Standard_Integer I) const; 00110 const GEOMAlgo_ShapeInfo& operator ()(const Standard_Integer I) const 00111 { 00112 return FindFromIndex(I); 00113 } 00114 00115 00116 00117 Standard_EXPORT GEOMAlgo_ShapeInfo& ChangeFromIndex(const Standard_Integer I) ; 00118 GEOMAlgo_ShapeInfo& operator ()(const Standard_Integer I) 00119 { 00120 return ChangeFromIndex(I); 00121 } 00122 00123 00124 00125 Standard_EXPORT Standard_Integer FindIndex(const TopoDS_Shape& K) const; 00126 00127 00128 Standard_EXPORT const GEOMAlgo_ShapeInfo& FindFromKey(const TopoDS_Shape& K) const; 00129 00130 00131 Standard_EXPORT GEOMAlgo_ShapeInfo& ChangeFromKey(const TopoDS_Shape& K) ; 00132 00133 00134 00135 00136 00137 protected: 00138 00139 // Methods PROTECTED 00140 // 00141 00142 00143 // Fields PROTECTED 00144 // 00145 00146 00147 private: 00148 00149 // Methods PRIVATE 00150 // 00151 00152 00153 Standard_EXPORT GEOMAlgo_IndexedDataMapOfShapeShapeInfo(const GEOMAlgo_IndexedDataMapOfShapeShapeInfo& Other); 00154 00155 00156 // Fields PRIVATE 00157 // 00158 00159 00160 }; 00161 00162 00163 00164 00165 00166 // other Inline functions and methods (like "C++: function call" methods) 00167 // 00168 00169 00170 #endif