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#include <stdint.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct MR_AffineXf3f MR_AffineXf3f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
15typedef struct MR_Box3d MR_Box3d; // Defined in `#include <MRCMesh/MRBox.h>`.
16typedef struct MR_Box3f MR_Box3f; // Defined in `#include <MRCMesh/MRBox.h>`.
17typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
18typedef struct MR_Vector3d MR_Vector3d; // Defined in `#include <MRCMesh/MRVector3.h>`.
19typedef struct MR_VertBitSet MR_VertBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
20typedef struct MR_VertCoords MR_VertCoords; // Defined in `#include <MRCMesh/MRVector.h>`.
21typedef struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f; // Defined in `#include <MRCMisc/std_vector_MR_Vector3f.h>`.
22
23
28
34
38
41
44
45// Only set mesh ref
51
57
60
63
64// Calculates all points' normalized positions in parallel
65// sets ref grid by initialBox, if initialBox is invalid uses mesh bounding box instead
72MRC_API void MR_FreeFormDeformer_init(MR_FreeFormDeformer *_this, const MR_Vector3i *resolution, const MR_Box3f *initialBox);
73
74// Updates ref grid point position
80
81// Gets ref grid point position
87
88// Apply updated grid to all mesh points in parallel
89// ensure updating render object after using it
93
94// Apply updated grid to given point
99
100// Get one dimension index by grid coord
104MRC_API int32_t MR_FreeFormDeformer_getIndex(const MR_FreeFormDeformer *_this, const MR_Vector3i *coordOfPointInGrid);
105
106// Get grid coord by index
110
115
120
125
129
132
135
143
146
149
154
162
169
175
181
185
191
198
199// Calculates best Free Form transform to fit given source->target deformation
200// origin ref grid as box corners ( resolution parameter specifies how to divide box )
201// samplesToBox - if set used to transform source and target points to box space
202// returns new positions of ref grid
212
213#ifdef __cplusplus
214} // extern "C"
215#endif
struct MR_VertCoords MR_VertCoords
Definition MRAABBTreePoints.h:22
struct MR_VertBitSet MR_VertBitSet
Definition MRAABBTree.h:15
struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
Definition MRBestFit.h:26
struct MR_Mesh MR_Mesh
Definition MRCtm.h:13
MRC_API void MR_FreeFormBestFit_addPair_MR_Vector3f(MR_FreeFormBestFit *_this, const MR_Vector3f *src, const MR_Vector3f *tgt, const float *w)
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:27
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:33
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 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 int32_t MR_FreeFormDeformer_getIndex(const MR_FreeFormDeformer *_this, const MR_Vector3i *coordOfPointInGrid)
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)
MRC_API MR_Vector3i MR_FreeFormDeformer_getCoord(const MR_FreeFormDeformer *_this, int32_t index)
MR_PassBy
Definition common.h:19
#define MRC_API
Definition exports.h:11
Definition MRAffineXf.h:36
Definition MRBox.h:117
Definition MRBox.h:109
Definition MRVector3.h:60
Definition MRVector3.h:51
Definition MRVector3.h:33