Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Planarity.h
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/List.h>
38 #include <ogdf/basic/geometry.h>
40 
41 namespace ogdf {
42 class GraphAttributes;
43 template<class E>
44 class Array2D;
45 
46 namespace davidson_harel {
47 
48 class Planarity : public EnergyFunction {
49 public:
51  explicit Planarity(GraphAttributes& AG);
52 
53  ~Planarity();
54 
56  void computeEnergy() override;
57 
58 private:
59  struct ChangedCrossing {
60  int edgeNum1;
61  int edgeNum2;
62  bool cross;
63  };
64 
66  bool intersect(const edge, const edge) const;
67 
69  void compCandEnergy() override;
70 
72  void internalCandidateTaken() override;
73 
75  bool lowLevelIntersect(const DPoint&, const DPoint&, const DPoint&, const DPoint&) const;
76 
77 #ifdef OGDF_DEBUG
78  virtual void printInternalData() const override;
79 #endif
80 
83 
89 
91 };
92 
93 }
94 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
Graph.h
Includes declaration of graph class.
ogdf::GenericPoint< double >
ogdf::davidson_harel::Planarity::~Planarity
~Planarity()
ogdf::davidson_harel::Planarity::lowLevelIntersect
bool lowLevelIntersect(const DPoint &, const DPoint &, const DPoint &, const DPoint &) const
Tests if two lines given by four points intersect.
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::davidson_harel::Planarity::intersect
bool intersect(const edge, const edge) const
Returns 1 if edges cross else 0.
ogdf::davidson_harel::Planarity::compCandEnergy
void compCandEnergy() override
Computes energy of candidate.
ogdf::davidson_harel::Planarity::m_crossingChanges
List< ChangedCrossing > m_crossingChanges
stores for all edges incident to the test node an array with the crossings that change if the candida...
Definition: Planarity.h:88
ogdf::Array2D< bool >
ogdf::davidson_harel::Planarity::Planarity
Planarity(GraphAttributes &AG)
Initializes data structures to speed up later computations.
ogdf::davidson_harel::Planarity::ChangedCrossing
Definition: Planarity.h:59
ogdf::davidson_harel::Planarity::internalCandidateTaken
void internalCandidateTaken() override
Changes internal data if candidate is taken.
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
EnergyFunction.h
Declares class EnergyFunction...
ogdf::davidson_harel::Planarity::ChangedCrossing::edgeNum1
int edgeNum1
Definition: Planarity.h:60
ogdf::davidson_harel::Planarity::ChangedCrossing::cross
bool cross
Definition: Planarity.h:62
ogdf::davidson_harel::EnergyFunction
The interface for energy functions for the Davidson Harel graph drawing method.
Definition: EnergyFunction.h:52
ogdf::davidson_harel::Planarity::m_crossingMatrix
Array2D< bool > * m_crossingMatrix
stores for each pair of edges if they cross
Definition: Planarity.h:82
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::davidson_harel::Planarity::m_edgeNums
EdgeArray< int > * m_edgeNums
numbers of edges
Definition: Planarity.h:81
List.h
Declaration of doubly linked lists and iterators.
ogdf::davidson_harel::Planarity::ChangedCrossing::edgeNum2
int edgeNum2
Definition: Planarity.h:61
ogdf::davidson_harel::Planarity
Definition: Planarity.h:48
ogdf::davidson_harel::Planarity::computeEnergy
void computeEnergy() override
Computes energy of initial layout and stores it in m_energy.
ogdf::davidson_harel::Planarity::m_nonSelfLoops
List< edge > m_nonSelfLoops
list of edges that are not slef loops
Definition: Planarity.h:90
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::davidson_harel::Planarity::printInternalData
virtual void printInternalData() const override