RightmostEdgeFinder.h

00001 /**********************************************************************
00002  * $Id: RightmostEdgeFinder.h 1820 2006-09-06 16:54:23Z mloskot $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 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  * Last port: operation/buffer/RightmostEdgeFinder.java rev. 1.13 (JTS-1.7)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
00021 #define GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
00022 
00023 #include <geos/geom/Coordinate.h> // for composition
00024 
00025 #include <vector>
00026 
00027 // Forward declarations
00028 namespace geos {
00029         namespace geom {
00030         }
00031         namespace geomgraph {
00032                 class DirectedEdge;
00033         }
00034 }
00035 
00036 namespace geos {
00037 namespace operation { // geos.operation
00038 namespace buffer { // geos.operation.buffer
00039 
00046 class RightmostEdgeFinder {
00047 
00048 private:
00049 
00050         int minIndex;
00051 
00052         geom::Coordinate minCoord;
00053 
00054         geomgraph::DirectedEdge *minDe;
00055 
00056         geomgraph::DirectedEdge *orientedDe;
00057 
00058         void findRightmostEdgeAtNode();
00059 
00060         void findRightmostEdgeAtVertex();
00061 
00062         void checkForRightmostCoordinate(geomgraph::DirectedEdge *de);
00063 
00064         int getRightmostSide(geomgraph::DirectedEdge *de, int index);
00065 
00066         int getRightmostSideOfSegment(geomgraph::DirectedEdge *de, int i);
00067 
00068 public:
00069 
00077         RightmostEdgeFinder();
00078 
00079         geomgraph::DirectedEdge* getEdge();
00080 
00081         geom::Coordinate& getCoordinate();
00082 
00084         void findEdge(std::vector<geomgraph::DirectedEdge*>* dirEdgeList);
00085 };
00086 
00087 /*public*/
00088 inline geomgraph::DirectedEdge*
00089 RightmostEdgeFinder::getEdge()
00090 {
00091         return orientedDe;
00092 }
00093 
00094 /*public*/
00095 inline geom::Coordinate&
00096 RightmostEdgeFinder::getCoordinate()
00097 {
00098         return minCoord;
00099 }
00100 
00101 
00102 
00103 
00104 } // namespace geos::operation::buffer
00105 } // namespace geos::operation
00106 } // namespace geos
00107 
00108 #endif // ndef GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
00109 
00110 /**********************************************************************
00111  * $Log$
00112  * Revision 1.3  2006/05/04 12:19:59  strk
00113  * Added note about findEdge() only scanning for forward DirectedEdges
00114  *
00115  * Revision 1.2  2006/04/05 09:20:25  strk
00116  * Added port informations and many assertion checking.
00117  * Fixed bug in getRightmostSide() method ( a "testing-only" corner case )
00118  *
00119  * Revision 1.1  2006/03/14 00:19:40  strk
00120  * opBuffer.h split, streamlined headers in some (not all) files in operation/buffer/
00121  *
00122  **********************************************************************/
00123 

Generated on Fri Mar 27 04:52:59 2009 for GEOS by  doxygen 1.5.4