Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
NodeAttributes.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/geometry.h>
37
38namespace ogdf {
39namespace energybased {
40namespace fmmm {
41
46 friend OGDF_EXPORT std::ostream& operator<<(std::ostream&, const NodeAttributes&);
47
49 friend OGDF_EXPORT std::istream& operator>>(std::istream&, NodeAttributes&);
50
51public:
54
55 void set_NodeAttributes(double w, double h, DPoint pos, node v_low, node v_high) {
56 width = w;
57 height = h;
58 position = pos;
59 v_lower_level = v_low;
60 v_higher_level = v_high;
61 }
62
63 void set_position(DPoint pos) { position = pos; }
64
65 void set_width(double w) { width = w; }
66
67 void set_height(double h) { height = h; }
68
69 void set_x(double x) { position.m_x = x; }
70
71 void set_y(double y) { position.m_y = y; }
72
73 DPoint get_position() const { return position; }
74
75 double get_x() const { return position.m_x; }
76
77 double get_y() const { return position.m_y; }
78
79 double get_width() const { return width; }
80
81 double get_height() const { return height; }
82
85
86 void set_original_node(node v) { v_lower_level = v; }
87
88 void set_copy_node(node v) { v_higher_level = v; }
89
90 node get_original_node() const { return v_lower_level; }
91
92 node get_copy_node() const { return v_higher_level; }
93
97
98 void set_subgraph_node(node v) { v_higher_level = v; }
99
100 node get_subgraph_node() const { return v_higher_level; }
101
105
106 void set_lower_level_node(node v) { v_lower_level = v; }
107
108 void set_higher_level_node(node v) { v_higher_level = v; }
109
110 node get_lower_level_node() const { return v_lower_level; }
111
112 node get_higher_level_node() const { return v_higher_level; }
113
114 void set_mass(int m) { mass = m; }
115
116 void set_type(int t) { type = t; }
117
118 void set_dedicated_sun_node(node v) { dedicated_sun_node = v; }
119
120 void set_dedicated_sun_distance(double d) { dedicated_sun_distance = d; }
121
122 void set_dedicated_pm_node(node v) { dedicated_pm_node = v; }
123
124 void place() { placed = true; }
125
126 void set_angle_1(double a) { angle_1 = a; }
127
128 void set_angle_2(double a) { angle_2 = a; }
129
131
132 int get_mass() const { return mass; }
133
134 int get_type() const { return type; }
135
136 node get_dedicated_sun_node() const { return dedicated_sun_node; }
137
138 double get_dedicated_sun_distance() const { return dedicated_sun_distance; }
139
140 node get_dedicated_pm_node() const { return dedicated_pm_node; }
141
142 bool is_placed() const { return placed; }
143
144 double get_angle_1() const { return angle_1; }
145
146 double get_angle_2() const { return angle_2; }
147
148 List<double>* get_lambda_List_ptr() { return lambda_List_ptr; }
149
150 List<node>* get_neighbour_sun_node_List_ptr() { return neighbour_s_node_List_ptr; }
151
152 List<node>* get_dedicated_moon_node_List_ptr() { return moon_List_ptr; }
153
156
157private:
159 double width;
160 double height;
161
164
170
174
175 int mass;
176 int type;
191 bool placed;
193 double angle_1;
194 double angle_2;
195
197};
198
199}
200}
201}
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
Class for the representation of nodes.
Definition Graph_d.h:177
helping data structure that stores the graphical attributes of a node that are needed for the force-d...
bool placed
indicates weather an initial position has been assigned to this node or not
double angle_1
describes the sector where nodes that are not adjacent to other
friend std::ostream & operator<<(std::ostream &, const NodeAttributes &)
outputstream for NodeAttributes
List< node > * neighbour_s_node_List_ptr
a pointer to to the neighbour_s_node list
int mass
the mass (= number of previously collapsed nodes) of this node
node v_lower_level
the corresponding node in the lower level graph
List< node > neighbour_s_node
this is the list of the neighbour solar systems suns lambda[i] corresponds to neighbour_s_node[i]
List< double > lambda
the factors lambda for scaling the length of this edge relative to the pass between v's sun and the s...
double dedicated_sun_distance
the distance to the dedicated sun node of the galaxy of this node
List< double > * lambda_List_ptr
a pointer to the lambda list
friend std::istream & operator>>(std::istream &, NodeAttributes &)
inputstream for NodeAttributes
List< node > moon_List
the list of all dedicated moon nodes (!= nil if type == 3)
node dedicated_pm_node
if type == 4 the dedicated_pm_node is saved here
List< node > * moon_List_ptr
a pointer to the moon_List
node dedicated_sun_node
the dedicates s_node of the solar system of this node
void set_NodeAttributes(double w, double h, DPoint pos, node v_low, node v_high)
double angle_2
solar systems have to be placed
int type
1 = sun node (s_node); 2 = planet node (p_node) without a dedicate moon 3 = planet node with dedicate...
node v_higher_level
the corresponding node in the higher level graph for divide et impera v_lower_level is the original g...
void init_mult_values()
initialzes all values needed for multilevel representations
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.