43 int * numSmallerComponents =
nullptr );
56 UndirectedEdgeBitSet * outBdEdgesBetweenLargeComps =
nullptr );
68 const UndirectedEdgeBitSet *
isCompBd =
nullptr;
91 const UndirectedEdgeBitSet *
isCompBd =
nullptr;
100 UndirectedEdgeBitSet * outBdEdgesBetweenLargeComps =
nullptr );
126[[nodiscard]]
MRMESH_API std::vector<FaceBitSet>
getAllComponents( Face2RegionMap& componentsMap,
int componentsCount,
const FaceBitSet& region,
127 int maxComponentCount );
137 const Face2RegionMap & regionMap,
int numRegions );
143 const Face2RegionMap & regionMap,
int numRegions,
float minArea );
195 VertBitSet * outPathVerts =
nullptr );
198 VertBitSet* outPathVerts =
nullptr );
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRMeshTopology.h:23
Union-find data structure for representing disjoin sets of elements with few very quick operations: 1...
Definition MRUnionFind.h:23
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:753
tl::expected< T, E > Expected
Definition MRExpected.h:31
std::vector< MeshEdgePoint > SurfacePath
Definition MRMeshFwd.h:481
FaceBitSet getLargeByAreaComponents(const MeshPart &meshPart, float minArea, const UndirectedEdgeBitSet *isCompBd)
returns the union of connected components, each having at least given area
UndirectedEdgeBitSet getComponentsUndirectedEdges(const Mesh &mesh, const UndirectedEdgeBitSet &seeds)
returns union of connected components, each of which contains at least one seed edge
std::vector< FaceBitSet > getNLargeByAreaComponents(const MeshPart &meshPart, const LargeByAreaComponentsSettings &settings)
returns requested number of largest by area connected components in descending by area order
std::pair< Face2RegionMap, int > getAllComponentsMap(const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
std::vector< VertBitSet > getAllComponentsVertsSeparatedByPaths(const Mesh &mesh, const std::vector< SurfacePath > &paths)
gets all connected components, separating vertices by given paths (either closed or from boundary to ...
UnionFind< VertId > getUnionFindStructureVertsEx(const Mesh &mesh, const UndirectedEdgeBitSet &ignoreEdges)
gets union-find structure for vertices, considering connections by all edges excluding given ones
std::vector< VertBitSet > getAllComponentsVertsSeparatedByPath(const Mesh &mesh, const SurfacePath &path)
gets all connected components, separating vertices by given path (either closed or from boundary to b...
FaceIncidence
Face incidence type.
Definition MRMeshComponents.h:19
VertBitSet getComponentVerts(const Mesh &mesh, VertId id, const VertBitSet *region=nullptr)
std::vector< UndirectedEdgeBitSet > getAllComponentsUndirectedEdges(const Mesh &mesh, const UndirectedEdgeBitSet &edges)
subdivides given edges on connected components
UnionFind< FaceId > getUnionFindStructureFacesPerEdge(const MeshPart &meshPart, const UndirectedEdgeBitSet *isCompBd={})
UnionFind< VertId > 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 boun...
VertBitSet getLargestComponentVerts(const Mesh &mesh, const VertBitSet *region=nullptr)
returns the largest by number of elements component
FaceBitSet getComponent(const MeshPart &meshPart, FaceId id, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
Expected< FaceBitSet > expandToComponents(const MeshPart &mp, const FaceBitSet &seeds, const ExpandToComponentsParams ¶ms={})
expands given seeds to whole components
UnionFind< VertId > getUnionFindStructureVerts(const Mesh &mesh, const VertBitSet *region=nullptr)
gets union-find structure for vertices
FaceBitSet 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
bool hasFullySelectedComponent(const Mesh &mesh, const VertBitSet &selection)
returns true if all vertices of a mesh connected component are present in selection
UnionFind< UndirectedEdgeId > getUnionFindStructureUndirectedEdges(const Mesh &mesh, bool allPointToRoots=false)
UnionFind< FaceId > getUnionFindStructureFaces(const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
gets union-find structure for faces with different options of face-connectivity
Vector< double, RegionId > getRegionAreas(const MeshPart &meshPart, const Face2RegionMap ®ionMap, int numRegions)
computes the area of each region given via the map
VertBitSet 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
std::vector< VertBitSet > getAllComponentsVerts(const Mesh &mesh, const VertBitSet *region=nullptr)
gets all connected components of mesh part
std::vector< FaceBitSet > getAllComponents(const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
UnionFind< VertId > getUnionFindStructureVertsSeparatedByPaths(const Mesh &mesh, const std::vector< SurfacePath > &paths, VertBitSet *outPathVerts=nullptr)
FaceBitSet 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
size_t getNumComponents(const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgeBitSet *isCompBd={})
returns the number of connected components in mesh part
std::pair< FaceBitSet, int > getLargeByAreaRegions(const MeshPart &meshPart, const Face2RegionMap ®ionMap, int numRegions, float minArea)
VertBitSet getLargeComponentVerts(const Mesh &mesh, int minVerts, const VertBitSet *region=nullptr)
returns the union of vertex connected components, each having at least
void excludeFullySelectedComponents(const Mesh &mesh, VertBitSet &selection)
if all vertices of a mesh connected component are present in selection, excludes these vertices
FaceBitSet getLargeByAreaSmoothComponents(const MeshPart &meshPart, float minArea, float angleFromPlanar, UndirectedEdgeBitSet *outBdEdgesBetweenLargeComps=nullptr)
std::vector< EdgeBitSet > getAllComponentsEdges(const Mesh &mesh, const EdgeBitSet &edges)
subdivides given edges on connected components
@ PerVertex
face can have neighbor via vertex
Definition MRMeshComponents.h:21
@ PerEdge
face can have neighbor only via edge
Definition MRMeshComponents.h:20
Definition MRMeshComponents.h:11
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMeshComponents.h:59
const UndirectedEdgeBitSet * isCompBd
optional predicate of boundaries between components
Definition MRMeshComponents.h:68
FaceIncidence incidence
Definition MRMeshComponents.h:65
int * optOutNumComponents
optional output number of components
Definition MRMeshComponents.h:71
float coverRatio
Definition MRMeshComponents.h:63
ProgressCallback cb
Definition MRMeshComponents.h:73
Definition MRMeshComponents.h:80
const UndirectedEdgeBitSet * isCompBd
optional predicate of boundaries between components
Definition MRMeshComponents.h:91
int maxLargeComponents
return at most given number of largest by area connected components
Definition MRMeshComponents.h:82
float minArea
do not consider a component large if its area is below this value
Definition MRMeshComponents.h:88
int * numSmallerComponents
optional output: the number of components in addition to returned ones
Definition MRMeshComponents.h:85