summaryrefslogtreecommitdiff
path: root/src/NIS/NIS_ObjectsIterator.cxx
blob: b78527ce81b225bc01ff9e1c88b1421ee8eec072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// File:      NIS_ObjectsIterator.cxx
// Created:   03.09.07 00:06
// Author:    Alexander GRIGORIEV
// Copyright: Open Cascade 2007


#include <NIS_ObjectsIterator.hxx>
#include <NIS_InteractiveContext.hxx>

//=======================================================================
//function : NIS_ObjectsIterator()
//purpose  : Constructor
//=======================================================================

void NIS_ObjectsIterator::Initialize
                        (const Handle(NIS_InteractiveContext)& theCtx)
{
  if (theCtx.IsNull())
    myIter = NCollection_Vector <Handle_NIS_InteractiveObject>::Iterator();
  else
    for (myIter.Init (theCtx->myObjects); myIter.More(); myIter.Next())
      if (myIter.Value().IsNull() == Standard_False)
        break;
}

//=======================================================================
//function : Next
//purpose  : 
//=======================================================================

void NIS_ObjectsIterator::Next ()
{
  for (myIter.Next(); myIter.More(); myIter.Next())
    if (myIter.Value().IsNull() == Standard_False)
      break;
}

//=======================================================================
//function : Value
//purpose  : 
//=======================================================================

const Handle(NIS_InteractiveObject)& NIS_ObjectsIterator::Value() const
{
  if (More())
    return myIter.Value();
  static const Handle(NIS_InteractiveObject) aNullObj;
  return aNullObj;
}