# Edge.h

    00001 /**********************************************************************
    00002  * $Id: Edge.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) 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_EDGE_H
    00018 #define GEOS_PLANARGRAPH_EDGE_H
    00019
    00020 #include <geos/planargraph/GraphComponent.h> // for inheritance
    00021
    00022 #include <vector> // for typedefs
    00023 #include <set> // for typedefs
    00024 #include <iosfwd> // ostream
    00025
    00026 // Forward declarations
    00027 namespace geos {
    00028         namespace planargraph {
    00029                 class DirectedEdgeStar;
    00030                 class DirectedEdge;
    00031                 class Edge;
    00032                 class Node;
    00033         }
    00034 }
    00035
    00036 namespace geos {
    00037 namespace planargraph { // geos.planargraph
    00038
    00048 class Edge: public GraphComponent {
    00049
    00050 public:
    00051
    00052         friend std::ostream& operator<< (std::ostream& os, const Node&);
    00053
    00055         typedef std::set<const Edge *> ConstSet;
    00056
    00058         typedef std::set<Edge *> NonConstSet;
    00059
    00061         typedef std::vector<Edge *> NonConstVect;
    00062
    00064         typedef std::vector<const Edge *> ConstVect;
    00065
    00066 protected:
    00067
    00069         std::vector<DirectedEdge*> dirEdge;
    00070
    00077 public:
    00078
    00086         Edge(): dirEdge() {}
    00087
    00094         Edge(DirectedEdge *de0, DirectedEdge *de1)
    00095                 :
    00096                 dirEdge()
    00097         {
    00098                 setDirectedEdges(de0, de1);
    00099         }
    00100
    00108         void setDirectedEdges(DirectedEdge *de0, DirectedEdge *de1);
    00109
    00114         DirectedEdge* getDirEdge(int i);
    00115
    00121         DirectedEdge* getDirEdge(Node *fromNode);
    00122
    00127         Node* getOppositeNode(Node *node);
    00128 };
    00129
    00131 std::ostream& operator<<(std::ostream& os, const Edge& n);
    00132
    00133
    00134
    00136 //typedef Edge planarEdge;
    00137
    00138 } // namespace geos::planargraph
    00139 } // namespace geos
    00140
    00141 #endif // GEOS_PLANARGRAPH_EDGE_H
    00142
    00143 /**********************************************************************
    00144  * $Log$
    00145  * Revision 1.1  2006/03/21 21:42:54  strk
    00146  * planargraph.h header split, planargraph:: classes renamed to match JTS symbols
    00147  *
    00148  **********************************************************************/
    00149