MeshLib Documentation
Loading...
Searching...
No Matches
MRMeshC/MRMeshComponents.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRId.h"
5#include "MRMeshPart.h"
6#include "MRVector.h"
7
8
10
11MR_VECTOR_LIKE_DECL( Face2RegionMap, RegionId )
12
13
14
15typedef struct MRMeshComponentsMap
16{
17 MRFace2RegionMap* faceMap;
20
27
33
38MRMESHC_API MRFaceBitSet* mrMeshComponentsGetLargestComponent( const MRMeshPart* mp, MRFaceIncidence incidence, bool( *isCompBd )( MRUndirectedEdgeId ), float minArea, int* numSmallerComponents );
45
49MRMESHC_API MRMeshRegions mrMeshComponentsGetLargeByAreaRegions( const MRMeshPart* mp, const MRFace2RegionMap* face2RegionMap, int numRegions, float minArea );
50
53
MRMESHC_API void mrMeshComponentsAllComponentsMapFree(const MRMeshComponentsMap *map)
deletes allocated map
MRFaceIncidence
Definition MRMeshC/MRMeshComponents.h:29
@ MRFaceIncidencePerVertex
face can have neighbor via vertex
Definition MRMeshC/MRMeshComponents.h:31
@ MRFaceIncidencePerEdge
face can have neighbor only via edge
Definition MRMeshC/MRMeshComponents.h:30
MRMESHC_API MRMeshComponentsMap mrMeshComponentsGetAllComponentsMap(const MRMeshPart *mp, MRFaceIncidence incidence)
struct MRMeshRegions MRMeshRegions
stores reference on bitset of faces and number of regions
MRMESHC_API MRFaceBitSet * mrMeshComponentsGetLargeByAreaComponents(const MRMeshPart *mp, float minArea, bool(*isCompBd)(MRUndirectedEdgeId))
returns the union of connected components, each having at least given area
MRMESHC_API MRMeshRegions mrMeshComponentsGetLargeByAreaRegions(const MRMeshPart *mp, const MRFace2RegionMap *face2RegionMap, int numRegions, float minArea)
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
MR_EXTERN_C_BEGIN struct MRMeshComponentsMap MRMeshComponentsMap
stores reference on Face2RegionMap ( key: face id, value: region id ) and number of components
MRMESHC_API MRFaceBitSet * mrMeshComponentsGetComponent(const MRMeshPart *mp, MRFaceId id, MRFaceIncidence incidence, bool(*isCompBd)(MRUndirectedEdgeId))
#define MR_EXTERN_C_BEGIN
Definition MRMeshC/MRMeshFwd.h:26
#define MR_EXTERN_C_END
Definition MRMeshC/MRMeshFwd.h:27
struct MRFaceBitSet MRFaceBitSet
Definition MRMeshC/MRMeshFwd.h:37
#define MRMESHC_API
Definition MRMeshC/MRMeshFwd.h:19
#define MR_VECTOR_LIKE_DECL(ClassName, Type)
Definition MRMeshC/MRVector.h:19
face index
Definition MRMeshC/MRId.h:12
stores reference on Face2RegionMap ( key: face id, value: region id ) and number of components
Definition MRMeshC/MRMeshComponents.h:16
int numComponents
Definition MRMeshC/MRMeshComponents.h:18
MRFace2RegionMap * faceMap
Definition MRMeshC/MRMeshComponents.h:17
stores reference on whole mesh (if region is NULL) or on its part (if region pointer is valid)
Definition MRMeshC/MRMeshPart.h:9
stores reference on bitset of faces and number of regions
Definition MRMeshC/MRMeshComponents.h:23
int numRegions
Definition MRMeshC/MRMeshComponents.h:25
MRFaceBitSet * faces
Definition MRMeshC/MRMeshComponents.h:24
edge index
Definition MRMeshC/MRId.h:10