Blender  V3.3
BKE_lattice.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
4 #pragma once
5 
10 #include "BLI_compiler_attrs.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 struct BMEditMesh;
17 struct BPoint;
18 struct Depsgraph;
19 struct Lattice;
20 struct MDeformVert;
21 struct Main;
22 struct Mesh;
23 struct Object;
24 struct Scene;
25 
26 void BKE_lattice_resize(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
27 struct Lattice *BKE_lattice_add(struct Main *bmain, const char *name);
28 void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du);
29 
30 bool object_deform_mball(struct Object *ob, struct ListBase *dispbase);
31 void outside_lattice(struct Lattice *lt);
32 
33 float (*BKE_lattice_vert_coords_alloc(const struct Lattice *lt, int *r_vert_len))[3];
34 void BKE_lattice_vert_coords_get(const struct Lattice *lt, float (*vert_coords)[3]);
36  const float (*vert_coords)[3],
37  const float mat[4][4]);
38 void BKE_lattice_vert_coords_apply(struct Lattice *lt, const float (*vert_coords)[3]);
40  struct Scene *scene,
41  struct Object *ob);
42 
43 struct MDeformVert *BKE_lattice_deform_verts_get(const struct Object *oblatt);
44 struct BPoint *BKE_lattice_active_point_get(struct Lattice *lt);
45 
46 struct BoundBox *BKE_lattice_boundbox_get(struct Object *ob);
47 void BKE_lattice_minmax_dl(struct Object *ob, struct Lattice *lt, float min[3], float max[3]);
48 void BKE_lattice_minmax(struct Lattice *lt, float min[3], float max[3]);
49 void BKE_lattice_center_median(struct Lattice *lt, float cent[3]);
50 void BKE_lattice_center_bounds(struct Lattice *lt, float cent[3]);
51 void BKE_lattice_translate(struct Lattice *lt, const float offset[3], bool do_keys);
52 void BKE_lattice_transform(struct Lattice *lt, const float mat[4][4], bool do_keys);
53 
54 bool BKE_lattice_is_any_selected(const struct Lattice *lt);
55 
56 int BKE_lattice_index_from_uvw(struct Lattice *lt, int u, int v, int w);
57 void BKE_lattice_index_to_uvw(struct Lattice *lt, int index, int *r_u, int *r_v, int *r_w);
58 int BKE_lattice_index_flip(struct Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w);
60  struct Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide);
61 
62 /* **** Depsgraph evaluation **** */
63 
64 struct Depsgraph;
65 
67 
68 /* Draw Cache */
69 enum {
72 };
73 void BKE_lattice_batch_cache_dirty_tag(struct Lattice *lt, int mode);
74 void BKE_lattice_batch_cache_free(struct Lattice *lt);
75 
76 extern void (*BKE_lattice_batch_cache_dirty_tag_cb)(struct Lattice *lt, int mode);
77 extern void (*BKE_lattice_batch_cache_free_cb)(struct Lattice *lt);
78 
79 /* -------------------------------------------------------------------- */
84  const struct Object *oblatt, const struct Object *ob) ATTR_WARN_UNUSED_RESULT;
85 void BKE_lattice_deform_data_eval_co(struct LatticeDeformData *lattice_deform_data,
86  float co[3],
87  float weight);
88 void BKE_lattice_deform_data_destroy(struct LatticeDeformData *lattice_deform_data);
89 
90 void BKE_lattice_deform_coords(const struct Object *ob_lattice,
91  const struct Object *ob_target,
92  float (*vert_coords)[3],
93  int vert_coords_len,
94  short flag,
95  const char *defgrp_name,
96  float fac);
97 
98 void BKE_lattice_deform_coords_with_mesh(const struct Object *ob_lattice,
99  const struct Object *ob_target,
100  float (*vert_coords)[3],
101  int vert_coords_len,
102  short flag,
103  const char *defgrp_name,
104  float fac,
105  const struct Mesh *me_target);
106 
107 void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice,
108  const struct Object *ob_target,
109  float (*vert_coords)[3],
110  int vert_coords_len,
111  short flag,
112  const char *defgrp_name,
113  float fac,
114  struct BMEditMesh *em_target);
115 
118 #ifdef __cplusplus
119 }
120 #endif
typedef float(TangentPoint)[2]
void BKE_lattice_deform_data_destroy(struct LatticeDeformData *lattice_deform_data)
void BKE_lattice_modifiers_calc(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
Definition: lattice.c:533
@ BKE_LATTICE_BATCH_DIRTY_SELECT
Definition: BKE_lattice.h:71
@ BKE_LATTICE_BATCH_DIRTY_ALL
Definition: BKE_lattice.h:70
void BKE_lattice_bitmap_from_flag(struct Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide)
Definition: lattice.c:245
void BKE_lattice_translate(struct Lattice *lt, const float offset[3], bool do_keys)
Definition: lattice.c:728
void BKE_lattice_center_bounds(struct Lattice *lt, float cent[3])
Definition: lattice.c:696
void BKE_lattice_batch_cache_free(struct Lattice *lt)
Definition: lattice.c:790
float(* BKE_lattice_vert_coords_alloc(const struct Lattice *lt, int *r_vert_len))[3]
void BKE_lattice_center_median(struct Lattice *lt, float cent[3])
Definition: lattice.c:614
void BKE_lattice_deform_coords_with_mesh(const struct Object *ob_lattice, const struct Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac, const struct Mesh *me_target)
struct BPoint * BKE_lattice_active_point_get(struct Lattice *lt)
Definition: lattice.c:597
void BKE_lattice_transform(struct Lattice *lt, const float mat[4][4], bool do_keys)
Definition: lattice.c:706
int BKE_lattice_index_flip(struct Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w)
Definition: lattice.c:223
bool object_deform_mball(struct Object *ob, struct ListBase *dispbase)
Definition: lattice.c:401
void BKE_lattice_batch_cache_dirty_tag(struct Lattice *lt, int mode)
Definition: lattice.c:784
void BKE_lattice_deform_data_eval_co(struct LatticeDeformData *lattice_deform_data, float co[3], float weight)
void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du)
Definition: lattice.c:264
void(* BKE_lattice_batch_cache_free_cb)(struct Lattice *lt)
Definition: lattice.c:782
void BKE_lattice_minmax(struct Lattice *lt, float min[3], float max[3])
Definition: lattice.c:682
struct BoundBox * BKE_lattice_boundbox_get(struct Object *ob)
Definition: lattice.c:652
int BKE_lattice_index_from_uvw(struct Lattice *lt, int u, int v, int w)
Definition: lattice.c:205
void BKE_lattice_deform_coords(const struct Object *ob_lattice, const struct Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac)
void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice, const struct Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac, struct BMEditMesh *em_target)
struct Lattice * BKE_lattice_add(struct Main *bmain, const char *name)
Definition: lattice.c:392
void BKE_lattice_index_to_uvw(struct Lattice *lt, int index, int *r_u, int *r_v, int *r_w)
Definition: lattice.c:213
struct LatticeDeformData * BKE_lattice_deform_data_create(const struct Object *oblatt, const struct Object *ob) ATTR_WARN_UNUSED_RESULT
bool BKE_lattice_is_any_selected(const struct Lattice *lt)
void BKE_lattice_vert_coords_apply(struct Lattice *lt, const float(*vert_coords)[3])
Definition: lattice.c:525
void(* BKE_lattice_batch_cache_dirty_tag_cb)(struct Lattice *lt, int mode)
Definition: lattice.c:781
void BKE_lattice_minmax_dl(struct Object *ob, struct Lattice *lt, float min[3], float max[3])
Definition: lattice.c:659
void BKE_lattice_eval_geometry(struct Depsgraph *depsgraph, struct Lattice *latt)
void BKE_lattice_vert_coords_apply_with_mat4(struct Lattice *lt, const float(*vert_coords)[3], const float mat[4][4])
Definition: lattice.c:515
void BKE_lattice_resize(struct Lattice *lt, int u, int v, int w, struct Object *ltOb)
Definition: lattice.c:280
void BKE_lattice_vert_coords_get(const struct Lattice *lt, float(*vert_coords)[3])
void outside_lattice(struct Lattice *lt)
Definition: lattice.c:421
struct MDeformVert * BKE_lattice_deform_verts_get(const struct Object *oblatt)
Definition: lattice.c:590
#define ATTR_WARN_UNUSED_RESULT
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
Scene scene
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes void
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
static void clear(Message *msg)
Definition: msgfmt.c:278
#define min(a, b)
Definition: sort.c:35
unsigned char uint8_t
Definition: stdint.h:78
Definition: BKE_main.h:121
float max