GEOS
3.3.8
|
00001 /********************************************************************** 00002 * $Id: Edge.h 3255 2011-03-01 17:56:10Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00008 * Copyright (C) 2005-2006 Refractions Research Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 **********************************************************************/ 00016 00017 #ifndef GEOS_PLANARGRAPH_EDGE_H 00018 #define GEOS_PLANARGRAPH_EDGE_H 00019 00020 #include <geos/export.h> 00021 00022 #include <geos/planargraph/GraphComponent.h> // for inheritance 00023 00024 #include <vector> // for typedefs 00025 #include <set> // for typedefs 00026 #include <iosfwd> // ostream 00027 00028 #ifdef _MSC_VER 00029 #pragma warning(push) 00030 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00031 #endif 00032 00033 // Forward declarations 00034 namespace geos { 00035 namespace planargraph { 00036 class DirectedEdgeStar; 00037 class DirectedEdge; 00038 class Edge; 00039 class Node; 00040 } 00041 } 00042 00043 namespace geos { 00044 namespace planargraph { // geos.planargraph 00045 00055 class GEOS_DLL Edge: public GraphComponent { 00056 00057 public: 00058 00059 friend std::ostream& operator<< (std::ostream& os, const Node&); 00060 00062 typedef std::set<const Edge *> ConstSet; 00063 00065 typedef std::set<Edge *> NonConstSet; 00066 00068 typedef std::vector<Edge *> NonConstVect; 00069 00071 typedef std::vector<const Edge *> ConstVect; 00072 00073 protected: 00074 00076 std::vector<DirectedEdge*> dirEdge; 00077 00084 public: 00085 00093 Edge(): dirEdge() {} 00094 00101 Edge(DirectedEdge *de0, DirectedEdge *de1) 00102 : 00103 dirEdge() 00104 { 00105 setDirectedEdges(de0, de1); 00106 } 00107 00115 void setDirectedEdges(DirectedEdge *de0, DirectedEdge *de1); 00116 00121 DirectedEdge* getDirEdge(int i); 00122 00128 DirectedEdge* getDirEdge(Node *fromNode); 00129 00134 Node* getOppositeNode(Node *node); 00135 }; 00136 00138 std::ostream& operator<<(std::ostream& os, const Edge& n); 00139 00141 //typedef Edge planarEdge; 00142 00143 } // namespace geos::planargraph 00144 } // namespace geos 00145 00146 #ifdef _MSC_VER 00147 #pragma warning(pop) 00148 #endif 00149 00150 #endif // GEOS_PLANARGRAPH_EDGE_H 00151 00152 /********************************************************************** 00153 * $Log$ 00154 * Revision 1.1 2006/03/21 21:42:54 strk 00155 * planargraph.h header split, planargraph:: classes renamed to match JTS symbols 00156 * 00157 **********************************************************************/ 00158