MeshLib C Docs
Loading...
Searching...
No Matches
MRPolylineTrimWithPlane.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_EdgeBitSet MR_EdgeBitSet
 
typedef struct MR_EdgeMap MR_EdgeMap
 
typedef struct MR_Plane3f MR_Plane3f
 
typedef struct MR_Polyline3 MR_Polyline3
 
typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
 
typedef struct MR_VertMap MR_VertMap
 
typedef struct MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float
 
typedef struct MR_std_vector_MR_EdgeSegment MR_std_vector_MR_EdgeSegment
 
typedef struct MR_DividePolylineParameters MR_DividePolylineParameters
 Generated from class MR::DividePolylineParameters.
 

Functions

MRC_API MR_UndirectedEdgeBitSetMR_subdivideWithPlane_4 (MR_Polyline3 *polyline, const MR_Plane3f *plane, MR_EdgeBitSet *newPositiveEdges, MR_PassBy onEdgeSplitCallback_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float *onEdgeSplitCallback)
 
MRC_API const MR_std_function_void_from_MR_EdgeId_MR_EdgeId_floatMR_DividePolylineParameters_Get_onEdgeSplitCallback (const MR_DividePolylineParameters *_this)
 
MRC_API void MR_DividePolylineParameters_Set_onEdgeSplitCallback (MR_DividePolylineParameters *_this, MR_PassBy value_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float *value)
 
MRC_API MR_std_function_void_from_MR_EdgeId_MR_EdgeId_floatMR_DividePolylineParameters_GetMutable_onEdgeSplitCallback (MR_DividePolylineParameters *_this)
 
MRC_API const bool * MR_DividePolylineParameters_Get_closeLineAfterCut (const MR_DividePolylineParameters *_this)
 
MRC_API void MR_DividePolylineParameters_Set_closeLineAfterCut (MR_DividePolylineParameters *_this, bool value)
 
MRC_API bool * MR_DividePolylineParameters_GetMutable_closeLineAfterCut (MR_DividePolylineParameters *_this)
 
MRC_API MR_VertMap *const * MR_DividePolylineParameters_Get_outVmap (const MR_DividePolylineParameters *_this)
 
MRC_API void MR_DividePolylineParameters_Set_outVmap (MR_DividePolylineParameters *_this, MR_VertMap *value)
 
MRC_API MR_VertMap ** MR_DividePolylineParameters_GetMutable_outVmap (MR_DividePolylineParameters *_this)
 
MRC_API MR_EdgeMap *const * MR_DividePolylineParameters_Get_outEmap (const MR_DividePolylineParameters *_this)
 
MRC_API void MR_DividePolylineParameters_Set_outEmap (MR_DividePolylineParameters *_this, MR_EdgeMap *value)
 
MRC_API MR_EdgeMap ** MR_DividePolylineParameters_GetMutable_outEmap (MR_DividePolylineParameters *_this)
 
MRC_API MR_Polyline3 *const * MR_DividePolylineParameters_Get_otherPart (const MR_DividePolylineParameters *_this)
 
MRC_API void MR_DividePolylineParameters_Set_otherPart (MR_DividePolylineParameters *_this, MR_Polyline3 *value)
 
MRC_API MR_Polyline3 ** MR_DividePolylineParameters_GetMutable_otherPart (MR_DividePolylineParameters *_this)
 
MRC_API MR_VertMap *const * MR_DividePolylineParameters_Get_otherOutVmap (const MR_DividePolylineParameters *_this)
 
MRC_API void MR_DividePolylineParameters_Set_otherOutVmap (MR_DividePolylineParameters *_this, MR_VertMap *value)
 
MRC_API MR_VertMap ** MR_DividePolylineParameters_GetMutable_otherOutVmap (MR_DividePolylineParameters *_this)
 
MRC_API MR_EdgeMap *const * MR_DividePolylineParameters_Get_otherOutEmap (const MR_DividePolylineParameters *_this)
 
MRC_API void MR_DividePolylineParameters_Set_otherOutEmap (MR_DividePolylineParameters *_this, MR_EdgeMap *value)
 
MRC_API MR_EdgeMap ** MR_DividePolylineParameters_GetMutable_otherOutEmap (MR_DividePolylineParameters *_this)
 
MRC_API MR_DividePolylineParametersMR_DividePolylineParameters_DefaultConstruct (void)
 
MRC_API MR_DividePolylineParametersMR_DividePolylineParameters_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_DividePolylineParametersMR_DividePolylineParameters_ConstructFrom (MR_PassBy onEdgeSplitCallback_pass_by, MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float *onEdgeSplitCallback, bool closeLineAfterCut, MR_VertMap *outVmap, MR_EdgeMap *outEmap, MR_Polyline3 *otherPart, MR_VertMap *otherOutVmap, MR_EdgeMap *otherOutEmap)
 
MRC_API const MR_DividePolylineParametersMR_DividePolylineParameters_OffsetPtr (const MR_DividePolylineParameters *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.
 
MRC_API MR_DividePolylineParametersMR_DividePolylineParameters_OffsetMutablePtr (MR_DividePolylineParameters *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.
 
MRC_API MR_DividePolylineParametersMR_DividePolylineParameters_ConstructFromAnother (MR_PassBy _other_pass_by, MR_DividePolylineParameters *_other)
 
MRC_API void MR_DividePolylineParameters_Destroy (const MR_DividePolylineParameters *_this)
 Destroys a heap-allocated instance of MR_DividePolylineParameters. Does nothing if the pointer is null.
 
MRC_API void MR_DividePolylineParameters_DestroyArray (const MR_DividePolylineParameters *_this)
 Destroys a heap-allocated array of MR_DividePolylineParameters. Does nothing if the pointer is null.
 
MRC_API MR_DividePolylineParametersMR_DividePolylineParameters_AssignFromAnother (MR_DividePolylineParameters *_this, MR_PassBy _other_pass_by, MR_DividePolylineParameters *_other)
 
MRC_API void MR_trimWithPlane_MR_Polyline3 (MR_Polyline3 *polyline, const MR_Plane3f *plane, const MR_DividePolylineParameters *params)
 
MRC_API MR_std_vector_MR_EdgeSegmentMR_extractSectionsFromPolyline (const MR_Polyline3 *polyline, const MR_Plane3f *plane, float eps, MR_UndirectedEdgeBitSet *positiveEdges)
 

Typedef Documentation

◆ MR_DividePolylineParameters

◆ MR_EdgeBitSet

typedef struct MR_EdgeBitSet MR_EdgeBitSet

◆ MR_EdgeMap

typedef struct MR_EdgeMap MR_EdgeMap

◆ MR_Plane3f

typedef struct MR_Plane3f MR_Plane3f

◆ MR_Polyline3

typedef struct MR_Polyline3 MR_Polyline3

◆ MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float

◆ MR_std_vector_MR_EdgeSegment

◆ MR_UndirectedEdgeBitSet

◆ MR_VertMap

typedef struct MR_VertMap MR_VertMap

Function Documentation

◆ MR_DividePolylineParameters_AssignFromAnother()

MRC_API MR_DividePolylineParameters * MR_DividePolylineParameters_AssignFromAnother ( MR_DividePolylineParameters * _this,
MR_PassBy _other_pass_by,
MR_DividePolylineParameters * _other )

Generated from a method of class MR::DividePolylineParameters named operator=. 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_DividePolylineParameters_ConstructFrom()

MRC_API MR_DividePolylineParameters * MR_DividePolylineParameters_ConstructFrom ( MR_PassBy onEdgeSplitCallback_pass_by,
MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float * onEdgeSplitCallback,
bool closeLineAfterCut,
MR_VertMap * outVmap,
MR_EdgeMap * outEmap,
MR_Polyline3 * otherPart,
MR_VertMap * otherOutVmap,
MR_EdgeMap * otherOutEmap )

Constructs MR::DividePolylineParameters elementwise. Never returns null. Returns an instance allocated on the heap! Must call MR_DividePolylineParameters_Destroy() to free it when you're done using it.

◆ MR_DividePolylineParameters_ConstructFromAnother()

MRC_API MR_DividePolylineParameters * MR_DividePolylineParameters_ConstructFromAnother ( MR_PassBy _other_pass_by,
MR_DividePolylineParameters * _other )

Generated from a constructor of class MR::DividePolylineParameters. Never returns null. Returns an instance allocated on the heap! Must call MR_DividePolylineParameters_Destroy() to free it when you're done using it.

◆ MR_DividePolylineParameters_DefaultConstruct()

MRC_API MR_DividePolylineParameters * MR_DividePolylineParameters_DefaultConstruct ( void )

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

◆ MR_DividePolylineParameters_DefaultConstructArray()

MRC_API MR_DividePolylineParameters * MR_DividePolylineParameters_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_DividePolylineParameters_DestroyArray(). Use MR_DividePolylineParameters_OffsetMutablePtr() and MR_DividePolylineParameters_OffsetPtr() to access the array elements.

◆ MR_DividePolylineParameters_Destroy()

MRC_API void MR_DividePolylineParameters_Destroy ( const MR_DividePolylineParameters * _this)

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

◆ MR_DividePolylineParameters_DestroyArray()

MRC_API void MR_DividePolylineParameters_DestroyArray ( const MR_DividePolylineParameters * _this)

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

◆ MR_DividePolylineParameters_Get_closeLineAfterCut()

MRC_API const bool * MR_DividePolylineParameters_Get_closeLineAfterCut ( const MR_DividePolylineParameters * _this)

closeLineAfterCut if true, the ends of resulting polyline will be connected by new edges (can make a polyline closed, even if the original one was open) if close, only cut edges (no new edges will be created) Returns a pointer to a member variable of class MR::DividePolylineParameters named closeLineAfterCut. 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_DividePolylineParameters_Get_onEdgeSplitCallback()

MRC_API const MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float * MR_DividePolylineParameters_Get_onEdgeSplitCallback ( const MR_DividePolylineParameters * _this)

onEdgeSplitCallback is invoked each time when an edge is split. Receives edge ID before split, edge ID after split, and weight of the origin vertex Returns a pointer to a member variable of class MR::DividePolylineParameters named onEdgeSplitCallback. 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_DividePolylineParameters_Get_otherOutEmap()

MRC_API MR_EdgeMap *const * MR_DividePolylineParameters_Get_otherOutEmap ( const MR_DividePolylineParameters * _this)

map from input polyline edges to other output Returns a pointer to a member variable of class MR::DividePolylineParameters named otherOutEmap. 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_DividePolylineParameters_Get_otherOutVmap()

MRC_API MR_VertMap *const * MR_DividePolylineParameters_Get_otherOutVmap ( const MR_DividePolylineParameters * _this)

map from input polyline verts to other output Returns a pointer to a member variable of class MR::DividePolylineParameters named otherOutVmap. 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_DividePolylineParameters_Get_otherPart()

MRC_API MR_Polyline3 *const * MR_DividePolylineParameters_Get_otherPart ( const MR_DividePolylineParameters * _this)

otherPart Optional return, polyline composed from edges on the negative side of the plane Returns a pointer to a member variable of class MR::DividePolylineParameters named otherPart. 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_DividePolylineParameters_Get_outEmap()

MRC_API MR_EdgeMap *const * MR_DividePolylineParameters_Get_outEmap ( const MR_DividePolylineParameters * _this)

map from input polyline edges to output Returns a pointer to a member variable of class MR::DividePolylineParameters named outEmap. 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_DividePolylineParameters_Get_outVmap()

MRC_API MR_VertMap *const * MR_DividePolylineParameters_Get_outVmap ( const MR_DividePolylineParameters * _this)

map from input polyline verts to output Returns a pointer to a member variable of class MR::DividePolylineParameters named outVmap. 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_DividePolylineParameters_GetMutable_closeLineAfterCut()

MRC_API bool * MR_DividePolylineParameters_GetMutable_closeLineAfterCut ( MR_DividePolylineParameters * _this)

closeLineAfterCut if true, the ends of resulting polyline will be connected by new edges (can make a polyline closed, even if the original one was open) if close, only cut edges (no new edges will be created) Returns a mutable pointer to a member variable of class MR::DividePolylineParameters named closeLineAfterCut. 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_DividePolylineParameters_GetMutable_onEdgeSplitCallback()

MRC_API MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float * MR_DividePolylineParameters_GetMutable_onEdgeSplitCallback ( MR_DividePolylineParameters * _this)

onEdgeSplitCallback is invoked each time when an edge is split. Receives edge ID before split, edge ID after split, and weight of the origin vertex Returns a mutable pointer to a member variable of class MR::DividePolylineParameters named onEdgeSplitCallback. 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_DividePolylineParameters_GetMutable_otherOutEmap()

MRC_API MR_EdgeMap ** MR_DividePolylineParameters_GetMutable_otherOutEmap ( MR_DividePolylineParameters * _this)

map from input polyline edges to other output Returns a mutable pointer to a member variable of class MR::DividePolylineParameters named otherOutEmap. 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_DividePolylineParameters_GetMutable_otherOutVmap()

MRC_API MR_VertMap ** MR_DividePolylineParameters_GetMutable_otherOutVmap ( MR_DividePolylineParameters * _this)

map from input polyline verts to other output Returns a mutable pointer to a member variable of class MR::DividePolylineParameters named otherOutVmap. 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_DividePolylineParameters_GetMutable_otherPart()

MRC_API MR_Polyline3 ** MR_DividePolylineParameters_GetMutable_otherPart ( MR_DividePolylineParameters * _this)

otherPart Optional return, polyline composed from edges on the negative side of the plane Returns a mutable pointer to a member variable of class MR::DividePolylineParameters named otherPart. 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_DividePolylineParameters_GetMutable_outEmap()

MRC_API MR_EdgeMap ** MR_DividePolylineParameters_GetMutable_outEmap ( MR_DividePolylineParameters * _this)

map from input polyline edges to output Returns a mutable pointer to a member variable of class MR::DividePolylineParameters named outEmap. 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_DividePolylineParameters_GetMutable_outVmap()

MRC_API MR_VertMap ** MR_DividePolylineParameters_GetMutable_outVmap ( MR_DividePolylineParameters * _this)

map from input polyline verts to output Returns a mutable pointer to a member variable of class MR::DividePolylineParameters named outVmap. 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_DividePolylineParameters_OffsetMutablePtr()

MRC_API MR_DividePolylineParameters * MR_DividePolylineParameters_OffsetMutablePtr ( MR_DividePolylineParameters * 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.

◆ MR_DividePolylineParameters_OffsetPtr()

MRC_API const MR_DividePolylineParameters * MR_DividePolylineParameters_OffsetPtr ( const MR_DividePolylineParameters * 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.

◆ MR_DividePolylineParameters_Set_closeLineAfterCut()

MRC_API void MR_DividePolylineParameters_Set_closeLineAfterCut ( MR_DividePolylineParameters * _this,
bool value )

closeLineAfterCut if true, the ends of resulting polyline will be connected by new edges (can make a polyline closed, even if the original one was open) if close, only cut edges (no new edges will be created) Modifies a member variable of class MR::DividePolylineParameters named closeLineAfterCut. Parameter _this can not be null. It is a single object.

◆ MR_DividePolylineParameters_Set_onEdgeSplitCallback()

MRC_API void MR_DividePolylineParameters_Set_onEdgeSplitCallback ( MR_DividePolylineParameters * _this,
MR_PassBy value_pass_by,
MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float * value )

onEdgeSplitCallback is invoked each time when an edge is split. Receives edge ID before split, edge ID after split, and weight of the origin vertex Modifies a member variable of class MR::DividePolylineParameters named onEdgeSplitCallback. Parameter _this can not be null. It is a single object.

◆ MR_DividePolylineParameters_Set_otherOutEmap()

MRC_API void MR_DividePolylineParameters_Set_otherOutEmap ( MR_DividePolylineParameters * _this,
MR_EdgeMap * value )

map from input polyline edges to other output Modifies a member variable of class MR::DividePolylineParameters named otherOutEmap. Parameter _this can not be null. It is a single object.

◆ MR_DividePolylineParameters_Set_otherOutVmap()

MRC_API void MR_DividePolylineParameters_Set_otherOutVmap ( MR_DividePolylineParameters * _this,
MR_VertMap * value )

map from input polyline verts to other output Modifies a member variable of class MR::DividePolylineParameters named otherOutVmap. Parameter _this can not be null. It is a single object.

◆ MR_DividePolylineParameters_Set_otherPart()

MRC_API void MR_DividePolylineParameters_Set_otherPart ( MR_DividePolylineParameters * _this,
MR_Polyline3 * value )

otherPart Optional return, polyline composed from edges on the negative side of the plane Modifies a member variable of class MR::DividePolylineParameters named otherPart. Parameter _this can not be null. It is a single object.

◆ MR_DividePolylineParameters_Set_outEmap()

MRC_API void MR_DividePolylineParameters_Set_outEmap ( MR_DividePolylineParameters * _this,
MR_EdgeMap * value )

map from input polyline edges to output Modifies a member variable of class MR::DividePolylineParameters named outEmap. Parameter _this can not be null. It is a single object.

◆ MR_DividePolylineParameters_Set_outVmap()

MRC_API void MR_DividePolylineParameters_Set_outVmap ( MR_DividePolylineParameters * _this,
MR_VertMap * value )

map from input polyline verts to output Modifies a member variable of class MR::DividePolylineParameters named outVmap. Parameter _this can not be null. It is a single object.

◆ MR_extractSectionsFromPolyline()

MRC_API MR_std_vector_MR_EdgeSegment * MR_extractSectionsFromPolyline ( const MR_Polyline3 * polyline,
const MR_Plane3f * plane,
float eps,
MR_UndirectedEdgeBitSet * positiveEdges )

This function cuts polyline with a plane

plane cuts an edge if one end of the edge is below the plane and the other is not

Returns
Edge segments that are closer to the plane than
Parameters
eps.Segments are oriented according by plane normal ( segment.a <= segment.b)
polylineInput polyline that will be cut by the plane
planeInput plane to cut polyline with
epsMaximal distance from the plane
positiveEdgesEdges in a positive half-space relative to the plane or on the plane itself (only adds bits to the existing ones) Generated from function MR::extractSectionsFromPolyline. Parameter polyline can not be null. It is a single object. Parameter plane can not be null. It is a single object. Parameter positiveEdges defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_std_vector_MR_EdgeSegment_Destroy() to free it when you're done using it.

◆ MR_subdivideWithPlane_4()

MRC_API MR_UndirectedEdgeBitSet * MR_subdivideWithPlane_4 ( MR_Polyline3 * polyline,
const MR_Plane3f * plane,
MR_EdgeBitSet * newPositiveEdges,
MR_PassBy onEdgeSplitCallback_pass_by,
MR_std_function_void_from_MR_EdgeId_MR_EdgeId_float * onEdgeSplitCallback )

This function splits edges intersected by the plane

Returns
edges located above the plane (in direction of normal to plane)
Parameters
polylineInput polyline that will be cut by the plane
planeInput plane to cut polyline with
newPositiveEdgesedges with origin on the plane and oriented to the positive direction (only adds bits to the existing ones)
onEdgeSplitCallbackis invoked each time when an edge is split. Receives edge ID before split, edge ID after split, and weight of the origin vertex Generated from function MR::subdivideWithPlane. Parameter polyline can not be null. It is a single object. Parameter plane can not be null. It is a single object. Parameter newPositiveEdges defaults to a null pointer in C++. Parameter onEdgeSplitCallback 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_UndirectedEdgeBitSet_Destroy() to free it when you're done using it.

◆ MR_trimWithPlane_MR_Polyline3()

MRC_API void MR_trimWithPlane_MR_Polyline3 ( MR_Polyline3 * polyline,
const MR_Plane3f * plane,
const MR_DividePolylineParameters * params )

This function divides polyline with a plane, leaving only part of polyline that lies in positive direction of normal

Parameters
polylineInput polyline that will be cut by the plane
planeInput plane to cut polyline with
paramsParameters of the function, containing optional output Generated from function MR::trimWithPlane. Parameter polyline can not be null. It is a single object. Parameter plane can not be null. It is a single object. Parameter params is a single object. Parameter params has a default argument: {}, pass a null pointer to use it.