The PreprocessorLayout removes multi-edges and self-loops. More...
#include <ogdf/basic/PreprocessorLayout.h>
Classes | |
struct | EdgeData |
Deleted Edges are stored in EdgeData. More... | |
Public Member Functions | |
PreprocessorLayout () | |
Constructor. More... | |
~PreprocessorLayout () | |
Destructor. More... | |
virtual void | call (GraphAttributes &GA) override |
Calculates a drawing for the Graph GA . More... | |
virtual void | call (GraphAttributes &GA) override=0 |
Computes a layout of graph GA . More... | |
virtual void | call (MultilevelGraph &MLG) |
Computes a layout of graph MLG. More... | |
virtual void | call (MultilevelGraph &MLG) override |
Calculates a drawing for the Graph MLG . More... | |
void | setLayoutModule (LayoutModule *layout) |
Sets the secondary layout. More... | |
void | setRandomizePositions (bool on) |
Defines whether the positions of the node are randomized before the secondary layout call. More... | |
Public Member Functions inherited from ogdf::MultilevelLayoutModule | |
MultilevelLayoutModule () | |
Initializes a multilevel layout module. More... | |
virtual | ~MultilevelLayoutModule () |
Public Member Functions inherited from ogdf::LayoutModule | |
LayoutModule () | |
Initializes a layout module. More... | |
virtual | ~LayoutModule () |
void | operator() (GraphAttributes &GA) |
Computes a layout of graph GA . More... | |
Private Member Functions | |
void | call (Graph &G, MultilevelGraph &MLG) |
Private Attributes | |
std::vector< EdgeData > | m_deletedEdges |
bool | m_randomize |
std::unique_ptr< LayoutModule > | m_secondaryLayout |
The PreprocessorLayout removes multi-edges and self-loops.
To draw a graph using the ModularMultilevelMixer or other layouts the graph must be simple, i.e., contain neither multi-edges nor self-loops. Edges that conflict with these rules are deleted in the PreprocessorLayout. A secondary layout is then called that can work on the graph in required form. After the layout has been computed, the edges are inserted back into the graph, as they may have been relevant for the user.
Definition at line 57 of file PreprocessorLayout.h.
ogdf::PreprocessorLayout::PreprocessorLayout | ( | ) |
Constructor.
|
inline |
Destructor.
Definition at line 85 of file PreprocessorLayout.h.
|
private |
|
overridevirtual |
Calculates a drawing for the Graph GA
.
Implements ogdf::MultilevelLayoutModule.
|
override |
Computes a layout of graph GA
.
This method is the actual algorithm call and must be implemented by derived classes.
GA | is the input graph and will also be assigned the layout information. |
|
inline |
Computes a layout of graph MLG.
This method can be implemented optionally to allow a LayoutModule to modify the Graph. This allows some Layout Algorithms to save Memory, compared to a normal call(GA) DO NOT implement this if you are not sure whether this would save you Memory! This method only helps if the Graph is already in the MultiLevelGraph Format (or can be converted without creating a copy) AND the layout would need a copy otherwise. All Incremental Layouts (especially energy based) CAN be called by ModularMultilevelMixer. The standard implementation converts the MLG to GA and uses call(GA).
If implemented, the following Implementation of call(GA) is advised to ensure consistent behaviour of the two call Methods: void YourLayout::call(GraphAttributes &GA) { MultilevelGraph MLG(GA); call(MLG); MLG.exportAttributes(GA); }
MLG | is the input graph and will also be assigned the layout information. |
Definition at line 86 of file MultilevelLayoutModule.h.
|
overridevirtual |
Calculates a drawing for the Graph MLG
.
Reimplemented from ogdf::MultilevelLayoutModule.
|
inline |
Sets the secondary layout.
Definition at line 96 of file PreprocessorLayout.h.
|
inline |
Defines whether the positions of the node are randomized before the secondary layout call.
Definition at line 99 of file PreprocessorLayout.h.
|
private |
Definition at line 75 of file PreprocessorLayout.h.
|
private |
Definition at line 76 of file PreprocessorLayout.h.
|
private |
Definition at line 74 of file PreprocessorLayout.h.