SHAPER 9.16.0
GeomAPI_ShapeExplorer.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef GeomAPI_ShapeExplorer_H_
21#define GeomAPI_ShapeExplorer_H_
22
23#include <GeomAPI.h>
24#include <GeomAPI_Shape.h>
25
31{
32public:
34 GEOMAPI_EXPORT
36
44 GEOMAPI_EXPORT
45 GeomAPI_ShapeExplorer(const std::shared_ptr<GeomAPI_Shape>& theShape,
46 const GeomAPI_Shape::ShapeType toFind,
47 const GeomAPI_Shape::ShapeType toAvoid = GeomAPI_Shape::SHAPE);
48
56 GEOMAPI_EXPORT
57 void init(const std::shared_ptr<GeomAPI_Shape>& theShape,
58 const GeomAPI_Shape::ShapeType toFind,
59 const GeomAPI_Shape::ShapeType toAvoid = GeomAPI_Shape::SHAPE);
60
62 GEOMAPI_EXPORT
63 bool more() const;
64
67 GEOMAPI_EXPORT
68 void next();
69
72 GEOMAPI_EXPORT
73 std::shared_ptr<GeomAPI_Shape> current();
74
76 GEOMAPI_EXPORT
77 void reinit();
78
80 GEOMAPI_EXPORT
81 int depth() const;
82
84 GEOMAPI_EXPORT
85 void clear();
86
87};
88
89#endif
General base class for all interfaces in this package.
Definition: GeomAPI_Interface.h:38
This class is used to explore subshapes on shape.
Definition: GeomAPI_ShapeExplorer.h:31
GEOMAPI_EXPORT void init(const std::shared_ptr< GeomAPI_Shape > &theShape, const GeomAPI_Shape::ShapeType toFind, const GeomAPI_Shape::ShapeType toAvoid=GeomAPI_Shape::SHAPE)
Resets this explorer.
Definition: GeomAPI_ShapeExplorer.cpp:61
GEOMAPI_EXPORT void next()
Moves to the next Shape in the exploration or do nothing if there are no more shapes to explore.
Definition: GeomAPI_ShapeExplorer.cpp:77
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Shape > current()
Definition: GeomAPI_ShapeExplorer.cpp:86
GEOMAPI_EXPORT void clear()
Clears the content of the explorer. It will return False on more().
Definition: GeomAPI_ShapeExplorer.cpp:111
GEOMAPI_EXPORT void reinit()
Reinitialize the exploration with the original arguments.
Definition: GeomAPI_ShapeExplorer.cpp:99
GEOMAPI_EXPORT GeomAPI_ShapeExplorer()
Default constructor. Creates an empty explorer, becomes useful after Init.
Definition: GeomAPI_ShapeExplorer.cpp:28
GEOMAPI_EXPORT bool more() const
Definition: GeomAPI_ShapeExplorer.cpp:71
GEOMAPI_EXPORT int depth() const
Definition: GeomAPI_ShapeExplorer.cpp:105
ShapeType
Shape type enum.
Definition: GeomAPI_Shape.h:46