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
16 * \brief DataMap of Shape - Map of Shapes defined by TopoDS_Shapes
18 class GeomAPI_DataMapOfShapeMapOfShapes : public GeomAPI_Interface
21 /// Constructor.Creates empty map.
22 GEOMAPI_EXPORT GeomAPI_DataMapOfShapeMapOfShapes();
24 /** \brief Binds list of shapes to the key shape.
25 \param[in] theKey key shape.
26 \param[in] theItems list of shapes. If shapes have duplications in list only one will be stored.
27 \returns true if items bound successfully.
29 GEOMAPI_EXPORT bool bind(const std::shared_ptr<GeomAPI_Shape> theKey,
30 const ListOfShape& theItems);
32 /** \brief Adds item to the map bounded to the key.
33 \param[in] theKey key shape.
34 \param[in] theItem item shape.
35 \returns true if item bounded successfully. False if it is already bound.
37 GEOMAPI_EXPORT bool add(const std::shared_ptr<GeomAPI_Shape> theKey,
38 const std::shared_ptr<GeomAPI_Shape> theItem);
40 /// \return true if theKey is stored in the map.
41 GEOMAPI_EXPORT bool isBound(const std::shared_ptr<GeomAPI_Shape> theKey) const;
43 /// \return list of shapes bounded to theKey.
44 GEOMAPI_EXPORT bool find(const std::shared_ptr<GeomAPI_Shape> theKey,
45 ListOfShape& theItems) const;
47 /// Undinds shapes from theKey.
48 GEOMAPI_EXPORT bool unBind(const std::shared_ptr<GeomAPI_Shape> theKey);
50 /// \return size of map.
51 GEOMAPI_EXPORT int size() const;