MeshLib C++ Docs
Loading...
Searching...
No Matches

Classes

struct  MR::MeshComponents::ExpandToComponentsParams
struct  MR::MeshComponents::LargeByAreaComponentsSettings

Enumerations

enum  MR::MeshComponents::FaceIncidence { MR::MeshComponents::PerEdge , MR::MeshComponents::PerVertex }
 Face incidence type. More...
enum class  MR::MeshComponents::VolumeSelection { MR::MeshComponents::VolumeSelection::Abs , MR::MeshComponents::VolumeSelection::Positive , MR::MeshComponents::VolumeSelection::Negative }
 the rule of selecting one component by its signed volume More...

Functions

FaceBitSet MR::MeshComponents::getComponent (const MeshPart &meshPart, FaceId id, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
VertBitSet MR::MeshComponents::getComponentVerts (const Mesh &mesh, VertId id, const VertBitSet *region=nullptr)
VertBitSet MR::MeshComponents::getLargestComponentVerts (const Mesh &mesh, const VertBitSet *region=nullptr)
 returns the largest by number of elements component
VertBitSet MR::MeshComponents::getLargeComponentVerts (const Mesh &mesh, int minVerts, const VertBitSet *region=nullptr)
 returns the union of vertex connected components, each having at least
double MR::MeshComponents::getLargestComponentArea (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={}, FaceBitSet *largestComponent=nullptr, int *numSmallerComponents=nullptr)
 returns the area of the largest by surface area component, and zero if there are no components at all
FaceBitSet MR::MeshComponents::getLargestComponent (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={}, float minArea=0, int *numSmallerComponents=nullptr)
 returns the largest by surface area component or empty set if its area is smaller than
double MR::MeshComponents::getLargestComponentVolume (const MeshPart &meshPart, VolumeSelection selection=VolumeSelection::Abs, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={}, FaceBitSet *largestComponent=nullptr, int *numSmallerComponents=nullptr)
 optional output: the number of components in addition to returned one, so all components if none was selected
FaceBitSet MR::MeshComponents::getComponents (const MeshPart &meshPart, const FaceBitSet &seeds, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
 returns union of connected components, each of which contains at least one seed face
FaceBitSet MR::MeshComponents::getComponents (const MeshTopology &topology, const FaceBitSet &seeds, const FaceBitSet *region=nullptr, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
FaceBitSet MR::MeshComponents::getLargeByAreaComponents (const MeshPart &meshPart, float minArea, const UndirectedEdgeBitSet *isCompBd)
 returns the union of connected components, each having at least given area
FaceBitSet MR::MeshComponents::getLargeByVolumeComponents (const MeshPart &meshPart, float minVolume)
FaceBitSet MR::MeshComponents::getLargeByAreaComponents (const MeshPart &meshPart, BaseUnionFind< FaceId > &unionFind, float minArea, UndirectedEdgeBitSet *outBdEdgesBetweenLargeComps=nullptr)
 given prepared union-find structure returns the union of connected components, each having at least given area
Expected< FaceBitSet > MR::MeshComponents::expandToComponents (const MeshPart &mp, const FaceBitSet &seeds, const ExpandToComponentsParams &params={})
 expands given seeds to whole components
std::vector< FaceBitSet > MR::MeshComponents::getNLargeByAreaComponents (const MeshPart &meshPart, const LargeByAreaComponentsSettings &settings)
 returns requested number of largest by area connected components in descending by area order
FaceBitSet MR::MeshComponents::getLargeByAreaSmoothComponents (const MeshPart &meshPart, float minArea, float angleFromPlanar, UndirectedEdgeBitSet *outBdEdgesBetweenLargeComps=nullptr)
VertBitSet MR::MeshComponents::getComponentsVerts (const Mesh &mesh, const VertBitSet &seeds, const VertBitSet *region=nullptr)
 returns union of connected components, each of which contains at least one seed vert
size_t MR::MeshComponents::getNumComponents (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
 returns the number of connected components in mesh part
std::vector< FaceBitSet > MR::MeshComponents::getAllComponents (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
std::pair< std::vector< FaceBitSet >, int > MR::MeshComponents::getAllComponents (const MeshPart &meshPart, int maxComponentCount, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
std::vector< FaceBitSet > MR::MeshComponents::getAllComponents (Face2RegionMap &componentsMap, int componentsCount, const FaceBitSet &region, int maxComponentCount)
std::pair< Face2RegionMap, int > MR::MeshComponents::getAllComponentsMap (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
std::pair< Face2RegionMap, int > MR::MeshComponents::getFacePairRegionMap (const Mesh &mesh, const std::vector< FaceFace > &facePairs, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
Vector< double, RegionId > MR::MeshComponents::getRegionAreas (const MeshPart &meshPart, const Face2RegionMap &regionMap, int numRegions)
 computes the area of each region given via the map
std::pair< FaceBitSet, int > MR::MeshComponents::getLargeByAreaRegions (const MeshPart &meshPart, const Face2RegionMap &regionMap, int numRegions, float minArea)
std::vector< VertBitSet > MR::MeshComponents::getAllComponentsVerts (const Mesh &mesh, const VertBitSet *region=nullptr)
 gets all connected components of mesh part
std::vector< VertBitSet > MR::MeshComponents::getAllComponentsVertsSeparatedByPath (const Mesh &mesh, const SurfacePath &path)
 gets all connected components, separating vertices by given path (either closed or from boundary to boundary)
std::vector< VertBitSet > MR::MeshComponents::getAllComponentsVertsSeparatedByPaths (const Mesh &mesh, const std::vector< SurfacePath > &paths)
 gets all connected components, separating vertices by given paths (either closed or from boundary to boundary)
std::vector< EdgeBitSet > MR::MeshComponents::getAllComponentsEdges (const Mesh &mesh, const EdgeBitSet &edges)
 subdivides given edges on connected components
std::vector< UndirectedEdgeBitSet > MR::MeshComponents::getAllComponentsUndirectedEdges (const Mesh &mesh, const UndirectedEdgeBitSet &edges)
 subdivides given edges on connected components
bool MR::MeshComponents::hasFullySelectedComponent (const Mesh &mesh, const VertBitSet &selection)
 returns true if all vertices of a mesh connected component are present in selection
bool MR::MeshComponents::hasFullySelectedComponent (const MeshTopology &topology, const VertBitSet &selection)
void MR::MeshComponents::excludeFullySelectedComponents (const Mesh &mesh, VertBitSet &selection)
 if all vertices of a mesh connected component are present in selection, excludes these vertices
BaseUnionFind< FaceId > MR::MeshComponents::getUnionFindStructureFaces (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
 gets union-find structure for faces with different options of face-connectivity
BaseUnionFind< FaceId > MR::MeshComponents::getUnionFindStructureFaces (const MeshTopology &topology, const FaceBitSet *region=nullptr, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
BaseUnionFind< FaceId > MR::MeshComponents::getUnionFindStructureFacesPerEdge (const MeshPart &meshPart, const UndirectedEdgeBitSet *isCompBd={})
BaseUnionFind< FaceId > MR::MeshComponents::getUnionFindStructureFacesPerEdge (const MeshTopology &topology, const FaceBitSet *region=nullptr, const UndirectedEdgeBitSet *isCompBd={})
UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVerts (const Mesh &mesh, const VertBitSet *region=nullptr)
 gets union-find structure for vertices
UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVerts (const MeshTopology &topology, const VertBitSet *region=nullptr)
UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVerts (const Mesh &mesh, const EdgeBitSet &edges)
 gets union-find structure for vertices, considering connections by given edges only
UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVerts (const Mesh &mesh, const UndirectedEdgeBitSet &edges)
 gets union-find structure for vertices, considering connections by given undirected edges only
UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVertsEx (const Mesh &mesh, const UndirectedEdgeBitSet &ignoreEdges)
 gets union-find structure for vertices, considering connections by all edges excluding given ones
UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVertsSeparatedByPath (const Mesh &mesh, const SurfacePath &path, VertBitSet *outPathVerts=nullptr)
 gets union-find structure for vertices, separating vertices by given path (either closed or from boundary to boundary)
UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVertsSeparatedByPaths (const Mesh &mesh, const std::vector< SurfacePath > &paths, VertBitSet *outPathVerts=nullptr)
UnionFind< UndirectedEdgeId > MR::MeshComponents::getUnionFindStructureUndirectedEdges (const Mesh &mesh, bool allPointToRoots=false)
UndirectedEdgeBitSet MR::MeshComponents::getComponentsUndirectedEdges (const Mesh &mesh, const UndirectedEdgeBitSet &seeds)
 returns union of connected components, each of which contains at least one seed edge

Detailed Description

Enumeration Type Documentation

◆ FaceIncidence

#include <MRMesh/MRMeshComponents.h>

Face incidence type.

Enumerator
PerEdge 

face can have neighbor only via edge

PerVertex 

face can have neighbor via vertex

◆ VolumeSelection

#include <MRMesh/MRMeshComponents.h>

the rule of selecting one component by its signed volume

Enumerator
Abs 

the component with the largest absolute volume, whatever its sign is

Positive 

the component with the largest positive volume (its normals look outside)

Negative 

the component with the smallest negative volume (its normals look inside)

Function Documentation

◆ excludeFullySelectedComponents()

void MR::MeshComponents::excludeFullySelectedComponents ( const Mesh & mesh,
VertBitSet & selection )

#include <MRMesh/MRMeshComponents.h>

if all vertices of a mesh connected component are present in selection, excludes these vertices

◆ expandToComponents()

Expected< FaceBitSet > MR::MeshComponents::expandToComponents ( const MeshPart & mp,
const FaceBitSet & seeds,
const ExpandToComponentsParams & params = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

expands given seeds to whole components

◆ getAllComponents() [1/3]

std::vector< FaceBitSet > MR::MeshComponents::getAllComponents ( const MeshPart & meshPart,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets all connected components of mesh part

Note
be careful, if mesh is large enough and has many components, the memory overflow will occur

◆ getAllComponents() [2/3]

std::pair< std::vector< FaceBitSet >, int > MR::MeshComponents::getAllComponents ( const MeshPart & meshPart,
int maxComponentCount,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets all connected components of mesh part \detail if components number more than the maxComponentCount, they will be combined into groups of the same size

Parameters
maxComponentCountshould be more than 1
Returns
pair components bitsets vector and number components in one group if components number more than maxComponentCount

◆ getAllComponents() [3/3]

std::vector< FaceBitSet > MR::MeshComponents::getAllComponents ( Face2RegionMap & componentsMap,
int componentsCount,
const FaceBitSet & region,
int maxComponentCount )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets all connected components from components map ( FaceId => RegionId ) \detail if components number more than the maxComponentCount, they will be combined into groups of the same size (this similarly changes componentsMap)

Parameters
maxComponentCountshould be more than 1
Returns
components bitsets vector

◆ getAllComponentsEdges()

std::vector< EdgeBitSet > MR::MeshComponents::getAllComponentsEdges ( const Mesh & mesh,
const EdgeBitSet & edges )
nodiscard

#include <MRMesh/MRMeshComponents.h>

subdivides given edges on connected components

◆ getAllComponentsMap()

std::pair< Face2RegionMap, int > MR::MeshComponents::getAllComponentsMap ( const MeshPart & meshPart,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets all connected components of mesh part as

  1. the mapping: FaceId -> Component ID in [0, 1, 2, ...)
  2. the total number of components

◆ getAllComponentsUndirectedEdges()

std::vector< UndirectedEdgeBitSet > MR::MeshComponents::getAllComponentsUndirectedEdges ( const Mesh & mesh,
const UndirectedEdgeBitSet & edges )
nodiscard

#include <MRMesh/MRMeshComponents.h>

subdivides given edges on connected components

◆ getAllComponentsVerts()

std::vector< VertBitSet > MR::MeshComponents::getAllComponentsVerts ( const Mesh & mesh,
const VertBitSet * region = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets all connected components of mesh part

◆ getAllComponentsVertsSeparatedByPath()

std::vector< VertBitSet > MR::MeshComponents::getAllComponentsVertsSeparatedByPath ( const Mesh & mesh,
const SurfacePath & path )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets all connected components, separating vertices by given path (either closed or from boundary to boundary)

◆ getAllComponentsVertsSeparatedByPaths()

std::vector< VertBitSet > MR::MeshComponents::getAllComponentsVertsSeparatedByPaths ( const Mesh & mesh,
const std::vector< SurfacePath > & paths )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets all connected components, separating vertices by given paths (either closed or from boundary to boundary)

◆ getComponent()

FaceBitSet MR::MeshComponents::getComponent ( const MeshPart & meshPart,
FaceId id,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns one connected component containing given face, not effective to call more than once, if several components are needed use getAllComponents

◆ getComponents() [1/2]

FaceBitSet MR::MeshComponents::getComponents ( const MeshPart & meshPart,
const FaceBitSet & seeds,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns union of connected components, each of which contains at least one seed face

◆ getComponents() [2/2]

FaceBitSet MR::MeshComponents::getComponents ( const MeshTopology & topology,
const FaceBitSet & seeds,
const FaceBitSet * region = nullptr,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

◆ getComponentsUndirectedEdges()

UndirectedEdgeBitSet MR::MeshComponents::getComponentsUndirectedEdges ( const Mesh & mesh,
const UndirectedEdgeBitSet & seeds )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns union of connected components, each of which contains at least one seed edge

◆ getComponentsVerts()

VertBitSet MR::MeshComponents::getComponentsVerts ( const Mesh & mesh,
const VertBitSet & seeds,
const VertBitSet * region = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns union of connected components, each of which contains at least one seed vert

◆ getComponentVerts()

VertBitSet MR::MeshComponents::getComponentVerts ( const Mesh & mesh,
VertId id,
const VertBitSet * region = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns one connected component containing given vertex, not effective to call more than once, if several components are needed use getAllComponentsVerts

◆ getFacePairRegionMap()

std::pair< Face2RegionMap, int > MR::MeshComponents::getFacePairRegionMap ( const Mesh & mesh,
const std::vector< FaceFace > & facePairs,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

given some face pairs, collects them in regions, where for each face in a region its pair face and its incident faces from other pairs are also attributed to that region; returns 1. the mapping: FaceId -> RegionId, 2. the total number of regions

◆ getLargeByAreaComponents() [1/2]

FaceBitSet MR::MeshComponents::getLargeByAreaComponents ( const MeshPart & meshPart,
BaseUnionFind< FaceId > & unionFind,
float minArea,
UndirectedEdgeBitSet * outBdEdgesBetweenLargeComps = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

given prepared union-find structure returns the union of connected components, each having at least given area

◆ getLargeByAreaComponents() [2/2]

FaceBitSet MR::MeshComponents::getLargeByAreaComponents ( const MeshPart & meshPart,
float minArea,
const UndirectedEdgeBitSet * isCompBd )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns the union of connected components, each having at least given area

◆ getLargeByAreaRegions()

std::pair< FaceBitSet, int > MR::MeshComponents::getLargeByAreaRegions ( const MeshPart & meshPart,
const Face2RegionMap & regionMap,
int numRegions,
float minArea )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns

  1. the union of all regions with area >= minArea
  2. the number of such regions

◆ getLargeByAreaSmoothComponents()

FaceBitSet MR::MeshComponents::getLargeByAreaSmoothComponents ( const MeshPart & meshPart,
float minArea,
float angleFromPlanar,
UndirectedEdgeBitSet * outBdEdgesBetweenLargeComps = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns the union of connected components, each having at least given area, and any two faces in a connected component have a path along the surface across the edges, where surface does not deviate from plane more than on given angle

◆ getLargeByVolumeComponents()

FaceBitSet MR::MeshComponents::getLargeByVolumeComponents ( const MeshPart & meshPart,
float minVolume )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns the union of connected components, each having at least given volume note that function require closed mesh part

◆ getLargeComponentVerts()

VertBitSet MR::MeshComponents::getLargeComponentVerts ( const Mesh & mesh,
int minVerts,
const VertBitSet * region = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns the union of vertex connected components, each having at least

Parameters
minVertsvertices

◆ getLargestComponent()

FaceBitSet MR::MeshComponents::getLargestComponent ( const MeshPart & meshPart,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {},
float minArea = 0,
int * numSmallerComponents = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns the largest by surface area component or empty set if its area is smaller than

Parameters
minAreaoptional output: the number of components in addition to returned one

◆ getLargestComponentArea()

double MR::MeshComponents::getLargestComponentArea ( const MeshPart & meshPart,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {},
FaceBitSet * largestComponent = nullptr,
int * numSmallerComponents = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns the area of the largest by surface area component, and zero if there are no components at all

optional output: the number of components in addition to returned one

Parameters
largestComponentoptional output with the faces of the largest by area component

◆ getLargestComponentVerts()

VertBitSet MR::MeshComponents::getLargestComponentVerts ( const Mesh & mesh,
const VertBitSet * region = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns the largest by number of elements component

◆ getLargestComponentVolume()

double MR::MeshComponents::getLargestComponentVolume ( const MeshPart & meshPart,
VolumeSelection selection = VolumeSelection::Abs,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {},
FaceBitSet * largestComponent = nullptr,
int * numSmallerComponents = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

optional output: the number of components in addition to returned one, so all components if none was selected

returns the signed volume of the component selected by given rule, and zero if no component satisfies it, which is possible for Positive and Negative rules only, since they never select a component of zero volume; the volume of each component is computed as if it were closed, so the result is correct only for a closed mesh part (or if the area of holes in it is almost zero)

Parameters
largestComponentoptional output with the faces of the selected component

◆ getNLargeByAreaComponents()

std::vector< FaceBitSet > MR::MeshComponents::getNLargeByAreaComponents ( const MeshPart & meshPart,
const LargeByAreaComponentsSettings & settings )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns requested number of largest by area connected components in descending by area order

◆ getNumComponents()

size_t MR::MeshComponents::getNumComponents ( const MeshPart & meshPart,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns the number of connected components in mesh part

◆ getRegionAreas()

Vector< double, RegionId > MR::MeshComponents::getRegionAreas ( const MeshPart & meshPart,
const Face2RegionMap & regionMap,
int numRegions )
nodiscard

#include <MRMesh/MRMeshComponents.h>

computes the area of each region given via the map

◆ getUnionFindStructureFaces() [1/2]

BaseUnionFind< FaceId > MR::MeshComponents::getUnionFindStructureFaces ( const MeshPart & meshPart,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets union-find structure for faces with different options of face-connectivity

◆ getUnionFindStructureFaces() [2/2]

BaseUnionFind< FaceId > MR::MeshComponents::getUnionFindStructureFaces ( const MeshTopology & topology,
const FaceBitSet * region = nullptr,
FaceIncidence incidence = FaceIncidence::PerEdge,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

◆ getUnionFindStructureFacesPerEdge() [1/2]

BaseUnionFind< FaceId > MR::MeshComponents::getUnionFindStructureFacesPerEdge ( const MeshPart & meshPart,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets union-find structure for faces with connectivity by shared edge, and optional edge predicate whether to skip uniting components over it it is guaranteed that isCompBd is invoked in a thread-safe manner (that left and right face are always processed by one thread)

◆ getUnionFindStructureFacesPerEdge() [2/2]

BaseUnionFind< FaceId > MR::MeshComponents::getUnionFindStructureFacesPerEdge ( const MeshTopology & topology,
const FaceBitSet * region = nullptr,
const UndirectedEdgeBitSet * isCompBd = {} )
nodiscard

◆ getUnionFindStructureUndirectedEdges()

UnionFind< UndirectedEdgeId > MR::MeshComponents::getUnionFindStructureUndirectedEdges ( const Mesh & mesh,
bool allPointToRoots = false )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets union-find structure for all undirected edges in

Parameters
mesh
allPointToRootsif true, then every element in the structure will point directly to the root of its respective component

◆ getUnionFindStructureVerts() [1/4]

UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVerts ( const Mesh & mesh,
const EdgeBitSet & edges )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets union-find structure for vertices, considering connections by given edges only

◆ getUnionFindStructureVerts() [2/4]

UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVerts ( const Mesh & mesh,
const UndirectedEdgeBitSet & edges )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets union-find structure for vertices, considering connections by given undirected edges only

◆ getUnionFindStructureVerts() [3/4]

UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVerts ( const Mesh & mesh,
const VertBitSet * region = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets union-find structure for vertices

◆ getUnionFindStructureVerts() [4/4]

UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVerts ( const MeshTopology & topology,
const VertBitSet * region = nullptr )
nodiscard

◆ getUnionFindStructureVertsEx()

UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVertsEx ( const Mesh & mesh,
const UndirectedEdgeBitSet & ignoreEdges )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets union-find structure for vertices, considering connections by all edges excluding given ones

◆ getUnionFindStructureVertsSeparatedByPath()

UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVertsSeparatedByPath ( const Mesh & mesh,
const SurfacePath & path,
VertBitSet * outPathVerts = nullptr )
nodiscard

#include <MRMesh/MRMeshComponents.h>

gets union-find structure for vertices, separating vertices by given path (either closed or from boundary to boundary)

Parameters
outPathVertsthis set receives all vertices passed by the path

◆ getUnionFindStructureVertsSeparatedByPaths()

UnionFind< VertId > MR::MeshComponents::getUnionFindStructureVertsSeparatedByPaths ( const Mesh & mesh,
const std::vector< SurfacePath > & paths,
VertBitSet * outPathVerts = nullptr )
nodiscard

◆ hasFullySelectedComponent() [1/2]

bool MR::MeshComponents::hasFullySelectedComponent ( const Mesh & mesh,
const VertBitSet & selection )
nodiscard

#include <MRMesh/MRMeshComponents.h>

returns true if all vertices of a mesh connected component are present in selection

◆ hasFullySelectedComponent() [2/2]

bool MR::MeshComponents::hasFullySelectedComponent ( const MeshTopology & topology,
const VertBitSet & selection )
nodiscard