MeshLib
 
Loading...
Searching...
No Matches
MRMeshComponents.h File Reference
#include "MRUnionFind.h"
#include <functional>

Go to the source code of this file.

Classes

struct  MR::MeshComponents::LargeByAreaComponentsSettings
 

Namespaces

namespace  MR
 
namespace  MR::MeshComponents
 

Enumerations

enum  MR::MeshComponents::FaceIncidence { MR::MeshComponents::PerEdge , MR::MeshComponents::PerVertex }
 Face incidence type. More...
 

Functions

MRMESH_API FaceBitSet MR::MeshComponents::getComponent (const MeshPart &meshPart, FaceId id, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgePredicate &isCompBd={})
 
MRMESH_API VertBitSet MR::MeshComponents::getComponentVerts (const Mesh &mesh, VertId id, const VertBitSet *region=nullptr)
 
MRMESH_API VertBitSet MR::MeshComponents::getLargestComponentVerts (const Mesh &mesh, const VertBitSet *region=nullptr)
 returns the largest by number of elements component
 
MRMESH_API VertBitSet MR::MeshComponents::getLargeComponentVerts (const Mesh &mesh, int minVerts, const VertBitSet *region=nullptr)
 returns the union of vertex connected components, each having at least
 
MRMESH_API FaceBitSet MR::MeshComponents::getLargestComponent (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgePredicate &isCompBd={}, float minArea=0, int *numSmallerComponents=nullptr)
 returns the largest by surface area component or empty set if its area is smaller than
 
MRMESH_API FaceBitSet MR::MeshComponents::getComponents (const MeshPart &meshPart, const FaceBitSet &seeds, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgePredicate &isCompBd={})
 returns union of connected components, each of which contains at least one seed face
 
MRMESH_API FaceBitSet MR::MeshComponents::getLargeByAreaComponents (const MeshPart &meshPart, float minArea, const UndirectedEdgePredicate &isCompBd)
 returns the union of connected components, each having at least given area
 
MRMESH_API FaceBitSet MR::MeshComponents::getLargeByAreaComponents (const MeshPart &meshPart, UnionFind< FaceId > &unionFind, float minArea, UndirectedEdgeBitSet *outBdEdgesBetweenLargeComps=nullptr)
 given prepared union-find structure returns the union of connected components, each having at least given area
 
MRMESH_API std::vector< FaceBitSetMR::MeshComponents::getNLargeByAreaComponents (const MeshPart &meshPart, const LargeByAreaComponentsSettings &settings)
 returns requested number of largest by area connected components in descending by area order
 
MRMESH_API FaceBitSet MR::MeshComponents::getLargeByAreaSmoothComponents (const MeshPart &meshPart, float minArea, float angleFromPlanar, UndirectedEdgeBitSet *outBdEdgesBetweenLargeComps=nullptr)
 
MRMESH_API 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
 
MRMESH_API size_t MR::MeshComponents::getNumComponents (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgePredicate &isCompBd={})
 returns the number of connected components in mesh part
 
MRMESH_API std::vector< FaceBitSetMR::MeshComponents::getAllComponents (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgePredicate &isCompBd={})
 
MRMESH_API std::pair< std::vector< FaceBitSet >, int > MR::MeshComponents::getAllComponents (const MeshPart &meshPart, int maxComponentCount, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgePredicate &isCompBd={})
 
MRMESH_API std::vector< FaceBitSetMR::MeshComponents::getAllComponents (Face2RegionMap &componentsMap, int componentsCount, const FaceBitSet &region, int maxComponentCount)
 
MRMESH_API std::pair< Face2RegionMap, int > MR::MeshComponents::getAllComponentsMap (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgePredicate &isCompBd={})
 
MRMESH_API Vector< double, RegionId > MR::MeshComponents::getRegionAreas (const MeshPart &meshPart, const Face2RegionMap &regionMap, int numRegions)
 computes the area of each region given via the map
 
MRMESH_API std::pair< FaceBitSet, int > MR::MeshComponents::getLargeByAreaRegions (const MeshPart &meshPart, const Face2RegionMap &regionMap, int numRegions, float minArea)
 
MRMESH_API std::vector< VertBitSetMR::MeshComponents::getAllComponentsVerts (const Mesh &mesh, const VertBitSet *region=nullptr)
 gets all connected components of mesh part
 
MRMESH_API std::vector< VertBitSetMR::MeshComponents::getAllComponentsVertsSeparatedByPath (const Mesh &mesh, const SurfacePath &path)
 gets all connected components, separating vertices by given path (either closed or from boundary to boundary)
 
MRMESH_API std::vector< VertBitSetMR::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)
 
MRMESH_API std::vector< EdgeBitSet > MR::MeshComponents::getAllComponentsEdges (const Mesh &mesh, const EdgeBitSet &edges)
 subdivides given edges on connected components
 
MRMESH_API std::vector< UndirectedEdgeBitSet > MR::MeshComponents::getAllComponentsUndirectedEdges (const Mesh &mesh, const UndirectedEdgeBitSet &edges)
 subdivides given edges on connected components
 
MRMESH_API std::vector< FaceBitSetMR::MeshComponents::getAllFlatComponents (const MeshPart &meshPart, float zTolerance)
 gets all connected components where difference between the highest and the lowest point is less than
 
MRMESH_API bool MR::MeshComponents::hasFullySelectedComponent (const Mesh &mesh, const VertBitSet &selection)
 returns true if all vertices of a mesh connected component are present in selection
 
MRMESH_API UnionFind< FaceIdMR::MeshComponents::getUnionFindStructureFaces (const MeshPart &meshPart, FaceIncidence incidence=FaceIncidence::PerEdge, const UndirectedEdgePredicate &isCompBd={})
 gets union-find structure for faces with different options of face-connectivity
 
MRMESH_API UnionFind< FaceIdMR::MeshComponents::getUnionFindStructureFacesPerEdge (const MeshPart &meshPart, const UndirectedEdgePredicate &isCompBd={})
 
MRMESH_API UnionFind< VertIdMR::MeshComponents::getUnionFindStructureVerts (const Mesh &mesh, const VertBitSet *region=nullptr)
 gets union-find structure for vertices
 
MRMESH_API UnionFind< VertIdMR::MeshComponents::getUnionFindStructureVerts (const Mesh &mesh, const EdgeBitSet &edges)
 gets union-find structure for vertices, considering connections by given edges only
 
MRMESH_API UnionFind< VertIdMR::MeshComponents::getUnionFindStructureVerts (const Mesh &mesh, const UndirectedEdgeBitSet &edges)
 gets union-find structure for vertices, considering connections by given undirected edges only
 
MRMESH_API UnionFind< VertIdMR::MeshComponents::getUnionFindStructureVertsEx (const Mesh &mesh, const UndirectedEdgeBitSet &ignoreEdges)
 gets union-find structure for vertices, considering connections by all edges excluding given ones
 
MRMESH_API UnionFind< VertIdMR::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)
 
MRMESH_API UnionFind< VertIdMR::MeshComponents::getUnionFindStructureVertsSeparatedByPaths (const Mesh &mesh, const std::vector< SurfacePath > &paths, VertBitSet *outPathVerts=nullptr)
 
MRMESH_API UnionFind< UndirectedEdgeId > MR::MeshComponents::getUnionFindStructureUndirectedEdges (const Mesh &mesh, bool allPointToRoots=false)
 
MRMESH_API UndirectedEdgeBitSet MR::MeshComponents::getComponentsUndirectedEdges (const Mesh &mesh, const UndirectedEdgeBitSet &seeds)
 returns union of connected components, each of which contains at least one seed edge