Blender V4.3
BKE_lattice.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11#include <optional>
12
13#include "BLI_bounds_types.hh"
14#include "BLI_compiler_attrs.h"
16#include "BLI_sys_types.h"
17
18struct BMEditMesh;
19struct BPoint;
20struct Depsgraph;
21struct Lattice;
23struct Main;
24struct MDeformVert;
25struct Mesh;
26struct Object;
27struct Scene;
28
29void BKE_lattice_resize(Lattice *lt, int u_new, int v_new, int w_new, Object *lt_ob);
30Lattice *BKE_lattice_add(Main *bmain, const char *name);
31void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du);
32
33void outside_lattice(Lattice *lt);
34
35float (*BKE_lattice_vert_coords_alloc(const Lattice *lt, int *r_vert_len))[3];
36void BKE_lattice_vert_coords_get(const Lattice *lt, float (*vert_coords)[3]);
38 const float (*vert_coords)[3],
39 const float mat[4][4]);
40void BKE_lattice_vert_coords_apply(Lattice *lt, const float (*vert_coords)[3]);
41void BKE_lattice_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob);
42
45
46std::optional<blender::Bounds<blender::float3>> BKE_lattice_minmax(const Lattice *lt);
47void BKE_lattice_center_median(Lattice *lt, float cent[3]);
48void BKE_lattice_translate(Lattice *lt, const float offset[3], bool do_keys);
49void BKE_lattice_transform(Lattice *lt, const float mat[4][4], bool do_keys);
50
52
53int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w);
54void BKE_lattice_index_to_uvw(const Lattice *lt, int index, int *r_u, int *r_v, int *r_w);
55int BKE_lattice_index_flip(const Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w);
57 const Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide);
58
59/* **** Depsgraph evaluation **** */
60
61void BKE_lattice_eval_geometry(Depsgraph *depsgraph, Lattice *latt);
62
63/* Draw Cache */
64enum {
67};
70
71extern void (*BKE_lattice_batch_cache_dirty_tag_cb)(Lattice *lt, int mode);
73
74/* -------------------------------------------------------------------- */
81 float co[3],
82 float weight);
83void BKE_lattice_deform_data_destroy(LatticeDeformData *lattice_deform_data);
84
85void BKE_lattice_deform_coords(const Object *ob_lattice,
86 const Object *ob_target,
87 float (*vert_coords)[3],
88 int vert_coords_len,
89 short flag,
90 const char *defgrp_name,
91 float fac);
92
93void BKE_lattice_deform_coords_with_mesh(const Object *ob_lattice,
94 const Object *ob_target,
95 float (*vert_coords)[3],
96 int vert_coords_len,
97 short flag,
98 const char *defgrp_name,
99 float fac,
100 const Mesh *me_target);
101
103 const Object *ob_target,
104 float (*vert_coords)[3],
105 int vert_coords_len,
106 short flag,
107 const char *defgrp_name,
108 float fac,
109 const BMEditMesh *em_target);
110
LatticeDeformData * BKE_lattice_deform_data_create(const Object *oblatt, const Object *ob) ATTR_WARN_UNUSED_RESULT
void outside_lattice(Lattice *lt)
Definition lattice.cc:402
void BKE_lattice_transform(Lattice *lt, const float mat[4][4], bool do_keys)
Definition lattice.cc:637
void BKE_lattice_deform_coords(const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac)
void BKE_lattice_batch_cache_dirty_tag(Lattice *lt, int mode)
Definition lattice.cc:710
void BKE_lattice_eval_geometry(Depsgraph *depsgraph, Lattice *latt)
Definition lattice.cc:703
void BKE_lattice_deform_coords_with_mesh(const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac, const Mesh *me_target)
void BKE_lattice_vert_coords_apply(Lattice *lt, const float(*vert_coords)[3])
Definition lattice.cc:508
std::optional< blender::Bounds< blender::float3 > > BKE_lattice_minmax(const Lattice *lt)
Definition lattice.cc:617
void(* BKE_lattice_batch_cache_dirty_tag_cb)(Lattice *lt, int mode)
Definition lattice.cc:707
float(* BKE_lattice_vert_coords_alloc(const Lattice *lt, int *r_vert_len))[3]
Definition lattice.cc:489
void BKE_lattice_vert_coords_apply_with_mat4(Lattice *lt, const float(*vert_coords)[3], const float mat[4][4])
Definition lattice.cc:498
@ BKE_LATTICE_BATCH_DIRTY_SELECT
@ BKE_LATTICE_BATCH_DIRTY_ALL
void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du)
Definition lattice.cc:257
void BKE_lattice_center_median(Lattice *lt, float cent[3])
Definition lattice.cc:599
BPoint * BKE_lattice_active_point_get(Lattice *lt)
Definition lattice.cc:582
void BKE_lattice_bitmap_from_flag(const Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide)
Definition lattice.cc:235
void(* BKE_lattice_batch_cache_free_cb)(Lattice *lt)
Definition lattice.cc:708
void BKE_lattice_deform_data_destroy(LatticeDeformData *lattice_deform_data)
int BKE_lattice_index_flip(const Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w)
Definition lattice.cc:213
void BKE_lattice_index_to_uvw(const Lattice *lt, int index, int *r_u, int *r_v, int *r_w)
Definition lattice.cc:203
Lattice * BKE_lattice_add(Main *bmain, const char *name)
Definition lattice.cc:388
void BKE_lattice_deform_coords_with_editmesh(const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], int vert_coords_len, short flag, const char *defgrp_name, float fac, const BMEditMesh *em_target)
int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w)
Definition lattice.cc:195
void BKE_lattice_translate(Lattice *lt, const float offset[3], bool do_keys)
Definition lattice.cc:657
bool BKE_lattice_is_any_selected(const Lattice *lt)
Definition lattice.cc:685
MDeformVert * BKE_lattice_deform_verts_get(const Object *oblatt)
Definition lattice.cc:575
void BKE_lattice_deform_data_eval_co(LatticeDeformData *lattice_deform_data, float co[3], float weight)
void BKE_lattice_batch_cache_free(Lattice *lt)
Definition lattice.cc:716
void BKE_lattice_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
Definition lattice.cc:516
void BKE_lattice_resize(Lattice *lt, int u_new, int v_new, int w_new, Object *lt_ob)
Definition lattice.cc:273
void BKE_lattice_vert_coords_get(const Lattice *lt, float(*vert_coords)[3])
Definition lattice.cc:481
#define ATTR_WARN_UNUSED_RESULT
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
const Depsgraph * depsgraph
draw_view in_light_buf[] float
static void clear(Message &msg)
Definition msgfmt.cc:218
unsigned char uint8_t
Definition stdint.h:78
uint8_t flag
Definition wm_window.cc:138