Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

Node.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Graph.h>
36 
37 namespace ogdf {
38 namespace energybased {
39 namespace fmmm {
40 
43 class Node
44 {
45  friend int value(const Node& A) { return A.value; }
46 
47  friend std::ostream &operator<< (std::ostream & output,const Node & A)
48  {
49  output <<"node index ";
50  if(A.vertex == nullptr)
51  output<<"nil";
52  else
53  output<<A.vertex->index();
54  output<<" value "<< A.value;
55  return output;
56  }
57 
58  friend std::istream &operator>> (std::istream & input,Node & A) {
59  input >> A.value;
60  return input;
61  }
62 
63 public:
65  Node() { vertex = nullptr; value = 0; }
66 
67  void set_Node(node v,int a) { vertex = v; value = a; }
68  int get_value() const { return value; }
69  node get_node() const { return vertex; }
70 
71 private:
73  int value ;
74 };
75 
76 }
77 }
78 }
friend int value(const Node &A)
Definition: Node.h:45
void set_Node(node v, int a)
Definition: Node.h:67
int get_value() const
Definition: Node.h:68
friend std::ostream & operator<<(std::ostream &output, const Node &A)
Definition: Node.h:47
Data structure for representing nodes and an int value (needed for class ogdf/list) to perform bucket...
Definition: Node.h:43
Class for the representation of nodes.
Definition: Graph_d.h:169
Includes declaration of graph class.
int index() const
Returns the (unique) node index.
Definition: Graph_d.h:203
The namespace for all OGDF objects.
friend std::istream & operator>>(std::istream &input, Node &A)
Definition: Node.h:58
node get_node() const
Definition: Node.h:69
Node()
Constructor.
Definition: Node.h:65