summaryrefslogtreecommitdiff
path: root/src/TopOpeBRep/TopOpeBRep_WPointInterIterator.cxx
blob: 7d83dca487872e20ac7f9247fd09344f69189b8b (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
77
78
79
80
81
82
83
84
85
86
87
88
// File:	TopOpeBRep_WPointInterIterator.cxx
// Created:	Tue Nov 16 10:52:21 1993
// Author:	Jean Yves LEBEY
//		<jyl@phobox>

#include <TopOpeBRep_WPointInterIterator.ixx>
#include <Standard_ProgramError.hxx>

//=======================================================================
//function : WPointIterator
//purpose  : 
//=======================================================================

TopOpeBRep_WPointInterIterator::TopOpeBRep_WPointInterIterator() :
myLineInter(NULL),myWPointIndex(0),myWPointNb(0)
{
}

//=======================================================================
//function : WPointIterator
//purpose  : 
//=======================================================================

TopOpeBRep_WPointInterIterator::TopOpeBRep_WPointInterIterator
(const TopOpeBRep_LineInter& LI)
{
  Init(LI);
}


//=======================================================================
//function : Init
//purpose  : 
//=======================================================================

void TopOpeBRep_WPointInterIterator::Init(const TopOpeBRep_LineInter& LI)
{
  myLineInter = (TopOpeBRep_LineInter*)&LI;
  Init();
}


//=======================================================================
//function : Init
//purpose  : 
//=======================================================================

void TopOpeBRep_WPointInterIterator::Init()
{
  myWPointIndex = 1;
  myWPointNb = myLineInter->NbWPoint();
}


//=======================================================================
//function : More
//purpose  : 
//=======================================================================

Standard_Boolean TopOpeBRep_WPointInterIterator::More() const
{
  return (myWPointIndex <= myWPointNb);
}

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

void TopOpeBRep_WPointInterIterator::Next()
{
  myWPointIndex++;
}

//=======================================================================
//function : CurrentWP
//purpose  :
//=======================================================================

const TopOpeBRep_WPointInter& TopOpeBRep_WPointInterIterator::CurrentWP()
{
  if (!More()) 
    Standard_ProgramError::Raise("TopOpeBRep_WPointInterIterator::Current");
  const TopOpeBRep_WPointInter& WP = myLineInter->WPoint(myWPointIndex);
  return WP;
}

TopOpeBRep_PLineInter TopOpeBRep_WPointInterIterator::PLineInterDummy() const {return myLineInter;}