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. | |
~PreprocessorLayout () | |
Destructor. | |
virtual void | call (GraphAttributes &GA) override |
Calculates a drawing for the Graph GA . | |
virtual void | call (GraphAttributes &GA) override=0 |
Computes a layout of graph GA . | |
virtual void | call (MultilevelGraph &MLG) |
Computes a layout of graph MLG. | |
virtual void | call (MultilevelGraph &MLG) override |
Calculates a drawing for the Graph MLG . | |
void | setLayoutModule (LayoutModule *layout) |
Sets the secondary layout. | |
void | setRandomizePositions (bool on) |
Defines whether the positions of the node are randomized before the secondary layout call. | |
Public Member Functions inherited from ogdf::MultilevelLayoutModule | |
MultilevelLayoutModule () | |
Initializes a multilevel layout module. | |
virtual | ~MultilevelLayoutModule () |
Public Member Functions inherited from ogdf::LayoutModule | |
LayoutModule () | |
Initializes a layout module. | |
virtual | ~LayoutModule () |
void | operator() (GraphAttributes &GA) |
Computes a layout of graph GA . | |
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 51 of file PreprocessorLayout.h.
ogdf::PreprocessorLayout::PreprocessorLayout | ( | ) |
Constructor.
|
inline |
Destructor.
Definition at line 79 of file PreprocessorLayout.h.
|
private |
|
overridevirtual |
Calculates a drawing for the Graph GA
.
Implements ogdf::MultilevelLayoutModule.
|
overridevirtual |
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. |
Implements ogdf::MultilevelLayoutModule.
|
inlinevirtual |
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. |
Reimplemented from ogdf::MultilevelLayoutModule.
Definition at line 83 of file MultilevelLayoutModule.h.
|
overridevirtual |
Calculates a drawing for the Graph MLG
.
Reimplemented from ogdf::MultilevelLayoutModule.
|
inline |
Sets the secondary layout.
Definition at line 90 of file PreprocessorLayout.h.
Defines whether the positions of the node are randomized before the secondary layout call.
Definition at line 93 of file PreprocessorLayout.h.
|
private |
Definition at line 69 of file PreprocessorLayout.h.
|
private |
Definition at line 70 of file PreprocessorLayout.h.
|
private |
Definition at line 68 of file PreprocessorLayout.h.