Open
Graph Drawing
Framework

 v.2007.11
 

ogdf::EdgeComparer Class Reference

The EdgeComparer compares adjacency entries on base of the position of the nodes given by an Attributed Graph's layout information. More...

#include <EdgeComparer.h>

Inheritance diagram for ogdf::EdgeComparer:

ogdf::Comparer< E >

List of all members.

Public Member Functions

 EdgeComparer (const GraphAttributes &AG, const PlanRep &PR)
 EdgeComparer (const GraphAttributes &AG)
 compare the edges directly in AG
int compare (const adjEntry &e1, const adjEntry &e2)
bool before (const DPoint u, const DPoint v, const DPoint w)
 check if vector u->v lies within 180degree halfcircle before vector u->w in clockwise order (i.e. twelve o'clock lies before 1)

Private Member Functions

int orientation (const DPoint u, const DPoint v, const DPoint w)
 returns a value > 0, if vector uv lies "before" vector uw
int compareVectors (const double &x1, const double &y1, const double &x2, const double &y2)
 compares by angle relative to x-axis
double angle (DPoint p, DPoint q, DPoint r)
 computes angle between vectors p->q, p->r
int signOf (const double &x)

Private Attributes

const GraphAttributesm_AG
const PlanRepm_PR


Detailed Description

The EdgeComparer compares adjacency entries on base of the position of the nodes given by an Attributed Graph's layout information.

helper function for ordering / sorting assumes that PG is a planrep on original AG and that PG is not normalized, i.e., if there are bends in AG, they do not have a counterpart in PG (all nodes in PG have an original) temporary: we assume that we have two adjentries at a common point, so we leave the check for now if they meet and at which point

Todo:
check if sorting order fits adjacency list

Definition at line 82 of file EdgeComparer.h.


Constructor & Destructor Documentation

ogdf::EdgeComparer::EdgeComparer ( const GraphAttributes AG,
const PlanRep PR 
) [inline]

Definition at line 87 of file EdgeComparer.h.

ogdf::EdgeComparer::EdgeComparer ( const GraphAttributes AG  )  [inline]

compare the edges directly in AG

Definition at line 92 of file EdgeComparer.h.


Member Function Documentation

int ogdf::EdgeComparer::compare ( const adjEntry e1,
const adjEntry e2 
)

bool ogdf::EdgeComparer::before ( const DPoint  u,
const DPoint  v,
const DPoint  w 
)

check if vector u->v lies within 180degree halfcircle before vector u->w in clockwise order (i.e. twelve o'clock lies before 1)

int ogdf::EdgeComparer::orientation ( const DPoint  u,
const DPoint  v,
const DPoint  w 
) [private]

returns a value > 0, if vector uv lies "before" vector uw

int ogdf::EdgeComparer::compareVectors ( const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2 
) [private]

compares by angle relative to x-axis

double ogdf::EdgeComparer::angle ( DPoint  p,
DPoint  q,
DPoint  r 
) [private]

computes angle between vectors p->q, p->r

int ogdf::EdgeComparer::signOf ( const double &  x  )  [inline, private]

Definition at line 114 of file EdgeComparer.h.


Member Data Documentation

const GraphAttributes* ogdf::EdgeComparer::m_AG [private]

Definition at line 122 of file EdgeComparer.h.

const PlanRep* ogdf::EdgeComparer::m_PR [private]

Definition at line 123 of file EdgeComparer.h.


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

© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:07 2007 by doxygen 1.5.4.