Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

PreprocessorLayout.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 #include <memory>
37 
38 namespace ogdf {
39 
52 private:
58  struct EdgeData {
59  EdgeData(int edgeInd, int sourceInd, int targetInd, double edgeWeight)
60  : edgeIndex(edgeInd), sourceIndex(sourceInd), targetIndex(targetInd), weight(edgeWeight) { }
61 
62  int edgeIndex;
65  double weight;
66  };
67 
68  std::unique_ptr<LayoutModule> m_secondaryLayout;
69  std::vector<EdgeData> m_deletedEdges;
71 
72  void call(Graph& G, MultilevelGraph& MLG);
73 
74 public:
77 
80 
82 
84  virtual void call(MultilevelGraph& MLG) override;
85 
87  virtual void call(GraphAttributes& GA) override;
88 
90  void setLayoutModule(LayoutModule* layout) { m_secondaryLayout.reset(layout); }
91 
93  void setRandomizePositions(bool on) { m_randomize = on; }
94 };
95 
96 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
ogdf::PreprocessorLayout
The PreprocessorLayout removes multi-edges and self-loops.
Definition: PreprocessorLayout.h:51
ogdf::PreprocessorLayout::EdgeData::edgeIndex
int edgeIndex
Definition: PreprocessorLayout.h:62
ogdf::MultilevelGraph
Definition: MultilevelGraph.h:66
ogdf::PreprocessorLayout::EdgeData
Deleted Edges are stored in EdgeData.
Definition: PreprocessorLayout.h:58
ogdf::PreprocessorLayout::setRandomizePositions
void setRandomizePositions(bool on)
Defines whether the positions of the node are randomized before the secondary layout call.
Definition: PreprocessorLayout.h:93
ogdf::MultilevelLayoutModule::call
virtual void call(GraphAttributes &GA) override=0
Computes a layout of graph GA.
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:64
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::PreprocessorLayout::setLayoutModule
void setLayoutModule(LayoutModule *layout)
Sets the secondary layout.
Definition: PreprocessorLayout.h:90
ogdf::PreprocessorLayout::m_randomize
bool m_randomize
Definition: PreprocessorLayout.h:70
ogdf::MultilevelLayoutModule
Interface of general layout algorithms that also allow a MultilevelGraph as call parameter,...
Definition: MultilevelLayoutModule.h:45
ogdf::PreprocessorLayout::EdgeData::weight
double weight
Definition: PreprocessorLayout.h:65
ogdf::PreprocessorLayout::m_deletedEdges
std::vector< EdgeData > m_deletedEdges
Definition: PreprocessorLayout.h:69
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:59
ogdf::PreprocessorLayout::~PreprocessorLayout
~PreprocessorLayout()
Destructor.
Definition: PreprocessorLayout.h:79
ogdf::PreprocessorLayout::EdgeData::sourceIndex
int sourceIndex
Definition: PreprocessorLayout.h:63
ogdf::PreprocessorLayout::m_secondaryLayout
std::unique_ptr< LayoutModule > m_secondaryLayout
Definition: PreprocessorLayout.h:68
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:44