33 assert( a ==
v0 || a ==
v1 );
38 assert( what != with );
39 assert( (
v0 == what &&
v1 != with ) || (
v1 == what &&
v0 != with ) );
55 [[nodiscard]]
size_t vertSize()
const {
return neighboursPerVertex_.size(); }
61 [[nodiscard]]
bool valid(
VertId v )
const {
return validVerts_.test( v ); }
64 [[nodiscard]]
size_t edgeSize()
const {
return endsPerEdge_.size(); }
70 [[nodiscard]]
bool valid(
EdgeId e )
const {
return validEdges_.test( e ); }
#define MRMESH_API
Definition MRMeshFwd.h:80
mathematical graph consisting from vertices and undirected edges
Definition MRGraph.h:17
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
const EndVertices & ends(EdgeId e) const
returns the ends of given edge
Definition MRGraph.h:76
size_t edgeSize() const
returns the number of edge records, including invalid ones
Definition MRGraph.h:64
Vector< Neighbours, VertId > NeighboursPerVertex
sorted by edgeID
Definition MRGraph.h:26
VertId v1
Definition MRGraph.h:30
EdgeId findEdge(VertId a, VertId b) const
finds and returns edge between vertices a and b; returns invalid edge otherwise
const Neighbours & neighbours(VertId v) const
returns all edges adjacent to given vertex
Definition MRGraph.h:73
Vector< EndVertices, EdgeId > EndsPerEdge
Definition MRGraph.h:49
bool valid(VertId v) const
returns true if given vertex is valid
Definition MRGraph.h:61
bool valid(EdgeId e) const
returns true if given edge is valid
Definition MRGraph.h:70
VertId otherEnd(VertId a) const
v0 < v1
Definition MRGraph.h:31
void construct(NeighboursPerVertex neighboursPerVertex, EndsPerEdge endsPerEdge)
constructs the graph from all valid vertices and edges
const VertBitSet & validVerts() const
returns all valid vertices in the graph
Definition MRGraph.h:58
const EdgeBitSet & validEdges() const
returns all valid edges in the graph
Definition MRGraph.h:67
std::vector< EdgeId > Neighbours
Definition MRGraph.h:25
VertId v0
Definition MRGraph.h:30
GraphEdgeBitSet EdgeBitSet
Definition MRGraph.h:23
void merge(VertId remnant, VertId dead, std::function< void(EdgeId remnant, EdgeId dead)> onMergeEdges)
bool checkValidity() const
verifies that all internal data structures are valid
GraphEdgeId EdgeId
Definition MRGraph.h:20
GraphVertBitSet VertBitSet
Definition MRGraph.h:22
bool areNeighbors(VertId a, VertId b) const
returns true if the vertices a and b are neighbors
Definition MRGraph.h:82
size_t vertSize() const
returns the number of vertex records, including invalid ones
Definition MRGraph.h:55
void replaceEnd(VertId what, VertId with)
Definition MRGraph.h:36
GraphVertId VertId
Definition MRGraph.h:19
auto operator<=>(const EndVertices &) const =default
only for bindings generation
Definition MRCameraOrientationPlugin.h:8