1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_DataMapOfShapeShape.cpp
4 // Created: 28 Oct 2014
5 // Author: Sergey Zaritchny
7 #include <GeomAPI_Shape.h>
8 #include <GeomAPI_DataMapOfShapeShape.h>
9 #include <TopTools_DataMapOfShapeShape.hxx>
10 #include <TopoDS_Shape.hxx>
14 GeomAPI_DataMapOfShapeShape::GeomAPI_DataMapOfShapeShape()
15 :GeomAPI_Interface((void *)new TopTools_DataMapOfShapeShape){}
18 void GeomAPI_DataMapOfShapeShape::clear()
20 implPtr<TopTools_DataMapOfShapeShape>()->Clear();
24 int GeomAPI_DataMapOfShapeShape::size()
26 return implPtr<TopTools_DataMapOfShapeShape>()->Extent();
29 /// Adds the Key <K> to the Map <me> with the Item. Returns True if the Key was not already in the map
30 bool GeomAPI_DataMapOfShapeShape::bind (std::shared_ptr<GeomAPI_Shape> theKey, std::shared_ptr<GeomAPI_Shape> theItem)
33 if(implPtr<TopTools_DataMapOfShapeShape>()->Bind(theKey->impl<TopoDS_Shape>(), theItem->impl<TopoDS_Shape>()))
38 /// Returns true if theKey is stored in the map.
39 bool GeomAPI_DataMapOfShapeShape::isBound (std::shared_ptr<GeomAPI_Shape> theKey)
42 if(impl<TopTools_DataMapOfShapeShape>().IsBound(theKey->impl<TopoDS_Shape>()))
47 /// Returns the Item stored with the Key in the Map. To be checked before with isBound()
48 const std::shared_ptr<GeomAPI_Shape> GeomAPI_DataMapOfShapeShape::find(std::shared_ptr<GeomAPI_Shape> theKey)
50 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
51 aShape->setImpl(new TopoDS_Shape(impl<TopTools_DataMapOfShapeShape>().Find(theKey->impl<TopoDS_Shape>())));
55 /// Removes the Key from the map. Returns true if the Key was in the Map
56 bool GeomAPI_DataMapOfShapeShape::unBind(std::shared_ptr<GeomAPI_Shape> theKey)
59 if(implPtr<TopTools_DataMapOfShapeShape>()->UnBind(theKey->impl<TopoDS_Shape>()))
64 GeomAPI_DataMapOfShapeShape::~GeomAPI_DataMapOfShapeShape()
67 implPtr<TopTools_DataMapOfShapeShape>()->Clear();