MeshLib C Docs
Loading...
Searching...
No Matches
MRFreeFormDeformer.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRVector3.h>
4#include <MRCMisc/common.h>
5#include <MRCMisc/exports.h>
6
7#include <stddef.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef struct MR_AffineXf3f MR_AffineXf3f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
14typedef struct MR_Box3d MR_Box3d; // Defined in `#include <MRCMesh/MRBox.h>`.
15typedef struct MR_Box3f MR_Box3f; // Defined in `#include <MRCMesh/MRBox.h>`.
16typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
17typedef struct MR_Vector3d MR_Vector3d; // Defined in `#include <MRCMesh/MRVector3.h>`.
18typedef struct MR_VertBitSet MR_VertBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
19typedef struct MR_VertCoords MR_VertCoords; // Defined in `#include <MRCMesh/MRVector.h>`.
20typedef struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f; // Defined in `#include <MRCMisc/std_vector_MR_Vector3f.h>`.
21
22
27
33
37
40
43
44// Only set mesh ref
50
56
59
62
63// Calculates all points' normalized positions in parallel
64// sets ref grid by initialBox, if initialBox is invalid uses mesh bounding box instead
71MRC_API void MR_FreeFormDeformer_init(MR_FreeFormDeformer *_this, const MR_Vector3i *resolution, const MR_Box3f *initialBox);
72
73// Updates ref grid point position
79
80// Gets ref grid point position
86
87// Apply updated grid to all mesh points in parallel
88// ensure updating render object after using it
92
93// Apply updated grid to given point
98
99// Get one dimension index by grid coord
103MRC_API int MR_FreeFormDeformer_getIndex(const MR_FreeFormDeformer *_this, const MR_Vector3i *coordOfPointInGrid);
104
105// Get grid coord by index
109
114
119
124
128
131
134
142
145
148
153
161
168
174
180
184
190
197
198// Calculates best Free Form transform to fit given source->target deformation
199// origin ref grid as box corners ( resolution parameter specifies how to divide box )
200// samplesToBox - if set used to transform source and target points to box space
201// returns new positions of ref grid
211
212#ifdef __cplusplus
213} // extern "C"
214#endif
struct MR_VertCoords MR_VertCoords
Definition MRAABBTreePoints.h:21
struct MR_VertBitSet MR_VertBitSet
Definition MRAABBTree.h:15
struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
Definition MRBestFit.h:25
struct MR_Mesh MR_Mesh
Definition MRCtm.h:12
MRC_API void MR_FreeFormBestFit_addPair_MR_Vector3f(MR_FreeFormBestFit *_this, const MR_Vector3f *src, const MR_Vector3f *tgt, const float *w)
MRC_API int MR_FreeFormDeformer_getIndex(const MR_FreeFormDeformer *_this, const MR_Vector3i *coordOfPointInGrid)
MRC_API const MR_FreeFormBestFit * MR_FreeFormBestFit_OffsetPtr(const MR_FreeFormBestFit *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_FreeFormDeformer * MR_FreeFormDeformer_Construct_MR_VertCoords(MR_VertCoords *coords, const MR_VertBitSet *valid)
struct MR_FreeFormDeformer MR_FreeFormDeformer
Class for deforming mesh using Bernstein interpolation.
Definition MRFreeFormDeformer.h:26
MRC_API const MR_std_vector_MR_Vector3f * MR_FreeFormDeformer_getAllRefGridPositions(const MR_FreeFormDeformer *_this)
MRC_API void MR_FreeFormDeformer_init(MR_FreeFormDeformer *_this, const MR_Vector3i *resolution, const MR_Box3f *initialBox)
MRC_API const MR_FreeFormDeformer * MR_FreeFormDeformer_OffsetPtr(const MR_FreeFormDeformer *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_FreeFormDeformer_setRefGridPointPosition(MR_FreeFormDeformer *_this, const MR_Vector3i *coordOfPointInGrid, const MR_Vector3f *newPos)
MRC_API MR_FreeFormDeformer * MR_FreeFormDeformer_ConstructFromAnother(MR_PassBy _other_pass_by, MR_FreeFormDeformer *_other)
MRC_API void MR_FreeFormDeformer_apply(const MR_FreeFormDeformer *_this)
MRC_API MR_FreeFormDeformer * MR_FreeFormDeformer_OffsetMutablePtr(MR_FreeFormDeformer *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_FreeFormBestFit_addPair_MR_Vector3d(MR_FreeFormBestFit *_this, const MR_Vector3d *src, const MR_Vector3d *tgt, const double *w)
MRC_API double MR_FreeFormBestFit_getStabilizer(const MR_FreeFormBestFit *_this)
MRC_API void MR_FreeFormDeformer_setAllRefGridPositions(MR_FreeFormDeformer *_this, const MR_std_vector_MR_Vector3f *refPoints)
MRC_API MR_FreeFormBestFit * MR_FreeFormBestFit_ConstructFromAnother(MR_PassBy _other_pass_by, MR_FreeFormBestFit *_other)
MRC_API void MR_FreeFormDeformer_DestroyArray(const MR_FreeFormDeformer *_this)
Destroys a heap-allocated array of MR_FreeFormDeformer. Does nothing if the pointer is null.
MRC_API MR_Vector3f MR_FreeFormDeformer_applySinglePoint(const MR_FreeFormDeformer *_this, const MR_Vector3f *point)
struct MR_FreeFormBestFit MR_FreeFormBestFit
Definition MRFreeFormDeformer.h:32
MRC_API void MR_FreeFormBestFit_setStabilizer(MR_FreeFormBestFit *_this, double stabilizer)
MRC_API void MR_FreeFormBestFit_Destroy(const MR_FreeFormBestFit *_this)
Destroys a heap-allocated instance of MR_FreeFormBestFit. Does nothing if the pointer is null.
MRC_API MR_FreeFormBestFit * MR_FreeFormBestFit_OffsetMutablePtr(MR_FreeFormBestFit *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_Vector3i MR_FreeFormDeformer_getCoord(const MR_FreeFormDeformer *_this, int index)
MRC_API void MR_FreeFormDeformer_Destroy(const MR_FreeFormDeformer *_this)
Destroys a heap-allocated instance of MR_FreeFormDeformer. Does nothing if the pointer is null.
MRC_API MR_FreeFormBestFit * MR_FreeFormBestFit_AssignFromAnother(MR_FreeFormBestFit *_this, MR_PassBy _other_pass_by, MR_FreeFormBestFit *_other)
MRC_API void MR_FreeFormBestFit_addOther(MR_FreeFormBestFit *_this, const MR_FreeFormBestFit *other)
MRC_API const MR_Vector3f * MR_FreeFormDeformer_getRefGridPointPosition(const MR_FreeFormDeformer *_this, const MR_Vector3i *coordOfPointInGrid)
MRC_API MR_std_vector_MR_Vector3f * MR_FreeFormBestFit_findBestDeformationReferenceGrid(MR_FreeFormBestFit *_this)
MRC_API const MR_Vector3i * MR_FreeFormDeformer_getResolution(const MR_FreeFormDeformer *_this)
MRC_API void MR_FreeFormBestFit_DestroyArray(const MR_FreeFormBestFit *_this)
Destroys a heap-allocated array of MR_FreeFormBestFit. Does nothing if the pointer is null.
MRC_API MR_std_vector_MR_Vector3f * MR_makeFreeFormOriginGrid(const MR_Box3f *box, const MR_Vector3i *resolution)
MRC_API MR_std_vector_MR_Vector3f * MR_findBestFreeformDeformation(const MR_Box3f *box, const MR_std_vector_MR_Vector3f *source, const MR_std_vector_MR_Vector3f *target, const MR_Vector3i *resolution, const MR_AffineXf3f *samplesToBox)
MRC_API MR_FreeFormDeformer * MR_FreeFormDeformer_Construct_MR_Mesh(MR_Mesh *mesh, const MR_VertBitSet *region)
MRC_API MR_FreeFormBestFit * MR_FreeFormBestFit_Construct(const MR_Box3d *box, const MR_Vector3i *resolution)
MR_PassBy
Definition common.h:19
#define MRC_API
Definition exports.h:11
Definition MRAffineXf.h:36
Definition MRBox.h:116
Definition MRBox.h:108
Definition MRVector3.h:59
Definition MRVector3.h:50
Definition MRVector3.h:32