MeshLib C Docs
Loading...
Searching...
No Matches
MRMarchingCubes.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 <stdbool.h>
8#include <stddef.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct MR_FunctionVolume MR_FunctionVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
15typedef struct MR_SimpleBinaryVolume MR_SimpleBinaryVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
16typedef struct MR_SimpleVolume MR_SimpleVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
17typedef struct MR_SimpleVolumeMinMax MR_SimpleVolumeMinMax; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
18typedef struct MR_VdbVolume MR_VdbVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
19typedef struct MR_Vector3i MR_Vector3i; // Defined in `#include <MRCMesh/MRVector3.h>`.
20typedef struct MR_Vector_MR_VoxelId_MR_FaceId MR_Vector_MR_VoxelId_MR_FaceId; // Defined in `#include <MRCMesh/MRVector.h>`.
21typedef struct MR_expected_MR_Mesh_std_string MR_expected_MR_Mesh_std_string; // Defined in `#include <MRCMisc/expected_MR_Mesh_std_string.h>`.
22typedef struct MR_expected_MR_TriMesh_std_string MR_expected_MR_TriMesh_std_string; // Defined in `#include <MRCMisc/expected_MR_TriMesh_std_string.h>`.
23typedef struct MR_expected_void_std_string MR_expected_void_std_string; // Defined in `#include <MRCMisc/expected_void_std_string.h>`.
24typedef struct MR_std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float MR_std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float; // Defined in `#include <MRCMisc/std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float.h>`.
25typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float; // Defined in `#include <MRCMisc/std_function_bool_from_float.h>`.
26typedef struct MR_std_function_void MR_std_function_void; // Defined in `#include <MRCMisc/std_function_void.h>`.
27
28
41
45
57
63
70
76
82
89
95
101
107
113
119
125
131
137
144
150
158
167
175
181
187
193
198
204
209
215
222
228
232
237
248
252
256
261
264
267
274
275// makes Mesh from SimpleVolume with given settings using Marching Cubes algorithm
282
289
290// makes Mesh from SimpleVolumeMinMax with given settings using Marching Cubes algorithm
297
304
305// makes Mesh from VdbVolume with given settings using Marching Cubes algorithm
312
319
320// makes Mesh from FunctionVolume with given settings using Marching Cubes algorithm
327
334
335// makes Mesh from SimpleBinaryVolume with given settings using Marching Cubes algorithm
342
349
354
358
362
373
376
379
386
391
396
403
409
410#ifdef __cplusplus
411} // extern "C"
412#endif
struct MR_std_function_bool_from_float MR_std_function_bool_from_float
Definition MR3mf.h:10
struct MR_VdbVolume MR_VdbVolume
Definition MRBox.h:18
struct MR_SimpleVolumeMinMax MR_SimpleVolumeMinMax
Definition MRBox.h:16
struct MR_expected_void_std_string MR_expected_void_std_string
Definition MRCtm.h:26
struct MR_expected_MR_Mesh_std_string MR_expected_MR_Mesh_std_string
Definition MRCtm.h:24
MRC_API MR_MarchingCubesByParts * MR_MarchingCubesByParts_OffsetMutablePtr(MR_MarchingCubesByParts *ptr, ptrdiff_t i)
MRC_API const MR_MarchingCubesByParts * MR_MarchingCubesByParts_OffsetPtr(const MR_MarchingCubesByParts *ptr, ptrdiff_t i)
MRC_API MR_std_function_bool_from_float * MR_MarchingCubesParams_GetMutable_cb(MR_MarchingCubesParams *_this)
MRC_API const MR_Vector3f * MR_MarchingCubesParams_Get_origin(const MR_MarchingCubesParams *_this)
MRC_API MR_MarchingCubesByParts * MR_MarchingCubesByParts_Construct(const MR_Vector3i *dims, const MR_MarchingCubesParams *params, const int *layersPerBlock)
MRC_API MR_MarchingCubesByParts * MR_MarchingCubesByParts_AssignFromAnother(MR_MarchingCubesByParts *_this, MR_PassBy s_pass_by, MR_MarchingCubesByParts *s)
struct MR_MarchingCubesParams MR_MarchingCubesParams
Definition MRMarchingCubes.h:44
MRC_API MR_expected_MR_TriMesh_std_string * MR_marchingCubesAsTriMesh_MR_SimpleVolumeMinMax(const MR_SimpleVolumeMinMax *volume, const MR_MarchingCubesParams *params)
MRC_API MR_MarchingCubesByParts * MR_MarchingCubesByParts_ConstructFromAnother(MR_PassBy s_pass_by, MR_MarchingCubesByParts *s)
MRC_API void MR_MarchingCubesParams_Set_lessInside(MR_MarchingCubesParams *_this, bool value)
struct MR_MarchingCubesByParts MR_MarchingCubesByParts
Definition MRMarchingCubes.h:56
MRC_API MR_MarchingCubesParams_CachingMode * MR_MarchingCubesParams_GetMutable_cachingMode(MR_MarchingCubesParams *_this)
MRC_API MR_expected_MR_Mesh_std_string * MR_marchingCubes_MR_VdbVolume(const MR_VdbVolume *volume, const MR_MarchingCubesParams *params)
MRC_API void MR_MarchingCubesParams_DestroyArray(const MR_MarchingCubesParams *_this)
Destroys a heap-allocated array of MR_MarchingCubesParams. Does nothing if the pointer is null.
MRC_API void MR_MarchingCubesByParts_DestroyArray(const MR_MarchingCubesByParts *_this)
Destroys a heap-allocated array of MR_MarchingCubesByParts. Does nothing if the pointer is null.
MRC_API void MR_MarchingCubesParams_Set_cb(MR_MarchingCubesParams *_this, MR_PassBy value_pass_by, MR_std_function_bool_from_float *value)
MRC_API void MR_MarchingCubesParams_Set_iso(MR_MarchingCubesParams *_this, float value)
MRC_API const MR_std_function_void * MR_MarchingCubesParams_Get_freeVolume(const MR_MarchingCubesParams *_this)
MRC_API MR_MarchingCubesParams * MR_MarchingCubesParams_AssignFromAnother(MR_MarchingCubesParams *_this, MR_PassBy _other_pass_by, MR_MarchingCubesParams *_other)
MRC_API MR_MarchingCubesParams * MR_MarchingCubesParams_OffsetMutablePtr(MR_MarchingCubesParams *ptr, ptrdiff_t i)
MRC_API MR_expected_MR_Mesh_std_string * MR_marchingCubes_MR_SimpleBinaryVolume(const MR_SimpleBinaryVolume *volume, const MR_MarchingCubesParams *params)
MRC_API MR_MarchingCubesParams * MR_MarchingCubesParams_DefaultConstructArray(size_t num_elems)
MRC_API MR_expected_MR_Mesh_std_string * MR_marchingCubes_MR_FunctionVolume(const MR_FunctionVolume *volume, const MR_MarchingCubesParams *params)
MRC_API const MR_std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float * MR_MarchingCubesParams_Get_positioner(const MR_MarchingCubesParams *_this)
MRC_API MR_MarchingCubesParams * MR_MarchingCubesParams_DefaultConstruct(void)
MRC_API const bool * MR_MarchingCubesParams_Get_lessInside(const MR_MarchingCubesParams *_this)
MRC_API int MR_MarchingCubesByParts_nextZ(const MR_MarchingCubesByParts *_this)
MRC_API const MR_MarchingCubesParams * MR_MarchingCubesParams_OffsetPtr(const MR_MarchingCubesParams *ptr, ptrdiff_t i)
MRC_API MR_expected_MR_TriMesh_std_string * MR_marchingCubesAsTriMesh_MR_FunctionVolume(const MR_FunctionVolume *volume, const MR_MarchingCubesParams *params)
MRC_API void MR_MarchingCubesParams_Destroy(const MR_MarchingCubesParams *_this)
Destroys a heap-allocated instance of MR_MarchingCubesParams. Does nothing if the pointer is null.
MRC_API void MR_MarchingCubesParams_Set_cachingMode(MR_MarchingCubesParams *_this, MR_MarchingCubesParams_CachingMode value)
MRC_API MR_Vector_MR_VoxelId_MR_FaceId *const * MR_MarchingCubesParams_Get_outVoxelPerFaceMap(const MR_MarchingCubesParams *_this)
MRC_API const MR_std_function_bool_from_float * MR_MarchingCubesParams_Get_cb(const MR_MarchingCubesParams *_this)
MRC_API MR_MarchingCubesParams * MR_MarchingCubesParams_ConstructFrom(MR_Vector3f origin, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb, float iso, bool lessInside, MR_Vector_MR_VoxelId_MR_FaceId *outVoxelPerFaceMap, MR_PassBy positioner_pass_by, MR_std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float *positioner, int maxVertices, MR_MarchingCubesParams_CachingMode cachingMode, MR_PassBy freeVolume_pass_by, MR_std_function_void *freeVolume)
MRC_API void MR_MarchingCubesParams_Set_freeVolume(MR_MarchingCubesParams *_this, MR_PassBy value_pass_by, MR_std_function_void *value)
MRC_API int * MR_MarchingCubesParams_GetMutable_maxVertices(MR_MarchingCubesParams *_this)
MRC_API MR_std_function_void * MR_MarchingCubesParams_GetMutable_freeVolume(MR_MarchingCubesParams *_this)
MRC_API MR_expected_void_std_string * MR_MarchingCubesByParts_addPart(MR_MarchingCubesByParts *_this, const MR_SimpleVolume *part)
MRC_API MR_expected_MR_TriMesh_std_string * MR_marchingCubesAsTriMesh_MR_SimpleBinaryVolume(const MR_SimpleBinaryVolume *volume, const MR_MarchingCubesParams *params)
MRC_API MR_std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float * MR_MarchingCubesParams_GetMutable_positioner(MR_MarchingCubesParams *_this)
MRC_API MR_expected_MR_Mesh_std_string * MR_marchingCubes_MR_SimpleVolumeMinMax(const MR_SimpleVolumeMinMax *volume, const MR_MarchingCubesParams *params)
MRC_API int MR_MarchingCubesByParts_layersPerBlock(const MR_MarchingCubesByParts *_this)
MRC_API const int * MR_MarchingCubesParams_Get_maxVertices(const MR_MarchingCubesParams *_this)
MRC_API MR_expected_MR_Mesh_std_string * MR_marchingCubes_MR_SimpleVolume(const MR_SimpleVolume *volume, const MR_MarchingCubesParams *params)
MRC_API MR_expected_MR_TriMesh_std_string * MR_marchingCubesAsTriMesh_MR_VdbVolume(const MR_VdbVolume *volume, const MR_MarchingCubesParams *params)
MRC_API bool * MR_MarchingCubesParams_GetMutable_lessInside(MR_MarchingCubesParams *_this)
MRC_API MR_Vector_MR_VoxelId_MR_FaceId ** MR_MarchingCubesParams_GetMutable_outVoxelPerFaceMap(MR_MarchingCubesParams *_this)
MRC_API void MR_MarchingCubesParams_Set_positioner(MR_MarchingCubesParams *_this, MR_PassBy value_pass_by, MR_std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float *value)
MRC_API float * MR_MarchingCubesParams_GetMutable_iso(MR_MarchingCubesParams *_this)
MR_MarchingCubesParams_CachingMode
Definition MRMarchingCubes.h:32
@ MR_MarchingCubesParams_CachingMode_Automatic
Definition MRMarchingCubes.h:35
@ MR_MarchingCubesParams_CachingMode_None
don't cache any data
Definition MRMarchingCubes.h:37
@ MR_MarchingCubesParams_CachingMode_Normal
allocates 2 full slices per parallel thread
Definition MRMarchingCubes.h:39
MRC_API MR_MarchingCubesParams * MR_MarchingCubesParams_ConstructFromAnother(MR_PassBy _other_pass_by, MR_MarchingCubesParams *_other)
MRC_API MR_expected_MR_TriMesh_std_string * MR_MarchingCubesByParts_finalize(MR_MarchingCubesByParts *_this)
MRC_API MR_Vector3f * MR_MarchingCubesParams_GetMutable_origin(MR_MarchingCubesParams *_this)
MRC_API void MR_MarchingCubesParams_Set_outVoxelPerFaceMap(MR_MarchingCubesParams *_this, MR_Vector_MR_VoxelId_MR_FaceId *value)
MRC_API const MR_MarchingCubesParams_CachingMode * MR_MarchingCubesParams_Get_cachingMode(const MR_MarchingCubesParams *_this)
MRC_API void MR_MarchingCubesParams_Set_maxVertices(MR_MarchingCubesParams *_this, int value)
MRC_API MR_expected_MR_TriMesh_std_string * MR_marchingCubesAsTriMesh_MR_SimpleVolume(const MR_SimpleVolume *volume, const MR_MarchingCubesParams *params)
MRC_API void MR_MarchingCubesByParts_Destroy(const MR_MarchingCubesByParts *_this)
Destroys a heap-allocated instance of MR_MarchingCubesByParts. Does nothing if the pointer is null.
MRC_API const float * MR_MarchingCubesParams_Get_iso(const MR_MarchingCubesParams *_this)
MRC_API void MR_MarchingCubesParams_Set_origin(MR_MarchingCubesParams *_this, MR_Vector3f value)
struct MR_Vector_MR_VoxelId_MR_FaceId MR_Vector_MR_VoxelId_MR_FaceId
Definition MRSeparationPoint.h:14
struct MR_std_function_void MR_std_function_void
Definition MRSystem.h:14
MR_PassBy
Definition common.h:23
struct MR_FunctionVolume MR_FunctionVolume
Definition expected_MR_FunctionVolume_std_string.h:13
struct MR_SimpleBinaryVolume MR_SimpleBinaryVolume
Definition expected_MR_SimpleBinaryVolume_std_string.h:13
struct MR_SimpleVolume MR_SimpleVolume
Definition expected_MR_SimpleVolume_std_string.h:13
struct MR_expected_MR_TriMesh_std_string MR_expected_MR_TriMesh_std_string
Definition expected_MR_TriMesh_std_string.h:19
#define MRC_API
Definition exports.h:11
const Vector3i & dims() const
struct MR_std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float MR_std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float
Definition std_function_MR_Vector3f_from_const_MR_Vector3f_ref_const_MR_Vector3f_ref_float_float_float.h:16
Definition MRVector3.h:52
Definition MRVector3.h:34