303 return m_nodeLabelPosX[v];
312 return m_nodeLabelPosX[v];
321 return m_nodeLabelPosY[v];
330 return m_nodeLabelPosY[v];
340 return m_nodeLabelPosZ[v];
350 return m_nodeLabelPosZ[v];
431 return m_nodeShape[v];
440 return m_nodeShape[v];
449 return m_nodeStroke[v].m_type;
458 return m_nodeStroke[v].m_type;
467 return m_nodeStroke[v].m_color;
476 return m_nodeStroke[v].m_color;
485 return m_nodeStroke[v].m_width;
494 return m_nodeStroke[v].m_width;
503 return m_nodeFill[v].m_pattern;
512 return m_nodeFill[v].m_pattern;
521 return m_nodeFill[v].m_color;
530 return m_nodeFill[v].m_color;
539 return m_nodeFill[v].m_bgColor;
548 return m_nodeFill[v].m_bgColor;
557 return m_nodeLabel[v];
566 return m_nodeLabel[v];
575 return m_nodeTemplate[v];
584 return m_nodeTemplate[v];
593 return m_nodeIntWeight[v];
602 return m_nodeIntWeight[v];
611 return m_vType.
valid() ? m_vType[v] : Graph::NodeType::vertex;
631 return m_nodeId[v] == -1 ? v->
index() : m_nodeId[v];
642 if (m_nodeId[v] == -1) {
643 m_nodeId[v] = v->
index();
686 return m_edgeArrow[e];
695 return m_edgeArrow[e];
704 return m_edgeStroke[e].m_type;
713 return m_edgeStroke[e].m_type;
722 return m_edgeStroke[e].m_color;
731 return m_edgeStroke[e].m_color;
740 return m_edgeStroke[e].m_width;
749 return m_edgeStroke[e].m_width;
758 return m_edgeLabel[e];
767 return m_edgeLabel[e];
776 return m_intWeight[e];
785 return m_intWeight[e];
794 return m_doubleWeight[e];
803 return m_doubleWeight[e];
812 return m_eType.
valid() ? m_eType[e] : Graph::EdgeType::association;
830 return m_subGraph[e];
839 return m_subGraph[e];
850 return (m_subGraph[e] & (1 << n)) != 0;
861 m_subGraph[e] |= (1 << n);
872 m_subGraph[e] &= ~(1 << n);
891 virtual void scale(
double sx,
double sy,
bool scaleNodes =
true);
902 virtual void scale(
double s,
bool scaleNodes =
true) {
scale(s, s, scaleNodes); }
954 bool scaleNodes =
true);
967 scaleAndTranslate(s, s, dx, dy, scaleNodes);
1001 if (constGraph().numberOfNodes() == 0) {
1005 T
firstAttr = (this->*attribute)(*constGraph().nodes.begin());
1006 for (
node n : constGraph().nodes) {
1007 if ((this->*attribute)(n) !=
firstAttr) {
1022 template<
typename T>
1025 if (constGraph().numberOfEdges() == 0) {
1029 T
firstAttr = (this->*attribute)(*constGraph().edges.begin());
1030 for (
edge e : constGraph().edges) {
1031 if ((this->*attribute)(e) !=
firstAttr) {
1095 template<
class Rectangle = DRect>
1097 for (
node v : constGraph().nodes) {
Declaration and implementation of EdgeArray class.
Declares class LayoutStandards which specifies default / standard values used in graph layouts.
Declaration and implementation of NodeArray class.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Colors represented as RGBA values.
Rectangles with real coordinates.
Dynamic arrays indexed with edges.
bool valid() const
Returns true iff the array is associated with a graph.
Class for the representation of edges.
Polylines with PointType points.
Stores additional attributes of a graph (like layout information).
bool isUniform(long attributes) const
Check whether all of the attributes associated with the bitflags in attributes (that are also enabled...
NodeArray< double > m_z
z-coordinate of a node
virtual ~GraphAttributes()
Graph::EdgeType type(edge e) const
Returns the type of edge e.
int hierarchyList(List< List< edge > * > &list) const
Returns a list of all inheritance hierarchies in the graph.
NodeArray< double > m_nodeLabelPosZ
z-coordinate of a node label
DPolyline & bends(edge e)
Returns the list of bend points of edge e.
static const long edgeLabel
Corresponds to edge attribute label(edge).
EdgeArrow arrowType(edge e) const
Returns the arrow type of edge e.
EdgeArray< EdgeArrow > m_edgeArrow
arrow type of an edge
EdgeArray< double > m_doubleWeight
(real number) weight of an edge
void init(long attr)
Re-initializes the graph attributes while maintaining the associated graph.
string & label(node v)
Returns the label of node v.
void copyNodeAttributes(GraphAttributes &toAttr, node vFrom, node vTo, long attrs) const
Copies all attributes attrs of vFrom to toAttr for vTo.
EdgeArray< DPolyline > m_bends
list of bend points of an edge
static const long edgeArrow
Corresponds to edge attribute arrowType(edge).
GraphAttributes & operator=(const GraphAttributes &)=default
Copy assignment operator.
EdgeArray< uint32_t > m_subGraph
is element of subgraphs given by bitvector
NodeArray< string > m_nodeTemplate
name of template of a node
NodeArray< Fill > m_nodeFill
fill of a node
int weight(node v) const
Returns the weight of node v.
bool isUniformForNodes(NodeAttributeGetter< T > attribute) const
Checks whether a certain attribute has the same value for all nodes.
Color & fillColor(node v)
Returns the fill color of node v.
T(GraphAttributes::*)(node) const NodeAttributeGetter
type of node attribute getter functions
const Color & strokeColor(edge e) const
Returns the stroke color of edge e.
const NodeArray< double > & height() const
Returns a reference to the node array m_height.
NodeArray< Graph::NodeType > m_vType
type (vertex, dummy, generalizationMerger)
StrokeType strokeType(edge e) const
Returns the stroke type of edge e.
void removeUnnecessaryBendsHV()
Removes unnecessary bend points in orthogonal segements.
Graph::NodeType & type(node v)
Returns the type of node v.
virtual void scaleAndTranslate(double s, double dx, double dy, bool scaleNodes=true)
Scales the layout by s and then translates it by (dx,dy).
GraphAttributes(const GraphAttributes &)=default
Copy constructor.
bool isAssociationClass(node v) const
Returns true iff v represents an association class.
void setAllWidth(double w)
Sets the width of all nodes to w.
double y(node v) const
Returns the y-coordinate of node v.
virtual void rotateLeft90()
Rotates the layout by 90 degree (in counter-clockwise direction) around the origin.
double & zLabel(node v)
Returns the label z-coordinate of node v.
int intWeight(edge e) const
Returns the (integer) weight of edge e.
double height(node v) const
Returns the height of the bounding box of node v.
void transferToCopy(GraphAttributes ©Attr) const
Copies attributes of this to copyAttr.
bool directed() const
Returns if the graph is directed.
const string & label(node v) const
Returns the label of node v.
virtual void rotateRight90()
Rotates the layout by 90 degree (in clockwise direction) around the origin.
FillPattern & fillPattern(node v)
Returns the fill pattern of node v.
double x(node v) const
Returns the x-coordinate of node v.
EdgeArray< Graph::EdgeType > m_eType
type of an edge (association or generalization)
const Color & fillBgColor(node v) const
Returns the background color of fill patterns for node v.
const Graph * m_pGraph
associated graph
void addSubGraph(edge e, int n)
Adds edge e to basic graph n.
virtual void flipHorizontal()
Flips the layout horizontally within its bounding box.
virtual void flipHorizontal(const DRect &box)
Flips the (whole) layout horizontally such that the part in box remains in this area.
void destroyAttributes(long attr)
Disables attributes specified by attr and releases available memory.
static const long edgeStyle
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).
NodeArray< double > m_x
x-coordinate of a node
const Graph & constGraph() const
Returns a reference to the associated graph.
virtual void init(const Graph &G, long attr)
Initializes the graph attributes for graph G.
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).
const string & label(edge e) const
Returns the label of edge e.
double width(node v) const
Returns the width of the bounding box of node v.
static const long threeD
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only.
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
NodeArray< double > m_height
height of a nodes's bounding box
int & idNode(node v)
Returns the user ID of node v.
float & strokeWidth(node v)
Returns the stroke width of node v.
double & z(node v)
Returns the z-coordinate of node v.
virtual void translate(double dx, double dy)
Translates the layout by (dx,dy).
static const long all
Enables all available flags.
void nodeBoundingBoxes(NodeArray< Rectangle > &boundingBoxes) const
Computes the bounding rectangle for each node.
static const long nodeLabelPosition
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).
virtual DRect boundingBox() const
Returns the bounding box of the graph.
EdgeArray< int > m_intWeight
(integer) weight of an edge
NodeArray< int > m_nodeId
user ID of a node
Graph::EdgeType & type(edge e)
Returns the type of edge e.
uint32_t subGraphBits(edge e) const
Returns the edgesubgraph value of an edge e.
Graph::NodeType type(node v) const
Returns the type of node v.
GraphAttributes(const Graph &G, long attr=nodeGraphics|edgeGraphics)
Constructs graph attributes associated with the graph G.
float strokeWidth(edge e) const
Returns the stroke width of edge e.
double & x(node v)
Returns the x-coordinate of node v.
StrokeType strokeType(node v) const
Returns the stroke type of node v.
int & intWeight(edge e)
Returns the (integer) weight of edge e.
NodeArray< double > m_y
y-coordinate of a node
EdgeArrow & arrowType(edge e)
Returns the arrow type of edge e.
long attributes() const
Returns currently accessible attributes.
float & strokeWidth(edge e)
Returns the stroke width of edge e.
bool & directed()
Returns if the graph is directed.
double xLabel(node v) const
Returns the label x-coordinate of node v.
virtual void flipVertical(const DRect &box)
Flips the (whole) layout vertically such that the part in box remains in this area.
Color & strokeColor(edge e)
Returns the stroke color of edge e.
bool inSubGraph(edge e, int n) const
Checks whether edge e belongs to basic graph n.
double & yLabel(node v)
Returns the label y-coordinate of node v.
NodeArray< double > m_nodeLabelPosX
x-coordinate of a node label
static const long nodeLabel
Corresponds to node attribute label(node).
double & y(node v)
Returns the y-coordinate of node v.
double yLabel(node v) const
Returns the label y-coordinate of node v.
Color & strokeColor(node v)
Returns the stroke color of node v.
double & height(node v)
Returns the height of the bounding box of node v.
static const long nodeTemplate
Corresponds to node attribute templateNode(node).
static const long nodeId
Corresponds to node attribute idNode(node).
int idNode(node v) const
Returns the user ID of node v.
int & weight(node v)
Returns the weight of node v.
void transferToOriginal(GraphAttributes &origAttr) const
Copies attributes of this to origAttr.
void setAllHeight(double h)
Sets the height of all nodes to h.
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
EdgeArray< string > m_edgeLabel
label of an edge
static const long edgeType
Corresponds to edge attribute type(edge).
FillPattern fillPattern(node v) const
Returns the fill pattern of node v.
void copyEdgeAttributes(GraphAttributes &toAttr, edge eFrom, edge eTo, long attrs) const
Copies all attributes attrs except bends (!) of eFrom to toAttr for eTo.
static const long nodeWeight
Corresponds to node attribute weight(node).
const Color & fillColor(node v) const
Returns the fill color of node v.
void addAttributes(long attr)
Enables attributes specified by attr and allocates required memory.
double zLabel(node v) const
Returns the label z-coordinate of node v.
NodeArray< double > m_nodeLabelPosY
y-coordinate of a node label
void removeSubGraph(edge e, int n)
Removes edge e from basic graph n.
void addNodeCenter2Bends(int mode=1)
Adds additional bend points to all edges for connecting their endpoints.
const NodeArray< double > & width() const
Returns a reference to the node array m_width.
const Color & strokeColor(node v) const
Returns the stroke color of node v.
Shape shape(node v) const
Returns the shape type of node v.
bool isUniformForEdges(EdgeAttributeGetter< T > attribute) const
Checks whether a certain attribute has the same value for all edges.
float strokeWidth(node v) const
Returns the stroke width of node v.
NodeArray< Stroke > m_nodeStroke
stroke of a node
void clearAllBends()
Removes all edge bends.
StrokeType & strokeType(node v)
Returns the stroke type of node v.
NodeArray< double > m_width
width of a node's bounding box
long m_attributes
bit vector of currently used attributes
static const long nodeStyle
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node),...
double & width(node v)
Returns the width of the bounding box of node v.
NodeArray< double > & height()
Returns a reference to the node array m_height.
StrokeType & strokeType(edge e)
Returns the stroke type of edge e.
bool m_directed
whether or not the graph is directed
NodeArray< double > & width()
Returns a reference to the node array #m_width.
int hierarchyList(List< List< node > * > &list) const
Returns a list of all inheritance hierarchies in the graph.
double & doubleWeight(edge e)
Returns the (real number) weight of edge e.
Shape & shape(node v)
Returns the shape type of node v.
static const long edgeSubGraphs
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge,...
const string & templateNode(node v) const
Returns the template name of node v.
const DPolyline & bends(edge e) const
Returns the list of bend points of edge e.
virtual void scale(double sx, double sy, bool scaleNodes=true)
Scales the layout by (sx,sy).
virtual void flipVertical()
Flips the layout vertically within its bounding box.
static const long nodeType
Corresponds to node attribute type(node).
static const long edgeGraphics
Corresponds to edge attribute bends(edge).
DPoint point(node v) const
Returns a DPoint corresponding to the x- and y-coordinates of v.
NodeArray< Shape > m_nodeShape
shape of a node
virtual void translateToNonNeg()
Translates the layout such that the lower left corner is at (0,0).
bool has(long attr) const
Returns true iff all attributes in attr are available.
GraphAttributes()
Constructs graph attributes for no associated graph (default constructor).
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
double & xLabel(node v)
Returns the label x-coordinate of node v.
NodeArray< int > m_nodeIntWeight
(integer) weight of a node
NodeArray< string > m_nodeLabel
label of a node
string & label(edge e)
Returns the label of edge e.
static const long nodeGraphics
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node).
Color & fillBgColor(node v)
Returns the background color of fill patterns for node v.
string & templateNode(node v)
Returns the template name of node v.
T(GraphAttributes::*)(edge) const EdgeAttributeGetter
type of edge attribute getter functions
uint32_t & subGraphBits(edge e)
Returns the edgesubgraph value of an edge e.
double z(node v) const
Returns the z-coordinate of node v.
EdgeArray< Stroke > m_edgeStroke
stroke of an edge
virtual void scale(double s, bool scaleNodes=true)
Scales the layout by s.
Data type for general directed graphs (adjacency list representation).
NodeType
The type of nodes.
EdgeType
The type of edges (only used in derived classes).
Doubly linked lists (maintaining the length of the list).
Dynamic arrays indexed with nodes.
bool valid() const
Returns true iff the array is associated with a graph.
Class for the representation of nodes.
int index() const
Returns the (unique) node index.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition of exception classes.
FillPattern
Fill patterns.
StrokeType
Line types of strokes.
Shape
Types for node shapes.
EdgeArrow
Types for edge arrows.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.