1 // Created on: 1998-10-19
2 // Created by: Christian CAILLET
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IFSelect_SelectSuite_HeaderFile
18 #define _IFSelect_SelectSuite_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TCollection_AsciiString.hxx>
24 #include <TColStd_SequenceOfTransient.hxx>
25 #include <IFSelect_SelectDeduct.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_CString.hxx>
28 class IFSelect_Selection;
29 class Interface_EntityIterator;
30 class Interface_Graph;
33 class IFSelect_SelectSuite;
34 DEFINE_STANDARD_HANDLE(IFSelect_SelectSuite, IFSelect_SelectDeduct)
36 //! A SelectSuite can describe a suite of SelectDeduct as a unique
37 //! one : in other words, it can be seen as a "macro selection"
39 //! It works by applying each of its items (which is a
40 //! SelectDeduct) on the result computed by the previous one
41 //! (by using Alternate Input)
43 //! But each of these Selections used as items may be used
44 //! independently, it will then give its own result
46 //! Hence, SelectSuite gives a way of defining a new Selection
47 //! from existing ones, without having to do copies or saves
48 class IFSelect_SelectSuite : public IFSelect_SelectDeduct
54 //! Creates an empty SelectSuite
55 Standard_EXPORT IFSelect_SelectSuite();
57 //! Adds an input selection. I.E. :
58 //! If <item> is a SelectDeduct, adds it as Previous, not as Input
59 //! Else, sets it as Input
60 //! Returns True when done
61 //! Returns False and refuses to work if Input is already defined
62 Standard_EXPORT Standard_Boolean AddInput (const Handle(IFSelect_Selection)& item);
64 //! Adds a new first item (prepends to the list). The Input is not
66 //! If <item> is null, does nothing
67 Standard_EXPORT void AddPrevious (const Handle(IFSelect_SelectDeduct)& item);
69 //! Adds a new last item (prepends to the list)
70 //! If <item> is null, does nothing
71 Standard_EXPORT void AddNext (const Handle(IFSelect_SelectDeduct)& item);
73 //! Returns the count of Items
74 Standard_EXPORT Standard_Integer NbItems() const;
76 //! Returns an item from its rank in the list
77 //! (the Input is always apart)
78 Standard_EXPORT Handle(IFSelect_SelectDeduct) Item (const Standard_Integer num) const;
80 //! Sets a value for the Label
81 Standard_EXPORT void SetLabel (const Standard_CString lab);
83 //! Returns the list of selected entities
84 //! To do this, once InputResult has been taken (if Input or
85 //! Alternate has been defined, else the first Item gives it) :
86 //! this result is set as alternate input for the first item,
87 //! which computes its result : this result is set as alternate
88 //! input for the second item, etc...
89 Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE;
92 //! Either it has been defined by SetLabel, or it will give
93 //! "Suite of nn Selections"
94 Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE;
99 DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSuite,IFSelect_SelectDeduct)
109 TCollection_AsciiString thelab;
110 TColStd_SequenceOfTransient thesel;
121 #endif // _IFSelect_SelectSuite_HeaderFile