Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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  friend int value(const Node& A) { return A.value; }
45 
46  friend std::ostream& operator<<(std::ostream& output, const Node& A) {
47  output << "node index ";
48  if (A.vertex == nullptr) {
49  output << "nil";
50  } else {
51  output << A.vertex->index();
52  }
53  output << " value " << A.value;
54  return output;
55  }
56 
57  friend std::istream& operator>>(std::istream& input, Node& A) {
58  input >> A.value;
59  return input;
60  }
61 
62 public:
64  Node() {
65  vertex = nullptr;
66  value = 0;
67  }
68 
69  void set_Node(node v, int a) {
70  vertex = v;
71  value = a;
72  }
73 
74  int get_value() const { return value; }
75 
76  node get_node() const { return vertex; }
77 
78 private:
80  int value;
81 };
82 
83 }
84 }
85 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
Graph.h
Includes declaration of graph class.
ogdf::energybased::fmmm::Node::set_Node
void set_Node(node v, int a)
Definition: Node.h:69
ogdf::whaType::A
@ A
ogdf::energybased::fmmm::Node
Data structure for representing nodes and an int value (needed for class ogdf/list) to perform bucket...
Definition: Node.h:43
ogdf::energybased::fmmm::Node::get_node
node get_node() const
Definition: Node.h:76
ogdf::energybased::fmmm::Node::value
int value
Definition: Node.h:80
ogdf::energybased::fmmm::Node::Node
Node()
Constructor.
Definition: Node.h:64
ogdf::energybased::fmmm::Node::operator>>
friend std::istream & operator>>(std::istream &input, Node &A)
Definition: Node.h:57
ogdf::energybased::fmmm::Node::get_value
int get_value() const
Definition: Node.h:74
ogdf::energybased::fmmm::Node::value
friend int value(const Node &A)
Definition: Node.h:44
ogdf::energybased::fmmm::Node::operator<<
friend std::ostream & operator<<(std::ostream &output, const Node &A)
Definition: Node.h:46
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::energybased::fmmm::Node::vertex
node vertex
Definition: Node.h:79