Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
GEO::MeshFacetCornersStore Class Reference

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

#include <geogram/mesh/mesh.h>

Inheritance diagram for GEO::MeshFacetCornersStore:
GEO::MeshSubElementsStore

Public Member Functions

 MeshFacetCornersStore (Mesh &mesh)
 
index_t vertex (index_t c) const
 Gets the vertex that a corner is incident to.
 
index_t adjacent_facet (index_t c) const
 Gets the facet that a corner is adjacent to.
 
const index_tadjacent_facet_ptr (index_t c) const
 Gets a pointer to the the facet index that a corner is adjacent to.
 
index_tadjacent_facet_ptr (index_t c)
 Gets a pointer to the the facet index that a corner is adjacent to.
 
void set_vertex (index_t c, index_t v)
 Sets the vertex that a corner is incident to.
 
void set_vertex_no_check (index_t c, index_t v)
 Sets the vertex that a corner is incident to.
 
void set_adjacent_facet (index_t c, index_t f)
 Sets the facet that a corner is adjacent to.
 
index_tvertex_index_ptr (index_t c)
 Gets a pointer to the vertex that a corner is incident to.
 
const index_tvertex_index_ptr (index_t c) const
 Gets a pointer to the vertex that a corner is incident to.
 
const vector< index_t > & vertex_indices () const
 Gets the vertex indices of all corners as a single vector.
 
template<index_t DIM = 3>
vecng< DIM, double > & point (index_t c)
 Gets the point associated with a corner.
 
template<index_t DIM = 3>
const vecng< DIM, double > & point (index_t c) const
 Gets the point associated with a corner.
 
- Public Member Functions inherited from GEO::MeshSubElementsStore
 MeshSubElementsStore (Mesh &mesh)
 Constructs a new MeshSubElementStore.
 
virtual ~MeshSubElementsStore ()
 MeshElementStore destructor.
 
index_t nb () const
 Gets the number of (sub-)elements.
 
AttributesManagerattributes () const
 Gets the attributes manager.
 
index_as_iterator begin () const
 Used by range-based for.
 
index_as_iterator end () const
 Used by range-based for.
 

Protected Member Functions

void clear_store (bool keep_attributes, bool keep_memory=false) override
 Removes all the elements and attributes.
 
void resize_store (index_t new_size) override
 Resizes this MeshSubElementsStore.
 
index_t create_sub_element (index_t v, index_t f=NO_FACET)
 
index_t create_sub_elements (index_t nb)
 
void copy (const MeshFacetCornersStore &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.
 
index_t create_sub_elements (index_t nb)
 Creates a contiguous chunk of attributes for sub-elements.
 
index_t create_sub_element ()
 Creates attributes for a sub-element.
 
void adjust_store ()
 Makes the size of the store tightly match the number of the elements.
 
void copy (const MeshSubElementsStore &rhs, bool copy_attributes=true)
 Copies a MeshSubElementsStore into this one.
 

Protected Attributes

MeshVerticesvertices_
 
MeshFacetsStorefacets_
 
vector< index_tcorner_vertex_
 
vector< index_tcorner_adjacent_facet_
 
- Protected Attributes inherited from GEO::MeshSubElementsStore
Meshmesh_
 
AttributesManager attributes_
 
index_t nb_
 

Friends

class MeshFacets
 
class Mesh
 
class GeogramIOHandler
 

Detailed Description

Stores the facet corners of a mesh (low-level store)

Definition at line 976 of file mesh.h.

Member Function Documentation

◆ adjacent_facet()

index_t GEO::MeshFacetCornersStore::adjacent_facet ( index_t  c) const
inline

Gets the facet that a corner is adjacent to.

Parameters
[in]cthe corner
Returns
the facet that corner is adjacent to or NO_FACET if c is on the border

Definition at line 996 of file mesh.h.

◆ adjacent_facet_ptr() [1/2]

index_t * GEO::MeshFacetCornersStore::adjacent_facet_ptr ( index_t  c)
inline

Gets a pointer to the the facet index that a corner is adjacent to.

Parameters
[in]cthe corner
Returns
a pointer to the the facet index that corner is adjacent to.

Definition at line 1021 of file mesh.h.

◆ adjacent_facet_ptr() [2/2]

const index_t * GEO::MeshFacetCornersStore::adjacent_facet_ptr ( index_t  c) const
inline

Gets a pointer to the the facet index that a corner is adjacent to.

Parameters
[in]cthe corner
Returns
a pointer to the the facet index that corner is adjacent to.

Definition at line 1008 of file mesh.h.

◆ clear_store()

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

◆ copy()

void GEO::MeshFacetCornersStore::copy ( const MeshFacetCornersStore rhs,
bool  copy_attributes = true 
)
inlineprotected

Definition at line 1148 of file mesh.h.

◆ create_sub_element()

index_t GEO::MeshFacetCornersStore::create_sub_element ( index_t  v,
index_t  f = NO_FACET 
)
inlineprotected

Definition at line 1132 of file mesh.h.

◆ create_sub_elements()

index_t GEO::MeshFacetCornersStore::create_sub_elements ( index_t  nb)
inlineprotected

Definition at line 1138 of file mesh.h.

◆ point() [1/2]

template<index_t DIM = 3>
vecng< DIM, double > & GEO::MeshFacetCornersStore::point ( index_t  c)
inline

Gets the point associated with a corner.

Parameters
[in]cthe corner
Returns
a reference to the DIM-d point associated with the corner
Precondition
vertices.dimension() >= DIM

Definition at line 1106 of file mesh.h.

◆ point() [2/2]

template<index_t DIM = 3>
const vecng< DIM, double > & GEO::MeshFacetCornersStore::point ( index_t  c) const
inline

Gets the point associated with a corner.

Parameters
[in]cthe corner
Returns
const a reference to the DIM-d point associated with the corner
Precondition
vertices.dimension() >= DIM

Definition at line 1118 of file mesh.h.

◆ resize_store()

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

◆ set_adjacent_facet()

void GEO::MeshFacetCornersStore::set_adjacent_facet ( index_t  c,
index_t  f 
)
inline

Sets the facet that a corner is adjacent to.

Parameters
[in]cthe corner
[in]fthe facet that corner is adjacent to or NO_FACET if c is on the border

Definition at line 1059 of file mesh.h.

◆ set_vertex()

void GEO::MeshFacetCornersStore::set_vertex ( index_t  c,
index_t  v 
)
inline

Sets the vertex that a corner is incident to.

Parameters
[in]cthe corner
[in]vthe vertex that corner c is incident to
Precondition
v < mesh.vertices.nb()

Definition at line 1032 of file mesh.h.

◆ set_vertex_no_check()

void GEO::MeshFacetCornersStore::set_vertex_no_check ( index_t  c,
index_t  v 
)
inline

Sets the vertex that a corner is incident to.

Does not check whether v is a valid vertex index. This function is useful for some algorithms that need to create/update the facets before creating the vertices.

Parameters
[in]cthe corner
[in]vthe vertex that corner c is incident to
Note
Normal uses do not call this function

Definition at line 1048 of file mesh.h.

◆ vertex()

index_t GEO::MeshFacetCornersStore::vertex ( index_t  c) const
inline

Gets the vertex that a corner is incident to.

Parameters
[in]cthe corner
Returns
the vertex that corner c is incident to

Definition at line 985 of file mesh.h.

◆ vertex_index_ptr() [1/2]

index_t * GEO::MeshFacetCornersStore::vertex_index_ptr ( index_t  c)
inline

Gets a pointer to the vertex that a corner is incident to.

Parameters
[in]cthe corner
Returns
a pointer to the index of the vertex that this corner is incident to
Note
Normal uses do not call this function

Definition at line 1072 of file mesh.h.

◆ vertex_index_ptr() [2/2]

const index_t * GEO::MeshFacetCornersStore::vertex_index_ptr ( index_t  c) const
inline

Gets a pointer to the vertex that a corner is incident to.

Parameters
[in]cthe corner
Returns
a pointer to the index of the vertex that this corner is incident to
Note
Normal uses do not call this function

Definition at line 1084 of file mesh.h.

◆ vertex_indices()

const vector< index_t > & GEO::MeshFacetCornersStore::vertex_indices ( ) const
inline

Gets the vertex indices of all corners as a single vector.

On a triangulated mesh, this is the triangle list (3 vertex indices per facet). It is forbidden to change the size of the returned vector.

Returns
a const reference to the corner-to-vertex table.

Definition at line 1096 of file mesh.h.

Friends And Related Symbol Documentation

◆ GeogramIOHandler

friend class GeogramIOHandler
friend

Definition at line 1164 of file mesh.h.

◆ Mesh

friend class Mesh
friend

Definition at line 1163 of file mesh.h.

◆ MeshFacets

friend class MeshFacets
friend

Definition at line 1162 of file mesh.h.

Member Data Documentation

◆ corner_adjacent_facet_

vector<index_t> GEO::MeshFacetCornersStore::corner_adjacent_facet_
protected

Definition at line 1160 of file mesh.h.

◆ corner_vertex_

vector<index_t> GEO::MeshFacetCornersStore::corner_vertex_
protected

Definition at line 1159 of file mesh.h.

◆ facets_

MeshFacetsStore& GEO::MeshFacetCornersStore::facets_
protected

Definition at line 1158 of file mesh.h.

◆ vertices_

MeshVertices& GEO::MeshFacetCornersStore::vertices_
protected

Definition at line 1157 of file mesh.h.


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