PlanarGC  1.0.2
 All Data Structures Functions Variables Enumerations Enumerator Friends Pages
PlanarVertex Class Reference

#include <Planar.h>

Public Member Functions

 PlanarVertex ()
 ~PlanarVertex ()
int getNumEdges ()
PlanarEdgegetEdge (int id)
void setEdgesCCW (PlanarEdge **ccw, int nEdges)
int getEdgeID (PlanarEdge *e)

Friends

class PlanarEdge

Detailed Description

PlanarVertex is the central data structure in order to describe the algebraic embedding of planar graph's vertices.

To every PlanarVertex, there exists a set of planar edges that leaves resp. enters this vertex. Since the vertex is embedded in a planar graph, the edges form a star-like structure. By defining one "first edge", all edges can be ordered in a counter-clock-wise sense. This order is also known as an algebraic embedding.

This class handles this structure as comfortable as possible. In order to efficiently obtain this edge ID, an additional data element in PlanarEdge is directly used by methods of PlanarVertex. This is the reason for the "friend" relationship between PlanarEdge and PlanarVertex.

Examples:
cutplanar.cpp.

Constructor & Destructor Documentation

PlanarVertex::PlanarVertex ( )

the constructor builds a PlanarVertex with no outgoing or incoming edges.

PlanarVertex::~PlanarVertex ( )

the destructor deletes only the references on stored planar edges.

Member Function Documentation

int PlanarVertex::getNumEdges ( )
inline

provides the number of stored edges.

Referenced by CutPlanar::performChecks().

PlanarEdge* PlanarVertex::getEdge ( int  id)
inline

returns the edge with the ID id. This method provides also the correct result if id<0 or id>getNumEdges()-1.

Example: If four edges are stored, the following three getEdge-lines will all return the first stored edge:

num = getNumEdges(); // num = 4
edge = getEdge( 0);
edge = getEdge( 4);
edge = getEdge(-4);

Referenced by CutPlanar::performChecks(), and CutPlanar::preFlow().

void PlanarVertex::setEdgesCCW ( PlanarEdge **  ccw,
int  nEdges 
)
inline

the edges of the vertex are defined by the nEdges references that are stored in ccw. The edges in ccw have to be provided in a counter-clockwise order. Additionally, in the PlanarEdge *ccw[i] the ID i is stored as its tail resp. head edge ID.

Examples:
cutplanar.cpp.

References PlanarEdge::getHead(), and PlanarEdge::getTail().

Referenced by CutGrid::CutGrid(), and CutShape::setDissimilarityMatrix().

int PlanarVertex::getEdgeID ( PlanarEdge e)
inline

provides the edge ID that the edge reference e has in the counter-clockwise array of the current PlanarVertex. If the edge is not adjacent to the PlanarVertex, the method returns -1.

References PlanarEdge::getHead(), and PlanarEdge::getTail().

Friends And Related Function Documentation

friend class PlanarEdge
friend
© 2009 - 2013 by Eno Töppe, Frank R. Schmidt
generated by Doxygen