Stores additional attributes of a graph (like layout information). More...
#include <ogdf/basic/GraphAttributes.h>
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 ()=default |
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... | |
Static Public Attributes | |
Flags for enabling attributes. | |
static const long | nodeGraphics |
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node). More... | |
static const long | edgeGraphics |
Corresponds to edge attribute bends(edge). More... | |
static const long | edgeIntWeight |
Corresponds to edge attribute intWeight(edge). More... | |
static const long | edgeDoubleWeight |
Corresponds to edge attribute doubleWeight(edge). More... | |
static const long | edgeLabel |
Corresponds to edge attribute label(edge). More... | |
static const long | nodeLabel |
Corresponds to node attribute label(node). More... | |
static const long | edgeType |
Corresponds to edge attribute type(edge). More... | |
static const long | nodeType |
Corresponds to node attribute type(node). More... | |
static const long | nodeId |
Corresponds to node attribute idNode(node). More... | |
static const long | edgeArrow |
Corresponds to edge attribute arrowType(edge). More... | |
static const long | edgeStyle |
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge). More... | |
static const long | nodeStyle |
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node), fillPattern(node), fillColor(node), and fillBgColor(node). More... | |
static const long | nodeTemplate |
Corresponds to node attribute templateNode(node). More... | |
static const long | edgeSubGraphs |
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge, int) const, and removeSubGraph(edge, int). More... | |
static const long | nodeWeight |
Corresponds to node attribute weight(node). More... | |
static const long | threeD |
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only. More... | |
static const long | nodeLabelPosition |
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node). More... | |
static const long | all |
Enables all available flags. 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... | |
Private Member Functions | |
void | copyEdgeAttributes (GraphAttributes &toAttr, edge eFrom, edge eTo, long attrs) const |
Copies all attributes attrs except bends (!) of eFrom to toAttr for eTo . More... | |
void | copyNodeAttributes (GraphAttributes &toAttr, node vFrom, node vTo, long attrs) const |
Copies all attributes attrs of vFrom to toAttr for vTo . More... | |
Utility functions | |
template<typename T > | |
using | NodeAttributeGetter = T(GraphAttributes::*)(node) const |
type of node attribute getter functions More... | |
template<typename T > | |
using | EdgeAttributeGetter = T(GraphAttributes::*)(edge) const |
type of edge attribute getter functions More... | |
template<typename T > | |
bool | isUniformForNodes (NodeAttributeGetter< T > attribute) const |
Checks whether a certain attribute has the same value for all nodes. More... | |
template<typename T > | |
bool | isUniformForEdges (EdgeAttributeGetter< T > attribute) const |
Checks whether a certain attribute has the same value for all edges. More... | |
bool | isUniform (long attributes) const |
Check whether all of the attributes associated with the bitflags in attributes (that are also enabled for this ogdf::GraphAttributes instance) are uniform, i.e. More... | |
DPoint | point (node v) const |
Returns a DPoint corresponding to the x- and y-coordinates of v . More... | |
void | transferToOriginal (GraphAttributes &origAttr) const |
Copies attributes of this to origAttr . More... | |
void | transferToCopy (GraphAttributes ©Attr) const |
Copies attributes of this to copyAttr . More... | |
virtual DRect | boundingBox () const |
Returns the bounding box of the graph. More... | |
template<class Rectangle = DRect> | |
void | nodeBoundingBoxes (NodeArray< Rectangle > &boundingBoxes) const |
Computes the bounding rectangle for each node. 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... | |
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 66 of file GraphAttributes.h.
using ogdf::GraphAttributes::EdgeAttributeGetter = T (GraphAttributes::*)(edge) const |
type of edge attribute getter functions
Definition at line 982 of file GraphAttributes.h.
using ogdf::GraphAttributes::NodeAttributeGetter = T (GraphAttributes::*)(node) const |
type of node attribute getter functions
Definition at line 978 of file GraphAttributes.h.
ogdf::GraphAttributes::GraphAttributes | ( | ) |
Constructs graph attributes for no associated graph (default constructor).
The associated graph can be set later with the init() function.
|
explicit |
Constructs graph attributes associated with the graph G
.
G | is the associated graph. |
attr | specifies the set of attributes that can be accessed. |
|
virtualdefault |
void ogdf::GraphAttributes::addAttributes | ( | long | attr | ) |
Enables attributes specified by attr
and allocates required memory.
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 centermode
= 1: compute intersection with the line segment to the center and the boundary of the rectangular nodemode
= 2: compute intersection with the first/last line segment and the boundary of the rectangular node
|
inline |
Adds edge e
to basic graph n
.
Definition at line 851 of file GraphAttributes.h.
Returns the arrow type of edge e
.
Definition at line 687 of file GraphAttributes.h.
Returns the arrow type of edge e
.
Definition at line 678 of file GraphAttributes.h.
|
inline |
Returns currently accessible attributes.
Definition at line 191 of file GraphAttributes.h.
Returns the list of bend points of edge e
.
Definition at line 669 of file GraphAttributes.h.
Returns the list of bend points of edge e
.
Note that bend points should not be co-linear. This can always be achieved by calling DPolyline::normalize(). Similarly, bend points should never include the point of the edge's source or target node, even though the poly-line for the entire edge formally includes them.
Definition at line 658 of file GraphAttributes.h.
|
virtual |
Returns the bounding box of the graph.
Reimplemented in ogdf::ClusterGraphAttributes.
void ogdf::GraphAttributes::clearAllBends | ( | ) |
Removes all edge bends.
|
inline |
Returns a reference to the associated graph.
Definition at line 217 of file GraphAttributes.h.
|
private |
Copies all attributes attrs
except bends (!) of eFrom
to toAttr
for eTo
.
|
private |
Copies all attributes attrs
of vFrom
to toAttr
for vTo
.
void ogdf::GraphAttributes::destroyAttributes | ( | long | attr | ) |
Disables attributes specified by attr
and releases available memory.
|
inline |
Returns if the graph is directed.
Definition at line 229 of file GraphAttributes.h.
|
inline |
Returns if the graph is directed.
Definition at line 226 of file GraphAttributes.h.
|
inline |
Returns the (real number) weight of edge e
.
Definition at line 795 of file GraphAttributes.h.
|
inline |
Returns the (real number) weight of edge e
.
Definition at line 786 of file GraphAttributes.h.
Returns the background color of fill patterns for node v
.
Definition at line 540 of file GraphAttributes.h.
Returns the background color of fill patterns for node v
.
Definition at line 531 of file GraphAttributes.h.
Returns the fill color of node v
.
Definition at line 522 of file GraphAttributes.h.
Returns the fill color of node v
.
Definition at line 513 of file GraphAttributes.h.
|
inline |
Returns the fill pattern of node v
.
Definition at line 504 of file GraphAttributes.h.
|
inline |
Returns the fill pattern of node v
.
Definition at line 495 of file GraphAttributes.h.
|
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 927 of file GraphAttributes.h.
|
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.
|
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 913 of file GraphAttributes.h.
|
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.
|
inline |
Returns true iff all attributes in attr
are available.
Definition at line 194 of file GraphAttributes.h.
|
inline |
Returns a reference to the node array m_height.
Definition at line 414 of file GraphAttributes.h.
|
inline |
Returns a reference to the node array m_height.
Definition at line 405 of file GraphAttributes.h.
|
inline |
Returns the height of the bounding box of node v
.
Definition at line 396 of file GraphAttributes.h.
|
inline |
Returns the height of the bounding box of node v
.
Definition at line 387 of file GraphAttributes.h.
Returns a list of all inheritance hierarchies in the graph.
Inheritance hierarchies are identified by edges with type Graph::generalization.
list | is a list of all hierarchies; each hierarchy is itself a list of all edges in this hierarchy. |
Returns a list of all inheritance hierarchies in the graph.
Inheritance hierarchies are identified by edges with type Graph::generalization.
list | is a list of all hierarchies; each hierarchy is itself a list of all nodes in this hierarchy. |
|
inline |
Returns the user ID of node v
.
If no user ID is set, returns the original index of the node instead.
Definition at line 634 of file GraphAttributes.h.
|
inline |
Returns the user ID of node v
.
If no user ID is set, returns the original index of the node instead.
Definition at line 623 of file GraphAttributes.h.
|
virtual |
Initializes the graph attributes for graph G
.
G | is the new associated graph. |
attr | specifies the set of attributes that can be accessed. |
Reimplemented in ogdf::UMLGraph.
void ogdf::GraphAttributes::init | ( | long | attr | ) |
Re-initializes the graph attributes while maintaining the associated graph.
|
inline |
Checks whether edge e
belongs to basic graph n
.
Definition at line 840 of file GraphAttributes.h.
|
inline |
Returns the (integer) weight of edge e
.
Definition at line 777 of file GraphAttributes.h.
|
inline |
Returns the (integer) weight of edge e
.
Definition at line 768 of file GraphAttributes.h.
|
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().
Definition at line 1152 of file GraphAttributes.h.
bool ogdf::GraphAttributes::isUniform | ( | long | attributes | ) | const |
Check whether all of the attributes associated with the bitflags in attributes
(that are also enabled for this ogdf::GraphAttributes instance) are uniform, i.e.
have the same value.
attributes | bitmask for all attribute flags to query |
attributes
are uniform
|
inline |
Checks whether a certain attribute has the same value for all edges.
T | return type of the attribute getter function |
attribute | edge attribute getter function |
Definition at line 1017 of file GraphAttributes.h.
|
inline |
Checks whether a certain attribute has the same value for all nodes.
T | return type of the attribute getter function |
attribute | node attribute getter function |
Definition at line 993 of file GraphAttributes.h.
|
inline |
Returns the label of edge e
.
Definition at line 759 of file GraphAttributes.h.
|
inline |
Returns the label of edge e
.
Definition at line 750 of file GraphAttributes.h.
|
inline |
Returns the label of node v
.
Definition at line 558 of file GraphAttributes.h.
|
inline |
Returns the label of node v
.
Definition at line 549 of file GraphAttributes.h.
|
inline |
Computes the bounding rectangle for each node.
Rectangle | is the kind of rectangle that should be created. |
boundingBoxes | is assigned the bounding rectangle for each node. |
Definition at line 1090 of file GraphAttributes.h.
Returns a DPoint corresponding to the x- and y-coordinates of v
.
Definition at line 1044 of file GraphAttributes.h.
|
inline |
Removes edge e
from basic graph n
.
Definition at line 862 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.
|
virtual |
Rotates the layout by 90 degree (in counter-clockwise direction) around the origin.
|
virtual |
Rotates the layout by 90 degree (in clockwise direction) around the origin.
|
inlinevirtual |
Scales the layout by s
.
If scaleNodes
is true, node sizes are scaled as well.
s | is the scaling factor for both x- and y-coordinates. |
scaleNodes | determines if nodes size are scaled as well (true) or not. |
Definition at line 896 of file GraphAttributes.h.
|
virtual |
Scales the layout by (sx
,sy
).
If scaleNodes
is true, node sizes are scaled as well.
sx | is the scaling factor for x-coordinates. |
sy | is the scaling factor for y-coordinates. |
scaleNodes | determines if nodes size are scaled as well (true) or not. |
Reimplemented in ogdf::ClusterGraphAttributes.
|
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
).
s | is the scaling factor for both x- and y-coordinates. |
dx | is the translation in x-direction. |
dy | is the translation in y-direction. |
scaleNodes | determines if nodes size are scaled as well (true) or not. |
Definition at line 960 of file GraphAttributes.h.
|
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
).
sx | is the scaling factor for x-coordinates. |
sy | is the scaling factor for y-coordinates. |
dx | is the translation in x-direction. |
dy | is the translation in y-direction. |
scaleNodes | determines if nodes size are scaled as well (true) or not. |
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
.
Returns the shape type of node v
.
Definition at line 432 of file GraphAttributes.h.
Returns the shape type of node v
.
Definition at line 423 of file GraphAttributes.h.
Returns the stroke color of edge e
.
Definition at line 723 of file GraphAttributes.h.
Returns the stroke color of edge e
.
Definition at line 714 of file GraphAttributes.h.
Returns the stroke color of node v
.
Definition at line 468 of file GraphAttributes.h.
Returns the stroke color of node v
.
Definition at line 459 of file GraphAttributes.h.
|
inline |
Returns the stroke type of edge e
.
Definition at line 705 of file GraphAttributes.h.
|
inline |
Returns the stroke type of edge e
.
Definition at line 696 of file GraphAttributes.h.
|
inline |
Returns the stroke type of node v
.
Definition at line 450 of file GraphAttributes.h.
|
inline |
Returns the stroke type of node v
.
Definition at line 441 of file GraphAttributes.h.
|
inline |
Returns the stroke width of edge e
.
Definition at line 741 of file GraphAttributes.h.
|
inline |
Returns the stroke width of edge e
.
Definition at line 732 of file GraphAttributes.h.
|
inline |
Returns the stroke width of node v
.
Definition at line 486 of file GraphAttributes.h.
|
inline |
Returns the stroke width of node v
.
Definition at line 477 of file GraphAttributes.h.
|
inline |
Returns the edgesubgraph value of an edge e
.
Definition at line 831 of file GraphAttributes.h.
|
inline |
Returns the edgesubgraph value of an edge e
.
Definition at line 822 of file GraphAttributes.h.
|
inline |
Returns the template name of node v
.
Definition at line 576 of file GraphAttributes.h.
|
inline |
Returns the template name of node v
.
Definition at line 567 of file GraphAttributes.h.
void ogdf::GraphAttributes::transferToCopy | ( | GraphAttributes & | copyAttr | ) | const |
Copies attributes of this to copyAttr
.
Only attributes which are enabled in both this and copyAttr
are copied. The edges of copyAttr
get attributes associated with the respective original edge. Bend points, however, are only transferred to the first edge in the chain of copy edges. Bend points of all other copy edges in the chain are cleared.
copyAttr
is associated with a GraphCopy, which is a copy of the graph that this GraphAttributes is associated with.copyAttr | is the GraphAttributes of the GraphCopy. |
void ogdf::GraphAttributes::transferToOriginal | ( | GraphAttributes & | origAttr | ) | const |
Copies attributes of this to origAttr
.
Only attributes which are enabled in both this and origAttr
are copied. The edges of origAttr
get attributes associated with the respective first edge in the chain of copy edges. Both dummy nodes and bends between dummy nodes are added as bends to origAttr
.
origAttr
is associated with.origAttr | is the GraphAttributes of the original graph. |
|
virtual |
Translates the layout by (dx
,dy
).
dx | is the translation in x-direction. |
dy | is the translation in y-direction. |
Reimplemented in ogdf::ClusterGraphAttributes.
|
virtual |
Translates the layout such that the lower left corner is at (0,0).
|
inline |
Returns the type of edge e
.
Definition at line 813 of file GraphAttributes.h.
|
inline |
Returns the type of edge e
.
Definition at line 804 of file GraphAttributes.h.
|
inline |
Returns the type of node v
.
Definition at line 612 of file GraphAttributes.h.
|
inline |
Returns the type of node v
.
Definition at line 603 of file GraphAttributes.h.
|
inline |
Returns the weight of node v
.
Definition at line 594 of file GraphAttributes.h.
|
inline |
Returns the weight of node v
.
Definition at line 585 of file GraphAttributes.h.
|
inline |
Returns a reference to the node array #m_width.
Definition at line 378 of file GraphAttributes.h.
|
inline |
Returns a reference to the node array m_width.
Definition at line 369 of file GraphAttributes.h.
|
inline |
Returns the width of the bounding box of node v
.
Definition at line 360 of file GraphAttributes.h.
|
inline |
Returns the width of the bounding box of node v
.
Definition at line 351 of file GraphAttributes.h.
|
inline |
Returns the x-coordinate of node v
.
Definition at line 250 of file GraphAttributes.h.
|
inline |
Returns the x-coordinate of node v
.
Definition at line 241 of file GraphAttributes.h.
|
inline |
Returns the label x-coordinate of node v
.
Definition at line 304 of file GraphAttributes.h.
|
inline |
Returns the label x-coordinate of node v
.
Definition at line 295 of file GraphAttributes.h.
|
inline |
Returns the y-coordinate of node v
.
Definition at line 268 of file GraphAttributes.h.
|
inline |
Returns the y-coordinate of node v
.
Definition at line 259 of file GraphAttributes.h.
|
inline |
Returns the label y-coordinate of node v
.
Definition at line 322 of file GraphAttributes.h.
|
inline |
Returns the label y-coordinate of node v
.
Definition at line 313 of file GraphAttributes.h.
|
inline |
Returns the z-coordinate of node v
.
Definition at line 286 of file GraphAttributes.h.
|
inline |
Returns the z-coordinate of node v
.
Definition at line 277 of file GraphAttributes.h.
|
inline |
Returns the label z-coordinate of node v
.
Definition at line 341 of file GraphAttributes.h.
|
inline |
Returns the label z-coordinate of node v
.
Definition at line 331 of file GraphAttributes.h.
|
static |
Enables all available flags.
Definition at line 166 of file GraphAttributes.h.
|
static |
Corresponds to edge attribute arrowType(edge).
Definition at line 140 of file GraphAttributes.h.
|
static |
Corresponds to edge attribute doubleWeight(edge).
Definition at line 122 of file GraphAttributes.h.
|
static |
Corresponds to edge attribute bends(edge).
Definition at line 116 of file GraphAttributes.h.
|
static |
Corresponds to edge attribute intWeight(edge).
Definition at line 119 of file GraphAttributes.h.
|
static |
Corresponds to edge attribute label(edge).
Definition at line 125 of file GraphAttributes.h.
|
static |
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).
Definition at line 143 of file GraphAttributes.h.
|
static |
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge, int) const, and removeSubGraph(edge, int).
Definition at line 154 of file GraphAttributes.h.
|
static |
Corresponds to edge attribute type(edge).
Definition at line 131 of file GraphAttributes.h.
|
protected |
bit vector of currently used attributes
Definition at line 104 of file GraphAttributes.h.
list of bend points of an edge
Definition at line 93 of file GraphAttributes.h.
|
protected |
whether or not the graph is directed
Definition at line 70 of file GraphAttributes.h.
|
protected |
(real number) weight of an edge
Definition at line 100 of file GraphAttributes.h.
arrow type of an edge
Definition at line 95 of file GraphAttributes.h.
|
protected |
label of an edge
Definition at line 94 of file GraphAttributes.h.
stroke of an edge
Definition at line 96 of file GraphAttributes.h.
|
protected |
type of an edge (association or generalization)
Definition at line 101 of file GraphAttributes.h.
|
protected |
height of a nodes's bounding box
Definition at line 80 of file GraphAttributes.h.
|
protected |
(integer) weight of an edge
Definition at line 99 of file GraphAttributes.h.
fill of a node
Definition at line 84 of file GraphAttributes.h.
|
protected |
user ID of a node
Definition at line 88 of file GraphAttributes.h.
|
protected |
(integer) weight of a node
Definition at line 89 of file GraphAttributes.h.
|
protected |
label of a node
Definition at line 82 of file GraphAttributes.h.
|
protected |
x-coordinate of a node label
Definition at line 76 of file GraphAttributes.h.
|
protected |
y-coordinate of a node label
Definition at line 77 of file GraphAttributes.h.
|
protected |
z-coordinate of a node label
Definition at line 78 of file GraphAttributes.h.
shape of a node
Definition at line 81 of file GraphAttributes.h.
stroke of a node
Definition at line 83 of file GraphAttributes.h.
|
protected |
name of template of a node
Definition at line 85 of file GraphAttributes.h.
|
protected |
associated graph
Definition at line 68 of file GraphAttributes.h.
|
protected |
is element of subgraphs given by bitvector
Definition at line 102 of file GraphAttributes.h.
|
protected |
type (vertex, dummy, generalizationMerger)
Definition at line 90 of file GraphAttributes.h.
|
protected |
width of a node's bounding box
Definition at line 79 of file GraphAttributes.h.
|
protected |
x-coordinate of a node
Definition at line 73 of file GraphAttributes.h.
|
protected |
y-coordinate of a node
Definition at line 74 of file GraphAttributes.h.
|
protected |
z-coordinate of a node
Definition at line 75 of file GraphAttributes.h.
|
static |
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node).
Definition at line 113 of file GraphAttributes.h.
|
static |
Corresponds to node attribute idNode(node).
Definition at line 137 of file GraphAttributes.h.
|
static |
Corresponds to node attribute label(node).
Definition at line 128 of file GraphAttributes.h.
|
static |
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).
Definition at line 163 of file GraphAttributes.h.
|
static |
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node), fillPattern(node), fillColor(node), and fillBgColor(node).
Definition at line 147 of file GraphAttributes.h.
|
static |
Corresponds to node attribute templateNode(node).
Definition at line 150 of file GraphAttributes.h.
|
static |
Corresponds to node attribute type(node).
Definition at line 134 of file GraphAttributes.h.
|
static |
Corresponds to node attribute weight(node).
Definition at line 157 of file GraphAttributes.h.
|
static |
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only.
Definition at line 160 of file GraphAttributes.h.