mathematical graph consisting from vertices and undirected edges More...
#include <MRGraph.h>
Classes | |
struct | EndVertices |
Public Types | |
using | VertId = GraphVertId |
using | EdgeId = GraphEdgeId |
using | VertBitSet = GraphVertBitSet |
using | EdgeBitSet = GraphEdgeBitSet |
using | Neighbours = std::vector<EdgeId> |
using | NeighboursPerVertex = Vector<Neighbours, VertId> |
using | EndsPerEdge = Vector<EndVertices, EdgeId> |
Public Member Functions | |
MRMESH_API void | construct (NeighboursPerVertex neighboursPerVertex, EndsPerEdge endsPerEdge) |
constructs the graph from all valid vertices and edges | |
size_t | vertSize () const |
returns the number of vertex records, including invalid ones | |
const VertBitSet & | validVerts () const |
returns all valid vertices in the graph | |
bool | valid (VertId v) const |
returns true if given vertex is valid | |
size_t | edgeSize () const |
returns the number of edge records, including invalid ones | |
const EdgeBitSet & | validEdges () const |
returns all valid edges in the graph | |
bool | valid (EdgeId e) const |
returns true if given edge is valid | |
const Neighbours & | neighbours (VertId v) const |
returns all edges adjacent to given vertex | |
const EndVertices & | ends (EdgeId e) const |
returns the ends of given edge | |
MRMESH_API EdgeId | findEdge (VertId a, VertId b) const |
finds and returns edge between vertices a and b; returns invalid edge otherwise | |
bool | areNeighbors (VertId a, VertId b) const |
returns true if the vertices a and b are neighbors | |
MRMESH_API void | merge (VertId remnant, VertId dead, std::function< void(EdgeId remnant, EdgeId dead)> onMergeEdges) |
MRMESH_API bool | checkValidity () const |
verifies that all internal data structures are valid | |
mathematical graph consisting from vertices and undirected edges
using MR::Graph::EdgeBitSet = GraphEdgeBitSet |
using MR::Graph::EdgeId = GraphEdgeId |
using MR::Graph::EndsPerEdge = Vector<EndVertices, EdgeId> |
using MR::Graph::Neighbours = std::vector<EdgeId> |
using MR::Graph::NeighboursPerVertex = Vector<Neighbours, VertId> |
using MR::Graph::VertBitSet = GraphVertBitSet |
using MR::Graph::VertId = GraphVertId |
returns true if the vertices a and b are neighbors
MRMESH_API bool MR::Graph::checkValidity | ( | ) | const |
verifies that all internal data structures are valid
MRMESH_API void MR::Graph::construct | ( | NeighboursPerVertex | neighboursPerVertex, |
EndsPerEdge | endsPerEdge ) |
constructs the graph from all valid vertices and edges
|
inlinenodiscard |
returns the number of edge records, including invalid ones
|
inlinenodiscard |
returns the ends of given edge
|
nodiscard |
finds and returns edge between vertices a and b; returns invalid edge otherwise
MRMESH_API void MR::Graph::merge | ( | VertId | remnant, |
VertId | dead, | ||
std::function< void(EdgeId remnant, EdgeId dead)> | onMergeEdges ) |
unites two vertices into one (deleting the second one), which leads to deletion and merge of some edges, for which callback is called
|
inlinenodiscard |
returns all edges adjacent to given vertex
|
inlinenodiscard |
returns true if given edge is valid
|
inlinenodiscard |
returns true if given vertex is valid
|
inlinenodiscard |
returns all valid edges in the graph
|
inlinenodiscard |
returns all valid vertices in the graph
|
inlinenodiscard |
returns the number of vertex records, including invalid ones