Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ParticleInfo.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/List.h>
36 #include <ogdf/basic/basic.h>
37 #include <ogdf/basic/comparer.h>
38 
39 #include <ostream>
40 
41 namespace ogdf {
42 namespace energybased {
43 namespace fmmm {
44 
48  friend std::ostream& operator<<(std::ostream& output, const ParticleInfo& A) {
49  output << " node_index " << A.vertex->index() << " x_y_coord " << A.x_y_coord
50  << (A.marked ? " marked " : " unmarked ") << " sublist_ptr ";
51  if (A.subList_ptr == nullptr) {
52  output << "nullptr";
53  } else {
54  output << A.subList_ptr;
55  }
56  return output;
57  }
58 
59 #if 0
60  friend std::istream &operator>> (std::istream & input, ParticleInfo & A)
62  {
63  input >> A;
64  return input;
65  }
66 #endif
67 
68 public:
71  : vertex(nullptr)
72  , x_y_coord(0)
73  , cross_ref_item(nullptr)
74  , subList_ptr(nullptr)
75  , copy_item(nullptr)
76  , marked(false)
77  , tmp_item(nullptr) { }
78 
79  void set_vertex(node v) { vertex = v; }
80 
81  void set_x_y_coord(double c) { x_y_coord = c; }
82 
83  void set_cross_ref_item(ListIterator<ParticleInfo> it) { cross_ref_item = it; }
84 
85  void set_subList_ptr(List<ParticleInfo>* ptr) { subList_ptr = ptr; }
86 
87  void set_copy_item(ListIterator<ParticleInfo> it) { copy_item = it; }
88 
89  void mark() { marked = true; }
90 
91  void unmark() { marked = false; }
92 
94 
95  node get_vertex() const { return vertex; }
96 
97  double get_x_y_coord() const { return x_y_coord; }
98 
99  ListIterator<ParticleInfo> get_cross_ref_item() const { return cross_ref_item; }
100 
101  List<ParticleInfo>* get_subList_ptr() const { return subList_ptr; }
102 
103  ListIterator<ParticleInfo> get_copy_item() const { return copy_item; }
104 
105  bool is_marked() const { return marked; }
106 
108 
109 private:
111  double x_y_coord;
112 
118 
123  bool marked;
124 
129 };
130 
131 OGDF_DECLARE_COMPARER(ParticleInfoComparer, ParticleInfo, double, x.get_x_y_coord());
132 
133 }
134 }
135 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::energybased::fmmm::ParticleInfo::copy_item
ListIterator< ParticleInfo > copy_item
the item of this entry in the copy List
Definition: ParticleInfo.h:122
ogdf::energybased::fmmm::ParticleInfo::is_marked
bool is_marked() const
Definition: ParticleInfo.h:105
ogdf::energybased::fmmm::ParticleInfo::set_subList_ptr
void set_subList_ptr(List< ParticleInfo > *ptr)
Definition: ParticleInfo.h:85
ogdf::energybased::fmmm::ParticleInfo::set_x_y_coord
void set_x_y_coord(double c)
Definition: ParticleInfo.h:81
ogdf::energybased::fmmm::ParticleInfo::mark
void mark()
Definition: ParticleInfo.h:89
ogdf::whaType::A
@ A
ogdf::energybased::fmmm::ParticleInfo::operator<<
friend std::ostream & operator<<(std::ostream &output, const ParticleInfo &A)
Output stream for ParticleInfo.
Definition: ParticleInfo.h:48
ogdf::energybased::fmmm::ParticleInfo::set_cross_ref_item
void set_cross_ref_item(ListIterator< ParticleInfo > it)
Definition: ParticleInfo.h:83
ogdf::energybased::fmmm::ParticleInfo::x_y_coord
double x_y_coord
the x (resp.
Definition: ParticleInfo.h:111
ogdf::energybased::fmmm::ParticleInfo::set_vertex
void set_vertex(node v)
Definition: ParticleInfo.h:79
ogdf::energybased::fmmm::ParticleInfo::vertex
node vertex
the vertex of G that is associated with this attributes
Definition: ParticleInfo.h:110
ogdf::energybased::fmmm::ParticleInfo::get_x_y_coord
double get_x_y_coord() const
Definition: ParticleInfo.h:97
ogdf::energybased::fmmm::ParticleInfo
Helping data structure for building up the reduced quad tree by NMM.
Definition: ParticleInfo.h:46
ogdf::energybased::fmmm::ParticleInfo::get_tmp_cross_ref_item
ListIterator< ParticleInfo > get_tmp_cross_ref_item() const
Definition: ParticleInfo.h:107
ogdf::energybased::fmmm::ParticleInfo::unmark
void unmark()
Definition: ParticleInfo.h:91
ogdf::energybased::fmmm::ParticleInfo::set_tmp_cross_ref_item
void set_tmp_cross_ref_item(ListIterator< ParticleInfo > it)
Definition: ParticleInfo.h:93
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::energybased::fmmm::ParticleInfo::get_vertex
node get_vertex() const
Definition: ParticleInfo.h:95
ogdf::energybased::fmmm::ParticleInfo::marked
bool marked
indicates if this ParticleInfo object is marked or not
Definition: ParticleInfo.h:123
ogdf::energybased::fmmm::ParticleInfo::get_copy_item
ListIterator< ParticleInfo > get_copy_item() const
Definition: ParticleInfo.h:103
ogdf::energybased::fmmm::ParticleInfo::cross_ref_item
ListIterator< ParticleInfo > cross_ref_item
the Listiterator of the ParticleInfo-Element that containes the vertex in the List storing the other ...
Definition: ParticleInfo.h:117
ogdf::energybased::fmmm::ParticleInfo::get_subList_ptr
List< ParticleInfo > * get_subList_ptr() const
Definition: ParticleInfo.h:101
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::energybased::fmmm::OGDF_DECLARE_COMPARER
OGDF_DECLARE_COMPARER(ParticleInfoComparer, ParticleInfo, double, x.get_x_y_coord())
List.h
Declaration of doubly linked lists and iterators.
ogdf::energybased::fmmm::ParticleInfo::ParticleInfo
ParticleInfo()
constructor
Definition: ParticleInfo.h:70
ogdf::operator>>
std::istream & operator>>(std::istream &is, TokenIgnorer token)
ogdf::ListIteratorBase
Encapsulates a pointer to a list element.
Definition: List.h:51
ogdf::energybased::fmmm::ParticleInfo::get_cross_ref_item
ListIterator< ParticleInfo > get_cross_ref_item() const
Definition: ParticleInfo.h:99
ogdf::energybased::fmmm::ParticleInfo::set_copy_item
void set_copy_item(ListIterator< ParticleInfo > it)
Definition: ParticleInfo.h:87
comparer.h
Declarations for Comparer objects.
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::energybased::fmmm::ParticleInfo::tmp_item
ListIterator< ParticleInfo > tmp_item
A temporary item that is used to construct the cross references for the copy_Lists and the subLists.
Definition: ParticleInfo.h:128
ogdf::energybased::fmmm::ParticleInfo::subList_ptr
List< ParticleInfo > * subList_ptr
Points to the subList of L_x(L_y) where the actual entry of ParticleInfo has to be stored.
Definition: ParticleInfo.h:121