Blender  V2.93
openvdb_capi.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  * The Original Code is Copyright (C) 2015 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #ifndef __OPENVDB_CAPI_H__
21 #define __OPENVDB_CAPI_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Level Set Filters */
38 
46 
47 /* Level Set CSG Operations */
53 
60 
61 struct OpenVDBTransform;
62 struct OpenVDBLevelSet;
63 
66  int totquads;
68 
69  float *vertices;
70  unsigned int *quads;
71  unsigned int *triangles;
72 };
73 
75  float *verts;
76  unsigned int *faces;
77  int totfaces;
78  int totverts;
79 
80  float *out_verts;
81  unsigned int *out_faces;
82  unsigned int *out_tris;
88  enum OpenVDBLevelSet_FilterBias filter_width; /* Parameter for gaussian, median, mean*/
89 
90  float voxel_size;
91  float isovalue;
92  float adaptivity;
94 };
95 
96 int OpenVDB_getVersionHex(void);
97 
98 enum {
104 };
105 
109  double voxel_size);
110 
111 struct OpenVDBLevelSet *OpenVDBLevelSet_create(bool initGrid, struct OpenVDBTransform *xform);
112 void OpenVDBLevelSet_free(struct OpenVDBLevelSet *level_set);
114  const float *vertices,
115  const unsigned int *faces,
116  const unsigned int totvertices,
117  const unsigned int totfaces,
118  struct OpenVDBTransform *xform);
120  const float *vertices,
121  const unsigned int *faces,
122  const unsigned int totvertices,
123  const unsigned int totfaces,
124  struct OpenVDBTransform *transform);
125 void OpenVDBLevelSet_volume_to_mesh(struct OpenVDBLevelSet *level_set,
127  const double isovalue,
128  const double adaptivity,
129  const bool relax_disoriented_triangles);
130 void OpenVDBLevelSet_filter(struct OpenVDBLevelSet *level_set,
131  OpenVDBLevelSet_FilterType filter_type,
132  int width,
133  float distance,
136  struct OpenVDBLevelSet *gridA,
137  struct OpenVDBLevelSet *gridB,
138  OpenVDBLevelSet_CSGOperation operation);
139 
141  struct OpenVDBLevelSet *level_setB,
142  char sampler,
143  float isolevel);
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif /* __OPENVDB_CAPI_H__ */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static char faces[256]
OpenVDBLevelSet_CSGOperation
Definition: openvdb_capi.h:48
@ OPENVDB_LEVELSET_CSG_UNION
Definition: openvdb_capi.h:49
@ OPENVDB_LEVELSET_CSG_INTERSECTION
Definition: openvdb_capi.h:51
@ OPENVDB_LEVELSET_CSG_DIFFERENCE
Definition: openvdb_capi.h:50
void OpenVDBLevelSet_mesh_to_level_set_transform(struct OpenVDBLevelSet *level_set, const float *vertices, const unsigned int *faces, const unsigned int totvertices, const unsigned int totfaces, struct OpenVDBTransform *transform)
Definition: openvdb_capi.cc:74
struct OpenVDBLevelSet * OpenVDBLevelSet_transform_and_resample(struct OpenVDBLevelSet *level_setA, struct OpenVDBLevelSet *level_setB, char sampler, float isolevel)
void OpenVDBTransform_free(struct OpenVDBTransform *transform)
Definition: openvdb_capi.cc:49
@ VEC_CONTRAVARIANT_ABSOLUTE
Definition: openvdb_capi.h:103
@ VEC_CONTRAVARIANT_RELATIVE
Definition: openvdb_capi.h:102
@ VEC_COVARIANT
Definition: openvdb_capi.h:100
@ VEC_COVARIANT_NORMALIZE
Definition: openvdb_capi.h:101
@ VEC_INVARIANT
Definition: openvdb_capi.h:99
void OpenVDBTransform_create_linear_transform(struct OpenVDBTransform *transform, double voxel_size)
Definition: openvdb_capi.cc:54
OpenVDBLevelSet_FilterType
Definition: openvdb_capi.h:28
@ OPENVDB_LEVELSET_FILTER_DILATE
Definition: openvdb_capi.h:35
@ OPENVDB_LEVELSET_FILTER_MEAN_CURVATURE
Definition: openvdb_capi.h:33
@ OPENVDB_LEVELSET_FILTER_GAUSSIAN
Definition: openvdb_capi.h:30
@ OPENVDB_LEVELSET_FILTER_ERODE
Definition: openvdb_capi.h:36
@ OPENVDB_LEVELSET_FILTER_LAPLACIAN
Definition: openvdb_capi.h:34
@ OPENVDB_LEVELSET_FILTER_MEAN
Definition: openvdb_capi.h:31
@ OPENVDB_LEVELSET_FILTER_NONE
Definition: openvdb_capi.h:29
@ OPENVDB_LEVELSET_FILTER_MEDIAN
Definition: openvdb_capi.h:32
void OpenVDBLevelSet_free(struct OpenVDBLevelSet *level_set)
Definition: openvdb_capi.cc:59
struct OpenVDBLevelSet * OpenVDBLevelSet_create(bool initGrid, struct OpenVDBTransform *xform)
Definition: openvdb_capi.cc:30
void OpenVDBLevelSet_volume_to_mesh(struct OpenVDBLevelSet *level_set, struct OpenVDBVolumeToMeshData *mesh, const double isovalue, const double adaptivity, const bool relax_disoriented_triangles)
Definition: openvdb_capi.cc:84
void OpenVDBLevelSet_mesh_to_level_set(struct OpenVDBLevelSet *level_set, const float *vertices, const unsigned int *faces, const unsigned int totvertices, const unsigned int totfaces, struct OpenVDBTransform *xform)
Definition: openvdb_capi.cc:64
enum OpenVDBLevelSet_GridSampler OpenVDBLevelSet_Gridsampler
OpenVDBLevelSet_GridSampler
Definition: openvdb_capi.h:54
@ OPENVDB_LEVELSET_GRIDSAMPLER_QUADRATIC
Definition: openvdb_capi.h:58
@ OPENVDB_LEVELSET_GRIDSAMPLER_NONE
Definition: openvdb_capi.h:55
@ OPENVDB_LEVELSET_GRIDSAMPLER_BOX
Definition: openvdb_capi.h:57
@ OPENVDB_LEVELSET_GRIDSAMPLER_POINT
Definition: openvdb_capi.h:56
void OpenVDBLevelSet_filter(struct OpenVDBLevelSet *level_set, OpenVDBLevelSet_FilterType filter_type, int width, float distance, OpenVDBLevelSet_FilterBias bias)
Definition: openvdb_capi.cc:93
OpenVDBLevelSet_FilterBias
Definition: openvdb_capi.h:39
@ OPENVDB_LEVELSET_SECOND_BIAS
Definition: openvdb_capi.h:41
@ OPENVDB_LEVELSET_FIRST_BIAS
Definition: openvdb_capi.h:40
@ OPENVDB_LEVELSET_WENO5_BIAS
Definition: openvdb_capi.h:43
@ OPENVDB_LEVELSET_THIRD_BIAS
Definition: openvdb_capi.h:42
@ OPENVDB_LEVELSET_HJWENO5_BIAS
Definition: openvdb_capi.h:44
int OpenVDB_getVersionHex(void)
Definition: openvdb_capi.cc:25
struct OpenVDBTransform * OpenVDBTransform_create(void)
Definition: openvdb_capi.cc:44
void OpenVDBLevelSet_CSG_operation(struct OpenVDBLevelSet *out, struct OpenVDBLevelSet *gridA, struct OpenVDBLevelSet *gridB, OpenVDBLevelSet_CSGOperation operation)
unsigned int * out_tris
Definition: openvdb_capi.h:82
unsigned int * faces
Definition: openvdb_capi.h:76
enum OpenVDBLevelSet_FilterType filter_bias
Definition: openvdb_capi.h:87
int relax_disoriented_triangles
Definition: openvdb_capi.h:93
enum OpenVDBLevelSet_FilterBias filter_width
Definition: openvdb_capi.h:88
unsigned int * out_faces
Definition: openvdb_capi.h:81
unsigned int * quads
Definition: openvdb_capi.h:70
unsigned int * triangles
Definition: openvdb_capi.h:71
ccl_device_inline float distance(const float2 &a, const float2 &b)