Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
EdgeComparer.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/basic.h>
36#include <ogdf/basic/comparer.h>
37#include <ogdf/basic/geometry.h>
38
39namespace ogdf {
40class GraphAttributes;
41class PlanRep;
42
52class OGDF_EXPORT EdgeComparer : public VComparer<adjEntry> {
53public:
63 EdgeComparer(const GraphAttributes& AG, const PlanRep& PR) : m_AG(&AG), m_PR(&PR) { }
64
70 explicit EdgeComparer(const GraphAttributes& AG) : m_AG(&AG), m_PR(nullptr) { }
71
72 int compare(const adjEntry& e1, const adjEntry& e2) const override;
73
78 bool before(const DPoint& u, const DPoint& v, const DPoint& w) const;
79
80private:
85 int orientation(const DPoint& u, const DPoint& v, const DPoint& w) const;
86
88 const PlanRep* m_PR;
89};
90
91}
Includes declaration of graph class.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Basic declarations, included by all source files.
Class for adjacency list elements.
Definition Graph_d.h:143
Compares adjacency entries based on the position of the nodes given by GraphAttribute layout informat...
const GraphAttributes * m_AG
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 c...
int compare(const adjEntry &e1, const adjEntry &e2) const override
Compares x and y and returns the result as an integer.
const PlanRep * m_PR
EdgeComparer(const GraphAttributes &AG, const PlanRep &PR)
Constructor for a given PlanRep and given GraphAttributes.
EdgeComparer(const GraphAttributes &AG)
Constructor for given GraphAttributes.
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,...
Stores additional attributes of a graph (like layout information).
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:68
Abstract base class for comparer classes.
Definition comparer.h:258
Declarations for Comparer objects.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.