1 // File: GeomAPI_DataMapOfShapeShape.cpp
2 // Created: 28 Oct 2014
3 // Author: Sergey Zaritchny
5 #include <GeomAPI_Shape.h>
6 #include <GeomAPI_DataMapOfShapeShape.h>
7 #include <TopTools_DataMapOfShapeShape.hxx>
11 GeomAPI_DataMapOfShapeShape::GeomAPI_DataMapOfShapeShape()
12 :GeomAPI_Interface((void *)new TopTools_DataMapOfShapeShape){}
15 void GeomAPI_DataMapOfShapeShape::clear()
17 implPtr<TopTools_DataMapOfShapeShape>()->Clear();
20 /// Adds the Key <K> to the Map <me> with the Item. Returns True if the Key was not already in the map
21 bool GeomAPI_DataMapOfShapeShape::bind (const boost::shared_ptr<GeomAPI_Shape>& theKey, const boost::shared_ptr<GeomAPI_Shape>& theItem)
24 if(implPtr<TopTools_DataMapOfShapeShape>()->Bind(theKey->impl<TopoDS_Shape>(), theItem->impl<TopoDS_Shape>()))
29 /// Returns true if theKey is stored in the map.
30 bool GeomAPI_DataMapOfShapeShape::isBound (const boost::shared_ptr<GeomAPI_Shape>& theKey)
33 if(impl<TopTools_DataMapOfShapeShape>().IsBound(theKey->impl<TopoDS_Shape>()))
38 /// Returns the Item stored with the Key in the Map. To be checked before with isBound()
39 const boost::shared_ptr<GeomAPI_Shape> GeomAPI_DataMapOfShapeShape::find(const boost::shared_ptr<GeomAPI_Shape>& theKey)
41 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
42 aShape->setImpl((void *)&(impl<TopTools_DataMapOfShapeShape>().Find(theKey->impl<TopoDS_Shape>())));
46 /// Removes the Key from the map. Returns true if the Key was in the Map
47 bool GeomAPI_DataMapOfShapeShape::unBind(const boost::shared_ptr<GeomAPI_Shape>& theKey)
50 if(implPtr<TopTools_DataMapOfShapeShape>()->UnBind(theKey->impl<TopoDS_Shape>()))