MeshLib C Docs
Loading...
Searching...
No Matches
MREdgeLengthMesh.h File Reference
#include <MRCMesh/MRId.h>
#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_Mesh MR_Mesh
 
typedef struct MR_MeshTopology MR_MeshTopology
 
typedef struct MR_UndirectedEdgeScalars MR_UndirectedEdgeScalars
 
typedef struct MR_std_optional_float MR_std_optional_float
 
typedef struct MR_EdgeLengthMesh MR_EdgeLengthMesh
 

Functions

MRC_API const MR_MeshTopologyMR_EdgeLengthMesh_Get_topology (const MR_EdgeLengthMesh *_this)
 
MRC_API void MR_EdgeLengthMesh_Set_topology (MR_EdgeLengthMesh *_this, MR_PassBy value_pass_by, MR_MeshTopology *value)
 
MRC_API MR_MeshTopologyMR_EdgeLengthMesh_GetMutable_topology (MR_EdgeLengthMesh *_this)
 
MRC_API const MR_UndirectedEdgeScalarsMR_EdgeLengthMesh_Get_edgeLengths (const MR_EdgeLengthMesh *_this)
 
MRC_API void MR_EdgeLengthMesh_Set_edgeLengths (MR_EdgeLengthMesh *_this, MR_PassBy value_pass_by, MR_UndirectedEdgeScalars *value)
 
MRC_API MR_UndirectedEdgeScalarsMR_EdgeLengthMesh_GetMutable_edgeLengths (MR_EdgeLengthMesh *_this)
 
MRC_API MR_EdgeLengthMeshMR_EdgeLengthMesh_DefaultConstruct (void)
 
MRC_API MR_EdgeLengthMeshMR_EdgeLengthMesh_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_EdgeLengthMeshMR_EdgeLengthMesh_ConstructFrom (MR_PassBy topology_pass_by, MR_MeshTopology *topology, MR_PassBy edgeLengths_pass_by, MR_UndirectedEdgeScalars *edgeLengths)
 
MRC_API const MR_EdgeLengthMeshMR_EdgeLengthMesh_OffsetPtr (const MR_EdgeLengthMesh *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_EdgeLengthMeshMR_EdgeLengthMesh_OffsetMutablePtr (MR_EdgeLengthMesh *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_EdgeLengthMeshMR_EdgeLengthMesh_ConstructFromAnother (MR_PassBy _other_pass_by, MR_EdgeLengthMesh *_other)
 
MRC_API void MR_EdgeLengthMesh_Destroy (const MR_EdgeLengthMesh *_this)
 Destroys a heap-allocated instance of MR_EdgeLengthMesh. Does nothing if the pointer is null.
 
MRC_API void MR_EdgeLengthMesh_DestroyArray (const MR_EdgeLengthMesh *_this)
 Destroys a heap-allocated array of MR_EdgeLengthMesh. Does nothing if the pointer is null.
 
MRC_API MR_EdgeLengthMeshMR_EdgeLengthMesh_AssignFromAnother (MR_EdgeLengthMesh *_this, MR_PassBy _other_pass_by, MR_EdgeLengthMesh *_other)
 
MRC_API MR_EdgeLengthMeshMR_EdgeLengthMesh_fromMesh (const MR_Mesh *mesh)
 
MRC_API float MR_EdgeLengthMesh_leftCotan (const MR_EdgeLengthMesh *_this, MR_EdgeId e)
 
MRC_API float MR_EdgeLengthMesh_cotan (const MR_EdgeLengthMesh *_this, MR_UndirectedEdgeId ue)
 
MRC_API bool MR_EdgeLengthMesh_isDelone (const MR_EdgeLengthMesh *_this, MR_UndirectedEdgeId ue, const float *threshold)
 
MRC_API MR_std_optional_floatMR_EdgeLengthMesh_edgeLengthAfterFlip (const MR_EdgeLengthMesh *_this, MR_EdgeId e)
 
MRC_API bool MR_EdgeLengthMesh_flipEdge (MR_EdgeLengthMesh *_this, MR_EdgeId e)
 

Typedef Documentation

◆ MR_EdgeLengthMesh

Unlike the classic mesh that stores coordinates of its vertices, this class stores the lengths of all edges. It can be used for construction of intrinsic Intrinsic Delaunay Triangulations. Generated from class MR::EdgeLengthMesh.

◆ MR_Mesh

typedef struct MR_Mesh MR_Mesh

◆ MR_MeshTopology

◆ MR_std_optional_float

◆ MR_UndirectedEdgeScalars

Function Documentation

◆ MR_EdgeLengthMesh_AssignFromAnother()

MRC_API MR_EdgeLengthMesh * MR_EdgeLengthMesh_AssignFromAnother ( MR_EdgeLengthMesh * _this,
MR_PassBy _other_pass_by,
MR_EdgeLengthMesh * _other )

Generated from a method of class MR::EdgeLengthMesh 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_EdgeLengthMesh_ConstructFrom()

MRC_API MR_EdgeLengthMesh * MR_EdgeLengthMesh_ConstructFrom ( MR_PassBy topology_pass_by,
MR_MeshTopology * topology,
MR_PassBy edgeLengths_pass_by,
MR_UndirectedEdgeScalars * edgeLengths )

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

◆ MR_EdgeLengthMesh_ConstructFromAnother()

MRC_API MR_EdgeLengthMesh * MR_EdgeLengthMesh_ConstructFromAnother ( MR_PassBy _other_pass_by,
MR_EdgeLengthMesh * _other )

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

◆ MR_EdgeLengthMesh_cotan()

MRC_API float MR_EdgeLengthMesh_cotan ( const MR_EdgeLengthMesh * _this,
MR_UndirectedEdgeId ue )

computes sum of cotangents of the angle in the left and right triangles opposite to given edge, consider cotangents zero for not existing triangles Generated from a method of class MR::EdgeLengthMesh named cotan. Parameter _this can not be null. It is a single object.

◆ MR_EdgeLengthMesh_DefaultConstruct()

MRC_API MR_EdgeLengthMesh * MR_EdgeLengthMesh_DefaultConstruct ( void )

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

◆ MR_EdgeLengthMesh_DefaultConstructArray()

MRC_API MR_EdgeLengthMesh * MR_EdgeLengthMesh_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_EdgeLengthMesh_DestroyArray(). Use MR_EdgeLengthMesh_OffsetMutablePtr() and MR_EdgeLengthMesh_OffsetPtr() to access the array elements.

◆ MR_EdgeLengthMesh_Destroy()

MRC_API void MR_EdgeLengthMesh_Destroy ( const MR_EdgeLengthMesh * _this)

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

◆ MR_EdgeLengthMesh_DestroyArray()

MRC_API void MR_EdgeLengthMesh_DestroyArray ( const MR_EdgeLengthMesh * _this)

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

◆ MR_EdgeLengthMesh_edgeLengthAfterFlip()

MRC_API MR_std_optional_float * MR_EdgeLengthMesh_edgeLengthAfterFlip ( const MR_EdgeLengthMesh * _this,
MR_EdgeId e )

given the edge with left and right triangular faces, which form together a quadrangle, returns the length of geodesic line on original mesh between the vertices of the quadrangle opposite to given edge; returns std::nullopt if the geodesic line does not go fully inside the quadrangle Generated from a method of class MR::EdgeLengthMesh named edgeLengthAfterFlip. Parameter _this can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_optional_float_Destroy() to free it when you're done using it.

◆ MR_EdgeLengthMesh_flipEdge()

MRC_API bool MR_EdgeLengthMesh_flipEdge ( MR_EdgeLengthMesh * _this,
MR_EdgeId e )

given the edge with left and right triangular faces, which form together a quadrangle, rotates the edge counter-clockwise inside the quadrangle; the length of e becomes equal to the length of geodesic line between its new ends on original mesh; does not flip and returns false if the geodesic line does not go fully inside the quadrangle Generated from a method of class MR::EdgeLengthMesh named flipEdge. Parameter _this can not be null. It is a single object.

◆ MR_EdgeLengthMesh_fromMesh()

MRC_API MR_EdgeLengthMesh * MR_EdgeLengthMesh_fromMesh ( const MR_Mesh * mesh)

construct EdgeLengthMesh from an ordinary mesh Generated from a method of class MR::EdgeLengthMesh named fromMesh. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_EdgeLengthMesh_Destroy() to free it when you're done using it.

◆ MR_EdgeLengthMesh_Get_edgeLengths()

MRC_API const MR_UndirectedEdgeScalars * MR_EdgeLengthMesh_Get_edgeLengths ( const MR_EdgeLengthMesh * _this)

Returns a pointer to a member variable of class MR::EdgeLengthMesh named edgeLengths. 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_EdgeLengthMesh_Get_topology()

MRC_API const MR_MeshTopology * MR_EdgeLengthMesh_Get_topology ( const MR_EdgeLengthMesh * _this)

Returns a pointer to a member variable of class MR::EdgeLengthMesh named topology. 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_EdgeLengthMesh_GetMutable_edgeLengths()

MRC_API MR_UndirectedEdgeScalars * MR_EdgeLengthMesh_GetMutable_edgeLengths ( MR_EdgeLengthMesh * _this)

Returns a mutable pointer to a member variable of class MR::EdgeLengthMesh named edgeLengths. 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_EdgeLengthMesh_GetMutable_topology()

MRC_API MR_MeshTopology * MR_EdgeLengthMesh_GetMutable_topology ( MR_EdgeLengthMesh * _this)

Returns a mutable pointer to a member variable of class MR::EdgeLengthMesh named topology. 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_EdgeLengthMesh_isDelone()

MRC_API bool MR_EdgeLengthMesh_isDelone ( const MR_EdgeLengthMesh * _this,
MR_UndirectedEdgeId ue,
const float * threshold )

returns true if given edge satisfies Delaunay conditions, returns false if the edge needs to be flipped to satisfy Delaunay conditions, passing negative threshold makes more edges satisfy Delaunay conditions Generated from a method of class MR::EdgeLengthMesh named isDelone. Parameter _this can not be null. It is a single object. Parameter threshold has a default argument: 0, pass a null pointer to use it.

◆ MR_EdgeLengthMesh_leftCotan()

MRC_API float MR_EdgeLengthMesh_leftCotan ( const MR_EdgeLengthMesh * _this,
MR_EdgeId e )

computes cotangent of the angle in the left( e ) triangle opposite to e, and returns 0 if left face does not exist Generated from a method of class MR::EdgeLengthMesh named leftCotan. Parameter _this can not be null. It is a single object.

◆ MR_EdgeLengthMesh_OffsetMutablePtr()

MRC_API MR_EdgeLengthMesh * MR_EdgeLengthMesh_OffsetMutablePtr ( MR_EdgeLengthMesh * 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_EdgeLengthMesh_OffsetPtr()

MRC_API const MR_EdgeLengthMesh * MR_EdgeLengthMesh_OffsetPtr ( const MR_EdgeLengthMesh * 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_EdgeLengthMesh_Set_edgeLengths()

MRC_API void MR_EdgeLengthMesh_Set_edgeLengths ( MR_EdgeLengthMesh * _this,
MR_PassBy value_pass_by,
MR_UndirectedEdgeScalars * value )

Modifies a member variable of class MR::EdgeLengthMesh named edgeLengths. Parameter _this can not be null. It is a single object.

◆ MR_EdgeLengthMesh_Set_topology()

MRC_API void MR_EdgeLengthMesh_Set_topology ( MR_EdgeLengthMesh * _this,
MR_PassBy value_pass_by,
MR_MeshTopology * value )

Modifies a member variable of class MR::EdgeLengthMesh named topology. Parameter _this can not be null. It is a single object.