00001 /********************************************************************** 00002 * $Id: PolygonizeDirectedEdge.h 2567 2009-06-08 16:58:42Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions 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 * Last port: operation/polygonize/PolygonizeDirectedEdge.java rev. 1.4 (JTS-1.10) 00018 * 00019 **********************************************************************/ 00020 00021 00022 #ifndef GEOS_OP_POLYGONIZE_POLYGONIZEDIRECTEDEDGE_H 00023 #define GEOS_OP_POLYGONIZE_POLYGONIZEDIRECTEDEDGE_H 00024 00025 #include <geos/export.h> 00026 00027 #include <geos/planargraph/DirectedEdge.h> // for inheritance 00028 00029 // Forward declarations 00030 namespace geos { 00031 namespace geom { 00032 //class LineString; 00033 } 00034 namespace planargraph { 00035 class Node; 00036 } 00037 namespace operation { 00038 namespace polygonize { 00039 class EdgeRing; 00040 } 00041 } 00042 } 00043 00044 namespace geos { 00045 namespace operation { // geos::operation 00046 namespace polygonize { // geos::operation::polygonize 00047 00055 class GEOS_DLL PolygonizeDirectedEdge: public planargraph::DirectedEdge { 00056 00057 private: 00058 00059 EdgeRing *edgeRing; 00060 00061 PolygonizeDirectedEdge *next; 00062 00063 long label; 00064 00065 public: 00066 00067 /* 00068 * \brief 00069 * Constructs a directed edge connecting the <code>from</code> node 00070 * to the <code>to</code> node. 00071 * 00072 * @param directionPt 00073 * specifies this DirectedEdge's direction (given by an imaginary 00074 * line from the <code>from</code> node to <code>directionPt</code>) 00075 * 00076 * @param edgeDirection 00077 * whether this DirectedEdge's direction is the same as or 00078 * opposite to that of the parent Edge (if any) 00079 */ 00080 PolygonizeDirectedEdge(planargraph::Node *newFrom, 00081 planargraph::Node *newTo, 00082 const geom::Coordinate& newDirectionPt, 00083 bool nEdgeDirection); 00084 00085 /* 00086 * Returns the identifier attached to this directed edge. 00087 */ 00088 long getLabel() const; 00089 00090 /* 00091 * Attaches an identifier to this directed edge. 00092 */ 00093 void setLabel(long newLabel); 00094 00095 /* 00096 * Returns the next directed edge in the EdgeRing that this 00097 * directed edge is a member of. 00098 */ 00099 PolygonizeDirectedEdge* getNext() const; 00100 00101 /* 00102 * Sets the next directed edge in the EdgeRing that this 00103 * directed edge is a member of. 00104 */ 00105 void setNext(PolygonizeDirectedEdge *newNext); 00106 00107 /* 00108 * Returns the ring of directed edges that this directed edge is 00109 * a member of, or null if the ring has not been set. 00110 * @see #setRing(EdgeRing) 00111 */ 00112 bool isInRing() const; 00113 00114 /* 00115 * Sets the ring of directed edges that this directed edge is 00116 * a member of. 00117 */ 00118 void setRing(EdgeRing *newEdgeRing); 00119 }; 00120 } // namespace geos::operation::polygonize 00121 } // namespace geos::operation 00122 } // namespace geos 00123 00124 #endif // GEOS_OP_POLYGONIZE_POLYGONIZEDIRECTEDEDGE_H 00125 00126 /********************************************************************** 00127 * $Log$ 00128 * Revision 1.1 2006/03/22 11:19:06 strk 00129 * opPolygonize.h headers split. 00130 * 00131 **********************************************************************/