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#include <stdint.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef struct MR_FunctionVolume MR_FunctionVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
16typedef struct MR_SimpleBinaryVolume MR_SimpleBinaryVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
17typedef struct MR_SimpleVolume MR_SimpleVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
18typedef struct MR_SimpleVolumeMinMax MR_SimpleVolumeMinMax; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
19typedef struct MR_VdbVolume MR_VdbVolume; // Defined in `#include <MRCVoxels/MRVoxelsVolume.h>`.
20typedef struct MR_Vector3i MR_Vector3i; // Defined in `#include <MRCMesh/MRVector3.h>`.
21typedef struct MR_Vector_MR_VoxelId_MR_FaceId MR_Vector_MR_VoxelId_MR_FaceId; // Defined in `#include <MRCMesh/MRVector.h>`.
22typedef struct MR_expected_MR_Mesh_std_string MR_expected_MR_Mesh_std_string; // Defined in `#include <MRCMisc/expected_MR_Mesh_std_string.h>`.
23typedef struct MR_expected_MR_TriMesh_std_string MR_expected_MR_TriMesh_std_string; // Defined in `#include <MRCMisc/expected_MR_TriMesh_std_string.h>`.
24typedef struct MR_expected_void_std_string MR_expected_void_std_string; // Defined in `#include <MRCMisc/expected_void_std_string.h>`.
25typedef 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>`.
26typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float; // Defined in `#include <MRCMisc/std_function_bool_from_float.h>`.
27typedef struct MR_std_function_void MR_std_function_void; // Defined in `#include <MRCMisc/std_function_void.h>`.
28
29
32
36enum // MR_MarchingCubesParams_CachingMode
37{
45};
46
57
63
68
74
80
85
91
97
102
108
114
119
125
131
136
142
150
157
165
171
176
182
187
191
196
202
207
213
217
222
226
229
232
236
239
242
247
248// makes Mesh from SimpleVolume with given settings using Marching Cubes algorithm
255
262
263// makes Mesh from SimpleVolumeMinMax with given settings using Marching Cubes algorithm
270
277
278// makes Mesh from VdbVolume with given settings using Marching Cubes algorithm
285
292
293// makes Mesh from FunctionVolume with given settings using Marching Cubes algorithm
300
307
308// makes Mesh from SimpleBinaryVolume with given settings using Marching Cubes algorithm
315
322
326
329
332
341
344
347
352
357
362
369
375
376#ifdef __cplusplus
377} // extern "C"
378#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:19
struct MR_SimpleVolumeMinMax MR_SimpleVolumeMinMax
Definition MRBox.h:17
struct MR_expected_void_std_string MR_expected_void_std_string
Definition MRCtm.h:20
struct MR_expected_MR_Mesh_std_string MR_expected_MR_Mesh_std_string
Definition MRCtm.h:18
MRC_API MR_MarchingCubesByParts * MR_MarchingCubesByParts_OffsetMutablePtr(MR_MarchingCubesByParts *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 const MR_MarchingCubesByParts * MR_MarchingCubesByParts_OffsetPtr(const MR_MarchingCubesByParts *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 int32_t MR_MarchingCubesByParts_nextZ(const MR_MarchingCubesByParts *_this)
MRC_API MR_std_function_bool_from_float * MR_MarchingCubesParams_GetMutable_cb(MR_MarchingCubesParams *_this)
MRC_API int32_t * MR_MarchingCubesParams_GetMutable_maxVertices(MR_MarchingCubesParams *_this)
MRC_API const MR_Vector3f * MR_MarchingCubesParams_Get_origin(const MR_MarchingCubesParams *_this)
MRC_API MR_MarchingCubesByParts * MR_MarchingCubesByParts_AssignFromAnother(MR_MarchingCubesByParts *_this, MR_PassBy s_pass_by, MR_MarchingCubesByParts *s)
struct MR_MarchingCubesParams MR_MarchingCubesParams
Generated from class MR::MarchingCubesParams.
Definition MRMarchingCubes.h:31
MRC_API const int32_t * MR_MarchingCubesParams_Get_maxVertices(const MR_MarchingCubesParams *_this)
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 MR_MarchingCubesByParts * MR_MarchingCubesByParts_Construct(const MR_Vector3i *dims, const MR_MarchingCubesParams *params, const int32_t *layersPerBlock)
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)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
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 const MR_MarchingCubesParams * MR_MarchingCubesParams_OffsetPtr(const MR_MarchingCubesParams *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_expected_MR_TriMesh_std_string * MR_marchingCubesAsTriMesh_MR_FunctionVolume(const MR_FunctionVolume *volume, const MR_MarchingCubesParams *params)
@ MR_MarchingCubesParams_CachingMode_Automatic
Definition MRMarchingCubes.h:40
@ MR_MarchingCubesParams_CachingMode_None
don't cache any data
Definition MRMarchingCubes.h:42
@ MR_MarchingCubesParams_CachingMode_Normal
allocates 2 full slices per parallel thread
Definition MRMarchingCubes.h:44
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_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, int32_t maxVertices, MR_MarchingCubesParams_CachingMode cachingMode, MR_PassBy freeVolume_pass_by, MR_std_function_void *freeVolume)
int32_t MR_MarchingCubesParams_CachingMode
Definition MRMarchingCubes.h:35
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 void MR_MarchingCubesParams_Set_freeVolume(MR_MarchingCubesParams *_this, MR_PassBy value_pass_by, MR_std_function_void *value)
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)
struct MR_SimpleBinaryVolume MR_SimpleBinaryVolume
Definition MRMarchingCubes.h:16
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 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)
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 MR_expected_MR_TriMesh_std_string * MR_marchingCubesAsTriMesh_MR_SimpleVolume(const MR_SimpleVolume *volume, const MR_MarchingCubesParams *params)
MRC_API void MR_MarchingCubesParams_Set_maxVertices(MR_MarchingCubesParams *_this, int32_t value)
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 int32_t MR_MarchingCubesByParts_layersPerBlock(const MR_MarchingCubesByParts *_this)
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:15
MR_PassBy
Definition common.h:19
struct MR_FunctionVolume MR_FunctionVolume
Definition expected_MR_FunctionVolume_std_string.h:12
struct MR_SimpleVolume MR_SimpleVolume
Definition expected_MR_SimpleVolume_std_string.h:12
struct MR_expected_MR_TriMesh_std_string MR_expected_MR_TriMesh_std_string
Definition expected_MR_TriMesh_std_string.h:18
#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
struct MR_std_function_void MR_std_function_void
Definition std_function_void.h:15
Definition MRVector3.h:51
Definition MRVector3.h:33