Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::GraphAttributes Class Reference

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

#include <ogdf/basic/GraphAttributes.h>

+ Inheritance diagram for ogdf::GraphAttributes:

Public Member Functions

Construction and management of attributes
 GraphAttributes ()
 Constructs graph attributes for no associated graph (default constructor). More...
 
 GraphAttributes (const Graph &G, long attr=nodeGraphics|edgeGraphics)
 Constructs graph attributes associated with the graph G. More...
 
virtual ~GraphAttributes ()
 
long attributes () const
 Returns currently accessible attributes. More...
 
bool has (long attr) const
 Returns true iff all attributes in attr are available. More...
 
virtual void init (const Graph &G, long attr)
 Initializes the graph attributes for graph G. More...
 
void init (long attr)
 Re-initializes the graph attributes while maintaining the associated graph. More...
 
void addAttributes (long attr)
 Enables attributes specified by attr and allocates required memory. More...
 
void destroyAttributes (long attr)
 Disables attributes specified by attr and releases available memory. More...
 
const Graph & constGraph () const
 Returns a reference to the associated graph. More...
 
General attributes
bool directed () const
 Returns if the graph is directed. More...
 
bool & directed ()
 Returns if the graph is directed. More...
 
Node attributes
double x (node v) const
 Returns the x-coordinate of node v. More...
 
double & x (node v)
 Returns the x-coordinate of node v. More...
 
double y (node v) const
 Returns the y-coordinate of node v. More...
 
double & y (node v)
 Returns the y-coordinate of node v. More...
 
double z (node v) const
 Returns the z-coordinate of node v. More...
 
double & z (node v)
 Returns the z-coordinate of node v. More...
 
double xLabel (node v) const
 Returns the label x-coordinate of node v. More...
 
double & xLabel (node v)
 Returns the label x-coordinate of node v. More...
 
double yLabel (node v) const
 Returns the label y-coordinate of node v. More...
 
double & yLabel (node v)
 Returns the label y-coordinate of node v. More...
 
double zLabel (node v) const
 Returns the label z-coordinate of node v. More...
 
double & zLabel (node v)
 Returns the label z-coordinate of node v. More...
 
double width (node v) const
 Returns the width of the bounding box of node v. More...
 
double & width (node v)
 Returns the width of the bounding box of node v. More...
 
const NodeArray< double > & width () const
 Returns a reference to the node array m_width. More...
 
NodeArray< double > & width ()
 Returns a reference to the node array #m_width. More...
 
double height (node v) const
 Returns the height of the bounding box of node v. More...
 
double & height (node v)
 Returns the height of the bounding box of node v. More...
 
const NodeArray< double > & height () const
 Returns a reference to the node array m_height. More...
 
NodeArray< double > & height ()
 Returns a reference to the node array m_height. More...
 
Shape shape (node v) const
 Returns the shape type of node v. More...
 
Shape & shape (node v)
 Returns the shape type of node v. More...
 
StrokeType strokeType (node v) const
 Returns the stroke type of node v. More...
 
StrokeType & strokeType (node v)
 Returns the stroke type of node v. More...
 
const Color & strokeColor (node v) const
 Returns the stroke color of node v. More...
 
Color & strokeColor (node v)
 Returns the stroke color of node v. More...
 
float strokeWidth (node v) const
 Returns the stroke width of node v. More...
 
float & strokeWidth (node v)
 Returns the stroke width of node v. More...
 
FillPattern fillPattern (node v) const
 Returns the fill pattern of node v. More...
 
FillPattern & fillPattern (node v)
 Returns the fill pattern of node v. More...
 
const Color & fillColor (node v) const
 Returns the fill color of node v. More...
 
Color & fillColor (node v)
 Returns the fill color of node v. More...
 
const Color & fillBgColor (node v) const
 Returns the background color of fill patterns for node v. More...
 
Color & fillBgColor (node v)
 Returns the background color of fill patterns for node v. More...
 
const string & label (node v) const
 Returns the label of node v. More...
 
string & label (node v)
 Returns the label of node v. More...
 
const string & templateNode (node v) const
 Returns the template name of node v. More...
 
string & templateNode (node v)
 Returns the template name of node v. More...
 
int weight (node v) const
 Returns the weight of node v. More...
 
int & weight (node v)
 Returns the weight of node v. More...
 
Graph::NodeType type (node v) const
 Returns the type of node v. More...
 
Graph::NodeType & type (node v)
 Returns the type of node v. More...
 
int idNode (node v) const
 Returns the user ID of node v. More...
 
int & idNode (node v)
 Returns the user ID of node v. More...
 
Edge attributes
const DPolyline & bends (edge e) const
 Returns the list of bend points of edge e. More...
 
DPolyline & bends (edge e)
 Returns the list of bend points of edge e. More...
 
EdgeArrow arrowType (edge e) const
 Returns the arrow type of edge e. More...
 
EdgeArrow & arrowType (edge e)
 Returns the arrow type of edge e. More...
 
StrokeType strokeType (edge e) const
 Returns the stroke type of edge e. More...
 
StrokeType & strokeType (edge e)
 Returns the stroke type of edge e. More...
 
const Color & strokeColor (edge e) const
 Returns the stroke color of edge e. More...
 
Color & strokeColor (edge e)
 Returns the stroke color of edge e. More...
 
float strokeWidth (edge e) const
 Returns the stroke width of edge e. More...
 
float & strokeWidth (edge e)
 Returns the stroke width of edge e. More...
 
const string & label (edge e) const
 Returns the label of edge e. More...
 
string & label (edge e)
 Returns the label of edge e. More...
 
int intWeight (edge e) const
 Returns the (integer) weight of edge e. More...
 
int & intWeight (edge e)
 Returns the (integer) weight of edge e. More...
 
double doubleWeight (edge e) const
 Returns the (real number) weight of edge e. More...
 
double & doubleWeight (edge e)
 Returns the (real number) weight of edge e. More...
 
Graph::EdgeType type (edge e) const
 Returns the type of edge e. More...
 
Graph::EdgeType & type (edge e)
 Returns the type of edge e. More...
 
uint32_t subGraphBits (edge e) const
 Returns the edgesubgraph value of an edge e. More...
 
uint32_t & subGraphBits (edge e)
 Returns the edgesubgraph value of an edge e. More...
 
bool inSubGraph (edge e, int n) const
 Checks whether edge e belongs to basic graph n. More...
 
void addSubGraph (edge e, int n)
 Adds edge e to basic graph n. More...
 
void removeSubGraph (edge e, int n)
 Removes edge e from basic graph n. More...
 
Layout transformations
virtual void scale (double sx, double sy, bool scaleNodes=true)
 Scales the layout by (sx,sy). More...
 
virtual void scale (double s, bool scaleNodes=true)
 Scales the layout by s. More...
 
virtual void translate (double dx, double dy)
 Translates the layout by (dx,dy). More...
 
virtual void translateToNonNeg ()
 Translates the layout such that the lower left corner is at (0,0). More...
 
virtual void flipVertical ()
 Flips the layout vertically within its bounding box. More...
 
virtual void flipVertical (const DRect &box)
 Flips the (whole) layout vertically such that the part in box remains in this area. More...
 
virtual void flipHorizontal ()
 Flips the layout horizontally within its bounding box. More...
 
virtual void flipHorizontal (const DRect &box)
 Flips the (whole) layout horizontally such that the part in box remains in this area. More...
 
virtual void scaleAndTranslate (double sx, double sy, double dx, double dy, bool scaleNodes=true)
 Scales the layout by (sx,sy) and then translates it by (dx,dy). More...
 
virtual void scaleAndTranslate (double s, double dx, double dy, bool scaleNodes=true)
 Scales the layout by s and then translates it by (dx,dy). More...
 
virtual void rotateRight90 ()
 Rotates the layout by 90 degree (in clockwise direction) around the origin. More...
 
virtual void rotateLeft90 ()
 Rotates the layout by 90 degree (in counter-clockwise direction) around the origin. More...
 
Utility functions
virtual DRect boundingBox () const
 Returns the bounding box of the graph. More...
 
void setAllWidth (double w)
 Sets the width of all nodes to w. More...
 
void setAllHeight (double h)
 Sets the height of all nodes to h. More...
 
void clearAllBends ()
 Removes all edge bends. More...
 
void removeUnnecessaryBendsHV ()
 Removes unnecessary bend points in orthogonal segements. More...
 
void addNodeCenter2Bends (int mode=1)
 Adds additional bend points to all edges for connecting their endpoints. More...
 
bool isAssociationClass (node v) const
 Returns true iff v represents an association class. More...
 
int hierarchyList (List< List< node > *> &list) const
 Returns a list of all inheritance hierarchies in the graph. More...
 
int hierarchyList (List< List< edge > *> &list) const
 Returns a list of all inheritance hierarchies in the graph. More...
 

Static Public Attributes

Flags for enabling attributes.
static const int nodeGraphics
 Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node). More...
 
static const int edgeGraphics
 Corresponds to edge attribute bends(edge). More...
 
static const int edgeIntWeight
 Corresponds to edge attribute intWeight(edge). More...
 
static const int edgeDoubleWeight
 Corresponds to edge attribute doubleWeight(edge). More...
 
static const int edgeLabel
 Corresponds to edge attribute label(edge). More...
 
static const int nodeLabel
 Corresponds to node attribute label(node). More...
 
static const int edgeType
 Corresponds to edge attribute type(edge). More...
 
static const int nodeType
 Corresponds to node attribute type(node). More...
 
static const int nodeId
 Corresponds to node attribute idNode(node). More...
 
static const int edgeArrow
 Corresponds to edge attribute arrowType(edge). More...
 
static const int edgeStyle
 Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge). More...
 
static const int nodeStyle
 Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node), fillPattern(node), fillColor(node), and fillBgColor(node). More...
 
static const int nodeTemplate
 Corresponds to node attribute templateNode(node). More...
 
static const int edgeSubGraphs
 Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge, int) const, and removeSubGraph(edge, int). More...
 
static const int nodeWeight
 Corresponds to node attribute weight(node). More...
 
static const int threeD
 Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only. More...
 
static const int nodeLabelPosition
 Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node). More...
 

Protected Attributes

long m_attributes
 bit vector of currently used attributes More...
 
EdgeArray< DPolyline > m_bends
 list of bend points of an edge More...
 
bool m_directed
 whether or not the graph is directed More...
 
EdgeArray< double > m_doubleWeight
 (real number) weight of an edge More...
 
EdgeArray< EdgeArrow > m_edgeArrow
 arrow type of an edge More...
 
EdgeArray< string > m_edgeLabel
 label of an edge More...
 
EdgeArray< Stroke > m_edgeStroke
 stroke of an edge More...
 
EdgeArray< Graph::EdgeType > m_eType
 type of an edge (association or generalization) More...
 
NodeArray< double > m_height
 height of a nodes's bounding box More...
 
EdgeArray< int > m_intWeight
 (integer) weight of an edge More...
 
NodeArray< Fill > m_nodeFill
 fill of a node More...
 
NodeArray< int > m_nodeId
 user ID of a node More...
 
NodeArray< int > m_nodeIntWeight
 (integer) weight of a node More...
 
NodeArray< string > m_nodeLabel
 label of a node More...
 
NodeArray< double > m_nodeLabelPosX
 x-coordinate of a node label More...
 
NodeArray< double > m_nodeLabelPosY
 y-coordinate of a node label More...
 
NodeArray< double > m_nodeLabelPosZ
 z-coordinate of a node label More...
 
NodeArray< Shape > m_nodeShape
 shape of a node More...
 
NodeArray< Stroke > m_nodeStroke
 stroke of a node More...
 
NodeArray< string > m_nodeTemplate
 name of template of a node More...
 
const Graph * m_pGraph
 associated graph More...
 
EdgeArray< uint32_t > m_subGraph
 is element of subgraphs given by bitvector More...
 
NodeArray< Graph::NodeType > m_vType
 type (vertex, dummy, generalizationMerger) More...
 
NodeArray< double > m_width
 width of a node's bounding box More...
 
NodeArray< double > m_x
 x-coordinate of a node More...
 
NodeArray< double > m_y
 y-coordinate of a node More...
 
NodeArray< double > m_z
 z-coordinate of a node More...
 

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. See the available flags for a detailed description.

Attributes can be enabled/disabled by the constructor GraphAttributes(const Graph &,long), the re-initialization procedure init, addAttributes, and destroyAttributes.

Definition at line 67 of file GraphAttributes.h.

Constructor & Destructor Documentation

◆ GraphAttributes() [1/2]

ogdf::GraphAttributes::GraphAttributes ( )

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

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

◆ GraphAttributes() [2/2]

ogdf::GraphAttributes::GraphAttributes ( const Graph &  G,
long  attr = nodeGraphics|edgeGraphics 
)
explicit

Constructs graph attributes associated with the graph G.

Parameters
Gis the associated graph.
attrspecifies the set of attributes that can be accessed.

◆ ~GraphAttributes()

virtual ogdf::GraphAttributes::~GraphAttributes ( )
inlinevirtual

Definition at line 188 of file GraphAttributes.h.

Member Function Documentation

◆ addAttributes()

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

Enables attributes specified by attr and allocates required memory.

◆ addNodeCenter2Bends()

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

Adds additional bend points to all edges for connecting their endpoints.

According to 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
Precondition
nodeGraphics and edgeGraphics is enabled

◆ addSubGraph()

void ogdf::GraphAttributes::addSubGraph ( edge  e,
int  n 
)
inline

Adds edge e to basic graph n.

Precondition
edgeSubGraphs is enabled

Definition at line 881 of file GraphAttributes.h.

◆ arrowType() [1/2]

EdgeArrow ogdf::GraphAttributes::arrowType ( edge  e) const
inline

Returns the arrow type of edge e.

Precondition
edgeArrow is enabled

Definition at line 698 of file GraphAttributes.h.

◆ arrowType() [2/2]

EdgeArrow& ogdf::GraphAttributes::arrowType ( edge  e)
inline

Returns the arrow type of edge e.

Precondition
edgeArrow is enabled

Definition at line 707 of file GraphAttributes.h.

◆ attributes()

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

Returns currently accessible attributes.

Definition at line 192 of file GraphAttributes.h.

◆ bends() [1/2]

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

Returns the list of bend points of edge e.

Precondition
edgeGraphics is enabled

Definition at line 679 of file GraphAttributes.h.

◆ bends() [2/2]

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

Returns the list of bend points of edge e.

Precondition
edgeGraphics is enabled

Definition at line 688 of file GraphAttributes.h.

◆ boundingBox()

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

Returns the bounding box of the graph.

Precondition
nodeGraphics and edgeGraphics is enabled

Reimplemented in ogdf::ClusterGraphAttributes.

◆ clearAllBends()

void ogdf::GraphAttributes::clearAllBends ( )

Removes all edge bends.

Precondition
edgeGraphics is enabled

◆ constGraph()

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

Returns a reference to the associated graph.

Definition at line 222 of file GraphAttributes.h.

◆ destroyAttributes()

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

Disables attributes specified by attr and releases available memory.

◆ directed() [1/2]

bool ogdf::GraphAttributes::directed ( ) const
inline

Returns if the graph is directed.

Definition at line 233 of file GraphAttributes.h.

◆ directed() [2/2]

bool& ogdf::GraphAttributes::directed ( )
inline

Returns if the graph is directed.

Definition at line 238 of file GraphAttributes.h.

◆ doubleWeight() [1/2]

double ogdf::GraphAttributes::doubleWeight ( edge  e) const
inline

Returns the (real number) weight of edge e.

Precondition
edgeDoubleWeight is enabled

Definition at line 812 of file GraphAttributes.h.

◆ doubleWeight() [2/2]

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

Returns the (real number) weight of edge e.

Precondition
edgeDoubleWeight is enabled

Definition at line 821 of file GraphAttributes.h.

◆ fillBgColor() [1/2]

const Color& ogdf::GraphAttributes::fillBgColor ( node  v) const
inline

Returns the background color of fill patterns for node v.

Precondition
nodeStyle is enabled

Definition at line 559 of file GraphAttributes.h.

◆ fillBgColor() [2/2]

Color& ogdf::GraphAttributes::fillBgColor ( node  v)
inline

Returns the background color of fill patterns for node v.

Precondition
nodeStyle is enabled

Definition at line 568 of file GraphAttributes.h.

◆ fillColor() [1/2]

const Color& ogdf::GraphAttributes::fillColor ( node  v) const
inline

Returns the fill color of node v.

Precondition
nodeStyle is enabled

Definition at line 540 of file GraphAttributes.h.

◆ fillColor() [2/2]

Color& ogdf::GraphAttributes::fillColor ( node  v)
inline

Returns the fill color of node v.

Precondition
nodeStyle is enabled

Definition at line 549 of file GraphAttributes.h.

◆ fillPattern() [1/2]

FillPattern ogdf::GraphAttributes::fillPattern ( node  v) const
inline

Returns the fill pattern of node v.

Precondition
nodeStyle is enabled

Definition at line 522 of file GraphAttributes.h.

◆ fillPattern() [2/2]

FillPattern& ogdf::GraphAttributes::fillPattern ( node  v)
inline

Returns the fill pattern of node v.

Precondition
nodeStyle is enabled

Definition at line 531 of file GraphAttributes.h.

◆ flipHorizontal() [1/2]

virtual void ogdf::GraphAttributes::flipHorizontal ( )
inlinevirtual

Flips the layout horizontally within its bounding box.

If preserving the bounding box is not required, the layout can also be flipped horizontally by calling scale(-1.0, 1.0, false).

Definition at line 958 of file GraphAttributes.h.

◆ flipHorizontal() [2/2]

virtual void ogdf::GraphAttributes::flipHorizontal ( const DRect &  box)
virtual

Flips the (whole) layout horizontally such that the part in box remains in this area.

The whole layout is flipped and then moved such that the part that was in box before flipping is moved to this area.

Reimplemented in ogdf::ClusterGraphAttributes.

◆ flipVertical() [1/2]

virtual void ogdf::GraphAttributes::flipVertical ( )
inlinevirtual

Flips the layout vertically within its bounding box.

If preserving the bounding box is not required, the layout can also be flipped vertically by calling scale(1.0, -1.0, false).

Definition at line 944 of file GraphAttributes.h.

◆ flipVertical() [2/2]

virtual void ogdf::GraphAttributes::flipVertical ( const DRect &  box)
virtual

Flips the (whole) layout vertically such that the part in box remains in this area.

The whole layout is flipped and then moved such that the part that was in box before flipping is moved to this area.

Reimplemented in ogdf::ClusterGraphAttributes.

◆ has()

bool ogdf::GraphAttributes::has ( long  attr) const
inline

Returns true iff all attributes in attr are available.

Definition at line 197 of file GraphAttributes.h.

◆ height() [1/4]

double ogdf::GraphAttributes::height ( node  v) const
inline

Returns the height of the bounding box of node v.

Precondition
nodeGraphics is enabled

Definition at line 409 of file GraphAttributes.h.

◆ height() [2/4]

double& ogdf::GraphAttributes::height ( node  v)
inline

Returns the height of the bounding box of node v.

Precondition
nodeGraphics is enabled

Definition at line 418 of file GraphAttributes.h.

◆ height() [3/4]

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

Returns a reference to the node array m_height.

Precondition
nodeGraphics is enabled

Definition at line 428 of file GraphAttributes.h.

◆ height() [4/4]

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

Returns a reference to the node array m_height.

Precondition
nodeGraphics is enabled

Definition at line 437 of file GraphAttributes.h.

◆ hierarchyList() [1/2]

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
listis a list of all hierarchies; each hierarchy is itself a list of all nodes in this hierarchy.
Returns
Returns the number of generalization hierarchies.

◆ hierarchyList() [2/2]

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
listis a list of all hierarchies; each hierarchy is itself a list of all edges in this hierarchy.
Returns
Returns the number of generalization hierarchies.

◆ idNode() [1/2]

int ogdf::GraphAttributes::idNode ( node  v) const
inline

Returns the user ID of node v.

Precondition
nodeId is enabled

Definition at line 654 of file GraphAttributes.h.

◆ idNode() [2/2]

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

Returns the user ID of node v.

Precondition
nodeId is enabled

Definition at line 663 of file GraphAttributes.h.

◆ init() [1/2]

virtual void ogdf::GraphAttributes::init ( const Graph &  G,
long  attr 
)
virtual

Initializes the graph attributes for graph G.

Parameters
Gis the new associated graph.
attrspecifies 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 addAttributes.

Reimplemented in ogdf::ClusterGraphAttributes, and ogdf::UMLGraph.

◆ init() [2/2]

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

Re-initializes the graph attributes while maintaining the associated graph.

See also
init(const Graph&, long)

◆ inSubGraph()

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

Checks whether edge e belongs to basic graph n.

Precondition
edgeSubGraphs is enabled

Definition at line 869 of file GraphAttributes.h.

◆ intWeight() [1/2]

int ogdf::GraphAttributes::intWeight ( edge  e) const
inline

Returns the (integer) weight of edge e.

Precondition
edgeIntWeight is enabled

Definition at line 793 of file GraphAttributes.h.

◆ intWeight() [2/2]

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

Returns the (integer) weight of edge e.

Precondition
edgeIntWeight is enabled

Definition at line 802 of file GraphAttributes.h.

◆ isAssociationClass()

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

Returns true iff v represents an association class.

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().

Precondition
nodeGraphics are enabled

Definition at line 1065 of file GraphAttributes.h.

◆ label() [1/4]

const string& ogdf::GraphAttributes::label ( node  v) const
inline

Returns the label of node v.

Precondition
nodeLabel is enabled

Definition at line 578 of file GraphAttributes.h.

◆ label() [2/4]

string& ogdf::GraphAttributes::label ( node  v)
inline

Returns the label of node v.

Precondition
nodeLabel is enabled

Definition at line 587 of file GraphAttributes.h.

◆ label() [3/4]

const string& ogdf::GraphAttributes::label ( edge  e) const
inline

Returns the label of edge e.

Precondition
edgeLabel is enabled

Definition at line 774 of file GraphAttributes.h.

◆ label() [4/4]

string& ogdf::GraphAttributes::label ( edge  e)
inline

Returns the label of edge e.

Precondition
edgeLabel is enabled

Definition at line 783 of file GraphAttributes.h.

◆ removeSubGraph()

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

Removes edge e from basic graph n.

Precondition
edgeSubGraphs is enabled

Definition at line 893 of file GraphAttributes.h.

◆ removeUnnecessaryBendsHV()

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.

Precondition
edgeGraphics is enabled

◆ rotateLeft90()

virtual void ogdf::GraphAttributes::rotateLeft90 ( )
virtual

Rotates the layout by 90 degree (in counter-clockwise direction) around the origin.

◆ rotateRight90()

virtual void ogdf::GraphAttributes::rotateRight90 ( )
virtual

Rotates the layout by 90 degree (in clockwise direction) around the origin.

◆ scale() [1/2]

virtual void ogdf::GraphAttributes::scale ( double  sx,
double  sy,
bool  scaleNodes = true 
)
virtual

Scales the layout by (sx,sy).

If scaleNodes is true, node sizes are scaled as well.

Parameters
sxis the scaling factor for x-coordinates.
syis the scaling factor for y-coordinates.
scaleNodesdetermines if nodes size are scaled as well (true) or not.
Precondition
nodeGraphics and edgeGraphics are enabled

Reimplemented in ogdf::ClusterGraphAttributes.

◆ scale() [2/2]

virtual void ogdf::GraphAttributes::scale ( double  s,
bool  scaleNodes = true 
)
inlinevirtual

Scales the layout by s.

If scaleNodes is true, node sizes are scaled as well.

Parameters
sis the scaling factor for both x- and y-coordinates.
scaleNodesdetermines if nodes size are scaled as well (true) or not.
Precondition
nodeGraphics and edgeGraphics are enabled

Definition at line 927 of file GraphAttributes.h.

◆ scaleAndTranslate() [1/2]

virtual void ogdf::GraphAttributes::scaleAndTranslate ( double  sx,
double  sy,
double  dx,
double  dy,
bool  scaleNodes = true 
)
virtual

Scales the layout by (sx,sy) and then translates it by (dx,dy).

If scaleNodes is true, node sizes are scaled as well. A point (x,y) is moved to (sx ⋅ x + dx, sy ⋅ y + dy).

Parameters
sxis the scaling factor for x-coordinates.
syis the scaling factor for y-coordinates.
dxis the translation in x-direction.
dyis the translation in y-direction.
scaleNodesdetermines if nodes size are scaled as well (true) or not.

◆ scaleAndTranslate() [2/2]

virtual void ogdf::GraphAttributes::scaleAndTranslate ( double  s,
double  dx,
double  dy,
bool  scaleNodes = true 
)
inlinevirtual

Scales the layout by s and then translates it by (dx,dy).

If scaleNodes is true, node sizes are scaled as well. A point (x,y) is moved to (s ⋅ x + dx, s ⋅ y + dy).

Parameters
sis the scaling factor for both x- and y-coordinates.
dxis the translation in x-direction.
dyis the translation in y-direction.
scaleNodesdetermines if nodes size are scaled as well (true) or not.

Definition at line 990 of file GraphAttributes.h.

◆ setAllHeight()

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

Sets the height of all nodes to h.

Precondition
nodeGraphics is enabled

◆ setAllWidth()

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

Sets the width of all nodes to w.

Precondition
nodeGraphics is enabled

◆ shape() [1/2]

Shape ogdf::GraphAttributes::shape ( node  v) const
inline

Returns the shape type of node v.

Precondition
nodeGraphics is enabled

Definition at line 447 of file GraphAttributes.h.

◆ shape() [2/2]

Shape& ogdf::GraphAttributes::shape ( node  v)
inline

Returns the shape type of node v.

Precondition
nodeGraphics is enabled

Definition at line 456 of file GraphAttributes.h.

◆ strokeColor() [1/4]

const Color& ogdf::GraphAttributes::strokeColor ( node  v) const
inline

Returns the stroke color of node v.

Precondition
nodeStyle is enabled

Definition at line 485 of file GraphAttributes.h.

◆ strokeColor() [2/4]

Color& ogdf::GraphAttributes::strokeColor ( node  v)
inline

Returns the stroke color of node v.

Precondition
nodeStyle is enabled

Definition at line 494 of file GraphAttributes.h.

◆ strokeColor() [3/4]

const Color& ogdf::GraphAttributes::strokeColor ( edge  e) const
inline

Returns the stroke color of edge e.

Precondition
edgeStyle is enabled

Definition at line 736 of file GraphAttributes.h.

◆ strokeColor() [4/4]

Color& ogdf::GraphAttributes::strokeColor ( edge  e)
inline

Returns the stroke color of edge e.

Precondition
edgeStyle is enabled

Definition at line 745 of file GraphAttributes.h.

◆ strokeType() [1/4]

StrokeType ogdf::GraphAttributes::strokeType ( node  v) const
inline

Returns the stroke type of node v.

Precondition
nodeStyle is enabled

Definition at line 466 of file GraphAttributes.h.

◆ strokeType() [2/4]

StrokeType& ogdf::GraphAttributes::strokeType ( node  v)
inline

Returns the stroke type of node v.

Precondition
nodeStyle is enabled

Definition at line 475 of file GraphAttributes.h.

◆ strokeType() [3/4]

StrokeType ogdf::GraphAttributes::strokeType ( edge  e) const
inline

Returns the stroke type of edge e.

Precondition
edgeStyle is enabled

Definition at line 717 of file GraphAttributes.h.

◆ strokeType() [4/4]

StrokeType& ogdf::GraphAttributes::strokeType ( edge  e)
inline

Returns the stroke type of edge e.

Precondition
edgeStyle is enabled

Definition at line 726 of file GraphAttributes.h.

◆ strokeWidth() [1/4]

float ogdf::GraphAttributes::strokeWidth ( node  v) const
inline

Returns the stroke width of node v.

Precondition
nodeStyle is enabled

Definition at line 504 of file GraphAttributes.h.

◆ strokeWidth() [2/4]

float& ogdf::GraphAttributes::strokeWidth ( node  v)
inline

Returns the stroke width of node v.

Precondition
nodeStyle is enabled

Definition at line 513 of file GraphAttributes.h.

◆ strokeWidth() [3/4]

float ogdf::GraphAttributes::strokeWidth ( edge  e) const
inline

Returns the stroke width of edge e.

Precondition
edgeStyle is enabled

Definition at line 755 of file GraphAttributes.h.

◆ strokeWidth() [4/4]

float& ogdf::GraphAttributes::strokeWidth ( edge  e)
inline

Returns the stroke width of edge e.

Precondition
edgeStyle is enabled

Definition at line 764 of file GraphAttributes.h.

◆ subGraphBits() [1/2]

uint32_t ogdf::GraphAttributes::subGraphBits ( edge  e) const
inline

Returns the edgesubgraph value of an edge e.

Precondition
edgeSubGraphs is enabled

Definition at line 850 of file GraphAttributes.h.

◆ subGraphBits() [2/2]

uint32_t& ogdf::GraphAttributes::subGraphBits ( edge  e)
inline

Returns the edgesubgraph value of an edge e.

Precondition
edgeSubGraphs is enabled

Definition at line 859 of file GraphAttributes.h.

◆ templateNode() [1/2]

const string& ogdf::GraphAttributes::templateNode ( node  v) const
inline

Returns the template name of node v.

Precondition
nodeTemplate is enabled

Definition at line 597 of file GraphAttributes.h.

◆ templateNode() [2/2]

string& ogdf::GraphAttributes::templateNode ( node  v)
inline

Returns the template name of node v.

Precondition
nodeTemplate is enabled

Definition at line 606 of file GraphAttributes.h.

◆ translate()

virtual void ogdf::GraphAttributes::translate ( double  dx,
double  dy 
)
virtual

Translates the layout by (dx,dy).

Parameters
dxis the translation in x-direction.
dyis the translation in y-direction.

Reimplemented in ogdf::ClusterGraphAttributes.

◆ translateToNonNeg()

virtual void ogdf::GraphAttributes::translateToNonNeg ( )
virtual

Translates the layout such that the lower left corner is at (0,0).

◆ type() [1/4]

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

Returns the type of node v.

Precondition
nodeType is enabled

Definition at line 635 of file GraphAttributes.h.

◆ type() [2/4]

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

Returns the type of node v.

Precondition
nodeType is enabled

Definition at line 644 of file GraphAttributes.h.

◆ type() [3/4]

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

Returns the type of edge e.

Precondition
edgeType is enabled

Definition at line 831 of file GraphAttributes.h.

◆ type() [4/4]

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

Returns the type of edge e.

Precondition
edgeType is enabled

Definition at line 840 of file GraphAttributes.h.

◆ weight() [1/2]

int ogdf::GraphAttributes::weight ( node  v) const
inline

Returns the weight of node v.

Precondition
nodeWeight is enabled

Definition at line 616 of file GraphAttributes.h.

◆ weight() [2/2]

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

Returns the weight of node v.

Precondition
nodeWeight is enabled

Definition at line 625 of file GraphAttributes.h.

◆ width() [1/4]

double ogdf::GraphAttributes::width ( node  v) const
inline

Returns the width of the bounding box of node v.

Precondition
nodeGraphics is enabled

Definition at line 371 of file GraphAttributes.h.

◆ width() [2/4]

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

Returns the width of the bounding box of node v.

Precondition
nodeGraphics is enabled

Definition at line 380 of file GraphAttributes.h.

◆ width() [3/4]

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

Returns a reference to the node array m_width.

Precondition
nodeGraphics is enabled

Definition at line 390 of file GraphAttributes.h.

◆ width() [4/4]

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

Returns a reference to the node array #m_width.

Precondition
nodeGraphics is enabled

Definition at line 399 of file GraphAttributes.h.

◆ x() [1/2]

double ogdf::GraphAttributes::x ( node  v) const
inline

Returns the x-coordinate of node v.

Precondition
nodeGraphics is enabled

Definition at line 252 of file GraphAttributes.h.

◆ x() [2/2]

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

Returns the x-coordinate of node v.

Precondition
nodeGraphics is enabled

Definition at line 262 of file GraphAttributes.h.

◆ xLabel() [1/2]

double ogdf::GraphAttributes::xLabel ( node  v) const
inline

Returns the label x-coordinate of node v.

Precondition
nodeLabelPosition is enabled

Definition at line 312 of file GraphAttributes.h.

◆ xLabel() [2/2]

double& ogdf::GraphAttributes::xLabel ( node  v)
inline

Returns the label x-coordinate of node v.

Precondition
nodeLabelPosition is enabled

Definition at line 321 of file GraphAttributes.h.

◆ y() [1/2]

double ogdf::GraphAttributes::y ( node  v) const
inline

Returns the y-coordinate of node v.

Precondition
nodeGraphics is enabled

Definition at line 272 of file GraphAttributes.h.

◆ y() [2/2]

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

Returns the y-coordinate of node v.

Precondition
nodeGraphics is enabled

Definition at line 282 of file GraphAttributes.h.

◆ yLabel() [1/2]

double ogdf::GraphAttributes::yLabel ( node  v) const
inline

Returns the label y-coordinate of node v.

Precondition
nodeLabelPosition is enabled

Definition at line 331 of file GraphAttributes.h.

◆ yLabel() [2/2]

double& ogdf::GraphAttributes::yLabel ( node  v)
inline

Returns the label y-coordinate of node v.

Precondition
nodeLabelPosition is enabled

Definition at line 340 of file GraphAttributes.h.

◆ z() [1/2]

double ogdf::GraphAttributes::z ( node  v) const
inline

Returns the z-coordinate of node v.

Precondition
threeD is enabled

Definition at line 292 of file GraphAttributes.h.

◆ z() [2/2]

double& ogdf::GraphAttributes::z ( node  v)
inline

Returns the z-coordinate of node v.

Precondition
threeD is enabled

Definition at line 302 of file GraphAttributes.h.

◆ zLabel() [1/2]

double ogdf::GraphAttributes::zLabel ( node  v) const
inline

Returns the label z-coordinate of node v.

Precondition
nodeLabelPosition and threeD are enabled

Definition at line 350 of file GraphAttributes.h.

◆ zLabel() [2/2]

double& ogdf::GraphAttributes::zLabel ( node  v)
inline

Returns the label z-coordinate of node v.

Precondition
nodeLabelPosition and threeD are enabled

Definition at line 360 of file GraphAttributes.h.

Member Data Documentation

◆ edgeArrow

const int ogdf::GraphAttributes::edgeArrow
static

Corresponds to edge attribute arrowType(edge).

Definition at line 143 of file GraphAttributes.h.

◆ edgeDoubleWeight

const int ogdf::GraphAttributes::edgeDoubleWeight
static

Corresponds to edge attribute doubleWeight(edge).

Definition at line 125 of file GraphAttributes.h.

◆ edgeGraphics

const int ogdf::GraphAttributes::edgeGraphics
static

Corresponds to edge attribute bends(edge).

Definition at line 119 of file GraphAttributes.h.

◆ edgeIntWeight

const int ogdf::GraphAttributes::edgeIntWeight
static

Corresponds to edge attribute intWeight(edge).

Definition at line 122 of file GraphAttributes.h.

◆ edgeLabel

const int ogdf::GraphAttributes::edgeLabel
static

Corresponds to edge attribute label(edge).

Definition at line 128 of file GraphAttributes.h.

◆ edgeStyle

const int ogdf::GraphAttributes::edgeStyle
static

Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).

Definition at line 146 of file GraphAttributes.h.

◆ edgeSubGraphs

const int ogdf::GraphAttributes::edgeSubGraphs
static

Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge, int) const, and removeSubGraph(edge, int).

Definition at line 157 of file GraphAttributes.h.

◆ edgeType

const int ogdf::GraphAttributes::edgeType
static

Corresponds to edge attribute type(edge).

Definition at line 134 of file GraphAttributes.h.

◆ m_attributes

long ogdf::GraphAttributes::m_attributes
protected

bit vector of currently used attributes

Definition at line 106 of file GraphAttributes.h.

◆ m_bends

EdgeArray<DPolyline> ogdf::GraphAttributes::m_bends
protected

list of bend points of an edge

Definition at line 95 of file GraphAttributes.h.

◆ m_directed

bool ogdf::GraphAttributes::m_directed
protected

whether or not the graph is directed

Definition at line 72 of file GraphAttributes.h.

◆ m_doubleWeight

EdgeArray<double> ogdf::GraphAttributes::m_doubleWeight
protected

(real number) weight of an edge

Definition at line 102 of file GraphAttributes.h.

◆ m_edgeArrow

EdgeArray<EdgeArrow> ogdf::GraphAttributes::m_edgeArrow
protected

arrow type of an edge

Definition at line 97 of file GraphAttributes.h.

◆ m_edgeLabel

EdgeArray<string> ogdf::GraphAttributes::m_edgeLabel
protected

label of an edge

Definition at line 96 of file GraphAttributes.h.

◆ m_edgeStroke

EdgeArray<Stroke> ogdf::GraphAttributes::m_edgeStroke
protected

stroke of an edge

Definition at line 98 of file GraphAttributes.h.

◆ m_eType

EdgeArray<Graph::EdgeType> ogdf::GraphAttributes::m_eType
protected

type of an edge (association or generalization)

Definition at line 103 of file GraphAttributes.h.

◆ m_height

NodeArray<double> ogdf::GraphAttributes::m_height
protected

height of a nodes's bounding box

Definition at line 82 of file GraphAttributes.h.

◆ m_intWeight

EdgeArray<int> ogdf::GraphAttributes::m_intWeight
protected

(integer) weight of an edge

Definition at line 101 of file GraphAttributes.h.

◆ m_nodeFill

NodeArray<Fill> ogdf::GraphAttributes::m_nodeFill
protected

fill of a node

Definition at line 86 of file GraphAttributes.h.

◆ m_nodeId

NodeArray<int> ogdf::GraphAttributes::m_nodeId
protected

user ID of a node

Definition at line 90 of file GraphAttributes.h.

◆ m_nodeIntWeight

NodeArray<int> ogdf::GraphAttributes::m_nodeIntWeight
protected

(integer) weight of a node

Definition at line 91 of file GraphAttributes.h.

◆ m_nodeLabel

NodeArray<string> ogdf::GraphAttributes::m_nodeLabel
protected

label of a node

Definition at line 84 of file GraphAttributes.h.

◆ m_nodeLabelPosX

NodeArray<double> ogdf::GraphAttributes::m_nodeLabelPosX
protected

x-coordinate of a node label

Definition at line 78 of file GraphAttributes.h.

◆ m_nodeLabelPosY

NodeArray<double> ogdf::GraphAttributes::m_nodeLabelPosY
protected

y-coordinate of a node label

Definition at line 79 of file GraphAttributes.h.

◆ m_nodeLabelPosZ

NodeArray<double> ogdf::GraphAttributes::m_nodeLabelPosZ
protected

z-coordinate of a node label

Definition at line 80 of file GraphAttributes.h.

◆ m_nodeShape

NodeArray<Shape> ogdf::GraphAttributes::m_nodeShape
protected

shape of a node

Definition at line 83 of file GraphAttributes.h.

◆ m_nodeStroke

NodeArray<Stroke> ogdf::GraphAttributes::m_nodeStroke
protected

stroke of a node

Definition at line 85 of file GraphAttributes.h.

◆ m_nodeTemplate

NodeArray<string> ogdf::GraphAttributes::m_nodeTemplate
protected

name of template of a node

Definition at line 87 of file GraphAttributes.h.

◆ m_pGraph

const Graph* ogdf::GraphAttributes::m_pGraph
protected

associated graph

Definition at line 70 of file GraphAttributes.h.

◆ m_subGraph

EdgeArray<uint32_t> ogdf::GraphAttributes::m_subGraph
protected

is element of subgraphs given by bitvector

Definition at line 104 of file GraphAttributes.h.

◆ m_vType

NodeArray<Graph::NodeType> ogdf::GraphAttributes::m_vType
protected

type (vertex, dummy, generalizationMerger)

Definition at line 92 of file GraphAttributes.h.

◆ m_width

NodeArray<double> ogdf::GraphAttributes::m_width
protected

width of a node's bounding box

Definition at line 81 of file GraphAttributes.h.

◆ m_x

NodeArray<double> ogdf::GraphAttributes::m_x
protected

x-coordinate of a node

Definition at line 75 of file GraphAttributes.h.

◆ m_y

NodeArray<double> ogdf::GraphAttributes::m_y
protected

y-coordinate of a node

Definition at line 76 of file GraphAttributes.h.

◆ m_z

NodeArray<double> ogdf::GraphAttributes::m_z
protected

z-coordinate of a node

Definition at line 77 of file GraphAttributes.h.

◆ nodeGraphics

const int ogdf::GraphAttributes::nodeGraphics
static

Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node).

Definition at line 116 of file GraphAttributes.h.

◆ nodeId

const int ogdf::GraphAttributes::nodeId
static

Corresponds to node attribute idNode(node).

Definition at line 140 of file GraphAttributes.h.

◆ nodeLabel

const int ogdf::GraphAttributes::nodeLabel
static

Corresponds to node attribute label(node).

Definition at line 131 of file GraphAttributes.h.

◆ nodeLabelPosition

const int ogdf::GraphAttributes::nodeLabelPosition
static

Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).

Definition at line 166 of file GraphAttributes.h.

◆ nodeStyle

const int ogdf::GraphAttributes::nodeStyle
static

◆ nodeTemplate

const int ogdf::GraphAttributes::nodeTemplate
static

Corresponds to node attribute templateNode(node).

Definition at line 153 of file GraphAttributes.h.

◆ nodeType

const int ogdf::GraphAttributes::nodeType
static

Corresponds to node attribute type(node).

Definition at line 137 of file GraphAttributes.h.

◆ nodeWeight

const int ogdf::GraphAttributes::nodeWeight
static

Corresponds to node attribute weight(node).

Definition at line 160 of file GraphAttributes.h.

◆ threeD

const int ogdf::GraphAttributes::threeD
static

Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only.

Definition at line 163 of file GraphAttributes.h.


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