GEOS
3.4.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 **********************************************************************/ 00015 00016 #ifndef GEOS_PLANARGRAPH_EDGE_H 00017 #define GEOS_PLANARGRAPH_EDGE_H 00018 00019 #include <geos/export.h> 00020 00021 #include <geos/planargraph/GraphComponent.h> // for inheritance 00022 00023 #include <vector> // for typedefs 00024 #include <set> // for typedefs 00025 #include <iosfwd> // ostream 00026 00027 #ifdef _MSC_VER 00028 #pragma warning(push) 00029 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00030 #endif 00031 00032 // Forward declarations 00033 namespace geos { 00034 namespace planargraph { 00035 class DirectedEdgeStar; 00036 class DirectedEdge; 00037 class Edge; 00038 class Node; 00039 } 00040 } 00041 00042 namespace geos { 00043 namespace planargraph { // geos.planargraph 00044 00054 class GEOS_DLL Edge: public GraphComponent { 00055 00056 public: 00057 00058 friend std::ostream& operator<< (std::ostream& os, const Node&); 00059 00061 typedef std::set<const Edge *> ConstSet; 00062 00064 typedef std::set<Edge *> NonConstSet; 00065 00067 typedef std::vector<Edge *> NonConstVect; 00068 00070 typedef std::vector<const Edge *> ConstVect; 00071 00072 protected: 00073 00075 std::vector<DirectedEdge*> dirEdge; 00076 00083 public: 00084 00092 Edge(): dirEdge() {} 00093 00100 Edge(DirectedEdge *de0, DirectedEdge *de1) 00101 : 00102 dirEdge() 00103 { 00104 setDirectedEdges(de0, de1); 00105 } 00106 00114 void setDirectedEdges(DirectedEdge *de0, DirectedEdge *de1); 00115 00120 DirectedEdge* getDirEdge(int i); 00121 00127 DirectedEdge* getDirEdge(Node *fromNode); 00128 00133 Node* getOppositeNode(Node *node); 00134 }; 00135 00137 std::ostream& operator<<(std::ostream& os, const Edge& n); 00138 00140 //typedef Edge planarEdge; 00141 00142 } // namespace geos::planargraph 00143 } // namespace geos 00144 00145 #ifdef _MSC_VER 00146 #pragma warning(pop) 00147 #endif 00148 00149 #endif // GEOS_PLANARGRAPH_EDGE_H