Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::EdgeComparer Class Reference

Compares adjacency entries based on the position of the nodes given by GraphAttribute layout information. More...

#include <ogdf/basic/EdgeComparer.h>

+ Inheritance diagram for ogdf::EdgeComparer:

Public Member Functions

 EdgeComparer (const GraphAttributes &AG)
 Constructor for given GraphAttributes. More...
 
 EdgeComparer (const GraphAttributes &AG, const PlanRep &PR)
 Constructor for a given PlanRep and given GraphAttributes. More...
 
bool before (const DPoint &u, const DPoint &v, const DPoint &w) const
 Checks if vector from u to v lies within the 180-degree halfcircle before the vector from u to w in clockwise order (i.e. 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

int orientation (const DPoint &u, const DPoint &v, const DPoint &w) const
 Returns 1 if v lies to the left of the line through u and w, -1 if it lies to the right, and 0 if it lies on that line. More...
 

Private Attributes

const GraphAttributesm_AG
 
const PlanRepm_PR
 

Detailed Description

Compares adjacency entries based on the position of the nodes given by GraphAttribute layout information.

An adjacency entry considered greater than another if it comes after the other in a clockwise manner.

Definition at line 48 of file EdgeComparer.h.

Constructor & Destructor Documentation

◆ EdgeComparer() [1/2]

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

Constructor for a given PlanRep and given GraphAttributes.

Assumes that PR is a PlanRep on original AG and that PR is not normalized, i.e., if there are bends in AG, they do not have a counterpart in PR (all nodes in PR have an original) temporary: we assume that we have two adjacency entries at a common point, so we leave the check for now if they meet and at which point.

Definition at line 60 of file EdgeComparer.h.

◆ EdgeComparer() [2/2]

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

Constructor for given GraphAttributes.

Compares the edges directly in AG.

Definition at line 67 of file EdgeComparer.h.

Member Function Documentation

◆ before()

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

Checks if vector from u to v lies within the 180-degree halfcircle before the vector from u to 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 1 if v lies to the left of the line through u and w, -1 if it lies to the right, and 0 if it lies on that line.

Member Data Documentation

◆ m_AG

const GraphAttributes* ogdf::EdgeComparer::m_AG
private

Definition at line 87 of file EdgeComparer.h.

◆ m_PR

const PlanRep* ogdf::EdgeComparer::m_PR
private

Definition at line 88 of file EdgeComparer.h.


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