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

Constructs a polyhedral mesh from a restricted Voronoi diagram. More...

#include <geogram/voronoi/RVD_callback.h>

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

Public Member Functions

 BuildRVDMesh (Mesh &output_mesh)
 BuildRVDMesh constructor. More...
 
 ~BuildRVDMesh () override
 BuildRVDMesh destructor.
 
void set_generate_ids (bool x)
 Specifies whether ids should be generated. More...
 
void set_shrink (double x)
 Defines the optional shrink factor for cells. More...
 
void begin () override
 Called at the beginning of RVD traversal.
 
void end () override
 Called at the end of RVD traversal.
 
void begin_polyhedron (index_t seed, index_t tetrahedron) override
 Called at the beginning of each RVD polyhedron. More...
 
void begin_facet (index_t facet_seed, index_t facet_tet_facet) override
 Called at the beginning of each facet of each intersection polyhedron. More...
 
void vertex (const double *geometry, const GEOGen::SymbolicVertex &symb) override
 Called for each vertex of the current facet. More...
 
void end_facet () override
 Called at the end of each polyhedron facet. More...
 
void end_polyhedron () override
 Called at the end of each polyhedron. More...
 
void process_polyhedron_mesh () override
 If use_mesh is set, then this function is called for each generated mesh. More...
 
- Public Member Functions inherited from GEO::RVDPolyhedronCallback
 RVDPolyhedronCallback ()
 PolyhedronCallback constructor.
 
 ~RVDPolyhedronCallback () override
 PolyhedronCallback destructor.
 
virtual void operator() (index_t v, index_t t, const GEOGen::ConvexCell &C) const
 The default callback called for each polyhedron. More...
 
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...
 

Additional Inherited Members

- Protected Member Functions inherited from GEO::RVDPolyhedronCallback
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...
 
- Protected Attributes inherited from GEO::RVDPolyhedronCallback
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

Constructs a polyhedral mesh from a restricted Voronoi diagram.

Its member functions are called for each RVD polyhedron, i.e. the intersections between the volumetric mesh tetrahedra and the Voronoi cells. Based on set_simplify_xxx(), a smaller number of polyhedra can be generated.

Definition at line 505 of file RVD_callback.h.

Constructor & Destructor Documentation

◆ BuildRVDMesh()

GEO::BuildRVDMesh::BuildRVDMesh ( Mesh output_mesh)

BuildRVDMesh constructor.

Parameters
[out]output_mesha reference to the generated mesh

Member Function Documentation

◆ begin_facet()

void GEO::BuildRVDMesh::begin_facet ( index_t  facet_seed,
index_t  facet_tet_facet 
)
overridevirtual

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 from GEO::RVDPolyhedronCallback.

◆ begin_polyhedron()

void GEO::BuildRVDMesh::begin_polyhedron ( index_t  seed,
index_t  tetrahedron 
)
overridevirtual

Called at the beginning of each RVD polyhedron.

Parameters
[in]seed,tetrahedronthe (seed,tetrahedron) pair that defines the RVD polyhedron, as the intersection between the Voronoi cell of the seed and the tetrahedron.

Reimplemented from GEO::RVDPolyhedronCallback.

◆ end_facet()

void GEO::BuildRVDMesh::end_facet ( )
overridevirtual

Called at the end of each polyhedron facet.

Reimplemented from GEO::RVDPolyhedronCallback.

◆ end_polyhedron()

void GEO::BuildRVDMesh::end_polyhedron ( )
overridevirtual

Called at the end of each polyhedron.

Reimplemented from GEO::RVDPolyhedronCallback.

◆ process_polyhedron_mesh()

void GEO::BuildRVDMesh::process_polyhedron_mesh ( )
overridevirtual

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 from GEO::RVDPolyhedronCallback.

◆ set_generate_ids()

void GEO::BuildRVDMesh::set_generate_ids ( bool  x)

Specifies whether ids should be generated.

If enabled, unique vertex ids, seed ids and cell ids are generated and attached to the mesh vertices ("vertex_id" attribute) and mesh facets ("seed_id" and "cell_id" attributes) respectively. There is a cell_id per generated polyhedron, and seed_id refers to the Voronoi seed (the point that the Voronoi cell is associated with).

Parameters
[in]xtrue if ids should be generated, false otherwise (default)

◆ set_shrink()

void GEO::BuildRVDMesh::set_shrink ( double  x)

Defines the optional shrink factor for cells.

Parameters
[in]xshrink factor, 0.0 means no shrink, 1.0 means maximum shrink (cell reduced to a point).

◆ vertex()

void GEO::BuildRVDMesh::vertex ( const double *  geometry,
const GEOGen::SymbolicVertex symb 
)
overridevirtual

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 from GEO::RVDPolyhedronCallback.


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