Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

GraphAttributes.h
Go to the documentation of this file.
1 
36 #pragma once
37 
38 #include <ogdf/basic/NodeArray.h>
39 #include <ogdf/basic/EdgeArray.h>
40 #include <ogdf/basic/geometry.h>
42 #include <ogdf/basic/exceptions.h>
43 
44 
45 namespace ogdf {
46 
48 
68 
69 protected:
70  const Graph *m_pGraph;
71 
72  bool m_directed;
73 
74  // graphical representation of nodes
88 
89  // other node attributes
93 
94  // graphical representation of edges
99 
100  // other edge attributes
105 
107 
108 public:
109 
113 
116  static const long nodeGraphics;
117 
119  static const long edgeGraphics;
120 
122  static const long edgeIntWeight;
123 
125  static const long edgeDoubleWeight;
126 
128  static const long edgeLabel;
129 
131  static const long nodeLabel;
132 
134  static const long edgeType;
135 
137  static const long nodeType;
138 
140  static const long nodeId;
141 
143  static const long edgeArrow;
144 
146  static const long edgeStyle;
147 
150  static const long nodeStyle;
151 
153  static const long nodeTemplate;
154 
157  static const long edgeSubGraphs;
158 
160  static const long nodeWeight;
161 
163  static const long threeD;
164 
166  static const long nodeLabelPosition;
167 
169  static const long all;
170 
172 
176 
179 
182  GraphAttributes();
183 
185 
189  explicit GraphAttributes(const Graph &G, long attr = nodeGraphics | edgeGraphics);
190 
192  GraphAttributes(const GraphAttributes&) = default;
193 
195  GraphAttributes& operator=(const GraphAttributes&) = default;
196 
197  virtual ~GraphAttributes() {
198  }
199 
201  long attributes() const {
202  return m_attributes;
203  }
204 
206  inline bool has(long attr) const {
207  return (m_attributes & attr) == attr;
208  }
209 
211 
218  virtual void init(const Graph &G, long attr);
219 
222  void init(long attr);
223 
225  void addAttributes(long attr);
226 
228  void destroyAttributes(long attr);
229 
231  const Graph& constGraph() const {
232  return *m_pGraph;
233  }
234 
236 
239 
242  bool directed() const {
243  return m_directed;
244  }
245 
247  bool &directed() {
248  return m_directed;
249  }
250 
252 
255 
258 
261  double x(node v) const {
262  OGDF_ASSERT(has(nodeGraphics));
263  return m_x[v];
264  }
265 
266 
268 
271  double &x(node v) {
272  OGDF_ASSERT(has(nodeGraphics));
273  return m_x[v];
274  }
275 
276 
278 
281  double y(node v) const {
282  OGDF_ASSERT(has(nodeGraphics));
283  return m_y[v];
284  }
285 
286 
288 
291  double &y(node v) {
292  OGDF_ASSERT(has(nodeGraphics));
293  return m_y[v];
294  }
295 
296 
298 
301  double z(node v) const {
302  OGDF_ASSERT(has(threeD));
303  return m_z[v];
304  }
305 
306 
308 
311  double &z(node v) {
312  OGDF_ASSERT(has(threeD));
313  return m_z[v];
314  }
315 
316 
318 
321  double xLabel(node v) const {
322  OGDF_ASSERT(has(nodeLabelPosition));
323  return m_nodeLabelPosX[v];
324  }
325 
327 
330  double &xLabel(node v) {
331  OGDF_ASSERT(has(nodeLabelPosition));
332  return m_nodeLabelPosX[v];
333  }
334 
335 
337 
340  double yLabel(node v) const {
341  OGDF_ASSERT(has(nodeLabelPosition));
342  return m_nodeLabelPosY[v];
343  }
344 
346 
349  double &yLabel(node v) {
350  OGDF_ASSERT(has(nodeLabelPosition));
351  return m_nodeLabelPosY[v];
352  }
353 
354 
356 
359  double zLabel(node v) const {
360  OGDF_ASSERT(has(nodeLabelPosition));
361  OGDF_ASSERT(has(threeD));
362  return m_nodeLabelPosZ[v];
363  }
364 
366 
369  double &zLabel(node v) {
370  OGDF_ASSERT(has(nodeLabelPosition));
371  OGDF_ASSERT(has(threeD));
372  return m_nodeLabelPosZ[v];
373  }
374 
375 
377 
380  double width(node v) const {
381  OGDF_ASSERT(has(nodeGraphics));
382  return m_width[v];
383  }
384 
386 
389  double &width(node v) {
390  OGDF_ASSERT(has(nodeGraphics));
391  return m_width[v];
392  }
393 
394 
396 
399  const NodeArray<double> &width() const {
400  OGDF_ASSERT(has(nodeGraphics));
401  return m_width;
402  }
403 
405 
409  OGDF_ASSERT(has(nodeGraphics));
410  return m_width;
411  }
412 
413 
415 
418  double height(node v) const {
419  OGDF_ASSERT(has(nodeGraphics));
420  return m_height[v];
421  }
422 
424 
427  double &height(node v) {
428  OGDF_ASSERT(has(nodeGraphics));
429  return m_height[v];
430  }
431 
432 
434 
437  const NodeArray<double> &height() const {
438  OGDF_ASSERT(has(nodeGraphics));
439  return m_height;
440  }
441 
443 
447  OGDF_ASSERT(has(nodeGraphics));
448  return m_height;
449  }
450 
451 
453 
456  Shape shape(node v) const {
457  OGDF_ASSERT(has(nodeGraphics));
458  return m_nodeShape[v];
459  }
460 
462 
466  OGDF_ASSERT(has(nodeGraphics));
467  return m_nodeShape[v];
468  }
469 
470 
472 
476  OGDF_ASSERT(has(nodeStyle));
477  return m_nodeStroke[v].m_type;
478  }
479 
481 
485  OGDF_ASSERT(has(nodeStyle));
486  return m_nodeStroke[v].m_type;
487  }
488 
489 
491 
494  const Color &strokeColor(node v) const {
495  OGDF_ASSERT(has(nodeStyle));
496  return m_nodeStroke[v].m_color;
497  }
498 
500 
504  OGDF_ASSERT(has(nodeStyle));
505  return m_nodeStroke[v].m_color;
506  }
507 
508 
510 
513  float strokeWidth(node v) const {
514  OGDF_ASSERT(has(nodeStyle));
515  return m_nodeStroke[v].m_width;
516  }
517 
519 
522  float &strokeWidth(node v) {
523  OGDF_ASSERT(has(nodeStyle));
524  return m_nodeStroke[v].m_width;
525  }
526 
528 
532  OGDF_ASSERT(has(nodeStyle));
533  return m_nodeFill[v].m_pattern;
534  }
535 
537 
541  OGDF_ASSERT(has(nodeStyle));
542  return m_nodeFill[v].m_pattern;
543  }
544 
546 
549  const Color &fillColor(node v) const {
550  OGDF_ASSERT(has(nodeStyle));
551  return m_nodeFill[v].m_color;
552  }
553 
555 
559  OGDF_ASSERT(has(nodeStyle));
560  return m_nodeFill[v].m_color;
561  }
562 
563 
565 
568  const Color &fillBgColor(node v) const {
569  OGDF_ASSERT(has(nodeStyle));
570  return m_nodeFill[v].m_bgColor;
571  }
572 
574 
578  OGDF_ASSERT(has(nodeStyle));
579  return m_nodeFill[v].m_bgColor;
580  }
581 
582 
584 
587  const string &label(node v) const {
588  OGDF_ASSERT(has(nodeLabel));
589  return m_nodeLabel[v];
590  }
591 
593 
596  string &label(node v) {
597  OGDF_ASSERT(has(nodeLabel));
598  return m_nodeLabel[v];
599  }
600 
601 
603 
606  const string &templateNode(node v) const {
607  OGDF_ASSERT(has(nodeTemplate));
608  return m_nodeTemplate[v];
609  }
610 
612 
615  string &templateNode(node v) {
616  OGDF_ASSERT(has(nodeTemplate));
617  return m_nodeTemplate[v];
618  }
619 
620 
622 
625  int weight(node v) const {
626  OGDF_ASSERT(has(nodeWeight));
627  return m_nodeIntWeight[v];
628  }
629 
631 
634  int &weight(node v) {
635  OGDF_ASSERT(has(nodeWeight));
636  return m_nodeIntWeight[v];
637  }
638 
639 
641 
645  OGDF_ASSERT(has(nodeType));
646  return m_vType.valid() ? m_vType[v] : Graph::NodeType::vertex;
647  }
648 
650 
654  OGDF_ASSERT(has(nodeType));
655  return m_vType[v];
656  }
657 
658 
660 
665  int idNode(node v) const {
666  OGDF_ASSERT(has(nodeId));
667  return m_nodeId[v] == -1 ? v->index() : m_nodeId[v];
668  }
669 
671 
676  int &idNode(node v) {
677  OGDF_ASSERT(has(nodeId));
678  if (m_nodeId[v] == -1) {
679  m_nodeId[v] = v->index();
680  }
681  return m_nodeId[v];
682  }
683 
685 
688 
690 
692 
700  const DPolyline &bends(edge e) const {
701  OGDF_ASSERT(has(edgeGraphics));
702  return m_bends[e];
703  }
704 
706 
712  OGDF_ASSERT(has(edgeGraphics));
713  return m_bends[e];
714  }
715 
716 
718 
722  OGDF_ASSERT(has(edgeArrow));
723  return m_edgeArrow[e];
724  }
725 
727 
731  OGDF_ASSERT(has(edgeArrow));
732  return m_edgeArrow[e];
733  }
734 
735 
737 
741  OGDF_ASSERT(has(edgeStyle));
742  return m_edgeStroke[e].m_type;
743  }
744 
746 
750  OGDF_ASSERT(has(edgeStyle));
751  return m_edgeStroke[e].m_type;
752  }
753 
754 
756 
759  const Color &strokeColor(edge e) const {
760  OGDF_ASSERT(has(edgeStyle));
761  return m_edgeStroke[e].m_color;
762  }
763 
765 
769  OGDF_ASSERT(has(edgeStyle));
770  return m_edgeStroke[e].m_color;
771  }
772 
773 
775 
778  float strokeWidth(edge e) const {
779  OGDF_ASSERT(has(edgeStyle));
780  return m_edgeStroke[e].m_width;
781  }
782 
784 
787  float &strokeWidth(edge e) {
788  OGDF_ASSERT(has(edgeStyle));
789  return m_edgeStroke[e].m_width;
790  }
791 
792 
794 
797  const string &label(edge e) const {
798  OGDF_ASSERT(has(edgeLabel));
799  return m_edgeLabel[e];
800  }
801 
803 
806  string &label(edge e) {
807  OGDF_ASSERT(has(edgeLabel));
808  return m_edgeLabel[e];
809  }
810 
811 
813 
816  int intWeight(edge e) const {
817  OGDF_ASSERT(has(edgeIntWeight));
818  return m_intWeight[e];
819  }
820 
822 
825  int &intWeight(edge e) {
826  OGDF_ASSERT(has(edgeIntWeight));
827  return m_intWeight[e];
828  }
829 
830 
832 
835  double doubleWeight(edge e) const {
836  OGDF_ASSERT(has(edgeDoubleWeight));
837  return m_doubleWeight[e];
838  }
839 
841 
844  double &doubleWeight(edge e) {
845  OGDF_ASSERT(has(edgeDoubleWeight));
846  return m_doubleWeight[e];
847  }
848 
849 
851 
855  OGDF_ASSERT(has(edgeType));
856  return m_eType.valid() ? m_eType[e] : Graph::EdgeType::association;
857  }
858 
860 
864  OGDF_ASSERT(has(edgeType));
865  return m_eType[e];
866  }
867 
868 
870 
873  uint32_t subGraphBits(edge e) const {
874  OGDF_ASSERT(has(edgeSubGraphs));
875  return m_subGraph[e];
876  }
877 
879 
882  uint32_t &subGraphBits(edge e) {
883  OGDF_ASSERT(has(edgeSubGraphs));
884  return m_subGraph[e];
885  }
886 
887 
889 
892  bool inSubGraph(edge e, int n) const {
893  OGDF_ASSERT(has(edgeSubGraphs));
894  OGDF_ASSERT(n>=0);
895  OGDF_ASSERT(n<32);
896  return (m_subGraph[e] & (1 << n)) != 0;
897  }
898 
899 
901 
904  void addSubGraph(edge e, int n) {
905  OGDF_ASSERT(has(edgeSubGraphs));
906  OGDF_ASSERT(n>=0);
907  OGDF_ASSERT(n<32);
908  m_subGraph[e] |= (1 << n);
909  }
910 
911 
913 
916  void removeSubGraph(edge e, int n) {
917  OGDF_ASSERT(has(edgeSubGraphs));
918  OGDF_ASSERT(n>=0);
919  OGDF_ASSERT(n<32);
920  m_subGraph[e] &= ~(1 << n);
921  }
922 
924 
927 
930 
939  virtual void scale(double sx, double sy, bool scaleNodes = true);
940 
942 
950  virtual void scale(double s, bool scaleNodes = true) { scale(s, s, scaleNodes); }
951 
953 
957  virtual void translate(double dx, double dy);
958 
960  virtual void translateToNonNeg();
961 
963 
967  virtual void flipVertical() { flipVertical(boundingBox()); }
968 
970 
974  virtual void flipVertical(const DRect &box);
975 
977 
981  virtual void flipHorizontal() { flipHorizontal(boundingBox()); }
982 
984 
988  virtual void flipHorizontal(const DRect &box);
989 
991 
1001  virtual void scaleAndTranslate(double sx, double sy, double dx, double dy, bool scaleNodes = true);
1002 
1004 
1013  virtual void scaleAndTranslate(double s, double dx, double dy, bool scaleNodes = true) {
1014  scaleAndTranslate(s, s, dx, dy, scaleNodes);
1015  }
1016 
1018  virtual void rotateRight90();
1019 
1021  virtual void rotateLeft90();
1022 
1024 
1027 
1030  inline DPoint point(node v) const { return DPoint(m_x[v], m_y[v]); }
1031 
1033 
1045  void transferToOriginal(GraphAttributes &origAttr) const;
1046 
1048 
1061  void transferToCopy(GraphAttributes &copyAttr) const;
1062 
1064 
1067  virtual DRect boundingBox() const;
1068 
1070 
1075  template<class Rectangle = DRect>
1076  void nodeBoundingBoxes(NodeArray<Rectangle> &boundingBoxes) const {
1077  for (node v : constGraph().nodes) {
1078  double vHalfWidth = width(v) / 2.0;
1079  double vHalfHeight = height(v) / 2.0;
1080  boundingBoxes[v] = Rectangle(x(v) - vHalfWidth, y(v) - vHalfHeight,
1081  x(v) + vHalfWidth, y(v) + vHalfHeight);
1082  }
1083  }
1084 
1086 
1089  void setAllWidth(double w);
1090 
1092 
1095  void setAllHeight(double h);
1096 
1098 
1101  void clearAllBends();
1102 
1104 
1113  void removeUnnecessaryBendsHV();
1114 
1116 
1127  void addNodeCenter2Bends(int mode = 1);
1128 
1130 
1138  bool isAssociationClass(node v) const {
1140  }
1141 
1143 
1151  int hierarchyList(List<List<node>*> &list) const;
1152 
1154 
1162  int hierarchyList(List<List<edge>*> &list) const;
1163 
1165 
1166 private:
1168  void copyNodeAttributes(GraphAttributes &toAttr, node vFrom, node vTo, long attrs) const;
1169 
1171  void copyEdgeAttributes(GraphAttributes &toAttr, edge eFrom, edge eTo, long attrs) const;
1172 };
1173 
1174 }
ogdf::GraphAttributes::height
double & height(node v)
Returns the height of the bounding box of node v.
Definition: GraphAttributes.h:427
ogdf::GraphAttributes::edgeIntWeight
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
Definition: GraphAttributes.h:122
ogdf::GraphAttributes::yLabel
double & yLabel(node v)
Returns the label y-coordinate of node v.
Definition: GraphAttributes.h:349
ogdf::Color
Colors represented as RGBA values.
Definition: graphics.h:205
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:67
ogdf::GraphAttributes::strokeType
StrokeType & strokeType(node v)
Returns the stroke type of node v.
Definition: GraphAttributes.h:484
ogdf::GraphAttributes::idNode
int & idNode(node v)
Returns the user ID of node v.
Definition: GraphAttributes.h:676
ogdf::GraphAttributes::label
const string & label(edge e) const
Returns the label of edge e.
Definition: GraphAttributes.h:797
ogdf::GraphAttributes::all
static const long all
Enables all available flags.
Definition: GraphAttributes.h:169
ogdf::GraphAttributes::m_nodeShape
NodeArray< Shape > m_nodeShape
shape of a node
Definition: GraphAttributes.h:83
ogdf::GenericPoint< double >
ogdf::GraphAttributes::m_y
NodeArray< double > m_y
y-coordinate of a node
Definition: GraphAttributes.h:76
ogdf::StrokeType
StrokeType
Line types of strokes.
Definition: graphics.h:46
ogdf::GraphAttributes::fillBgColor
const Color & fillBgColor(node v) const
Returns the background color of fill patterns for node v.
Definition: GraphAttributes.h:568
ogdf::Graph::NodeType::vertex
@ vertex
ogdf::GraphAttributes::m_nodeLabelPosZ
NodeArray< double > m_nodeLabelPosZ
z-coordinate of a node label
Definition: GraphAttributes.h:80
ogdf::GraphAttributes::zLabel
double zLabel(node v) const
Returns the label z-coordinate of node v.
Definition: GraphAttributes.h:359
ogdf::GraphAttributes::fillColor
const Color & fillColor(node v) const
Returns the fill color of node v.
Definition: GraphAttributes.h:549
exceptions.h
Definition of exception classes.
ogdf::GraphAttributes::m_nodeLabel
NodeArray< string > m_nodeLabel
label of a node
Definition: GraphAttributes.h:84
ogdf::GraphAttributes::m_attributes
long m_attributes
bit vector of currently used attributes
Definition: GraphAttributes.h:106
ogdf::GraphAttributes::fillPattern
FillPattern fillPattern(node v) const
Returns the fill pattern of node v.
Definition: GraphAttributes.h:531
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:41
ogdf::GraphAttributes::edgeStyle
static const long edgeStyle
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).
Definition: GraphAttributes.h:146
ogdf::GraphAttributes::nodeStyle
static const long nodeStyle
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node),...
Definition: GraphAttributes.h:150
ogdf::Graph::NodeType::associationClass
@ associationClass
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::GraphAttributes::arrowType
EdgeArrow arrowType(edge e) const
Returns the arrow type of edge e.
Definition: GraphAttributes.h:721
ogdf::GraphAttributes::strokeColor
Color & strokeColor(node v)
Returns the stroke color of node v.
Definition: GraphAttributes.h:503
ogdf::Graph::EdgeType
EdgeType
The type of edges (only used in derived classes).
Definition: Graph_d.h:541
ogdf::NodeElement::index
int index() const
Returns the (unique) node index.
Definition: Graph_d.h:203
ogdf::GraphAttributes::z
double z(node v) const
Returns the z-coordinate of node v.
Definition: GraphAttributes.h:301
ogdf::GraphAttributes::yLabel
double yLabel(node v) const
Returns the label y-coordinate of node v.
Definition: GraphAttributes.h:340
ogdf::GraphAttributes::fillBgColor
Color & fillBgColor(node v)
Returns the background color of fill patterns for node v.
Definition: GraphAttributes.h:577
ogdf::GraphAttributes::shape
Shape & shape(node v)
Returns the shape type of node v.
Definition: GraphAttributes.h:465
ogdf::GraphAttributes::type
Graph::NodeType & type(node v)
Returns the type of node v.
Definition: GraphAttributes.h:653
ogdf::GenericPolyline
Polylines with PointType points.
Definition: geometry.h:263
ogdf::GraphAttributes::m_nodeFill
NodeArray< Fill > m_nodeFill
fill of a node
Definition: GraphAttributes.h:86
ogdf::GraphAttributes::m_nodeLabelPosX
NodeArray< double > m_nodeLabelPosX
x-coordinate of a node label
Definition: GraphAttributes.h:78
ogdf::GraphAttributes::x
double x(node v) const
Returns the x-coordinate of node v.
Definition: GraphAttributes.h:261
ogdf::GraphAttributes::removeSubGraph
void removeSubGraph(edge e, int n)
Removes edge e from basic graph n.
Definition: GraphAttributes.h:916
ogdf::GraphAttributes::attributes
long attributes() const
Returns currently accessible attributes.
Definition: GraphAttributes.h:201
ogdf::GraphAttributes::width
const NodeArray< double > & width() const
Returns a reference to the node array m_width.
Definition: GraphAttributes.h:399
ogdf::nodeType
long long nodeType
Definition: NodeTypePatterns.h:44
ogdf::GraphAttributes::zLabel
double & zLabel(node v)
Returns the label z-coordinate of node v.
Definition: GraphAttributes.h:369
ogdf::GraphAttributes::addSubGraph
void addSubGraph(edge e, int n)
Adds edge e to basic graph n.
Definition: GraphAttributes.h:904
ogdf::edgeType
long long edgeType
Definition: EdgeTypePatterns.h:42
ogdf::GraphAttributes::m_edgeStroke
EdgeArray< Stroke > m_edgeStroke
stroke of an edge
Definition: GraphAttributes.h:98
ogdf::GraphAttributes::z
double & z(node v)
Returns the z-coordinate of node v.
Definition: GraphAttributes.h:311
ogdf::GraphAttributes::nodeWeight
static const long nodeWeight
Corresponds to node attribute weight(node).
Definition: GraphAttributes.h:160
ogdf::GraphAttributes::xLabel
double & xLabel(node v)
Returns the label x-coordinate of node v.
Definition: GraphAttributes.h:330
ogdf::GraphAttributes::m_edgeLabel
EdgeArray< string > m_edgeLabel
label of an edge
Definition: GraphAttributes.h:96
ogdf::GraphAttributes::directed
bool directed() const
Returns if the graph is directed.
Definition: GraphAttributes.h:242
ogdf::GraphAttributes::constGraph
const Graph & constGraph() const
Returns a reference to the associated graph.
Definition: GraphAttributes.h:231
ogdf::GraphAttributes::nodeBoundingBoxes
void nodeBoundingBoxes(NodeArray< Rectangle > &boundingBoxes) const
Computes the bounding rectangle for each node.
Definition: GraphAttributes.h:1076
ogdf::NodeArray< double >
ogdf::GraphAttributes::m_vType
NodeArray< Graph::NodeType > m_vType
type (vertex, dummy, generalizationMerger)
Definition: GraphAttributes.h:92
ogdf::GraphAttributes::strokeWidth
float & strokeWidth(node v)
Returns the stroke width of node v.
Definition: GraphAttributes.h:522
ogdf::GraphAttributes::edgeLabel
static const long edgeLabel
Corresponds to edge attribute label(edge).
Definition: GraphAttributes.h:128
ogdf::GraphAttributes::height
const NodeArray< double > & height() const
Returns a reference to the node array m_height.
Definition: GraphAttributes.h:437
ogdf::GraphAttributes::bends
DPolyline & bends(edge e)
Returns the list of bend points of edge e.
Definition: GraphAttributes.h:711
ogdf::EdgeArray
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
ogdf::GraphAttributes::m_pGraph
const Graph * m_pGraph
associated graph
Definition: GraphAttributes.h:70
ogdf::EdgeArray::valid
bool valid() const
Returns true iff the array is associated with a graph.
Definition: EdgeArray.h:161
ogdf::GraphAttributes::bends
const DPolyline & bends(edge e) const
Returns the list of bend points of edge e.
Definition: GraphAttributes.h:700
ogdf::GraphAttributes::type
Graph::NodeType type(node v) const
Returns the type of node v.
Definition: GraphAttributes.h:644
ogdf::GraphAttributes::m_subGraph
EdgeArray< uint32_t > m_subGraph
is element of subgraphs given by bitvector
Definition: GraphAttributes.h:104
ogdf::GraphAttributes::m_nodeStroke
NodeArray< Stroke > m_nodeStroke
stroke of a node
Definition: GraphAttributes.h:85
ogdf::GraphAttributes::weight
int & weight(node v)
Returns the weight of node v.
Definition: GraphAttributes.h:634
ogdf::GraphAttributes::strokeType
StrokeType & strokeType(edge e)
Returns the stroke type of edge e.
Definition: GraphAttributes.h:749
ogdf::GraphAttributes::strokeWidth
float strokeWidth(edge e) const
Returns the stroke width of edge e.
Definition: GraphAttributes.h:778
ogdf::GraphAttributes::shape
Shape shape(node v) const
Returns the shape type of node v.
Definition: GraphAttributes.h:456
ogdf::GraphAttributes::y
double y(node v) const
Returns the y-coordinate of node v.
Definition: GraphAttributes.h:281
ogdf::GraphAttributes::inSubGraph
bool inSubGraph(edge e, int n) const
Checks whether edge e belongs to basic graph n.
Definition: GraphAttributes.h:892
ogdf::GraphAttributes::type
Graph::EdgeType type(edge e) const
Returns the type of edge e.
Definition: GraphAttributes.h:854
ogdf::GraphAttributes::weight
int weight(node v) const
Returns the weight of node v.
Definition: GraphAttributes.h:625
ogdf::Graph::EdgeType::association
@ association
ogdf::GraphAttributes::edgeType
static const long edgeType
Corresponds to edge attribute type(edge).
Definition: GraphAttributes.h:134
ogdf::GraphAttributes::fillPattern
FillPattern & fillPattern(node v)
Returns the fill pattern of node v.
Definition: GraphAttributes.h:540
backward::Color::type
type
Definition: backward.hpp:1716
ogdf::GraphAttributes::subGraphBits
uint32_t subGraphBits(edge e) const
Returns the edgesubgraph value of an edge e.
Definition: GraphAttributes.h:873
LayoutStandards.h
Declares class LayoutStandards which specifies default / standard values used in graph layouts.
ogdf::DRect
Rectangles with real coordinates.
Definition: geometry.h:815
ogdf::GraphAttributes::nodeTemplate
static const long nodeTemplate
Corresponds to node attribute templateNode(node).
Definition: GraphAttributes.h:153
EdgeArray.h
Declaration and implementation of EdgeArray class.
ogdf::GraphAttributes::m_x
NodeArray< double > m_x
x-coordinate of a node
Definition: GraphAttributes.h:75
ogdf::GraphAttributes::y
double & y(node v)
Returns the y-coordinate of node v.
Definition: GraphAttributes.h:291
ogdf::GraphAttributes::label
string & label(node v)
Returns the label of node v.
Definition: GraphAttributes.h:596
ogdf::GraphAttributes::nodeLabelPosition
static const long nodeLabelPosition
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).
Definition: GraphAttributes.h:166
ogdf::GraphAttributes::xLabel
double xLabel(node v) const
Returns the label x-coordinate of node v.
Definition: GraphAttributes.h:321
ogdf::GraphAttributes::strokeColor
Color & strokeColor(edge e)
Returns the stroke color of edge e.
Definition: GraphAttributes.h:768
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
ogdf::GraphAttributes::point
DPoint point(node v) const
Returns a DPoint corresponding to the x- and y-coordinates of v.
Definition: GraphAttributes.h:1030
ogdf::GraphAttributes::templateNode
string & templateNode(node v)
Returns the template name of node v.
Definition: GraphAttributes.h:615
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:495
ogdf::GraphAttributes::height
double height(node v) const
Returns the height of the bounding box of node v.
Definition: GraphAttributes.h:418
ogdf::GraphAttributes::height
NodeArray< double > & height()
Returns a reference to the node array m_height.
Definition: GraphAttributes.h:446
ogdf::EdgeArrow
EdgeArrow
Types for edge arrows.
Definition: graphics.h:186
ogdf::Graph::NodeType
NodeType
The type of nodes.
Definition: Graph_d.h:548
ogdf::GraphAttributes::nodeLabel
static const long nodeLabel
Corresponds to node attribute label(node).
Definition: GraphAttributes.h:131
NodeArray.h
Declaration and implementation of NodeArray class.
ogdf::GraphAttributes::strokeType
StrokeType strokeType(edge e) const
Returns the stroke type of edge e.
Definition: GraphAttributes.h:740
ogdf::GraphAttributes::m_nodeTemplate
NodeArray< string > m_nodeTemplate
name of template of a node
Definition: GraphAttributes.h:87
ogdf::GraphAttributes::flipVertical
virtual void flipVertical()
Flips the layout vertically within its bounding box.
Definition: GraphAttributes.h:967
ogdf::GraphAttributes::arrowType
EdgeArrow & arrowType(edge e)
Returns the arrow type of edge e.
Definition: GraphAttributes.h:730
ogdf::DPoint
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
Definition: geometry.h:244
ogdf::GraphAttributes::~GraphAttributes
virtual ~GraphAttributes()
Definition: GraphAttributes.h:197
ogdf::GraphAttributes::fillColor
Color & fillColor(node v)
Returns the fill color of node v.
Definition: GraphAttributes.h:558
ogdf::GraphAttributes::isAssociationClass
bool isAssociationClass(node v) const
Returns true iff v represents an association class.
Definition: GraphAttributes.h:1138
ogdf::GraphAttributes::m_doubleWeight
EdgeArray< double > m_doubleWeight
(real number) weight of an edge
Definition: GraphAttributes.h:102
ogdf::graphics::init
void init()
Definition: graphics.h:472
ogdf::GraphAttributes::edgeArrow
static const long edgeArrow
Corresponds to edge attribute arrowType(edge).
Definition: GraphAttributes.h:143
ogdf::GraphAttributes::edgeGraphics
static const long edgeGraphics
Corresponds to edge attribute bends(edge).
Definition: GraphAttributes.h:119
ogdf::GraphAttributes::edgeSubGraphs
static const long edgeSubGraphs
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge,...
Definition: GraphAttributes.h:157
ogdf::GraphAttributes::strokeWidth
float & strokeWidth(edge e)
Returns the stroke width of edge e.
Definition: GraphAttributes.h:787
ogdf::GraphAttributes::directed
bool & directed()
Returns if the graph is directed.
Definition: GraphAttributes.h:247
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
ogdf::GraphAttributes::m_z
NodeArray< double > m_z
z-coordinate of a node
Definition: GraphAttributes.h:77
ogdf::GraphAttributes::templateNode
const string & templateNode(node v) const
Returns the template name of node v.
Definition: GraphAttributes.h:606
ogdf::GraphAttributes::scaleAndTranslate
virtual void scaleAndTranslate(double s, double dx, double dy, bool scaleNodes=true)
Scales the layout by s and then translates it by (dx,dy).
Definition: GraphAttributes.h:1013
ogdf::GraphAttributes::m_nodeIntWeight
NodeArray< int > m_nodeIntWeight
(integer) weight of a node
Definition: GraphAttributes.h:91
ogdf::GraphAttributes::m_directed
bool m_directed
whether or not the graph is directed
Definition: GraphAttributes.h:72
ogdf::GraphAttributes::scale
virtual void scale(double s, bool scaleNodes=true)
Scales the layout by s.
Definition: GraphAttributes.h:950
ogdf::GraphAttributes::m_nodeId
NodeArray< int > m_nodeId
user ID of a node
Definition: GraphAttributes.h:90
ogdf::GraphAttributes::width
double & width(node v)
Returns the width of the bounding box of node v.
Definition: GraphAttributes.h:389
ogdf::GraphAttributes::m_width
NodeArray< double > m_width
width of a node's bounding box
Definition: GraphAttributes.h:81
ogdf::Shape
Shape
Types for node shapes.
Definition: graphics.h:149
ogdf::GraphAttributes::m_edgeArrow
EdgeArray< EdgeArrow > m_edgeArrow
arrow type of an edge
Definition: GraphAttributes.h:97
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:292
ogdf::GraphAttributes::x
double & x(node v)
Returns the x-coordinate of node v.
Definition: GraphAttributes.h:271
ogdf::GraphAttributes::idNode
int idNode(node v) const
Returns the user ID of node v.
Definition: GraphAttributes.h:665
ogdf::GraphAttributes::type
Graph::EdgeType & type(edge e)
Returns the type of edge e.
Definition: GraphAttributes.h:863
ogdf::GraphAttributes::doubleWeight
double & doubleWeight(edge e)
Returns the (real number) weight of edge e.
Definition: GraphAttributes.h:844
ogdf::GraphAttributes::intWeight
int & intWeight(edge e)
Returns the (integer) weight of edge e.
Definition: GraphAttributes.h:825
ogdf::GraphAttributes::subGraphBits
uint32_t & subGraphBits(edge e)
Returns the edgesubgraph value of an edge e.
Definition: GraphAttributes.h:882
ogdf::GraphAttributes::strokeColor
const Color & strokeColor(node v) const
Returns the stroke color of node v.
Definition: GraphAttributes.h:494
ogdf::GraphAttributes::intWeight
int intWeight(edge e) const
Returns the (integer) weight of edge e.
Definition: GraphAttributes.h:816
ogdf::GraphAttributes::label
string & label(edge e)
Returns the label of edge e.
Definition: GraphAttributes.h:806
ogdf::GraphAttributes::edgeDoubleWeight
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
Definition: GraphAttributes.h:125
ogdf::GraphAttributes::flipHorizontal
virtual void flipHorizontal()
Flips the layout horizontally within its bounding box.
Definition: GraphAttributes.h:981
ogdf::GraphAttributes::doubleWeight
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
Definition: GraphAttributes.h:835
ogdf::GraphAttributes::m_nodeLabelPosY
NodeArray< double > m_nodeLabelPosY
y-coordinate of a node label
Definition: GraphAttributes.h:79
ogdf::GraphAttributes::m_height
NodeArray< double > m_height
height of a nodes's bounding box
Definition: GraphAttributes.h:82
ogdf::GraphAttributes::nodeType
static const long nodeType
Corresponds to node attribute type(node).
Definition: GraphAttributes.h:137
ogdf::FillPattern
FillPattern
Fill patterns.
Definition: graphics.h:103
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:169
ogdf::NodeArray::valid
bool valid() const
Returns true iff the array is associated with a graph.
Definition: NodeArray.h:157
ogdf::GraphAttributes::width
NodeArray< double > & width()
Returns a reference to the node array #m_width.
Definition: GraphAttributes.h:408
ogdf::GraphAttributes::nodeGraphics
static const long nodeGraphics
Corresponds to node attributes x(node), y(node), width(node), height(node), and shape(node).
Definition: GraphAttributes.h:116
ogdf::GraphAttributes::strokeColor
const Color & strokeColor(edge e) const
Returns the stroke color of edge e.
Definition: GraphAttributes.h:759
ogdf::GraphAttributes::nodeId
static const long nodeId
Corresponds to node attribute idNode(node).
Definition: GraphAttributes.h:140
ogdf::GraphAttributes::m_intWeight
EdgeArray< int > m_intWeight
(integer) weight of an edge
Definition: GraphAttributes.h:101
ogdf::GraphAttributes::threeD
static const long threeD
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only.
Definition: GraphAttributes.h:163
ogdf::GraphAttributes::strokeType
StrokeType strokeType(node v) const
Returns the stroke type of node v.
Definition: GraphAttributes.h:475
ogdf::GraphAttributes::label
const string & label(node v) const
Returns the label of node v.
Definition: GraphAttributes.h:587
ogdf::GraphAttributes::has
bool has(long attr) const
Returns true iff all attributes in attr are available.
Definition: GraphAttributes.h:206
ogdf::GraphAttributes::m_eType
EdgeArray< Graph::EdgeType > m_eType
type of an edge (association or generalization)
Definition: GraphAttributes.h:103
ogdf::GraphAttributes::m_bends
EdgeArray< DPolyline > m_bends
list of bend points of an edge
Definition: GraphAttributes.h:95
ogdf::GraphAttributes::strokeWidth
float strokeWidth(node v) const
Returns the stroke width of node v.
Definition: GraphAttributes.h:513
ogdf::GraphAttributes::width
double width(node v) const
Returns the width of the bounding box of node v.
Definition: GraphAttributes.h:380