Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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 
37 namespace ogdf {
38 namespace energybased {
39 namespace fmmm {
40 
43 {
45  friend ostream &operator<< (ostream & output, const ParticleInfo & A)
46  {
47  output <<" node_index "<<A.vertex->index()<<" x_y_coord "<<A.x_y_coord;
48  if(A.marked == true)
49  output<<" marked ";
50  else
51  output<<" unmarked ";
52  output<<" sublist_ptr ";
53  if (A.subList_ptr == nullptr)
54  output<<"nullptr";
55  else
56  output<<A.subList_ptr;
57  return output;
58  }
59 
60 #if 0
61  friend istream &operator>> (istream & input, ParticleInfo & A)
63  {
64  input >> A;
65  return input;
66  }
67 #endif
68 
69 public:
70 
73  vertex(nullptr),
74  x_y_coord(0),
75  cross_ref_item(nullptr),
76  subList_ptr(nullptr),
77  copy_item(nullptr),
78  marked(false),
79  tmp_item(nullptr)
80  { }
81 
83 
84  void set_vertex(node v) { vertex = v; }
85  void set_x_y_coord(double c) { x_y_coord = c; }
86  void set_cross_ref_item (ListIterator<ParticleInfo> it) { cross_ref_item = it; }
87  void set_subList_ptr(List<ParticleInfo>* ptr) { subList_ptr = ptr; }
88  void set_copy_item (ListIterator<ParticleInfo> it) { copy_item = it; }
89  void mark() { marked = true; }
90  void unmark() { marked = false; }
92 
93  node get_vertex() const { return vertex; }
94  double get_x_y_coord() const { return x_y_coord; }
95  ListIterator<ParticleInfo> get_cross_ref_item() const { return cross_ref_item; }
96  List<ParticleInfo>* get_subList_ptr() const { return subList_ptr; }
97  ListIterator<ParticleInfo> get_copy_item() const{return copy_item;}
98  bool is_marked() const { return marked; }
100 
101 private:
103  double x_y_coord;
104 
110 
115  bool marked;
116 
121 };
122 
123 
126 public:
129  static int compare(const ParticleInfo& a,const ParticleInfo & b)
130  {
131  double p = a.get_x_y_coord();
132  double q = b.get_x_y_coord();
133  if(p < q ) return -1;
134  else if(p > q ) return 1;
135  else return 0;
136  }
138 };
139 
140 }
141 }
142 }
bool marked
indicates if this ParticleInfo object is marked or not
Definition: ParticleInfo.h:115
Needed for sorting algorithms in ogdf/List and ogdf/Array.
Definition: ParticleInfo.h:125
void set_cross_ref_item(ListIterator< ParticleInfo > it)
Definition: ParticleInfo.h:86
void set_copy_item(ListIterator< ParticleInfo > it)
Definition: ParticleInfo.h:88
static std::istream & operator>>(std::istream &inStream, HyperGraph::NodeArray< T > &array)
Definition: HyperGraph.h:814
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
ListIterator< ParticleInfo > get_cross_ref_item() const
Definition: ParticleInfo.h:95
node vertex
the vertex of G that is associated with this attributes
Definition: ParticleInfo.h:102
Helping data structure for building up the reduced quad tree by NMM.
Definition: ParticleInfo.h:42
#define OGDF_AUGMENT_STATICCOMPARER(type)
Add this macro to your class to turn it into a full static comparer.
Definition: comparer.h:201
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:120
ostream & operator<<(ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
Definition: Array.h:764
static int compare(const ParticleInfo &a, const ParticleInfo &b)
Returns -1(1) if height of a <(>) height of b. If they are equal 0 is returned.
Definition: ParticleInfo.h:129
ListIterator< ParticleInfo > get_copy_item() const
Definition: ParticleInfo.h:97
ListIterator< ParticleInfo > cross_ref_item
the Listiterator of the ParticleInfo-Element that containes the vertex in the List storing the other ...
Definition: ParticleInfo.h:109
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
Class for the representation of nodes.
Definition: Graph_d.h:167
Encapsulates a pointer to a list element.
Definition: List.h:41
Includes declaration of graph class.
List< ParticleInfo > * get_subList_ptr() const
Definition: ParticleInfo.h:96
int index() const
Returns the (unique) node index.
Definition: Graph_d.h:201
ListIterator< ParticleInfo > get_tmp_cross_ref_item() const
Definition: ParticleInfo.h:99
ListIterator< ParticleInfo > copy_item
the item of this entry in the copy List
Definition: ParticleInfo.h:114
The namespace for all OGDF objects.
void set_subList_ptr(List< ParticleInfo > *ptr)
Definition: ParticleInfo.h:87
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:113
void set_tmp_cross_ref_item(ListIterator< ParticleInfo > it)
Definition: ParticleInfo.h:91
Declaration of doubly linked lists and iterators.