coordinates_generator
graph Struct Reference

Main class to store all the information about graph, edges, vertices, ... More...

#include <functions.hpp>

Public Member Functions

void close_files ()
 
 graph (int n, int ii)
 
void add_edge (shared_ptr< Vertex > a, shared_ptr< Vertex > b, shared_ptr< Face > face, int a_index, int b_index, pair< double, double > previous_vertex, pair< double, double > next_vertex, bool outer_face_bool=false)
 Function to add edge between a and b. More...
 
void add_vertex (Edge *edge)
 Creating new vertec on the edge as a new intersection. More...
 
void delete_edge_back (bool outer_face_bool=false)
 Deleting the last added edge. More...
 
void delete_vertex (Vertex *a)
 Deleting given intersection vertex. More...
 
shared_ptr< Vertextearup_lines_in_half (Edge *edge, vector< shared_ptr< Vertex > > &a_half, vector< shared_ptr< Vertex > > &b_half)
 Function to tear up edge into two halves a_half and b_half. More...
 
vector< shared_ptr< Vertex > > find_path_through_triangulation (shared_ptr< Vertex > a, shared_ptr< Vertex > b, shared_ptr< Face > face, int a_index, int b_index, pair< double, double > shift_previous, pair< double, double > shift_next, bool outer_face_bool=false)
 Function to find correct way (preserving crossing properties) from vertex a to vertex b through the face. More...
 
void create_special_vertex (int index, int x, int y)
 Creating the "dummy" vertex (circle) representing real vertex. More...
 
void recolor_fingerprint (const string &rotation)
 Setting values of array starts to values of given fingerprint. More...
 
void create_base_star ()
 Function to create all edges incident to vertex 0. More...
 
void create_all_special_vertices ()
 Function to create all "dummy" vertices More...
 
void find_the_way_to_intersect (int s_index, int t_index, int a, int b)
 Main algorithm similar to described in psedocode in thesis. It recursively tries all the possible ways how to pull the edges. More...
 
void create_all_possible_drawings ()
 Function to try all possible drawings, It tries all the pullings of edges for given fingerprint until some realization, because it is already checked fingerprint. More...
 
void write_coordinates ()
 Function to write coordinates of graph into a file. More...
 
vector< shared_ptr< Vertex > > find_shortest_path (const vector< vector< double > > &distances, vector< shared_ptr< Vertex > > &face_vertices)
 Function to find shortest path between vertices (all_vertices) 0 and 1. More...
 
void update_most_away (vector< pair< double, double > > vertices)
 Function to update the convex hull of vertices of a graph. More...
 

Public Attributes

int number_of_vertices = 0
 
vector< Vertexouter_vertices {Vertex(336, 341), Vertex(310, -337), Vertex(-329, -283), Vertex(-302, 297)}
 
int realized = 0
 
bool done = false
 
int counter = 0
 
vector< pair< double, double > > most_away
 
list< Edgeedges
 
shared_ptr< Faceouter_face
 
ofstream output_file
 
vector< pair< double, double > > vertices_
 
vector< pair< double, double > > coordinates_of_special_vertices
 
int index
 
vector< Edge * > segments
 Vector to store (pointers on) edges. More...
 
array_4D blocked
 4D array to check which edges already intersect More...
 
vector< vector< int > > starts
 Array which for given pair of vertice i, j return the index in vector segments so the "dummy" edge ("dummy" vertex) where to start (end) More...
 

Detailed Description

Main class to store all the information about graph, edges, vertices, ...

Constructor & Destructor Documentation

◆ graph()

graph::graph ( int  n,
int  ii 
)
inline

Member Function Documentation

◆ add_edge()

void graph::add_edge ( shared_ptr< Vertex a,
shared_ptr< Vertex b,
shared_ptr< Face face,
int  a_index,
int  b_index,
pair< double, double >  shift_previous,
pair< double, double >  shift_next,
bool  outer_face_bool = false 
)
inline

Function to add edge between a and b.

Parameters
a
b
face
a_index
b_index
shift_previous
shift_next
outer_face_bool

◆ add_vertex()

void graph::add_vertex ( Edge edge)
inline

Creating new vertec on the edge as a new intersection.

Parameters
edge

◆ close_files()

void graph::close_files ( )
inline

◆ create_all_possible_drawings()

void graph::create_all_possible_drawings ( )
inline

Function to try all possible drawings, It tries all the pullings of edges for given fingerprint until some realization, because it is already checked fingerprint.

◆ create_all_special_vertices()

void graph::create_all_special_vertices ( )
inline

Function to create all "dummy" vertices

◆ create_base_star()

void graph::create_base_star ( )
inline

Function to create all edges incident to vertex 0.

◆ create_special_vertex()

void graph::create_special_vertex ( int  index,
int  x,
int  y 
)
inline

Creating the "dummy" vertex (circle) representing real vertex.

Parameters
index

◆ delete_edge_back()

void graph::delete_edge_back ( bool  outer_face_bool = false)
inline

Deleting the last added edge.

Parameters
outer_face_bool

◆ delete_vertex()

void graph::delete_vertex ( Vertex vertex)
inline

Deleting given intersection vertex.

Parameters
vertex

◆ find_path_through_triangulation()

vector< shared_ptr< Vertex > > graph::find_path_through_triangulation ( shared_ptr< Vertex a,
shared_ptr< Vertex b,
shared_ptr< Face face,
int  a_index,
int  b_index,
pair< double, double >  shift_previous,
pair< double, double >  shift_next,
bool  outer_face_bool = false 
)
inline

Function to find correct way (preserving crossing properties) from vertex a to vertex b through the face.

Parameters
a
b
face
a_index
b_index
shift_previous
shift_next
outer_face_bool
Returns

◆ find_shortest_path()

vector< shared_ptr< Vertex > > graph::find_shortest_path ( const vector< vector< double > > &  distances,
vector< shared_ptr< Vertex > > &  all_vertices 
)
inline

Function to find shortest path between vertices (all_vertices) 0 and 1.

Parameters
distances
all_vertices
Returns

◆ find_the_way_to_intersect()

void graph::find_the_way_to_intersect ( int  s_index,
int  t_index,
int  a,
int  b 
)
inline

Main algorithm similar to described in psedocode in thesis. It recursively tries all the possible ways how to pull the edges.

Parameters
s_index
t_index
a
b

◆ recolor_fingerprint()

void graph::recolor_fingerprint ( const string &  fingerprint)
inline

Setting values of array starts to values of given fingerprint.

Parameters
fingerprint

◆ tearup_lines_in_half()

shared_ptr< Vertex > graph::tearup_lines_in_half ( Edge edge,
vector< shared_ptr< Vertex > > &  a_half,
vector< shared_ptr< Vertex > > &  b_half 
)
inline

Function to tear up edge into two halves a_half and b_half.

Parameters
edge
a_half
b_half
Returns

◆ update_most_away()

void graph::update_most_away ( vector< pair< double, double > >  vertices)
inline

Function to update the convex hull of vertices of a graph.

Parameters
vertices

◆ write_coordinates()

void graph::write_coordinates ( )
inline

Function to write coordinates of graph into a file.

Member Data Documentation

◆ blocked

array_4D graph::blocked

4D array to check which edges already intersect

◆ coordinates_of_special_vertices

vector<pair<double, double> > graph::coordinates_of_special_vertices

◆ counter

int graph::counter = 0

◆ done

bool graph::done = false

◆ edges

list<Edge> graph::edges

◆ index

int graph::index

◆ most_away

vector< pair<double, double> > graph::most_away

◆ number_of_vertices

int graph::number_of_vertices = 0

◆ outer_face

shared_ptr<Face> graph::outer_face

◆ outer_vertices

vector<Vertex> graph::outer_vertices {Vertex(336, 341), Vertex(310, -337), Vertex(-329, -283), Vertex(-302, 297)}

◆ output_file

ofstream graph::output_file

◆ realized

int graph::realized = 0

◆ segments

vector<Edge*> graph::segments

Vector to store (pointers on) edges.

◆ starts

vector<vector<int> > graph::starts

Array which for given pair of vertice i, j return the index in vector segments so the "dummy" edge ("dummy" vertex) where to start (end)

◆ vertices_

vector<pair<double, double> > graph::vertices_

The documentation for this struct was generated from the following file: