Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::MeshFacetsStore Class Reference

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

#include <geogram/mesh/mesh.h>

Inheritance diagram for GEO::MeshFacetsStore:
GEO::MeshSubElementsStore GEO::MeshFacets

Public Member Functions

 MeshFacetsStore (Mesh &mesh)
 
index_t corners_begin (index_t f) const
 Gets the first element for iterating over the corners of a facet. More...
 
index_t corners_end (index_t f) const
 Gets the upper limit for iterating over the corners of a facet. More...
 
index_t nb_corners (index_t f) const
 Gets the number of corners in a facet. More...
 
index_t corner (index_t f, index_t lv) const
 Gets a corner by facet and local vertex index. More...
 
bool are_simplices () const
 Tests whether all the facets are triangles. More...
 
const index_tcorners_begin_ptr (index_t f) const
 Gets a pointer to the first element for iterating over the corners of a facet. 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...
 

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 ()
 
index_t create_sub_elements (index_t nb)
 
void copy (const MeshFacetsStore &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< index_tfacet_ptr_
 
- Protected Attributes inherited from GEO::MeshSubElementsStore
Meshmesh_
 
AttributesManager attributes_
 
index_t nb_
 

Friends

class Mesh
 
class GeogramIOHandler
 

Detailed Description

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

Definition at line 753 of file mesh.h.

Member Function Documentation

◆ are_simplices()

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

Tests whether all the facets are triangles.

When all the facets are triangles, storage and access is optimized.

Return values
trueif all the facets are triangles
falseotherwise

Definition at line 809 of file mesh.h.

◆ clear_store()

void GEO::MeshFacetsStore::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::MeshFacetsStore::corner ( index_t  f,
index_t  lv 
) const
inline

Gets a corner by facet and local vertex index.

Parameters
[in]fthe facet
[in]lvthe local index of the vertex in facet f
Returns
the lvth corner of facet f
Precondition
lv < nb_corners(f)

Definition at line 796 of file mesh.h.

◆ corners_begin()

index_t GEO::MeshFacetsStore::corners_begin ( index_t  f) const
inline

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

Parameters
[in]fthe facet
Returns
the first corner of the facet

Definition at line 763 of file mesh.h.

◆ corners_begin_ptr()

const index_t* GEO::MeshFacetsStore::corners_begin_ptr ( index_t  f) const
inline

Gets a pointer to the first element for iterating over the corners of a facet.

Parameters
[in]fthe facet
Returns
a pointer to the first corner of the facet

Definition at line 819 of file mesh.h.

◆ corners_end()

index_t GEO::MeshFacetsStore::corners_end ( index_t  f) const
inline

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

Parameters
[in]fthe facet
Returns
one position past the last corner of the facet

Definition at line 774 of file mesh.h.

◆ nb_corners()

index_t GEO::MeshFacetsStore::nb_corners ( index_t  f) const
inline

Gets the number of corners in a facet.

Parameters
[in]fthe facet
Returns
the number of corners in facet f

Definition at line 784 of file mesh.h.

◆ resize_store()

void GEO::MeshFacetsStore::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.


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