Salome HOME
Merge branch 'V9_2_2_BR'
[modules/shaper.git] / src / Selector / Selector_AlgoWithSubs.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
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 Selector_AlgoWithSubs_H_
21 #define Selector_AlgoWithSubs_H_
22
23 #include "Selector_Algo.h"
24
25 #include <list>
26
27 /**\class Selector_AlgoWithSubs
28  * \ingroup DataModel
29  * \brief Kind of selection algorithm: generic algorithm that contains sub-algorithms inside.
30  * It is base for Container, Intersection and FilterByNeighbours algorithms.
31  */
32 class Selector_AlgoWithSubs: public Selector_Algo
33 {
34   std::list<Selector_Algo*> mySubSelList; ///< list of sub-algorithms
35 public:
36   /// Initializes selector
37   Selector_AlgoWithSubs();
38   /// Destructor
39   virtual ~Selector_AlgoWithSubs();
40   /// Erases the sub-algorithms stored
41   void clearSubAlgos();
42   /// Returns the next label for a new sub-selector created
43   TDF_Label newSubLabel();
44   /// Appends a new algorithm to the list, erases list if it is null (failed)
45   bool append(Selector_Algo* theAlgo, const bool theEraseIfNull = true);
46   /// Returns the stored list of sub-algorithms.
47   std::list<Selector_Algo*>& list();
48 };
49
50 #endif