Blender  V2.93
BKE_mball.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) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 #pragma once
20 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct Base;
30 struct BoundBox;
31 struct Depsgraph;
32 struct Main;
33 struct MetaBall;
34 struct MetaElem;
35 struct Object;
36 struct Scene;
37 
38 struct MetaBall *BKE_mball_add(struct Main *bmain, const char *name);
39 
40 bool BKE_mball_is_any_selected(const struct MetaBall *mb);
41 bool BKE_mball_is_any_selected_multi(struct Base **bases, int bases_len);
42 bool BKE_mball_is_any_unselected(const struct MetaBall *mb);
43 bool BKE_mball_is_basis_for(struct Object *ob1, struct Object *ob2);
44 bool BKE_mball_is_basis(struct Object *ob);
45 struct Object *BKE_mball_basis_find(struct Scene *scene, struct Object *ob);
46 
47 void BKE_mball_texspace_calc(struct Object *ob);
48 struct BoundBox *BKE_mball_boundbox_get(struct Object *ob);
49 float *BKE_mball_make_orco(struct Object *ob, struct ListBase *dispbase);
50 
51 void BKE_mball_properties_copy(struct Scene *scene, struct Object *active_object);
52 
53 bool BKE_mball_minmax_ex(const struct MetaBall *mb,
54  float min[3],
55  float max[3],
56  const float obmat[4][4],
57  const short flag);
58 bool BKE_mball_minmax(const struct MetaBall *mb, float min[3], float max[3]);
59 bool BKE_mball_center_median(const struct MetaBall *mb, float r_cent[3]);
60 bool BKE_mball_center_bounds(const struct MetaBall *mb, float r_cent[3]);
61 void BKE_mball_transform(struct MetaBall *mb, const float mat[4][4], const bool do_props);
62 void BKE_mball_translate(struct MetaBall *mb, const float offset[3]);
63 
64 struct MetaElem *BKE_mball_element_add(struct MetaBall *mb, const int type);
65 
66 int BKE_mball_select_count(const struct MetaBall *mb);
67 int BKE_mball_select_count_multi(struct Base **bases, int bases_len);
68 bool BKE_mball_select_all(struct MetaBall *mb);
69 bool BKE_mball_select_all_multi_ex(struct Base **bases, int bases_len);
70 bool BKE_mball_deselect_all(struct MetaBall *mb);
71 bool BKE_mball_deselect_all_multi_ex(struct Base **bases, int bases_len);
72 bool BKE_mball_select_swap(struct MetaBall *mb);
73 bool BKE_mball_select_swap_multi_ex(struct Base **bases, int bases_len);
74 
75 /* **** Depsgraph evaluation **** */
76 
77 struct Depsgraph;
78 
79 /* Draw Cache */
80 
81 enum {
83 };
84 void BKE_mball_batch_cache_dirty_tag(struct MetaBall *mb, int mode);
85 void BKE_mball_batch_cache_free(struct MetaBall *mb);
86 
87 extern void (*BKE_mball_batch_cache_dirty_tag_cb)(struct MetaBall *mb, int mode);
88 extern void (*BKE_mball_batch_cache_free_cb)(struct MetaBall *mb);
89 
90 #ifdef __cplusplus
91 }
92 #endif
bool BKE_mball_is_basis_for(struct Object *ob1, struct Object *ob2)
Definition: mball.c:406
bool BKE_mball_center_median(const struct MetaBall *mb, float r_cent[3])
bool BKE_mball_minmax(const struct MetaBall *mb, float min[3], float max[3])
struct MetaBall * BKE_mball_add(struct Main *bmain, const char *name)
Definition: mball.c:214
bool BKE_mball_select_swap(struct MetaBall *mb)
Definition: mball.c:720
void BKE_mball_translate(struct MetaBall *mb, const float offset[3])
Definition: mball.c:643
bool BKE_mball_deselect_all(struct MetaBall *mb)
Definition: mball.c:696
struct Object * BKE_mball_basis_find(struct Scene *scene, struct Object *ob)
This function finds the basis MetaBall.
Definition: mball.c:511
int BKE_mball_select_count_multi(struct Base **bases, int bases_len)
Definition: mball.c:662
void BKE_mball_batch_cache_dirty_tag(struct MetaBall *mb, int mode)
Definition: mball.c:748
void(* BKE_mball_batch_cache_dirty_tag_cb)(struct MetaBall *mb, int mode)
Definition: mball.c:745
bool BKE_mball_is_any_selected(const struct MetaBall *mb)
struct MetaElem * BKE_mball_element_add(struct MetaBall *mb, const int type)
Definition: mball.c:225
bool BKE_mball_select_all(struct MetaBall *mb)
Definition: mball.c:673
void(* BKE_mball_batch_cache_free_cb)(struct MetaBall *mb)
Definition: mball.c:746
bool BKE_mball_deselect_all_multi_ex(struct Base **bases, int bases_len)
Definition: mball.c:708
bool BKE_mball_minmax_ex(const struct MetaBall *mb, float min[3], float max[3], const float obmat[4][4], const short flag)
struct BoundBox * BKE_mball_boundbox_get(struct Object *ob)
Definition: mball.c:322
bool BKE_mball_select_swap_multi_ex(struct Base **bases, int bases_len)
Definition: mball.c:730
@ BKE_MBALL_BATCH_DIRTY_ALL
Definition: BKE_mball.h:82
bool BKE_mball_center_bounds(const struct MetaBall *mb, float r_cent[3])
float * BKE_mball_make_orco(struct Object *ob, struct ListBase *dispbase)
Definition: mball.c:339
void BKE_mball_properties_copy(struct Scene *scene, struct Object *active_object)
copy some properties from object to other meta-ball object with same base name
Definition: mball.c:465
bool BKE_mball_is_basis(struct Object *ob)
Test, if ob is a basis meta-ball.
Definition: mball.c:398
void BKE_mball_texspace_calc(struct Object *ob)
Definition: mball.c:278
bool BKE_mball_is_any_selected_multi(struct Base **bases, int bases_len)
Definition: mball.c:436
bool BKE_mball_is_any_unselected(const struct MetaBall *mb)
bool BKE_mball_select_all_multi_ex(struct Base **bases, int bases_len)
Definition: mball.c:685
void BKE_mball_transform(struct MetaBall *mb, const float mat[4][4], const bool do_props)
Definition: mball.c:617
void BKE_mball_batch_cache_free(struct MetaBall *mb)
Definition: mball.c:754
int BKE_mball_select_count(const struct MetaBall *mb)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
_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 type
Scene scene
#define min(a, b)
Definition: sort.c:51
Definition: BKE_main.h:116
float max