summaryrefslogtreecommitdiff
path: root/src/Draft/Draft_VertexInfo.cxx
blob: c67e9081b5781e3e8aa5d9fc29987e6eeb70e930 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// File:	Draft_VertexInfo.cxx
// Created:	Thu Sep  1 10:18:30 1994
// Author:	Jacques GOUSSARD
//		<jag@topsn2>


#include <Draft_VertexInfo.ixx>

#include <TColStd_ListIteratorOfListOfReal.hxx>
#include <TopoDS.hxx>

//=======================================================================
//function : Draft_VertexInfo
//purpose  : 
//=======================================================================

Draft_VertexInfo::Draft_VertexInfo () {}


//=======================================================================
//function : Add
//purpose  : 
//=======================================================================

void Draft_VertexInfo::Add(const TopoDS_Edge& E)
{
  for (myItEd.Initialize(myEdges); myItEd.More(); myItEd.Next()) {
    if (E.IsSame(myItEd.Value())) {
      break;
    }
  }
  if (!myItEd.More()) {
    myEdges.Append(E);
    myParams.Append(RealLast());
  }
}


//=======================================================================
//function : Geometry
//purpose  : 
//=======================================================================

const gp_Pnt& Draft_VertexInfo::Geometry () const
{
  return myGeom;
}


//=======================================================================
//function : ChangeGeometry
//purpose  : 
//=======================================================================

gp_Pnt& Draft_VertexInfo::ChangeGeometry ()
{
  return myGeom;
}


//=======================================================================
//function : Parameter
//purpose  : 
//=======================================================================

Standard_Real Draft_VertexInfo::Parameter (const TopoDS_Edge& E)
{
  TColStd_ListIteratorOfListOfReal itp(myParams);
  myItEd.Initialize(myEdges);
  for (; myItEd.More(); myItEd.Next(),itp.Next()) {
    if (myItEd.Value().IsSame(E)) {
      return itp.Value();
    }
  }
  Standard_DomainError::Raise(); return 0;
}


//=======================================================================
//function : ChangeParameter
//purpose  : 
//=======================================================================

Standard_Real& Draft_VertexInfo::ChangeParameter (const TopoDS_Edge& E)
{
  TColStd_ListIteratorOfListOfReal itp(myParams);
  myItEd.Initialize(myEdges);
  for (; myItEd.More(); myItEd.Next(),itp.Next()) {
    if (myItEd.Value().IsSame(E)) {
      return itp.Value();
    }
  }
  Standard_DomainError::Raise(); return itp.Value();
}


//=======================================================================
//function : InitEdgeIterator
//purpose  : 
//=======================================================================

void Draft_VertexInfo::InitEdgeIterator () 
{
  myItEd.Initialize(myEdges);
}


//=======================================================================
//function : Edge
//purpose  : 
//=======================================================================

const TopoDS_Edge& Draft_VertexInfo::Edge () const
{
  return TopoDS::Edge(myItEd.Value());
}


//=======================================================================
//function : MoreEdge
//purpose  : 
//=======================================================================

Standard_Boolean Draft_VertexInfo::MoreEdge() const
{
  return myItEd.More();
}


//=======================================================================
//function : NextEdge
//purpose  : 
//=======================================================================

void Draft_VertexInfo::NextEdge()
{
  myItEd.Next();
}