Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

Planarity.h
Go to the documentation of this file.
1 
34 #pragma once
35 
37 #include <ogdf/basic/Array2D.h>
38 
39 namespace ogdf {
40 namespace davidson_harel {
41 
42 class Planarity: public EnergyFunction {
43 public:
45  explicit Planarity(GraphAttributes &AG);
46 
47  ~Planarity();
48 
50  void computeEnergy() override;
51 
52 private:
53  struct ChangedCrossing {
54  int edgeNum1;
55  int edgeNum2;
56  bool cross;
57  };
58 
60  bool intersect(const edge, const edge) const;
61 
63  void compCandEnergy() override;
64 
66  void internalCandidateTaken() override;
67 
69  bool lowLevelIntersect(const DPoint&, const DPoint&, const DPoint&,
70  const DPoint&) const;
71 
72 #ifdef OGDF_DEBUG
73  virtual void printInternalData() const override;
74 #endif
75 
78 
84 
86 };
87 
88 }}
Declares class EnergyFunction...
void computeEnergy() override
Computes energy of initial layout and stores it in m_energy.
Array2D< bool > * m_crossingMatrix
stores for each pair of edges if they cross
Definition: Planarity.h:77
bool intersect(const edge, const edge) const
Returns 1 if edges cross else 0.
The interface for energy functions for the Davidson Harel graph drawing method.
Planarity(GraphAttributes &AG)
Initializes data structures to speed up later computations.
bool lowLevelIntersect(const DPoint &, const DPoint &, const DPoint &, const DPoint &) const
Tests if two lines given by four points intersect.
List< edge > m_nonSelfLoops
list of edges that are not slef loops
Definition: Planarity.h:85
Stores additional attributes of a graph (like layout information).
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
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:83
Class for the representation of edges.
Definition: Graph_d.h:292
void internalCandidateTaken() override
Changes internal data if candidate is taken.
void compCandEnergy() override
Computes energy of candidate.
The namespace for all OGDF objects.
EdgeArray< int > * m_edgeNums
numbers of edges
Definition: Planarity.h:76
Declaration and implementation of class Array2D which implements dynamic two dimensional arrays...