Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::MeshElements Class Referenceabstract

Base class for mesh elements. More...

#include <geogram/mesh/mesh.h>

Inheritance diagram for GEO::MeshElements:
GEO::MeshCells GEO::MeshEdges GEO::MeshFacets GEO::MeshVertices

Public Member Functions

virtual void delete_elements (vector< index_t > &to_delete, bool remove_isolated_vertices=true)=0
 Deletes a set of elements. More...
 
virtual void permute_elements (vector< index_t > &permutation)=0
 Applies a permutation to the elements and their attributes. More...
 
virtual void clear (bool keep_attributes=true, bool keep_memory=false)=0
 Removes all the elements and attributes. More...
 
virtual void pop ()=0
 Removes the last element.
 

Static Protected Member Functions

static bool has_non_zero (const GEO::vector< index_t > &I)
 Tests whether a vector contains a non-zero value. More...
 

Detailed Description

Base class for mesh elements.

Mesh elements can be created / manipulated independantly, in contrast with sub-elements that cannot. Mesh elements are vertices, facets and cells.

Definition at line 243 of file mesh.h.

Member Function Documentation

◆ clear()

virtual void GEO::MeshElements::clear ( bool  keep_attributes = true,
bool  keep_memory = false 
)
pure virtual

Removes all the elements and attributes.

Parameters
[in]keep_attributesif true, then all the existing attribute names / bindings are kept (but they are cleared). If false, they are destroyed.
[in]keep_memoryif true, then memory is kept and can be reused by subsequent mesh element creations.

Implemented in GEO::MeshCells, GEO::MeshFacets, GEO::MeshEdges, and GEO::MeshVertices.

◆ delete_elements()

virtual void GEO::MeshElements::delete_elements ( vector< index_t > &  to_delete,
bool  remove_isolated_vertices = true 
)
pure virtual

Deletes a set of elements.

Parameters
[in]to_deletea vector of size nb(). If to_delete[e] is different from 0, then element e will be destroyed, else it will be kept. On exit, to_delete is modified (it is used for internal bookkeeping).
[in]remove_isolated_verticesif true, then the vertices that are no longer incident to any element are deleted.

Implemented in GEO::MeshCells, GEO::MeshFacets, GEO::MeshEdges, and GEO::MeshVertices.

◆ has_non_zero()

static bool GEO::MeshElements::has_non_zero ( const GEO::vector< index_t > &  I)
inlinestaticprotected

Tests whether a vector contains a non-zero value.

This function is used internally by delete_elements()

Parameters
[in]Ia vector of signed integers
Return values
trueif I contains at least a non-zero value
falseotherwise

Definition at line 302 of file mesh.h.

◆ permute_elements()

virtual void GEO::MeshElements::permute_elements ( vector< index_t > &  permutation)
pure virtual

Applies a permutation to the elements and their attributes.

On exit, permutation is modified (used for internal bookkeeping). Applying a permutation permutation is equivalent to:

for(i=0; i<permutation.size(); i++) {
data2[i] = data[permutation[i]]
}
data = data2 ;

Implemented in GEO::MeshCells, GEO::MeshFacets, GEO::MeshEdges, and GEO::MeshVertices.


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