30 assert( a ==
v0 || a ==
v1 );
35 assert( what != with );
36 assert( (
v0 == what &&
v1 != with ) || (
v1 == what &&
v0 != with ) );
52 [[nodiscard]]
size_t vertSize()
const {
return neighboursPerVertex_.
size(); }
58 [[nodiscard]]
bool valid(
VertId v )
const {
return validVerts_.test( v ); }
61 [[nodiscard]]
size_t edgeSize()
const {
return endsPerEdge_.
size(); }
67 [[nodiscard]]
bool valid(
EdgeId e )
const {
return validEdges_.test( e ); }
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
mathematical graph consisting from vertices and undirected edges
Definition MRGraph.h:14
MRMESH_API void construct(NeighboursPerVertex neighboursPerVertex, EndsPerEdge endsPerEdge)
constructs the graph from all valid vertices and edges
const EndVertices & ends(EdgeId e) const
returns the ends of given edge
Definition MRGraph.h:73
size_t edgeSize() const
returns the number of edge records, including invalid ones
Definition MRGraph.h:61
MRMESH_API void merge(VertId remnant, VertId dead, std::function< void(EdgeId remnant, EdgeId dead)> onMergeEdges)
const Neighbours & neighbours(VertId v) const
returns all edges adjacent to given vertex
Definition MRGraph.h:70
bool valid(VertId v) const
returns true if given vertex is valid
Definition MRGraph.h:58
bool valid(EdgeId e) const
returns true if given edge is valid
Definition MRGraph.h:67
MRMESH_API EdgeId findEdge(VertId a, VertId b) const
finds and returns edge between vertices a and b; returns invalid edge otherwise
const VertBitSet & validVerts() const
returns all valid vertices in the graph
Definition MRGraph.h:55
MRMESH_API bool checkValidity() const
verifies that all internal data structures are valid
const EdgeBitSet & validEdges() const
returns all valid edges in the graph
Definition MRGraph.h:64
std::vector< EdgeId > Neighbours
Definition MRGraph.h:22
GraphEdgeBitSet EdgeBitSet
Definition MRGraph.h:20
GraphEdgeId EdgeId
Definition MRGraph.h:17
GraphVertBitSet VertBitSet
Definition MRGraph.h:19
bool areNeighbors(VertId a, VertId b) const
returns true if the vertices a and b are neighbors
Definition MRGraph.h:79
size_t vertSize() const
returns the number of vertex records, including invalid ones
Definition MRGraph.h:52
GraphVertId VertId
Definition MRGraph.h:16
std::size_t size() const
Definition MRMesh/MRVector.h:42
Definition MRCameraOrientationPlugin.h:8
VertId v1
Definition MRGraph.h:27
VertId otherEnd(VertId a) const
Definition MRGraph.h:28
VertId v0
Definition MRGraph.h:27
void replaceEnd(VertId what, VertId with)
Definition MRGraph.h:33
auto operator<=>(const EndVertices &) const =default