Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

PreprocessorLayout.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/basic.h>
37 
38 #include <memory>
39 #include <vector>
40 
41 namespace ogdf {
42 class Graph;
43 class GraphAttributes;
44 class MultilevelGraph;
45 
58 private:
64  struct EdgeData {
65  EdgeData(int edgeInd, int sourceInd, int targetInd, double edgeWeight)
66  : edgeIndex(edgeInd), sourceIndex(sourceInd), targetIndex(targetInd), weight(edgeWeight) { }
67 
68  int edgeIndex;
71  double weight;
72  };
73 
74  std::unique_ptr<LayoutModule> m_secondaryLayout;
75  std::vector<EdgeData> m_deletedEdges;
77 
78  void call(Graph& G, MultilevelGraph& MLG);
79 
80 public:
83 
86 
88 
90  virtual void call(MultilevelGraph& MLG) override;
91 
93  virtual void call(GraphAttributes& GA) override;
94 
96  void setLayoutModule(LayoutModule* layout) { m_secondaryLayout.reset(layout); }
97 
99  void setRandomizePositions(bool on) { m_randomize = on; }
100 };
101 
102 }
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
ogdf::PreprocessorLayout
The PreprocessorLayout removes multi-edges and self-loops.
Definition: PreprocessorLayout.h:57
ogdf::PreprocessorLayout::EdgeData::edgeIndex
int edgeIndex
Definition: PreprocessorLayout.h:68
LayoutModule.h
Declaration of interface for layout algorithms (class LayoutModule)
ogdf::MultilevelGraph
Definition: MultilevelGraph.h:69
ogdf::PreprocessorLayout::EdgeData
Deleted Edges are stored in EdgeData.
Definition: PreprocessorLayout.h:64
ogdf::PreprocessorLayout::setRandomizePositions
void setRandomizePositions(bool on)
Defines whether the positions of the node are randomized before the secondary layout call.
Definition: PreprocessorLayout.h:99
ogdf::MultilevelLayoutModule::call
virtual void call(GraphAttributes &GA) override=0
Computes a layout of graph GA.
ogdf::gml::Key::Graph
@ Graph
MultilevelLayoutModule.h
Declaration of interface for layout algorithms that allow calls with a MultilevelGraph parameter (cla...
ogdf::PreprocessorLayout::EdgeData::targetIndex
int targetIndex
Definition: PreprocessorLayout.h:70
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::PreprocessorLayout::setLayoutModule
void setLayoutModule(LayoutModule *layout)
Sets the secondary layout.
Definition: PreprocessorLayout.h:96
ogdf::PreprocessorLayout::m_randomize
bool m_randomize
Definition: PreprocessorLayout.h:76
ogdf::MultilevelLayoutModule
Interface of general layout algorithms that also allow a MultilevelGraph as call parameter,...
Definition: MultilevelLayoutModule.h:48
ogdf::PreprocessorLayout::EdgeData::weight
double weight
Definition: PreprocessorLayout.h:71
ogdf::PreprocessorLayout::m_deletedEdges
std::vector< EdgeData > m_deletedEdges
Definition: PreprocessorLayout.h:75
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::PreprocessorLayout::EdgeData::EdgeData
EdgeData(int edgeInd, int sourceInd, int targetInd, double edgeWeight)
Definition: PreprocessorLayout.h:65
ogdf::PreprocessorLayout::~PreprocessorLayout
~PreprocessorLayout()
Destructor.
Definition: PreprocessorLayout.h:85
ogdf::PreprocessorLayout::EdgeData::sourceIndex
int sourceIndex
Definition: PreprocessorLayout.h:69
ogdf::PreprocessorLayout::m_secondaryLayout
std::unique_ptr< LayoutModule > m_secondaryLayout
Definition: PreprocessorLayout.h:74
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:45