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

Go to the source code of this file.

Typedefs

typedef struct MR_FaceBitSet MR_FaceBitSet
 
typedef struct MR_MeshPart MR_MeshPart
 
typedef struct MR_MeshTopology MR_MeshTopology
 
typedef struct MR_expected_MR_FaceBitSet_std_string MR_expected_MR_FaceBitSet_std_string
 
typedef struct MR_expected_std_vector_MR_EdgeId_std_string MR_expected_std_vector_MR_EdgeId_std_string
 
typedef struct MR_expected_std_vector_std_vector_MR_EdgeId_std_string MR_expected_std_vector_std_vector_MR_EdgeId_std_string
 
typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float
 
typedef struct MR_std_function_float_from_MR_EdgeId MR_std_function_float_from_MR_EdgeId
 
typedef struct MR_std_vector_MR_EdgeId MR_std_vector_MR_EdgeId
 
typedef struct MR_DetectTunnelSettings MR_DetectTunnelSettings
 

Functions

MRC_API MR_expected_std_vector_std_vector_MR_EdgeId_std_stringMR_detectBasisTunnels (const MR_MeshPart *mp, MR_PassBy metric_pass_by, MR_std_function_float_from_MR_EdgeId *metric, MR_PassBy progressCallback_pass_by, MR_std_function_bool_from_float *progressCallback)
 
MRC_API MR_expected_std_vector_MR_EdgeId_std_stringMR_findSmallestMetricCoLoop (const MR_MeshTopology *topology, const MR_std_vector_MR_EdgeId *loop, const MR_std_function_float_from_MR_EdgeId *metric, const MR_FaceBitSet *region)
 
MRC_API MR_expected_std_vector_MR_EdgeId_std_stringMR_findShortestCoLoop (const MR_MeshPart *mp, const MR_std_vector_MR_EdgeId *loop)
 
MRC_API const float * MR_DetectTunnelSettings_Get_maxTunnelLength (const MR_DetectTunnelSettings *_this)
 
MRC_API void MR_DetectTunnelSettings_Set_maxTunnelLength (MR_DetectTunnelSettings *_this, float value)
 
MRC_API float * MR_DetectTunnelSettings_GetMutable_maxTunnelLength (MR_DetectTunnelSettings *_this)
 
MRC_API const int * MR_DetectTunnelSettings_Get_maxIters (const MR_DetectTunnelSettings *_this)
 
MRC_API void MR_DetectTunnelSettings_Set_maxIters (MR_DetectTunnelSettings *_this, int value)
 
MRC_API int * MR_DetectTunnelSettings_GetMutable_maxIters (MR_DetectTunnelSettings *_this)
 
MRC_API const MR_std_function_float_from_MR_EdgeIdMR_DetectTunnelSettings_Get_metric (const MR_DetectTunnelSettings *_this)
 
MRC_API void MR_DetectTunnelSettings_Set_metric (MR_DetectTunnelSettings *_this, MR_PassBy value_pass_by, MR_std_function_float_from_MR_EdgeId *value)
 
MRC_API MR_std_function_float_from_MR_EdgeIdMR_DetectTunnelSettings_GetMutable_metric (MR_DetectTunnelSettings *_this)
 
MRC_API const bool * MR_DetectTunnelSettings_Get_buildCoLoops (const MR_DetectTunnelSettings *_this)
 
MRC_API void MR_DetectTunnelSettings_Set_buildCoLoops (MR_DetectTunnelSettings *_this, bool value)
 
MRC_API bool * MR_DetectTunnelSettings_GetMutable_buildCoLoops (MR_DetectTunnelSettings *_this)
 
MRC_API const bool * MR_DetectTunnelSettings_Get_filterEquivalentCoLoops (const MR_DetectTunnelSettings *_this)
 
MRC_API void MR_DetectTunnelSettings_Set_filterEquivalentCoLoops (MR_DetectTunnelSettings *_this, bool value)
 
MRC_API bool * MR_DetectTunnelSettings_GetMutable_filterEquivalentCoLoops (MR_DetectTunnelSettings *_this)
 
MRC_API const MR_std_function_bool_from_floatMR_DetectTunnelSettings_Get_progress (const MR_DetectTunnelSettings *_this)
 
MRC_API void MR_DetectTunnelSettings_Set_progress (MR_DetectTunnelSettings *_this, MR_PassBy value_pass_by, MR_std_function_bool_from_float *value)
 
MRC_API MR_std_function_bool_from_floatMR_DetectTunnelSettings_GetMutable_progress (MR_DetectTunnelSettings *_this)
 
MRC_API MR_DetectTunnelSettingsMR_DetectTunnelSettings_DefaultConstruct (void)
 
MRC_API MR_DetectTunnelSettingsMR_DetectTunnelSettings_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_DetectTunnelSettingsMR_DetectTunnelSettings_ConstructFrom (float maxTunnelLength, int maxIters, MR_PassBy metric_pass_by, MR_std_function_float_from_MR_EdgeId *metric, bool buildCoLoops, bool filterEquivalentCoLoops, MR_PassBy progress_pass_by, MR_std_function_bool_from_float *progress)
 
MRC_API const MR_DetectTunnelSettingsMR_DetectTunnelSettings_OffsetPtr (const MR_DetectTunnelSettings *ptr, ptrdiff_t i)
 
MRC_API MR_DetectTunnelSettingsMR_DetectTunnelSettings_OffsetMutablePtr (MR_DetectTunnelSettings *ptr, ptrdiff_t i)
 
MRC_API MR_DetectTunnelSettingsMR_DetectTunnelSettings_ConstructFromAnother (MR_PassBy _other_pass_by, MR_DetectTunnelSettings *_other)
 
MRC_API void MR_DetectTunnelSettings_Destroy (const MR_DetectTunnelSettings *_this)
 Destroys a heap-allocated instance of MR_DetectTunnelSettings. Does nothing if the pointer is null.
 
MRC_API void MR_DetectTunnelSettings_DestroyArray (const MR_DetectTunnelSettings *_this)
 Destroys a heap-allocated array of MR_DetectTunnelSettings. Does nothing if the pointer is null.
 
MRC_API MR_DetectTunnelSettingsMR_DetectTunnelSettings_AssignFromAnother (MR_DetectTunnelSettings *_this, MR_PassBy _other_pass_by, MR_DetectTunnelSettings *_other)
 
MRC_API MR_expected_MR_FaceBitSet_std_stringMR_detectTunnelFaces (const MR_MeshPart *mp, const MR_DetectTunnelSettings *settings)
 

Typedef Documentation

◆ MR_DetectTunnelSettings

Generated from class MR::DetectTunnelSettings. 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_expected_MR_FaceBitSet_std_string

◆ MR_expected_std_vector_MR_EdgeId_std_string

◆ MR_expected_std_vector_std_vector_MR_EdgeId_std_string

◆ MR_FaceBitSet

typedef struct MR_FaceBitSet MR_FaceBitSet

◆ MR_MeshPart

typedef struct MR_MeshPart MR_MeshPart

◆ MR_MeshTopology

◆ MR_std_function_bool_from_float

◆ MR_std_function_float_from_MR_EdgeId

◆ MR_std_vector_MR_EdgeId

Function Documentation

◆ MR_detectBasisTunnels()

MRC_API MR_expected_std_vector_std_vector_MR_EdgeId_std_string * MR_detectBasisTunnels ( const MR_MeshPart * mp,
MR_PassBy metric_pass_by,
MR_std_function_float_from_MR_EdgeId * metric,
MR_PassBy progressCallback_pass_by,
MR_std_function_bool_from_float * progressCallback )

detects all not-contractible-in-point and not-equivalent tunnel loops on the mesh; trying to include in the loops the edges with the smallest metric; if no metric is given then discreteMinusAbsMeanCurvatureMetric will be used Generated from function MR::detectBasisTunnels. Parameter mp can not be null. It is a single object. Parameter metric has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Parameter progressCallback has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_std_vector_std_vector_MR_EdgeId_std_string_Destroy() to free it when you're done using it.

◆ MR_detectTunnelFaces()

MRC_API MR_expected_MR_FaceBitSet_std_string * MR_detectTunnelFaces ( const MR_MeshPart * mp,
const MR_DetectTunnelSettings * settings )

returns tunnels as a number of faces; if you remove these faces and patch every boundary with disk, then the surface will be topology equivalent to sphere Generated from function MR::detectTunnelFaces. Parameter mp can not be null. It is a single object. Parameter settings is a single object. Parameter settings has a default argument: {}, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_MR_FaceBitSet_std_string_Destroy() to free it when you're done using it.

◆ MR_DetectTunnelSettings_AssignFromAnother()

MRC_API MR_DetectTunnelSettings * MR_DetectTunnelSettings_AssignFromAnother ( MR_DetectTunnelSettings * _this,
MR_PassBy _other_pass_by,
MR_DetectTunnelSettings * _other )

Generated from method MR::DetectTunnelSettings::operator=. Parameter _this 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_DetectTunnelSettings_ConstructFrom()

MRC_API MR_DetectTunnelSettings * MR_DetectTunnelSettings_ConstructFrom ( float maxTunnelLength,
int maxIters,
MR_PassBy metric_pass_by,
MR_std_function_float_from_MR_EdgeId * metric,
bool buildCoLoops,
bool filterEquivalentCoLoops,
MR_PassBy progress_pass_by,
MR_std_function_bool_from_float * progress )

Constructs MR::DetectTunnelSettings elementwise. The reference to the parameter metric might be preserved in the constructed object. The reference to the parameter progress might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_DetectTunnelSettings_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_DetectTunnelSettings_ConstructFromAnother()

MRC_API MR_DetectTunnelSettings * MR_DetectTunnelSettings_ConstructFromAnother ( MR_PassBy _other_pass_by,
MR_DetectTunnelSettings * _other )

Generated from constructor MR::DetectTunnelSettings::DetectTunnelSettings. 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_DetectTunnelSettings_Destroy() to free it when you're done using it.

◆ MR_DetectTunnelSettings_DefaultConstruct()

MRC_API MR_DetectTunnelSettings * MR_DetectTunnelSettings_DefaultConstruct ( void )

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

◆ MR_DetectTunnelSettings_DefaultConstructArray()

MRC_API MR_DetectTunnelSettings * MR_DetectTunnelSettings_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_DetectTunnelSettings_DestroyArray(). Use MR_DetectTunnelSettings_OffsetMutablePtr() and MR_DetectTunnelSettings_OffsetPtr() to access the array elements.

◆ MR_DetectTunnelSettings_Destroy()

MRC_API void MR_DetectTunnelSettings_Destroy ( const MR_DetectTunnelSettings * _this)

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

◆ MR_DetectTunnelSettings_DestroyArray()

MRC_API void MR_DetectTunnelSettings_DestroyArray ( const MR_DetectTunnelSettings * _this)

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

◆ MR_DetectTunnelSettings_Get_buildCoLoops()

MRC_API const bool * MR_DetectTunnelSettings_Get_buildCoLoops ( const MR_DetectTunnelSettings * _this)

if true then for every basis loop, findShortestCoLoop will be called; it typically results in shorter tunnels found, but requires more time per iteration, and more iterations to find all tunnels Returns a pointer to a member variable of class MR::DetectTunnelSettings named buildCoLoops. 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.

◆ MR_DetectTunnelSettings_Get_filterEquivalentCoLoops()

MRC_API const bool * MR_DetectTunnelSettings_Get_filterEquivalentCoLoops ( const MR_DetectTunnelSettings * _this)

if ( buildCoLoops ) then some tunnel loops can be equivalent (e.g. they cut the same handle twice), this option activates their filtering out, but it is very slow Returns a pointer to a member variable of class MR::DetectTunnelSettings named filterEquivalentCoLoops. 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.

◆ MR_DetectTunnelSettings_Get_maxIters()

MRC_API const int * MR_DetectTunnelSettings_Get_maxIters ( const MR_DetectTunnelSettings * _this)

maximal number of iterations to detect all tunnels; on a big mesh with many tunnels even one iteration can take a while Returns a pointer to a member variable of class MR::DetectTunnelSettings named maxIters. 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.

◆ MR_DetectTunnelSettings_Get_maxTunnelLength()

MRC_API const float * MR_DetectTunnelSettings_Get_maxTunnelLength ( const MR_DetectTunnelSettings * _this)

maximal length of tunnel loops to consider Returns a pointer to a member variable of class MR::DetectTunnelSettings named maxTunnelLength. 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.

◆ MR_DetectTunnelSettings_Get_metric()

MRC_API const MR_std_function_float_from_MR_EdgeId * MR_DetectTunnelSettings_Get_metric ( const MR_DetectTunnelSettings * _this)

metric for detectBasisTunnels, if no metric is given then discreteMinusAbsMeanCurvatureMetric will be used Returns a pointer to a member variable of class MR::DetectTunnelSettings named metric. 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.

◆ MR_DetectTunnelSettings_Get_progress()

MRC_API const MR_std_function_bool_from_float * MR_DetectTunnelSettings_Get_progress ( const MR_DetectTunnelSettings * _this)

to report algorithm progress and cancel from outside Returns a pointer to a member variable of class MR::DetectTunnelSettings named progress. 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.

◆ MR_DetectTunnelSettings_GetMutable_buildCoLoops()

MRC_API bool * MR_DetectTunnelSettings_GetMutable_buildCoLoops ( MR_DetectTunnelSettings * _this)

if true then for every basis loop, findShortestCoLoop will be called; it typically results in shorter tunnels found, but requires more time per iteration, and more iterations to find all tunnels Returns a mutable pointer to a member variable of class MR::DetectTunnelSettings named buildCoLoops. 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.

◆ MR_DetectTunnelSettings_GetMutable_filterEquivalentCoLoops()

MRC_API bool * MR_DetectTunnelSettings_GetMutable_filterEquivalentCoLoops ( MR_DetectTunnelSettings * _this)

if ( buildCoLoops ) then some tunnel loops can be equivalent (e.g. they cut the same handle twice), this option activates their filtering out, but it is very slow Returns a mutable pointer to a member variable of class MR::DetectTunnelSettings named filterEquivalentCoLoops. 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.

◆ MR_DetectTunnelSettings_GetMutable_maxIters()

MRC_API int * MR_DetectTunnelSettings_GetMutable_maxIters ( MR_DetectTunnelSettings * _this)

maximal number of iterations to detect all tunnels; on a big mesh with many tunnels even one iteration can take a while Returns a mutable pointer to a member variable of class MR::DetectTunnelSettings named maxIters. 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.

◆ MR_DetectTunnelSettings_GetMutable_maxTunnelLength()

MRC_API float * MR_DetectTunnelSettings_GetMutable_maxTunnelLength ( MR_DetectTunnelSettings * _this)

maximal length of tunnel loops to consider Returns a mutable pointer to a member variable of class MR::DetectTunnelSettings named maxTunnelLength. 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.

◆ MR_DetectTunnelSettings_GetMutable_metric()

MRC_API MR_std_function_float_from_MR_EdgeId * MR_DetectTunnelSettings_GetMutable_metric ( MR_DetectTunnelSettings * _this)

metric for detectBasisTunnels, if no metric is given then discreteMinusAbsMeanCurvatureMetric will be used Returns a mutable pointer to a member variable of class MR::DetectTunnelSettings named metric. 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.

◆ MR_DetectTunnelSettings_GetMutable_progress()

MRC_API MR_std_function_bool_from_float * MR_DetectTunnelSettings_GetMutable_progress ( MR_DetectTunnelSettings * _this)

to report algorithm progress and cancel from outside Returns a mutable pointer to a member variable of class MR::DetectTunnelSettings named progress. 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.

◆ MR_DetectTunnelSettings_OffsetMutablePtr()

MRC_API MR_DetectTunnelSettings * MR_DetectTunnelSettings_OffsetMutablePtr ( MR_DetectTunnelSettings * 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_DetectTunnelSettings_OffsetPtr()

MRC_API const MR_DetectTunnelSettings * MR_DetectTunnelSettings_OffsetPtr ( const MR_DetectTunnelSettings * 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_DetectTunnelSettings_Set_buildCoLoops()

MRC_API void MR_DetectTunnelSettings_Set_buildCoLoops ( MR_DetectTunnelSettings * _this,
bool value )

if true then for every basis loop, findShortestCoLoop will be called; it typically results in shorter tunnels found, but requires more time per iteration, and more iterations to find all tunnels Modifies a member variable of class MR::DetectTunnelSettings named buildCoLoops. 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 buildCoLoops.

◆ MR_DetectTunnelSettings_Set_filterEquivalentCoLoops()

MRC_API void MR_DetectTunnelSettings_Set_filterEquivalentCoLoops ( MR_DetectTunnelSettings * _this,
bool value )

if ( buildCoLoops ) then some tunnel loops can be equivalent (e.g. they cut the same handle twice), this option activates their filtering out, but it is very slow Modifies a member variable of class MR::DetectTunnelSettings named filterEquivalentCoLoops. 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 filterEquivalentCoLoops.

◆ MR_DetectTunnelSettings_Set_maxIters()

MRC_API void MR_DetectTunnelSettings_Set_maxIters ( MR_DetectTunnelSettings * _this,
int value )

maximal number of iterations to detect all tunnels; on a big mesh with many tunnels even one iteration can take a while Modifies a member variable of class MR::DetectTunnelSettings named maxIters. 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 maxIters.

◆ MR_DetectTunnelSettings_Set_maxTunnelLength()

MRC_API void MR_DetectTunnelSettings_Set_maxTunnelLength ( MR_DetectTunnelSettings * _this,
float value )

maximal length of tunnel loops to consider Modifies a member variable of class MR::DetectTunnelSettings named maxTunnelLength. 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 maxTunnelLength.

◆ MR_DetectTunnelSettings_Set_metric()

MRC_API void MR_DetectTunnelSettings_Set_metric ( MR_DetectTunnelSettings * _this,
MR_PassBy value_pass_by,
MR_std_function_float_from_MR_EdgeId * value )

metric for detectBasisTunnels, if no metric is given then discreteMinusAbsMeanCurvatureMetric will be used Modifies a member variable of class MR::DetectTunnelSettings named metric. 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 metric. When this function is called, this object will drop object references it had previously in metric.

◆ MR_DetectTunnelSettings_Set_progress()

MRC_API void MR_DetectTunnelSettings_Set_progress ( MR_DetectTunnelSettings * _this,
MR_PassBy value_pass_by,
MR_std_function_bool_from_float * value )

to report algorithm progress and cancel from outside Modifies a member variable of class MR::DetectTunnelSettings named progress. 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 progress. When this function is called, this object will drop object references it had previously in progress.

◆ MR_findShortestCoLoop()

MRC_API MR_expected_std_vector_MR_EdgeId_std_string * MR_findShortestCoLoop ( const MR_MeshPart * mp,
const MR_std_vector_MR_EdgeId * loop )

same as findMinimalCoLoop with euclidean edge length metric Generated from function MR::findShortestCoLoop. Parameter mp can not be null. It is a single object. Parameter loop can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_std_vector_MR_EdgeId_std_string_Destroy() to free it when you're done using it.

◆ MR_findSmallestMetricCoLoop()

MRC_API MR_expected_std_vector_MR_EdgeId_std_string * MR_findSmallestMetricCoLoop ( const MR_MeshTopology * topology,
const MR_std_vector_MR_EdgeId * loop,
const MR_std_function_float_from_MR_EdgeId * metric,
const MR_FaceBitSet * region )

given not-trivial loop on input, finds the loop that 1) goes from left side of input loop 2) returns to the input loop from its right side 3) goes along the input loop to become closed such that the resulting loop has minimal sum of given metric for its edges; edges 1) and 2) can be only inner or boundary to the given region (they must have region from left or from right) Generated from function MR::findSmallestMetricCoLoop. Parameter topology can not be null. It is a single object. Parameter loop can not be null. It is a single object. Parameter metric can not be null. It is a single object. Parameter region defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_std_vector_MR_EdgeId_std_string_Destroy() to free it when you're done using it.