197 inline bool has(
long attr)
const {
198 return (m_attributes & attr) == attr;
209 virtual void init(
const Graph &G,
long attr);
213 void init(
long attr);
216 void addAttributes(
long attr);
219 void destroyAttributes(
long attr);
314 return m_nodeLabelPosX[v];
323 return m_nodeLabelPosX[v];
333 return m_nodeLabelPosY[v];
342 return m_nodeLabelPosY[v];
353 return m_nodeLabelPosZ[v];
363 return m_nodeLabelPosZ[v];
449 return m_nodeShape[v];
458 return m_nodeShape[v];
468 return m_nodeStroke[v].m_type;
477 return m_nodeStroke[v].m_type;
487 return m_nodeStroke[v].m_color;
496 return m_nodeStroke[v].m_color;
506 return m_nodeStroke[v].m_width;
515 return m_nodeStroke[v].m_width;
524 return m_nodeFill[v].m_pattern;
533 return m_nodeFill[v].m_pattern;
542 return m_nodeFill[v].m_color;
551 return m_nodeFill[v].m_color;
561 return m_nodeFill[v].m_bgColor;
570 return m_nodeFill[v].m_bgColor;
580 return m_nodeLabel[v];
589 return m_nodeLabel[v];
599 return m_nodeTemplate[v];
608 return m_nodeTemplate[v];
618 return m_nodeIntWeight[v];
627 return m_nodeIntWeight[v];
700 return m_edgeArrow[e];
709 return m_edgeArrow[e];
719 return m_edgeStroke[e].m_type;
728 return m_edgeStroke[e].m_type;
738 return m_edgeStroke[e].m_color;
747 return m_edgeStroke[e].m_color;
757 return m_edgeStroke[e].m_width;
766 return m_edgeStroke[e].m_width;
776 return m_edgeLabel[e];
785 return m_edgeLabel[e];
795 return m_intWeight[e];
804 return m_intWeight[e];
814 return m_doubleWeight[e];
823 return m_doubleWeight[e];
852 return m_subGraph[e];
861 return m_subGraph[e];
873 return (m_subGraph[e] & (1 << n)) != 0;
885 m_subGraph[e] |= (1 << n);
897 m_subGraph[e] &= ~(1 << n);
916 virtual void scale(
double sx,
double sy,
bool scaleNodes =
true);
927 virtual void scale(
double s,
bool scaleNodes =
true) {
scale(s, s, scaleNodes); }
934 virtual void translate(
double dx,
double dy);
937 virtual void translateToNonNeg();
951 virtual void flipVertical(
const DRect &box);
965 virtual void flipHorizontal(
const DRect &box);
978 virtual void scaleAndTranslate(
double sx,
double sy,
double dx,
double dy,
bool scaleNodes =
true);
991 scaleAndTranslate(s, s, dx, dy, scaleNodes);
995 virtual void rotateRight90();
998 virtual void rotateLeft90();
1010 virtual DRect boundingBox()
const;
1016 void setAllWidth(
double w);
1022 void setAllHeight(
double h);
1028 void clearAllBends();
1040 void removeUnnecessaryBendsHV();
1054 void addNodeCenter2Bends(
int mode = 1);
bool & directed()
Returns if the graph is directed.
EdgeArrow & arrowType(edge e)
Returns the arrow type of edge e.
Color & strokeColor(edge e)
Returns the stroke color of edge e.
double width(node v) const
Returns the width of the bounding box of node v.
double & zLabel(node v)
Returns the label z-coordinate of node v.
static const int edgeGraphics
Corresponds to edge attribute bends(edge).
int & idNode(node v)
Returns the user ID of node v.
uint32_t & subGraphBits(edge e)
Returns the edgesubgraph value of an edge e.
EdgeArray< Stroke > m_edgeStroke
stroke of an edge
virtual ~GraphAttributes()
Data type for general directed graphs (adjacency list representation).
NodeArray< double > m_width
width of a node's bounding box
const Color & fillColor(node v) const
Returns the fill color of node v.
StrokeType & strokeType(edge e)
Returns the stroke type of edge e.
FillPattern fillPattern(node v) const
Returns the fill pattern of node v.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static const int threeD
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only...
static const int edgeStyle
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).
bool has(long attr) const
Returns true iff all attributes in attr are available.
NodeArray< double > m_z
z-coordinate of a node
bool m_directed
whether or not the graph is directed
virtual void scale(double s, bool scaleNodes=true)
Scales the layout by s.
const Color & strokeColor(node v) const
Returns the stroke color of node v.
Rectangles with real coordinates.
const Graph * m_pGraph
associated graph
virtual void flipVertical()
Flips the layout vertically within its bounding box.
static const int edgeType
Corresponds to edge attribute type(edge).
StrokeType & strokeType(node v)
Returns the stroke type of node v.
Polylines with real coordinates.
static const int nodeTemplate
Corresponds to node attribute templateNode(node).
static const int nodeGraphics
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node).
double & z(node v)
Returns the z-coordinate of node v.
Graph::NodeType & type(node v)
Returns the type of node v.
EdgeArray< Graph::EdgeType > m_eType
type of an edge (association or generalization)
double & xLabel(node v)
Returns the label x-coordinate of node v.
Declares class LayoutStandards which specifies default / standard values used in graph layouts...
string & label(edge e)
Returns the label of edge e.
Dynamic arrays indexed with edges.
bool directed() const
Returns if the graph is directed.
int weight(node v) const
Returns the weight of node v.
FillPattern
Fill patterns.
bool valid() const
Returns true iff the array is associated with a graph.
EdgeArrow
Types for edge arrows.
bool isAssociationClass(node v) const
Returns true iff v represents an association class.
string & label(node v)
Returns the label of node v.
const DPolyline & bends(edge e) const
Returns the list of bend points of edge e.
static const int nodeStyle
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node), fillPattern(node), fillColor(node), and fillBgColor(node).
EdgeArray< uint32_t > m_subGraph
is element of subgraphs given by bitvector
Color & strokeColor(node v)
Returns the stroke color of node v.
NodeArray< Stroke > m_nodeStroke
stroke of a node
double height(node v) const
Returns the height of the bounding box of node v.
double & y(node v)
Returns the y-coordinate of node v.
void removeSubGraph(edge e, int n)
Removes edge e from basic graph n.
double xLabel(node v) const
Returns the label x-coordinate of node v.
const string & label(edge e) const
Returns the label of edge e.
EdgeArray< EdgeArrow > m_edgeArrow
arrow type of an edge
static const int edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
bool inSubGraph(edge e, int n) const
Checks whether edge e belongs to basic graph n.
double y(node v) const
Returns the y-coordinate of node v.
string & templateNode(node v)
Returns the template name of node v.
static const int edgeLabel
Corresponds to edge attribute label(edge).
Shape
Types for node shapes.
NodeArray< double > m_nodeLabelPosZ
z-coordinate of a node label
NodeArray< string > m_nodeLabel
label of a node
long m_attributes
bit vector of currently used attributes
virtual void flipHorizontal()
Flips the layout horizontally within its bounding box.
Declaration and implementation of EdgeArray class.
const string & label(node v) const
Returns the label of node v.
Graph::EdgeType type(edge e) const
Returns the type of edge e.
NodeArray< Graph::NodeType > m_vType
type (vertex, dummy, generalizationMerger)
NodeArray< double > & height()
Returns a reference to the node array m_height.
static const int nodeId
Corresponds to node attribute idNode(node).
NodeArray< int > m_nodeId
user ID of a node
EdgeType
The type of edges (only used in derived classes).
static const int nodeType
Corresponds to node attribute type(node).
DPolyline & bends(edge e)
Returns the list of bend points of edge e.
static const int nodeLabel
Corresponds to node attribute label(node).
Colors represented as RGBA values.
Stores additional attributes of a graph (like layout information).
int intWeight(edge e) const
Returns the (integer) weight of edge e.
float & strokeWidth(edge e)
Returns the stroke width of edge e.
double & height(node v)
Returns the height of the bounding box of node v.
NodeArray< string > m_nodeTemplate
name of template of a node
Doubly linked lists (maintaining the length of the list).
Definition of exception classes.
NodeArray< int > m_nodeIntWeight
(integer) weight of a node
virtual void scaleAndTranslate(double s, double dx, double dy, bool scaleNodes=true)
Scales the layout by s and then translates it by (dx,dy).
NodeArray< double > m_nodeLabelPosX
x-coordinate of a node label
int & intWeight(edge e)
Returns the (integer) weight of edge e.
const string & templateNode(node v) const
Returns the template name of node v.
Class for the representation of edges.
double z(node v) const
Returns the z-coordinate of node v.
int & weight(node v)
Returns the weight of node v.
double x(node v) const
Returns the x-coordinate of node v.
long attributes() const
Returns currently accessible attributes.
Class for the representation of nodes.
bool valid() const
Returns true iff the array is associated with a graph.
NodeArray< double > m_x
x-coordinate of a node
const Graph & constGraph() const
Returns a reference to the associated graph.
Declaration and implementation of NodeArray class.
float strokeWidth(edge e) const
Returns the stroke width of edge e.
double zLabel(node v) const
Returns the label z-coordinate of node v.
const Color & fillBgColor(node v) const
Returns the background color of fill patterns for node v.
NodeArray< Shape > m_nodeShape
shape of a node
NodeArray< double > m_height
height of a nodes's bounding box
double & x(node v)
Returns the x-coordinate of node v.
StrokeType strokeType(node v) const
Returns the stroke type of node v.
EdgeArray< double > m_doubleWeight
(real number) weight of an edge
Graph::EdgeType & type(edge e)
Returns the type of edge e.
Color & fillColor(node v)
Returns the fill color of node v.
double yLabel(node v) const
Returns the label y-coordinate of node v.
StrokeType strokeType(edge e) const
Returns the stroke type of edge e.
const NodeArray< double > & height() const
Returns a reference to the node array m_height.
Graph::NodeType type(node v) const
Returns the type of node v.
static const int edgeSubGraphs
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge, int) const, and removeSubGraph(edge, int).
int idNode(node v) const
Returns the user ID of node v.
StrokeType
Line types of strokes.
double & width(node v)
Returns the width of the bounding box of node v.
const Color & strokeColor(edge e) const
Returns the stroke color of edge e.
EdgeArray< int > m_intWeight
(integer) weight of an edge
static const int edgeIntWeight
Corresponds to edge attribute intWeight(edge).
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
static const int edgeArrow
Corresponds to edge attribute arrowType(edge).
The namespace for all OGDF objects.
Declaration of classes DPoint, DPolyline, DLine, DRect, DIntersectableRect, DScaler.
float strokeWidth(node v) const
Returns the stroke width of node v.
NodeArray< double > m_nodeLabelPosY
y-coordinate of a node label
NodeArray< Fill > m_nodeFill
fill of a node
NodeType
The type of nodes.
static const int nodeLabelPosition
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).
double & yLabel(node v)
Returns the label y-coordinate of node v.
uint32_t subGraphBits(edge e) const
Returns the edgesubgraph value of an edge e.
float & strokeWidth(node v)
Returns the stroke width of node v.
EdgeArrow arrowType(edge e) const
Returns the arrow type of edge e.
NodeArray< double > m_y
y-coordinate of a node
Color & fillBgColor(node v)
Returns the background color of fill patterns for node v.
FillPattern & fillPattern(node v)
Returns the fill pattern of node v.
double & doubleWeight(edge e)
Returns the (real number) weight of edge e.
static const int nodeWeight
Corresponds to node attribute weight(node).
void addSubGraph(edge e, int n)
Adds edge e to basic graph n.
Shape shape(node v) const
Returns the shape type of node v.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
EdgeArray< DPolyline > m_bends
list of bend points of an edge
NodeArray< double > & width()
Returns a reference to the node array #m_width.
EdgeArray< string > m_edgeLabel
label of an edge
Shape & shape(node v)
Returns the shape type of node v.
const NodeArray< double > & width() const
Returns a reference to the node array m_width.