Blender  V2.93
BKE_volume_render.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #include "BLI_sys_types.h"
25 
26 #include "DNA_volume_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 struct Volume;
33 struct VolumeGrid;
34 
35 /* Dense Voxels */
36 
37 typedef struct DenseFloatVolumeGrid {
39  int resolution[3];
40  float texture_to_object[4][4];
41  int channels;
42  float *voxels;
44 
45 bool BKE_volume_grid_dense_floats(const struct Volume *volume,
46  const struct VolumeGrid *volume_grid,
47  DenseFloatVolumeGrid *r_dense_grid);
49 
50 /* Wireframe */
51 
52 typedef void (*BKE_volume_wireframe_cb)(
53  void *userdata, float (*verts)[3], int (*edges)[2], int totvert, int totedge);
54 
55 void BKE_volume_grid_wireframe(const struct Volume *volume,
56  const struct VolumeGrid *volume_grid,
58  void *cb_userdata);
59 
60 /* Selection Surface */
61 
63  void *userdata, float (*verts)[3], int (*tris)[3], int totvert, int tottris);
64 
65 void BKE_volume_grid_selection_surface(const struct Volume *volume,
66  const struct VolumeGrid *volume_grid,
68  void *cb_userdata);
69 
70 /* Render */
71 
72 float BKE_volume_density_scale(const struct Volume *volume, const float matrix[4][4]);
73 
74 #ifdef __cplusplus
75 }
76 #endif
typedef float(TangentPoint)[2]
VolumeGridType
Definition: BKE_volume.h:98
void(* BKE_volume_wireframe_cb)(void *userdata, float(*verts)[3], int(*edges)[2], int totvert, int totedge)
float BKE_volume_density_scale(const struct Volume *volume, const float matrix[4][4])
void BKE_volume_dense_float_grid_clear(DenseFloatVolumeGrid *dense_grid)
bool BKE_volume_grid_dense_floats(const struct Volume *volume, const struct VolumeGrid *volume_grid, DenseFloatVolumeGrid *r_dense_grid)
void BKE_volume_grid_wireframe(const struct Volume *volume, const struct VolumeGrid *volume_grid, BKE_volume_wireframe_cb cb, void *cb_userdata)
void BKE_volume_grid_selection_surface(const struct Volume *volume, const struct VolumeGrid *volume_grid, BKE_volume_selection_surface_cb cb, void *cb_userdata)
struct DenseFloatVolumeGrid DenseFloatVolumeGrid
void(* BKE_volume_selection_surface_cb)(void *userdata, float(*verts)[3], int(*tris)[3], int totvert, int tottris)
static float verts[][3]
float texture_to_object[4][4]