Geogram  Version 1.8.9-rc
A programming library of geometric algorithms
GEO::MeshEdges Class Reference

The edges of a mesh. More...

#include <geogram/mesh/mesh.h>

Inheritance diagram for GEO::MeshEdges:
GEO::MeshSubElementsStore GEO::MeshElements

Public Member Functions

 MeshEdges (Mesh &mesh)
 
index_t vertex (index_t e, index_t lv) const
 Gets the index of an edge vertex. More...
 
void set_vertex (index_t e, index_t lv, index_t v)
 Sets a vertex of an edge. More...
 
index_tvertex_index_ptr (index_t c)
 Gets a pointer to a vertex index by corner index. More...
 
const index_tvertex_index_ptr (index_t c) const
 Gets a pointer to a vertex index by corner index. More...
 
index_t create_edge ()
 Creates a new edge. More...
 
index_t create_edges (index_t nb)
 Creates a batch of edges. More...
 
index_t create_edge (index_t v1, index_t v2)
 Creates a new edge. More...
 
void delete_elements (vector< index_t > &to_delete, bool remove_isolated_vertices=true) override
 Deletes a set of elements. More...
 
void permute_elements (vector< index_t > &permutation) override
 Applies a permutation to the elements and their attributes. More...
 
void clear (bool keep_attributes=true, bool keep_memory=false) override
 Removes all the elements and attributes. More...
 
void pop () override
 Removes the last element.
 
- 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_in)
 
void copy (const MeshEdges &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

vector< index_tedge_vertex_
 
- Protected Attributes inherited from GEO::MeshSubElementsStore
Meshmesh_
 
AttributesManager attributes_
 
index_t nb_
 

Friends

class Mesh
 
class GeogramIOHandler
 

Additional Inherited Members

- Static Protected Member Functions inherited from GEO::MeshElements
static bool has_non_zero (const GEO::vector< index_t > &I)
 Tests whether a vector contains a non-zero value. More...
 

Detailed Description

The edges of a mesh.

Definition at line 625 of file mesh.h.

Member Function Documentation

◆ clear()

void GEO::MeshEdges::clear ( bool  keep_attributes = true,
bool  keep_memory = false 
)
overridevirtual

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.

Implements GEO::MeshElements.

◆ clear_store()

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

◆ create_edge() [1/2]

index_t GEO::MeshEdges::create_edge ( )
inline

Creates a new edge.

Returns
the index of the created edge

Definition at line 682 of file mesh.h.

◆ create_edge() [2/2]

index_t GEO::MeshEdges::create_edge ( index_t  v1,
index_t  v2 
)
inline

Creates a new edge.

Parameters
[in]v1,v2global indices of the vertices of the edge
Returns
the index of the created edge

Definition at line 700 of file mesh.h.

◆ create_edges()

index_t GEO::MeshEdges::create_edges ( index_t  nb)
inline

Creates a batch of edges.

Parameters
[in]nbnumber of edges to create
Returns
the index of the first created edge

Definition at line 691 of file mesh.h.

◆ delete_elements()

void GEO::MeshEdges::delete_elements ( vector< index_t > &  to_delete,
bool  remove_isolated_vertices = true 
)
overridevirtual

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.

Implements GEO::MeshElements.

◆ permute_elements()

void GEO::MeshEdges::permute_elements ( vector< index_t > &  permutation)
overridevirtual

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 ;

Implements GEO::MeshElements.

◆ resize_store()

void GEO::MeshEdges::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_vertex()

void GEO::MeshEdges::set_vertex ( index_t  e,
index_t  lv,
index_t  v 
)
inline

Sets a vertex of an edge.

Parameters
[in]eindex of the edge
[in]lvlocal index of the vertex, in {0,1}
[in]vglobal index of the vertex

Definition at line 649 of file mesh.h.

◆ vertex()

index_t GEO::MeshEdges::vertex ( index_t  e,
index_t  lv 
) const
inline

Gets the index of an edge vertex.

Parameters
[in]eindex of the edge
[in]lvlocal index of the vertex, in {0,1}
Returns
the global index of vertex lv in edge e

Definition at line 637 of file mesh.h.

◆ vertex_index_ptr() [1/2]

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

Gets a pointer to a vertex index by corner index.

Parameters
[in]ccorner index (2 * edge index + 0 or 1)
Returns
a pointer to the index of the vertex.
Note
Normal uses do not call this function

Definition at line 662 of file mesh.h.

◆ vertex_index_ptr() [2/2]

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

Gets a pointer to a vertex index by corner index.

Parameters
[in]ccorner index (2 * edge index + 0 or 1)
Returns
a pointer to the index of the vertex.
Note
Normal uses do not call this function

Definition at line 673 of file mesh.h.


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