7fd59977 |
1 | #include <IFSelect_SelectionIterator.ixx> |
2 | |
3 | |
4 | IFSelect_SelectionIterator::IFSelect_SelectionIterator () |
5 | { |
6 | thecurr = 1; |
7 | thelist = new IFSelect_HSeqOfSelection(); |
8 | } |
9 | |
10 | IFSelect_SelectionIterator::IFSelect_SelectionIterator |
11 | (const Handle(IFSelect_Selection)& sel) |
12 | { |
13 | thecurr = 1; |
14 | thelist = new IFSelect_HSeqOfSelection(); |
15 | sel->FillIterator(*this); |
16 | } |
17 | |
18 | void IFSelect_SelectionIterator::AddFromIter (IFSelect_SelectionIterator& iter) |
19 | { for (; iter.More(); iter.Next()) AddItem(iter.Value()); } |
20 | |
21 | void IFSelect_SelectionIterator::AddItem |
22 | (const Handle(IFSelect_Selection)& sel) |
23 | { if (!sel.IsNull()) thelist->Append(sel); } |
24 | |
25 | void IFSelect_SelectionIterator::AddList |
26 | (const IFSelect_TSeqOfSelection& list) |
27 | { |
28 | Standard_Integer nb = list.Length(); // <list> Pas Handle <thelist> Handle |
29 | for (Standard_Integer i = 1; i <= nb; i ++) thelist->Append(list.Value(i)); |
30 | } |
31 | |
32 | Standard_Boolean IFSelect_SelectionIterator::More () const |
33 | { return (thecurr <= thelist->Length()); } |
34 | |
35 | void IFSelect_SelectionIterator::Next () |
36 | { thecurr ++; } |
37 | |
38 | const Handle(IFSelect_Selection)& IFSelect_SelectionIterator::Value () const |
39 | { return thelist->Value(thecurr); } |