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>
8 #include <TopoDS_Shape.hxx>
12 GeomAPI_DataMapOfShapeShape::GeomAPI_DataMapOfShapeShape()
13 :GeomAPI_Interface((void *)new TopTools_DataMapOfShapeShape){}
16 void GeomAPI_DataMapOfShapeShape::clear()
18 implPtr<TopTools_DataMapOfShapeShape>()->Clear();
21 /// Adds the Key <K> to the Map <me> with the Item. Returns True if the Key was not already in the map
22 bool GeomAPI_DataMapOfShapeShape::bind (boost::shared_ptr<GeomAPI_Shape> theKey, boost::shared_ptr<GeomAPI_Shape> theItem)
25 if(implPtr<TopTools_DataMapOfShapeShape>()->Bind(theKey->impl<TopoDS_Shape>(), theItem->impl<TopoDS_Shape>()))
30 /// Returns true if theKey is stored in the map.
31 bool GeomAPI_DataMapOfShapeShape::isBound (boost::shared_ptr<GeomAPI_Shape> theKey)
34 if(impl<TopTools_DataMapOfShapeShape>().IsBound(theKey->impl<TopoDS_Shape>()))
39 /// Returns the Item stored with the Key in the Map. To be checked before with isBound()
40 const boost::shared_ptr<GeomAPI_Shape> GeomAPI_DataMapOfShapeShape::find(boost::shared_ptr<GeomAPI_Shape> theKey)
42 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
43 aShape->setImpl(new TopoDS_Shape(impl<TopTools_DataMapOfShapeShape>().Find(theKey->impl<TopoDS_Shape>())));
47 /// Removes the Key from the map. Returns true if the Key was in the Map
48 bool GeomAPI_DataMapOfShapeShape::unBind(boost::shared_ptr<GeomAPI_Shape> theKey)
51 if(implPtr<TopTools_DataMapOfShapeShape>()->UnBind(theKey->impl<TopoDS_Shape>()))
56 GeomAPI_DataMapOfShapeShape::~GeomAPI_DataMapOfShapeShape()
59 implPtr<TopTools_DataMapOfShapeShape>()->Clear();