42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _IFSelect_SelectCombine_HeaderFile |
18 | #define _IFSelect_SelectCombine_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
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; |
29 | |
30 | |
31 | class IFSelect_SelectCombine; |
32 | DEFINE_STANDARD_HANDLE(IFSelect_SelectCombine, IFSelect_Selection) |
33 | |
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 |
39 | { |
40 | |
41 | public: |
42 | |
43 | |
44 | //! Returns the count of Input Selections |
45 | Standard_EXPORT Standard_Integer NbInputs() const; |
46 | |
47 | //! Returns an Input Selection, given its rank in the list |
48 | Standard_EXPORT Handle(IFSelect_Selection) Input (const Standard_Integer num) const; |
49 | |
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; |
56 | |
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); |
62 | |
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); |
66 | |
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); |
70 | |
71 | //! Puts in an Iterator the Selections from which "me" depends |
72 | //! That is to say, the list of Input Selections |
79104795 |
73 | Standard_EXPORT void FillIterator (IFSelect_SelectionIterator& iter) const Standard_OVERRIDE; |
42cf5bc1 |
74 | |
75 | |
76 | |
77 | |
92efcf78 |
78 | DEFINE_STANDARD_RTTIEXT(IFSelect_SelectCombine,IFSelect_Selection) |
42cf5bc1 |
79 | |
80 | protected: |
81 | |
82 | |
83 | //! Defines an empty SelectCombine |
84 | Standard_EXPORT IFSelect_SelectCombine(); |
85 | |
86 | //! Returns always True, because RootResult gives a Unique list |
87 | Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const Standard_OVERRIDE; |
88 | |
89 | |
90 | |
91 | private: |
92 | |
93 | |
94 | IFSelect_TSeqOfSelection thelist; |
95 | |
96 | |
97 | }; |
98 | |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | #endif // _IFSelect_SelectCombine_HeaderFile |