MeshLib C Docs
Loading...
Searching...
No Matches
MRPolylineComponents.h File Reference
#include <MRCMesh/MRId.h>
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_Polyline2 MR_Polyline2
 
typedef struct MR_Polyline3 MR_Polyline3
 
typedef struct MR_PolylineTopology MR_PolylineTopology
 
typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
 
typedef struct MR_UnionFind_MR_UndirectedEdgeId MR_UnionFind_MR_UndirectedEdgeId
 
typedef struct MR_std_pair_std_vector_MR_UndirectedEdgeBitSet_int MR_std_pair_std_vector_MR_UndirectedEdgeBitSet_int
 
typedef struct MR_std_vector_MR_UndirectedEdgeBitSet MR_std_vector_MR_UndirectedEdgeBitSet
 
typedef struct MR_PolylineComponents_LargeByLengthComponentsSettings MR_PolylineComponents_LargeByLengthComponentsSettings
 

Functions

MRC_API MR_uint64_t MR_PolylineComponents_getNumComponents (const MR_PolylineTopology *topology)
 
MRC_API MR_UndirectedEdgeBitSetMR_PolylineComponents_getComponent (const MR_PolylineTopology *topology, MR_UndirectedEdgeId id)
 
MRC_API MR_std_vector_MR_UndirectedEdgeBitSetMR_PolylineComponents_getAllComponents_1 (const MR_PolylineTopology *topology)
 
MRC_API MR_std_pair_std_vector_MR_UndirectedEdgeBitSet_intMR_PolylineComponents_getAllComponents_2 (const MR_PolylineTopology *topology, int maxComponentCount)
 
MRC_API const int * MR_PolylineComponents_LargeByLengthComponentsSettings_Get_maxLargeComponents (const MR_PolylineComponents_LargeByLengthComponentsSettings *_this)
 
MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_Set_maxLargeComponents (MR_PolylineComponents_LargeByLengthComponentsSettings *_this, int value)
 
MRC_API int * MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_maxLargeComponents (MR_PolylineComponents_LargeByLengthComponentsSettings *_this)
 
MRC_API int *const * MR_PolylineComponents_LargeByLengthComponentsSettings_Get_numSmallerComponents (const MR_PolylineComponents_LargeByLengthComponentsSettings *_this)
 
MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_Set_numSmallerComponents (MR_PolylineComponents_LargeByLengthComponentsSettings *_this, int *value)
 
MRC_API int ** MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_numSmallerComponents (MR_PolylineComponents_LargeByLengthComponentsSettings *_this)
 
MRC_API const float * MR_PolylineComponents_LargeByLengthComponentsSettings_Get_minLength (const MR_PolylineComponents_LargeByLengthComponentsSettings *_this)
 
MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_Set_minLength (MR_PolylineComponents_LargeByLengthComponentsSettings *_this, float value)
 
MRC_API float * MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_minLength (MR_PolylineComponents_LargeByLengthComponentsSettings *_this)
 
MRC_API MR_PolylineComponents_LargeByLengthComponentsSettingsMR_PolylineComponents_LargeByLengthComponentsSettings_DefaultConstruct (void)
 
MRC_API MR_PolylineComponents_LargeByLengthComponentsSettingsMR_PolylineComponents_LargeByLengthComponentsSettings_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_PolylineComponents_LargeByLengthComponentsSettingsMR_PolylineComponents_LargeByLengthComponentsSettings_ConstructFrom (int maxLargeComponents, int *numSmallerComponents, float minLength)
 
MRC_API const MR_PolylineComponents_LargeByLengthComponentsSettingsMR_PolylineComponents_LargeByLengthComponentsSettings_OffsetPtr (const MR_PolylineComponents_LargeByLengthComponentsSettings *ptr, ptrdiff_t i)
 
MRC_API MR_PolylineComponents_LargeByLengthComponentsSettingsMR_PolylineComponents_LargeByLengthComponentsSettings_OffsetMutablePtr (MR_PolylineComponents_LargeByLengthComponentsSettings *ptr, ptrdiff_t i)
 
MRC_API MR_PolylineComponents_LargeByLengthComponentsSettingsMR_PolylineComponents_LargeByLengthComponentsSettings_ConstructFromAnother (const MR_PolylineComponents_LargeByLengthComponentsSettings *_other)
 
MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_Destroy (const MR_PolylineComponents_LargeByLengthComponentsSettings *_this)
 Destroys a heap-allocated instance of MR_PolylineComponents_LargeByLengthComponentsSettings. Does nothing if the pointer is null.
 
MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_DestroyArray (const MR_PolylineComponents_LargeByLengthComponentsSettings *_this)
 Destroys a heap-allocated array of MR_PolylineComponents_LargeByLengthComponentsSettings. Does nothing if the pointer is null.
 
MRC_API MR_PolylineComponents_LargeByLengthComponentsSettingsMR_PolylineComponents_LargeByLengthComponentsSettings_AssignFromAnother (MR_PolylineComponents_LargeByLengthComponentsSettings *_this, const MR_PolylineComponents_LargeByLengthComponentsSettings *_other)
 
MRC_API MR_std_vector_MR_UndirectedEdgeBitSetMR_PolylineComponents_getNLargeByLengthComponents_MR_Vector2f (const MR_Polyline2 *polyline, const MR_PolylineComponents_LargeByLengthComponentsSettings *settings)
 
MRC_API MR_std_vector_MR_UndirectedEdgeBitSetMR_PolylineComponents_getNLargeByLengthComponents_MR_Vector3f (const MR_Polyline3 *polyline, const MR_PolylineComponents_LargeByLengthComponentsSettings *settings)
 
MRC_API MR_UnionFind_MR_UndirectedEdgeIdMR_PolylineComponents_getUnionFindStructure (const MR_PolylineTopology *topology)
 
MRC_API MR_UndirectedEdgeBitSetMR_PolylineComponents_getLargestComponent_MR_Vector2f (const MR_Polyline2 *polyline, const float *minLength, int *numSmallerComponents)
 
MRC_API MR_UndirectedEdgeBitSetMR_PolylineComponents_getLargestComponent_MR_Vector3f (const MR_Polyline3 *polyline, const float *minLength, int *numSmallerComponents)
 

Typedef Documentation

◆ MR_Polyline2

typedef struct MR_Polyline2 MR_Polyline2

◆ MR_Polyline3

typedef struct MR_Polyline3 MR_Polyline3

◆ MR_PolylineComponents_LargeByLengthComponentsSettings

Generated from class MR::PolylineComponents::LargeByLengthComponentsSettings. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).

◆ MR_PolylineTopology

◆ MR_std_pair_std_vector_MR_UndirectedEdgeBitSet_int

◆ MR_std_vector_MR_UndirectedEdgeBitSet

◆ MR_UndirectedEdgeBitSet

◆ MR_UnionFind_MR_UndirectedEdgeId

Function Documentation

◆ MR_PolylineComponents_getAllComponents_1()

MRC_API MR_std_vector_MR_UndirectedEdgeBitSet * MR_PolylineComponents_getAllComponents_1 ( const MR_PolylineTopology * topology)

gets all connected components of polyline topology

Note
be careful, if mesh is large enough and has many components, the memory overflow will occur Generated from function MR::PolylineComponents::getAllComponents. Parameter topology can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_vector_MR_UndirectedEdgeBitSet_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_getAllComponents_2()

MRC_API MR_std_pair_std_vector_MR_UndirectedEdgeBitSet_int * MR_PolylineComponents_getAllComponents_2 ( const MR_PolylineTopology * topology,
int maxComponentCount )

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

Parameters
maxComponentCountshould be more then 1
Returns
pair components bitsets vector and number components in one group if components number more than maxComponentCount Generated from function MR::PolylineComponents::getAllComponents. Parameter topology can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_pair_std_vector_MR_UndirectedEdgeBitSet_int_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_getComponent()

MRC_API MR_UndirectedEdgeBitSet * MR_PolylineComponents_getComponent ( const MR_PolylineTopology * topology,
MR_UndirectedEdgeId id )

returns one connected component containing given undirected edge id, not effective to call more than once, if several components are needed use getAllComponents Generated from function MR::PolylineComponents::getComponent. Parameter topology can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_UndirectedEdgeBitSet_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_getLargestComponent_MR_Vector2f()

MRC_API MR_UndirectedEdgeBitSet * MR_PolylineComponents_getLargestComponent_MR_Vector2f ( const MR_Polyline2 * polyline,
const float * minLength,
int * numSmallerComponents )

returns largest by length component Generated from function MR::PolylineComponents::getLargestComponent<MR::Vector2f>. Parameter polyline can not be null. It is a single object. Parameter minLength has a default argument: 0, pass a null pointer to use it. Parameter numSmallerComponents defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_UndirectedEdgeBitSet_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_getLargestComponent_MR_Vector3f()

MRC_API MR_UndirectedEdgeBitSet * MR_PolylineComponents_getLargestComponent_MR_Vector3f ( const MR_Polyline3 * polyline,
const float * minLength,
int * numSmallerComponents )

returns largest by length component Generated from function MR::PolylineComponents::getLargestComponent<MR::Vector3f>. Parameter polyline can not be null. It is a single object. Parameter minLength has a default argument: 0, pass a null pointer to use it. Parameter numSmallerComponents defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_UndirectedEdgeBitSet_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_getNLargeByLengthComponents_MR_Vector2f()

MRC_API MR_std_vector_MR_UndirectedEdgeBitSet * MR_PolylineComponents_getNLargeByLengthComponents_MR_Vector2f ( const MR_Polyline2 * polyline,
const MR_PolylineComponents_LargeByLengthComponentsSettings * settings )

returns requested number of largest by length connected components in descending by length order Generated from function MR::PolylineComponents::getNLargeByLengthComponents<MR::Vector2f>. Parameter polyline can not be null. It is a single object. Parameter settings can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_vector_MR_UndirectedEdgeBitSet_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_getNLargeByLengthComponents_MR_Vector3f()

MRC_API MR_std_vector_MR_UndirectedEdgeBitSet * MR_PolylineComponents_getNLargeByLengthComponents_MR_Vector3f ( const MR_Polyline3 * polyline,
const MR_PolylineComponents_LargeByLengthComponentsSettings * settings )

returns requested number of largest by length connected components in descending by length order Generated from function MR::PolylineComponents::getNLargeByLengthComponents<MR::Vector3f>. Parameter polyline can not be null. It is a single object. Parameter settings can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_vector_MR_UndirectedEdgeBitSet_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_getNumComponents()

MRC_API MR_uint64_t MR_PolylineComponents_getNumComponents ( const MR_PolylineTopology * topology)

returns the number of connected components in polyline Generated from function MR::PolylineComponents::getNumComponents. Parameter topology can not be null. It is a single object.

◆ MR_PolylineComponents_getUnionFindStructure()

MRC_API MR_UnionFind_MR_UndirectedEdgeId * MR_PolylineComponents_getUnionFindStructure ( const MR_PolylineTopology * topology)

gets union-find structure for given polyline Generated from function MR::PolylineComponents::getUnionFindStructure. Parameter topology can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_UnionFind_MR_UndirectedEdgeId_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_AssignFromAnother()

MRC_API MR_PolylineComponents_LargeByLengthComponentsSettings * MR_PolylineComponents_LargeByLengthComponentsSettings_AssignFromAnother ( MR_PolylineComponents_LargeByLengthComponentsSettings * _this,
const MR_PolylineComponents_LargeByLengthComponentsSettings * _other )

Generated from method MR::PolylineComponents::LargeByLengthComponentsSettings::operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in this object. The returned pointer will never be null. It is non-owning, do NOT destroy it. When this function is called, this object will drop any object references it had previously.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_ConstructFrom()

MRC_API MR_PolylineComponents_LargeByLengthComponentsSettings * MR_PolylineComponents_LargeByLengthComponentsSettings_ConstructFrom ( int maxLargeComponents,
int * numSmallerComponents,
float minLength )

Constructs MR::PolylineComponents::LargeByLengthComponentsSettings elementwise. The reference to the parameter numSmallerComponents might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_PolylineComponents_LargeByLengthComponentsSettings_Destroy() to free it when you're done using it. When this function is called, this object will drop any object references it had previously.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_ConstructFromAnother()

MRC_API MR_PolylineComponents_LargeByLengthComponentsSettings * MR_PolylineComponents_LargeByLengthComponentsSettings_ConstructFromAnother ( const MR_PolylineComponents_LargeByLengthComponentsSettings * _other)

Generated from constructor MR::PolylineComponents::LargeByLengthComponentsSettings::LargeByLengthComponentsSettings. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_PolylineComponents_LargeByLengthComponentsSettings_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_DefaultConstruct()

MRC_API MR_PolylineComponents_LargeByLengthComponentsSettings * MR_PolylineComponents_LargeByLengthComponentsSettings_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_PolylineComponents_LargeByLengthComponentsSettings_Destroy() to free it when you're done using it.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_DefaultConstructArray()

MRC_API MR_PolylineComponents_LargeByLengthComponentsSettings * MR_PolylineComponents_LargeByLengthComponentsSettings_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_PolylineComponents_LargeByLengthComponentsSettings_DestroyArray(). Use MR_PolylineComponents_LargeByLengthComponentsSettings_OffsetMutablePtr() and MR_PolylineComponents_LargeByLengthComponentsSettings_OffsetPtr() to access the array elements.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_Destroy()

MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_Destroy ( const MR_PolylineComponents_LargeByLengthComponentsSettings * _this)

Destroys a heap-allocated instance of MR_PolylineComponents_LargeByLengthComponentsSettings. Does nothing if the pointer is null.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_DestroyArray()

MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_DestroyArray ( const MR_PolylineComponents_LargeByLengthComponentsSettings * _this)

Destroys a heap-allocated array of MR_PolylineComponents_LargeByLengthComponentsSettings. Does nothing if the pointer is null.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_Get_maxLargeComponents()

MRC_API const int * MR_PolylineComponents_LargeByLengthComponentsSettings_Get_maxLargeComponents ( const MR_PolylineComponents_LargeByLengthComponentsSettings * _this)

return at most given number of largest by length connected components Returns a pointer to a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named maxLargeComponents. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_Get_minLength()

MRC_API const float * MR_PolylineComponents_LargeByLengthComponentsSettings_Get_minLength ( const MR_PolylineComponents_LargeByLengthComponentsSettings * _this)

do not consider a component large if its length is below this value Returns a pointer to a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named minLength. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_Get_numSmallerComponents()

MRC_API int *const * MR_PolylineComponents_LargeByLengthComponentsSettings_Get_numSmallerComponents ( const MR_PolylineComponents_LargeByLengthComponentsSettings * _this)

optional output: the number of components in addition to returned ones Returns a pointer to a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named numSmallerComponents. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_maxLargeComponents()

MRC_API int * MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_maxLargeComponents ( MR_PolylineComponents_LargeByLengthComponentsSettings * _this)

return at most given number of largest by length connected components Returns a mutable pointer to a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named maxLargeComponents. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_minLength()

MRC_API float * MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_minLength ( MR_PolylineComponents_LargeByLengthComponentsSettings * _this)

do not consider a component large if its length is below this value Returns a mutable pointer to a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named minLength. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_numSmallerComponents()

MRC_API int ** MR_PolylineComponents_LargeByLengthComponentsSettings_GetMutable_numSmallerComponents ( MR_PolylineComponents_LargeByLengthComponentsSettings * _this)

optional output: the number of components in addition to returned ones Returns a mutable pointer to a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named numSmallerComponents. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it. The reference to this object might be preserved as the return value.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_OffsetMutablePtr()

MRC_API MR_PolylineComponents_LargeByLengthComponentsSettings * MR_PolylineComponents_LargeByLengthComponentsSettings_OffsetMutablePtr ( MR_PolylineComponents_LargeByLengthComponentsSettings * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_OffsetPtr()

MRC_API const MR_PolylineComponents_LargeByLengthComponentsSettings * MR_PolylineComponents_LargeByLengthComponentsSettings_OffsetPtr ( const MR_PolylineComponents_LargeByLengthComponentsSettings * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_Set_maxLargeComponents()

MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_Set_maxLargeComponents ( MR_PolylineComponents_LargeByLengthComponentsSettings * _this,
int value )

return at most given number of largest by length connected components Modifies a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named maxLargeComponents. Parameter _this can not be null. It is a single object. When this function is called, this object will drop object references it had previously in maxLargeComponents.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_Set_minLength()

MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_Set_minLength ( MR_PolylineComponents_LargeByLengthComponentsSettings * _this,
float value )

do not consider a component large if its length is below this value Modifies a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named minLength. Parameter _this can not be null. It is a single object. When this function is called, this object will drop object references it had previously in minLength.

◆ MR_PolylineComponents_LargeByLengthComponentsSettings_Set_numSmallerComponents()

MRC_API void MR_PolylineComponents_LargeByLengthComponentsSettings_Set_numSmallerComponents ( MR_PolylineComponents_LargeByLengthComponentsSettings * _this,
int * value )

optional output: the number of components in addition to returned ones Modifies a member variable of class MR::PolylineComponents::LargeByLengthComponentsSettings named numSmallerComponents. Parameter _this can not be null. It is a single object. The reference to the parameter value might be preserved in this object in element numSmallerComponents. When this function is called, this object will drop object references it had previously in numSmallerComponents.