Graphite
Version 3
An experimental 3D geometry processing program
|
Implements the MarchingCells algorithm. More...
#include <geogram_gfx/GLUP/GLUP_marching_cells.h>
Public Member Functions | |
MarchingCell (GLUPprimitive prim) | |
MarchingCell constructor. More... | |
~MarchingCell () | |
MarchingCell destructor. | |
index_t | nb_vertices () const |
Gets the number of vertices. More... | |
index_t | nb_edges () const |
Gets the number of edges. More... | |
index_t | nb_configs () const |
Gets the number of configurations. More... | |
index_t | edge_vertex (index_t e, index_t lv) const |
Gets a vertex by edge index and local vertex index. More... | |
index_t | config_size (index_t config) const |
Gets the number of intersected edges in a configuration. More... | |
index_t | max_config_size () const |
Gets the maximum configuration size. More... | |
const index_t * | config_edges (index_t config) const |
Gets the list of intersected edges in a configuration. More... | |
const char * | GLSL_uniform_state_declaration () const |
Gets the GLSL declaration of marching cell uniform state. More... | |
const char * | GLSL_compute_intersections () const |
Gets the GLSL declaration of the function that computes the intersections. More... | |
GLuint | uniform_binding_point () const |
Gets the binding point of the uniform buffer that contains the tables for the marching cell. More... | |
GLuint | create_UBO () |
Creates a Uniform Buffer Object that contains the tables for the marching cell. More... | |
GLuint | create_elements_VBO () |
Creates a Vertex Buffer Object with the indices for all configurations. More... | |
void | bind_uniform_state (GLuint program) |
Binds the uniform state marching cell variables to a given program. | |
Protected Member Functions | |
void | compute_config (index_t config) |
Computes the intersection polygon for a configuration. More... | |
void | move_to_next (index_t &f, index_t &lv) |
Moves from a given halfedge to the next halfege. More... | |
index_t | origin_vertex (index_t f, index_t lv) |
Gets the origin vertex of a halfedge. More... | |
index_t | destination_vertex (index_t f, index_t lv) |
Gets the destination vertex of a halfedge. More... | |
index_t | edge (index_t f, index_t lv) |
Gets the edge index that corresponds to a given halfedge. More... | |
void | move_to_opposite (index_t &f, index_t &lv) |
Moves from a given halfedge to the opposite halfege. More... | |
bool | edge_is_intersected (index_t f, index_t lv, index_t config) |
Tests whether a given edge is intersected. More... | |
bool | config_is_ambiguous (index_t config) |
Tests whether a vertex configuration bitcode is ambiguous. More... | |
bool | get_first_edge (index_t &f, index_t &lv, index_t config) |
Gets the first intersected halfedge given a vertex configuration. More... | |
Implements the MarchingCells algorithm.
MarchingCell compute the intersection between a cell and a plane, using only combinatorial information. It uses the static tables from the Mesh class, so that cell numberings are coherent between storage and graphics.
Definition at line 66 of file GLUP_marching_cells.h.
GLUP::MarchingCell::MarchingCell | ( | GLUPprimitive | prim | ) |
MarchingCell constructor.
[in] | prim | the GLUP volumetric primitive, should be one of GLUP_TETRAHEDRA, GLUP_HEXAHEDRA, GLUP_PRISMS, GLUP_PYRAMIDS. |
|
protected |
Computes the intersection polygon for a configuration.
[in] | config | the vertex configuration bitcode. The bit corresponding to vertex v is set if v is on the positive side of the intersection plane. |
Gets the list of intersected edges in a configuration.
[in] | config | the vertex configuration bitcode. The bit corresponding to vertex v is set if v is on the positive side of the intersection plane. |
Definition at line 146 of file GLUP_marching_cells.h.
|
protected |
Tests whether a vertex configuration bitcode is ambiguous.
A configuration is ambiguous if it results in several intersection polygons.
[in] | config | the vertex configuration bitcode. The bit corresponding to vertex v is set if v is on the positive side of the intersection plane. |
true | if the configuration is ambiguous |
false | otherwise |
Gets the number of intersected edges in a configuration.
[in] | config | the vertex configuration bitcode. The bit corresponding to vertex v is set if v is on the positive side of the intersection plane. |
config
Definition at line 125 of file GLUP_marching_cells.h.
GLuint GLUP::MarchingCell::create_elements_VBO | ( | ) |
Creates a Vertex Buffer Object with the indices for all configurations.
Used by GLUPES2 that does not support UBOs. This MarchingCells keeps ownership of the created VBO (it is destroyed by the destructor of this MarchingCells).
GLuint GLUP::MarchingCell::create_UBO | ( | ) |
Creates a Uniform Buffer Object that contains the tables for the marching cell.
Used by GLUP150 and GLUP440 profiles that support UBOs. This MarchingCells keeps ownership of the created UBO (it is destroyed by the destructor of this MarchingCells).
Gets the destination vertex of a halfedge.
The halfedge is refered to as a facet index and a local vertex index within the facet.
[in] | f | the index of the facet |
[in] | lv | the local index of the vertex in the facet. |
Definition at line 245 of file GLUP_marching_cells.h.
Gets the edge index that corresponds to a given halfedge.
The halfedge is refered to as a facet index and a local vertex index within the facet.
[in] | f | the index of the facet |
[in] | lv | the local index of the vertex in the facet. |
Definition at line 258 of file GLUP_marching_cells.h.
|
inlineprotected |
Tests whether a given edge is intersected.
The halfedge is refered to as a facet index and a local vertex index within the facet.
[in] | f | the index of the facet |
[in] | lv | the local index of the vertex in the facet. |
[in] | config | the vertex configuration bitcode. The bit corresponding to vertex v is set if v is on the positive side of the intersection plane. |
true | if the edge is intersected |
false | otherwise |
Definition at line 287 of file GLUP_marching_cells.h.
Gets a vertex by edge index and local vertex index.
[in] | e | the index of the edge |
[in] | lv | the local vertex index in the edge, one of 0,1 |
Definition at line 112 of file GLUP_marching_cells.h.
Gets the first intersected halfedge given a vertex configuration.
[out] | f | the facet of the first intersected halfedge |
[out] | lv | the local vertex index of the first intersected halfedge |
[in] | config | the vertex configuration bitcode. The bit corresponding to vertex v is set if v is on the positive side of the intersection plane. |
true | if there was an intersection |
false | otherwise |
|
inline |
Gets the GLSL declaration of the function that computes the intersections.
Definition at line 165 of file GLUP_marching_cells.h.
|
inline |
Gets the GLSL declaration of marching cell uniform state.
Definition at line 156 of file GLUP_marching_cells.h.
|
inline |
Gets the maximum configuration size.
Definition at line 134 of file GLUP_marching_cells.h.
Moves from a given halfedge to the next halfege.
The halfedge is refered to as a facet index and a local vertex index within the facet.
[in,out] | f | the index of the facet |
[in,out] | lv | the local index of the vertex in the facet. |
Definition at line 221 of file GLUP_marching_cells.h.
Moves from a given halfedge to the opposite halfege.
The halfedge is refered to as a facet index and a local vertex index within the facet.
[in,out] | f | the index of the facet |
[in,out] | lv | the local index of the vertex in the facet. |
|
inline |
Gets the number of configurations.
Definition at line 102 of file GLUP_marching_cells.h.
|
inline |
Gets the number of edges.
Definition at line 93 of file GLUP_marching_cells.h.
|
inline |
Gets the number of vertices.
Definition at line 85 of file GLUP_marching_cells.h.
Gets the origin vertex of a halfedge.
The halfedge is refered to as a facet index and a local vertex index within the facet.
[in] | f | the index of the facet |
[in] | lv | the local index of the vertex in the facet. |
Definition at line 233 of file GLUP_marching_cells.h.
|
inline |
Gets the binding point of the uniform buffer that contains the tables for the marching cell.
Definition at line 175 of file GLUP_marching_cells.h.