b311480e |
1 | // Created on: 1993-03-16 |
2 | // Created by: Denis PASCAL |
3 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | #include <Standard_NoMoreObject.hxx> |
18 | #include <Standard_NoSuchObject.hxx> |
19 | |
20 | //======================================================================= |
21 | //function : GraphDS_EdgesIterator |
22 | //purpose : |
23 | //======================================================================= |
24 | |
25 | GraphDS_EdgesIterator::GraphDS_EdgesIterator () |
26 | { |
27 | } |
28 | |
29 | |
30 | //======================================================================= |
31 | //function : GraphDS_EdgesIterator |
32 | //purpose : |
33 | //======================================================================= |
34 | |
35 | GraphDS_EdgesIterator::GraphDS_EdgesIterator |
36 | (const GraphDS_DirectedGraph& G) |
37 | { |
38 | Initialize (G); |
39 | } |
40 | |
41 | |
42 | //======================================================================= |
43 | //function : GraphDS_EdgesIterator |
44 | //purpose : |
45 | //======================================================================= |
46 | |
47 | GraphDS_EdgesIterator::GraphDS_EdgesIterator |
48 | (const GraphDS_DirectedGraph& G, |
49 | const Handle(GraphDS_Vertex)& V) |
50 | { |
51 | Initialize (G,V); |
52 | } |
53 | |
54 | |
55 | //======================================================================= |
56 | //function : Initialize |
57 | //purpose : |
58 | //======================================================================= |
59 | |
60 | void GraphDS_EdgesIterator::Initialize |
61 | (const GraphDS_DirectedGraph& G) |
62 | { |
63 | myEdges.Initialize(G.myEdges); |
64 | } |
65 | |
66 | |
67 | //======================================================================= |
68 | //function : Initialize |
69 | //purpose : |
70 | //======================================================================= |
71 | |
72 | void GraphDS_EdgesIterator::Initialize |
73 | (const GraphDS_DirectedGraph&, |
74 | const Handle(GraphDS_Vertex)& V) |
75 | { |
76 | myEdges.Initialize(V->GetEdges()); |
77 | } |
78 | |
79 | |
80 | //======================================================================= |
81 | //function : More |
82 | //purpose : |
83 | //======================================================================= |
84 | |
85 | Standard_Boolean GraphDS_EdgesIterator::More () const |
86 | { |
87 | return myEdges.More(); |
88 | } |
89 | |
90 | |
91 | //======================================================================= |
92 | //function : Next |
93 | //purpose : |
94 | //======================================================================= |
95 | |
96 | void GraphDS_EdgesIterator::Next () |
97 | { |
98 | myEdges.Next(); |
99 | } |
100 | |
101 | |
102 | |
103 | //======================================================================= |
104 | //function : Value |
105 | //purpose : |
106 | //======================================================================= |
107 | |
108 | const Handle(GraphDS_Edge)& GraphDS_EdgesIterator::Value () const |
109 | { |
110 | return *((Handle(GraphDS_Edge)*)& myEdges.Key()); |
111 | //return Handle(GraphDS_Edge)::DownCast(myEdges.Key()); |
112 | } |
113 | |
114 | |
115 | |
116 | |
117 | |
118 | |