1 #include <IFSelect_SelectCombine.ixx>
2 #include <IFGraph_Cumulate.hxx>
5 IFSelect_SelectCombine::IFSelect_SelectCombine () { }
6 // { thelist = new IFSelect_SequenceOfSelection(); }
8 Standard_Integer IFSelect_SelectCombine::NbInputs () const
9 { return thelist.Length(); }
11 Handle(IFSelect_Selection) IFSelect_SelectCombine::Input
12 (const Standard_Integer num) const
13 { return thelist.Value(num); }
15 Standard_Integer IFSelect_SelectCombine::InputRank
16 (const Handle(IFSelect_Selection)& sel) const
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;
25 void IFSelect_SelectCombine::Add
26 (const Handle(IFSelect_Selection)& sel, const Standard_Integer atnum)
28 if (atnum <= 0 || atnum > thelist.Length()) thelist.Append(sel);
29 else thelist.InsertBefore(atnum,sel);
32 Standard_Boolean IFSelect_SelectCombine::Remove
33 (const Handle(IFSelect_Selection)& sel)
34 { return Remove (InputRank(sel)); }
36 Standard_Boolean IFSelect_SelectCombine::Remove
37 (const Standard_Integer num)
39 if (num <= 0 || num > thelist.Length()) return Standard_False;
45 Standard_Boolean IFSelect_SelectCombine::HasUniqueResult () const
46 { return Standard_True; }
48 void IFSelect_SelectCombine::FillIterator
49 (IFSelect_SelectionIterator& iter) const
50 { iter.AddList(thelist); }