|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
200 inline bool has(
long attr)
const {
return (m_attributes & attr) == attr; }
210 virtual void init(
const Graph& G,
long attr);
214 void init(
long attr);
217 void addAttributes(
long attr);
220 void destroyAttributes(
long attr);
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];
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];
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); }
909 virtual void translate(
double dx,
double dy);
912 virtual void translateToNonNeg();
926 virtual void flipVertical(
const DRect& box);
940 virtual void flipHorizontal(
const DRect& box);
953 virtual void scaleAndTranslate(
double sx,
double sy,
double dx,
double dy,
954 bool scaleNodes =
true);
967 scaleAndTranslate(s, s, dx, dy, scaleNodes);
971 virtual void rotateRight90();
974 virtual void rotateLeft90();
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) {
1047 bool isUniform(
long attributes)
const;
1087 virtual DRect boundingBox()
const;
1095 template<
class Rectangle = DRect>
1097 for (
node v : constGraph().nodes) {
1098 double vHalfWidth = width(v) / 2.0;
1099 double vHalfHeight = height(v) / 2.0;
1100 boundingBoxes[v] = Rectangle(x(v) - vHalfWidth, y(v) - vHalfHeight, x(v) + vHalfWidth,
1101 y(v) + vHalfHeight);
1109 void setAllWidth(
double w);
1115 void setAllHeight(
double h);
1121 void clearAllBends();
1133 void removeUnnecessaryBendsHV();
1147 void addNodeCenter2Bends(
int mode = 1);
double & height(node v)
Returns the height of the bounding box of node v.
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
double & yLabel(node v)
Returns the label y-coordinate of node v.
Colors represented as RGBA values.
The namespace for all OGDF objects.
Stores additional attributes of a graph (like layout information).
StrokeType & strokeType(node v)
Returns the stroke type of node v.
int & idNode(node v)
Returns the user ID of node v.
const string & label(edge e) const
Returns the label of edge e.
static const long all
Enables all available flags.
NodeArray< Shape > m_nodeShape
shape of a node
Includes declaration of graph class.
NodeArray< double > m_y
y-coordinate of a node
Declaration of basic types for graphics.
StrokeType
Line types of strokes.
const Color & fillBgColor(node v) const
Returns the background color of fill patterns for node v.
NodeArray< double > m_nodeLabelPosZ
z-coordinate of a node label
double zLabel(node v) const
Returns the label z-coordinate of node v.
const Color & fillColor(node v) const
Returns the fill color of node v.
NodeArray< string > m_nodeLabel
label of a node
long m_attributes
bit vector of currently used attributes
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
FillPattern fillPattern(node v) const
Returns the fill pattern of node v.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static const long edgeStyle
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).
static const long nodeStyle
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node),...
EdgeArrow arrowType(edge e) const
Returns the arrow type of edge e.
Color & strokeColor(node v)
Returns the stroke color of node v.
EdgeType
The type of edges (only used in derived classes).
int index() const
Returns the (unique) node index.
double z(node v) const
Returns the z-coordinate of node v.
double yLabel(node v) const
Returns the label y-coordinate of node v.
Color & fillBgColor(node v)
Returns the background color of fill patterns for node v.
Shape & shape(node v)
Returns the shape type of node v.
Graph::NodeType & type(node v)
Returns the type of node v.
Polylines with PointType points.
NodeArray< Fill > m_nodeFill
fill of a node
NodeArray< double > m_nodeLabelPosX
x-coordinate of a node label
double x(node v) const
Returns the x-coordinate of node v.
void removeSubGraph(edge e, int n)
Removes edge e from basic graph n.
bool isUniformForNodes(NodeAttributeGetter< T > attribute) const
Checks whether a certain attribute has the same value for all nodes.
long attributes() const
Returns currently accessible attributes.
const NodeArray< double > & width() const
Returns a reference to the node array m_width.
double & zLabel(node v)
Returns the label z-coordinate of node v.
void addSubGraph(edge e, int n)
Adds edge e to basic graph n.
T(GraphAttributes::*)(edge) const EdgeAttributeGetter
type of edge attribute getter functions
EdgeArray< Stroke > m_edgeStroke
stroke of an edge
double & z(node v)
Returns the z-coordinate of node v.
static const long nodeWeight
Corresponds to node attribute weight(node).
double & xLabel(node v)
Returns the label x-coordinate of node v.
EdgeArray< string > m_edgeLabel
label of an edge
bool directed() const
Returns if the graph is directed.
bool isUniformForEdges(EdgeAttributeGetter< T > attribute) const
Checks whether a certain attribute has the same value for all edges.
const Graph & constGraph() const
Returns a reference to the associated graph.
void nodeBoundingBoxes(NodeArray< Rectangle > &boundingBoxes) const
Computes the bounding rectangle for each node.
NodeArray< Graph::NodeType > m_vType
type (vertex, dummy, generalizationMerger)
float & strokeWidth(node v)
Returns the stroke width of node v.
static const long edgeLabel
Corresponds to edge attribute label(edge).
T(GraphAttributes::*)(node) const NodeAttributeGetter
type of node attribute getter functions
const NodeArray< double > & height() const
Returns a reference to the node array m_height.
DPolyline & bends(edge e)
Returns the list of bend points of edge e.
const Graph * m_pGraph
associated graph
const DPolyline & bends(edge e) const
Returns the list of bend points of edge e.
Graph::NodeType type(node v) const
Returns the type of node v.
EdgeArray< uint32_t > m_subGraph
is element of subgraphs given by bitvector
NodeArray< Stroke > m_nodeStroke
stroke of a node
int & weight(node v)
Returns the weight of node v.
StrokeType & strokeType(edge e)
Returns the stroke type of edge e.
EdgeElement * edge
The type of edges.
float strokeWidth(edge e) const
Returns the stroke width of edge e.
Shape shape(node v) const
Returns the shape type of node v.
double y(node v) const
Returns the y-coordinate of node v.
bool inSubGraph(edge e, int n) const
Checks whether edge e belongs to basic graph n.
Graph::EdgeType type(edge e) const
Returns the type of edge e.
int weight(node v) const
Returns the weight of node v.
static const long edgeType
Corresponds to edge attribute type(edge).
FillPattern & fillPattern(node v)
Returns the fill pattern of node v.
uint32_t subGraphBits(edge e) const
Returns the edgesubgraph value of an edge e.
Decralation of GraphElement and GraphList classes.
Rectangles with real coordinates.
static const long nodeTemplate
Corresponds to node attribute templateNode(node).
NodeArray< double > m_x
x-coordinate of a node
double & y(node v)
Returns the y-coordinate of node v.
string & label(node v)
Returns the label of node v.
NodeElement * node
The type of nodes.
static const long nodeLabelPosition
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).
double xLabel(node v) const
Returns the label x-coordinate of node v.
Color & strokeColor(edge e)
Returns the stroke color of edge e.
Doubly linked lists (maintaining the length of the list).
DPoint point(node v) const
Returns a DPoint corresponding to the x- and y-coordinates of v.
RegisteredArray for nodes, edges and adjEntries of a graph.
string & templateNode(node v)
Returns the template name of node v.
Data type for general directed graphs (adjacency list representation).
double height(node v) const
Returns the height of the bounding box of node v.
NodeArray< double > & height()
Returns a reference to the node array m_height.
EdgeArrow
Types for edge arrows.
NodeType
The type of nodes.
static const long nodeLabel
Corresponds to node attribute label(node).
Decralation of graph iterators.
StrokeType strokeType(edge e) const
Returns the stroke type of edge e.
NodeArray< string > m_nodeTemplate
name of template of a node
virtual void flipVertical()
Flips the layout vertically within its bounding box.
EdgeArrow & arrowType(edge e)
Returns the arrow type of edge e.
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
Color & fillColor(node v)
Returns the fill color of node v.
bool isAssociationClass(node v) const
Returns true iff v represents an association class.
EdgeArray< double > m_doubleWeight
(real number) weight of an edge
static const long edgeArrow
Corresponds to edge attribute arrowType(edge).
static const long edgeGraphics
Corresponds to edge attribute bends(edge).
static const long edgeSubGraphs
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge,...
float & strokeWidth(edge e)
Returns the stroke width of edge e.
Basic declarations, included by all source files.
bool & directed()
Returns if the graph is directed.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
NodeArray< double > m_z
z-coordinate of a node
const string & templateNode(node v) const
Returns the template name 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).
NodeArray< int > m_nodeIntWeight
(integer) weight 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.
NodeArray< int > m_nodeId
user ID of a node
double & width(node v)
Returns the width of the bounding box of node v.
NodeArray< double > m_width
width of a node's bounding box
Shape
Types for node shapes.
EdgeArray< EdgeArrow > m_edgeArrow
arrow type of an edge
Class for the representation of edges.
double & x(node v)
Returns the x-coordinate of node v.
int idNode(node v) const
Returns the user ID of node v.
Graph::EdgeType & type(edge e)
Returns the type of edge e.
double & doubleWeight(edge e)
Returns the (real number) weight of edge e.
int & intWeight(edge e)
Returns the (integer) weight of edge e.
uint32_t & subGraphBits(edge e)
Returns the edgesubgraph value of an edge e.
const Color & strokeColor(node v) const
Returns the stroke color of node v.
int intWeight(edge e) const
Returns the (integer) weight of edge e.
string & label(edge e)
Returns the label of edge e.
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
virtual void flipHorizontal()
Flips the layout horizontally within its bounding box.
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
NodeArray< double > m_nodeLabelPosY
y-coordinate of a node label
NodeArray< double > m_height
height of a nodes's bounding box
static const long nodeType
Corresponds to node attribute type(node).
FillPattern
Fill patterns.
Class for the representation of nodes.
NodeArray< double > & width()
Returns a reference to the node array #m_width.
static const long nodeGraphics
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node).
const Color & strokeColor(edge e) const
Returns the stroke color of edge e.
static const long nodeId
Corresponds to node attribute idNode(node).
EdgeArray< int > m_intWeight
(integer) weight of an edge
static const long threeD
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only.
StrokeType strokeType(node v) const
Returns the stroke type of node v.
const string & label(node v) const
Returns the label of node v.
bool has(long attr) const
Returns true iff all attributes in attr are available.
EdgeArray< Graph::EdgeType > m_eType
type of an edge (association or generalization)
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
EdgeArray< DPolyline > m_bends
list of bend points of an edge
float strokeWidth(node v) const
Returns the stroke width of node v.
double width(node v) const
Returns the width of the bounding box of node v.