Blender V5.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
10
11#include <optional>
12
13#include "BLI_array.hh"
14#include "BLI_bounds_types.hh"
15#include "BLI_compiler_attrs.hh"
18#include "BLI_span.hh"
19
20namespace blender {
21
22struct BMesh;
23struct BPoint;
24struct Depsgraph;
25struct Lattice;
27struct Main;
28struct MDeformVert;
29struct Mesh;
30struct Object;
31struct Scene;
32
33void BKE_lattice_resize(Lattice *lt, int u_new, int v_new, int w_new, Object *lt_ob);
34Lattice *BKE_lattice_add(Main *bmain, const char *name);
35void BKE_lattice_params_copy(Lattice *lt_dst, const Lattice *lt_src);
36void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du);
37
38void outside_lattice(Lattice *lt);
39
41void BKE_lattice_vert_coords_get(const Lattice *lt, MutableSpan<float3> vert_coordss);
43 Span<float3> vert_coordss,
44 const float4x4 &transform);
46void BKE_lattice_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob);
47
50
51std::optional<Bounds<float3>> BKE_lattice_minmax(const Lattice *lt);
52void BKE_lattice_center_median(Lattice *lt, float cent[3]);
53void BKE_lattice_translate(Lattice *lt, const float offset[3], bool do_keys);
54void BKE_lattice_transform(Lattice *lt, const float mat[4][4], bool do_keys);
55
57
58int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w);
59void BKE_lattice_index_to_uvw(const Lattice *lt, int index, int *r_u, int *r_v, int *r_w);
60int BKE_lattice_index_flip(const Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w);
62 const Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide);
63
64/* **** Depsgraph evaluation **** */
65
66void BKE_lattice_eval_geometry(Depsgraph *depsgraph, Lattice *latt);
67
68/* Draw Cache */
69enum {
72};
73void BKE_lattice_batch_cache_dirty_tag(Lattice *lt, int mode);
74void BKE_lattice_batch_cache_free(Lattice *lt);
75
76extern void (*BKE_lattice_batch_cache_dirty_tag_cb)(Lattice *lt, int mode);
77extern void (*BKE_lattice_batch_cache_free_cb)(Lattice *lt);
78
79/* -------------------------------------------------------------------- */
82
83LatticeDeformData *BKE_lattice_deform_data_create(const Object *oblatt,
85void BKE_lattice_deform_data_eval_co(LatticeDeformData *lattice_deform_data,
86 float co[3],
87 float weight);
88void BKE_lattice_deform_data_destroy(LatticeDeformData *lattice_deform_data);
89
90void BKE_lattice_deform_coords(const Object *ob_lattice,
91 const 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
98void BKE_lattice_deform_coords_with_mesh(const Object *ob_lattice,
99 const 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 Mesh *me_target);
106
108 const 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 const BMesh &bm_target);
115
117
118} // namespace blender
#define ATTR_WARN_UNUSED_RESULT
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
BMesh Iterators.
void BKE_lattice_resize(Lattice *lt, int u_new, int v_new, int w_new, Object *lt_ob)
Definition lattice.cc:277
void BKE_lattice_params_copy(Lattice *lt_dst, const Lattice *lt_src)
Definition lattice.cc:401
void BKE_lattice_bitmap_from_flag(const Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide)
Definition lattice.cc:239
@ BKE_LATTICE_BATCH_DIRTY_ALL
@ BKE_LATTICE_BATCH_DIRTY_SELECT
void BKE_lattice_transform(Lattice *lt, const float mat[4][4], bool do_keys)
Definition lattice.cc:645
std::optional< Bounds< float3 > > BKE_lattice_minmax(const Lattice *lt)
Definition lattice.cc:625
void BKE_lattice_deform_data_eval_co(LatticeDeformData *lattice_deform_data, float co[3], float weight)
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)
ATTR_WARN_UNUSED_RESULT const BMVert * v
MatBase< float, 4, 4 > float4x4
Array< float3 > BKE_lattice_vert_coords_alloc(const Lattice *lt)
Definition lattice.cc:502
void BKE_lattice_eval_geometry(Depsgraph *depsgraph, Lattice *latt)
Definition lattice.cc:711
void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du)
Definition lattice.cc:261
void(*) BKE_lattice_batch_cache_dirty_tag_cb(Lattice *lt, int mode)
Definition lattice.cc:715
void(*) BKE_lattice_batch_cache_free_cb(Lattice *lt)
Definition lattice.cc:716
void BKE_lattice_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
Definition lattice.cc:528
void outside_lattice(Lattice *lt)
Definition lattice.cc:415
int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w)
Definition lattice.cc:199
unsigned char uint8_t
Definition BKE_text.h:79
MDeformVert * BKE_lattice_deform_verts_get(const Object *oblatt)
Definition lattice.cc:583
int BKE_lattice_index_flip(const Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w)
Definition lattice.cc:217
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 BMesh &bm_target)
BPoint * BKE_lattice_active_point_get(Lattice *lt)
Definition lattice.cc:590
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_free(Lattice *lt)
Definition lattice.cc:724
void BKE_lattice_deform_data_destroy(LatticeDeformData *lattice_deform_data)
void BKE_lattice_vert_coords_apply_with_mat4(Lattice *lt, Span< float3 > vert_coordss, const float4x4 &transform)
Definition lattice.cc:510
void BKE_lattice_index_to_uvw(const Lattice *lt, int index, int *r_u, int *r_v, int *r_w)
Definition lattice.cc:207
bool BKE_lattice_is_any_selected(const Lattice *lt)
Definition lattice.cc:693
void BKE_lattice_batch_cache_dirty_tag(Lattice *lt, int mode)
Definition lattice.cc:718
void BKE_lattice_translate(Lattice *lt, const float offset[3], bool do_keys)
Definition lattice.cc:665
void BKE_lattice_center_median(Lattice *lt, float cent[3])
Definition lattice.cc:607
void BKE_lattice_vert_coords_get(const Lattice *lt, MutableSpan< float3 > vert_coordss)
Definition lattice.cc:494
void BKE_lattice_vert_coords_apply(Lattice *lt, Span< float3 > vert_coordss)
Definition lattice.cc:520
LatticeDeformData * BKE_lattice_deform_data_create(const Object *oblatt, const Object *ob) ATTR_WARN_UNUSED_RESULT
Lattice * BKE_lattice_add(Main *bmain, const char *name)
Definition lattice.cc:392