1 // Created on: 1994-09-01
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <Draft_VertexInfo.hxx>
20 #include <Standard_DomainError.hxx>
21 #include <Standard_NoMoreObject.hxx>
22 #include <TColStd_ListIteratorOfListOfReal.hxx>
24 #include <TopoDS_Edge.hxx>
26 //=======================================================================
27 //function : Draft_VertexInfo
29 //=======================================================================
30 Draft_VertexInfo::Draft_VertexInfo () {}
33 //=======================================================================
36 //=======================================================================
38 void Draft_VertexInfo::Add(const TopoDS_Edge& E)
40 for (myItEd.Initialize(myEdges); myItEd.More(); myItEd.Next()) {
41 if (E.IsSame(myItEd.Value())) {
47 myParams.Append(RealLast());
52 //=======================================================================
55 //=======================================================================
57 const gp_Pnt& Draft_VertexInfo::Geometry () const
63 //=======================================================================
64 //function : ChangeGeometry
66 //=======================================================================
68 gp_Pnt& Draft_VertexInfo::ChangeGeometry ()
74 //=======================================================================
75 //function : Parameter
77 //=======================================================================
79 Standard_Real Draft_VertexInfo::Parameter (const TopoDS_Edge& E)
81 TColStd_ListIteratorOfListOfReal itp(myParams);
82 myItEd.Initialize(myEdges);
83 for (; myItEd.More(); myItEd.Next(),itp.Next()) {
84 if (myItEd.Value().IsSame(E)) {
88 throw Standard_DomainError();
92 //=======================================================================
93 //function : ChangeParameter
95 //=======================================================================
97 Standard_Real& Draft_VertexInfo::ChangeParameter (const TopoDS_Edge& E)
99 TColStd_ListIteratorOfListOfReal itp(myParams);
100 myItEd.Initialize(myEdges);
101 for (; myItEd.More(); myItEd.Next(),itp.Next()) {
102 if (myItEd.Value().IsSame(E)) {
106 throw Standard_DomainError();
110 //=======================================================================
111 //function : InitEdgeIterator
113 //=======================================================================
115 void Draft_VertexInfo::InitEdgeIterator ()
117 myItEd.Initialize(myEdges);
121 //=======================================================================
124 //=======================================================================
126 const TopoDS_Edge& Draft_VertexInfo::Edge () const
128 return TopoDS::Edge(myItEd.Value());
132 //=======================================================================
133 //function : MoreEdge
135 //=======================================================================
137 Standard_Boolean Draft_VertexInfo::MoreEdge() const
139 return myItEd.More();
143 //=======================================================================
144 //function : NextEdge
146 //=======================================================================
148 void Draft_VertexInfo::NextEdge()