2022-02-10 23:07:11 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2020-03-17 16:27:08 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-03-20 02:19:09 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup bke
|
|
|
|
* \brief Volume data-block rendering and viewport drawing utilities.
|
2020-03-17 16:27:08 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "BLI_sys_types.h"
|
|
|
|
|
|
|
|
#include "DNA_volume_types.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct Volume;
|
|
|
|
struct VolumeGrid;
|
|
|
|
|
|
|
|
/* Dense Voxels */
|
|
|
|
|
2020-10-01 17:58:43 +02:00
|
|
|
typedef struct DenseFloatVolumeGrid {
|
|
|
|
VolumeGridType type;
|
|
|
|
int resolution[3];
|
|
|
|
float texture_to_object[4][4];
|
|
|
|
int channels;
|
|
|
|
float *voxels;
|
|
|
|
} DenseFloatVolumeGrid;
|
|
|
|
|
|
|
|
bool BKE_volume_grid_dense_floats(const struct Volume *volume,
|
2021-04-08 19:00:26 +02:00
|
|
|
const struct VolumeGrid *volume_grid,
|
2020-10-01 17:58:43 +02:00
|
|
|
DenseFloatVolumeGrid *r_dense_grid);
|
|
|
|
void BKE_volume_dense_float_grid_clear(DenseFloatVolumeGrid *dense_grid);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
|
|
|
/* Wireframe */
|
|
|
|
|
|
|
|
typedef void (*BKE_volume_wireframe_cb)(
|
2021-06-07 16:11:05 +02:00
|
|
|
void *userdata, const float (*verts)[3], const int (*edges)[2], int totvert, int totedge);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
|
|
|
void BKE_volume_grid_wireframe(const struct Volume *volume,
|
2021-04-08 19:00:26 +02:00
|
|
|
const struct VolumeGrid *volume_grid,
|
2020-03-17 16:27:08 +01:00
|
|
|
BKE_volume_wireframe_cb cb,
|
|
|
|
void *cb_userdata);
|
|
|
|
|
2020-09-29 12:39:41 +02:00
|
|
|
/* Selection Surface */
|
|
|
|
|
|
|
|
typedef void (*BKE_volume_selection_surface_cb)(
|
|
|
|
void *userdata, float (*verts)[3], int (*tris)[3], int totvert, int tottris);
|
|
|
|
|
|
|
|
void BKE_volume_grid_selection_surface(const struct Volume *volume,
|
2021-04-08 19:00:26 +02:00
|
|
|
const struct VolumeGrid *volume_grid,
|
2020-09-29 12:39:41 +02:00
|
|
|
BKE_volume_selection_surface_cb cb,
|
|
|
|
void *cb_userdata);
|
|
|
|
|
2020-03-16 14:42:56 +01:00
|
|
|
/* Render */
|
|
|
|
|
|
|
|
float BKE_volume_density_scale(const struct Volume *volume, const float matrix[4][4]);
|
|
|
|
|
2020-03-17 16:27:08 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|