Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
GraphAttributes.h
Go to the documentation of this file.
1
36#pragma once
37
42#include <ogdf/basic/geometry.h>
43
44namespace ogdf {
45
47
67protected:
68 const Graph* m_pGraph;
69
71
72 // graphical representation of nodes
86
87 // other node attributes
91
92 // graphical representation of edges
97
98 // other edge attributes
103
105
106public:
111
113 static const long nodeGraphics;
114
116 static const long edgeGraphics;
117
119 static const long edgeIntWeight;
120
122 static const long edgeDoubleWeight;
123
125 static const long edgeLabel;
126
128 static const long nodeLabel;
129
131 static const long edgeType;
132
134 static const long nodeType;
135
137 static const long nodeId;
138
140 static const long edgeArrow;
141
143 static const long edgeStyle;
144
147 static const long nodeStyle;
148
150 static const long nodeTemplate;
151
154 static const long edgeSubGraphs;
155
157 static const long nodeWeight;
158
160 static const long threeD;
161
163 static const long nodeLabelPosition;
164
166 static const long all;
167
169
174
176
180
182
186 explicit GraphAttributes(const Graph& G, long attr = nodeGraphics | edgeGraphics);
187
190
193
194 virtual ~GraphAttributes() { }
195
197 long attributes() const { return m_attributes; }
198
200 inline bool has(long attr) const { return (m_attributes & attr) == attr; }
201
203
210 virtual void init(const Graph& G, long attr);
211
214 void init(long attr);
215
217 void addAttributes(long attr);
218
221
223 const Graph& constGraph() const { return *m_pGraph; }
224
226
230
232 bool directed() const { return m_directed; }
233
235 bool& directed() { return m_directed; }
236
238
242
244
247 double x(node v) const {
248 OGDF_ASSERT(has(nodeGraphics));
249 return m_x[v];
250 }
251
253
256 double& x(node v) {
257 OGDF_ASSERT(has(nodeGraphics));
258 return m_x[v];
259 }
260
262
265 double y(node v) const {
266 OGDF_ASSERT(has(nodeGraphics));
267 return m_y[v];
268 }
269
271
274 double& y(node v) {
275 OGDF_ASSERT(has(nodeGraphics));
276 return m_y[v];
277 }
278
280
283 double z(node v) const {
284 OGDF_ASSERT(has(threeD));
285 return m_z[v];
286 }
287
289
292 double& z(node v) {
293 OGDF_ASSERT(has(threeD));
294 return m_z[v];
295 }
296
298
301 double xLabel(node v) const {
302 OGDF_ASSERT(has(nodeLabelPosition));
303 return m_nodeLabelPosX[v];
304 }
305
307
310 double& xLabel(node v) {
311 OGDF_ASSERT(has(nodeLabelPosition));
312 return m_nodeLabelPosX[v];
313 }
314
316
319 double yLabel(node v) const {
320 OGDF_ASSERT(has(nodeLabelPosition));
321 return m_nodeLabelPosY[v];
322 }
323
325
328 double& yLabel(node v) {
329 OGDF_ASSERT(has(nodeLabelPosition));
330 return m_nodeLabelPosY[v];
331 }
332
334
337 double zLabel(node v) const {
338 OGDF_ASSERT(has(nodeLabelPosition));
339 OGDF_ASSERT(has(threeD));
340 return m_nodeLabelPosZ[v];
341 }
342
344
347 double& zLabel(node v) {
348 OGDF_ASSERT(has(nodeLabelPosition));
349 OGDF_ASSERT(has(threeD));
350 return m_nodeLabelPosZ[v];
351 }
352
354
357 double width(node v) const {
358 OGDF_ASSERT(has(nodeGraphics));
359 return m_width[v];
360 }
361
363
366 double& width(node v) {
367 OGDF_ASSERT(has(nodeGraphics));
368 return m_width[v];
369 }
370
372
375 const NodeArray<double>& width() const {
376 OGDF_ASSERT(has(nodeGraphics));
377 return m_width;
378 }
379
381
385 OGDF_ASSERT(has(nodeGraphics));
386 return m_width;
387 }
388
390
393 double height(node v) const {
394 OGDF_ASSERT(has(nodeGraphics));
395 return m_height[v];
396 }
397
399
402 double& height(node v) {
403 OGDF_ASSERT(has(nodeGraphics));
404 return m_height[v];
405 }
406
408
411 const NodeArray<double>& height() const {
412 OGDF_ASSERT(has(nodeGraphics));
413 return m_height;
414 }
415
417
421 OGDF_ASSERT(has(nodeGraphics));
422 return m_height;
423 }
424
426
429 Shape shape(node v) const {
430 OGDF_ASSERT(has(nodeGraphics));
431 return m_nodeShape[v];
432 }
433
435
439 OGDF_ASSERT(has(nodeGraphics));
440 return m_nodeShape[v];
441 }
442
444
448 OGDF_ASSERT(has(nodeStyle));
449 return m_nodeStroke[v].m_type;
450 }
451
453
457 OGDF_ASSERT(has(nodeStyle));
458 return m_nodeStroke[v].m_type;
459 }
460
462
465 const Color& strokeColor(node v) const {
466 OGDF_ASSERT(has(nodeStyle));
467 return m_nodeStroke[v].m_color;
468 }
469
471
475 OGDF_ASSERT(has(nodeStyle));
476 return m_nodeStroke[v].m_color;
477 }
478
480
483 float strokeWidth(node v) const {
484 OGDF_ASSERT(has(nodeStyle));
485 return m_nodeStroke[v].m_width;
486 }
487
489
492 float& strokeWidth(node v) {
493 OGDF_ASSERT(has(nodeStyle));
494 return m_nodeStroke[v].m_width;
495 }
496
498
502 OGDF_ASSERT(has(nodeStyle));
503 return m_nodeFill[v].m_pattern;
504 }
505
507
511 OGDF_ASSERT(has(nodeStyle));
512 return m_nodeFill[v].m_pattern;
513 }
514
516
519 const Color& fillColor(node v) const {
520 OGDF_ASSERT(has(nodeStyle));
521 return m_nodeFill[v].m_color;
522 }
523
525
529 OGDF_ASSERT(has(nodeStyle));
530 return m_nodeFill[v].m_color;
531 }
532
534
537 const Color& fillBgColor(node v) const {
538 OGDF_ASSERT(has(nodeStyle));
539 return m_nodeFill[v].m_bgColor;
540 }
541
543
547 OGDF_ASSERT(has(nodeStyle));
548 return m_nodeFill[v].m_bgColor;
549 }
550
552
555 const string& label(node v) const {
556 OGDF_ASSERT(has(nodeLabel));
557 return m_nodeLabel[v];
558 }
559
561
564 string& label(node v) {
565 OGDF_ASSERT(has(nodeLabel));
566 return m_nodeLabel[v];
567 }
568
570
573 const string& templateNode(node v) const {
574 OGDF_ASSERT(has(nodeTemplate));
575 return m_nodeTemplate[v];
576 }
577
579
582 string& templateNode(node v) {
583 OGDF_ASSERT(has(nodeTemplate));
584 return m_nodeTemplate[v];
585 }
586
588
591 int weight(node v) const {
592 OGDF_ASSERT(has(nodeWeight));
593 return m_nodeIntWeight[v];
594 }
595
597
600 int& weight(node v) {
601 OGDF_ASSERT(has(nodeWeight));
602 return m_nodeIntWeight[v];
603 }
604
606
610 OGDF_ASSERT(has(nodeType));
611 return m_vType.valid() ? m_vType[v] : Graph::NodeType::vertex;
612 }
613
615
619 OGDF_ASSERT(has(nodeType));
620 return m_vType[v];
621 }
622
624
629 int idNode(node v) const {
630 OGDF_ASSERT(has(nodeId));
631 return m_nodeId[v] == -1 ? v->index() : m_nodeId[v];
632 }
633
635
640 int& idNode(node v) {
641 OGDF_ASSERT(has(nodeId));
642 if (m_nodeId[v] == -1) {
643 m_nodeId[v] = v->index();
644 }
645 return m_nodeId[v];
646 }
647
649
653
654
656
664 const DPolyline& bends(edge e) const {
665 OGDF_ASSERT(has(edgeGraphics));
666 return m_bends[e];
667 }
668
670
676 OGDF_ASSERT(has(edgeGraphics));
677 return m_bends[e];
678 }
679
681
685 OGDF_ASSERT(has(edgeArrow));
686 return m_edgeArrow[e];
687 }
688
690
694 OGDF_ASSERT(has(edgeArrow));
695 return m_edgeArrow[e];
696 }
697
699
703 OGDF_ASSERT(has(edgeStyle));
704 return m_edgeStroke[e].m_type;
705 }
706
708
712 OGDF_ASSERT(has(edgeStyle));
713 return m_edgeStroke[e].m_type;
714 }
715
717
720 const Color& strokeColor(edge e) const {
721 OGDF_ASSERT(has(edgeStyle));
722 return m_edgeStroke[e].m_color;
723 }
724
726
730 OGDF_ASSERT(has(edgeStyle));
731 return m_edgeStroke[e].m_color;
732 }
733
735
738 float strokeWidth(edge e) const {
739 OGDF_ASSERT(has(edgeStyle));
740 return m_edgeStroke[e].m_width;
741 }
742
744
747 float& strokeWidth(edge e) {
748 OGDF_ASSERT(has(edgeStyle));
749 return m_edgeStroke[e].m_width;
750 }
751
753
756 const string& label(edge e) const {
757 OGDF_ASSERT(has(edgeLabel));
758 return m_edgeLabel[e];
759 }
760
762
765 string& label(edge e) {
766 OGDF_ASSERT(has(edgeLabel));
767 return m_edgeLabel[e];
768 }
769
771
774 int intWeight(edge e) const {
775 OGDF_ASSERT(has(edgeIntWeight));
776 return m_intWeight[e];
777 }
778
780
783 int& intWeight(edge e) {
784 OGDF_ASSERT(has(edgeIntWeight));
785 return m_intWeight[e];
786 }
787
789
792 double doubleWeight(edge e) const {
793 OGDF_ASSERT(has(edgeDoubleWeight));
794 return m_doubleWeight[e];
795 }
796
798
801 double& doubleWeight(edge e) {
802 OGDF_ASSERT(has(edgeDoubleWeight));
803 return m_doubleWeight[e];
804 }
805
807
811 OGDF_ASSERT(has(edgeType));
812 return m_eType.valid() ? m_eType[e] : Graph::EdgeType::association;
813 }
814
816
820 OGDF_ASSERT(has(edgeType));
821 return m_eType[e];
822 }
823
825
829 OGDF_ASSERT(has(edgeSubGraphs));
830 return m_subGraph[e];
831 }
832
834
838 OGDF_ASSERT(has(edgeSubGraphs));
839 return m_subGraph[e];
840 }
841
843
846 bool inSubGraph(edge e, int n) const {
847 OGDF_ASSERT(has(edgeSubGraphs));
848 OGDF_ASSERT(n >= 0);
849 OGDF_ASSERT(n < 32);
850 return (m_subGraph[e] & (1 << n)) != 0;
851 }
852
854
857 void addSubGraph(edge e, int n) {
858 OGDF_ASSERT(has(edgeSubGraphs));
859 OGDF_ASSERT(n >= 0);
860 OGDF_ASSERT(n < 32);
861 m_subGraph[e] |= (1 << n);
862 }
863
865
868 void removeSubGraph(edge e, int n) {
869 OGDF_ASSERT(has(edgeSubGraphs));
870 OGDF_ASSERT(n >= 0);
871 OGDF_ASSERT(n < 32);
872 m_subGraph[e] &= ~(1 << n);
873 }
874
876
880
882
891 virtual void scale(double sx, double sy, bool scaleNodes = true);
892
894
902 virtual void scale(double s, bool scaleNodes = true) { scale(s, s, scaleNodes); }
903
905
909 virtual void translate(double dx, double dy);
910
912 virtual void translateToNonNeg();
913
915
919 virtual void flipVertical() { flipVertical(boundingBox()); }
920
922
926 virtual void flipVertical(const DRect& box);
927
929
933 virtual void flipHorizontal() { flipHorizontal(boundingBox()); }
934
936
940 virtual void flipHorizontal(const DRect& box);
941
943
953 virtual void scaleAndTranslate(double sx, double sy, double dx, double dy,
954 bool scaleNodes = true);
955
957
966 virtual void scaleAndTranslate(double s, double dx, double dy, bool scaleNodes = true) {
967 scaleAndTranslate(s, s, dx, dy, scaleNodes);
968 }
969
971 virtual void rotateRight90();
972
974 virtual void rotateLeft90();
975
977
981
983 template<typename T>
985
987 template<typename T>
989
991
998 template<typename T>
1000 OGDF_ASSERT(attribute != nullptr);
1001 if (constGraph().numberOfNodes() == 0) {
1002 return true;
1003 }
1004
1005 T firstAttr = (this->*attribute)(*constGraph().nodes.begin());
1006 for (node n : constGraph().nodes) {
1007 if ((this->*attribute)(n) != firstAttr) {
1008 return false;
1009 }
1010 }
1011 return true;
1012 }
1013
1015
1022 template<typename T>
1024 OGDF_ASSERT(attribute != nullptr);
1025 if (constGraph().numberOfEdges() == 0) {
1026 return true;
1027 }
1028
1029 T firstAttr = (this->*attribute)(*constGraph().edges.begin());
1030 for (edge e : constGraph().edges) {
1031 if ((this->*attribute)(e) != firstAttr) {
1032 return false;
1033 }
1034 }
1035 return true;
1036 }
1037
1047 bool isUniform(long attributes) const;
1048
1050 inline DPoint point(node v) const { return DPoint(m_x[v], m_y[v]); }
1051
1053
1066
1068
1082
1084
1087 virtual DRect boundingBox() const;
1088
1090
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);
1102 }
1103 }
1104
1106
1109 void setAllWidth(double w);
1110
1112
1115 void setAllHeight(double h);
1116
1118
1122
1124
1134
1136
1148
1150
1158 bool isAssociationClass(node v) const { return type(v) == Graph::NodeType::associationClass; }
1159
1161
1169 int hierarchyList(List<List<node>*>& list) const;
1170
1172
1180 int hierarchyList(List<List<edge>*>& list) const;
1181
1183
1184private:
1187
1190};
1191
1192}
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.
Definition graphics.h:160
Rectangles with real coordinates.
Definition geometry.h:790
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
bool valid() const
Returns true iff the array is associated with a graph.
Definition EdgeArray.h:172
Class for the representation of edges.
Definition Graph_d.h:300
Polylines with PointType points.
Definition geometry.h:253
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
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 &copyAttr) 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).
Definition Graph_d.h:521
NodeType
The type of nodes.
Definition Graph_d.h:569
EdgeType
The type of edges (only used in derived classes).
Definition Graph_d.h:566
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
bool valid() const
Returns true iff the array is associated with a graph.
Definition NodeArray.h:170
Class for the representation of nodes.
Definition Graph_d.h:177
int index() const
Returns the (unique) node index.
Definition Graph_d.h:211
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
Definition of exception classes.
FillPattern
Fill patterns.
Definition graphics.h:82
StrokeType
Line types of strokes.
Definition graphics.h:46
Shape
Types for node shapes.
Definition graphics.h:116
EdgeArrow
Types for edge arrows.
Definition graphics.h:141
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition basic.h:41
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
long long nodeType
long long edgeType