Project OpenGeode
class GraphBuilder
Interface class to represent the builder of a Graph
Inherits from VertexSetBuilder
Inherits from VertexSetBuilder
Functions
create
public std::unique_ptr<GraphBuilder> create(Graph & mesh)
public std::unique_ptr<GraphBuilder> create(Graph & mesh)
Create the builder associated with a Graph.
mesh [in] The Graph to build/modify
create_edge
public index_t create_edge()
public index_t create_edge()
Create a new edge.
return the index of the created edge
create_edge
public index_t create_edge(index_t v0_id, index_t v1_id)
public index_t create_edge(index_t v0_id, index_t v1_id)
Create a new edge between to vertex.
v0_id [in] Index of the edge initial vertex
v1_id [in] Index of the edge terminal vertex
return the index of the created edge
create_edges
public index_t create_edges(index_t nb)
public index_t create_edges(index_t nb)
Create several new edges.
nb [in] Number of edges to create
return the index of the first created edge
set_edge_vertex
public void set_edge_vertex(const EdgeVertex & edge_vertex, index_t vertex_id)
public void set_edge_vertex(const EdgeVertex & edge_vertex, index_t vertex_id)
Set a vertex as an edge endpoint
edge_vertex [in] Index of the edge endpoint
vertex_id [in] Index of the vertex to set as edge endpoint
associate_edge_vertex_to_vertex
public void associate_edge_vertex_to_vertex(const EdgeVertex & edge_vertex, index_t vertex_id)
public void associate_edge_vertex_to_vertex(const EdgeVertex & edge_vertex, index_t vertex_id)
disassociate_edge_vertex_to_vertex
public void disassociate_edge_vertex_to_vertex(const EdgeVertex & edge_vertex)
public void disassociate_edge_vertex_to_vertex(const EdgeVertex & edge_vertex)
set_edges_around_vertex
public void set_edges_around_vertex(index_t vertex_id, EdgesAroundVertex edges)
public void set_edges_around_vertex(index_t vertex_id, EdgesAroundVertex edges)
replace_vertex
public void replace_vertex(index_t old_vertex_id, index_t new_vertex_id)
public void replace_vertex(index_t old_vertex_id, index_t new_vertex_id)
Replace old edge vertices from a given vertex to another.
old_vertex_id [in] Index of the initial mesh vertex to modify
new_vertex_id [in] Index of the target mesh vertex to set as edge vertex
delete_edges
public vector delete_edges(const std::vector<bool> & to_delete)
public vector delete_edges(const std::vector<bool> & to_delete)
Delete a set of edges
to_delete [in] Vector of size graph_.nb_edges(). If to_delete[i] is true the edge of index i is deleted, else the edge is kept.
return the mapping between old edge indices to new ones. Deleted edges new index is NO_ID
permute_edges
public vector permute_edges(Span permutation)
public vector permute_edges(Span permutation)
Permute edges to match the given order.
permutation [in] Vector of size graph_.nb_edges(). Each value corresponds to the destination position.
return the mapping between old edge indices to new ones.
delete_isolated_vertices
public vector delete_isolated_vertices()
public vector delete_isolated_vertices()
Delete all the isolated vertices (not used as edge endpoint)
return the mapping between old vertex indices to new ones. Deleted vertices new index is NO_ID
copy
public void copy(const Graph & graph)
public void copy(const Graph & graph)
GraphBuilder
protected void GraphBuilder(Graph & mesh)
protected void GraphBuilder(Graph & mesh)