planargraph/Edge.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2001-2002 Vivid Solutions Inc.
* Copyright (C) 2005-2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/planargraph/GraphComponent.h> // for inheritance
#include <vector> // for typedefs
#include <set> // for typedefs
#include <iosfwd> // ostream
#include <cstdint>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
#endif
// Forward declarations
namespace geos {
namespace planargraph {
class DirectedEdgeStar;
class DirectedEdge;
class Edge;
class Node;
}
}
namespace geos {
namespace planargraph { // geos.planargraph
class GEOS_DLL Edge: public GraphComponent {
public:
friend std::ostream& operator<< (std::ostream& os, const Node&);
typedef std::set<const Edge*> ConstSet;
typedef std::set<Edge*> NonConstSet;
typedef std::vector<Edge*> NonConstVect;
typedef std::vector<const Edge*> ConstVect;
protected:
std::vector<DirectedEdge*> dirEdge;
public:
Edge(): dirEdge() {}
Edge(DirectedEdge* de0, DirectedEdge* de1)
:
dirEdge()
{
setDirectedEdges(de0, de1);
}
void setDirectedEdges(DirectedEdge* de0, DirectedEdge* de1);
DirectedEdge* getDirEdge(int i);
DirectedEdge* getDirEdge(Node* fromNode);
Node* getOppositeNode(Node* node);
};
std::ostream& operator<<(std::ostream& os, const Edge& n);
//typedef Edge planarEdge;
} // namespace geos::planargraph
} // namespace geos
#ifdef _MSC_VER
#pragma warning(pop)
#endif
geos::planargraph::DirectedEdgeStar
A sorted collection of DirectedEdge which leave a Node in a PlanarGraph.
Definition planargraph/DirectedEdgeStar.h:42
geos::planargraph::DirectedEdge
Represents a directed edge in a PlanarGraph.
Definition planargraph/DirectedEdge.h:45
geos::planargraph::Edge
Represents an undirected edge of a PlanarGraph.
Definition planargraph/Edge.h:54
geos::planargraph::Edge::ConstVect
std::vector< const Edge * > ConstVect
Vector of const Edges pointers.
Definition planargraph/Edge.h:70
geos::planargraph::Edge::getDirEdge
DirectedEdge * getDirEdge(Node *fromNode)
Returns the DirectedEdge that starts from the given node, or null if the node is not one of the two n...
geos::planargraph::Edge::getOppositeNode
Node * getOppositeNode(Node *node)
If node is one of the two nodes associated with this Edge, returns the other node; otherwise returns ...
geos::planargraph::Edge::Edge
Edge()
Constructs a Edge whose DirectedEdges are not yet set.
Definition planargraph/Edge.h:85
geos::planargraph::Edge::getDirEdge
DirectedEdge * getDirEdge(int i)
Returns one of the DirectedEdges associated with this Edge.
geos::planargraph::Edge::Edge
Edge(DirectedEdge *de0, DirectedEdge *de1)
Constructs an Edge initialized with the given DirectedEdges.
Definition planargraph/Edge.h:93
geos::planargraph::Edge::ConstSet
std::set< const Edge * > ConstSet
Set of const Edges pointers.
Definition planargraph/Edge.h:61
geos::planargraph::Edge::NonConstSet
std::set< Edge * > NonConstSet
Set of non-const Edges pointers.
Definition planargraph/Edge.h:64
geos::planargraph::Edge::dirEdge
std::vector< DirectedEdge * > dirEdge
The two DirectedEdges associated with this Edge.
Definition planargraph/Edge.h:75
geos::planargraph::Edge::setDirectedEdges
void setDirectedEdges(DirectedEdge *de0, DirectedEdge *de1)
Initializes this Edge's two DirectedEdges.
geos::planargraph::Edge::NonConstVect
std::vector< Edge * > NonConstVect
Vector of non-const Edges pointers.
Definition planargraph/Edge.h:67
geos::planargraph::Node
A node in a PlanarGraph is a location where 0 or more Edge meet.
Definition planargraph/Node.h:44
geos::planargraph
Contains classes to implement a planar graph data structure.
Definition namespaces.h:293
geos::planargraph::operator<<
std::ostream & operator<<(std::ostream &, const DirectedEdge &)
Output operator.
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38