Geogram Version 1.10.2
A programming library of geometric algorithms
Loading...
Searching...
No Matches
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.
void set_vertex (index_t e, index_t lv, index_t v)
 Sets a vertex of an edge.
index_t * vertex_index_ptr (index_t c)
 Gets a pointer to a vertex index by corner index.
const index_t * vertex_index_ptr (index_t c) const
 Gets a pointer to a vertex index by corner index.
index_t create_edge ()
 Creates a new edge.
index_t create_edges (index_t nb)
 Creates a batch of edges.
index_t create_edge (index_t v1, index_t v2)
 Creates a new edge.
void delete_elements (vector< index_t > &to_delete, bool remove_isolated_vertices=true) override
 Deletes a set of elements.
void permute_elements (vector< index_t > &permutation) override
 Applies a permutation to the elements and their attributes.
void clear (bool keep_attributes=true, bool keep_memory=false) override
 Removes all the elements and attributes.
void pop () override
 Removes the last element.
void flip (index_t e)
 Swaps both extremities of an edge.
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.
AttributesManager & attributes () 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 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.
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

vector< index_t > edge_vertex_
Protected Attributes inherited from GEO::MeshSubElementsStore
Mesh & mesh_
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.

Detailed Description

The edges of a mesh.

Definition at line 715 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.

◆ copy()

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

Definition at line 833 of file mesh.h.

◆ 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 772 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 790 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 781 of file mesh.h.

◆ create_sub_element()

index_t GEO::MeshEdges::create_sub_element ( )
inlineprotected

Definition at line 822 of file mesh.h.

◆ create_sub_elements()

index_t GEO::MeshEdges::create_sub_elements ( index_t nb_in)
inlineprotected

Definition at line 828 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.

◆ flip()

void GEO::MeshEdges::flip ( index_t e)

Swaps both extremities of an edge.

Parameters
[in]ethe edge

◆ 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.

◆ pop()

void GEO::MeshEdges::pop ( )
overridevirtual

Removes the last element.

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 739 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 727 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 752 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 763 of file mesh.h.

◆ GeogramIOHandler

friend class GeogramIOHandler
friend

Definition at line 840 of file mesh.h.

◆ Mesh

friend class Mesh
friend

Definition at line 839 of file mesh.h.

Member Data Documentation

◆ edge_vertex_

vector<index_t> GEO::MeshEdges::edge_vertex_
protected

Definition at line 838 of file mesh.h.


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