Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
BertaultLayout.h
Go to the documentation of this file.
1
36#pragma once
37
38#include <ogdf/basic/Array.h>
39#include <ogdf/basic/Array2D.h>
42#include <ogdf/basic/List.h>
44
45namespace ogdf {
46
48public:
52
54 BertaultLayout(double length,
55 int number); // length= desired edge length... number= number of iterations
56
58 explicit BertaultLayout(int number); // number= number of iterations
59
60
62 virtual void call(GraphAttributes& AG) override;
63
65 void setImpred(bool option) { impred = option; };
66
68 void iterno(int no) { userIterNo = no; }
69
71 int iterno() { return iter_no; }
72
75 void reqlength(double length) { userReqLength = length; }
76
78 double reqlength() { return req_length; }
79
87
90
93
98
99protected:
102
105
108
111
114
117
120
123
125 class CCElement {
126 public:
127 bool root; // denotes if a element is root
128 int num; // The number of the connected component represented by the object
129 CCElement* parent; // refers to parent of this object in the heirarchy
130 int faceNum; // the index of the face of parent in which it is contained
131 List<CCElement*> child; //list of CCElements refering to the CCs which are contained inside this CC
132
133 // Initialises the CCElement to the ith CC
134 void init(int i) {
135 root = false;
136 num = i;
137 child.clear();
138 parent = this;
139 }
140 };
141
142
143private:
146 public:
147 double R[9];
148
150 void initialize() {
151 int i;
152 for (i = 0; i < 9; i++) {
153 R[i] = std::numeric_limits<double>::max();
154 }
155 }
156 };
157
160
163
166
169
174
177
179 struct proj {
180 double x;
181 double y;
182 } proj;
183
188 double userIterNo;
189 double req_length;
191 bool impred;
193
195};
196
197}
Declaration and implementation of class Array2D which implements dynamic two dimensional arrays.
Declaration and implementation of Array class and Array algorithms.
Declaration of CombinatorialEmbedding and face.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of doubly linked lists and iterators.
Declaration of a base class for planar representations of graphs and cluster graphs.
The parameterized class Array2D implements dynamic two-dimensional arrays.
Definition Array2D.h:47
The sections associated with each node.
void initialize()
Ri is radius of ith section.
Objects of this class are members of the containment heirarchy made in preprocessing stage of ImPrEd.
BertaultLayout()
Constructor, sets options to default values.
void compute(CCElement *element, PlanRep &PG, GraphAttributes &AG1, GraphCopy &G1)
Computes the surrounding edges from the data calculated so far.
bool impred
number of iterations to be performed
void f_Node_Attractive(node *v, node *j, GraphAttributes &AG)
Calculates the attractive force on node v due to node j and adds it to total force on v.
void preprocess(GraphAttributes &AG)
preprocessing for ImPrEd
BertaultLayout(double length, int number)
Constructor, with user defined values for required length and number of iterations.
void setImpred(bool option)
Sets impred option true or false.
double reqlength()
Returns the required length.
void r_Calc_On_Edge(node *v, edge *e, GraphAttributes &AG)
Calculates the radii of the zones of node v if node i lies on edge (a,b)
Array2D< bool > surr
sets the algorithm to ImPrEd when true
NodeArray< double > F_x
Sections associated with all nodes.
void f_Node_Repulsive(node *v, node *j, GraphAttributes &AG)
Calculates the repulsive force on node v due to node j and adds it to total force on v.
int iter_no
req_length is the required edge length
void labelling(GraphAttributes &AG)
labels the edges with weights which aids in surrounding edge computation
void reqlength(double length)
Sets the required length. If length <= 0, the average edge length will be used.
void iterno(int no)
Sets the number of iterations. If no <= 0, 10*n will be used.
void initPositions(GraphAttributes &AG, char c)
Set the initPositions of nodes.
void compute_I(node *v, edge *e, GraphAttributes &AG)
Computes the projection of node v on the edge (a,b)
NodeArray< double > F_y
Force in x direction.
int contained(CCElement *ele1, CCElement *ele2, GraphAttributes &PAG, PlanRep &PG)
Checks if the first connected component is within the second one. Returns -1 if not contained....
BertaultLayout(int number)
Constructor, with user defined values for number of iterations.
void r_Calc_Outside_Edge(node *v, edge *e, GraphAttributes &AG)
Calculates the radii of the zones of node v if node i does not lie on edge (a,b)
double userReqLength
Force in y direction.
double edgelength(GraphAttributes &GA)
Calculates the normalised standard deviation of edge lengths in the graph corresponding to AG....
void f_Edge(node *v, edge *e, GraphAttributes &AG)
Calculates the repulsive force on node v due to the edge on which node i lies and adds it to total fo...
double userIterNo
required edge length set by the user
void move(node *v, GraphAttributes &AG)
Moves the node v according to the forces Fx and Fy on it. Also ensures that movement is within the re...
double nodeDistribution(GraphAttributes &GA)
Gives a measure of the node distribution in the graph corresponding to AG. The lesser the value,...
double req_length
number of iterations set by the user
void crossingPlanarize(GraphAttributes &AG)
Inserts a node at each edge crossing in a GraphCopy and assigns weights to the new edges formed.
int insert(CCElement *new1, CCElement *node, GraphAttributes &PAG, PlanRep &PG)
Insert method for the data structure which stores the heirarchy of containment of Connected Component...
int iterno()
Returns the number of iterations.
int edgeCrossings(GraphAttributes &AG)
Calculates the edge crossings in the graph corresponding to AG. Node attributes required.
NodeArray< BertaultSections > sect
virtual void call(GraphAttributes &AG) override
The main call to the algorithm. AG should have nodeGraphics and EdgeGraphics attributes enabled.
bool i_On_Edge(edge *e, GraphAttributes &AG)
Returns true if node i lies on the edge (a,b)
Class for the representation of edges.
Definition Graph_d.h:300
Stores additional attributes of a graph (like layout information).
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:254
Interface of general layout algorithms.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
void clear()
Removes all elements from the list.
Definition List.h:1610
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:57
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
Definition memory.h:84
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
a structure which stores the projection of a node on an edge