GEOS 3.4.2

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

planargraph/Edge.h
1 /**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2005-2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16 #ifndef GEOS_PLANARGRAPH_EDGE_H
17 #define GEOS_PLANARGRAPH_EDGE_H
18
19 #include <geos/export.h>
20
21 #include <geos/planargraph/GraphComponent.h> // for inheritance
22
23 #include <vector> // for typedefs
24 #include <set> // for typedefs
25 #include <iosfwd> // ostream
26
27 #ifdef _MSC_VER
28 #pragma warning(push)
29 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
30 #endif
31
32 // Forward declarations
33 namespace geos {
34 namespace planargraph {
35 class DirectedEdgeStar;
36 class DirectedEdge;
37 class Edge;
38 class Node;
39 }
40 }
41
42 namespace geos {
43 namespace planargraph { // geos.planargraph
44
54 class GEOS_DLL Edge: public GraphComponent {
55
56 public:
57
58 friend std::ostream& operator<< (std::ostream& os, const Node&);
59
61 typedef std::set<const Edge *> ConstSet;
62
64 typedef std::set<Edge *> NonConstSet;
65
67 typedef std::vector<Edge *> NonConstVect;
68
70 typedef std::vector<const Edge *> ConstVect;
71
72 protected:
73
75 std::vector<DirectedEdge*> dirEdge;
76
83 public:
84
92 Edge(): dirEdge() {}
93
100 Edge(DirectedEdge *de0, DirectedEdge *de1)
101 :
102 dirEdge()
103 {
104 setDirectedEdges(de0, de1);
105 }
106
114 void setDirectedEdges(DirectedEdge *de0, DirectedEdge *de1);
115
120 DirectedEdge* getDirEdge(int i);
121
127 DirectedEdge* getDirEdge(Node *fromNode);
128
133 Node* getOppositeNode(Node *node);
134 };
135
137 std::ostream& operator<<(std::ostream& os, const Edge& n);
138
140 //typedef Edge planarEdge;
141
142 } // namespace geos::planargraph
143 } // namespace geos
144
145 #ifdef _MSC_VER
146 #pragma warning(pop)
147 #endif
148
149 #endif // GEOS_PLANARGRAPH_EDGE_H