7fd59977 |
1 | #include <IFSelect_SelectCombine.ixx> |
2 | #include <IFGraph_Cumulate.hxx> |
3 | |
4 | |
5 | IFSelect_SelectCombine::IFSelect_SelectCombine () { } |
6 | // { thelist = new IFSelect_SequenceOfSelection(); } |
7 | |
8 | Standard_Integer IFSelect_SelectCombine::NbInputs () const |
9 | { return thelist.Length(); } |
10 | |
11 | Handle(IFSelect_Selection) IFSelect_SelectCombine::Input |
12 | (const Standard_Integer num) const |
13 | { return thelist.Value(num); } |
14 | |
15 | Standard_Integer IFSelect_SelectCombine::InputRank |
16 | (const Handle(IFSelect_Selection)& sel) const |
17 | { |
18 | if (sel.IsNull()) return 0; |
19 | Standard_Integer i, nb = thelist.Length(); |
20 | for (i = 1; i <= nb; i ++) |
21 | if (sel == thelist.Value(i)) return i; |
22 | return 0; |
23 | } |
24 | |
25 | void IFSelect_SelectCombine::Add |
26 | (const Handle(IFSelect_Selection)& sel, const Standard_Integer atnum) |
27 | { |
28 | if (atnum <= 0 || atnum > thelist.Length()) thelist.Append(sel); |
29 | else thelist.InsertBefore(atnum,sel); |
30 | } |
31 | |
32 | Standard_Boolean IFSelect_SelectCombine::Remove |
33 | (const Handle(IFSelect_Selection)& sel) |
34 | { return Remove (InputRank(sel)); } |
35 | |
36 | Standard_Boolean IFSelect_SelectCombine::Remove |
37 | (const Standard_Integer num) |
38 | { |
39 | if (num <= 0 || num > thelist.Length()) return Standard_False; |
40 | thelist.Remove(num); |
41 | return Standard_True; |
42 | } |
43 | |
44 | |
45 | Standard_Boolean IFSelect_SelectCombine::HasUniqueResult () const |
46 | { return Standard_True; } |
47 | |
48 | void IFSelect_SelectCombine::FillIterator |
49 | (IFSelect_SelectionIterator& iter) const |
50 | { iter.AddList(thelist); } |