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 <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
11 #include <TopoDS_Shape.hxx>
15 GeomAPI_DataMapOfShapeShape::GeomAPI_DataMapOfShapeShape()
16 : GeomAPI_Interface(new TopTools_DataMapOfShapeShape){}
18 void GeomAPI_DataMapOfShapeShape::clear()
20 implPtr<TopTools_DataMapOfShapeShape>()->Clear();
23 int GeomAPI_DataMapOfShapeShape::size()
25 return implPtr<TopTools_DataMapOfShapeShape>()->Extent();
28 bool GeomAPI_DataMapOfShapeShape::bind (std::shared_ptr<GeomAPI_Shape> theKey, std::shared_ptr<GeomAPI_Shape> theItem)
31 if(implPtr<TopTools_DataMapOfShapeShape>()->Bind(theKey->impl<TopoDS_Shape>(), theItem->impl<TopoDS_Shape>()))
36 void GeomAPI_DataMapOfShapeShape::merge(const GeomAPI_DataMapOfShapeShape& theDataMap)
38 const TopTools_DataMapOfShapeShape& aDataMap = theDataMap.impl<TopTools_DataMapOfShapeShape>();
39 TopTools_DataMapOfShapeShape* myDataMap = implPtr<TopTools_DataMapOfShapeShape>();
40 for(TopTools_DataMapIteratorOfDataMapOfShapeShape anIt(aDataMap); anIt.More(); anIt.Next()) {
41 myDataMap->Bind(anIt.Key(), anIt.Value());
45 void GeomAPI_DataMapOfShapeShape::merge(const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theDataMap)
47 if(theDataMap.get()) {
48 merge(*theDataMap.get());
52 bool GeomAPI_DataMapOfShapeShape::isBound (std::shared_ptr<GeomAPI_Shape> theKey)
55 if(impl<TopTools_DataMapOfShapeShape>().IsBound(theKey->impl<TopoDS_Shape>()))
60 const std::shared_ptr<GeomAPI_Shape> GeomAPI_DataMapOfShapeShape::find(std::shared_ptr<GeomAPI_Shape> theKey)
62 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
63 aShape->setImpl(new TopoDS_Shape(impl<TopTools_DataMapOfShapeShape>().Find(theKey->impl<TopoDS_Shape>())));
67 bool GeomAPI_DataMapOfShapeShape::unBind(std::shared_ptr<GeomAPI_Shape> theKey)
70 if(implPtr<TopTools_DataMapOfShapeShape>()->UnBind(theKey->impl<TopoDS_Shape>()))
75 GeomAPI_DataMapOfShapeShape::~GeomAPI_DataMapOfShapeShape()
78 implPtr<TopTools_DataMapOfShapeShape>()->Clear();