206 inline bool has(
long attr)
const {
207 return (m_attributes & attr) == attr;
218 virtual void init(
const Graph &G,
long attr);
222 void init(
long attr);
225 void addAttributes(
long attr);
228 void destroyAttributes(
long attr);
323 return m_nodeLabelPosX[v];
332 return m_nodeLabelPosX[v];
342 return m_nodeLabelPosY[v];
351 return m_nodeLabelPosY[v];
362 return m_nodeLabelPosZ[v];
372 return m_nodeLabelPosZ[v];
458 return m_nodeShape[v];
467 return m_nodeShape[v];
477 return m_nodeStroke[v].m_type;
486 return m_nodeStroke[v].m_type;
496 return m_nodeStroke[v].m_color;
505 return m_nodeStroke[v].m_color;
515 return m_nodeStroke[v].m_width;
524 return m_nodeStroke[v].m_width;
533 return m_nodeFill[v].m_pattern;
542 return m_nodeFill[v].m_pattern;
551 return m_nodeFill[v].m_color;
560 return m_nodeFill[v].m_color;
570 return m_nodeFill[v].m_bgColor;
579 return m_nodeFill[v].m_bgColor;
589 return m_nodeLabel[v];
598 return m_nodeLabel[v];
608 return m_nodeTemplate[v];
617 return m_nodeTemplate[v];
627 return m_nodeIntWeight[v];
636 return m_nodeIntWeight[v];
716 return m_edgeArrow[e];
725 return m_edgeArrow[e];
735 return m_edgeStroke[e].m_type;
744 return m_edgeStroke[e].m_type;
754 return m_edgeStroke[e].m_color;
763 return m_edgeStroke[e].m_color;
773 return m_edgeStroke[e].m_width;
782 return m_edgeStroke[e].m_width;
792 return m_edgeLabel[e];
801 return m_edgeLabel[e];
811 return m_intWeight[e];
820 return m_intWeight[e];
830 return m_doubleWeight[e];
839 return m_doubleWeight[e];
868 return m_subGraph[e];
877 return m_subGraph[e];
889 return (m_subGraph[e] & (1 << n)) != 0;
901 m_subGraph[e] |= (1 << n);
913 m_subGraph[e] &= ~(1 << n);
932 virtual void scale(
double sx,
double sy,
bool scaleNodes =
true);
943 virtual void scale(
double s,
bool scaleNodes =
true) {
scale(s, s, scaleNodes); }
950 virtual void translate(
double dx,
double dy);
953 virtual void translateToNonNeg();
967 virtual void flipVertical(
const DRect &box);
981 virtual void flipHorizontal(
const DRect &box);
994 virtual void scaleAndTranslate(
double sx,
double sy,
double dx,
double dy,
bool scaleNodes =
true);
1007 scaleAndTranslate(s, s, dx, dy, scaleNodes);
1011 virtual void rotateRight90();
1014 virtual void rotateLeft90();
1060 virtual DRect boundingBox()
const;
1068 template<
class Rectangle = DRect>
1070 for (
node v : constGraph().nodes) {
1071 double vHalfWidth = width(v) / 2.0;
1072 double vHalfHeight = height(v) / 2.0;
1073 boundingBoxes[v] = Rectangle(x(v) - vHalfWidth, y(v) - vHalfHeight,
1074 x(v) + vHalfWidth, y(v) + vHalfHeight);
1082 void setAllWidth(
double w);
1088 void setAllHeight(
double h);
1094 void clearAllBends();
1106 void removeUnnecessaryBendsHV();
1120 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.
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.
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
bool has(long attr) const
Returns true iff all attributes in attr are available.
static const long edgeLabel
Corresponds to edge attribute label(edge).
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.
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
const Graph * m_pGraph
associated graph
virtual void flipVertical()
Flips the layout vertically within its bounding box.
static const long nodeId
Corresponds to node attribute idNode(node).
StrokeType & strokeType(node v)
Returns the stroke type of node v.
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.
static const long nodeTemplate
Corresponds to node attribute templateNode(node).
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 long 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.
void nodeBoundingBoxes(NodeArray< Rectangle > &boundingBoxes) const
Computes the bounding rectangle for each node.
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 long nodeLabelPosition
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).
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.
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.
static const long all
Enables all available flags.
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 long nodeLabel
Corresponds to node attribute label(node).
static const long nodeWeight
Corresponds to node attribute weight(node).
NodeArray< int > m_nodeId
user ID of a node
EdgeType
The type of edges (only used in derived classes).
DPolyline & bends(edge e)
Returns the list of bend points of edge e.
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
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.
DPoint point(node v) const
Returns a DPoint corresponding to the x- and y-coordinates of 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.
static const long threeD
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only...
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.
Polylines with PointType points.
static const long edgeGraphics
Corresponds to edge attribute bends(edge).
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.
static const long nodeType
Corresponds to node attribute type(node).
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.
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 long edgeArrow
Corresponds to edge attribute arrowType(edge).
static const long edgeSubGraphs
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge, int) const, and removeSubGraph(edge, int).
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
The namespace for all OGDF objects.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment, DPolygon, DRect, DIntersectableRect.
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 long edgeType
Corresponds to edge attribute type(edge).
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.
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
static const long nodeGraphics
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node).
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.
static const long edgeStyle
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).