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.
26 /// If shapes have duplications in list only one will be stored.
27 /// \returns true if items bound successfully.
28 GEOMAPI_EXPORT bool bind(const std::shared_ptr<GeomAPI_Shape> theKey,
29 const ListOfShape& theItems);
31 /// \brief Adds item to the map bounded to the key.
32 /// \param[in] theKey key shape.
33 /// \param[in] theItem item shape.
34 /// \returns true if item bounded successfully. False if it is already bound.
35 GEOMAPI_EXPORT bool add(const std::shared_ptr<GeomAPI_Shape> theKey,
36 const std::shared_ptr<GeomAPI_Shape> theItem);
38 /// \return true if theKey is stored in the map.
39 GEOMAPI_EXPORT bool isBound(const std::shared_ptr<GeomAPI_Shape> theKey) const;
41 /// \return list of shapes bounded to theKey.
42 GEOMAPI_EXPORT bool find(const std::shared_ptr<GeomAPI_Shape> theKey,
43 ListOfShape& theItems) const;
45 /// Undinds shapes from theKey.
46 GEOMAPI_EXPORT bool unBind(const std::shared_ptr<GeomAPI_Shape> theKey);
49 GEOMAPI_EXPORT void clear();
51 /// \return size of map.
52 GEOMAPI_EXPORT int size() const;