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
28
35
39
42
45
46// Only set mesh ref
52
58
61
64
65// Calculates all points' normalized positions in parallel
66// sets ref grid by initialBox, if initialBox is invalid uses mesh bounding box instead
73MRC_API void MR_FreeFormDeformer_init(MR_FreeFormDeformer *_this, const MR_Vector3i *resolution, const MR_Box3f *initialBox);
74
75// Updates ref grid point position
81
82// Gets ref grid point position
88
89// Apply updated grid to all mesh points in parallel
90// ensure updating render object after using it
94
95// Apply updated grid to given point
100
101// Get one dimension index by grid coord
105MRC_API int MR_FreeFormDeformer_getIndex(const MR_FreeFormDeformer *_this, const MR_Vector3i *coordOfPointInGrid);
106
107// Get grid coord by index
111
116
121
126
130
133
136
144
147
150
155
163
170
176
182
186
192
199
200// Calculates best Free Form transform to fit given source->target deformation
201// origin ref grid as box corners ( resolution parameter specifies how to divide box )
202// samplesToBox - if set used to transform source and target points to box space
203// returns new positions of ref grid
213
214#ifdef __cplusplus
215} // extern "C"
216#endif
struct MR_VertCoords MR_VertCoords
Definition MRAABBTreePoints.h:21
struct MR_VertBitSet MR_VertBitSet
Definition MRAABBTree.h:22
struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
Definition MRBestFit.h:25
struct MR_Mesh MR_Mesh
Definition MRCtm.h:16
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: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:34
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:23
#define MRC_API
Definition exports.h:11
Definition MRAffineXf.h:39
Definition MRBox.h:118
Definition MRBox.h:110
Definition MRVector3.h:61
Definition MRVector3.h:52
Definition MRVector3.h:34