Salome HOME
Issue #1369: Added "SubShapes" feature.
[modules/shaper.git] / src / GeomAPI / GeomAPI_DataMapOfShapeMapOfShapes.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_DataMapOfShapeMapOfShapes.h
4 // Created:     4 September 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef GeomAPI_DataMapOfShapeMapOfShapes_H_
8 #define GeomAPI_DataMapOfShapeMapOfShapes_H_
9
10 #include "GeomAPI_Interface.h"
11
12 #include "GeomAPI_Shape.h"
13
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
18 {
19 public:
20   /// Constructor.Creates empty map.
21   GEOMAPI_EXPORT GeomAPI_DataMapOfShapeMapOfShapes();
22
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);
29
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);
36
37   /// \return true if theKey is stored  in the map.
38   GEOMAPI_EXPORT bool isBound(const std::shared_ptr<GeomAPI_Shape> theKey) const;
39
40   /// \return list of shapes bounded to theKey.
41   GEOMAPI_EXPORT bool find(const std::shared_ptr<GeomAPI_Shape> theKey,
42                            ListOfShape& theItems) const;
43
44   /// Undinds shapes from theKey.
45   GEOMAPI_EXPORT bool unBind(const std::shared_ptr<GeomAPI_Shape> theKey);
46
47   /// Clears map.
48   GEOMAPI_EXPORT void clear();
49
50   /// \return size of map.
51   GEOMAPI_EXPORT int size() const;
52 };
53
54 #endif