-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVoronoiMesh.h
37 lines (32 loc) · 1.16 KB
/
VoronoiMesh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "VoronoiCell.h"
#include "Point.h"
#include <vector>
#ifndef VoronoiMesh_h
#define VoronoiMesh_h
class VoronoiMesh {
public:
VoronoiMesh(vector<Point> points);
~VoronoiMesh();
vector<Point> pts;
vector<VoronoiCell> vcells;
long total_steps;
int total_frame_counter;
void construct_mesh();
void insert_cell(Point new_seed, int new_seed_index);
void save_mesh_to_files(int nr);
bool check_equidistance();
double check_area();
bool check_neighbours();
bool check_mesh();
void do_point_insertion();
int find_cell_index(Point point);
long long calculate_mesh_memory(bool use_capacity);
void optimize_mesh_memory();
private:
void find_smallest_pos_intersect(Halfplane ¤t_hp, int ¤t_cell_index, VoronoiCell &new_cell, Point &last_vertex,
int &last_cell_index, Point &vertex, Halfplane &edge_hp);
int get_edge_index_in_cell(int &edge_index, VoronoiCell &vcell);
bool intersection_between_start_stop(int index, Point &new_seed, int &new_seed_index, int &next_cell_index,
VoronoiCell &new_cell);
};
#endif