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/Graph.h>
39 #include <ogdf/basic/GraphList.h>
40 #include <ogdf/basic/basic.h>
41 #include <ogdf/basic/geometry.h>
42 #include <ogdf/basic/graphics.h>
44 
45 #include <cstdint>
46 #include <string>
47 
48 namespace ogdf {
49 template<class E>
50 class List;
51 
53 
73 protected:
74  const Graph* m_pGraph;
75 
76  bool m_directed;
77 
78  // graphical representation of nodes
92 
93  // other node attributes
97 
98  // graphical representation of edges
103 
104  // other edge attributes
109 
111 
112 public:
116 
119  static const long nodeGraphics;
120 
122  static const long edgeGraphics;
123 
125  static const long edgeIntWeight;
126 
128  static const long edgeDoubleWeight;
129 
131  static const long edgeLabel;
132 
134  static const long nodeLabel;
135 
137  static const long edgeType;
138 
140  static const long nodeType;
141 
143  static const long nodeId;
144 
146  static const long edgeArrow;
147 
149  static const long edgeStyle;
150 
153  static const long nodeStyle;
154 
156  static const long nodeTemplate;
157 
160  static const long edgeSubGraphs;
161 
163  static const long nodeWeight;
164 
166  static const long threeD;
167 
169  static const long nodeLabelPosition;
170 
172  static const long all;
173 
175 
179 
182 
185  GraphAttributes();
186 
188 
192  explicit GraphAttributes(const Graph& G, long attr = nodeGraphics | edgeGraphics);
193 
194  virtual ~GraphAttributes() = default;
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 
220  void destroyAttributes(long attr);
221 
223  const Graph& constGraph() const { return *m_pGraph; }
224 
226 
229 
232  bool directed() const { return m_directed; }
233 
235  bool& directed() { return m_directed; }
236 
238 
241 
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 
652 
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 
828  uint32_t subGraphBits(edge e) const {
829  OGDF_ASSERT(has(edgeSubGraphs));
830  return m_subGraph[e];
831  }
832 
834 
837  uint32_t& subGraphBits(edge e) {
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 
879 
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 
980 
983  template<typename T>
984  using NodeAttributeGetter = T (GraphAttributes::*)(node) const;
985 
987  template<typename T>
988  using EdgeAttributeGetter = T (GraphAttributes::*)(edge) const;
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 
1065  void transferToOriginal(GraphAttributes& origAttr) const;
1066 
1068 
1081  void transferToCopy(GraphAttributes& copyAttr) const;
1082 
1084 
1087  virtual DRect boundingBox() const;
1088 
1090 
1095  template<class Rectangle = DRect>
1096  void nodeBoundingBoxes(NodeArray<Rectangle>& boundingBoxes) const {
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 
1121  void clearAllBends();
1122 
1124 
1133  void removeUnnecessaryBendsHV();
1134 
1136 
1147  void addNodeCenter2Bends(int mode = 1);
1148 
1150 
1159 
1161 
1169  int hierarchyList(List<List<node>*>& list) const;
1170 
1172 
1180  int hierarchyList(List<List<edge>*>& list) const;
1181 
1183 
1184 private:
1186  void copyNodeAttributes(GraphAttributes& toAttr, node vFrom, node vTo, long attrs) const;
1187 
1189  void copyEdgeAttributes(GraphAttributes& toAttr, edge eFrom, edge eTo, long attrs) const;
1190 };
1191 
1192 }
ogdf::GraphAttributes::height
double & height(node v)
Returns the height of the bounding box of node v.
Definition: GraphAttributes.h:402
ogdf::GraphAttributes::edgeIntWeight
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
Definition: GraphAttributes.h:125
ogdf::GraphAttributes::yLabel
double & yLabel(node v)
Returns the label y-coordinate of node v.
Definition: GraphAttributes.h:328
ogdf::Color
Colors represented as RGBA values.
Definition: graphics.h:164
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
ogdf::GraphAttributes::strokeType
StrokeType & strokeType(node v)
Returns the stroke type of node v.
Definition: GraphAttributes.h:456
ogdf::GraphAttributes::idNode
int & idNode(node v)
Returns the user ID of node v.
Definition: GraphAttributes.h:640
ogdf::GraphAttributes::label
const string & label(edge e) const
Returns the label of edge e.
Definition: GraphAttributes.h:756
ogdf::GraphAttributes::all
static const long all
Enables all available flags.
Definition: GraphAttributes.h:172
ogdf::GraphAttributes::m_nodeShape
NodeArray< Shape > m_nodeShape
shape of a node
Definition: GraphAttributes.h:87
Graph.h
Includes declaration of graph class.
ogdf::GenericPoint< double >
ogdf::GraphAttributes::m_y
NodeArray< double > m_y
y-coordinate of a node
Definition: GraphAttributes.h:80
graphics.h
Declaration of basic types for graphics.
ogdf::StrokeType
StrokeType
Line types of strokes.
Definition: graphics.h:50
ogdf::GraphAttributes::fillBgColor
const Color & fillBgColor(node v) const
Returns the background color of fill patterns for node v.
Definition: GraphAttributes.h:537
ogdf::Graph::NodeType::vertex
@ vertex
ogdf::GraphAttributes::m_nodeLabelPosZ
NodeArray< double > m_nodeLabelPosZ
z-coordinate of a node label
Definition: GraphAttributes.h:84
ogdf::GraphAttributes::zLabel
double zLabel(node v) const
Returns the label z-coordinate of node v.
Definition: GraphAttributes.h:337
ogdf::GraphAttributes::fillColor
const Color & fillColor(node v) const
Returns the fill color of node v.
Definition: GraphAttributes.h:519
ogdf::GraphAttributes::m_nodeLabel
NodeArray< string > m_nodeLabel
label of a node
Definition: GraphAttributes.h:88
ogdf::GraphAttributes::m_attributes
long m_attributes
bit vector of currently used attributes
Definition: GraphAttributes.h:110
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:501
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:66
ogdf::GraphAttributes::edgeStyle
static const long edgeStyle
Corresponds to edge attributes strokeColor(edge), strokeType(edge), and strokeWidth(edge).
Definition: GraphAttributes.h:149
ogdf::GraphAttributes::nodeStyle
static const long nodeStyle
Corresponds to node attributes strokeColor(node), strokeType(node), strokeWidth(node),...
Definition: GraphAttributes.h:153
ogdf::Graph::NodeType::associationClass
@ associationClass
ogdf::GraphAttributes::arrowType
EdgeArrow arrowType(edge e) const
Returns the arrow type of edge e.
Definition: GraphAttributes.h:684
ogdf::GraphAttributes::strokeColor
Color & strokeColor(node v)
Returns the stroke color of node v.
Definition: GraphAttributes.h:474
ogdf::Graph::EdgeType
EdgeType
The type of edges (only used in derived classes).
Definition: Graph_d.h:909
ogdf::NodeElement::index
int index() const
Returns the (unique) node index.
Definition: Graph_d.h:274
ogdf::GraphAttributes::z
double z(node v) const
Returns the z-coordinate of node v.
Definition: GraphAttributes.h:283
ogdf::GraphAttributes::yLabel
double yLabel(node v) const
Returns the label y-coordinate of node v.
Definition: GraphAttributes.h:319
ogdf::GraphAttributes::fillBgColor
Color & fillBgColor(node v)
Returns the background color of fill patterns for node v.
Definition: GraphAttributes.h:546
ogdf::GraphAttributes::shape
Shape & shape(node v)
Returns the shape type of node v.
Definition: GraphAttributes.h:438
ogdf::GraphAttributes::type
Graph::NodeType & type(node v)
Returns the type of node v.
Definition: GraphAttributes.h:618
ogdf::GenericPolyline
Polylines with PointType points.
Definition: geometry.h:261
ogdf::GraphAttributes::m_nodeFill
NodeArray< Fill > m_nodeFill
fill of a node
Definition: GraphAttributes.h:90
ogdf::GraphAttributes::m_nodeLabelPosX
NodeArray< double > m_nodeLabelPosX
x-coordinate of a node label
Definition: GraphAttributes.h:82
ogdf::GraphAttributes::x
double x(node v) const
Returns the x-coordinate of node v.
Definition: GraphAttributes.h:247
ogdf::GraphAttributes::removeSubGraph
void removeSubGraph(edge e, int n)
Removes edge e from basic graph n.
Definition: GraphAttributes.h:868
ogdf::GraphAttributes::isUniformForNodes
bool isUniformForNodes(NodeAttributeGetter< T > attribute) const
Checks whether a certain attribute has the same value for all nodes.
Definition: GraphAttributes.h:999
ogdf::GraphAttributes::attributes
long attributes() const
Returns currently accessible attributes.
Definition: GraphAttributes.h:197
ogdf::GraphAttributes::width
const NodeArray< double > & width() const
Returns a reference to the node array m_width.
Definition: GraphAttributes.h:375
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:347
ogdf::GraphAttributes::addSubGraph
void addSubGraph(edge e, int n)
Adds edge e to basic graph n.
Definition: GraphAttributes.h:857
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:988
ogdf::GraphAttributes::m_edgeStroke
EdgeArray< Stroke > m_edgeStroke
stroke of an edge
Definition: GraphAttributes.h:102
ogdf::GraphAttributes::z
double & z(node v)
Returns the z-coordinate of node v.
Definition: GraphAttributes.h:292
ogdf::GraphAttributes::nodeWeight
static const long nodeWeight
Corresponds to node attribute weight(node).
Definition: GraphAttributes.h:163
ogdf::GraphAttributes::xLabel
double & xLabel(node v)
Returns the label x-coordinate of node v.
Definition: GraphAttributes.h:310
ogdf::GraphAttributes::m_edgeLabel
EdgeArray< string > m_edgeLabel
label of an edge
Definition: GraphAttributes.h:100
ogdf::GraphAttributes::directed
bool directed() const
Returns if the graph is directed.
Definition: GraphAttributes.h:232
ogdf::GraphAttributes::isUniformForEdges
bool isUniformForEdges(EdgeAttributeGetter< T > attribute) const
Checks whether a certain attribute has the same value for all edges.
Definition: GraphAttributes.h:1023
ogdf::GraphAttributes::constGraph
const Graph & constGraph() const
Returns a reference to the associated graph.
Definition: GraphAttributes.h:223
ogdf::GraphAttributes::nodeBoundingBoxes
void nodeBoundingBoxes(NodeArray< Rectangle > &boundingBoxes) const
Computes the bounding rectangle for each node.
Definition: GraphAttributes.h:1096
ogdf::GraphAttributes::m_vType
NodeArray< Graph::NodeType > m_vType
type (vertex, dummy, generalizationMerger)
Definition: GraphAttributes.h:96
ogdf::GraphAttributes::strokeWidth
float & strokeWidth(node v)
Returns the stroke width of node v.
Definition: GraphAttributes.h:492
ogdf::GraphAttributes::edgeLabel
static const long edgeLabel
Corresponds to edge attribute label(edge).
Definition: GraphAttributes.h:131
ogdf::GraphAttributes::NodeAttributeGetter
T(GraphAttributes::*)(node) const NodeAttributeGetter
type of node attribute getter functions
Definition: GraphAttributes.h:984
ogdf::GraphAttributes::height
const NodeArray< double > & height() const
Returns a reference to the node array m_height.
Definition: GraphAttributes.h:411
ogdf::GraphAttributes::bends
DPolyline & bends(edge e)
Returns the list of bend points of edge e.
Definition: GraphAttributes.h:675
ogdf::GraphAttributes::m_pGraph
const Graph * m_pGraph
associated graph
Definition: GraphAttributes.h:74
ogdf::GraphAttributes::bends
const DPolyline & bends(edge e) const
Returns the list of bend points of edge e.
Definition: GraphAttributes.h:664
ogdf::GraphAttributes::type
Graph::NodeType type(node v) const
Returns the type of node v.
Definition: GraphAttributes.h:609
ogdf::GraphAttributes::m_subGraph
EdgeArray< uint32_t > m_subGraph
is element of subgraphs given by bitvector
Definition: GraphAttributes.h:108
ogdf::GraphAttributes::m_nodeStroke
NodeArray< Stroke > m_nodeStroke
stroke of a node
Definition: GraphAttributes.h:89
ogdf::GraphAttributes::weight
int & weight(node v)
Returns the weight of node v.
Definition: GraphAttributes.h:600
ogdf::GraphAttributes::strokeType
StrokeType & strokeType(edge e)
Returns the stroke type of edge e.
Definition: GraphAttributes.h:711
ogdf::edge
EdgeElement * edge
The type of edges.
Definition: Graph_d.h:74
ogdf::GraphAttributes::strokeWidth
float strokeWidth(edge e) const
Returns the stroke width of edge e.
Definition: GraphAttributes.h:738
ogdf::GraphAttributes::shape
Shape shape(node v) const
Returns the shape type of node v.
Definition: GraphAttributes.h:429
ogdf::GraphAttributes::y
double y(node v) const
Returns the y-coordinate of node v.
Definition: GraphAttributes.h:265
ogdf::GraphAttributes::inSubGraph
bool inSubGraph(edge e, int n) const
Checks whether edge e belongs to basic graph n.
Definition: GraphAttributes.h:846
ogdf::GraphAttributes::type
Graph::EdgeType type(edge e) const
Returns the type of edge e.
Definition: GraphAttributes.h:810
ogdf::GraphAttributes::weight
int weight(node v) const
Returns the weight of node v.
Definition: GraphAttributes.h:591
ogdf::Graph::EdgeType::association
@ association
ogdf::GraphAttributes::edgeType
static const long edgeType
Corresponds to edge attribute type(edge).
Definition: GraphAttributes.h:137
ogdf::GraphAttributes::fillPattern
FillPattern & fillPattern(node v)
Returns the fill pattern of node v.
Definition: GraphAttributes.h:510
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:828
GraphList.h
Decralation of GraphElement and GraphList classes.
ogdf::DRect
Rectangles with real coordinates.
Definition: geometry.h:798
ogdf::GraphAttributes::nodeTemplate
static const long nodeTemplate
Corresponds to node attribute templateNode(node).
Definition: GraphAttributes.h:156
ogdf::GraphAttributes::m_x
NodeArray< double > m_x
x-coordinate of a node
Definition: GraphAttributes.h:79
ogdf::GraphAttributes::y
double & y(node v)
Returns the y-coordinate of node v.
Definition: GraphAttributes.h:274
ogdf::GraphAttributes::label
string & label(node v)
Returns the label of node v.
Definition: GraphAttributes.h:564
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:70
ogdf::GraphAttributes::nodeLabelPosition
static const long nodeLabelPosition
Corresponds to node attributes xLabel(node), yLabel(node), and zLabel(node).
Definition: GraphAttributes.h:169
ogdf::GraphAttributes::xLabel
double xLabel(node v) const
Returns the label x-coordinate of node v.
Definition: GraphAttributes.h:301
ogdf::GraphAttributes::strokeColor
Color & strokeColor(edge e)
Returns the stroke color of edge e.
Definition: GraphAttributes.h:729
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.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:1050
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::GraphAttributes::templateNode
string & templateNode(node v)
Returns the template name of node v.
Definition: GraphAttributes.h:582
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::GraphAttributes::height
double height(node v) const
Returns the height of the bounding box of node v.
Definition: GraphAttributes.h:393
ogdf::GraphAttributes::height
NodeArray< double > & height()
Returns a reference to the node array m_height.
Definition: GraphAttributes.h:420
ogdf::EdgeArrow
EdgeArrow
Types for edge arrows.
Definition: graphics.h:145
ogdf::Graph::NodeType
NodeType
The type of nodes.
Definition: Graph_d.h:912
ogdf::GraphAttributes::nodeLabel
static const long nodeLabel
Corresponds to node attribute label(node).
Definition: GraphAttributes.h:134
graph_iterators.h
Decralation of graph iterators.
ogdf::GraphAttributes::strokeType
StrokeType strokeType(edge e) const
Returns the stroke type of edge e.
Definition: GraphAttributes.h:702
ogdf::GraphAttributes::m_nodeTemplate
NodeArray< string > m_nodeTemplate
name of template of a node
Definition: GraphAttributes.h:91
ogdf::GraphAttributes::flipVertical
virtual void flipVertical()
Flips the layout vertically within its bounding box.
Definition: GraphAttributes.h:919
ogdf::GraphAttributes::arrowType
EdgeArrow & arrowType(edge e)
Returns the arrow type of edge e.
Definition: GraphAttributes.h:693
ogdf::DPoint
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
Definition: geometry.h:244
ogdf::GraphAttributes::fillColor
Color & fillColor(node v)
Returns the fill color of node v.
Definition: GraphAttributes.h:528
ogdf::GraphAttributes::isAssociationClass
bool isAssociationClass(node v) const
Returns true iff v represents an association class.
Definition: GraphAttributes.h:1158
ogdf::GraphAttributes::m_doubleWeight
EdgeArray< double > m_doubleWeight
(real number) weight of an edge
Definition: GraphAttributes.h:106
ogdf::graphics::init
void init()
Definition: graphics.h:450
ogdf::GraphAttributes::edgeArrow
static const long edgeArrow
Corresponds to edge attribute arrowType(edge).
Definition: GraphAttributes.h:146
ogdf::GraphAttributes::edgeGraphics
static const long edgeGraphics
Corresponds to edge attribute bends(edge).
Definition: GraphAttributes.h:122
ogdf::GraphAttributes::edgeSubGraphs
static const long edgeSubGraphs
Corresponds to edge attributes modified by addSubGraph(edge, int), inSubGraph(edge,...
Definition: GraphAttributes.h:160
ogdf::GraphAttributes::strokeWidth
float & strokeWidth(edge e)
Returns the stroke width of edge e.
Definition: GraphAttributes.h:747
basic.h
Basic declarations, included by all source files.
ogdf::GraphAttributes::directed
bool & directed()
Returns if the graph is directed.
Definition: GraphAttributes.h:235
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:81
ogdf::GraphAttributes::templateNode
const string & templateNode(node v) const
Returns the template name of node v.
Definition: GraphAttributes.h:573
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:966
ogdf::GraphAttributes::m_nodeIntWeight
NodeArray< int > m_nodeIntWeight
(integer) weight of a node
Definition: GraphAttributes.h:95
ogdf::GraphAttributes::m_directed
bool m_directed
whether or not the graph is directed
Definition: GraphAttributes.h:76
ogdf::GraphAttributes::scale
virtual void scale(double s, bool scaleNodes=true)
Scales the layout by s.
Definition: GraphAttributes.h:902
ogdf::GraphAttributes::m_nodeId
NodeArray< int > m_nodeId
user ID of a node
Definition: GraphAttributes.h:94
ogdf::GraphAttributes::width
double & width(node v)
Returns the width of the bounding box of node v.
Definition: GraphAttributes.h:366
ogdf::GraphAttributes::m_width
NodeArray< double > m_width
width of a node's bounding box
Definition: GraphAttributes.h:85
ogdf::Shape
Shape
Types for node shapes.
Definition: graphics.h:120
ogdf::GraphAttributes::m_edgeArrow
EdgeArray< EdgeArrow > m_edgeArrow
arrow type of an edge
Definition: GraphAttributes.h:101
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::GraphAttributes::x
double & x(node v)
Returns the x-coordinate of node v.
Definition: GraphAttributes.h:256
ogdf::GraphAttributes::idNode
int idNode(node v) const
Returns the user ID of node v.
Definition: GraphAttributes.h:629
ogdf::GraphAttributes::type
Graph::EdgeType & type(edge e)
Returns the type of edge e.
Definition: GraphAttributes.h:819
ogdf::GraphAttributes::doubleWeight
double & doubleWeight(edge e)
Returns the (real number) weight of edge e.
Definition: GraphAttributes.h:801
ogdf::GraphAttributes::intWeight
int & intWeight(edge e)
Returns the (integer) weight of edge e.
Definition: GraphAttributes.h:783
ogdf::GraphAttributes::subGraphBits
uint32_t & subGraphBits(edge e)
Returns the edgesubgraph value of an edge e.
Definition: GraphAttributes.h:837
ogdf::GraphAttributes::strokeColor
const Color & strokeColor(node v) const
Returns the stroke color of node v.
Definition: GraphAttributes.h:465
ogdf::GraphAttributes::intWeight
int intWeight(edge e) const
Returns the (integer) weight of edge e.
Definition: GraphAttributes.h:774
ogdf::GraphAttributes::label
string & label(edge e)
Returns the label of edge e.
Definition: GraphAttributes.h:765
ogdf::GraphAttributes::edgeDoubleWeight
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
Definition: GraphAttributes.h:128
ogdf::GraphAttributes::flipHorizontal
virtual void flipHorizontal()
Flips the layout horizontally within its bounding box.
Definition: GraphAttributes.h:933
ogdf::GraphAttributes::doubleWeight
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
Definition: GraphAttributes.h:792
ogdf::GraphAttributes::m_nodeLabelPosY
NodeArray< double > m_nodeLabelPosY
y-coordinate of a node label
Definition: GraphAttributes.h:83
ogdf::GraphAttributes::m_height
NodeArray< double > m_height
height of a nodes's bounding box
Definition: GraphAttributes.h:86
ogdf::GraphAttributes::nodeType
static const long nodeType
Corresponds to node attribute type(node).
Definition: GraphAttributes.h:140
ogdf::FillPattern
FillPattern
Fill patterns.
Definition: graphics.h:86
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::GraphAttributes::width
NodeArray< double > & width()
Returns a reference to the node array #m_width.
Definition: GraphAttributes.h:384
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:119
ogdf::GraphAttributes::strokeColor
const Color & strokeColor(edge e) const
Returns the stroke color of edge e.
Definition: GraphAttributes.h:720
ogdf::GraphAttributes::nodeId
static const long nodeId
Corresponds to node attribute idNode(node).
Definition: GraphAttributes.h:143
ogdf::GraphAttributes::m_intWeight
EdgeArray< int > m_intWeight
(integer) weight of an edge
Definition: GraphAttributes.h:105
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:166
ogdf::GraphAttributes::strokeType
StrokeType strokeType(node v) const
Returns the stroke type of node v.
Definition: GraphAttributes.h:447
ogdf::GraphAttributes::label
const string & label(node v) const
Returns the label of node v.
Definition: GraphAttributes.h:555
ogdf::GraphAttributes::has
bool has(long attr) const
Returns true iff all attributes in attr are available.
Definition: GraphAttributes.h:200
ogdf::GraphAttributes::m_eType
EdgeArray< Graph::EdgeType > m_eType
type of an edge (association or generalization)
Definition: GraphAttributes.h:107
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::GraphAttributes::m_bends
EdgeArray< DPolyline > m_bends
list of bend points of an edge
Definition: GraphAttributes.h:99
ogdf::GraphAttributes::strokeWidth
float strokeWidth(node v) const
Returns the stroke width of node v.
Definition: GraphAttributes.h:483
ogdf::GraphAttributes::width
double width(node v) const
Returns the width of the bounding box of node v.
Definition: GraphAttributes.h:357