GEOS: EdgeIntersectionList.h Source File

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

- File List

# EdgeIntersectionList.h

    00001 /**********************************************************************
    00002  * $Id: EdgeIntersectionList.h 2557 2009-06-08 09:30:55Z strk $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 2005-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: geomgraph/EdgeIntersectionList.java rev. 1.5 (JTS-1.10)
    00018  *
    00019  **********************************************************************/
    00020
    00021
    00022 #ifndef GEOS_GEOMGRAPH_EDGEINTERSECTIONLIST_H
    00023 #define GEOS_GEOMGRAPH_EDGEINTERSECTIONLIST_H
    00024
    00025 #include <geos/export.h>
    00026 #include <vector>
    00027 #include <set>
    00028 #include <string>
    00029
    00030 #include <geos/geomgraph/EdgeIntersection.h> // for EdgeIntersectionLessThen
    00031 #include <geos/geom/Coordinate.h> // for CoordinateLessThen
    00032
    00033 #include <geos/inline.h>
    00034
    00035 // Forward declarations
    00036 namespace geos {
    00037         namespace geom {
    00038                 class Coordinate;
    00039         }
    00040         namespace geomgraph {
    00041                 class Edge;
    00042         }
    00043 }
    00044
    00045 namespace geos {
    00046 namespace geomgraph { // geos.geomgraph
    00047
    00048
    00054 class GEOS_DLL EdgeIntersectionList{
    00055 public:
    00056         typedef std::set<EdgeIntersection *, EdgeIntersectionLessThen> container;
    00057         typedef container::iterator iterator;
    00058         typedef container::const_iterator const_iterator;
    00059
    00060 private:
    00061         container nodeMap;
    00062
    00063 public:
    00064
    00065         Edge *edge;
    00066         EdgeIntersectionList(Edge *edge);
    00067         ~EdgeIntersectionList();
    00068
    00069         /*
    00070          * Adds an intersection into the list, if it isn't already there.
    00071          * The input segmentIndex and dist are expected to be normalized.
    00072          * @return the EdgeIntersection found or added
    00073          */
    00074         EdgeIntersection* add(const geom::Coordinate& coord,
    00075                 int segmentIndex, double dist);
    00076
    00077         iterator begin() { return nodeMap.begin(); }
    00078         iterator end() { return nodeMap.end(); }
    00079         const_iterator begin() const { return nodeMap.begin(); }
    00080         const_iterator end() const { return nodeMap.end(); }
    00081
    00082         bool isEmpty() const;
    00083         bool isIntersection(const geom::Coordinate& pt) const;
    00084
    00085         /*
    00086          * Adds entries for the first and last points of the edge to the list
    00087          */
    00088         void addEndpoints();
    00089
    00098         void addSplitEdges(std::vector<Edge*> *edgeList);
    00099
    00100         Edge *createSplitEdge(EdgeIntersection *ei0, EdgeIntersection *ei1);
    00101         std::string print() const;
    00102
    00103 };
    00104
    00105 } // namespace geos.geomgraph
    00106 } // namespace geos
    00107
    00108 //#ifdef GEOS_INLINE
    00109 //# include "geos/geomgraph/EdgeIntersectionList.inl"
    00110 //#endif
    00111
    00112 #endif // ifndef GEOS_GEOMGRAPH_EDGEINTERSECTIONLIST_H
    00113
    00114 /**********************************************************************
    00115  * $Log$
    00116  * Revision 1.2  2006/03/24 09:52:41  strk
    00117  * USE_INLINE => GEOS_INLINE
    00118  *
    00119  * Revision 1.1  2006/03/09 16:46:49  strk
    00120  * geos::geom namespace definition, first pass at headers split
    00121  *
    00122  **********************************************************************/
    00123