MeshLib Documentation
Loading...
Searching...
No Matches
MRMeshComponents.h File Reference
#include "MRMeshFwd.h"
#include "MRId.h"
#include "MRMeshPart.h"
#include "MRVector.h"

Go to the source code of this file.

Classes

struct  MRMeshComponentsMap
 stores reference on Face2RegionMap ( key: face id, value: region id ) and number of components More...
 
struct  MRMeshRegions
 stores reference on bitset of faces and number of regions More...
 

Typedefs

typedef MR_EXTERN_C_BEGIN struct MRMeshComponentsMap MRMeshComponentsMap
 stores reference on Face2RegionMap ( key: face id, value: region id ) and number of components
 
typedef struct MRMeshRegions MRMeshRegions
 stores reference on bitset of faces and number of regions
 
typedef enum MRFaceIncidence MRFaceIncidence
 

Enumerations

enum  MRFaceIncidence { MRFaceIncidencePerEdge , MRFaceIncidencePerVertex }
 

Functions

MRMESHC_API MRFaceBitSetmrMeshComponentsGetComponent (const MRMeshPart *mp, MRFaceId id, MRFaceIncidence incidence, bool(*isCompBd)(MRUndirectedEdgeId))
 
MRMESHC_API MRFaceBitSetmrMeshComponentsGetLargestComponent (const MRMeshPart *mp, MRFaceIncidence incidence, bool(*isCompBd)(MRUndirectedEdgeId), float minArea, int *numSmallerComponents)
 returns the largest by surface area component or empty set if its area is smaller than
 
MRMESHC_API MRFaceBitSetmrMeshComponentsGetLargeByAreaComponents (const MRMeshPart *mp, float minArea, bool(*isCompBd)(MRUndirectedEdgeId))
 returns the union of connected components, each having at least given area
 
MRMESHC_API MRMeshComponentsMap mrMeshComponentsGetAllComponentsMap (const MRMeshPart *mp, MRFaceIncidence incidence)
 
MRMESHC_API MRMeshRegions mrMeshComponentsGetLargeByAreaRegions (const MRMeshPart *mp, const MRFace2RegionMap *face2RegionMap, int numRegions, float minArea)
 
MRMESHC_API void mrMeshComponentsAllComponentsMapFree (const MRMeshComponentsMap *map)
 deletes allocated map
 

Typedef Documentation

◆ MRFaceIncidence

◆ MRMeshComponentsMap

typedef MR_EXTERN_C_BEGIN struct MRMeshComponentsMap MRMeshComponentsMap

stores reference on Face2RegionMap ( key: face id, value: region id ) and number of components

◆ MRMeshRegions

typedef struct MRMeshRegions MRMeshRegions

stores reference on bitset of faces and number of regions

Enumeration Type Documentation

◆ MRFaceIncidence

Enumerator
MRFaceIncidencePerEdge 

face can have neighbor only via edge

MRFaceIncidencePerVertex 

face can have neighbor via vertex

Function Documentation

◆ mrMeshComponentsAllComponentsMapFree()

MRMESHC_API void mrMeshComponentsAllComponentsMapFree ( const MRMeshComponentsMap * map)

deletes allocated map

◆ mrMeshComponentsGetAllComponentsMap()

MRMESHC_API MRMeshComponentsMap mrMeshComponentsGetAllComponentsMap ( const MRMeshPart * mp,
MRFaceIncidence incidence )

gets all connected components of mesh part as

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

◆ mrMeshComponentsGetComponent()

MRMESHC_API MRFaceBitSet * mrMeshComponentsGetComponent ( const MRMeshPart * mp,
MRFaceId id,
MRFaceIncidence incidence,
bool(* isCompBd )(MRUndirectedEdgeId) )

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

◆ mrMeshComponentsGetLargeByAreaComponents()

MRMESHC_API MRFaceBitSet * mrMeshComponentsGetLargeByAreaComponents ( const MRMeshPart * mp,
float minArea,
bool(* isCompBd )(MRUndirectedEdgeId) )

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

◆ mrMeshComponentsGetLargeByAreaRegions()

MRMESHC_API MRMeshRegions mrMeshComponentsGetLargeByAreaRegions ( const MRMeshPart * mp,
const MRFace2RegionMap * face2RegionMap,
int numRegions,
float minArea )

returns

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

◆ mrMeshComponentsGetLargestComponent()

MRMESHC_API MRFaceBitSet * mrMeshComponentsGetLargestComponent ( const MRMeshPart * mp,
MRFaceIncidence incidence,
bool(* isCompBd )(MRUndirectedEdgeId),
float minArea,
int * numSmallerComponents )

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

Parameters
minArea