Salome HOME
Merge remote-tracking branch 'origin/cgt/devCEA'
[modules/shaper.git] / src / GeomAPI / GeomAPI_DataMapOfShapeMapOfShapes.cpp
index 9e076e6f9c838140ce1129adb3af7f80bdaaf0a3..350289e897451c836eb25fc6f294782f2237dfb4 100644 (file)
@@ -22,6 +22,9 @@ bool GeomAPI_DataMapOfShapeMapOfShapes::bind(const std::shared_ptr<GeomAPI_Shape
                                              const ListOfShape& theItems)
 {
   const TopoDS_Shape& aKey = theKey->impl<TopoDS_Shape>();
+  if(MY_MAP->IsBound(aKey)) {
+    MY_MAP->ChangeFind(aKey).Clear();
+  }
   for(ListOfShape::const_iterator anIt = theItems.cbegin(); anIt != theItems.cend(); anIt++) {
     const TopoDS_Shape& anItem = (*anIt)->impl<TopoDS_Shape>();
     if(MY_MAP->IsBound(aKey)) {
@@ -85,6 +88,12 @@ bool GeomAPI_DataMapOfShapeMapOfShapes::unBind(const std::shared_ptr<GeomAPI_Sha
   return MY_MAP->UnBind(aKey) == Standard_True;
 }
 
+//=================================================================================================
+void GeomAPI_DataMapOfShapeMapOfShapes::clear()
+{
+  return MY_MAP->Clear();
+}
+
 //=================================================================================================
 int GeomAPI_DataMapOfShapeMapOfShapes::size() const
 {