Geogram  Version 1.9.1
A programming library of geometric algorithms
GEO::RVDPolyhedronCallback Class Reference

Baseclass for user functions called for each polyhedron of a volumetric restricted Voronoi diagram. More...

#include <geogram/voronoi/RVD_callback.h>

Inheritance diagram for GEO::RVDPolyhedronCallback:
GEO::RVDCallback GEO::BuildRVDMesh

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::SymbolicVertexmesh_vertex_sym_
 
Attribute< index_tmesh_facet_seed_
 
Attribute< index_tmesh_facet_tet_
 
RVDVertexMapvertex_map_
 
vector< index_tbase_current_facet_
 
- Protected Attributes inherited from GEO::RVDCallback
index_t seed_
 
index_t simplex_
 
Process::SpinLockArrayspinlocks_
 

Detailed Description

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.

Member Function Documentation

◆ begin()

void GEO::RVDPolyhedronCallback::begin ( )
overridevirtual

Called at the beginning of the RVD traversal.

Reimplemented from GEO::RVDCallback.

Reimplemented in GEO::BuildRVDMesh.

◆ begin_facet()

virtual void GEO::RVDPolyhedronCallback::begin_facet ( index_t  facet_seed,
index_t  facet_tet 
)
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.

Parameters
[in]facet_seedif the facet corresponds to a bisector, the index of the seed that defines the bisector, or index_t(-1) otherwise
[in]facet_tetif 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.

◆ begin_facet_internal()

virtual void GEO::RVDPolyhedronCallback::begin_facet_internal ( index_t  facet_seed,
index_t  facet_tet 
)
protectedvirtual

Filters callbacks between operator() and client callbacks.

This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).

See also
begin_facet()

◆ begin_polyhedron()

virtual void GEO::RVDPolyhedronCallback::begin_polyhedron ( index_t  seed,
index_t  tetrahedron 
)
virtual

Called at the beginning of each intersection polyhedron.

Each intersection polyhedron is defined as the intersection between a Voronoi cell and a tetrahedron.

Parameters
[in]seedindex of the seed associated with the Voronoi cell
[in]tetrahedronindex of the tetrahedron

Reimplemented in GEO::BuildRVDMesh.

◆ begin_polyhedron_internal()

virtual void GEO::RVDPolyhedronCallback::begin_polyhedron_internal ( index_t  seed,
index_t  tetrahedron 
)
protectedvirtual

Filters callbacks between operator() and client callbacks.

This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).

See also
begin_polyhedron()

◆ end()

void GEO::RVDPolyhedronCallback::end ( )
overridevirtual

Called at the end of the RVD traversal.

Reimplemented from GEO::RVDCallback.

Reimplemented in GEO::BuildRVDMesh.

◆ end_facet_internal()

virtual void GEO::RVDPolyhedronCallback::end_facet_internal ( )
protectedvirtual

Filters callbacks between operator() and client callbacks.

This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).

See also
end_facet()

◆ end_polyhedron_internal()

virtual void GEO::RVDPolyhedronCallback::end_polyhedron_internal ( )
protectedvirtual

Filters callbacks between operator() and client callbacks.

This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).

See also
end_polyhedron()

◆ facet_seed()

index_t GEO::RVDPolyhedronCallback::facet_seed ( ) const
inline

Gets the index of the seed that defines the bisector on which the current facet lies, or index_t(-1).

Returns
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.

◆ facet_tet()

index_t GEO::RVDPolyhedronCallback::facet_tet ( ) const
inline

Gets the index of the tetrahedron adjacent to the current facet or index_t(-1) if there is no such facet.

Returns
the index of the tetrahedron adjacent to the current facet or index_t(-1).

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.

◆ operator()()

virtual void GEO::RVDPolyhedronCallback::operator() ( index_t  v,
index_t  t,
const GEOGen::ConvexCell C 
) const
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).

Parameters
[in]vindex of current Delaunay seed
[in]tindex of current mesh tetrahedron
[in]Cintersection between current mesh tetrahedron and the Voronoi cell of v

◆ process_polyhedron_mesh()

virtual void GEO::RVDPolyhedronCallback::process_polyhedron_mesh ( )
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.

◆ set_dimension()

void GEO::RVDPolyhedronCallback::set_dimension ( index_t  dim)
inline

Sets the dimension of the internal mesh if need be.

This function is called automatically by RestrictedVoronoiDiagram::for_each_polyhedron().

Parameters
[in]dimthe dimension of the mesh (3 for 3d).

Definition at line 408 of file RVD_callback.h.

◆ set_simplify_boundary_facets()

void GEO::RVDPolyhedronCallback::set_simplify_boundary_facets ( bool  x,
double  angle_threshold = 45.0 
)
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.

Parameters
[in]xtrue if boundary facets should be simplified, false otherwise.
[in]angle_thresholdan 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.

◆ set_simplify_internal_tet_facets()

void GEO::RVDPolyhedronCallback::set_simplify_internal_tet_facets ( bool  x)
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.

Parameters
[in]xtrue if internal facets should be removed, false otherwise

Definition at line 336 of file RVD_callback.h.

◆ set_simplify_voronoi_facets()

void GEO::RVDPolyhedronCallback::set_simplify_voronoi_facets ( bool  x)
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.

Parameters
[in]xtrue if Voronoi facets should be simplified, false otherwise.

Definition at line 350 of file RVD_callback.h.

◆ set_tessellate_non_convex_facets()

void GEO::RVDPolyhedronCallback::set_tessellate_non_convex_facets ( bool  x)
inline

Specifies whether non-convex facets should be tessellated.

Parameters
[in]xtrue 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.

◆ set_use_mesh()

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().

Parameters
[in]xtrue if a mesh should be build, false otherwise

◆ tet()

index_t GEO::RVDPolyhedronCallback::tet ( ) const
inline

Gets the index of the tetrahedron that corresponds to the current polyhedron.

Returns
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.

◆ vertex()

virtual void GEO::RVDPolyhedronCallback::vertex ( const double *  geometry,
const GEOGen::SymbolicVertex symb 
)
virtual

Called for each vertex of the current facet.

Parameters
[in]geometrya pointer to the coordinates of the vertex
[in]symbthe symbolic representation of the vertex

Reimplemented in GEO::BuildRVDMesh.

◆ vertex_internal()

virtual void GEO::RVDPolyhedronCallback::vertex_internal ( const double *  geometry,
const GEOGen::SymbolicVertex symb 
)
protectedvirtual

Filters callbacks between operator() and client callbacks.

This is used to implement cells simplifications (remove internal boundaries and intersections with tetrahedra).

See also
vertex()

The documentation for this class was generated from the following file: