40#ifndef PERIODIC_DELAUNAY_TRIANGULATION_3D
41#define PERIODIC_DELAUNAY_TRIANGULATION_3D
55 class PeriodicDelaunay3dThread;
78 std::stack<index_t> S;
85 incident_tets_set.resize(0);
93 incident_tets_set.push_back(t);
104 for(
index_t i=0; i<incident_tets_set.
size(); ++i) {
105 if(incident_tets_set[i] == t) {
113 return incident_tets_set.begin();
117 return incident_tets_set.end();
140 index_t nb_vertices,
const double* vertices
167 convex_cell_exact_predicates_ = x;
181 return vec3(vertices_ + 3*v);
183 index_t instance = v/nb_vertices_non_periodic_;
184 v = v%nb_vertices_non_periodic_;
185 vec3 result(vertices_ + 3*v);
186 result.x += double(translation[instance][0]) * period_.x;
187 result.y += double(translation[instance][1]) * period_.y;
188 result.z += double(translation[instance][2]) * period_.z;
199 if(weights_ ==
nullptr) {
202 return periodic_ ? weights_[periodic_vertex_real(v)] : weights_[v] ;
254 copy_Laguerre_cell_from_Delaunay(i,C,W);
266 return has_empty_cells_;
401 return reinterpret_cast<PeriodicDelaunay3dThread*
>(
411 return index_t(threads_.size());
417 friend class PeriodicDelaunay3dThread;
422 const double* weights_;
441 bool verbose_debug_mode_;
446 bool benchmark_mode_;
451 bool detailed_benchmark_mode_;
459 bool update_periodic_v_to_cell_;
466 bool has_empty_cells_;
477 bool convex_cell_exact_predicates_;
485 std::string to_string() {
486 return raw_ ? to_string_raw() : to_string_pretty();
489 std::string to_string_raw()
const;
490 std::string to_string_pretty()
const;
503 double phase_I_classify_t_;
504 index_t phase_I_nb_inside_;
505 index_t phase_I_nb_cross_;
506 index_t phase_I_nb_outside_;
507 double phase_I_insert_t_;
508 index_t phase_I_insert_nb_;
511 double phase_II_classify_t_;
512 double phase_II_insert_t_;
513 index_t phase_II_insert_nb_;
516 friend class LaguerreDiagramOmegaSimple3d;
#define geo_debug_assert(x)
Verifies that a condition is met.
An array of cell status codes associates to each tetrahedron in a Delaunay tetrahedralization.
Abstract interface for Delaunay triangulation in Nd.
Multithreaded implementation of Delaunay in 3d with optional periodic boundary conditions.
PeriodicDelaunay3d(const vec3 &period, bool periodic=true)
Constructs a new PeriodicDelaunay3d.
PeriodicDelaunay3d(bool periodic, double period=1.0)
Constructs a new PeriodicDelaunay3d.
void check_volume()
Checks the volume of Laguerre cells.
void compute()
Computes the Delaunay triangulation.
void use_exact_predicates_for_convex_cell(bool x)
Use exact predicates in convex cell computations.
void handle_periodic_boundaries()
Duplicates the points with Voronoi cells that cross the boundary.
void save_cells(const std::string &basename, bool clipped)
Saves the cells in an Alias-Wavefront file.
void set_BRIO_levels(const vector< index_t > &levels) override
Specifies the bounds of each level to be used when hierarchic ordering is specified from outside.
index_t compress(bool shrink=true)
Removes unused tetrahedra.
void insert_vertices(const char *phase, index_t b, index_t e)
Inserts vertices from reorder_[b] to reorder_[e-1] using multithreaded Delaunay. Called by insert_ver...
void handle_periodic_boundaries_phase_II()
Phase II of periodic boundaries handling.
double weight(index_t v) const
Gets a weight by index.
bool Laguerre_vertex_is_in_conflict_with_plane(index_t t, vec4 P) const
Tests the position of a Laguerre vertex w.r.t. a plane.
void update_v_to_cell() override
Stores for each vertex v a cell incident to v.
void update_cicl() override
Updates the circular incident cell lists.
void get_incident_tets(index_t v, IncidentTetrahedra &W) const
computes the set of tetrahedra that are incident to a vertex.
void copy_Laguerre_cell_from_Delaunay(GEO::index_t i, ConvexCell &C, IncidentTetrahedra &W) const
Copies a Laguerre cell from the triangulation.
void insert_vertices_with_BRIO(const char *phase, const vector< index_t > &levels)
Inserts vertices as indicated by a reordering vector and a vector of BRIO levels, as obtained using c...
index_t nb_threads() const
Gets the number of threads.
void handle_periodic_boundaries_phase_I()
Phase I of periodic boundaries handling.
index_t nearest_vertex(const double *p) const override
Computes the nearest vertex from a query point.
void copy_Laguerre_cell_from_Delaunay(GEO::index_t i, ConvexCell &C) const
Copies a Laguerre cell from the triangulation.
vec3 vertex(index_t v) const
Gets a vertex by index.
bool has_empty_cells() const
Tests whether the Laguerre diagram has empty cells.
GEO::index_t copy_Laguerre_cell_facet_from_Delaunay(GEO::index_t i, const GEO::vec3 &Pi, double wi, double Pi_len2, GEO::index_t t, ConvexCell &C, IncidentTetrahedra &W) const
Copies a Laguerre cell facet from the triangulation.
void set_weights(const double *weights)
Sets the weights.
void set_vertices(index_t nb_vertices, const double *vertices) override
Sets the vertices of this Delaunay, and recomputes the cells.
PeriodicDelaunay3dThread * thread(index_t t)
Gets a thread by index.
Utilities for managing 3D periodic space.
Vector with aligned memory allocation.
index_t size() const
Gets the number of elements.
Computes the intersection between a set of halfplanes using Bowyer-Watson algorithm.
Class to compute the intersection of a set of half-spaces in 3D.
Abstract interface for Delaunay.
Synchronization primitives for parallel Delaunay.
Common include file, providing basic definitions. Should be included before anything else by all head...
Geometric functions in 2d and 3d.
Global Vorpaline namespace.
std::vector< Thread_var > ThreadGroup
Collection of Threads.
geo_index_t index_t
The type for storing and manipulating indices.
Manipulation of indices for 3D periodic space.
Function and classes for process manipulation.
Gathers some structures used by some algorithms, makes multithreading more efficient by avoiding dyna...
void add_incident_tet(index_t t)
Inserts a tet into the set of incident tets.
void clear_incident_tets()
Clears the set of incident tets.
bool has_incident_tet(index_t t) const
Tests whether a tet belongs to the set of incident tets.