1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_DataMapOfShapeMapOfShapes.h
4 // Created: 4 September 2015
5 // Author: Dmitry Bobylev
7 #ifndef GeomAPI_DataMapOfShapeMapOfShapes_H_
8 #define GeomAPI_DataMapOfShapeMapOfShapes_H_
10 #include "GeomAPI_Interface.h"
12 #include "GeomAPI_Shape.h"
14 /// \class GeomAPI_DataMapOfShapeMapOfShapes
15 /// \ingroup DataModel
16 /// \brief DataMap of Shape - Map of Shapes defined by TopoDS_Shapes
17 class GeomAPI_DataMapOfShapeMapOfShapes : public GeomAPI_Interface
20 /// Constructor.Creates empty map.
21 GEOMAPI_EXPORT GeomAPI_DataMapOfShapeMapOfShapes();
23 /// \brief Binds list of shapes to the key shape.
24 /// \param[in] theKey key shape.
25 /// \param[in] theItems list of shapes. If shapes have duplications in list only one will be stored.
26 /// \returns true if items bound successfully.
27 GEOMAPI_EXPORT bool bind(const std::shared_ptr<GeomAPI_Shape> theKey,
28 const ListOfShape& theItems);
30 /// \brief Adds item to the map bounded to the key.
31 /// \param[in] theKey key shape.
32 /// \param[in] theItem item shape.
33 /// \returns true if item bounded successfully. False if it is already bound.
34 GEOMAPI_EXPORT bool add(const std::shared_ptr<GeomAPI_Shape> theKey,
35 const std::shared_ptr<GeomAPI_Shape> theItem);
37 /// \return true if theKey is stored in the map.
38 GEOMAPI_EXPORT bool isBound(const std::shared_ptr<GeomAPI_Shape> theKey) const;
40 /// \return list of shapes bounded to theKey.
41 GEOMAPI_EXPORT bool find(const std::shared_ptr<GeomAPI_Shape> theKey,
42 ListOfShape& theItems) const;
44 /// Undinds shapes from theKey.
45 GEOMAPI_EXPORT bool unBind(const std::shared_ptr<GeomAPI_Shape> theKey);
48 GEOMAPI_EXPORT void clear();
50 /// \return size of map.
51 GEOMAPI_EXPORT int size() const;