Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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 <ogdf/basic/EdgeComparer.h>

+ Inheritance diagram for ogdf::EdgeComparer:

Public Member Functions

 EdgeComparer (const GraphAttributes &AG, const PlanRep &PR)
 
 EdgeComparer (const GraphAttributes &AG)
 compare the edges directly in AG More...
 
bool before (const DPoint &u, const DPoint &v, const DPoint &w) const
 check if vector u->v lies within 180degree halfcircle before vector u->w in clockwise order (i.e. twelve o'clock lies before 1) More...
 
int compare (const adjEntry &e1, const adjEntry &e2) const override
 Compares x and y and returns the result as an integer. More...
 
- Public Member Functions inherited from ogdf::VComparer< adjEntry >
 VComparer ()
 Initializes a comparer. More...
 
virtual ~VComparer ()
 
virtual bool equal (const adjEntry &x, const adjEntry &y) const
 Returns true iff x = y. More...
 
virtual bool geq (const adjEntry &x, const adjEntry &y) const
 Returns true iff x >= y. More...
 
virtual bool greater (const adjEntry &x, const adjEntry &y) const
 Returns true iff x > y. More...
 
virtual bool leq (const adjEntry &x, const adjEntry &y) const
 Returns true iff x <= y. More...
 
virtual bool less (const adjEntry &x, const adjEntry &y) const
 Returns true iff x < y. More...
 

Private Member Functions

double angle (DPoint p, DPoint q, DPoint r) const
 computes angle between vectors p->q, p->r More...
 
int orientation (const DPoint &u, const DPoint &v, const DPoint &w) const
 returns a value > 0, if vector uv lies "before" vector uw More...
 

Private Attributes

const GraphAttributes * m_AG
 
const PlanRep * m_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

Definition at line 57 of file EdgeComparer.h.

Constructor & Destructor Documentation

◆ EdgeComparer() [1/2]

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

Definition at line 62 of file EdgeComparer.h.

◆ EdgeComparer() [2/2]

ogdf::EdgeComparer::EdgeComparer ( const GraphAttributes &  AG)
inlineexplicit

compare the edges directly in AG

Definition at line 65 of file EdgeComparer.h.

Member Function Documentation

◆ angle()

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

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

◆ before()

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

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

◆ compare()

int ogdf::EdgeComparer::compare ( const adjEntry &  x,
const adjEntry &  y 
) const
overridevirtual

Compares x and y and returns the result as an integer.

The returns value is

  • < 0 iff x < y,
  • = 0 iff x = y,
  • > 0 iff x > y

Implements ogdf::VComparer< adjEntry >.

◆ orientation()

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

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

Member Data Documentation

◆ m_AG

const GraphAttributes* ogdf::EdgeComparer::m_AG
private

Definition at line 83 of file EdgeComparer.h.

◆ m_PR

const PlanRep* ogdf::EdgeComparer::m_PR
private

Definition at line 84 of file EdgeComparer.h.


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