Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::SimDraw Class Reference

The Base class for simultaneous graph drawing. More...

#include <ogdf/simultaneous/SimDraw.h>

Public Types

enum  CompareBy { CompareBy::index, CompareBy::label }
 Types for node comparison. More...
 

Public Member Functions

 SimDraw ()
 constructs empty simdraw instance More...
 
void addAttribute (long attr)
 gives access to new attribute if not already given More...
 
bool addGraph (const Graph &G)
 adds the graph g to the instance m_G More...
 
bool addGraphAttributes (const GraphAttributes &GA)
 adds new GraphAttributes to m_G More...
 
void clear ()
 empty graph More...
 
CompareBycompareBy ()
 returns compare mode More...
 
const CompareBycompareBy () const
 returns compare mode More...
 
void consistencyCheck () const
 Asserts that this SimDraw instance is consistent. More...
 
GraphconstGraph ()
 returns graph More...
 
const GraphconstGraph () const
 returns graph More...
 
GraphAttributesconstGraphAttributes ()
 returns graphattributes More...
 
const GraphAttributesconstGraphAttributes () const
 returns graphattributes More...
 
std::unique_ptr< GraphCopygetBasicGraph (int i) const
 returns graph consisting of all edges and nodes from SubGraph i More...
 
void getBasicGraphAttributes (int i, GraphAttributes &GA, Graph &G)
 returns graphattributes associated with basic graph i More...
 
bool & isDummy (node v)
 returns true if node v is marked as dummy More...
 
const bool & isDummy (node v) const
 returns true if node v is marked as dummy More...
 
bool isPhantomDummy (node v) const
 returns true if node v is a cost zero dummy node More...
 
bool isProperDummy (node v) const
 returns true if node v is a cost greater zero dummy node More...
 
int maxSubGraph () const
 calculates maximum number of input graphs More...
 
int numberOfBasicGraphs () const
 returns number of BasicGraphs in m_G More...
 
int numberOfDummyNodes () const
 returns number of dummy nodes More...
 
int numberOfNodes () const
 returns number of nodes More...
 
int numberOfPhantomDummyNodes () const
 returns number of phantom dummy nodes More...
 
int numberOfProperDummyNodes () const
 returns number of proper dummy nodes More...
 
void readGML (const char *fileName)
 calls GraphAttributes::readGML More...
 
void writeGML (const char *fileName) const
 calls GraphAttributes::writeGML More...
 

Private Member Functions

bool compare (const GraphAttributes &vGA, node v, const GraphAttributes &wGA, node w) const
 compares two nodes v and w by compare mode stored in m_compareBy More...
 
bool compareById (node v, node w) const
 compares two nodes v and w by their ids More...
 
bool compareByLabel (const GraphAttributes &vGA, node v, const GraphAttributes &wGA, node w) const
 compares two nodes v and w by their labels More...
 

Private Attributes

CompareBy m_compareBy
 compare mode More...
 
Graph m_G
 the underlying graph More...
 
GraphAttributes m_GA
 the underlying graphattributes More...
 
NodeArray< bool > m_isDummy
 dummy nodes may be colored differently More...
 

Friends

class SimDrawCaller
 
class SimDrawColorizer
 
class SimDrawCreator
 
class SimDrawCreatorSimple
 
class SimDrawManipulatorModule
 

Detailed Description

The Base class for simultaneous graph drawing.

This class provides functions for simultaneous graph drawing, such as adding new subgraphs.

It is possible to store up to 32 basicgraphs in one instance of the class. The basic graph membership for all edges is stored via GraphAttributes::edgeSubgraph. Several functions are outsourced in corresponding manipulator modules.

Definition at line 55 of file SimDraw.h.

Member Enumeration Documentation

◆ CompareBy

Types for node comparison.

Enumerator
index 

nodes are compared by their indices

label 

nodes are compared by their labels

Definition at line 64 of file SimDraw.h.

Constructor & Destructor Documentation

◆ SimDraw()

ogdf::SimDraw::SimDraw ( )

constructs empty simdraw instance

GraphAttributes::edgeSubGraphs is activated. No other attributes are active.

Member Function Documentation

◆ addAttribute()

void ogdf::SimDraw::addAttribute ( long  attr)
inline

gives access to new attribute if not already given

Definition at line 191 of file SimDraw.h.

◆ addGraph()

bool ogdf::SimDraw::addGraph ( const Graph G)

adds the graph g to the instance m_G

If the number of subgraphs in m_G is less than 32 and m_compareBy is set to index, this function will add graph G to m_G and return true. Otherwise this function returns false.

◆ addGraphAttributes()

bool ogdf::SimDraw::addGraphAttributes ( const GraphAttributes GA)

adds new GraphAttributes to m_G

If the number of subgraphs in m_G is less than 32, this function will add the new GraphAttributes GA to m_G and return true. Otherwise this function returns false. The function uses the current compare mode.

◆ clear()

void ogdf::SimDraw::clear ( )
inline

empty graph

Definition at line 97 of file SimDraw.h.

◆ compare()

bool ogdf::SimDraw::compare ( const GraphAttributes vGA,
node  v,
const GraphAttributes wGA,
node  w 
) const
private

compares two nodes v and w by compare mode stored in m_compareBy

This method checks whether m_compareBy was set to index or label and uses the corresponding compare method.

◆ compareBy() [1/2]

CompareBy& ogdf::SimDraw::compareBy ( )
inline

returns compare mode

Definition at line 107 of file SimDraw.h.

◆ compareBy() [2/2]

const CompareBy& ogdf::SimDraw::compareBy ( ) const
inline

returns compare mode

Definition at line 100 of file SimDraw.h.

◆ compareById()

bool ogdf::SimDraw::compareById ( node  v,
node  w 
) const
inlineprivate

compares two nodes v and w by their ids

Definition at line 199 of file SimDraw.h.

◆ compareByLabel()

bool ogdf::SimDraw::compareByLabel ( const GraphAttributes vGA,
node  v,
const GraphAttributes wGA,
node  w 
) const
inlineprivate

compares two nodes v and w by their labels

This method only works, if attribute nodeLabel is activated and set properly. Otherwise it is recommended to use compareById.

Definition at line 207 of file SimDraw.h.

◆ consistencyCheck()

void ogdf::SimDraw::consistencyCheck ( ) const

Asserts that this SimDraw instance is consistent.

◆ constGraph() [1/2]

Graph& ogdf::SimDraw::constGraph ( )
inline

returns graph

Definition at line 88 of file SimDraw.h.

◆ constGraph() [2/2]

const Graph& ogdf::SimDraw::constGraph ( ) const
inline

returns graph

Definition at line 85 of file SimDraw.h.

◆ constGraphAttributes() [1/2]

GraphAttributes& ogdf::SimDraw::constGraphAttributes ( )
inline

returns graphattributes

Definition at line 94 of file SimDraw.h.

◆ constGraphAttributes() [2/2]

const GraphAttributes& ogdf::SimDraw::constGraphAttributes ( ) const
inline

returns graphattributes

Definition at line 91 of file SimDraw.h.

◆ getBasicGraph()

std::unique_ptr<GraphCopy> ogdf::SimDraw::getBasicGraph ( int  i) const

returns graph consisting of all edges and nodes from SubGraph i

◆ getBasicGraphAttributes()

void ogdf::SimDraw::getBasicGraphAttributes ( int  i,
GraphAttributes GA,
Graph G 
)

returns graphattributes associated with basic graph i

Supported attributes are: nodeGraphics, edgeGraphics, edgeLabel, nodeLabel, nodeId, edgeIntWeight and edgeColor.

◆ isDummy() [1/2]

bool& ogdf::SimDraw::isDummy ( node  v)
inline

returns true if node v is marked as dummy

Definition at line 117 of file SimDraw.h.

◆ isDummy() [2/2]

const bool& ogdf::SimDraw::isDummy ( node  v) const
inline

returns true if node v is marked as dummy

All dummy node features are introduced for usage when running callSubgraphPlanarizer of SimDrawCaller.

Definition at line 114 of file SimDraw.h.

◆ isPhantomDummy()

bool ogdf::SimDraw::isPhantomDummy ( node  v) const
inline

returns true if node v is a cost zero dummy node

Definition at line 120 of file SimDraw.h.

◆ isProperDummy()

bool ogdf::SimDraw::isProperDummy ( node  v) const

returns true if node v is a cost greater zero dummy node

◆ maxSubGraph()

int ogdf::SimDraw::maxSubGraph ( ) const

calculates maximum number of input graphs

Subgraphs are numbered from 0 to 31. This method returns the number of the maximal used subgraph. If the graph is empty, the function returns -1.

◆ numberOfBasicGraphs()

int ogdf::SimDraw::numberOfBasicGraphs ( ) const

returns number of BasicGraphs in m_G

This function uses maxSubGraph to return the number of basic graphs contained in m_G. If the graph is empty, the function returns 0.

◆ numberOfDummyNodes()

int ogdf::SimDraw::numberOfDummyNodes ( ) const

returns number of dummy nodes

◆ numberOfNodes()

int ogdf::SimDraw::numberOfNodes ( ) const
inline

returns number of nodes

Definition at line 126 of file SimDraw.h.

◆ numberOfPhantomDummyNodes()

int ogdf::SimDraw::numberOfPhantomDummyNodes ( ) const

returns number of phantom dummy nodes

◆ numberOfProperDummyNodes()

int ogdf::SimDraw::numberOfProperDummyNodes ( ) const

returns number of proper dummy nodes

◆ readGML()

void ogdf::SimDraw::readGML ( const char *  fileName)

calls GraphAttributes::readGML

◆ writeGML()

void ogdf::SimDraw::writeGML ( const char *  fileName) const

calls GraphAttributes::writeGML

Friends And Related Function Documentation

◆ SimDrawCaller

friend class SimDrawCaller
friend

Definition at line 57 of file SimDraw.h.

◆ SimDrawColorizer

friend class SimDrawColorizer
friend

Definition at line 58 of file SimDraw.h.

◆ SimDrawCreator

friend class SimDrawCreator
friend

Definition at line 59 of file SimDraw.h.

◆ SimDrawCreatorSimple

friend class SimDrawCreatorSimple
friend

Definition at line 60 of file SimDraw.h.

◆ SimDrawManipulatorModule

friend class SimDrawManipulatorModule
friend

Definition at line 56 of file SimDraw.h.

Member Data Documentation

◆ m_compareBy

CompareBy ogdf::SimDraw::m_compareBy
private

compare mode

Definition at line 72 of file SimDraw.h.

◆ m_G

Graph ogdf::SimDraw::m_G
private

the underlying graph

Definition at line 70 of file SimDraw.h.

◆ m_GA

GraphAttributes ogdf::SimDraw::m_GA
private

the underlying graphattributes

Definition at line 71 of file SimDraw.h.

◆ m_isDummy

NodeArray<bool> ogdf::SimDraw::m_isDummy
private

dummy nodes may be colored differently

Definition at line 73 of file SimDraw.h.


The documentation for this class was generated from the following file: