|
Geogram Version 1.9.7
A programming library of geometric algorithms
|
Delaunay interface for NearestNeighbors search. More...
#include <geogram/delaunay/delaunay_nn.h>
Public Member Functions | |
| Delaunay_NearestNeighbors (coord_index_t dimension) | |
| Creates a new Delaunay_NearestNeighbors. | |
| virtual void | enlarge_neighborhood (index_t i, index_t nb) |
| Stores nb neighbors with vertex i. | |
| void | set_vertices (index_t nb_vertices, const double *vertices) override |
| Sets the vertices of this Delaunay, and recomputes the cells. | |
| index_t | nearest_vertex (const double *p) const override |
| Computes the nearest vertex from a query point. | |
| NearestNeighborSearch * | nn_search () |
| Gets the NearestNeighborSearch used internally. | |
| void | store_neighbors_CB (index_t i) override |
| Used internally for parallel computation of the neighborhoods in Delaunay. | |
Public Member Functions inherited from GEO::Delaunay | |
| coord_index_t | dimension () const |
| Gets the dimension of this Delaunay. | |
| index_t | cell_size () const |
| Gets the number of vertices in each cell. | |
| void | set_reorder (bool x) |
| Specifies whether vertices should be reordered. | |
| 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. | |
| const double * | vertices_ptr () const |
| Gets a pointer to the array of vertices. | |
| const double * | vertex_ptr (index_t i) const |
| Gets a pointer to a vertex by its global index. | |
| index_t | nb_vertices () const |
| Gets the number of vertices. | |
| virtual bool | supports_constraints () const |
| Tests whether constraints are supported by this Delaunay. | |
| virtual void | set_constraints (const Mesh *mesh) |
| Defines the constraints. | |
| void | set_refine (bool x) |
| Specifies whether the mesh should be refined. | |
| bool | get_refine () const |
| Tests whether mesh refinement is selected. | |
| void | set_quality (double qual) |
| Specifies the desired quality for mesh elements when refinement is enabled (. | |
| const Mesh * | constraints () const |
| Gets the constraints. | |
| index_t | nb_cells () const |
| Gets the number of cells. | |
| index_t | nb_finite_cells () const |
| Gets the number of finite cells. | |
| const index_t * | cell_to_v () const |
| Gets a pointer to the cell-to-vertex incidence array. | |
| const index_t * | cell_to_cell () const |
| Gets a pointer to the cell-to-cell adjacency array. | |
| index_t | cell_vertex (index_t c, index_t lv) const |
| Gets a vertex index by cell index and local vertex index. | |
| index_t | cell_adjacent (index_t c, index_t lf) const |
| Gets an adjacent cell index by cell index and local facet index. | |
| bool | cell_is_infinite (index_t c) const |
| Tests whether a cell is infinite. | |
| bool | cell_is_finite (index_t c) const |
| Tests whether a cell is finite. | |
| index_t | index (index_t c, index_t v) const |
| Retrieves a local vertex index from cell index and global vertex index. | |
| index_t | adjacent_index (index_t c1, index_t c2) const |
| Retrieves a local facet index from two adacent cell global indices. | |
| index_t | vertex_cell (index_t v) const |
| Gets an incident cell index by a vertex index. | |
| index_t | next_around_vertex (index_t c, index_t lv) const |
| Traverses the list of cells incident to a vertex. | |
| void | get_neighbors (index_t v, vector< index_t > &neighbors) const |
| Gets the one-ring neighbors of vertex v. | |
| void | save_histogram (std::ostream &out) const |
| Saves the histogram of vertex degree (can be visualized with gnuplot). | |
| bool | stores_neighbors () const |
| Tests whether neighbors are stored. | |
| void | set_stores_neighbors (bool x) |
| Specifies whether neighbors should be stored. | |
| bool | stores_cicl () const |
| Tests whether incident tetrahedra lists are stored. | |
| void | set_stores_cicl (bool x) |
| Specifies whether incident tetrahedra lists should be stored. | |
| bool | keeps_infinite () const |
| Tests whether infinite elements are kept. | |
| void | set_keeps_infinite (bool x) |
| Sets whether infinite elements should be kept. | |
| bool | thread_safe () const |
| Tests whether thread-safe mode is active. | |
| void | set_thread_safe (bool x) |
| Specifies whether thread-safe mode should be used. | |
| void | set_default_nb_neighbors (index_t x) |
| Sets the default number of stored neighbors. | |
| index_t | default_nb_neighbors () const |
| Gets the default number of stored neighbors. | |
| void | clear_neighbors () |
| Frees all memory used for neighbors storage. | |
| void | set_keep_regions (bool x) |
| Specifies whether all internal regions should be kept. | |
| virtual index_t | region (index_t t) const |
| Gets the region id associated with a tetrahedron. | |
Public Member Functions inherited from GEO::Counted | |
| void | ref () const |
| Increments the reference count. | |
| void | unref () const |
| Decrements the reference count. | |
| bool | is_shared () const |
| Check if the object is shared. | |
| int | nb_refs () const |
| Gets the number of references that point to this object. | |
Protected Member Functions | |
| ~Delaunay_NearestNeighbors () override | |
| Delaunay_NearestNeighbors destructor. | |
| void | get_neighbors_internal (index_t v, vector< index_t > &neighbors) const override |
| Internal implementation for get_neighbors (with vector). | |
| virtual index_t | get_neighbors_internal (index_t v, index_t nb_neighbors, index_t *neighbors) const |
| Internal implementation for get_neighbors (with pointers). | |
Protected Member Functions inherited from GEO::Delaunay | |
| Delaunay (coord_index_t dimension) | |
| Creates a new Delaunay triangulation. | |
| ~Delaunay () override | |
| Delaunay destructor. | |
| virtual void | set_arrays (index_t nb_cells, const index_t *cell_to_v, const index_t *cell_to_cell) |
| Sets the arrays that represent the combinatorics of this Delaunay. | |
| virtual void | update_v_to_cell () |
| Stores for each vertex v a cell incident to v. | |
| virtual void | update_cicl () |
| Updates the circular incident cell lists. | |
| virtual void | update_neighbors () |
| Computes the stored neighbor lists. | |
| void | set_next_around_vertex (index_t c1, index_t lv, index_t c2) |
| Sets the circular incident edge list. | |
| void | set_dimension (coord_index_t dim) |
| Sets the dimension of this Delaunay. | |
Protected Member Functions inherited from GEO::Counted | |
| Counted () | |
| Creates a reference counted object. | |
| virtual | ~Counted () |
| Destroys a reference counted object. | |
Additional Inherited Members | |
Static Public Member Functions inherited from GEO::Delaunay | |
| static Delaunay * | create (coord_index_t dim, const std::string &name="default") |
| Creates a Delaunay triangulation of the specified dimension. | |
| static void | initialize () |
| This function needs to be called once before using the Delaunay class. | |
Static Public Member Functions inherited from GEO::Counted | |
| static void | ref (const Counted *counted) |
| Increments the reference count. | |
| static void | unref (const Counted *counted) |
| Decrements the reference count. | |
Protected Attributes inherited from GEO::Delaunay | |
| coord_index_t | dimension_ |
| index_t | vertex_stride_ |
| index_t | cell_size_ |
| index_t | cell_v_stride_ |
| index_t | cell_neigh_stride_ |
| const double * | vertices_ |
| index_t | nb_vertices_ |
| index_t | nb_cells_ |
| const index_t * | cell_to_v_ |
| const index_t * | cell_to_cell_ |
| vector< index_t > | v_to_cell_ |
| vector< index_t > | cicl_ |
| bool | is_locked_ |
| PackedArrays | neighbors_ |
| bool | store_neighbors_ |
| index_t | default_nb_neighbors_ |
| bool | do_reorder_ |
| If true, uses BRIO reordering (in some implementations) | |
| const Mesh * | constraints_ |
| bool | refine_ |
| double | quality_ |
| bool | store_cicl_ |
| It true, circular incident tet lists are stored. | |
| bool | keep_infinite_ |
| If true, infinite vertex and infinite simplices are kept. | |
| index_t | nb_finite_cells_ |
| If keep_infinite_ is true, then finite cells are 0..nb_finite_cells_-1 and infinite cells are nb_finite_cells_ ... nb_cells_. | |
| bool | keep_regions_ |
Related Symbols inherited from GEO::Delaunay | |
| typedef SmartPointer< Delaunay > | Delaunay_var |
| Smart pointer that refers to a Delaunay object. | |
| typedef Factory1< Delaunay, coord_index_t > | DelaunayFactory |
| Delaunay Factory. | |
Delaunay interface for NearestNeighbors search.
This does not fully implement a Delaunay triangulation, cell-related queries are not implemented. It only implements neighborhood queries, which are the only ones needed by RestrictedVoronoiDiagram with radius of security.
Definition at line 63 of file delaunay_nn.h.
| GEO::Delaunay_NearestNeighbors::Delaunay_NearestNeighbors | ( | coord_index_t | dimension | ) |
Creates a new Delaunay_NearestNeighbors.
| [in] | dimension | the dimension of the points |
Stores nb neighbors with vertex i.
By default, Delaunay::default_nb_neighbors() are stored for each vertex. This function changes the number of stored neighbors for a given vertex.
| [in] | i | index of the vertex which neighborhood should be enlarged |
| [in] | nb | new number of vertices in vertex i's neighborhood. |
|
protectedvirtual |
Internal implementation for get_neighbors (with pointers).
| [in] | v | index of the Delaunay vertex |
| [in] | nb_neighbors | required number of neighbors |
| [out] | neighbors | the computed neighbors of vertex v, allocated and managed by caller |
|
overrideprotectedvirtual |
Internal implementation for get_neighbors (with vector).
| [in] | v | index of the Delaunay vertex |
| [in,out] | neighbors | the computed neighbors of vertex v. Its size is used to determine the number of queried neighbors. |
Reimplemented from GEO::Delaunay.
|
overridevirtual |
Computes the nearest vertex from a query point.
| [in] | p | query point |
Reimplemented from GEO::Delaunay.
|
inline |
Gets the NearestNeighborSearch used internally.
Definition at line 92 of file delaunay_nn.h.
|
overridevirtual |
Sets the vertices of this Delaunay, and recomputes the cells.
| [in] | nb_vertices | number of vertices |
| [in] | vertices | a pointer to the coordinates of the vertices, as a contiguous array of doubles |
Reimplemented from GEO::Delaunay.
|
overridevirtual |
Used internally for parallel computation of the neighborhoods in Delaunay.
Reimplemented from GEO::Delaunay.