Salome HOME
25a40590de6cd056068836d6be1ca9c7e345405b
[modules/shaper.git] / src / GeomAPI / GeomAPI_ShapeIterator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_ShapeIterator.h
4 // Created:     27 April 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef GeomAPI_ShapeIterator_H_
8 #define GeomAPI_ShapeIterator_H_
9
10 #include "GeomAPI.h"
11 #include "GeomAPI_Shape.h"
12
13 /// \class GeomAPI_ShapeIterator
14 /// \ingroup DataModel
15 /// \brief Iterates on the underlying shape underlying a given GeomAPI_Shape object, 
16 ///        providing access
17 ///        to its component sub-shapes. Each component shape is returned as a GeomAPI_Shape with
18 ///        an orientation, and a compound of the original values and the relative values.
19 class GeomAPI_ShapeIterator : public GeomAPI_Interface
20 {
21 public:
22   /// Default constructor. Creates an empty iterator, becomes usefull after Init.
23   GEOMAPI_EXPORT GeomAPI_ShapeIterator();
24
25   /// \brief Creates an iterator on theShape sub-shapes.
26   /// \param[in] theShape shape to iterate.
27   GEOMAPI_EXPORT GeomAPI_ShapeIterator(const std::shared_ptr<GeomAPI_Shape> theShape);
28
29   /// \brief Initializes this iterator with theShape.
30   /// \param[in] theShape shape to iterate.
31   GEOMAPI_EXPORT void init(const std::shared_ptr<GeomAPI_Shape> theShape);
32
33   /// \return  true if there is another sub-shape in the shape which this iterator is scanning.
34   GEOMAPI_EXPORT bool more() const;
35
36   /// Moves on to the next sub-shape in the shape which this iterator is scanning.
37   GEOMAPI_EXPORT void next();
38
39   /// \return the current sub-shape in the shape which this iterator is scanning.
40   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Shape> current();
41 };
42
43 #endif