Graphite  Version 3
An experimental 3D geometry processing program
GEO::MeshCellsStore Class Reference

Stores the cells of a mesh (low-level store) More...

#include <geogram/mesh/mesh.h>

Inheritance diagram for GEO::MeshCellsStore:
GEO::MeshSubElementsStore GEO::MeshCells

Public Member Functions

 MeshCellsStore (Mesh &mesh)
 
bool are_simplices () const
 Tests whether all the cells are tetrahedra. More...
 
MeshCellType type (index_t c) const
 Gets the type of a cell. More...
 
const CellDescriptordescriptor (index_t c) const
 Gets the descriptor of a cell. More...
 
index_t nb_corners (index_t c) const
 Gets the number of corners of a cell. More...
 
index_t corners_begin (index_t c) const
 Gets the first element for iterating over the corners of a cell. More...
 
index_t corners_end (index_t c) const
 Gets the upper limit for iterating over the corners of a cell. More...
 
index_t corner (index_t c, index_t lv) const
 Gets a corner of a cell by local vertex index. More...
 
index_t nb_facets (index_t c) const
 Gets the number of facets of a cell. More...
 
index_t facets_begin (index_t c) const
 Gets the first element for iterating over the facets of a cell. More...
 
index_t facets_end (index_t c) const
 Gets the upper limit for iterating over the facets of a cell. More...
 
index_t facet (index_t c, index_t lf) const
 Gets a facet of a cell by local facet index. More...
 
index_t nb_edges (index_t c) const
 Gets the number of edges in a cell. More...
 
- Public Member Functions inherited from GEO::MeshSubElementsStore
 MeshSubElementsStore (Mesh &mesh)
 Constructs a new MeshSubElementStore. More...
 
virtual ~MeshSubElementsStore ()
 MeshElementStore destructor.
 
index_t nb () const
 Gets the number of (sub-)elements. More...
 
AttributesManagerattributes () const
 Gets the attributes manager. More...
 
index_as_iterator begin () const
 Used by range-based for. More...
 
index_as_iterator end () const
 Used by range-based for. More...
 

Static Public Member Functions

static const CellDescriptorcell_type_to_cell_descriptor (MeshCellType t)
 Gets a descriptor by cell type. More...
 

Protected Member Functions

void clear_store (bool keep_attributes, bool keep_memory=false) override
 Removes all the elements and attributes. More...
 
void resize_store (index_t new_size) override
 Resizes this MeshSubElementsStore. More...
 
index_t create_sub_element (MeshCellType type)
 
index_t create_sub_elements (index_t nb, MeshCellType type)
 
void copy (const MeshCellsStore &rhs, bool copy_attributes=true)
 
- Protected Member Functions inherited from GEO::MeshSubElementsStore
void reserve_store (index_t nb_to_reserve)
 Reserves space for new elements. More...
 
index_t create_sub_elements (index_t nb)
 Creates a contiguous chunk of attributes for sub-elements. More...
 
index_t create_sub_element ()
 Creates attributes for a sub-element. More...
 
void adjust_store ()
 Makes the size of the store tightly match the number of the elements. More...
 
void copy (const MeshSubElementsStore &rhs, bool copy_attributes=true)
 Copies a MeshSubElementsStore into this one. More...
 

Protected Attributes

bool is_simplicial_
 
vector< Numeric::uint8cell_type_
 
vector< index_tcell_ptr_
 
- Protected Attributes inherited from GEO::MeshSubElementsStore
Meshmesh_
 
AttributesManager attributes_
 
index_t nb_
 

Friends

class Mesh
 
class GeogramIOHandler
 

Detailed Description

Stores the cells of a mesh (low-level store)

Definition at line 1530 of file mesh.h.

Member Function Documentation

◆ are_simplices()

bool GEO::MeshCellsStore::are_simplices ( ) const
inline

Tests whether all the cells are tetrahedra.

Storage and access are optimized when all the cells are tetrahedra

Return values
trueif all the cells are tetrahedra
falseotherwise

Definition at line 1541 of file mesh.h.

◆ cell_type_to_cell_descriptor()

static const CellDescriptor& GEO::MeshCellsStore::cell_type_to_cell_descriptor ( MeshCellType  t)
inlinestatic

Gets a descriptor by cell type.

The descriptor of a cell is a set of static arrays that facilitate some accesses (most client code do not need to use this function)

Parameters
[in]tone of MESH_TET, MESH_HEX, MESH_PRISM, MESH_PYRAMID, MESH_CONNECTOR
Returns
the descriptor of cell c

Definition at line 1583 of file mesh.h.

◆ clear_store()

void GEO::MeshCellsStore::clear_store ( bool  keep_attributes,
bool  keep_memory = false 
)
overrideprotectedvirtual

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.

Reimplemented from GEO::MeshSubElementsStore.

◆ corner()

index_t GEO::MeshCellsStore::corner ( index_t  c,
index_t  lv 
) const
inline

Gets a corner of a cell by local vertex index.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lvthe local vertex index, in 0..nb_corners(c)-1
Returns
the corner incident to vertex lv in cell c

Definition at line 1628 of file mesh.h.

◆ corners_begin()

index_t GEO::MeshCellsStore::corners_begin ( index_t  c) const
inline

Gets the first element for iterating over the corners of a cell.

Parameters
[in]cthe cell, in 0..nb()-1
Returns
the first corner of the cell

Definition at line 1606 of file mesh.h.

◆ corners_end()

index_t GEO::MeshCellsStore::corners_end ( index_t  c) const
inline

Gets the upper limit for iterating over the corners of a cell.

Parameters
[in]cthe cell, in 0..nb()-1
Returns
one position past the last corner of the cell

Definition at line 1617 of file mesh.h.

◆ descriptor()

const CellDescriptor& GEO::MeshCellsStore::descriptor ( index_t  c) const
inline

Gets the descriptor of a cell.

The descriptor of a cell is a set of static arrays that facilitate some accesses (most client code do not need to use this function)

Parameters
[in]ca cell, in 0..nb()-1
Returns
the descriptor of cell c

Definition at line 1564 of file mesh.h.

◆ facet()

index_t GEO::MeshCellsStore::facet ( index_t  c,
index_t  lf 
) const
inline

Gets a facet of a cell by local facet index.

Parameters
[in]cthe cell, in 0..nb()-1
[in]lfthe local facet index, in 0..nb_facets(c)-1
Returns
the facet lf in cell c

Definition at line 1676 of file mesh.h.

◆ facets_begin()

index_t GEO::MeshCellsStore::facets_begin ( index_t  c) const
inline

Gets the first element for iterating over the facets of a cell.

Parameters
[in]cthe cell, in 0..nb()-1
Returns
the first facet of the cell

Definition at line 1654 of file mesh.h.

◆ facets_end()

index_t GEO::MeshCellsStore::facets_end ( index_t  c) const
inline

Gets the upper limit for iterating over the facets of a cell.

Parameters
[in]cthe cell, in 0..nb()-1
Returns
one position past the last facet of the facet

Definition at line 1665 of file mesh.h.

◆ nb_corners()

index_t GEO::MeshCellsStore::nb_corners ( index_t  c) const
inline

Gets the number of corners of a cell.

Parameters
[in]ca cell, in 0..nb()-1
Returns
the number of corners of cell c

Definition at line 1595 of file mesh.h.

◆ nb_edges()

index_t GEO::MeshCellsStore::nb_edges ( index_t  c) const
inline

Gets the number of edges in a cell.

Parameters
[in]cthe cell, in 0..nb()-1
Returns
the number of edges in cell c

Definition at line 1687 of file mesh.h.

◆ nb_facets()

index_t GEO::MeshCellsStore::nb_facets ( index_t  c) const
inline

Gets the number of facets of a cell.

Parameters
[in]cthe cell, in 0..nb()-1
Returns
the number of facets of cell c

Definition at line 1643 of file mesh.h.

◆ resize_store()

void GEO::MeshCellsStore::resize_store ( index_t  new_size)
overrideprotectedvirtual

Resizes this MeshSubElementsStore.

On exit, nb() == new_size, elements are created or destroyed if needed.

Parameters
[in]new_sizethe desired size

Reimplemented from GEO::MeshSubElementsStore.

◆ type()

MeshCellType GEO::MeshCellsStore::type ( index_t  c) const
inline

Gets the type of a cell.

Parameters
[in]cthe cell, in 0..nb()-1
Returns
one of MESH_TET, MESH_HEX, MESH_PRISM, MESH_PYRAMID, MESH_CONNECTOR.

Definition at line 1551 of file mesh.h.


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