GEOS  3.4.2
Public Member Functions | Static Public Member Functions
geos::triangulate::quadedge::QuadEdge Class Reference

#include <QuadEdge.h>

List of all members.

Public Member Functions

virtual void free ()
const QuadEdgegetPrimary () const
virtual void setData (void *data)
virtual void * getData ()
void remove ()
bool isLive ()
void setNext (QuadEdge *next)
QuadEdgerot () const
QuadEdgeinvRot () const
QuadEdgesym () const
QuadEdgeoNext () const
QuadEdgeoPrev () const
QuadEdgedNext () const
QuadEdgedPrev () const
QuadEdgelNext () const
QuadEdgelPrev () const
QuadEdgerNext ()
QuadEdgerPrev ()
void setOrig (const Vertex &o)
void setDest (const Vertex &d)
const Vertexorig () const
const Vertexdest () const
double getLength () const
bool equalsNonOriented (const QuadEdge &qe) const
bool equalsOriented (const QuadEdge &qe) const
std::auto_ptr< geom::LineSegmenttoLineSegment () const

Static Public Member Functions

static std::auto_ptr< QuadEdgemakeEdge (const Vertex &o, const Vertex &d)
static std::auto_ptr< QuadEdgeconnect (QuadEdge &a, QuadEdge &b)
static void splice (QuadEdge &a, QuadEdge &b)
static void swap (QuadEdge &e)

Detailed Description

A class that represents the edge data structure which implements the quadedge algebra. The quadedge algebra was described in a well-known paper by Guibas and Stolfi, "Primitives for the manipulation of general subdivisions and the computation of Voronoi diagrams", ACM Transactions on Graphics, 4(2), 1985, 75-123.

Each edge object is part of a quartet of 4 edges, linked via their _rot references. Any edge in the group may be accessed using a series of rot() operations. Quadedges in a subdivision are linked together via their next references. The linkage between the quadedge quartets determines the topology of the subdivision.

The edge class does not contain separate information for vertice or faces; a vertex is implicitly defined as a ring of edges (created using the next field).

Author:
JTS: David Skea
JTS: Martin Davis
Benjamin Campbell

Member Function Documentation

static std::auto_ptr<QuadEdge> geos::triangulate::quadedge::QuadEdge::connect ( QuadEdge a,
QuadEdge b 
) [static]

Creates a new QuadEdge connecting the destination of a to the origin of b, in such a way that all three have the same left face after the connection is complete. Additionally, the data pointers of the new edge are set.

Returns:
the new QuadEdge* The caller is reponsible for freeing the returned pointer

Gets the vertex for the edge's destination

Returns:
the destination vertex

Gets the next CCW edge around (into) the destination of this edge.

Returns:
the next destination edge.

References oNext(), and sym().

Gets the next CW edge around (into) the destination of this edge.

Returns:
the previous destination edge.

References invRot(), and oNext().

Tests if this quadedge and another have the same line segment geometry, regardless of orientation.

Parameters:
qea quadege
Returns:
true if the quadedges are based on the same line segment regardless of orientation

Tests if this quadedge and another have the same line segment geometry with the same orientation.

Parameters:
qea quadege
Returns:
true if the quadedges are based on the same line segment
virtual void geos::triangulate::quadedge::QuadEdge::free ( ) [virtual]

Free the QuadEdge quartet associated with this QuadEdge by a connect() or makeEdge() call. DO NOT call this function on a QuadEdge that was not returned by connect() or makeEdge().

Gets the external data value for this edge.

Returns:
the data object

Gets the length of the geometry of this quadedge.

Returns:
the length of the quadedge

Gets the primary edge of this quadedge and its sym. The primary edge is the one for which the origin and destination coordinates are ordered according to the standard Coordinate ordering

Returns:
the primary quadedge

Gets the dual of this edge, directed from its left to its right.

Returns:
the inverse rotated edge.

References sym().

Referenced by dPrev(), and rNext().

Tests whether this edge has been deleted.

Returns:
true if this edge has not been deleted.

Gets the CCW edge around the left face following this edge.

Returns:
the next left face edge.

References oNext(), and rot().

Gets the CCW edge around the left face before this edge.

Returns:
the previous left face edge.

References sym().

static std::auto_ptr<QuadEdge> geos::triangulate::quadedge::QuadEdge::makeEdge ( const Vertex o,
const Vertex d 
) [static]

Creates a new QuadEdge quartet from Vertex o to Vertex d.

Parameters:
othe origin Vertex
dthe destination Vertex
Returns:
the new QuadEdge* The caller is reponsible for freeing the returned pointer

Gets the next CCW edge around the origin of this edge.

Returns:
the next linked edge.

Referenced by dNext(), dPrev(), lNext(), oPrev(), rNext(), and rPrev().

Gets the next CW edge around (from) the origin of this edge.

Returns:
the previous edge.

References oNext(), and rot().

Gets the vertex for the edge's origin

Returns:
the origin vertex

Marks this quadedge as being deleted. This does not free the memory used by this quadedge quartet, but indicates that this quadedge quartet no longer participates in a subdivision.

NOTE: called "delete" in JTS

Gets the edge around the right face ccw following this edge.

Returns:
the next right face edge.

References invRot(), and oNext().

Gets the dual of this edge, directed from its right to its left.

Returns:
the rotated edge

Referenced by lNext(), oPrev(), and sym().

Gets the edge around the right face ccw before this edge.

Returns:
the previous right face edge.

References oNext().

virtual void geos::triangulate::quadedge::QuadEdge::setData ( void *  data) [virtual]

Sets the external data value for this edge.

Parameters:
dataan object containing external data

Sets the vertex for this edge's destination

Parameters:
dthe destination vertex

Sets the connected edge

Parameters:
nextEdgeedge

Sets the vertex for this edge's origin

Parameters:
othe origin vertex
static void geos::triangulate::quadedge::QuadEdge::splice ( QuadEdge a,
QuadEdge b 
) [static]

Splices two edges together or apart. Splice affects the two edge rings around the origins of a and b, and, independently, the two edge rings around the left faces of a and b. In each case, (i) if the two rings are distinct, Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it into two separate pieces. Thus, Splice can be used both to attach the two edges together, and to break them apart.

Parameters:
aan edge to splice
ban edge to splice

Turns an edge counterclockwise inside its enclosing quadrilateral.

Parameters:
ethe quadedge to turn

Gets the edge from the destination to the origin of this edge.

Returns:
the sym of the edge

References rot().

Referenced by dNext(), invRot(), and lPrev().

Creates a LineSegment representing the geometry of this edge.

Returns:
a LineSegment

The documentation for this class was generated from the following file: