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

- File List

# DirectedEdgeStar.h

    00001 /**********************************************************************
    00002  * $Id: DirectedEdgeStar.h 2556 2009-06-06 22:22:28Z strk $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
    00008  * Copyright (C) 2005-2006 Refractions Research 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 #ifndef GEOS_PLANARGRAPH_DIRECTEDEDGESTAR_H
    00018 #define GEOS_PLANARGRAPH_DIRECTEDEDGESTAR_H
    00019
    00020 #include <geos/export.h>
    00021
    00022 #include <vector>
    00023
    00024 // Forward declarations
    00025 namespace geos {
    00026         namespace geom {
    00027                 class Coordinate;
    00028         }
    00029         namespace planargraph {
    00030                 class DirectedEdge;
    00031                 class Edge;
    00032         }
    00033 }
    00034
    00035 namespace geos {
    00036 namespace planargraph { // geos.planargraph
    00037
    00039 class GEOS_DLL DirectedEdgeStar {
    00040 protected:
    00041
    00042 private:
    00046         mutable std::vector<DirectedEdge*> outEdges;
    00047         mutable bool sorted;
    00048         void sortEdges() const;
    00049
    00050 public:
    00054         DirectedEdgeStar(): sorted(false) {}
    00055
    00056         virtual ~DirectedEdgeStar() {}
    00057
    00061         void add(DirectedEdge *de);
    00062
    00066         void remove(DirectedEdge *de);
    00067
    00072         std::vector<DirectedEdge*>::iterator iterator() { return begin(); }
    00074         std::vector<DirectedEdge*>::iterator begin();
    00075
    00077         std::vector<DirectedEdge*>::iterator end();
    00078
    00080         std::vector<DirectedEdge*>::const_iterator begin() const;
    00081
    00083         std::vector<DirectedEdge*>::const_iterator end() const;
    00084
    00089         size_t getDegree() const { return outEdges.size(); }
    00090
    00095         geom::Coordinate& getCoordinate() const;
    00096
    00101         std::vector<DirectedEdge*>& getEdges();
    00102
    00108         int getIndex(const Edge *edge);
    00109
    00115         int getIndex(const DirectedEdge *dirEdge);
    00116
    00121         int getIndex(int i) const;
    00122
    00128         DirectedEdge* getNextEdge(DirectedEdge *dirEdge);
    00129 };
    00130
    00131
    00132 } // namespace geos::planargraph
    00133 } // namespace geos
    00134
    00135 #endif // GEOS_PLANARGRAPH_DIRECTEDEDGESTAR_H
    00136
    00137 /**********************************************************************
    00138  * $Log$
    00139  * Revision 1.2  2006/06/12 10:49:43  strk
    00140  * unsigned int => size_t
    00141  *
    00142  * Revision 1.1  2006/03/21 21:42:54  strk
    00143  * planargraph.h header split, planargraph:: classes renamed to match JTS symbols
    00144  *
    00145  **********************************************************************/
    00146