Open
Graph Drawing
Framework

 v.2010.10
 

Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes

ogdf::ClusterGraphAttributes Class Reference

Stores additional attributes of a clustered graph (like layout information). More...

#include <ogdf/cluster/ClusterGraphAttributes.h>

Inheritance diagram for ogdf::ClusterGraphAttributes:
ogdf::GraphAttributes

List of all members.

Public Member Functions

 ClusterGraphAttributes ()
 Initializes new instance of class ClusterGraphAttributes.
 ClusterGraphAttributes (ClusterGraph &cg, long initAttributes=0)
virtual ~ClusterGraphAttributes ()
virtual void init (ClusterGraph &cg, long initAttributes=0)
virtual void initAtt (long initAttributes=0)
 Initializes the attributes according to initAttributes.
const ClusterGraphconstClusterGraph () const
 Returns the ClusterGraph.
int clusterID (node v)
 Returns the index of the parent cluster of node v.
cluster clusterOf (node v)
 Returns the parent cluster of node v.
int maxClusterID () const
 Returns the maximum cluster index used.
void updateClusterPositions (double boundaryDist=1.0)
 Updates positions of cluster boundaries wrt to children and child clusters.
double clusterXPos (int clusterID) const
 Returns x position of the cluster cages lower left corner.
double & clusterXPos (int clusterID)
 Returns x position of the cluster cages lower left corner.
double clusterYPos (int clusterID) const
 Returns y position of the cluster cages lower left corner.
double & clusterYPos (int clusterID)
 Returns y position of the cluster cages lower left corner.
double clusterHeight (int clusterID) const
 Returns cluster cage height.
double & clusterHeight (int clusterID)
 Returns cluster cage height.
double clusterWidth (int clusterID) const
 Returns cluster cage width.
double & clusterWidth (int clusterID)
 Returns cluster cage width.
double clusterLineWidth (int clusterID) const
 Returns cluster line width.
double & clusterLineWidth (int clusterID)
 Returns cluster line width.
String clusterFillColor (int clusterID) const
 Returns cluster fill color.
StringclusterFillColor (int clusterID)
 Returns cluster fill color.
GraphAttributes::BrushPattern clusterFillPattern (int clusterID) const
 Returns cluster fill pattern.
GraphAttributes::BrushPatternclusterFillPattern (int clusterID)
 Returns cluster fill pattern.
const StringclusterLabel (int clusterID) const
 Returns label of cluster c.
StringclusterLabel (int clusterID)
 Returns label of cluster c.
const ClusterInfoclusterInfo (int clusterID) const
 Returns structure containing information on cluster with ID clusterID.
ClusterInfoclusterInfo (int clusterID)
 Returns structure containing information on cluster with ID clusterID.
double clusterXPos (cluster c) const
 Returns x position of the cluster cages lower left corner.
double & clusterXPos (cluster c)
 Returns x position of the cluster cages lower left corner.
double clusterYPos (cluster c) const
 Returns y position of the cluster cages lower left corner.
double & clusterYPos (cluster c)
 Returns y position of the cluster cages lower left corner.
double clusterHeight (cluster c) const
 Returns cluster cage height.
double & clusterHeight (cluster c)
 Returns cluster cage height.
double clusterWidth (cluster c) const
 Returns cluster cage width.
double & clusterWidth (cluster c)
 Returns cluster cage width.
const StringclusterLabel (cluster c) const
 Returns label of cluster c.
StringclusterLabel (cluster c)
 Returns label of cluster c.
const StringtemplateCluster (cluster c) const
 Returns const reference to template of cluster c.
StringtemplateCluster (cluster c)
 Returns reference to template of cluster c.
const ClusterInfoclusterInfo (cluster c) const
 Returns const reference to structure containing information on cluster c.
ClusterInfoclusterInfo (cluster c)
 Returns reference to structure containing information on cluster c.
const StringclusterColor (cluster c) const
 Returns line color stored for cluster c in string format.
StringclusterColor (cluster c)
 Returns line color of cluster c in string format.
const StringclusterFillColor (cluster c) const
StringclusterFillColor (cluster c)
const StringclusterBackColor (cluster c) const
StringclusterBackColor (cluster c)
const GraphAttributes::EdgeStyleclusterLineStyle (cluster c) const
 Returns edge style of cluster c.
GraphAttributes::EdgeStyleclusterLineStyle (cluster c)
 Returns line style of cluster c.
const
GraphAttributes::BrushPattern
clusterFillPattern (cluster c) const
 Returns brush pattern of cluster c.
GraphAttributes::BrushPatternclusterFillPattern (cluster c)
 Returns brush pattern of cluster c.
const double & clusterLineWidth (cluster c) const
 Returns line width of cluster c.
double & clusterLineWidth (cluster c)
 Returns line width of cluster c.
void setClusterFillPattern (cluster c, int i)
 Set fill pattern i for cluster c.
void setClusterLineStyle (cluster c, int i)
 Set style i for cluster c.
const DRect boundingBox () const
 Returns bounding box.
void writeGML (const char *fileName)
 Writes attributed clustergraph in GML format to file fileName.
void writeGML (ostream &os)
 Writes attributed clustergraph in GML format to output stream os.
void writeOGML (const char *fileName)
 Writes attributed clustergraph in OGML format to file fileName.
void writeOGML (ostream &os)
 Writes attributed clustergraph in OGML format to output stream os.
bool readClusterGML (const char *fileName, ClusterGraph &CG, Graph &G)
 Reads attributed clustergraph in GML format from file fileName.
bool readClusterGML (istream &is, ClusterGraph &CG, Graph &G)
 Reads attributed clustergraph in GML format from input stream is.
bool readClusterGraphGML (const char *fileName, ClusterGraph &CG, Graph &G, GmlParser &gml)
bool readClusterGraphGML (ClusterGraph &CG, Graph &G, GmlParser &gml)
 Reads clustered graph from input stream of GmlParser.
bool readClusterGraphOGML (const char *fileName, ClusterGraph &CG, Graph &G)
 Reads clustered graph from OGML-file.

Protected Attributes

const ClusterGraphm_pClusterGraph
 Only points to existing graphs.

Private Member Functions

void writeCluster (ostream &os, NodeArray< int > &nId, ClusterArray< int > &cId, int &nextId, cluster c, String indent)
 Recursively writes the cluster structure in GML format into output stream os.
void writeGraphWinCluster (ostream &os, NodeArray< int > &nId, int &nextId, cluster c, String indent)
 Recursively writes the cluster structure in GraphWin GML format.
void writeClusterOGML (ostream &os, std::ostringstream &osS, NodeArray< int > &nodeIds, int &nextNodeId, int &nextLabelId, cluster cluster, int &indentDepth, int indentDepthS)
 Recursively writes the cluster structure in OGML.

Private Attributes

ClusterArray< Stringm_clusterTemplate
 Name of cluster template.
HashArray< int, ClusterInfom_clusterInfo
 Information on the cluster positions, index is cluster ID.

Detailed Description

Stores additional attributes of a clustered graph (like layout information).

Attributes are simply stored in node or edge arrays; for memory consumption reasons, only a subset of these arrays is in fact initialized for the graph; non-initialized arrays require only a few bytes of extra memory.

Which arrays are initialized is specified by a bit vector; each bit in this bit vector corresponds to one or more attributes. E.g., nodeGraphics corresponds to the attributes m_x, m_y, m_width, and m_height; whereas edgeDoubleWeight only corresponds to the attribute m_doubleWeight.

Definition at line 117 of file ClusterGraphAttributes.h.


Constructor & Destructor Documentation

ogdf::ClusterGraphAttributes::ClusterGraphAttributes (  )  [inline]

Initializes new instance of class ClusterGraphAttributes.

Definition at line 124 of file ClusterGraphAttributes.h.

ogdf::ClusterGraphAttributes::ClusterGraphAttributes ( ClusterGraph cg,
long  initAttributes = 0 
)

Initializes new instance of class ClusterGraphAttributes. Uses initAttributes, which are enriched by node and edge graphics.

virtual ogdf::ClusterGraphAttributes::~ClusterGraphAttributes (  )  [inline, virtual]

Definition at line 130 of file ClusterGraphAttributes.h.


Member Function Documentation

const DRect ogdf::ClusterGraphAttributes::boundingBox (  )  const

Returns bounding box.

Reimplemented from ogdf::GraphAttributes.

String& ogdf::ClusterGraphAttributes::clusterBackColor ( cluster  c  )  [inline]

Definition at line 256 of file ClusterGraphAttributes.h.

const String& ogdf::ClusterGraphAttributes::clusterBackColor ( cluster  c  )  const [inline]

Definition at line 253 of file ClusterGraphAttributes.h.

const String& ogdf::ClusterGraphAttributes::clusterColor ( cluster  c  )  const [inline]

Returns line color stored for cluster c in string format.

Definition at line 240 of file ClusterGraphAttributes.h.

String& ogdf::ClusterGraphAttributes::clusterColor ( cluster  c  )  [inline]

Returns line color of cluster c in string format.

Definition at line 243 of file ClusterGraphAttributes.h.

String& ogdf::ClusterGraphAttributes::clusterFillColor ( int  clusterID  )  [inline]

Returns cluster fill color.

Definition at line 183 of file ClusterGraphAttributes.h.

const String& ogdf::ClusterGraphAttributes::clusterFillColor ( cluster  c  )  const [inline]

Definition at line 247 of file ClusterGraphAttributes.h.

String& ogdf::ClusterGraphAttributes::clusterFillColor ( cluster  c  )  [inline]

Definition at line 250 of file ClusterGraphAttributes.h.

String ogdf::ClusterGraphAttributes::clusterFillColor ( int  clusterID  )  const [inline]

Returns cluster fill color.

Definition at line 180 of file ClusterGraphAttributes.h.

GraphAttributes::BrushPattern ogdf::ClusterGraphAttributes::clusterFillPattern ( int  clusterID  )  const [inline]

Returns cluster fill pattern.

Definition at line 186 of file ClusterGraphAttributes.h.

GraphAttributes::BrushPattern& ogdf::ClusterGraphAttributes::clusterFillPattern ( int  clusterID  )  [inline]

Returns cluster fill pattern.

Definition at line 189 of file ClusterGraphAttributes.h.

const GraphAttributes::BrushPattern& ogdf::ClusterGraphAttributes::clusterFillPattern ( cluster  c  )  const [inline]

Returns brush pattern of cluster c.

Definition at line 267 of file ClusterGraphAttributes.h.

GraphAttributes::BrushPattern& ogdf::ClusterGraphAttributes::clusterFillPattern ( cluster  c  )  [inline]

Returns brush pattern of cluster c.

Definition at line 270 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterHeight ( int  clusterID  )  const [inline]

Returns cluster cage height.

Definition at line 166 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterHeight ( int  clusterID  )  [inline]

Returns cluster cage height.

Definition at line 168 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterHeight ( cluster  c  )  const [inline]

Returns cluster cage height.

Definition at line 214 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterHeight ( cluster  c  )  [inline]

Returns cluster cage height.

Definition at line 216 of file ClusterGraphAttributes.h.

int ogdf::ClusterGraphAttributes::clusterID ( node  v  )  [inline]

Returns the index of the parent cluster of node v.

Definition at line 146 of file ClusterGraphAttributes.h.

const ClusterInfo& ogdf::ClusterGraphAttributes::clusterInfo ( cluster  c  )  const [inline]

Returns const reference to structure containing information on cluster c.

Definition at line 235 of file ClusterGraphAttributes.h.

ClusterInfo& ogdf::ClusterGraphAttributes::clusterInfo ( cluster  c  )  [inline]

Returns reference to structure containing information on cluster c.

Definition at line 237 of file ClusterGraphAttributes.h.

const ClusterInfo& ogdf::ClusterGraphAttributes::clusterInfo ( int  clusterID  )  const [inline]

Returns structure containing information on cluster with ID clusterID.

Definition at line 199 of file ClusterGraphAttributes.h.

ClusterInfo& ogdf::ClusterGraphAttributes::clusterInfo ( int  clusterID  )  [inline]

Returns structure containing information on cluster with ID clusterID.

Definition at line 201 of file ClusterGraphAttributes.h.

const String& ogdf::ClusterGraphAttributes::clusterLabel ( cluster  c  )  const [inline]

Returns label of cluster c.

Definition at line 223 of file ClusterGraphAttributes.h.

String& ogdf::ClusterGraphAttributes::clusterLabel ( cluster  c  )  [inline]

Returns label of cluster c.

Definition at line 226 of file ClusterGraphAttributes.h.

const String& ogdf::ClusterGraphAttributes::clusterLabel ( int  clusterID  )  const [inline]

Returns label of cluster c.

Definition at line 193 of file ClusterGraphAttributes.h.

String& ogdf::ClusterGraphAttributes::clusterLabel ( int  clusterID  )  [inline]

Returns label of cluster c.

Definition at line 196 of file ClusterGraphAttributes.h.

const GraphAttributes::EdgeStyle& ogdf::ClusterGraphAttributes::clusterLineStyle ( cluster  c  )  const [inline]

Returns edge style of cluster c.

Definition at line 261 of file ClusterGraphAttributes.h.

GraphAttributes::EdgeStyle& ogdf::ClusterGraphAttributes::clusterLineStyle ( cluster  c  )  [inline]

Returns line style of cluster c.

Definition at line 264 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterLineWidth ( int  clusterID  )  [inline]

Returns cluster line width.

Definition at line 177 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterLineWidth ( int  clusterID  )  const [inline]

Returns cluster line width.

Definition at line 174 of file ClusterGraphAttributes.h.

const double& ogdf::ClusterGraphAttributes::clusterLineWidth ( cluster  c  )  const [inline]

Returns line width of cluster c.

Definition at line 274 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterLineWidth ( cluster  c  )  [inline]

Returns line width of cluster c.

Definition at line 277 of file ClusterGraphAttributes.h.

cluster ogdf::ClusterGraphAttributes::clusterOf ( node  v  )  [inline]

Returns the parent cluster of node v.

Definition at line 148 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterWidth ( cluster  c  )  const [inline]

Returns cluster cage width.

Definition at line 218 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterWidth ( cluster  c  )  [inline]

Returns cluster cage width.

Definition at line 220 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterWidth ( int  clusterID  )  [inline]

Returns cluster cage width.

Definition at line 172 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterWidth ( int  clusterID  )  const [inline]

Returns cluster cage width.

Definition at line 170 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterXPos ( int  clusterID  )  const [inline]

Returns x position of the cluster cages lower left corner.

Definition at line 158 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterXPos ( int  clusterID  )  [inline]

Returns x position of the cluster cages lower left corner.

Definition at line 160 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterXPos ( cluster  c  )  const [inline]

Returns x position of the cluster cages lower left corner.

Definition at line 206 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterXPos ( cluster  c  )  [inline]

Returns x position of the cluster cages lower left corner.

Definition at line 208 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterYPos ( int  clusterID  )  const [inline]

Returns y position of the cluster cages lower left corner.

Definition at line 162 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterYPos ( int  clusterID  )  [inline]

Returns y position of the cluster cages lower left corner.

Definition at line 164 of file ClusterGraphAttributes.h.

double ogdf::ClusterGraphAttributes::clusterYPos ( cluster  c  )  const [inline]

Returns y position of the cluster cages lower left corner.

Definition at line 210 of file ClusterGraphAttributes.h.

double& ogdf::ClusterGraphAttributes::clusterYPos ( cluster  c  )  [inline]

Returns y position of the cluster cages lower left corner.

Definition at line 212 of file ClusterGraphAttributes.h.

const ClusterGraph& ogdf::ClusterGraphAttributes::constClusterGraph (  )  const [inline]

Returns the ClusterGraph.

Definition at line 143 of file ClusterGraphAttributes.h.

virtual void ogdf::ClusterGraphAttributes::init ( ClusterGraph cg,
long  initAttributes = 0 
) [virtual]

Initializes the instance with ClusterGraph cg. Sets the attributes to initAttributes

virtual void ogdf::ClusterGraphAttributes::initAtt ( long  initAttributes = 0  )  [inline, virtual]

Initializes the attributes according to initAttributes.

Definition at line 136 of file ClusterGraphAttributes.h.

int ogdf::ClusterGraphAttributes::maxClusterID (  )  const [inline]

Returns the maximum cluster index used.

Definition at line 150 of file ClusterGraphAttributes.h.

bool ogdf::ClusterGraphAttributes::readClusterGML ( istream &  is,
ClusterGraph CG,
Graph G 
)

Reads attributed clustergraph in GML format from input stream is.

bool ogdf::ClusterGraphAttributes::readClusterGML ( const char *  fileName,
ClusterGraph CG,
Graph G 
)

Reads attributed clustergraph in GML format from file fileName.

bool ogdf::ClusterGraphAttributes::readClusterGraphGML ( ClusterGraph CG,
Graph G,
GmlParser gml 
)

Reads clustered graph from input stream of GmlParser.

bool ogdf::ClusterGraphAttributes::readClusterGraphGML ( const char *  fileName,
ClusterGraph CG,
Graph G,
GmlParser gml 
)

Reads Cluster Graph with Attributes, base graph G, from fileName with a given gmlparser gml (has objecttree). Input stream given by parser.

bool ogdf::ClusterGraphAttributes::readClusterGraphOGML ( const char *  fileName,
ClusterGraph CG,
Graph G 
)

Reads clustered graph from OGML-file.

void ogdf::ClusterGraphAttributes::setClusterFillPattern ( cluster  c,
int  i 
) [inline]

Set fill pattern i for cluster c.

Definition at line 281 of file ClusterGraphAttributes.h.

void ogdf::ClusterGraphAttributes::setClusterLineStyle ( cluster  c,
int  i 
) [inline]

Set style i for cluster c.

Definition at line 286 of file ClusterGraphAttributes.h.

const String& ogdf::ClusterGraphAttributes::templateCluster ( cluster  c  )  const [inline]

Returns const reference to template of cluster c.

Definition at line 230 of file ClusterGraphAttributes.h.

String& ogdf::ClusterGraphAttributes::templateCluster ( cluster  c  )  [inline]

Returns reference to template of cluster c.

Definition at line 232 of file ClusterGraphAttributes.h.

void ogdf::ClusterGraphAttributes::updateClusterPositions ( double  boundaryDist = 1.0  ) 

Updates positions of cluster boundaries wrt to children and child clusters.

void ogdf::ClusterGraphAttributes::writeCluster ( ostream &  os,
NodeArray< int > &  nId,
ClusterArray< int > &  cId,
int &  nextId,
cluster  c,
String  indent 
) [private]

Recursively writes the cluster structure in GML format into output stream os.

void ogdf::ClusterGraphAttributes::writeClusterOGML ( ostream &  os,
std::ostringstream &  osS,
NodeArray< int > &  nodeIds,
int &  nextNodeId,
int &  nextLabelId,
cluster  cluster,
int &  indentDepth,
int  indentDepthS 
) [private]

Recursively writes the cluster structure in OGML.

void ogdf::ClusterGraphAttributes::writeGML ( ostream &  os  ) 

Writes attributed clustergraph in GML format to output stream os.

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

Writes attributed clustergraph in GML format to file fileName.

void ogdf::ClusterGraphAttributes::writeGraphWinCluster ( ostream &  os,
NodeArray< int > &  nId,
int &  nextId,
cluster  c,
String  indent 
) [private]

Recursively writes the cluster structure in GraphWin GML format.

void ogdf::ClusterGraphAttributes::writeOGML ( const char *  fileName  ) 

Writes attributed clustergraph in OGML format to file fileName.

void ogdf::ClusterGraphAttributes::writeOGML ( ostream &  os  ) 

Writes attributed clustergraph in OGML format to output stream os.


Member Data Documentation

Information on the cluster positions, index is cluster ID.

Definition at line 336 of file ClusterGraphAttributes.h.

Name of cluster template.

Definition at line 120 of file ClusterGraphAttributes.h.

Only points to existing graphs.

Definition at line 332 of file ClusterGraphAttributes.h.


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