40#ifndef GEOGRAM_VORONOI_GENERIC_RVD
41#define GEOGRAM_VORONOI_GENERIC_RVD
77 template <index_t DIM>
133 facets_begin_ = UNSPECIFIED_RANGE;
134 facets_end_ = UNSPECIFIED_RANGE;
135 tets_begin_ = UNSPECIFIED_RANGE;
136 tets_end_ = UNSPECIFIED_RANGE;
137 connected_components_priority_ =
false;
138 facet_seed_marking_ =
nullptr;
139 connected_component_changed_ =
false;
140 current_connected_component_ = 0;
141 cur_stamp_ = NO_INDEX;
144 current_polygon_ =
nullptr;
146 current_polyhedron_ =
nullptr;
157 connected_components_priority_ = x;
172 return connected_components_priority_;
228 facets_begin_ = facets_begin;
229 facets_end_ = facets_end;
242 tets_begin_ = tets_begin;
243 tets_end_ = tets_end;
251 return facets_end_ - facets_begin_;
259 return tets_end_ - tets_begin_;
268 return current_facet_;
277 return current_seed_;
288 return *current_polygon_;
309 return *current_polyhedron_;
376 return &intersections_;
391 template <
class ACTION>
416 const_cast<ACTION&
> ( do_it_)(v, P);
420 const ACTION& do_it_;
430 template <
class ACTION>
459 const_cast<ACTION&
> (do_it_)(
466 const ACTION& do_it_;
476 template <
class ACTION>
507 const_cast<ACTION&
> (do_it_)(
515 const ACTION& do_it_;
525 template <
class ACTION>
557 const_cast<ACTION&
> (do_it_)(
566 const ACTION& do_it_;
575 template <
class ACTION>
610 if(iv1 < iv2 && iv1 < iv3) {
611 const_cast<ACTION&
> (do_it_)(iv1, iv2, iv3);
618 const ACTION& do_it_;
634 template <
class ACTION>
659 const_cast<ACTION&
> ( do_it_)(v, t, C);
663 const ACTION& do_it_;
688 template <
class ACTION>
709 bool visit_inner_tets =
false,
710 bool coherent_triangles =
false
713 visit_inner_tets_(visit_inner_tets),
714 coherent_triangles_(coherent_triangles)
743 if(!visit_inner_tets_) {
746 t_adj = -adjacent - 1;
747 }
else if(adjacent > 0) {
750 v_adj = adjacent - 1;
763 if(coherent_triangles_) {
779 const_cast<ACTION&
> (do_it_)(
819 }
while(cur != first);
839 GEO::signed_quadindex K1(
843 GEO::signed_quadindex K2(
851 const ACTION& do_it_;
852 bool visit_inner_tets_;
853 bool coherent_triangles_;
878 template <
class ACTION>
910 const Vertex* v0 =
nullptr;
912 for(t0 = 0; t0 < C.
max_t(); ++t0) {
938 t_adj = -adjacent - 1;
939 }
else if(adjacent > 0) {
942 v_adj = adjacent - 1;
970 const_cast<ACTION&
> (do_it_)(
1001 }
while(cur != first);
1006 const ACTION& do_it_;
1016 template <
class ACTION>
1050 if(v < v1 && v < v2 && v < v3) {
1051 const_cast<ACTION&
> (do_it_)(v, v1, v2, v3);
1059 const ACTION& do_it_;
1079 template <
class ACTION>
1094 template <
class TRIACTION>
1110 template <
class HEACTION>
1126 template <
class BOACTION>
1142 template <
class PRIMTRIACTION>
1162 template <
class ACTION>
1203 template <
class ACTION>
1205 const ACTION& action,
1206 bool visit_inner_tets =
false,
bool coherent_triangles =
false
1212 action, visit_inner_tets, coherent_triangles
1240 template <
class ACTION>
1242 const ACTION& action
1263 template <
class ACTION>
1293 template <
class ACTION>
1295 if(connected_components_priority_) {
1318 template <
class ACTION>
1321 facets_begin_ == UNSPECIFIED_RANGE &&
1322 facets_end_ == UNSPECIFIED_RANGE
1325 facets_end_ = mesh_->facets.nb();
1327 current_polygon_ =
nullptr;
1329 delaunay_->nb_vertices(),
index_t(-1)
1339 mesh_->vertices.attributes(),
"weight"
1346 for(
index_t f = facets_begin_; f < facets_end_; f++) {
1347 if(!facet_is_marked[f-facets_begin_]) {
1349 facet_is_marked[f-facets_begin_] =
true;
1350 adjacent_facets.push(
1353 while(!adjacent_facets.empty()) {
1354 current_facet_ = adjacent_facets.top().f;
1355 current_seed_ = adjacent_facets.top().seed;
1356 adjacent_facets.pop();
1362 mesh_, current_facet_, symbolic_, vertex_weight
1369 seed_stamp[current_seed_] = current_facet_;
1370 adjacent_seeds.push(current_seed_);
1372 while(!adjacent_seeds.empty()) {
1373 current_seed_ = adjacent_seeds.top();
1374 adjacent_seeds.pop();
1395 if(!facet_is_marked[
1396 index_t(neigh_f)-facets_begin_
1399 index_t(neigh_f)-facets_begin_
1401 adjacent_facets.push(
1412 seed_stamp[neigh_s] != current_facet_
1414 seed_stamp[neigh_s] = current_facet_;
1415 adjacent_seeds.push(
index_t(neigh_s));
1423 current_polygon_ =
nullptr;
1439 template <
class ACTION>
1441 if(connected_components_priority_) {
1464 template <
class ACTION>
1467 tets_begin_ == UNSPECIFIED_RANGE &&
1468 tets_end_ == UNSPECIFIED_RANGE
1471 tets_end_ = mesh_->cells.nb();
1474 geo_assert(tets_begin_ != UNSPECIFIED_RANGE);
1478 delaunay_->nb_vertices(),
index_t(-1)
1488 mesh_->vertices.attributes(),
"weight"
1491 current_polyhedron_ = &C;
1496 for(
index_t t = tets_begin_; t < tets_end_; ++t) {
1497 if(!tet_is_marked[t-tets_begin_]) {
1499 tet_is_marked[t-tets_begin_] =
true;
1503 while(!adjacent_tets.empty()) {
1504 current_tet_ = adjacent_tets.top().f;
1505 current_seed_ = adjacent_tets.top().seed;
1506 adjacent_tets.pop();
1518 seed_stamp[current_seed_] = current_tet_;
1519 adjacent_seeds.push(current_seed_);
1521 while(!adjacent_seeds.empty()) {
1522 current_seed_ = adjacent_seeds.top();
1523 adjacent_seeds.pop();
1526 mesh_, current_tet_, symbolic_, vertex_weight
1534 current_seed_, current_tet_,
1559 if(seed_stamp[neigh_s] != current_tet_) {
1560 seed_stamp[neigh_s] = current_tet_;
1561 adjacent_seeds.push(neigh_s);
1596 current_polyhedron_ =
nullptr;
1619 template <
class ACTION>
1621 const ACTION& action
1625 tets_begin_ == UNSPECIFIED_RANGE &&
1626 tets_end_ == UNSPECIFIED_RANGE
1629 tets_end_ = mesh_->cells.nb();
1632 geo_assert(tets_begin_ != UNSPECIFIED_RANGE);
1635 current_polyhedron_ =
nullptr;
1638 std::deque<TetSeed> adjacent_seeds;
1639 std::stack<index_t> adjacent_tets;
1643 tets_end_ - tets_begin_, NO_STAMP
1647 tets_end_ - tets_begin_, delaunay_->nb_vertices()
1653 facet_seed_marking_ = &visited;
1655 current_polyhedron_ = &C;
1657 current_connected_component_ = 0;
1662 mesh_->vertices.attributes(),
"weight"
1669 for(
index_t t = tets_begin_; t < tets_end_; ++t) {
1670 if(tet_stamp[t - tets_begin_] == NO_STAMP) {
1674 adjacent_seeds.push_back(
1675 TetSeed(current_tet_, current_seed_)
1679 while(!adjacent_seeds.empty()) {
1681 current_tet_ = adjacent_seeds.front().f;
1682 current_seed_ = adjacent_seeds.front().seed;
1683 adjacent_seeds.pop_front();
1685 tet_stamp[current_tet_ - tets_begin_] ==
1691 if(visited.
is_marked(current_tet_, current_seed_)) {
1695 connected_component_changed_ =
true;
1696 adjacent_tets.push(current_tet_);
1697 tet_stamp[current_tet_ - tets_begin_] =
1699 while(!adjacent_tets.empty()) {
1700 current_tet_ = adjacent_tets.top();
1701 adjacent_tets.pop();
1709 mesh_, current_tet_, symbolic_, vertex_weight
1725 connected_component_changed_ =
false;
1727 bool touches_RVC_border =
false;
1761 tet_stamp[neigh_t - tets_begin_] !=
1764 tet_stamp[neigh_t - tets_begin_] =
1766 adjacent_tets.push(neigh_t);
1771 touches_RVC_border =
true;
1772 TetSeed ts(current_tet_, neigh_s);
1774 adjacent_seeds.push_back(ts);
1779 if(touches_RVC_border) {
1781 TetSeed(current_tet_, current_seed_),
1782 current_connected_component_
1786 ++current_connected_component_;
1790 facet_seed_marking_ =
nullptr;
1802 return facet_seed_marking_->is_marked(
FacetSeed(f, s));
1815 return facet_seed_marking_->get_connected_component(
1824 return connected_component_changed_;
1831 return current_connected_component_;
1855 template <
class ACTION>
1857 const ACTION& action
1861 facets_begin_ == UNSPECIFIED_RANGE &&
1862 facets_end_ == UNSPECIFIED_RANGE
1865 facets_end_ = mesh_->facets.nb();
1868 current_polygon_ =
nullptr;
1871 std::deque<FacetSeed> adjacent_seeds;
1872 std::stack<index_t> adjacent_facets;
1876 facets_end_ - facets_begin_, NO_STAMP
1880 facets_end_ - facets_begin_, delaunay_->nb_vertices()
1883 facet_seed_marking_ = &visited;
1885 current_connected_component_ = 0;
1886 index_t F_index = facets_end_ + 1;
1890 mesh_->vertices.attributes(),
"weight"
1897 for(
index_t f = facets_begin_; f < facets_end_; ++f) {
1898 if(facet_stamp[f - facets_begin_] == NO_STAMP) {
1902 adjacent_seeds.push_back(
1903 FacetSeed(current_facet_, current_seed_)
1908 !adjacent_seeds.empty()
1910 current_facet_ = adjacent_seeds.front().f;
1911 current_seed_ = adjacent_seeds.front().seed;
1912 adjacent_seeds.pop_front();
1914 facet_stamp[current_facet_ - facets_begin_] ==
1920 if(visited.
is_marked(current_facet_, current_seed_)) {
1924 connected_component_changed_ =
true;
1925 adjacent_facets.push(current_facet_);
1926 facet_stamp[current_facet_ - facets_begin_] =
1928 while(!adjacent_facets.empty()) {
1929 current_facet_ = adjacent_facets.top();
1930 adjacent_facets.pop();
1935 if(F_index != current_facet_) {
1937 mesh_, current_facet_, symbolic_,
1940 F_index = current_facet_;
1949 connected_component_changed_ =
false;
1951 bool touches_RVC_border =
false;
1970 facet_stamp[neigh_f - facets_begin_] !=
1973 facet_stamp[neigh_f - facets_begin_] =
1975 adjacent_facets.push(neigh_f);
1980 touches_RVC_border =
true;
1982 current_facet_,
index_t(neigh_s)
1985 adjacent_seeds.push_back(fs);
1989 if(touches_RVC_border) {
1991 FacetSeed(current_facet_, current_seed_),
1992 current_connected_component_
1996 ++current_connected_component_;
2000 facet_seed_marking_ =
nullptr;
2011 const double* p = mesh_->vertices.point_ptr(
2012 mesh_->facets.vertex(f,0)
2025 index_t v = mesh_->cells.tet_vertex(t, 0);
2026 const double* p = mesh_->vertices.point_ptr(v);
2045 if(exact_ && delaunay_nn_ !=
nullptr) {
2048 double neighbors_sq_dist[10];
2050 if(delaunay_nn_->nb_vertices() < nb) {
2051 nb = delaunay_nn_->nb_vertices();
2053 delaunay_nn_->nn_search()->get_nearest_neighbors(
2054 nb, p, neighbors, neighbors_sq_dist
2056 index_t nearest = neighbors[0];
2057 double min_d = neighbors_sq_dist[0];
2058 for(
index_t i = 1; i < nb; ++i) {
2059 if(neighbors_sq_dist[i] != min_d) {
2062 if(neighbors[i] < nearest) {
2063 nearest = neighbors[i];
2069 return delaunay_->nearest_vertex(p);
2083 if(ping != &P1 && ping != &P2) {
2089 std::swap(ping, pong);
2101 intersections_.
clear();
2109 if(delaunay_nn_ !=
nullptr) {
2139 const double* geo_restrict pi = delaunay_->vertex_ptr(i);
2143 index_t prev_nb_neighbors = 0;
2144 neighbors_.resize(0);
2145 while(neighbors_.size() < delaunay_nn_->nb_vertices() - 1) {
2147 delaunay_nn_->get_neighbors(i, neighbors_);
2148 if(neighbors_.size() == 0) {
2151 if(prev_nb_neighbors == neighbors_.size()) {
2155 for(; jj < neighbors_.size(); jj++) {
2159 geo_decl_aligned(
double dik);
2160 const double* geo_restrict pk = ping->
vertex(k).
point();
2163 R2 = std::max(R2, dik);
2165 geo_decl_aligned(
double dij);
2166 const double* geo_restrict pj = delaunay_->vertex_ptr(j);
2172 if(dij > 4.1 * R2) {
2183 index_t nb_neighbors = neighbors_.size();
2184 prev_nb_neighbors = nb_neighbors;
2186 if(nb_neighbors > 8) {
2187 nb_neighbors += nb_neighbors / 8;
2192 nb_neighbors = std::min(
2194 delaunay_nn_->nb_vertices() - 1
2197 delaunay_nn_->enlarge_neighborhood(i, nb_neighbors);
2219 for(
index_t jj = 0; jj < neighbors_.size(); jj++) {
2245 pong, intersections_, mesh_, delaunay_, i, j, exact_, symbolic_
2264 if(delaunay_nn_ !=
nullptr) {
2284 const double* geo_restrict pi = delaunay_->vertex_ptr(seed);
2288 index_t prev_nb_neighbors = 0;
2289 neighbors_.resize(0);
2291 while(neighbors_.size() < delaunay_nn_->nb_vertices() - 1) {
2293 delaunay_nn_->get_neighbors(seed, neighbors_);
2294 if(neighbors_.size() == 0) {
2297 if(prev_nb_neighbors == neighbors_.size()) {
2301 for(; jj < neighbors_.size(); jj++) {
2308 geo_decl_aligned(
double dik);
2309 const double* geo_restrict pk =
2313 R2 = std::max(R2, dik);
2315 geo_decl_aligned(
double dij);
2316 const double* geo_restrict pj = delaunay_->vertex_ptr(j);
2322 if(dij > 4.1 * R2) {
2332 index_t nb_neighbors = neighbors_.size();
2333 prev_nb_neighbors = nb_neighbors;
2335 if(nb_neighbors > 8) {
2336 nb_neighbors += nb_neighbors / 8;
2341 nb_neighbors = std::min(
2343 delaunay_nn_->nb_vertices() - 1
2345 delaunay_nn_->enlarge_neighborhood(seed, nb_neighbors);
2359 if(neighbors_.size() == 0) {
2362 for(
index_t jj = 0; jj < neighbors_.size(); jj++) {
2377 mesh_, delaunay_, i, j, exact_, symbolic_
2399 if(delaunay_->dimension() == 3 && delaunay_->nb_cells() != 0) {
2401 stamp_.assign(delaunay_->nb_vertices(), NO_INDEX);
2413 if(stamp_.size() == 0) {
2415 delaunay_->get_neighbors(v, neighbors_);
2421 neighbors_.resize(0);
2424 index_t lv = delaunay_->index(t, v);
2425 for(
index_t lw = 0; lw < delaunay_->cell_size(); lw++) {
2428 if(stamp_[w] != cur_stamp_) {
2429 stamp_[w] = cur_stamp_;
2430 neighbors_.push_back(w);
2434 t =
index_t(delaunay_->next_around_vertex(t, lv));
2435 }
while(t !=
index_t(delaunay_->vertex_cell(v)));
2474 bool connected_components_priority_;
2476 bool connected_component_changed_;
2477 index_t current_connected_component_;
Declaration of base types for implementing user-defined code that queries the cells of a restricted V...
A function to suppress unused parameters compilation warnings.
#define geo_assert(x)
Verifies that a condition is met.
#define geo_debug_assert(x)
Verifies that a condition is met.
Generic mechanism for attributes.
A Corner corresponds to a vertex seen from a triangle.
Computes the intersection between a set of halfspaces.
const GEOGen::Vertex & triangle_dual(index_t t) const
Gets the dual vertex that corresponds to a triangle.
index_t max_v() const
Gets the maximum valid vertex index plus one.
void initialize_from_mesh_tetrahedron(const Mesh *mesh, index_t t, bool symbolic, const GEO::Attribute< double > &vertex_weight)
Assigns a mesh tetrahedron to this ConvexCell.
signed_index_t clip_by_plane(const Mesh *mesh, const Delaunay *delaunay, index_t i, index_t j, bool exact, bool symbolic)
Clips this ConvexCell with a plane.
signed_index_t vertex_id(index_t v) const
Gets the id of a vertex.
void clear()
Clears this ConvexCell.
index_t find_triangle_vertex(index_t t, index_t v) const
Finds the local index of a triangle vertex.
bool triangle_is_used(index_t t) const
Tests whether a given triangle is used.
void move_to_next_around_vertex(Corner &c) const
Replaces a corner by the next corner obtained by turing around the vertex.
signed_index_t vertex_triangle(index_t v) const
Gets one of the triangles incident to a vertex.
index_t max_t() const
Gets the maximum valid triangle index plus one.
Stores associations between (facet,seed) pairs and the index of a connected component.
void mark(const FacetSeed &fs, index_t conn_comp)
Marks a FacetSeed and sets the associated connected component index.
bool is_marked(index_t facet, index_t seed) const
Tests whether a given facet,seed couple is marked.
An allocator for points that are created from intersections in GenericVoronoiDiagram.
Internal representation of polygons for GenericVoronoiDiagram.
void initialize_from_mesh_facet(const Mesh *mesh, index_t f, bool symbolic, const GEO::Attribute< double > &vertex_weight)
Assigns a mesh facet to this Polygon.
index_t nb_vertices() const
Gets the number of vertices.
const Vertex & vertex(index_t i) const
Gets a vertex by index.
index_t next_vertex(index_t i) const
Gets the index of the successor of a Vertex.
void clip_by_plane(Polygon &target, PointAllocator &target_intersections, const Mesh *mesh, const Delaunay *delaunay, index_t i, index_t j, bool exact, bool symbolic)
Clips a polygon with a plane.
void clear()
Clears this Polygon.
Adapter class used internally to implement for_each_border_halfedge().
BorderHalfedgeAction(const ACTION &do_it)
Creates a new BorderHalfedgeAction that wraps a user ACTION instance.
void operator()(index_t v, index_t f, const Polygon &P) const
Callback called for each integration simplex.
Adapter class used internally to implement for_each_halfedge().
void operator()(index_t v, index_t f, const Polygon &P) const
Callback called for each integration simplex.
HalfedgeAction(const ACTION &do_it)
Creates a new HalfedgeAction that wraps a user ACTION instance.
Adapter class used internally to implement for_each_polygon().
void operator()(index_t v, index_t f, const Polygon &P) const
Callback called for each polygon.
PolygonAction(const ACTION &do_it)
Creates a new PolygonAction around a user ACTION instance.
Adapter class used internally to implement for_each_polyhedron().
void operator()(index_t v, index_t t, const Polyhedron &C) const
Callback called for each polyhedron.
PolyhedronAction(const ACTION &do_it)
Creates a new PolyhedronAction that wraps a user ACTION instance.
Adapter class used internally to implement for_each_primal_tetrahedron().
PrimalTetrahedronAction(const ACTION &do_it)
Constructs a new PrimalTetrahedronAction.
void operator()(index_t v, index_t t, const Polyhedron &C) const
Callback called for each polyhedron.
Adapter class used internally to implement for_each_primal_triangle().
void operator()(index_t iv1, index_t f, const Polygon &P) const
Callback called for each primal triangle.
PrimalTriangleAction(const ACTION &do_it)
Creates a new PrimalTriangleAction that wraps a user ACTION instance.
Adapter class used internally to implement for_each_tetrahedron().
TetrahedronAction(const ACTION &do_it)
Creates a new TetrahedronAction that wraps a user ACTION instance.
bool facet_is_incident_to_vertex(const Polyhedron &C, Polyhedron::Corner &c, index_t t) const
Tests whether a Polyhedron facet is incident to a vertex.
void operator()(index_t v, index_t t, const Polyhedron &C) const
Callback called for each polyhedron.
Adapter class used internally to implement for_each_triangle().
void operator()(index_t v, index_t f, const Polygon &P) const
Callback called for each integration simplex.
TriangleAction(const ACTION &do_it)
Creates a new TriangleAction that wraps a user ACTION instance.
Adapter class used internally to implement for_each_volumetric_integration_simplex().
VolumetricIntegrationSimplexAction(const ACTION &do_it, bool visit_inner_tets=false, bool coherent_triangles=false)
Creates a new VolumetricIntegrationSimplexAction that wraps a user ACTION instance.
void operator()(index_t v, index_t t, const Polyhedron &C) const
Callback called for each polyhedron.
void move_to_first_corner_of_facet(const Polyhedron &C, Polyhedron::Corner &c, index_t center_vertex_id) const
Finds the first corner of a facet in a Polyhedron.
static bool symbolic_compare(const Vertex &p1, const Vertex &p2, index_t center_vertex_id)
Compares the symbolic information of two vertices in such a way that a global order is defined.
GEOGen::Vertex Vertex
Internal representation of vertices.
index_t nb_facets_in_range() const
Gets the number of facets in the current range.
Polygon * intersect_cell_facet(index_t seed, Polygon &F)
Computes the intersection between the Voronoi cell of a seed and a facet.
void clip_by_cell(index_t seed, Polyhedron &C)
Computes the intersection between a Voronoi cell and a cell in plain mode.
void set_exact_predicates(bool x)
Specifies whether exact predicates should be used.
void for_each_primal_triangle(const PRIMTRIACTION &action)
Iterates on the triangles of the Restricted Delaunay Triangulation.
static coord_index_t dimension()
Gets the dimension.
Delaunay * delaunay()
Gets the Delaunay triangulation.
index_t find_seed_near_point(const double *p)
Finds a seed near a given point.
GEOGen::ConvexCell Polyhedron
Internal representation of volumetric cells.
GEOGen::Polygon Polygon
Internal representation of polygons.
void set_mesh(GEO::Mesh *mesh)
Sets the input mesh.
void for_each_polyhedron(const ACTION &action)
Iterates on the polyhedra of this RVD.
void compute_volumetric_with_cnx_priority(const ACTION &action)
Low-level API of Restricted Voronoi Diagram traversal with connected components priority.
void for_each_triangle(const TRIACTION &action)
Iterates on the facets of this RVD, triangulated on the fly.
const Polyhedron & current_polyhedron() const
Gets the current cell.
void clip_by_plane(Polyhedron &C, index_t i, index_t j)
Computes the intersection between a Voronoi cell and a half-space determined by a bisector.
void for_each_tetrahedron(const ACTION &action)
Iterates on the polyhedra of this RVD decomposed on the fly into tetrahedra.
index_t current_seed() const
Gets the index of the Delaunay vertex currently processed.
void clip_by_cell(index_t i, Polygon *&ping, Polygon *&pong)
Computes the intersection between a Voronoi cell and a polygon.
bool symbolic() const
Tests whether symbolic mode is active.
void for_each_border_halfedge(const BOACTION &action)
Iterates on the halfedges on the borders of the restricted Voronoi cells that are on the boundary of ...
void for_each_halfedge(const HEACTION &action)
Iterates on the halfedges on the borders of the restricted Voronoi cells.
void compute_volumetric(const ACTION &action)
Low-level API of Restricted Voronoi Diagram traversal .
index_t current_connected_component() const
Gets the index of the current connected component.
GEO::Mesh * mesh()
Gets the input mesh.
void clip_by_cell_SR(index_t seed, Polyhedron &C)
Computes the intersection between a Voronoi cell and a cell in radius-of-security mode.
void for_each_polygon(const ACTION &action)
Iterates on the facets of this RVD.
index_t current_facet() const
Gets the index of the mesh facet currently processed.
const Delaunay * delaunay() const
Gets the Delaunay triangulation.
const Polygon & current_polygon() const
Gets the current polygon.
index_t current_tet() const
Gets the undex of the mesh tetrahedron currently processed.
void intersect_cell_cell(index_t seed, Polyhedron &C)
Computes the intersection between a Voronoi cell and a cell with radius of security or plain mode.
thisclass & operator=(const thisclass &rhs)=delete
Forbids assignment.
void clip_by_cell_SR(index_t i, Polygon *&ping, Polygon *&pong)
Computes the intersection between the Voronoi cell of a vertex and the Mesh 'ping'.
void get_neighbors(index_t v)
Caches the neighbors of a Delaunay vertex.
GEOGen::PointAllocator PointAllocator
Used to allocate the generated points.
void compute_volumetric_with_seeds_priority(const ACTION &action)
Low-level API of Restricted Voronoi Diagram traversal with seeds priority in volumetric mode.
void set_check_SR(bool x)
Specifies whether radius of security should be enforced.
PointAllocator * point_allocator()
Gets the PointAllocator.
RestrictedVoronoiDiagram(Delaunay *delaunay, GEO::Mesh *mesh)
Constructs a new RestrictedVoronoiDiagram.
bool connected_component_changed() const
Tests whether the current connected component changed.
void set_delaunay(Delaunay *delaunay)
Sets the Delaunay triangulation.
bool connected_components_priority() const
Tests whether connected components priority is set.
bool exact_predicates() const
Tests whether exact predicates are used.
index_t find_seed_near_facet(index_t f)
Finds a seed near a given facet.
void swap_polygons(Polygon *&ping, Polygon *&pong)
Swaps two pointers between two polygons.
void set_connected_components_priority(bool x)
Sets traveral priority.
void for_each_primal_tetrahedron(const ACTION &action)
Iterates on the primal tetrahedra of this RVD.
index_t get_facet_seed_connected_component(index_t f, index_t s) const
Gets the index of the connected component associated with a (facet,seed).
void set_symbolic(bool x)
Sets symbolic mode.
void init_get_neighbors()
Creates the data structure for optimized get_neighbors() function.
RestrictedVoronoiDiagram(const thisclass &rhs)=delete
Forbids construction from copy.
bool facet_seed_is_visited(index_t f, index_t s) const
Tests whether a (facet,seed) couple was visited.
void compute_surfacic(const ACTION &action)
Low-level API of Restricted Voronoi Diagram traversal.
void set_facets_range(index_t facets_begin, index_t facets_end)
Sets the facets range.
void compute_surfacic_with_seeds_priority(const ACTION &action)
Low-level API of Restricted Voronoi Diagram traversal with seeds priority in surfacic mode.
index_t nb_tetrahedra_in_range() const
Gets the number of tetrahedra in the current range.
bool check_SR() const
Tests whether radius of security is enforced.
void compute_surfacic_with_cnx_priority(const ACTION &action)
Low-level API of Restricted Voronoi Diagram traversal with connected components priority.
const GEO::Mesh * mesh() const
Gets the input mesh.
index_t find_seed_near_tet(index_t t)
Finds a seed near a given tetrahedron.
void clip_by_plane(Polygon &ping, Polygon &pong, index_t i, index_t j)
Computes the intersection between a polygon and a half-space.
void for_each_volumetric_integration_simplex(const ACTION &action, bool visit_inner_tets=false, bool coherent_triangles=false)
Iterates on the polyhedra of this RVD decomposed on the fly into tetrahedra.
void set_tetrahedra_range(index_t tets_begin, index_t tets_end)
Sets the tetrahedra range.
A set of three integers that encodes the equation of a vertex in GenericVoronoiDiagram.
index_t nb_bisectors() const
Gets the number of bisectors in the symbolic representation.
index_t bisector(signed_index_t i) const
Gets a bisector.
Internal representation of vertices in GenericVoronoiDiagram.
const double * point() const
Gets the geometric location at this Vertex.
const SymbolicVertex & sym() const
Gets the symbolic representation.
signed_index_t adjacent_seed() const
Gets the adjacent seed.
signed_index_t adjacent_facet() const
Gets the adjacent facet.
bool check_flag(EdgeFlag f) const
Tests an EdgeFlag in this Vertex.
bool bind_if_is_defined(AttributesManager &manager, const std::string &name)
Binds this Attribute to an AttributesManager if it already exists in the AttributesManager.
Manages an attribute attached to a set of object.
Delaunay interface for NearestNeighbors search.
Abstract interface for Delaunay triangulation in Nd.
Vector with aligned memory allocation.
Some utilities for implementing surfacic and volumetric restricted Voronoi diagrams.
std::stack< TetSeed > TetSeedStack
A stack of TetSeed.
std::stack< FacetSeed > FacetSeedStack
A stack of FacetSeed.
FacetSeed TetSeed
A (tetrahedron,seed) pair.
std::stack< index_t > SeedStack
A stack of seed indices (index_t).
FacetSeedMarking TetSeedMarking
Stores associations between (tet,seed) pairs and the index of a connected component.
Common include file, providing basic definitions. Should be included before anything else by all head...
Geometric functions in arbitrary dimension.
Classes for managing tuples of indices.
#define geo_dim_alignment(dim)
Gets a point alignment.
double distance2(const COORD_T *p1, const COORD_T *p2, coord_index_t dim)
Computes the squared distance between two nd points.
Global Vorpaline namespace.
void geo_argused(const T &)
Suppresses compiler warnings about unused parameters.
geo_signed_index_t signed_index_t
The type for storing and manipulating indices differences.
GEOGen::SymbolicVertex SymbolicVertex
Symbolic representation of a RestrictedVoronoiDiagram vertex.
geo_index_t index_t
The type for storing and manipulating indices.
geo_coord_index_t coord_index_t
The type for storing coordinate indices, and iterating on the coordinates of a point.
constexpr index_t max_index_t()
Gets the maximum positive value of type index_t.
Types and functions for numbers manipulation.
Filtered exact predicates for restricted Voronoi diagrams.
Function and classes for process manipulation.