Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

GraphAttributes.h
Go to the documentation of this file.
1 
36 #pragma once
37 
38 #include <ogdf/basic/EdgeArray.h>
40 #include <ogdf/basic/NodeArray.h>
41 #include <ogdf/basic/exceptions.h>
42 #include <ogdf/basic/geometry.h>
43 
44 namespace ogdf {
45 
47 
67 protected:
68  const Graph* m_pGraph;
69 
70  bool m_directed;
71 
72  // graphical representation of nodes
86 
87  // other node attributes
91 
92  // graphical representation of edges
97 
98  // other edge attributes
103 
105 
106 public:
110 
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 
173 
176 
179  GraphAttributes();
180 
182 
186  explicit GraphAttributes(const Graph& G, long attr = nodeGraphics | edgeGraphics);
187 
188  virtual ~GraphAttributes() = default;
189 
191  long attributes() const { return m_attributes; }
192 
194  inline bool has(long attr) const { return (m_attributes & attr) == attr; }
195 
197 
204  virtual void init(const Graph& G, long attr);
205 
208  void init(long attr);
209 
211  void addAttributes(long attr);
212 
214  void destroyAttributes(long attr);
215 
217  const Graph& constGraph() const { return *m_pGraph; }
218 
220 
223 
226  bool directed() const { return m_directed; }
227 
229  bool& directed() { return m_directed; }
230 
232 
235 
238 
241  double x(node v) const {
242  OGDF_ASSERT(has(nodeGraphics));
243  return m_x[v];
244  }
245 
247 
250  double& x(node v) {
251  OGDF_ASSERT(has(nodeGraphics));
252  return m_x[v];
253  }
254 
256 
259  double y(node v) const {
260  OGDF_ASSERT(has(nodeGraphics));
261  return m_y[v];
262  }
263 
265 
268  double& y(node v) {
269  OGDF_ASSERT(has(nodeGraphics));
270  return m_y[v];
271  }
272 
274 
277  double z(node v) const {
278  OGDF_ASSERT(has(threeD));
279  return m_z[v];
280  }
281 
283 
286  double& z(node v) {
287  OGDF_ASSERT(has(threeD));
288  return m_z[v];
289  }
290 
292 
295  double xLabel(node v) const {
296  OGDF_ASSERT(has(nodeLabelPosition));
297  return m_nodeLabelPosX[v];
298  }
299 
301 
304  double& xLabel(node v) {
305  OGDF_ASSERT(has(nodeLabelPosition));
306  return m_nodeLabelPosX[v];
307  }
308 
310 
313  double yLabel(node v) const {
314  OGDF_ASSERT(has(nodeLabelPosition));
315  return m_nodeLabelPosY[v];
316  }
317 
319 
322  double& yLabel(node v) {
323  OGDF_ASSERT(has(nodeLabelPosition));
324  return m_nodeLabelPosY[v];
325  }
326 
328 
331  double zLabel(node v) const {
332  OGDF_ASSERT(has(nodeLabelPosition));
333  OGDF_ASSERT(has(threeD));
334  return m_nodeLabelPosZ[v];
335  }
336 
338 
341  double& zLabel(node v) {
342  OGDF_ASSERT(has(nodeLabelPosition));
343  OGDF_ASSERT(has(threeD));
344  return m_nodeLabelPosZ[v];
345  }
346 
348 
351  double width(node v) const {
352  OGDF_ASSERT(has(nodeGraphics));
353  return m_width[v];
354  }
355 
357 
360  double& width(node v) {
361  OGDF_ASSERT(has(nodeGraphics));
362  return m_width[v];
363  }
364 
366 
369  const NodeArray<double>& width() const {
370  OGDF_ASSERT(has(nodeGraphics));
371  return m_width;
372  }
373 
375 
379  OGDF_ASSERT(has(nodeGraphics));
380  return m_width;
381  }
382 
384 
387  double height(node v) const {
388  OGDF_ASSERT(has(nodeGraphics));
389  return m_height[v];
390  }
391 
393 
396  double& height(node v) {
397  OGDF_ASSERT(has(nodeGraphics));
398  return m_height[v];
399  }
400 
402 
405  const NodeArray<double>& height() const {
406  OGDF_ASSERT(has(nodeGraphics));
407  return m_height;
408  }
409 
411 
415  OGDF_ASSERT(has(nodeGraphics));
416  return m_height;
417  }
418 
420 
423  Shape shape(node v) const {
424  OGDF_ASSERT(has(nodeGraphics));
425  return m_nodeShape[v];
426  }
427 
429 
433  OGDF_ASSERT(has(nodeGraphics));
434  return m_nodeShape[v];
435  }
436 
438 
442  OGDF_ASSERT(has(nodeStyle));
443  return m_nodeStroke[v].m_type;
444  }
445 
447 
451  OGDF_ASSERT(has(nodeStyle));
452  return m_nodeStroke[v].m_type;
453  }
454 
456 
459  const Color& strokeColor(node v) const {
460  OGDF_ASSERT(has(nodeStyle));
461  return m_nodeStroke[v].m_color;
462  }
463 
465 
469  OGDF_ASSERT(has(nodeStyle));
470  return m_nodeStroke[v].m_color;
471  }
472 
474 
477  float strokeWidth(node v) const {
478  OGDF_ASSERT(has(nodeStyle));
479  return m_nodeStroke[v].m_width;
480  }
481 
483 
486  float& strokeWidth(node v) {
487  OGDF_ASSERT(has(nodeStyle));
488  return m_nodeStroke[v].m_width;
489  }
490 
492 
496  OGDF_ASSERT(has(nodeStyle));
497  return m_nodeFill[v].m_pattern;
498  }
499 
501 
505  OGDF_ASSERT(has(nodeStyle));
506  return m_nodeFill[v].m_pattern;
507  }
508 
510 
513  const Color& fillColor(node v) const {
514  OGDF_ASSERT(has(nodeStyle));
515  return m_nodeFill[v].m_color;
516  }
517 
519 
523  OGDF_ASSERT(has(nodeStyle));
524  return m_nodeFill[v].m_color;
525  }
526 
528 
531  const Color& fillBgColor(node v) const {
532  OGDF_ASSERT(has(nodeStyle));
533  return m_nodeFill[v].m_bgColor;
534  }
535 
537 
541  OGDF_ASSERT(has(nodeStyle));
542  return m_nodeFill[v].m_bgColor;
543  }
544 
546 
549  const string& label(node v) const {
550  OGDF_ASSERT(has(nodeLabel));
551  return m_nodeLabel[v];
552  }
553 
555 
558  string& label(node v) {
559  OGDF_ASSERT(has(nodeLabel));
560  return m_nodeLabel[v];
561  }
562 
564 
567  const string& templateNode(node v) const {
568  OGDF_ASSERT(has(nodeTemplate));
569  return m_nodeTemplate[v];
570  }
571 
573 
576  string& templateNode(node v) {
577  OGDF_ASSERT(has(nodeTemplate));
578  return m_nodeTemplate[v];
579  }
580 
582 
585  int weight(node v) const {
586  OGDF_ASSERT(has(nodeWeight));
587  return m_nodeIntWeight[v];
588  }
589 
591 
594  int& weight(node v) {
595  OGDF_ASSERT(has(nodeWeight));
596  return m_nodeIntWeight[v];
597  }
598 
600 
604  OGDF_ASSERT(has(nodeType));
605  return m_vType.valid() ? m_vType[v] : Graph::NodeType::vertex;
606  }
607 
609 
613  OGDF_ASSERT(has(nodeType));
614  return m_vType[v];
615  }
616 
618 
623  int idNode(node v) const {
624  OGDF_ASSERT(has(nodeId));
625  return m_nodeId[v] == -1 ? v->index() : m_nodeId[v];
626  }
627 
629 
634  int& idNode(node v) {
635  OGDF_ASSERT(has(nodeId));
636  if (m_nodeId[v] == -1) {
637  m_nodeId[v] = v->index();
638  }
639  return m_nodeId[v];
640  }
641 
643 
646 
648 
650 
658  const DPolyline& bends(edge e) const {
659  OGDF_ASSERT(has(edgeGraphics));
660  return m_bends[e];
661  }
662 
664 
670  OGDF_ASSERT(has(edgeGraphics));
671  return m_bends[e];
672  }
673 
675 
679  OGDF_ASSERT(has(edgeArrow));
680  return m_edgeArrow[e];
681  }
682 
684 
688  OGDF_ASSERT(has(edgeArrow));
689  return m_edgeArrow[e];
690  }
691 
693 
697  OGDF_ASSERT(has(edgeStyle));
698  return m_edgeStroke[e].m_type;
699  }
700 
702 
706  OGDF_ASSERT(has(edgeStyle));
707  return m_edgeStroke[e].m_type;
708  }
709 
711 
714  const Color& strokeColor(edge e) const {
715  OGDF_ASSERT(has(edgeStyle));
716  return m_edgeStroke[e].m_color;
717  }
718 
720 
724  OGDF_ASSERT(has(edgeStyle));
725  return m_edgeStroke[e].m_color;
726  }
727 
729 
732  float strokeWidth(edge e) const {
733  OGDF_ASSERT(has(edgeStyle));
734  return m_edgeStroke[e].m_width;
735  }
736 
738 
741  float& strokeWidth(edge e) {
742  OGDF_ASSERT(has(edgeStyle));
743  return m_edgeStroke[e].m_width;
744  }
745 
747 
750  const string& label(edge e) const {
751  OGDF_ASSERT(has(edgeLabel));
752  return m_edgeLabel[e];
753  }
754 
756 
759  string& label(edge e) {
760  OGDF_ASSERT(has(edgeLabel));
761  return m_edgeLabel[e];
762  }
763 
765 
768  int intWeight(edge e) const {
769  OGDF_ASSERT(has(edgeIntWeight));
770  return m_intWeight[e];
771  }
772 
774 
777  int& intWeight(edge e) {
778  OGDF_ASSERT(has(edgeIntWeight));
779  return m_intWeight[e];
780  }
781 
783 
786  double doubleWeight(edge e) const {
787  OGDF_ASSERT(has(edgeDoubleWeight));
788  return m_doubleWeight[e];
789  }
790 
792 
795  double& doubleWeight(edge e) {
796  OGDF_ASSERT(has(edgeDoubleWeight));
797  return m_doubleWeight[e];
798  }
799 
801 
805  OGDF_ASSERT(has(edgeType));
806  return m_eType.valid() ? m_eType[e] : Graph::EdgeType::association;
807  }
808 
810 
814  OGDF_ASSERT(has(edgeType));
815  return m_eType[e];
816  }
817 
819 
822  uint32_t subGraphBits(edge e) const {
823  OGDF_ASSERT(has(edgeSubGraphs));
824  return m_subGraph[e];
825  }
826 
828 
831  uint32_t& subGraphBits(edge e) {
832  OGDF_ASSERT(has(edgeSubGraphs));
833  return m_subGraph[e];
834  }
835 
837 
840  bool inSubGraph(edge e, int n) const {
841  OGDF_ASSERT(has(edgeSubGraphs));
842  OGDF_ASSERT(n >= 0);
843  OGDF_ASSERT(n < 32);
844  return (m_subGraph[e] & (1 << n)) != 0;
845  }
846 
848 
851  void addSubGraph(edge e, int n) {
852  OGDF_ASSERT(has(edgeSubGraphs));
853  OGDF_ASSERT(n >= 0);
854  OGDF_ASSERT(n < 32);
855  m_subGraph[e] |= (1 << n);
856  }
857 
859 
862  void removeSubGraph(edge e, int n) {
863  OGDF_ASSERT(has(edgeSubGraphs));
864  OGDF_ASSERT(n >= 0);
865  OGDF_ASSERT(n < 32);
866  m_subGraph[e] &= ~(1 << n);
867  }
868 
870 
873 
876 
885  virtual void scale(double sx, double sy, bool scaleNodes = true);
886 
888 
896  virtual void scale(double s, bool scaleNodes = true) { scale(s, s, scaleNodes); }
897 
899 
903  virtual void translate(double dx, double dy);
904 
906  virtual void translateToNonNeg();
907 
909 
913  virtual void flipVertical() { flipVertical(boundingBox()); }
914 
916 
920  virtual void flipVertical(const DRect& box);
921 
923 
927  virtual void flipHorizontal() { flipHorizontal(boundingBox()); }
928 
930 
934  virtual void flipHorizontal(const DRect& box);
935 
937 
947  virtual void scaleAndTranslate(double sx, double sy, double dx, double dy,
948  bool scaleNodes = true);
949 
951 
960  virtual void scaleAndTranslate(double s, double dx, double dy, bool scaleNodes = true) {
961  scaleAndTranslate(s, s, dx, dy, scaleNodes);
962  }
963 
965  virtual void rotateRight90();
966 
968  virtual void rotateLeft90();
969 
971 
974 
977  template<typename T>
978  using NodeAttributeGetter = T (GraphAttributes::*)(node) const;
979 
981  template<typename T>
982  using EdgeAttributeGetter = T (GraphAttributes::*)(edge) const;
983 
985 
992  template<typename T>
994  OGDF_ASSERT(attribute != nullptr);
995  if (constGraph().numberOfNodes() == 0) {
996  return true;
997  }
998 
999  T firstAttr = (this->*attribute)(*constGraph().nodes.begin());
1000  for (node n : constGraph().nodes) {
1001  if ((this->*attribute)(n) != firstAttr) {
1002  return false;
1003  }
1004  }
1005  return true;
1006  }
1007 
1009 
1016  template<typename T>
1018  OGDF_ASSERT(attribute != nullptr);
1019  if (constGraph().numberOfEdges() == 0) {
1020  return true;
1021  }
1022 
1023  T firstAttr = (this->*attribute)(*constGraph().edges.begin());
1024  for (edge e : constGraph().edges) {
1025  if ((this->*attribute)(e) != firstAttr) {
1026  return false;
1027  }
1028  }
1029  return true;
1030  }
1031 
1041  bool isUniform(long attributes) const;
1042 
1044  inline DPoint point(node v) const { return DPoint(m_x[v], m_y[v]); }
1045 
1047 
1059  void transferToOriginal(GraphAttributes& origAttr) const;
1060 
1062 
1075  void transferToCopy(GraphAttributes& copyAttr) const;
1076 
1078 
1081  virtual DRect boundingBox() const;
1082 
1084 
1089  template<class Rectangle = DRect>
1090  void nodeBoundingBoxes(NodeArray<Rectangle>& boundingBoxes) const {
1091  for (node v : constGraph().nodes) {
1092  double vHalfWidth = width(v) / 2.0;
1093  double vHalfHeight = height(v) / 2.0;
1094  boundingBoxes[v] = Rectangle(x(v) - vHalfWidth, y(v) - vHalfHeight, x(v) + vHalfWidth,
1095  y(v) + vHalfHeight);
1096  }
1097  }
1098 
1100 
1103  void setAllWidth(double w);
1104 
1106 
1109  void setAllHeight(double h);
1110 
1112 
1115  void clearAllBends();
1116 
1118 
1127  void removeUnnecessaryBendsHV();
1128 
1130 
1141  void addNodeCenter2Bends(int mode = 1);
1142 
1144 
1153 
1155 
1163  int hierarchyList(List<List<node>*>& list) const;
1164 
1166 
1174  int hierarchyList(List<List<edge>*>& list) const;
1175 
1177 
1178 private:
1180  void copyNodeAttributes(GraphAttributes& toAttr, node vFrom, node vTo, long attrs) const;
1181 
1183  void copyEdgeAttributes(GraphAttributes& toAttr, edge eFrom, edge eTo, long attrs) const;
1184 };
1185 
1186 }
ogdf::GraphAttributes::height
double & height(node v)
Returns the height of the bounding box of node v.
Definition: GraphAttributes.h:396
ogdf::GraphAttributes::edgeIntWeight
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
Definition: GraphAttributes.h:119
ogdf::GraphAttributes::yLabel
double & yLabel(node v)
Returns the label y-coordinate of node v.
Definition: GraphAttributes.h:322
ogdf::Color
Colors represented as RGBA values.
Definition: graphics.h:160
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:66
ogdf::GraphAttributes::strokeType
StrokeType & strokeType(node v)
Returns the stroke type of node v.
Definition: GraphAttributes.h:450
ogdf::GraphAttributes::idNode
int & idNode(node v)
Returns the user ID of node v.
Definition: GraphAttributes.h:634
ogdf::GraphAttributes::label
const string & label(edge e) const
Returns the label of edge e.
Definition: GraphAttributes.h:750
ogdf::GraphAttributes::all
static const long all
Enables all available flags.
Definition: GraphAttributes.h:166
ogdf::GraphAttributes::m_nodeShape
NodeArray< Shape > m_nodeShape
shape of a node
Definition: GraphAttributes.h:81
ogdf::GenericPoint< double >
ogdf::GraphAttributes::m_y
NodeArray< double > m_y
y-coordinate of a node
Definition: GraphAttributes.h:74
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:531
ogdf::Graph::NodeType::vertex
@ vertex
ogdf::GraphAttributes::m_nodeLabelPosZ
NodeArray< double > m_nodeLabelPosZ
z-coordinate of a node label
Definition: GraphAttributes.h:78
ogdf::GraphAttributes::zLabel
double zLabel(node v) const
Returns the label z-coordinate of node v.
Definition: GraphAttributes.h:331
ogdf::GraphAttributes::fillColor
const Color & fillColor(node v) const
Returns the fill color of node v.
Definition: GraphAttributes.h:513
exceptions.h
Definition of exception classes.
ogdf::GraphAttributes::m_nodeLabel
NodeArray< string > m_nodeLabel
label of a node
Definition: GraphAttributes.h:82
ogdf::GraphAttributes::m_attributes
long m_attributes
bit vector of currently used attributes
Definition: GraphAttributes.h:104
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::GraphAttributes::fillPattern
FillPattern fillPattern(node v) const
Returns the fill pattern of node v.
Definition: GraphAttributes.h:495
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:54
ogdf::GraphAttributes::edgeStyle
static const long edgeStyle
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).
Definition: GraphAttributes.h:143
ogdf::GraphAttributes::nodeStyle
static const long nodeStyle
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node),...
Definition: GraphAttributes.h:147
ogdf::Graph::NodeType::associationClass
@ associationClass
ogdf::GraphAttributes::arrowType
EdgeArrow arrowType(edge e) const
Returns the arrow type of edge e.
Definition: GraphAttributes.h:678
ogdf::GraphAttributes::strokeColor
Color & strokeColor(node v)
Returns the stroke color of node v.
Definition: GraphAttributes.h:468
ogdf::Graph::EdgeType
EdgeType
The type of edges (only used in derived classes).
Definition: Graph_d.h:901
ogdf::NodeElement::index
int index() const
Returns the (unique) node index.
Definition: Graph_d.h:267
ogdf::GraphAttributes::z
double z(node v) const
Returns the z-coordinate of node v.
Definition: GraphAttributes.h:277
ogdf::GraphAttributes::yLabel
double yLabel(node v) const
Returns the label y-coordinate of node v.
Definition: GraphAttributes.h:313
ogdf::GraphAttributes::fillBgColor
Color & fillBgColor(node v)
Returns the background color of fill patterns for node v.
Definition: GraphAttributes.h:540
ogdf::GraphAttributes::shape
Shape & shape(node v)
Returns the shape type of node v.
Definition: GraphAttributes.h:432
ogdf::GraphAttributes::type
Graph::NodeType & type(node v)
Returns the type of node v.
Definition: GraphAttributes.h:612
ogdf::GenericPolyline
Polylines with PointType points.
Definition: geometry.h:254
ogdf::GraphAttributes::m_nodeFill
NodeArray< Fill > m_nodeFill
fill of a node
Definition: GraphAttributes.h:84
ogdf::GraphAttributes::m_nodeLabelPosX
NodeArray< double > m_nodeLabelPosX
x-coordinate of a node label
Definition: GraphAttributes.h:76
ogdf::GraphAttributes::x
double x(node v) const
Returns the x-coordinate of node v.
Definition: GraphAttributes.h:241
ogdf::GraphAttributes::removeSubGraph
void removeSubGraph(edge e, int n)
Removes edge e from basic graph n.
Definition: GraphAttributes.h:862
ogdf::GraphAttributes::isUniformForNodes
bool isUniformForNodes(NodeAttributeGetter< T > attribute) const
Checks whether a certain attribute has the same value for all nodes.
Definition: GraphAttributes.h:993
ogdf::GraphAttributes::attributes
long attributes() const
Returns currently accessible attributes.
Definition: GraphAttributes.h:191
ogdf::GraphAttributes::width
const NodeArray< double > & width() const
Returns a reference to the node array m_width.
Definition: GraphAttributes.h:369
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:341
ogdf::GraphAttributes::addSubGraph
void addSubGraph(edge e, int n)
Adds edge e to basic graph n.
Definition: GraphAttributes.h:851
ogdf::edgeType
long long edgeType
Definition: EdgeTypePatterns.h:42
ogdf::GraphAttributes::EdgeAttributeGetter
T(GraphAttributes::*)(edge) const EdgeAttributeGetter
type of edge attribute getter functions
Definition: GraphAttributes.h:982
ogdf::GraphAttributes::m_edgeStroke
EdgeArray< Stroke > m_edgeStroke
stroke of an edge
Definition: GraphAttributes.h:96
ogdf::GraphAttributes::z
double & z(node v)
Returns the z-coordinate of node v.
Definition: GraphAttributes.h:286
ogdf::GraphAttributes::nodeWeight
static const long nodeWeight
Corresponds to node attribute weight(node).
Definition: GraphAttributes.h:157
ogdf::GraphAttributes::xLabel
double & xLabel(node v)
Returns the label x-coordinate of node v.
Definition: GraphAttributes.h:304
ogdf::GraphAttributes::m_edgeLabel
EdgeArray< string > m_edgeLabel
label of an edge
Definition: GraphAttributes.h:94
ogdf::GraphAttributes::directed
bool directed() const
Returns if the graph is directed.
Definition: GraphAttributes.h:226
ogdf::GraphAttributes::isUniformForEdges
bool isUniformForEdges(EdgeAttributeGetter< T > attribute) const
Checks whether a certain attribute has the same value for all edges.
Definition: GraphAttributes.h:1017
ogdf::GraphAttributes::constGraph
const Graph & constGraph() const
Returns a reference to the associated graph.
Definition: GraphAttributes.h:217
ogdf::GraphAttributes::nodeBoundingBoxes
void nodeBoundingBoxes(NodeArray< Rectangle > &boundingBoxes) const
Computes the bounding rectangle for each node.
Definition: GraphAttributes.h:1090
ogdf::GraphAttributes::m_vType
NodeArray< Graph::NodeType > m_vType
type (vertex, dummy, generalizationMerger)
Definition: GraphAttributes.h:90
ogdf::GraphAttributes::strokeWidth
float & strokeWidth(node v)
Returns the stroke width of node v.
Definition: GraphAttributes.h:486
ogdf::GraphAttributes::edgeLabel
static const long edgeLabel
Corresponds to edge attribute label(edge).
Definition: GraphAttributes.h:125
ogdf::GraphAttributes::NodeAttributeGetter
T(GraphAttributes::*)(node) const NodeAttributeGetter
type of node attribute getter functions
Definition: GraphAttributes.h:978
ogdf::GraphAttributes::height
const NodeArray< double > & height() const
Returns a reference to the node array m_height.
Definition: GraphAttributes.h:405
ogdf::GraphAttributes::bends
DPolyline & bends(edge e)
Returns the list of bend points of edge e.
Definition: GraphAttributes.h:669
ogdf::GraphAttributes::m_pGraph
const Graph * m_pGraph
associated graph
Definition: GraphAttributes.h:68
ogdf::GraphAttributes::bends
const DPolyline & bends(edge e) const
Returns the list of bend points of edge e.
Definition: GraphAttributes.h:658
ogdf::GraphAttributes::type
Graph::NodeType type(node v) const
Returns the type of node v.
Definition: GraphAttributes.h:603
ogdf::GraphAttributes::m_subGraph
EdgeArray< uint32_t > m_subGraph
is element of subgraphs given by bitvector
Definition: GraphAttributes.h:102
ogdf::GraphAttributes::m_nodeStroke
NodeArray< Stroke > m_nodeStroke
stroke of a node
Definition: GraphAttributes.h:83
ogdf::GraphAttributes::weight
int & weight(node v)
Returns the weight of node v.
Definition: GraphAttributes.h:594
ogdf::GraphAttributes::strokeType
StrokeType & strokeType(edge e)
Returns the stroke type of edge e.
Definition: GraphAttributes.h:705
ogdf::edge
EdgeElement * edge
The type of edges.
Definition: Graph_d.h:67
ogdf::GraphAttributes::strokeWidth
float strokeWidth(edge e) const
Returns the stroke width of edge e.
Definition: GraphAttributes.h:732
ogdf::GraphAttributes::shape
Shape shape(node v) const
Returns the shape type of node v.
Definition: GraphAttributes.h:423
ogdf::GraphAttributes::y
double y(node v) const
Returns the y-coordinate of node v.
Definition: GraphAttributes.h:259
ogdf::GraphAttributes::inSubGraph
bool inSubGraph(edge e, int n) const
Checks whether edge e belongs to basic graph n.
Definition: GraphAttributes.h:840
ogdf::GraphAttributes::type
Graph::EdgeType type(edge e) const
Returns the type of edge e.
Definition: GraphAttributes.h:804
ogdf::GraphAttributes::weight
int weight(node v) const
Returns the weight of node v.
Definition: GraphAttributes.h:585
ogdf::Graph::EdgeType::association
@ association
ogdf::GraphAttributes::edgeType
static const long edgeType
Corresponds to edge attribute type(edge).
Definition: GraphAttributes.h:131
ogdf::GraphAttributes::fillPattern
FillPattern & fillPattern(node v)
Returns the fill pattern of node v.
Definition: GraphAttributes.h:504
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:822
LayoutStandards.h
Declares class LayoutStandards which specifies default / standard values used in graph layouts.
ogdf::DRect
Rectangles with real coordinates.
Definition: geometry.h:791
ogdf::GraphAttributes::nodeTemplate
static const long nodeTemplate
Corresponds to node attribute templateNode(node).
Definition: GraphAttributes.h:150
EdgeArray.h
Declaration and implementation of EdgeArray class.
ogdf::GraphAttributes::m_x
NodeArray< double > m_x
x-coordinate of a node
Definition: GraphAttributes.h:73
ogdf::GraphAttributes::y
double & y(node v)
Returns the y-coordinate of node v.
Definition: GraphAttributes.h:268
ogdf::GraphAttributes::label
string & label(node v)
Returns the label of node v.
Definition: GraphAttributes.h:558
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:63
ogdf::GraphAttributes::nodeLabelPosition
static const long nodeLabelPosition
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).
Definition: GraphAttributes.h:163
ogdf::GraphAttributes::xLabel
double xLabel(node v) const
Returns the label x-coordinate of node v.
Definition: GraphAttributes.h:295
ogdf::GraphAttributes::strokeColor
Color & strokeColor(edge e)
Returns the stroke color of edge e.
Definition: GraphAttributes.h:723
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::GraphAttributes::point
DPoint point(node v) const
Returns a DPoint corresponding to the x- and y-coordinates of v.
Definition: GraphAttributes.h:1044
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::GraphAttributes::templateNode
string & templateNode(node v)
Returns the template name of node v.
Definition: GraphAttributes.h:576
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::GraphAttributes::height
double height(node v) const
Returns the height of the bounding box of node v.
Definition: GraphAttributes.h:387
ogdf::GraphAttributes::height
NodeArray< double > & height()
Returns a reference to the node array m_height.
Definition: GraphAttributes.h:414
ogdf::EdgeArrow
EdgeArrow
Types for edge arrows.
Definition: graphics.h:141
ogdf::Graph::NodeType
NodeType
The type of nodes.
Definition: Graph_d.h:904
ogdf::GraphAttributes::nodeLabel
static const long nodeLabel
Corresponds to node attribute label(node).
Definition: GraphAttributes.h:128
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:696
ogdf::GraphAttributes::m_nodeTemplate
NodeArray< string > m_nodeTemplate
name of template of a node
Definition: GraphAttributes.h:85
ogdf::GraphAttributes::flipVertical
virtual void flipVertical()
Flips the layout vertically within its bounding box.
Definition: GraphAttributes.h:913
ogdf::GraphAttributes::arrowType
EdgeArrow & arrowType(edge e)
Returns the arrow type of edge e.
Definition: GraphAttributes.h:687
ogdf::DPoint
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
Definition: geometry.h:237
ogdf::GraphAttributes::fillColor
Color & fillColor(node v)
Returns the fill color of node v.
Definition: GraphAttributes.h:522
ogdf::GraphAttributes::isAssociationClass
bool isAssociationClass(node v) const
Returns true iff v represents an association class.
Definition: GraphAttributes.h:1152
ogdf::GraphAttributes::m_doubleWeight
EdgeArray< double > m_doubleWeight
(real number) weight of an edge
Definition: GraphAttributes.h:100
ogdf::graphics::init
void init()
Definition: graphics.h:446
ogdf::GraphAttributes::edgeArrow
static const long edgeArrow
Corresponds to edge attribute arrowType(edge).
Definition: GraphAttributes.h:140
ogdf::GraphAttributes::edgeGraphics
static const long edgeGraphics
Corresponds to edge attribute bends(edge).
Definition: GraphAttributes.h:116
ogdf::GraphAttributes::edgeSubGraphs
static const long edgeSubGraphs
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge,...
Definition: GraphAttributes.h:154
ogdf::GraphAttributes::strokeWidth
float & strokeWidth(edge e)
Returns the stroke width of edge e.
Definition: GraphAttributes.h:741
ogdf::GraphAttributes::directed
bool & directed()
Returns if the graph is directed.
Definition: GraphAttributes.h:229
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::GraphAttributes::m_z
NodeArray< double > m_z
z-coordinate of a node
Definition: GraphAttributes.h:75
ogdf::GraphAttributes::templateNode
const string & templateNode(node v) const
Returns the template name of node v.
Definition: GraphAttributes.h:567
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:960
ogdf::GraphAttributes::m_nodeIntWeight
NodeArray< int > m_nodeIntWeight
(integer) weight of a node
Definition: GraphAttributes.h:89
ogdf::GraphAttributes::m_directed
bool m_directed
whether or not the graph is directed
Definition: GraphAttributes.h:70
ogdf::GraphAttributes::scale
virtual void scale(double s, bool scaleNodes=true)
Scales the layout by s.
Definition: GraphAttributes.h:896
ogdf::GraphAttributes::m_nodeId
NodeArray< int > m_nodeId
user ID of a node
Definition: GraphAttributes.h:88
ogdf::GraphAttributes::width
double & width(node v)
Returns the width of the bounding box of node v.
Definition: GraphAttributes.h:360
ogdf::GraphAttributes::m_width
NodeArray< double > m_width
width of a node's bounding box
Definition: GraphAttributes.h:79
ogdf::Shape
Shape
Types for node shapes.
Definition: graphics.h:116
ogdf::GraphAttributes::m_edgeArrow
EdgeArray< EdgeArrow > m_edgeArrow
arrow type of an edge
Definition: GraphAttributes.h:95
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:356
ogdf::GraphAttributes::x
double & x(node v)
Returns the x-coordinate of node v.
Definition: GraphAttributes.h:250
ogdf::GraphAttributes::idNode
int idNode(node v) const
Returns the user ID of node v.
Definition: GraphAttributes.h:623
ogdf::GraphAttributes::type
Graph::EdgeType & type(edge e)
Returns the type of edge e.
Definition: GraphAttributes.h:813
ogdf::GraphAttributes::doubleWeight
double & doubleWeight(edge e)
Returns the (real number) weight of edge e.
Definition: GraphAttributes.h:795
ogdf::GraphAttributes::intWeight
int & intWeight(edge e)
Returns the (integer) weight of edge e.
Definition: GraphAttributes.h:777
ogdf::GraphAttributes::subGraphBits
uint32_t & subGraphBits(edge e)
Returns the edgesubgraph value of an edge e.
Definition: GraphAttributes.h:831
ogdf::GraphAttributes::strokeColor
const Color & strokeColor(node v) const
Returns the stroke color of node v.
Definition: GraphAttributes.h:459
ogdf::GraphAttributes::intWeight
int intWeight(edge e) const
Returns the (integer) weight of edge e.
Definition: GraphAttributes.h:768
ogdf::GraphAttributes::label
string & label(edge e)
Returns the label of edge e.
Definition: GraphAttributes.h:759
ogdf::GraphAttributes::edgeDoubleWeight
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
Definition: GraphAttributes.h:122
ogdf::GraphAttributes::flipHorizontal
virtual void flipHorizontal()
Flips the layout horizontally within its bounding box.
Definition: GraphAttributes.h:927
ogdf::GraphAttributes::doubleWeight
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
Definition: GraphAttributes.h:786
ogdf::GraphAttributes::m_nodeLabelPosY
NodeArray< double > m_nodeLabelPosY
y-coordinate of a node label
Definition: GraphAttributes.h:77
ogdf::GraphAttributes::m_height
NodeArray< double > m_height
height of a nodes's bounding box
Definition: GraphAttributes.h:80
ogdf::GraphAttributes::nodeType
static const long nodeType
Corresponds to node attribute type(node).
Definition: GraphAttributes.h:134
ogdf::FillPattern
FillPattern
Fill patterns.
Definition: graphics.h:82
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::GraphAttributes::width
NodeArray< double > & width()
Returns a reference to the node array #m_width.
Definition: GraphAttributes.h:378
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:113
ogdf::GraphAttributes::strokeColor
const Color & strokeColor(edge e) const
Returns the stroke color of edge e.
Definition: GraphAttributes.h:714
ogdf::GraphAttributes::nodeId
static const long nodeId
Corresponds to node attribute idNode(node).
Definition: GraphAttributes.h:137
ogdf::GraphAttributes::m_intWeight
EdgeArray< int > m_intWeight
(integer) weight of an edge
Definition: GraphAttributes.h:99
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:160
ogdf::GraphAttributes::strokeType
StrokeType strokeType(node v) const
Returns the stroke type of node v.
Definition: GraphAttributes.h:441
ogdf::GraphAttributes::label
const string & label(node v) const
Returns the label of node v.
Definition: GraphAttributes.h:549
ogdf::GraphAttributes::has
bool has(long attr) const
Returns true iff all attributes in attr are available.
Definition: GraphAttributes.h:194
ogdf::GraphAttributes::m_eType
EdgeArray< Graph::EdgeType > m_eType
type of an edge (association or generalization)
Definition: GraphAttributes.h:101
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709
ogdf::GraphAttributes::m_bends
EdgeArray< DPolyline > m_bends
list of bend points of an edge
Definition: GraphAttributes.h:93
ogdf::GraphAttributes::strokeWidth
float strokeWidth(node v) const
Returns the stroke width of node v.
Definition: GraphAttributes.h:477
ogdf::GraphAttributes::width
double width(node v) const
Returns the width of the bounding box of node v.
Definition: GraphAttributes.h:351