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/basic.h>
37#include <ogdf/basic/geometry.h>
38
39#include <iosfwd>
40
41namespace ogdf {
42namespace energybased {
43namespace fmmm {
44
49 friend OGDF_EXPORT std::ostream& operator<<(std::ostream&, const NodeAttributes&);
50
52 friend OGDF_EXPORT std::istream& operator>>(std::istream&, NodeAttributes&);
53
54public:
57
58 void set_NodeAttributes(double w, double h, DPoint pos, node v_low, node v_high) {
59 width = w;
60 height = h;
61 position = pos;
62 v_lower_level = v_low;
63 v_higher_level = v_high;
64 }
65
66 void set_position(DPoint pos) { position = pos; }
67
68 void set_width(double w) { width = w; }
69
70 void set_height(double h) { height = h; }
71
72 void set_x(double x) { position.m_x = x; }
73
74 void set_y(double y) { position.m_y = y; }
75
76 DPoint get_position() const { return position; }
77
78 double get_x() const { return position.m_x; }
79
80 double get_y() const { return position.m_y; }
81
82 double get_width() const { return width; }
83
84 double get_height() const { return height; }
85
88
89 void set_original_node(node v) { v_lower_level = v; }
90
91 void set_copy_node(node v) { v_higher_level = v; }
92
93 node get_original_node() const { return v_lower_level; }
94
95 node get_copy_node() const { return v_higher_level; }
96
100
101 void set_subgraph_node(node v) { v_higher_level = v; }
102
103 node get_subgraph_node() const { return v_higher_level; }
104
108
109 void set_lower_level_node(node v) { v_lower_level = v; }
110
111 void set_higher_level_node(node v) { v_higher_level = v; }
112
113 node get_lower_level_node() const { return v_lower_level; }
114
115 node get_higher_level_node() const { return v_higher_level; }
116
117 void set_mass(int m) { mass = m; }
118
119 void set_type(int t) { type = t; }
120
121 void set_dedicated_sun_node(node v) { dedicated_sun_node = v; }
122
123 void set_dedicated_sun_distance(double d) { dedicated_sun_distance = d; }
124
125 void set_dedicated_pm_node(node v) { dedicated_pm_node = v; }
126
127 void place() { placed = true; }
128
129 void set_angle_1(double a) { angle_1 = a; }
130
131 void set_angle_2(double a) { angle_2 = a; }
132
134
135 int get_mass() const { return mass; }
136
137 int get_type() const { return type; }
138
139 node get_dedicated_sun_node() const { return dedicated_sun_node; }
140
141 double get_dedicated_sun_distance() const { return dedicated_sun_distance; }
142
143 node get_dedicated_pm_node() const { return dedicated_pm_node; }
144
145 bool is_placed() const { return placed; }
146
147 double get_angle_1() const { return angle_1; }
148
149 double get_angle_2() const { return angle_2; }
150
151 List<double>* get_lambda_List_ptr() { return lambda_List_ptr; }
152
153 List<node>* get_neighbour_sun_node_List_ptr() { return neighbour_s_node_List_ptr; }
154
155 List<node>* get_dedicated_moon_node_List_ptr() { return moon_List_ptr; }
156
159
160private:
162 double width;
163 double height;
164
167
173
177
178 int mass;
179 int type;
194 bool placed;
196 double angle_1;
197 double angle_2;
198
200};
201
202}
203}
204}
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Basic declarations, included by all source files.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
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 dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.