1 // Created on: 1992-11-17
2 // Created by: Christian CAILLET
3 // Copyright (c) 1992-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_SelectCombine_HeaderFile
18 #define _IFSelect_SelectCombine_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <IFSelect_TSeqOfSelection.hxx>
24 #include <IFSelect_Selection.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 class IFSelect_Selection;
28 class IFSelect_SelectionIterator;
31 class IFSelect_SelectCombine;
32 DEFINE_STANDARD_HANDLE(IFSelect_SelectCombine, IFSelect_Selection)
34 //! A SelectCombine type Selection defines algebraic operations
35 //! between results of several Selections
36 //! It is a deferred class : sub-classes will have to define
37 //! precise what operator is to be applied
38 class IFSelect_SelectCombine : public IFSelect_Selection
44 //! Returns the count of Input Selections
45 Standard_EXPORT Standard_Integer NbInputs() const;
47 //! Returns an Input Selection, given its rank in the list
48 Standard_EXPORT Handle(IFSelect_Selection) Input (const Standard_Integer num) const;
50 //! Returns the rank of an input Selection, 0 if not in the list.
51 //! Most generally, its value is meaningless, except for testing
52 //! the presence of an input Selection :
53 //! - == 0 if <sel> is not an input for <me>
54 //! - > 0 if <sel> is an input for <me>
55 Standard_EXPORT Standard_Integer InputRank (const Handle(IFSelect_Selection)& sel) const;
57 //! Adds a Selection to the filling list
58 //! By default, adds it to the end of the list
59 //! A Positive rank less then NbInputs gives an insertion rank
60 //! (InsertBefore : the new <atnum>th item of the list is <sel>)
61 Standard_EXPORT void Add (const Handle(IFSelect_Selection)& sel, const Standard_Integer atnum = 0);
63 //! Removes an input Selection.
64 //! Returns True if Done, False, if <sel> is not an input for <me>
65 Standard_EXPORT Standard_Boolean Remove (const Handle(IFSelect_Selection)& sel);
67 //! Removes an input Selection, given its rank in the list
68 //! Returns True if Done, False if <num> is out of range
69 Standard_EXPORT Standard_Boolean Remove (const Standard_Integer num);
71 //! Puts in an Iterator the Selections from which "me" depends
72 //! That is to say, the list of Input Selections
73 Standard_EXPORT void FillIterator (IFSelect_SelectionIterator& iter) const Standard_OVERRIDE;
78 DEFINE_STANDARD_RTTIEXT(IFSelect_SelectCombine,IFSelect_Selection)
83 //! Defines an empty SelectCombine
84 Standard_EXPORT IFSelect_SelectCombine();
86 //! Returns always True, because RootResult gives a Unique list
87 Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const Standard_OVERRIDE;
94 IFSelect_TSeqOfSelection thelist;
105 #endif // _IFSelect_SelectCombine_HeaderFile