Open
Graph Drawing
Framework

 v.2010.10
 

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

ogdf::GraphAttributes Class Reference

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

#include <ogdf/basic/GraphAttributes.h>

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

List of all members.

Public Types

enum  EdgeArrow {
  none, last, first, both,
  undefined
}
 

Types for edge arrows.

More...
enum  EdgeStyle {
  esNoPen = 0, esSolid = 1, esDash = 2, esDot = 3,
  esDashdot = 4, esDashdotdot = 5
}
 

Types for line styles.

More...
enum  BrushPattern {
  bpNone = 0, bpSolid = 1, bpDense1 = 2, bpDense2 = 3,
  bpDense3 = 4, bpDense4 = 5, bpDense5 = 6, bpDense6 = 7,
  bpDense7 = 8, bpHorizontal = 9, bpVertical = 10, bpCross = 11,
  BackwardDiagonal = 12, ForwardDiagonal = 13, DiagonalCross = 14
}
 

Types for object brush patterns.

More...
enum  ImageStyle { FreeScale = 0, FixScale = 1 }
 

Specifies scaling of images.

More...
enum  ImageAlignment {
  TopLeft = 0, TopCenter, TopRight, CenterLeft,
  Center, CenterRight, BottomLeft, BottomCenter,
  BottomRight
}
 

Specifies image alignment.

More...
enum  {
  nodeGraphics = 0x00001, edgeGraphics = 0x00002, nodeLevel = 0x00004, edgeIntWeight = 0x00008,
  edgeDoubleWeight = 0x00010, edgeLabel = 0x00020, nodeLabel = 0x00040, edgeType = 0x00080,
  nodeType = 0x00100, nodeColor = 0x00200, nodeId = 0x00400, edgeArrow = 0x00800,
  edgeColor = 0x01000, edgeStyle = 0x02000, nodeStyle = 0x04000, nodeTemplate = 0x08000,
  edgeSubGraph = 0x10000, nodeWeight = 0x20000
}
 

Bits for specifying attributes.

More...
enum  { oval = 0x8001, rectangle = 0x8002 }
 

Bits for specifying node shapes.

More...

Public Member Functions

 GraphAttributes ()
 Constructs graph attributes for no associated graph (default constructor).
 GraphAttributes (const Graph &G, long initAttributes=nodeGraphics|edgeGraphics)
 Constructs graph attributes associated with the graph G.
virtual ~GraphAttributes ()
virtual void init (const Graph &G, long initAttr)
 Initializes the graph attributes for graph G.
long attributes () const
 Returns currently accessible attributes.
void initAttributes (long attr)
 Initializes attributes in attr for usage.
void destroyAttributes (long attr)
 Destroys attributes in attr.
const GraphconstGraph () const
 Returns a reference to the associated graph.
bool directed ()
 Returns if the graph is directed.
void directed (bool directed)
 Sets if the graph is directed to directed.
const StringtemplateNode (node v) const
 Returns the template name of node v.
StringtemplateNode (node v)
 Returns the template name of node v.
const double & x (node v) const
 Returns the x-coordinate of node v.
double & x (node v)
 Returns the x-coordinate of node v.
const double & y (node v) const
 Returns the y-coordinate of node v.
double & y (node v)
 Returns the y-coordinate of node v.
const NodeArray< double > & width () const
 Returns a reference to the NodeArray m_width.
NodeArray< double > & width ()
 Returns a refeence to the NodeArray m_width.
const double & width (node v) const
 Returns the width of the bounding box of node v.
double & width (node v)
 Returns the width of the bounding box of node v.
const NodeArray< double > & height () const
 Returns a reference to the NodeArray m_height.
NodeArray< double > & height ()
 Returns a refeence to the NodeArray m_height.
const double & height (node v) const
 Returns the height of the bounding box of node v.
double & height (node v)
 Returns the height of the bounding box of node v.
const int & level (node v) const
 Returns the level of node v.
int & level (node v)
 Returns the level of node v.
const int & weight (node v) const
 Returns the weight of node v.
int & weight (node v)
 Returns the weight of node v.
const BrushPatternnodePattern (node v) const
 Returns the brush pattern of node v.
BrushPatternnodePattern (node v)
 Returns the brush pattern of node v.
const EdgeStylestyleNode (node v) const
 Returns the line style of node \ v.
EdgeStylestyleNode (node v)
 Returns the line style of node \ v.
const double & lineWidthNode (node v) const
 Returns the line width of node v.
double & lineWidthNode (node v)
 Returns the line width of node v.
const StringnodeLine (node v) const
 Returns the line color of node v.
StringnodeLine (node v)
 Returns the line color of node v.
const DPolylinebends (edge e) const
 Returns the list of bend points of edge e.
DPolylinebends (edge e)
 Returns the list of bend points of edge e.
const int & intWeight (edge e) const
 Returns the (integer) weight of edge e.
int & intWeight (edge e)
 Returns the (integer) weight of edge e.
const double & doubleWeight (edge e) const
 Returns the (real number) weight of edge e.
double & doubleWeight (edge e)
 Returns the (real number) weight of edge e.
const double & edgeWidth (edge e) const
 Returns the line width of edge e.
double & edgeWidth (edge e)
 Returns the line width of edge e.
const StringcolorNode (node v) const
 Returns the color of node v.
StringcolorNode (node v)
 Returns the color of node v.
int shapeNode (node v) const
 Returns the shape type of node v.
int & shapeNode (node v)
 Returns the shape type of node v.
const StringlabelNode (node v) const
 Returns the label of node \ v.
StringlabelNode (node v)
 Returns the label of node \ v.
const StringlabelEdge (edge e) const
 Returns the label of edge e.
StringlabelEdge (edge e)
 Returns the label of edge e.
Graph::EdgeType type (edge e) const
 Returns the type of edge e.
Graph::EdgeTypetype (edge e)
 Returns the type of edge e.
Graph::NodeType type (node v) const
 Returns the type of node v.
Graph::NodeTypetype (node v)
 Returns the type of node v.
const int & idNode (node v) const
 Returns the user ID of node v.
int & idNode (node v)
 Returns the user ID of node v.
const EdgeArrowarrowEdge (edge e) const
 Returns the arrow type of edge e.
EdgeArrowarrowEdge (edge e)
 Returns the arrow type of edge e.
const EdgeStylestyleEdge (edge e) const
 Returns the line style of an edge e.
EdgeStylestyleEdge (edge e)
 Returns the line style of an edge e.
const StringcolorEdge (edge e) const
 Returns the color of node v.
StringcolorEdge (edge e)
 Returns the color of node v.
const StringimageUriNode (node v) const
 Returns image uri of node v.
StringimageUriNode (node v)
 Returns image uri of node v.
const ImageStyleimageStyleNode (node v) const
 Returns image style of node v.
ImageStyleimageStyleNode (node v)
 Returns image style of node v.
const ImageAlignmentimageAlignmentNode (node v) const
ImageAlignmentimageAlignmentNode (node v)
const bool & imageDrawLineNode (node v) const
 Returns bool value drawLine of node v.
bool & imageDrawLineNode (node v)
 Returns bool value drawLine of node v.
const double & imageWidthNode (node v) const
 Returns image width of node v.
double & imageWidthNode (node v)
 Returns image width of node v.
const double & imageHeightNode (node v) const
double & imageHeightNode (node v)
const unsigned int & subGraphBits (edge e) const
 Returns the edgesubgraph value of an edge e.
unsigned int & subGraphBits (edge e)
 Returns the edgesubgraph value of an edge e.
bool inSubGraph (edge e, int n) const
 Checks whether edge e belongs to basic graph n.
void addSubGraph (edge e, int n)
 Addes edge e to basic graph n.
void removeSubGraph (edge e, int n)
 Removes edge e from basic graph n.
const DRect boundingBox () const
 Returns the bounding box of the graph.
bool isAssociationClass (node v) const
void addNodeCenter2Bends (int mode=1)
void clearAllBends ()
int hierarchyList (List< List< node > * > &list) const
 Returns a list of all inheritance hierarchies in the graph.
int hierarchyList (List< List< edge > * > &list) const
 Returns a list of all inheritance hierarchies in the graph.
void setAllWidth (double w)
 Sets the width of all nodes to w.
void setAllHeight (double h)
 Sets the height of all nodes to h.
bool readGML (Graph &G, const String &fileName)
 Reads the graph from a GML file fileName.
bool readGML (Graph &G, istream &is)
 Reads the graph from a GML input stream is.
void writeGML (const String &fileName) const
 Writes the graph with its attributes in GML format to file fileName.
void writeGML (ostream &os) const
 Writes the graph with its attributes in GML format to output stream os.
bool readXML (Graph &G, const String &fileName)
 Reads the graph and attributes from the XML file fileName.
bool readXML (Graph &G, istream &is)
 Reads the graph and attributes from the XML input stream is.
void writeXML (const String &fileName, const char *delimiter="", const char *offset="") const
 Reads the graph from the XML input stream is.
virtual void writeXML (ostream &os, const char *delimiter="", const char *offset="") const
 Reads the graph from the XML input stream is.
bool readRudy (Graph &G, const String &fileName)
 Reads a graph in Rudy format from file fileName.
bool readRudy (Graph &G, istream &is)
 Reads a graph in Rudy format from input stream is.
void writeRudy (const String &fileName) const
 Writes the graph in Rudy format to file fileName.
void writeRudy (ostream &os) const
 Writes the graph in Rudy format to output stream os.
void removeUnnecessaryBendsHV ()
 Removes unnecessary bend points in orthogonal segements.

Static Public Member Functions

static EdgeStyle intToStyle (int i)
 Converts integer i to edge style.
static BrushPattern intToPattern (int i)
 Converts integer i to brush pattern.
static ImageStyle intToImageStyle (int i)
 Helper function mapping int values to image styles.
static ImageAlignment intToImageAlignment (int i)
 Helper function mapping int values to image alignment.

Protected Member Functions

void writeLongString (ostream &os, const String &str) const
String formatLabel (const String &labelText)
 Static helper method for exchanging X(HT)ML-tag specific chars.

Static Protected Member Functions

static const char * edgeStyleToOGML (const GraphAttributes::EdgeStyle &edgeStyle)
 Static helper method for mapping edge styles to ogml.
static const char * imageAlignmentToOGML (const GraphAttributes::ImageAlignment &imgAlign)
 Static helper method for mapping image alignments to ogml.
static const char * imageStyleToOGML (const GraphAttributes::ImageStyle &imgStyle)
 Static helper method for mapping image style to ogml.
static const char * brushPatternToOGML (const GraphAttributes::BrushPattern &brushPattern)
 Static helper method for mapping brush patterns styles to ogml.
static void generateIndent (char **indent, const int &indentSize)

Protected Attributes

const Graphm_pGraph
 associated graph
bool m_directed
 whether or not the graph is directed
NodeArray< double > m_x
 x-coordinate of a node
NodeArray< double > m_y
 y-coordinate pf a node
NodeArray< double > m_width
 width of a node's bounding box
NodeArray< double > m_height
 height of a nodes's bounding box
NodeArray< Stringm_nodeLabel
 label of a node
NodeArray< Stringm_nodeColor
 color of a node
NodeArray< Stringm_nodeLine
 line color of a node
NodeArray< int > m_nodeShape
 shape of a node
NodeArray< double > m_nodeLineWidth
 line width of a node
NodeArray< BrushPatternm_nodePattern
 brush pattern of a node
NodeArray< EdgeStylem_nodeStyle
 line style of a node
NodeArray< Stringm_nodeTemplate
 name of template of a node
NodeArray< Stringm_imageUri
NodeArray< ImageStylem_imageStyle
NodeArray< ImageAlignmentm_imageAlign
NodeArray< bool > m_imageDrawLine
NodeArray< double > m_imageWidth
NodeArray< double > m_imageHeight
NodeArray< int > m_nodeId
 user ID of a node
NodeArray< int > m_level
 level of a node
NodeArray< int > m_nodeIntWeight
 (integer) weight of a node
NodeArray< Graph::NodeTypem_vType
EdgeArray< DPolylinem_bends
 list of bend points of an edge
EdgeArray< Stringm_edgeLabel
 label of an edge
EdgeArray< EdgeArrowm_edgeArrow
 arrow type of an edge
EdgeArray< EdgeStylem_edgeStyle
 line style of an edge
EdgeArray< Stringm_edgeColor
 line color of an edge
EdgeArray< double > m_edgeWidth
 line width of an edge
EdgeArray< Graph::EdgeTypem_eType
 type of an edge (association or generalization)
EdgeArray< int > m_intWeight
 (integer) weight of an edge
EdgeArray< double > m_doubleWeight
 (real number) weight of an edge
EdgeArray< unsigned int > m_subGraph
 is element of subgraphs given by bitvector
long m_attributes
 bit vector of currently used attributes

Detailed Description

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

It is frequently necessary to associate additional attributes with a graph. The class GraphAttributes provides various such attributes and is the central place were such attributes are stored.

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.

Attributes can be initialized by the constructor GraphAttributes(const Graph &,long) or the function initAttributes(); attributes can also be deinitialized by calling destroyAttributes().

Definition at line 96 of file GraphAttributes.h.


Member Enumeration Documentation

anonymous enum

Bits for specifying attributes.

Enumerator:
nodeGraphics 

node attributes m_x, m_y, m_width, m_height

edgeGraphics 

edge attribute m_bends

nodeLevel 

node attribute m_level

edgeIntWeight 

edge attribute m_intWeight

edgeDoubleWeight 

edge attribute m_doubleWeight

edgeLabel 

edge attribute m_edgeLabel

nodeLabel 

node attribute m_nodeLabel

edgeType 

edge attribute m_eType

nodeType 

node attribute m_vType

nodeColor 

node attribute m_nodeColor

nodeId 

node attribute m_nodeId

edgeArrow 

edge attribute m_edgeArrow

edgeColor 

edge attribute m_edgeColor

edgeStyle 

edge attribute m_edgeStyle

nodeStyle 

node attributes m_nodePattern, m_nodeStyle, m_nodeLineWidth

nodeTemplate 

node attribute m_nodeTemplate

edgeSubGraph 

edge attribute m_subGraph

nodeWeight 

node attribute m_nodeIntWeight

Definition at line 332 of file GraphAttributes.h.

anonymous enum

Bits for specifying node shapes.

Enumerator:
oval 
rectangle 

Definition at line 354 of file GraphAttributes.h.

Types for object brush patterns.

The brush patterns are currently the same as the GDE project.

Enumerator:
bpNone 
bpSolid 
bpDense1 
bpDense2 
bpDense3 
bpDense4 
bpDense5 
bpDense6 
bpDense7 
bpHorizontal 
bpVertical 
bpCross 
BackwardDiagonal 
ForwardDiagonal 
DiagonalCross 

Definition at line 141 of file GraphAttributes.h.

Types for edge arrows.

Enumerator:
none 

no edge arrows

last 

edge arrow at target node of the edge

first 

edge arrow at source node of the edge

both 

edge arrow at target and source node of the edge

undefined 

Definition at line 100 of file GraphAttributes.h.

Types for line styles.

The line styles are preliminary the same as in QT.

Enumerator:
esNoPen 

no line

esSolid 

solid line

esDash 

dashed line

esDot 

dotted line

esDashdot 

line style "dash dot dash dot ..."

esDashdotdot 

line style "dash dot dot dash dot dot ..."

Definition at line 112 of file GraphAttributes.h.

Specifies image alignment.

Enumerator:
TopLeft 
TopCenter 
TopRight 
CenterLeft 
Center 
CenterRight 
BottomLeft 
BottomCenter 
BottomRight 

Definition at line 189 of file GraphAttributes.h.

Specifies scaling of images.

Enumerator:
FreeScale 
FixScale 

Definition at line 184 of file GraphAttributes.h.


Constructor & Destructor Documentation

ogdf::GraphAttributes::GraphAttributes (  ) 

Constructs graph attributes for no associated graph (default constructor).

The associated graph can be set later with the init() function.

ogdf::GraphAttributes::GraphAttributes ( const Graph G,
long  initAttributes = nodeGraphics|edgeGraphics 
)

Constructs graph attributes associated with the graph G.

Parameters:
G is the associated graph.
initAttributes specifies the set of attributes that can be accessed.
virtual ogdf::GraphAttributes::~GraphAttributes (  )  [inline, virtual]

Definition at line 373 of file GraphAttributes.h.


Member Function Documentation

void ogdf::GraphAttributes::addNodeCenter2Bends ( int  mode = 1  ) 

According to the mode switch add either the node center points to the bends or the anchor point on the node boundary

  • mode = 0: only add node center
  • mode = 1: compute intersection with the line segment to the center and the boundary of the rectangular node
  • mode = 2: compute intersection with the first/last line segment and the boundary of the rectangular node
void ogdf::GraphAttributes::addSubGraph ( edge  e,
int  n 
) [inline]

Addes edge e to basic graph n.

Definition at line 578 of file GraphAttributes.h.

const EdgeArrow& ogdf::GraphAttributes::arrowEdge ( edge  e  )  const [inline]

Returns the arrow type of edge e.

Definition at line 530 of file GraphAttributes.h.

EdgeArrow& ogdf::GraphAttributes::arrowEdge ( edge  e  )  [inline]

Returns the arrow type of edge e.

Definition at line 532 of file GraphAttributes.h.

long ogdf::GraphAttributes::attributes (  )  const [inline]

Returns currently accessible attributes.

Definition at line 386 of file GraphAttributes.h.

const DPolyline& ogdf::GraphAttributes::bends ( edge  e  )  const [inline]

Returns the list of bend points of edge e.

Definition at line 470 of file GraphAttributes.h.

DPolyline& ogdf::GraphAttributes::bends ( edge  e  )  [inline]

Returns the list of bend points of edge e.

Definition at line 472 of file GraphAttributes.h.

const DRect ogdf::GraphAttributes::boundingBox (  )  const

Returns the bounding box of the graph.

Reimplemented in ogdf::ClusterGraphAttributes.

static const char* ogdf::GraphAttributes::brushPatternToOGML ( const GraphAttributes::BrushPattern brushPattern  )  [static, protected]

Static helper method for mapping brush patterns styles to ogml.

void ogdf::GraphAttributes::clearAllBends (  ) 
const String& ogdf::GraphAttributes::colorEdge ( edge  e  )  const [inline]

Returns the color of node v.

Definition at line 540 of file GraphAttributes.h.

String& ogdf::GraphAttributes::colorEdge ( edge  e  )  [inline]

Returns the color of node v.

Definition at line 542 of file GraphAttributes.h.

const String& ogdf::GraphAttributes::colorNode ( node  v  )  const [inline]

Returns the color of node v.

Definition at line 490 of file GraphAttributes.h.

String& ogdf::GraphAttributes::colorNode ( node  v  )  [inline]

Returns the color of node v.

Definition at line 492 of file GraphAttributes.h.

const Graph& ogdf::GraphAttributes::constGraph (  )  const [inline]

Returns a reference to the associated graph.

Definition at line 395 of file GraphAttributes.h.

void ogdf::GraphAttributes::destroyAttributes ( long  attr  ) 

Destroys attributes in attr.

bool ogdf::GraphAttributes::directed (  )  [inline]

Returns if the graph is directed.

Definition at line 398 of file GraphAttributes.h.

void ogdf::GraphAttributes::directed ( bool  directed  )  [inline]

Sets if the graph is directed to directed.

Definition at line 401 of file GraphAttributes.h.

double& ogdf::GraphAttributes::doubleWeight ( edge  e  )  [inline]

Returns the (real number) weight of edge e.

Definition at line 482 of file GraphAttributes.h.

const double& ogdf::GraphAttributes::doubleWeight ( edge  e  )  const [inline]

Returns the (real number) weight of edge e.

Definition at line 480 of file GraphAttributes.h.

static const char* ogdf::GraphAttributes::edgeStyleToOGML ( const GraphAttributes::EdgeStyle edgeStyle  )  [static, protected]

Static helper method for mapping edge styles to ogml.

const double& ogdf::GraphAttributes::edgeWidth ( edge  e  )  const [inline]

Returns the line width of edge e.

Definition at line 485 of file GraphAttributes.h.

double& ogdf::GraphAttributes::edgeWidth ( edge  e  )  [inline]

Returns the line width of edge e.

Definition at line 487 of file GraphAttributes.h.

String ogdf::GraphAttributes::formatLabel ( const String labelText  )  [protected]

Static helper method for exchanging X(HT)ML-tag specific chars.

static void ogdf::GraphAttributes::generateIndent ( char **  indent,
const int &  indentSize 
) [static, protected]
double& ogdf::GraphAttributes::height ( node  v  )  [inline]

Returns the height of the bounding box of node v.

Definition at line 437 of file GraphAttributes.h.

const NodeArray<double>& ogdf::GraphAttributes::height (  )  const [inline]

Returns a reference to the NodeArray m_height.

Definition at line 430 of file GraphAttributes.h.

NodeArray<double>& ogdf::GraphAttributes::height (  )  [inline]

Returns a refeence to the NodeArray m_height.

Definition at line 432 of file GraphAttributes.h.

const double& ogdf::GraphAttributes::height ( node  v  )  const [inline]

Returns the height of the bounding box of node v.

Definition at line 435 of file GraphAttributes.h.

int ogdf::GraphAttributes::hierarchyList ( List< List< node > * > &  list  )  const

Returns a list of all inheritance hierarchies in the graph.

Inheritance hierarchies are identified by edges with type Graph::generalization.

Parameters:
list is a list of all hierarchies; each hierarchie is itself a list of all nodes in this hierarchy.
Returns:
Returns the number of generalization hierarchies.
int ogdf::GraphAttributes::hierarchyList ( List< List< edge > * > &  list  )  const

Returns a list of all inheritance hierarchies in the graph.

Inheritance hierarchies are identified by edges with type Graph::generalization.

Parameters:
list is a list of all hierarchies; each hierarchie is itself a list of all edges in this hierarchy.
Returns:
Returns the number of generalization hierarchies.
const int& ogdf::GraphAttributes::idNode ( node  v  )  const [inline]

Returns the user ID of node v.

Definition at line 525 of file GraphAttributes.h.

int& ogdf::GraphAttributes::idNode ( node  v  )  [inline]

Returns the user ID of node v.

Definition at line 527 of file GraphAttributes.h.

const ImageAlignment& ogdf::GraphAttributes::imageAlignmentNode ( node  v  )  const [inline]

Definition at line 554 of file GraphAttributes.h.

ImageAlignment& ogdf::GraphAttributes::imageAlignmentNode ( node  v  )  [inline]

Definition at line 556 of file GraphAttributes.h.

static const char* ogdf::GraphAttributes::imageAlignmentToOGML ( const GraphAttributes::ImageAlignment imgAlign  )  [static, protected]

Static helper method for mapping image alignments to ogml.

const bool& ogdf::GraphAttributes::imageDrawLineNode ( node  v  )  const [inline]

Returns bool value drawLine of node v.

Definition at line 558 of file GraphAttributes.h.

bool& ogdf::GraphAttributes::imageDrawLineNode ( node  v  )  [inline]

Returns bool value drawLine of node v.

Definition at line 560 of file GraphAttributes.h.

const double& ogdf::GraphAttributes::imageHeightNode ( node  v  )  const [inline]

Definition at line 566 of file GraphAttributes.h.

double& ogdf::GraphAttributes::imageHeightNode ( node  v  )  [inline]

Definition at line 568 of file GraphAttributes.h.

const ImageStyle& ogdf::GraphAttributes::imageStyleNode ( node  v  )  const [inline]

Returns image style of node v.

Definition at line 550 of file GraphAttributes.h.

ImageStyle& ogdf::GraphAttributes::imageStyleNode ( node  v  )  [inline]

Returns image style of node v.

Definition at line 552 of file GraphAttributes.h.

static const char* ogdf::GraphAttributes::imageStyleToOGML ( const GraphAttributes::ImageStyle imgStyle  )  [static, protected]

Static helper method for mapping image style to ogml.

const String& ogdf::GraphAttributes::imageUriNode ( node  v  )  const [inline]

Returns image uri of node v.

Definition at line 546 of file GraphAttributes.h.

String& ogdf::GraphAttributes::imageUriNode ( node  v  )  [inline]

Returns image uri of node v.

Definition at line 548 of file GraphAttributes.h.

const double& ogdf::GraphAttributes::imageWidthNode ( node  v  )  const [inline]

Returns image width of node v.

Definition at line 562 of file GraphAttributes.h.

double& ogdf::GraphAttributes::imageWidthNode ( node  v  )  [inline]

Returns image width of node v.

Definition at line 564 of file GraphAttributes.h.

virtual void ogdf::GraphAttributes::init ( const Graph G,
long  initAttr 
) [virtual]

Initializes the graph attributes for graph G.

Parameters:
G is the new associated graph.
initAttr specifies the set of attributes that can be accessed.
Warning:
All attributes that were allocated before are destroyed by this function! If you wish to extend the set of allocated attributes, use initAttributes().
void ogdf::GraphAttributes::initAttributes ( long  attr  ) 

Initializes attributes in attr for usage.

bool ogdf::GraphAttributes::inSubGraph ( edge  e,
int  n 
) const [inline]

Checks whether edge e belongs to basic graph n.

Definition at line 576 of file GraphAttributes.h.

static ImageAlignment ogdf::GraphAttributes::intToImageAlignment ( int  i  )  [inline, static]

Helper function mapping int values to image alignment.

Definition at line 218 of file GraphAttributes.h.

static ImageStyle ogdf::GraphAttributes::intToImageStyle ( int  i  )  [inline, static]

Helper function mapping int values to image styles.

Definition at line 202 of file GraphAttributes.h.

static BrushPattern ogdf::GraphAttributes::intToPattern ( int  i  )  [inline, static]

Converts integer i to brush pattern.

Definition at line 160 of file GraphAttributes.h.

static EdgeStyle ogdf::GraphAttributes::intToStyle ( int  i  )  [inline, static]

Converts integer i to edge style.

Definition at line 122 of file GraphAttributes.h.

const int& ogdf::GraphAttributes::intWeight ( edge  e  )  const [inline]

Returns the (integer) weight of edge e.

Definition at line 475 of file GraphAttributes.h.

int& ogdf::GraphAttributes::intWeight ( edge  e  )  [inline]

Returns the (integer) weight of edge e.

Definition at line 477 of file GraphAttributes.h.

bool ogdf::GraphAttributes::isAssociationClass ( node  v  )  const [inline]

We hide the internal representation of semantic node types from the user to be able to change this later (semantic node type member array). We are not allowed to set association classes manually, only by calling createAssociationClass().

Definition at line 591 of file GraphAttributes.h.

const String& ogdf::GraphAttributes::labelEdge ( edge  e  )  const [inline]

Returns the label of edge e.

Definition at line 505 of file GraphAttributes.h.

String& ogdf::GraphAttributes::labelEdge ( edge  e  )  [inline]

Returns the label of edge e.

Definition at line 507 of file GraphAttributes.h.

const String& ogdf::GraphAttributes::labelNode ( node  v  )  const [inline]

Returns the label of node \ v.

Definition at line 500 of file GraphAttributes.h.

String& ogdf::GraphAttributes::labelNode ( node  v  )  [inline]

Returns the label of node \ v.

Definition at line 502 of file GraphAttributes.h.

const int& ogdf::GraphAttributes::level ( node  v  )  const [inline]

Returns the level of node v.

Definition at line 440 of file GraphAttributes.h.

int& ogdf::GraphAttributes::level ( node  v  )  [inline]

Returns the level of node v.

Definition at line 442 of file GraphAttributes.h.

const double& ogdf::GraphAttributes::lineWidthNode ( node  v  )  const [inline]

Returns the line width of node v.

Definition at line 460 of file GraphAttributes.h.

double& ogdf::GraphAttributes::lineWidthNode ( node  v  )  [inline]

Returns the line width of node v.

Definition at line 462 of file GraphAttributes.h.

const String& ogdf::GraphAttributes::nodeLine ( node  v  )  const [inline]

Returns the line color of node v.

Definition at line 465 of file GraphAttributes.h.

String& ogdf::GraphAttributes::nodeLine ( node  v  )  [inline]

Returns the line color of node v.

Definition at line 467 of file GraphAttributes.h.

BrushPattern& ogdf::GraphAttributes::nodePattern ( node  v  )  [inline]

Returns the brush pattern of node v.

Definition at line 452 of file GraphAttributes.h.

const BrushPattern& ogdf::GraphAttributes::nodePattern ( node  v  )  const [inline]

Returns the brush pattern of node v.

Definition at line 450 of file GraphAttributes.h.

bool ogdf::GraphAttributes::readGML ( Graph G,
const String fileName 
)

Reads the graph from a GML file fileName.

bool ogdf::GraphAttributes::readGML ( Graph G,
istream &  is 
)

Reads the graph from a GML input stream is.

bool ogdf::GraphAttributes::readRudy ( Graph G,
istream &  is 
)

Reads a graph in Rudy format from input stream is.

bool ogdf::GraphAttributes::readRudy ( Graph G,
const String fileName 
)

Reads a graph in Rudy format from file fileName.

bool ogdf::GraphAttributes::readXML ( Graph G,
const String fileName 
)

Reads the graph and attributes from the XML file fileName.

bool ogdf::GraphAttributes::readXML ( Graph G,
istream &  is 
)

Reads the graph and attributes from the XML input stream is.

void ogdf::GraphAttributes::removeSubGraph ( edge  e,
int  n 
) [inline]

Removes edge e from basic graph n.

Definition at line 580 of file GraphAttributes.h.

void ogdf::GraphAttributes::removeUnnecessaryBendsHV (  ) 

Removes unnecessary bend points in orthogonal segements.

Processes all edges and removes unnecessary bend points in the bend point list of the edge, i.e., bend points such that the preceding and succeeding bend point form a horizontal or vertical segement containing this bend point. This function is useful to remove redundant bend points in an orthogonal layout.

void ogdf::GraphAttributes::setAllHeight ( double  h  ) 

Sets the height of all nodes to h.

void ogdf::GraphAttributes::setAllWidth ( double  w  ) 

Sets the width of all nodes to w.

int ogdf::GraphAttributes::shapeNode ( node  v  )  const [inline]

Returns the shape type of node v.

Definition at line 495 of file GraphAttributes.h.

int& ogdf::GraphAttributes::shapeNode ( node  v  )  [inline]

Returns the shape type of node v.

Definition at line 497 of file GraphAttributes.h.

EdgeStyle& ogdf::GraphAttributes::styleEdge ( edge  e  )  [inline]

Returns the line style of an edge e.

Definition at line 537 of file GraphAttributes.h.

const EdgeStyle& ogdf::GraphAttributes::styleEdge ( edge  e  )  const [inline]

Returns the line style of an edge e.

Definition at line 535 of file GraphAttributes.h.

EdgeStyle& ogdf::GraphAttributes::styleNode ( node  v  )  [inline]

Returns the line style of node \ v.

Definition at line 457 of file GraphAttributes.h.

const EdgeStyle& ogdf::GraphAttributes::styleNode ( node  v  )  const [inline]

Returns the line style of node \ v.

Definition at line 455 of file GraphAttributes.h.

unsigned int& ogdf::GraphAttributes::subGraphBits ( edge  e  )  [inline]

Returns the edgesubgraph value of an edge e.

Definition at line 573 of file GraphAttributes.h.

const unsigned int& ogdf::GraphAttributes::subGraphBits ( edge  e  )  const [inline]

Returns the edgesubgraph value of an edge e.

Definition at line 571 of file GraphAttributes.h.

const String& ogdf::GraphAttributes::templateNode ( node  v  )  const [inline]

Returns the template name of node v.

Definition at line 404 of file GraphAttributes.h.

String& ogdf::GraphAttributes::templateNode ( node  v  )  [inline]

Returns the template name of node v.

Definition at line 406 of file GraphAttributes.h.

Graph::NodeType& ogdf::GraphAttributes::type ( node  v  )  [inline]

Returns the type of node v.

Definition at line 522 of file GraphAttributes.h.

Graph::NodeType ogdf::GraphAttributes::type ( node  v  )  const [inline]

Returns the type of node v.

Definition at line 518 of file GraphAttributes.h.

Graph::EdgeType ogdf::GraphAttributes::type ( edge  e  )  const [inline]

Returns the type of edge e.

Definition at line 510 of file GraphAttributes.h.

Graph::EdgeType& ogdf::GraphAttributes::type ( edge  e  )  [inline]

Returns the type of edge e.

Definition at line 514 of file GraphAttributes.h.

int& ogdf::GraphAttributes::weight ( node  v  )  [inline]

Returns the weight of node v.

Definition at line 447 of file GraphAttributes.h.

const int& ogdf::GraphAttributes::weight ( node  v  )  const [inline]

Returns the weight of node v.

Definition at line 445 of file GraphAttributes.h.

const NodeArray<double>& ogdf::GraphAttributes::width (  )  const [inline]

Returns a reference to the NodeArray m_width.

Definition at line 420 of file GraphAttributes.h.

double& ogdf::GraphAttributes::width ( node  v  )  [inline]

Returns the width of the bounding box of node v.

Definition at line 427 of file GraphAttributes.h.

NodeArray<double>& ogdf::GraphAttributes::width (  )  [inline]

Returns a refeence to the NodeArray m_width.

Definition at line 422 of file GraphAttributes.h.

const double& ogdf::GraphAttributes::width ( node  v  )  const [inline]

Returns the width of the bounding box of node v.

Definition at line 425 of file GraphAttributes.h.

void ogdf::GraphAttributes::writeGML ( ostream &  os  )  const

Writes the graph with its attributes in GML format to output stream os.

void ogdf::GraphAttributes::writeGML ( const String fileName  )  const

Writes the graph with its attributes in GML format to file fileName.

void ogdf::GraphAttributes::writeLongString ( ostream &  os,
const String str 
) const [protected]

Writes string str into a GML file such that line length limits are respected and characters '\', '"' are correctly escaped.

void ogdf::GraphAttributes::writeRudy ( ostream &  os  )  const

Writes the graph in Rudy format to output stream os.

void ogdf::GraphAttributes::writeRudy ( const String fileName  )  const

Writes the graph in Rudy format to file fileName.

void ogdf::GraphAttributes::writeXML ( const String fileName,
const char *  delimiter = "",
const char *  offset = "" 
) const

Reads the graph from the XML input stream is.

virtual void ogdf::GraphAttributes::writeXML ( ostream &  os,
const char *  delimiter = "",
const char *  offset = "" 
) const [virtual]

Reads the graph from the XML input stream is.

double& ogdf::GraphAttributes::x ( node  v  )  [inline]

Returns the x-coordinate of node v.

Definition at line 411 of file GraphAttributes.h.

const double& ogdf::GraphAttributes::x ( node  v  )  const [inline]

Returns the x-coordinate of node v.

Definition at line 409 of file GraphAttributes.h.

double& ogdf::GraphAttributes::y ( node  v  )  [inline]

Returns the y-coordinate of node v.

Definition at line 416 of file GraphAttributes.h.

const double& ogdf::GraphAttributes::y ( node  v  )  const [inline]

Returns the y-coordinate of node v.

Definition at line 414 of file GraphAttributes.h.


Member Data Documentation

bit vector of currently used attributes

Definition at line 328 of file GraphAttributes.h.

list of bend points of an edge

Definition at line 315 of file GraphAttributes.h.

whether or not the graph is directed

Definition at line 284 of file GraphAttributes.h.

(real number) weight of an edge

Definition at line 325 of file GraphAttributes.h.

arrow type of an edge

Definition at line 317 of file GraphAttributes.h.

line color of an edge

Definition at line 319 of file GraphAttributes.h.

label of an edge

Definition at line 316 of file GraphAttributes.h.

line style of an edge

Definition at line 318 of file GraphAttributes.h.

line width of an edge

Definition at line 320 of file GraphAttributes.h.

type of an edge (association or generalization)

Definition at line 321 of file GraphAttributes.h.

height of a nodes's bounding box

Definition at line 290 of file GraphAttributes.h.

Definition at line 304 of file GraphAttributes.h.

Definition at line 306 of file GraphAttributes.h.

Definition at line 301 of file GraphAttributes.h.

Definition at line 305 of file GraphAttributes.h.

(integer) weight of an edge

Definition at line 324 of file GraphAttributes.h.

level of a node

Definition at line 310 of file GraphAttributes.h.

color of a node

Definition at line 292 of file GraphAttributes.h.

user ID of a node

Definition at line 309 of file GraphAttributes.h.

(integer) weight of a node

Definition at line 311 of file GraphAttributes.h.

label of a node

Definition at line 291 of file GraphAttributes.h.

line color of a node

Definition at line 293 of file GraphAttributes.h.

line width of a node

Definition at line 295 of file GraphAttributes.h.

brush pattern of a node

Definition at line 296 of file GraphAttributes.h.

shape of a node

Definition at line 294 of file GraphAttributes.h.

line style of a node

Definition at line 297 of file GraphAttributes.h.

name of template of a node

Definition at line 298 of file GraphAttributes.h.

associated graph

Definition at line 282 of file GraphAttributes.h.

EdgeArray<unsigned int> ogdf::GraphAttributes::m_subGraph [protected]

is element of subgraphs given by bitvector

Definition at line 326 of file GraphAttributes.h.

width of a node's bounding box

Definition at line 289 of file GraphAttributes.h.

x-coordinate of a node

Definition at line 287 of file GraphAttributes.h.

y-coordinate pf a node

Definition at line 288 of file GraphAttributes.h.


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