Geogram
Version 1.9.1-rc
A programming library of geometric algorithms
|
Baseclass for user functions called for each polyhedron of a volumetric restricted Voronoi diagram. More...
#include <geogram/voronoi/RVD_callback.h>
Public Member Functions | |
RVDPolyhedronCallback () | |
PolyhedronCallback constructor. | |
~RVDPolyhedronCallback () override | |
PolyhedronCallback destructor. | |
void | begin () override |
Called at the beginning of the RVD traversal. More... | |
void | end () override |
Called at the end of the RVD traversal. More... | |
virtual void | operator() (index_t v, index_t t, const GEOGen::ConvexCell &C) const |
The default callback called for each polyhedron. More... | |
virtual void | begin_polyhedron (index_t seed, index_t tetrahedron) |
Called at the beginning of each intersection polyhedron. More... | |
virtual void | begin_facet (index_t facet_seed, index_t facet_tet) |
Called at the beginning of each facet of each intersection polyhedron. More... | |
virtual void | vertex (const double *geometry, const GEOGen::SymbolicVertex &symb) |
Called for each vertex of the current facet. More... | |
virtual void | end_facet () |
Called at the end of each polyhedron facet. | |
virtual void | end_polyhedron () |
Called at the end of each polyhedron. | |
index_t | tet () const |
Gets the index of the tetrahedron that corresponds to the current polyhedron. More... | |
index_t | facet_seed () const |
Gets the index of the seed that defines the bisector on which the current facet lies, or index_t(-1). More... | |
index_t | facet_tet () const |
Gets the index of the tetrahedron adjacent to the current facet or index_t(-1) if there is no such facet. More... | |
void | set_simplify_internal_tet_facets (bool x) |
Specifies whether internal tetrahedron facets should be removed. More... | |
void | set_simplify_voronoi_facets (bool x) |
Specifies whether Voronoi facets should be simplified. More... | |
void | set_simplify_boundary_facets (bool x, double angle_threshold=45.0) |
Specifies whether boundary facets should be simplified. More... | |
void | set_tessellate_non_convex_facets (bool x) |
Specifies whether non-convex facets should be tessellated. More... | |
void | set_use_mesh (bool x) |
Specifies whether a mesh should be built for each traversed polyhedron. More... | |
void | set_dimension (index_t dim) |
Sets the dimension of the internal mesh if need be. More... | |
Public Member Functions inherited from GEO::RVDCallback | |
RVDCallback () | |
RVDCallback constructor. | |
virtual | ~RVDCallback () |
RVDCallback destructor. | |
index_t | seed () const |
Gets the index of the seed that corresponds to the current polygon/polyhedron. More... | |
index_t | simplex () const |
Gets the index of the simplex that corresponds to the current polygon/polyhedron. More... | |
void | set_spinlocks (Process::SpinLockArray *spinlocks) |
Sets the spinlocks array. More... | |
Protected Member Functions | |
virtual void | begin_polyhedron_internal (index_t seed, index_t tetrahedron) |
Filters callbacks between operator() and client callbacks. More... | |
virtual void | begin_facet_internal (index_t facet_seed, index_t facet_tet) |
Filters callbacks between operator() and client callbacks. More... | |
virtual void | vertex_internal (const double *geometry, const GEOGen::SymbolicVertex &symb) |
Filters callbacks between operator() and client callbacks. More... | |
virtual void | end_facet_internal () |
Filters callbacks between operator() and client callbacks. More... | |
virtual void | end_polyhedron_internal () |
Filters callbacks between operator() and client callbacks. More... | |
virtual void | process_polyhedron_mesh () |
If use_mesh is set, then this function is called for each generated mesh. More... | |
Protected Attributes | |
index_t | facet_seed_ |
index_t | facet_tet_ |
index_t | last_seed_ |
bool | simplify_internal_tet_facets_ |
bool | simplify_voronoi_facets_ |
bool | simplify_boundary_facets_ |
double | simplify_boundary_facets_angle_threshold_ |
bool | tessellate_non_convex_facets_ |
bool | use_mesh_ |
bool | facet_is_skipped_ |
Mesh | mesh_ |
Attribute< GEOGen::SymbolicVertex > | mesh_vertex_sym_ |
Attribute< index_t > | mesh_facet_seed_ |
Attribute< index_t > | mesh_facet_tet_ |
RVDVertexMap * | vertex_map_ |
vector< index_t > | base_current_facet_ |
Protected Attributes inherited from GEO::RVDCallback | |
index_t | seed_ |
index_t | simplex_ |
Process::SpinLockArray * | spinlocks_ |
Baseclass for user functions called for each polyhedron of a volumetric restricted Voronoi diagram.
A volumetric restricted Voronoi diagram is the intersection between Voronoi cells and the tetrahedra of a given tetrahedral mesh. The member functions of this class are called for each intersection between a Voronoi cell and a tetrahedron.
Definition at line 202 of file RVD_callback.h.
|
overridevirtual |
Called at the beginning of the RVD traversal.
Reimplemented from GEO::RVDCallback.
Reimplemented in GEO::BuildRVDMesh.
|
virtual |
Called at the beginning of each facet of each intersection polyhedron.
A facet can be a subset of either a bisector (defined by two seeds), or it can be a subset of a facet of a tetrahedron.
[in] | facet_seed | if the facet corresponds to a bisector, the index of the seed that defines the bisector, or index_t(-1) otherwise |
[in] | facet_tet | if the facet corresponds to a facet of the current tetrahedron, the index of the tetrahedron adjacent to that facet, or index_t(-1) otherwise |
Reimplemented in GEO::BuildRVDMesh.
|
protectedvirtual |
Filters callbacks between operator() and client callbacks.
This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).
|
virtual |
Called at the beginning of each intersection polyhedron.
Each intersection polyhedron is defined as the intersection between a Voronoi cell and a tetrahedron.
[in] | seed | index of the seed associated with the Voronoi cell |
[in] | tetrahedron | index of the tetrahedron |
Reimplemented in GEO::BuildRVDMesh.
|
protectedvirtual |
Filters callbacks between operator() and client callbacks.
This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).
|
overridevirtual |
Called at the end of the RVD traversal.
Reimplemented from GEO::RVDCallback.
Reimplemented in GEO::BuildRVDMesh.
|
protectedvirtual |
Filters callbacks between operator() and client callbacks.
This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).
|
protectedvirtual |
Filters callbacks between operator() and client callbacks.
This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).
|
inline |
Gets the index of the seed that defines the bisector on which the current facet lies, or index_t(-1).
Each facet is either on a bisector or on a tetrahedron facet. If the current facet is on a bisector, it is defined by seed() and facet_seed(), otherwise facet_seed() returns index_t(-1).
Definition at line 308 of file RVD_callback.h.
|
inline |
Gets the index of the tetrahedron adjacent to the current facet or index_t(-1) if there is no such facet.
Each facet is either on a bisector or on a tetrahedron facet. If the current facet is on a tetrahedron facet, then it is defined by tet() and facet_tet(), otherwise facet_tet() returns index_t(-1).
Definition at line 322 of file RVD_callback.h.
|
virtual |
The default callback called for each polyhedron.
This default implementation routes the callback to the begin_polyhedron_internal(), end_polyhedron_internal(), begin_facet_internal(), end_facet_internal() and vertex_internal() functions (that in turn route the callbacks to their without "_internal" counterparts).
[in] | v | index of current Delaunay seed |
[in] | t | index of current mesh tetrahedron |
[in] | C | intersection between current mesh tetrahedron and the Voronoi cell of v |
|
protectedvirtual |
If use_mesh is set, then this function is called for each generated mesh.
Default implementation simplifies the mesh based on sipmlify_xxx flags, then it calls user callbacks begin_facet(), end_facet(), vertex() for each facet of the mesh, as well as begin_polyhedron() and end_polyhedron() once per mesh. Derived classes may modify (e.g., simplify) the mesh before calling user callbacks.
Reimplemented in GEO::BuildRVDMesh.
|
inline |
Sets the dimension of the internal mesh if need be.
This function is called automatically by RestrictedVoronoiDiagram::for_each_polyhedron().
[in] | dim | the dimension of the mesh (3 for 3d). |
Definition at line 408 of file RVD_callback.h.
|
inline |
Specifies whether boundary facets should be simplified.
By default, the intersection between a Voronoi cell and the boundary is possibly composed of multiple polygons, that correspond to the initial polygons of the boundary. They can be simplified as a single polygon per Voronoi cell. This implies simplifying the internal tetrahedron facets, simplifying the Voronoi facets and using a mesh.
[in] | x | true if boundary facets should be simplified, false otherwise. |
[in] | angle_threshold | an edge shared by two adjacent facets is suppressed if the angle between the facet normals is smaller than angle_threshold |
Definition at line 372 of file RVD_callback.h.
|
inline |
Specifies whether internal tetrahedron facets should be removed.
If set, a single polyhedron is generated for each (connected component) of the restricted Voronoi cells. If not set (default), each tetrahedron-Voronoi cell intersection generates a new polyhedron.
[in] | x | true if internal facets should be removed, false otherwise |
Definition at line 336 of file RVD_callback.h.
|
inline |
Specifies whether Voronoi facets should be simplified.
By default, the computed Voronoi facets are composed of multiple polyhedra that correspond to the intersection with the tetrahedra of the input volume mesh. They can be simplified and replaced by a single polygon. This implies simplifying the internal tetrahedron facets and using a mesh.
[in] | x | true if Voronoi facets should be simplified, false otherwise. |
Definition at line 350 of file RVD_callback.h.
|
inline |
Specifies whether non-convex facets should be tessellated.
[in] | x | true if non-convex facets should be tessellated, false otherwise. |
Only taken into account if set_use_mesh(true) was called.
Definition at line 388 of file RVD_callback.h.
void GEO::RVDPolyhedronCallback::set_use_mesh | ( | bool | x | ) |
Specifies whether a mesh should be built for each traversed polyhedron.
The build mesh can then be modified (e.g., simplified) by overloading process_mesh().
[in] | x | true if a mesh should be build, false otherwise |
|
inline |
Gets the index of the tetrahedron that corresponds to the current polyhedron.
The current polyhedron is the intersection between a Voronoi cell and a tetrahedron.
Definition at line 295 of file RVD_callback.h.
|
virtual |
Called for each vertex of the current facet.
[in] | geometry | a pointer to the coordinates of the vertex |
[in] | symb | the symbolic representation of the vertex |
Reimplemented in GEO::BuildRVDMesh.
|
protectedvirtual |
Filters callbacks between operator() and client callbacks.
This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).