Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
CrossingMinimalPosition.h
Go to the documentation of this file.
1
46#pragma once
47
48#include <ogdf/basic/Graph.h>
49#include <ogdf/basic/basic.h>
50#include <ogdf/basic/geometry.h>
52
53#include <random>
54
55#ifdef OGDF_INCLUDE_CGAL
56# include <CGAL/Gmpq.h>
57#endif
58
59namespace ogdf {
60class GraphAttributes;
61
68template<typename FT>
70public: // ~Initialize vertex position module
72
74
78
85
90 void setSampleSize(const unsigned int number_of_edge_samples,
91 const unsigned int number_of_point_samples) {
92 m_number_of_edge_samples = number_of_edge_samples;
93 m_number_of_point_samples = number_of_point_samples;
94 }
95
99 void computePositionInOptimalRegion(const bool within_region) {
100 m_within_region = within_region;
101 }
102
107 void setNeighboorhoodThreshold(const unsigned int threshold) {
108 m_neighborhood_threshold = threshold;
109 }
110
111 unsigned int neighborThreshold() const { return m_neighborhood_threshold; }
112
113protected:
114 unsigned int m_number_of_edge_samples = -1;
116 unsigned int m_neighborhood_threshold = 100;
117 bool m_within_region = true;
118
119 std::mt19937_64 rnd;
120};
121
122// the actual instantiation happens in CrossingMinimalPosition.cpp (thus the 'extern'),
123// here we just need to mark the instantiated class as EXPORTed
126
127#ifdef OGDF_INCLUDE_CGAL
129using CrossingMinimalPositionPrecise = CrossingMinimalPosition<CGAL::Gmpq>;
130#endif
131
132
134public:
136 m_number_of_edge_samples = 512;
137 m_number_of_point_samples = 1000;
138 m_neighborhood_threshold = 100;
139 m_within_region = true;
140 }
141};
142
144public:
146 m_number_of_edge_samples = 512;
147 m_number_of_point_samples = 1000;
148 m_neighborhood_threshold = 100;
149 m_within_region = false;
150 }
151};
152
153
154}
Includes declaration of graph class.
Optimal Vertex Position interface.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Basic declarations, included by all source files.
Compute a crossing minimal position for a vertex.
void computePositionInOptimalRegion(const bool within_region)
If the value within_region is set to false, the algorithm samples points outside the optimal region.
void setNeighboorhoodThreshold(const unsigned int threshold)
The algortihm randomly partitions the neighbor of the vertex into blocks of size threshold.
DPoint call(GraphAttributes &GA, node v)
computes a good position for the vertex v with respect to GA
void setSampleSize(const unsigned int number_of_edge_samples, const unsigned int number_of_point_samples)
set the number of edges that are randomly selected to compute the new vertex postion and the number o...
Stores additional attributes of a graph (like layout information).
Class for the representation of nodes.
Definition Graph_d.h:241
Interface for computing a good / optimal vertex position.
#define OGDF_EXPORT_TEMPL_DECL
If you declare a template in a header file, but only provide a definition for its implementation in a...
Definition config.h:161
#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.