MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::Graph Class Reference

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>
 sorted by edgeID
 
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 VertBitSetvalidVerts () 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 EdgeBitSetvalidEdges () const
 returns all valid edges in the graph
 
bool valid (EdgeId e) const
 returns true if given edge is valid
 
const Neighboursneighbours (VertId v) const
 returns all edges adjacent to given vertex
 
const EndVerticesends (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
 

Detailed Description

mathematical graph consisting from vertices and undirected edges


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