summaryrefslogtreecommitdiff
path: root/src/BOP/BOP_BlockIterator.cxx
blob: 1a4a571f5443832087b2a071ae0b282fb84f5e8c (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// File:	BOP_BlockIterator.cxx
// Created:	Tue Mar 23 15:37:30 1993
// Author:	Jean Yves LEBEY
//		<jyl@phobox>
 
#include <BOP_BlockIterator.ixx>

//=======================================================================
//function : BOP_BlockIterator::BOP_BlockIterator
//purpose  : 
//=======================================================================
  BOP_BlockIterator::BOP_BlockIterator() 
:
  myLower(0),
  myUpper(0),
  myValue(1)
{
}

//=======================================================================
//function :  BOP_BlockIterator::BOP_BlockIterator
//purpose  :
//=======================================================================
  BOP_BlockIterator::BOP_BlockIterator(const Standard_Integer Lower, 
				       const Standard_Integer Upper)
:
  myLower(Lower),
  myUpper(Upper),
  myValue(Lower)
{
}
//=======================================================================
//function : Initialize
//purpose  : 
//=======================================================================
  void BOP_BlockIterator::Initialize()
{
  myValue = myLower;
}
//=======================================================================
//function : More
//purpose  : 
//=======================================================================
  Standard_Boolean BOP_BlockIterator::More() const
{
  Standard_Boolean b = (myValue <= myUpper);
  return b;
}
//=======================================================================
//function : Next
//purpose  : 
//=======================================================================
  void BOP_BlockIterator::Next()
{
  myValue++;
}
//=======================================================================
//function : Value
//purpose  : 
//=======================================================================
  Standard_Integer BOP_BlockIterator::Value() const
{
  return myValue;
}
//=======================================================================
//function : Extent
//purpose  : 
//=======================================================================
  Standard_Integer BOP_BlockIterator::Extent() const
{
  if (myLower != 0) {
    Standard_Integer n = myUpper - myLower + 1;
    return n;
  }
  return 0;
}