GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2006 Refractions Research Inc. 00007 * 00008 * This is free software; you can redistribute and/or modify it under 00009 * the terms of the GNU Lesser General Public Licence as published 00010 * by the Free Software Foundation. 00011 * See the COPYING file for more information. 00012 * 00013 ********************************************************************** 00014 * 00015 * Last port: operation/buffer/RightmostEdgeFinder.java r320 (JTS-1.12) 00016 * 00017 **********************************************************************/ 00018 00019 #ifndef GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H 00020 #define GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H 00021 00022 #include <geos/export.h> 00023 00024 #include <geos/geom/Coordinate.h> // for composition 00025 00026 #include <vector> 00027 00028 // Forward declarations 00029 namespace geos { 00030 namespace geom { 00031 } 00032 namespace geomgraph { 00033 class DirectedEdge; 00034 } 00035 } 00036 00037 namespace geos { 00038 namespace operation { // geos.operation 00039 namespace buffer { // geos.operation.buffer 00040 00047 class GEOS_DLL RightmostEdgeFinder { 00048 00049 private: 00050 00051 int minIndex; 00052 00053 geom::Coordinate minCoord; 00054 00055 geomgraph::DirectedEdge *minDe; 00056 00057 geomgraph::DirectedEdge *orientedDe; 00058 00059 void findRightmostEdgeAtNode(); 00060 00061 void findRightmostEdgeAtVertex(); 00062 00063 void checkForRightmostCoordinate(geomgraph::DirectedEdge *de); 00064 00065 int getRightmostSide(geomgraph::DirectedEdge *de, int index); 00066 00067 int getRightmostSideOfSegment(geomgraph::DirectedEdge *de, int i); 00068 00069 public: 00070 00078 RightmostEdgeFinder(); 00079 00080 geomgraph::DirectedEdge* getEdge(); 00081 00082 geom::Coordinate& getCoordinate(); 00083 00085 void findEdge(std::vector<geomgraph::DirectedEdge*>* dirEdgeList); 00086 }; 00087 00088 /*public*/ 00089 inline geomgraph::DirectedEdge* 00090 RightmostEdgeFinder::getEdge() 00091 { 00092 return orientedDe; 00093 } 00094 00095 /*public*/ 00096 inline geom::Coordinate& 00097 RightmostEdgeFinder::getCoordinate() 00098 { 00099 return minCoord; 00100 } 00101 00102 00103 00104 00105 } // namespace geos::operation::buffer 00106 } // namespace geos::operation 00107 } // namespace geos 00108 00109 #endif // ndef GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H 00110