EdgeList.h

00001 /**********************************************************************
00002  * $Id: EdgeList.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) 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 };
00088 
00089 std::ostream& operator<< (std::ostream& os, const EdgeList& el);
00090 
00091 
00092 } // namespace geos.geomgraph
00093 } // namespace geos
00094 
00095 //#ifdef GEOS_INLINE
00096 //# include "geos/geomgraph/EdgeList.inl"
00097 //#endif
00098 
00099 #endif // ifndef GEOS_GEOMGRAPH_EDGELIST_H
00100 
00101 /**********************************************************************
00102  * $Log$
00103  * Revision 1.3  2006/03/24 09:52:41  strk
00104  * USE_INLINE => GEOS_INLINE
00105  *
00106  * Revision 1.2  2006/03/14 11:03:15  strk
00107  * Added operator<< for Edge and EdgeList
00108  *
00109  * Revision 1.1  2006/03/09 16:46:49  strk
00110  * geos::geom namespace definition, first pass at headers split
00111  *
00112  **********************************************************************/
00113 

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