40 #ifndef GEOGRAM_DELAUNAY_DELAUNAY
41 #define GEOGRAM_DELAUNAY_DELAUNAY
95 const char*
what() const GEO_NOEXCEPT override;
123 const
char* what() const GEO_NOEXCEPT override;
191 index_t nb_vertices,
const double* vertices
235 return vertices_ + vertex_stride_ * i;
333 return nb_finite_cells_;
349 return cell_to_cell_;
368 return cell_to_v_[c * cell_v_stride_ + lv];
382 return cell_to_cell_[c * cell_neigh_stride_ + lf];
400 return !cell_is_infinite(c);
414 for(
index_t iv = 0; iv < cell_size(); iv++) {
415 if(cell_vertex(c, iv) == v) {
434 for(
index_t f = 0; f < cell_size(); f++) {
452 return v_to_cell_[v];
468 return cicl_[cell_size() * c + lv];
485 if(store_neighbors_) {
486 neighbors_.get_array(v, neighbors);
488 get_neighbors_internal(v, neighbors);
508 return store_neighbors_;
519 store_neighbors_ = x;
520 if(store_neighbors_) {
521 set_stores_cicl(
true);
552 return keep_infinite_;
572 return neighbors_.thread_safe();
581 neighbors_.set_thread_safe(x);
592 default_nb_neighbors_ = x;
603 return default_nb_neighbors_;
730 vertex_stride_ = dim;
732 cell_v_stride_ = cell_size_;
733 cell_neigh_stride_ = cell_size_;
742 const double* vertices_;
751 bool store_neighbors_;
760 const Mesh* constraints_;
811 #define geo_register_Delaunay_creator(type, name) \
812 geo_register_creator(GEO::DelaunayFactory, type, name)
#define geo_assert_not_reached
Sets a non reachable point in the program.
#define geo_assert(x)
Verifies that a condition is met.
#define geo_debug_assert(x)
Verifies that a condition is met.
Base class for reference-counted objects.
Abstract interface for Delaunay triangulation in Nd.
index_t adjacent_index(index_t c1, index_t c2) const
Retrieves a local facet index from two adacent cell global indices.
void save_histogram(std::ostream &out) const
Saves the histogram of vertex degree (can be visualized with gnuplot).
void set_refine(bool x)
Specifies whether the mesh should be refined.
signed_index_t cell_vertex(index_t c, index_t lv) const
Gets a vertex index by cell index and local vertex index.
virtual index_t nearest_vertex(const double *p) const
Computes the nearest vertex from a query point.
void set_stores_neighbors(bool x)
Specifies whether neighbors should be stored.
const double * vertex_ptr(index_t i) const
Gets a pointer to a vertex by its global index.
virtual void get_neighbors_internal(index_t v, vector< index_t > &neighbors) const
Internal implementation for get_neighbors (with vector).
void set_stores_cicl(bool x)
Specifies whether incident tetrahedra lists should be stored.
index_t nb_cells() const
Gets the number of cells.
signed_index_t cell_adjacent(index_t c, index_t lf) const
Gets an adjacent cell index by cell index and local facet index.
const signed_index_t * cell_to_cell() const
Gets a pointer to the cell-to-cell adjacency array.
void get_neighbors(index_t v, vector< index_t > &neighbors) const
Gets the one-ring neighbors of vertex v.
bool do_reorder_
If true, uses BRIO reordering (in some implementations)
void set_thread_safe(bool x)
Specifies whether thread-safe mode should be used.
const signed_index_t * cell_to_v() const
Gets a pointer to the cell-to-vertex incidence array.
index_t nb_finite_cells_
If keep_infinite_ is true, then finite cells are 0..nb_finite_cells_-1 and infinite cells are nb_fini...
virtual bool supports_constraints() const
Tests whether constraints are supported by this Delaunay.
void set_default_nb_neighbors(index_t x)
Sets the default number of stored neighbors.
bool store_cicl_
It true, circular incident tet lists are stored.
void set_quality(double qual)
Specifies the desired quality for mesh elements when refinement is enabled (.
virtual void update_v_to_cell()
Stores for each vertex v a cell incident to v.
const Mesh * constraints() const
Gets the constraints.
void set_next_around_vertex(index_t c1, index_t lv, index_t c2)
Sets the circular incident edge list.
index_t cell_size() const
Gets the number of vertices in each cell.
index_t nb_vertices() const
Gets the number of vertices.
bool stores_cicl() const
Tests whether incident tetrahedra lists are stored.
void set_reorder(bool x)
Specifies whether vertices should be reordered.
signed_index_t vertex_cell(index_t v) const
Gets an incident cell index by a vertex index.
bool get_refine() const
Tests whether mesh refinement is selected.
bool keep_infinite_
If true, infinite vertex and infinite simplices are kept.
bool thread_safe() const
Tests whether thread-safe mode is active.
virtual void set_vertices(index_t nb_vertices, const double *vertices)
Sets the vertices of this Delaunay, and recomputes the cells.
bool cell_is_infinite(index_t c) const
Tests whether a cell is infinite.
~Delaunay() override
Delaunay destructor.
index_t nb_finite_cells() const
Gets the number of finite cells.
bool cell_is_finite(index_t c) const
Tests whether a cell is finite.
Delaunay(coord_index_t dimension)
Creates a new Delaunay triangulation.
const double * vertices_ptr() const
Gets a pointer to the array of vertices.
void set_keeps_infinite(bool x)
Sets whether infinite elements should be kept.
virtual void set_arrays(index_t nb_cells, const signed_index_t *cell_to_v, const signed_index_t *cell_to_cell)
Sets the arrays that represent the combinatorics of this Delaunay.
SmartPointer< Delaunay > Delaunay_var
Smart pointer that refers to a Delaunay object.
void set_keep_regions(bool x)
Specifies whether all internal regions should be kept.
index_t index(index_t c, signed_index_t v) const
Retrieves a local vertex index from cell index and global vertex index.
virtual void update_cicl()
Updates the circular incident cell lists.
virtual index_t region(index_t t) const
Gets the region id associated with a tetrahedron.
bool keeps_infinite() const
Tests whether infinite elements are kept.
signed_index_t next_around_vertex(index_t c, index_t lv) const
Traverses the list of cells incident to a vertex.
void clear_neighbors()
Frees all memory used for neighbors storage.
Factory1< Delaunay, coord_index_t > DelaunayFactory
Delaunay Factory.
virtual void set_BRIO_levels(const vector< index_t > &levels)
Specifies the bounds of each level to be used when hierarchic ordering is specified from outside.
bool stores_neighbors() const
Tests whether neighbors are stored.
virtual void store_neighbors_CB(index_t i)
Stores the neighbors of a vertex.
void set_dimension(coord_index_t dim)
Sets the dimension of this Delaunay.
virtual void update_neighbors()
Computes the stored neighbor lists.
virtual void set_constraints(const Mesh *mesh)
Defines the constraints.
index_t default_nb_neighbors() const
Gets the default number of stored neighbors.
Factory for types with one constructor argument.
Efficient storage for array of arrays.
A smart pointer with reference-counted copy semantics.
Vector with aligned memory allocation.
Base class of reference-counted objects, to be used with smart pointers.
Generic factory mechanism.
Common include file, providing basic definitions. Should be included before anything else by all head...
Global Vorpaline namespace.
geo_signed_index_t signed_index_t
The type for storing and manipulating indices differences.
geo_index_t index_t
The type for storing and manipulating indices.
void initialize(int flags=GEOGRAM_INSTALL_NONE)
Initialize Geogram.
geo_coord_index_t coord_index_t
The type for storing coordinate indices, and iterating on the coordinates of a point.
Efficient storage for array of arrays.
Pointers with automatic reference counting.
Invalid dimension exception.
const char * what() const GEO_NOEXCEPT override
Gets the string identifying the exception.
InvalidDimension(coord_index_t dimension, const char *name, const char *expected)
Creates a invalid dimension exception.