GEOS: RightmostEdgeFinder.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# RightmostEdgeFinder.h

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