GEOS: EdgeList.h Source File

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

# EdgeList.h

    00001 /**********************************************************************
    00002  * $Id: EdgeList.h 2219 2008-11-11 17:31:37Z pramsey $
    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
    00018 #ifndef GEOS_GEOMGRAPH_EDGELIST_H
    00019 #define GEOS_GEOMGRAPH_EDGELIST_H
    00020
    00021 #include <vector>
    00022 #include <string>
    00023 #include <iostream>
    00024
    00025 #include <geos/indexQuadtree.h> // for inlined ctor
    00026
    00027 #include <geos/inline.h>
    00028
    00029 // Forward declarations
    00030 namespace geos {
    00031         namespace index {
    00032                 class SpatialIndex;
    00033         }
    00034         namespace geomgraph {
    00035                 class Edge;
    00036         }
    00037 }
    00038
    00039 namespace geos {
    00040 namespace geomgraph { // geos.geomgraph
    00041
    00042 class EdgeList {
    00043
    00044 private:
    00045
    00046         std::vector<Edge*> edges;
    00047
    00057         geos::index::SpatialIndex* index;
    00058
    00059 public:
    00060         friend std::ostream& operator<< (std::ostream& os, const EdgeList& el);
    00061
    00062         EdgeList()
    00063                 :
    00064                 edges(),
    00065                 index(new geos::index::quadtree::Quadtree())
    00066         {}
    00067
    00068         virtual ~EdgeList() { delete index; }
    00069
    00073         void add(Edge *e);
    00074
    00075         void addAll(const std::vector<Edge*> &edgeColl);
    00076
    00077         std::vector<Edge*> &getEdges() { return edges; }
    00078
    00079         Edge* findEqualEdge(Edge* e);
    00080
    00081         Edge* get(int i);
    00082
    00083         int findEdgeIndex(Edge *e);
    00084
    00085         std::string print();
    00086
    00087         void clearList();
    00088
    00089 };
    00090
    00091 std::ostream& operator<< (std::ostream& os, const EdgeList& el);
    00092
    00093
    00094 } // namespace geos.geomgraph
    00095 } // namespace geos
    00096
    00097 //#ifdef GEOS_INLINE
    00098 //# include "geos/geomgraph/EdgeList.inl"
    00099 //#endif
    00100
    00101 #endif // ifndef GEOS_GEOMGRAPH_EDGELIST_H
    00102
    00103 /**********************************************************************
    00104  * $Log$
    00105  * Revision 1.3  2006/03/24 09:52:41  strk
    00106  * USE_INLINE => GEOS_INLINE
    00107  *
    00108  * Revision 1.2  2006/03/14 11:03:15  strk
    00109  * Added operator<< for Edge and EdgeList
    00110  *
    00111  * Revision 1.1  2006/03/09 16:46:49  strk
    00112  * geos::geom namespace definition, first pass at headers split
    00113  *
    00114  **********************************************************************/
    00115