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

Go to the source code of this file.

Typedefs

typedef struct MR_AABBTree MR_AABBTree
 
typedef struct MR_Dipoles MR_Dipoles
 
typedef struct MR_Mesh MR_Mesh
 
typedef struct MR_Dipole MR_Dipole
 

Functions

MRC_API const MR_Vector3fMR_Dipole_Get_pos (const MR_Dipole *_this)
 
MRC_API void MR_Dipole_Set_pos (MR_Dipole *_this, MR_Vector3f value)
 
MRC_API MR_Vector3fMR_Dipole_GetMutable_pos (MR_Dipole *_this)
 
MRC_API const float * MR_Dipole_Get_area (const MR_Dipole *_this)
 
MRC_API void MR_Dipole_Set_area (MR_Dipole *_this, float value)
 
MRC_API float * MR_Dipole_GetMutable_area (MR_Dipole *_this)
 
MRC_API const MR_Vector3fMR_Dipole_Get_dirArea (const MR_Dipole *_this)
 
MRC_API void MR_Dipole_Set_dirArea (MR_Dipole *_this, MR_Vector3f value)
 
MRC_API MR_Vector3fMR_Dipole_GetMutable_dirArea (MR_Dipole *_this)
 
MRC_API const float * MR_Dipole_Get_rr (const MR_Dipole *_this)
 
MRC_API void MR_Dipole_Set_rr (MR_Dipole *_this, float value)
 
MRC_API float * MR_Dipole_GetMutable_rr (MR_Dipole *_this)
 
MRC_API MR_DipoleMR_Dipole_DefaultConstruct (void)
 
MRC_API MR_DipoleMR_Dipole_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_DipoleMR_Dipole_ConstructFrom (MR_Vector3f pos, float area, MR_Vector3f dirArea, float rr)
 
MRC_API const MR_DipoleMR_Dipole_OffsetPtr (const MR_Dipole *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_DipoleMR_Dipole_OffsetMutablePtr (MR_Dipole *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_DipoleMR_Dipole_ConstructFromAnother (const MR_Dipole *_other)
 
MRC_API void MR_Dipole_Destroy (const MR_Dipole *_this)
 Destroys a heap-allocated instance of MR_Dipole. Does nothing if the pointer is null.
 
MRC_API void MR_Dipole_DestroyArray (const MR_Dipole *_this)
 Destroys a heap-allocated array of MR_Dipole. Does nothing if the pointer is null.
 
MRC_API MR_DipoleMR_Dipole_AssignFromAnother (MR_Dipole *_this, const MR_Dipole *_other)
 
MRC_API bool MR_Dipole_addIfGoodApprox (const MR_Dipole *_this, const MR_Vector3f *q, float betaSq, float *addTo)
 
MRC_API void MR_calcDipoles_3 (MR_Dipoles *dipoles, const MR_AABBTree *tree, const MR_Mesh *mesh)
 
MRC_API MR_DipolesMR_calcDipoles_2 (const MR_AABBTree *tree, const MR_Mesh *mesh)
 
MRC_API float MR_calcFastWindingNumber (const MR_Dipoles *dipoles, const MR_AABBTree *tree, const MR_Mesh *mesh, const MR_Vector3f *q, float beta, MR_FaceId skipFace)
 

Typedef Documentation

◆ MR_AABBTree

typedef struct MR_AABBTree MR_AABBTree

◆ MR_Dipole

typedef struct MR_Dipole MR_Dipole

Single oriented point or two oppositely charged points close together, representing a mesh part (one or more triangles) https://www.dgp.toronto.edu/projects/fast-winding-numbers/fast-winding-numbers-for-soups-and-clouds-siggraph-2018-barill-et-al.pdf Generated from class MR::Dipole.

◆ MR_Dipoles

typedef struct MR_Dipoles MR_Dipoles

◆ MR_Mesh

typedef struct MR_Mesh MR_Mesh

Function Documentation

◆ MR_calcDipoles_2()

MRC_API MR_Dipoles * MR_calcDipoles_2 ( const MR_AABBTree * tree,
const MR_Mesh * mesh )

Generated from function MR::calcDipoles. Parameter tree can not be null. It is a single object. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_Dipoles_Destroy() to free it when you're done using it.

◆ MR_calcDipoles_3()

MRC_API void MR_calcDipoles_3 ( MR_Dipoles * dipoles,
const MR_AABBTree * tree,
const MR_Mesh * mesh )

calculates dipoles for given mesh and AABB-tree Generated from function MR::calcDipoles. Parameter dipoles can not be null. It is a single object. Parameter tree can not be null. It is a single object. Parameter mesh can not be null. It is a single object.

◆ MR_calcFastWindingNumber()

MRC_API float MR_calcFastWindingNumber ( const MR_Dipoles * dipoles,
const MR_AABBTree * tree,
const MR_Mesh * mesh,
const MR_Vector3f * q,
float beta,
MR_FaceId skipFace )

compute approximate winding number at

Parameters
q;
betadetermines the precision of the approximation: the more the better, recommended value 2 or more; if distance from q to the center of some triangle group is more than beta times the distance from the center to most distance triangle in the group then we use approximate formula
skipFacethis triangle (if it is close to
q)will be skipped from summation Generated from function MR::calcFastWindingNumber. Parameter dipoles can not be null. It is a single object. Parameter tree can not be null. It is a single object. Parameter mesh can not be null. It is a single object. Parameter q can not be null. It is a single object.

◆ MR_Dipole_addIfGoodApprox()

MRC_API bool MR_Dipole_addIfGoodApprox ( const MR_Dipole * _this,
const MR_Vector3f * q,
float betaSq,
float * addTo )

returns true if this dipole is good approximation for a point

Parameters
q;and adds the contribution of this dipole to the winding number at point
qto
addToGenerated from a method of class MR::Dipole named addIfGoodApprox. Parameter _this can not be null. It is a single object. Parameter q can not be null. It is a single object. Parameter addTo can not be null. It is a single object.

◆ MR_Dipole_AssignFromAnother()

MRC_API MR_Dipole * MR_Dipole_AssignFromAnother ( MR_Dipole * _this,
const MR_Dipole * _other )

Generated from a method of class MR::Dipole named operator=. Parameter _this can not be null. It is a single object. Parameter _other 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_Dipole_ConstructFrom()

MRC_API MR_Dipole * MR_Dipole_ConstructFrom ( MR_Vector3f pos,
float area,
MR_Vector3f dirArea,
float rr )

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

◆ MR_Dipole_ConstructFromAnother()

MRC_API MR_Dipole * MR_Dipole_ConstructFromAnother ( const MR_Dipole * _other)

Generated from a constructor of class MR::Dipole. Parameter _other can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_Dipole_Destroy() to free it when you're done using it.

◆ MR_Dipole_DefaultConstruct()

MRC_API MR_Dipole * MR_Dipole_DefaultConstruct ( void )

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

◆ MR_Dipole_DefaultConstructArray()

MRC_API MR_Dipole * MR_Dipole_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_Dipole_DestroyArray(). Use MR_Dipole_OffsetMutablePtr() and MR_Dipole_OffsetPtr() to access the array elements.

◆ MR_Dipole_Destroy()

MRC_API void MR_Dipole_Destroy ( const MR_Dipole * _this)

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

◆ MR_Dipole_DestroyArray()

MRC_API void MR_Dipole_DestroyArray ( const MR_Dipole * _this)

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

◆ MR_Dipole_Get_area()

MRC_API const float * MR_Dipole_Get_area ( const MR_Dipole * _this)

Returns a pointer to a member variable of class MR::Dipole named area. 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_Dipole_Get_dirArea()

MRC_API const MR_Vector3f * MR_Dipole_Get_dirArea ( const MR_Dipole * _this)

Returns a pointer to a member variable of class MR::Dipole named dirArea. 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_Dipole_Get_pos()

MRC_API const MR_Vector3f * MR_Dipole_Get_pos ( const MR_Dipole * _this)

Returns a pointer to a member variable of class MR::Dipole named pos. 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_Dipole_Get_rr()

MRC_API const float * MR_Dipole_Get_rr ( const MR_Dipole * _this)

Returns a pointer to a member variable of class MR::Dipole named rr. 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_Dipole_GetMutable_area()

MRC_API float * MR_Dipole_GetMutable_area ( MR_Dipole * _this)

Returns a mutable pointer to a member variable of class MR::Dipole named area. 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_Dipole_GetMutable_dirArea()

MRC_API MR_Vector3f * MR_Dipole_GetMutable_dirArea ( MR_Dipole * _this)

Returns a mutable pointer to a member variable of class MR::Dipole named dirArea. 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_Dipole_GetMutable_pos()

MRC_API MR_Vector3f * MR_Dipole_GetMutable_pos ( MR_Dipole * _this)

Returns a mutable pointer to a member variable of class MR::Dipole named pos. 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_Dipole_GetMutable_rr()

MRC_API float * MR_Dipole_GetMutable_rr ( MR_Dipole * _this)

Returns a mutable pointer to a member variable of class MR::Dipole named rr. 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_Dipole_OffsetMutablePtr()

MRC_API MR_Dipole * MR_Dipole_OffsetMutablePtr ( MR_Dipole * 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_Dipole_OffsetPtr()

MRC_API const MR_Dipole * MR_Dipole_OffsetPtr ( const MR_Dipole * 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_Dipole_Set_area()

MRC_API void MR_Dipole_Set_area ( MR_Dipole * _this,
float value )

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

◆ MR_Dipole_Set_dirArea()

MRC_API void MR_Dipole_Set_dirArea ( MR_Dipole * _this,
MR_Vector3f value )

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

◆ MR_Dipole_Set_pos()

MRC_API void MR_Dipole_Set_pos ( MR_Dipole * _this,
MR_Vector3f value )

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

◆ MR_Dipole_Set_rr()

MRC_API void MR_Dipole_Set_rr ( MR_Dipole * _this,
float value )

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