Blender V5.3
draw_manager_text.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2016 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "MEM_guardedalloc.h"
10
12#include "BLI_math_color_c.hh"
13#include "BLI_math_geom_c.hh"
14#include "BLI_math_matrix.hh"
15#include "BLI_math_matrix_c.hh"
17#include "BLI_math_vector_c.hh"
18#include "BLI_rect.hh"
19#include "BLI_string.hh"
20
21#include "BKE_editmesh.hh"
22#include "BKE_editmesh_cache.hh"
23#include "BKE_global.hh"
24#include "BKE_mesh.hh"
25#include "BKE_mesh_types.hh"
26#include "BKE_mesh_wrapper.hh"
27#include "BKE_object.hh"
28#include "BKE_unit.hh"
29
30#include "DNA_mesh_types.h"
31#include "DNA_object_types.h"
32#include "DNA_scene_types.h"
33#include "DNA_screen_types.h"
34#include "DNA_userdef_types.h"
35#include "DNA_view3d_types.h"
36
37#include "GPU_matrix.hh"
38#include "GPU_state.hh"
39
40#include "ED_view3d.hh"
41
42#include "UI_interface.hh"
43#include "UI_resources.hh"
44
45#include "BLF_api.hh"
46#include "WM_api.hh"
47
48#include "draw_manager_text.hh"
50
51namespace blender {
52
54 float vec[3];
55 union {
56 uchar ub[4];
57 int pack;
58 } col;
59 short sco[2];
60 short xoffs, yoffs;
61 short flag;
62 bool shadow;
64
66};
67
73
75{
76 return MEM_new<DRWTextStore>(__func__);
77}
78
80{
81 if (dt == nullptr) {
82 return;
83 }
84 MEM_delete(dt);
85}
86
88 const float co[3],
89 const char *str,
90 const int str_len,
91 short xoffs,
92 short yoffs,
93 short flag,
94 const uchar col[4],
95 const bool shadow,
96 const bool align_center)
97{
99
100 if (flag & DRW_TEXT_CACHE_STRING_PTR) {
101 BLI_assert(str_len == strlen(str));
102 vos.str = StringRef(str);
103 }
104 else {
105 vos.str = dt->string_allocator.copy_string(StringRef(str, str_len));
106 }
107
108 copy_v3_v3(vos.vec, co);
109 copy_v4_v4_uchar(vos.col.ub, col);
110 vos.xoffs = xoffs;
111 vos.yoffs = yoffs;
112 vos.flag = flag;
113 vos.shadow = shadow;
114 vos.align_center = align_center;
115
116 dt->cache_strings.append(vos);
117}
118
119static void drw_text_cache_draw_ex(DRWTextStore *dt, const ARegion *region)
120{
121 int col_pack_prev = 0;
122
123 float original_proj[4][4];
124 GPU_matrix_projection_get(original_proj);
126
129
130 BLF_default_size(ui::style_get()->widget.points);
131 const int font_id = BLF_set_default();
132
133 float outline_dark_color[4] = {0, 0, 0, 0.8f};
134 float outline_light_color[4] = {1, 1, 1, 0.8f};
135 bool outline_is_dark = true;
136
137 for (ViewCachedString &vos : dt->cache_strings) {
138 if (vos.sco[0] != IS_CLIPPED) {
139 if (col_pack_prev != vos.col.pack) {
140 BLF_color4ubv(font_id, vos.col.ub);
141 const uchar lightness = srgb_to_grayscale_byte(vos.col.ub);
142 outline_is_dark = lightness > 96;
143 col_pack_prev = vos.col.pack;
144 }
145
146 if (vos.align_center) {
147 /* Measure the size of the string, then offset to align to the vertex. */
148 float width, height;
149 BLF_width_and_height(font_id, vos.str.data(), size_t(vos.str.size()), &width, &height);
150 vos.xoffs -= short(width / 2.0f);
151 vos.yoffs -= short(height / 2.0f);
152 }
153
154 const int font_id = BLF_default();
155 if (vos.shadow) {
156 BLF_enable(font_id, BLF_SHADOW);
157 BLF_shadow(font_id,
159 outline_is_dark ? outline_dark_color : outline_light_color);
160 BLF_shadow_offset(font_id, 0, 0);
161 }
162 else {
163 BLF_disable(font_id, BLF_SHADOW);
164 }
165 BLF_draw_default(float(vos.sco[0] + vos.xoffs),
166 float(vos.sco[1] + vos.yoffs),
167 2.0f,
168 vos.str.data(),
169 size_t(vos.str.size()));
170 }
171 }
172
174 GPU_matrix_projection_set(original_proj);
175}
176
177void DRW_text_cache_draw(DRWTextStore *dt, const ARegion *region, const View3D *v3d)
178{
179 if (v3d) {
180 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
181 int tot = 0;
182 /* project first and test */
183 for (ViewCachedString &vos : dt->cache_strings) {
185 region,
186 (vos.flag & DRW_TEXT_CACHE_GLOBALSPACE) ? rv3d->persmat : rv3d->persmatob,
187 (vos.flag & DRW_TEXT_CACHE_LOCALCLIP) != 0,
188 vos.vec,
189 vos.sco,
192 {
193 tot++;
194 }
195 else {
196 vos.sco[0] = IS_CLIPPED;
197 }
198 }
199
200 if (tot) {
201 /* Disable clipping for text */
202 const bool rv3d_clipping_enabled = RV3D_CLIPPING_ENABLED(v3d, rv3d);
203 if (rv3d_clipping_enabled) {
205 }
206
207 drw_text_cache_draw_ex(dt, region);
208
209 if (rv3d_clipping_enabled) {
211 }
212 }
213 }
214 else {
215 /* project first */
216 const View2D *v2d = &region->v2d;
217 float viewmat[4][4];
218 rctf region_space = {0.0f, float(region->winx), 0.0f, float(region->winy)};
219 BLI_rctf_transform_calc_m4_pivot_min(&v2d->cur, &region_space, viewmat);
220
221 for (ViewCachedString &vos : dt->cache_strings) {
222 float p[3];
223 copy_v3_v3(p, vos.vec);
224 mul_m4_v3(viewmat, p);
225
226 vos.sco[0] = p[0];
227 vos.sco[1] = p[1];
228 }
229
230 drw_text_cache_draw_ex(dt, region);
231 }
232}
233
235 const View3D *v3d,
236 const Object *ob,
237 const UnitSettings &unit,
238 DRWTextStore *dt)
239{
240 /* Do not use ASCII when using non-default unit system, some unit chars are UTF8
241 * (micro, square, etc.). See #36090. */
242 const short txt_flag = DRW_TEXT_CACHE_GLOBALSPACE;
244 if (!mesh) {
245 return;
246 }
247 const BMEditMesh *em = mesh->runtime->edit_mesh.get();
249 return;
250 }
251 BMesh *bm = const_cast<BMesh *>(BKE_editmesh_bmesh_get(mesh));
252 char numstr[32]; /* Stores the measurement display text here */
253 const char *conv_float; /* Use a float conversion matching the grid size */
254 uchar4 col = {0, 0, 0, 255}; /* color of the text to draw */
255 const float grid = unit.system ? unit.scale_length : v3d->grid;
256 const bool do_global = (v3d->flag & V3D_GLOBAL_STATS) != 0;
257 const bool do_moving = (G.moving & G_TRANSFORM_EDIT) != 0;
258 float4x4 clip_planes;
259 /* allow for displaying shape keys and deform mods */
260 BMIter iter;
261 const Span<float3> vert_positions = BKE_mesh_wrapper_vert_coords(mesh);
262 const bool use_coords = !vert_positions.is_empty();
263
264 /* when 2 or more edge-info options are enabled, space apart */
265 short edge_tex_count = 0;
267 edge_tex_count += 1;
268 }
270 edge_tex_count += 1;
271 }
273 edge_tex_count += 1;
274 }
275 const short edge_tex_sep = short((edge_tex_count - 1) * 5.0f * UI_SCALE_FAC);
276
277 /* Make the precision of the display value proportionate to the grid-size. */
278
279 if (grid <= 0.01f) {
280 conv_float = "%.6g";
281 }
282 else if (grid <= 0.1f) {
283 conv_float = "%.5g";
284 }
285 else if (grid <= 1.0f) {
286 conv_float = "%.4g";
287 }
288 else if (grid <= 10.0f) {
289 conv_float = "%.3g";
290 }
291 else {
292 conv_float = "%.2g";
293 }
294
295 if (v3d->overlay.edit_flag &
297 {
298 BoundBox bb;
299 const rcti rect = {0, region->winx, 0, region->winy};
300
301 ED_view3d_clipping_calc(&bb, clip_planes.ptr(), region, ob, &rect);
302 }
303
305 BMEdge *eed;
306
308
309 if (use_coords) {
311 }
312
313 BM_ITER_MESH (eed, &iter, bm, BM_EDGES_OF_MESH) {
314 /* draw selected edges, or edges next to selected verts while dragging */
316 (do_moving && (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
318 {
319 float3 v1, v2;
320 float3 v1_clip, v2_clip;
321
322 if (use_coords) {
323 v1 = vert_positions[BM_elem_index_get(eed->v1)];
324 v2 = vert_positions[BM_elem_index_get(eed->v2)];
325 }
326 else {
327 v1 = eed->v1->co;
328 v2 = eed->v2->co;
329 }
330
331 if (clip_segment_v3_plane_n(v1, v2, clip_planes.ptr(), 4, v1_clip, v2_clip)) {
332 const float3 co = math::transform_point(ob->object_to_world(),
333 0.5 * (v1_clip + v2_clip));
334
335 if (do_global) {
336 v1 = ob->object_to_world().view<3, 3>() * v1;
337 v2 = ob->object_to_world().view<3, 3>() * v2;
338 }
339
340 const size_t numstr_len = unit.system ?
342 sizeof(numstr),
343 len_v3v3(v1, v2),
344 3,
346 unit,
347 false,
348 true) :
349 SNPRINTF_RLEN(numstr, conv_float, len_v3v3(v1, v2));
350
351 DRW_text_cache_add(dt, co, numstr, numstr_len, 0, edge_tex_sep, txt_flag, col);
352 }
353 }
354 }
355 }
356
358 const bool is_rad = (unit.system_rotation == USER_UNIT_ROT_RADIANS);
359 BMEdge *eed;
360
362
363 Span<float3> face_normals;
364 if (use_coords) {
366 /* TODO: This is not const correct for wrapper meshes, but it should be okay because
367 * every evaluated object gets its own evaluated cage mesh (they are not shared). */
368 face_normals = BKE_mesh_wrapper_face_normals(const_cast<Mesh *>(mesh));
369 }
370
371 BM_ITER_MESH (eed, &iter, bm, BM_EDGES_OF_MESH) {
372 BMLoop *l_a, *l_b;
373 if (BM_edge_loop_pair(eed, &l_a, &l_b)) {
374 /* Draw selected edges, or edges next to selected verts while dragging. */
376 (do_moving && (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
378 /* Special case, this is useful to show when verts connected
379 * to this edge via a face are being transformed. */
384 {
385 float3 v1, v2;
386 float3 v1_clip, v2_clip;
387
388 if (use_coords) {
389 v1 = vert_positions[BM_elem_index_get(eed->v1)];
390 v2 = vert_positions[BM_elem_index_get(eed->v2)];
391 }
392 else {
393 v1 = eed->v1->co;
394 v2 = eed->v2->co;
395 }
396
397 if (clip_segment_v3_plane_n(v1, v2, clip_planes.ptr(), 4, v1_clip, v2_clip)) {
398 float3 no_a, no_b;
399
400 const float3 co = math::transform_point(ob->object_to_world(),
401 0.5 * (v1_clip + v2_clip));
402
403 if (use_coords) {
404 no_a = face_normals[BM_elem_index_get(l_a->f)];
405 no_b = face_normals[BM_elem_index_get(l_b->f)];
406 }
407 else {
408 no_a = l_a->f->no;
409 no_b = l_b->f->no;
410 }
411
412 if (do_global) {
413 no_a = math::normalize(ob->world_to_object().view<3, 3>() * no_a);
414 no_b = math::normalize(ob->world_to_object().view<3, 3>() * no_b);
415 }
416
417 const float angle = angle_normalized_v3v3(no_a, no_b);
418
419 const size_t numstr_len = SNPRINTF_RLEN(numstr,
420 "%.3f%s",
421 (is_rad) ? angle : RAD2DEGF(angle),
422 (is_rad) ? "r" : BLI_STR_UTF8_DEGREE_SIGN);
423
424 DRW_text_cache_add(dt, co, numstr, numstr_len, 0, -edge_tex_sep, txt_flag, col);
425 }
426 }
427 }
428 }
429 }
430
432 /* would be nice to use BM_face_calc_area, but that is for 2d faces
433 * so instead add up tessellation triangle areas */
434
436
437 int i;
438 BMFace *f = nullptr;
439 /* Alternative to using `poly_to_tri_count(i, BM_elem_index_get(f->l_first))`
440 * without having to add an extra loop. */
441 int tri_index = 0;
442 BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
443 const int f_corner_tris_len = f->len - 2;
445 int n = 0;
446 float area = 0; /* area of the face */
447 float3 vmid(0.0f);
448 const std::array<BMLoop *, 3> *ltri_array = &em->looptris[tri_index];
449 for (int j = 0; j < f_corner_tris_len; j++) {
450 float3 v1, v2, v3;
451
452 if (use_coords) {
453 v1 = vert_positions[BM_elem_index_get(ltri_array[j][0]->v)];
454 v2 = vert_positions[BM_elem_index_get(ltri_array[j][1]->v)];
455 v3 = vert_positions[BM_elem_index_get(ltri_array[j][2]->v)];
456 }
457 else {
458 v1 = ltri_array[j][0]->v->co;
459 v2 = ltri_array[j][1]->v->co;
460 v3 = ltri_array[j][2]->v->co;
461 }
462
463 vmid += v1;
464 vmid += v2;
465 vmid += v3;
466 n += 3;
467
468 if (do_global) {
469 v1 = ob->object_to_world().view<3, 3>() * v1;
470 v2 = ob->object_to_world().view<3, 3>() * v2;
471 v3 = ob->object_to_world().view<3, 3>() * v3;
472 }
473
474 area += area_tri_v3(v1, v2, v3);
475 }
476
477 vmid *= 1.0f / float(n);
478 vmid = math::transform_point(ob->object_to_world(), vmid);
479
480 const size_t numstr_len =
482 numstr, sizeof(numstr), area, 3, B_UNIT_AREA, unit, false, true) :
483 SNPRINTF_RLEN(numstr, conv_float, area);
484
485 DRW_text_cache_add(dt, vmid, numstr, numstr_len, 0, 0, txt_flag, col);
486 }
487 tri_index += f_corner_tris_len;
488 }
489 }
490
492 BMFace *efa;
493 const bool is_rad = (unit.system_rotation == USER_UNIT_ROT_RADIANS);
494
496
497 if (use_coords) {
499 }
500
501 BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
502 const bool is_face_sel = BM_elem_flag_test_bool(efa, BM_ELEM_SELECT);
503
504 if (is_face_sel || do_moving) {
505 BMIter liter;
506 BMLoop *loop;
507 bool is_first = true;
508
509 BM_ITER_ELEM (loop, &liter, efa, BM_LOOPS_OF_FACE) {
510 if (is_face_sel || (do_moving && (BM_elem_flag_test(loop->v, BM_ELEM_SELECT) ||
513 {
514 float3 v1, v2, v3;
515 float3 vmid;
516
517 /* lazy init center calc */
518 if (is_first) {
519 if (use_coords) {
520 BM_face_calc_center_bounds_vcos(bm, efa, vmid, vert_positions);
521 }
522 else {
524 }
525 is_first = false;
526 }
527 if (use_coords) {
528 v1 = vert_positions[BM_elem_index_get(loop->prev->v)];
529 v2 = vert_positions[BM_elem_index_get(loop->v)];
530 v3 = vert_positions[BM_elem_index_get(loop->next->v)];
531 }
532 else {
533 v1 = loop->prev->v->co;
534 v2 = loop->v->co;
535 v3 = loop->next->v->co;
536 }
537
538 const float3 v2_local = v2;
539
540 if (do_global) {
541 v1 = ob->object_to_world().view<3, 3>() * v1;
542 v2 = ob->object_to_world().view<3, 3>() * v2;
543 v3 = ob->object_to_world().view<3, 3>() * v3;
544 }
545
546 const float angle = angle_v3v3v3(v1, v2, v3);
547
548 const size_t numstr_len = SNPRINTF_RLEN(numstr,
549 "%.3f%s",
550 (is_rad) ? angle : RAD2DEGF(angle),
551 (is_rad) ? "r" : BLI_STR_UTF8_DEGREE_SIGN);
552 const float3 co = math::transform_point(ob->object_to_world(),
553 math::interpolate(vmid, v2_local, 0.8f));
554 DRW_text_cache_add(dt, co, numstr, numstr_len, 0, 0, txt_flag, col);
555 }
556 }
557 }
558 }
559 }
560
561 /* This option is for mesh ops and addons debugging; only available in UI if Blender starts
562 * with
563 * --debug */
565 int i;
566
568
569 if (em->selectmode & SCE_SELECT_VERTEX) {
570 BMVert *v;
571
572 if (use_coords) {
574 }
577 const float3 co = math::transform_point(
578 ob->object_to_world(), use_coords ? vert_positions[BM_elem_index_get(v)] : v->co);
579
580 const size_t numstr_len = SNPRINTF_RLEN(numstr, "%d", i);
581 DRW_text_cache_add(dt, co, numstr, numstr_len, 0, 0, txt_flag, col, true, false);
582 }
583 }
584 }
585
586 if (em->selectmode & SCE_SELECT_EDGE) {
587 BMEdge *eed;
588
589 const bool use_edge_tex_sep = (edge_tex_count == 2);
590 const bool use_edge_tex_len = (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_EDGE_LEN);
591
592 BM_ITER_MESH_INDEX (eed, &iter, bm, BM_EDGES_OF_MESH, i) {
594 float3 v1, v2;
595 float3 v1_clip, v2_clip;
596
597 if (use_coords) {
598 v1 = vert_positions[BM_elem_index_get(eed->v1)];
599 v2 = vert_positions[BM_elem_index_get(eed->v2)];
600 }
601 else {
602 v1 = eed->v1->co;
603 v2 = eed->v2->co;
604 }
605
606 if (clip_segment_v3_plane_n(v1, v2, clip_planes.ptr(), 4, v1_clip, v2_clip)) {
607 const float3 co = math::transform_point(ob->object_to_world(),
608 0.5 * (v1_clip + v2_clip));
609
610 const size_t numstr_len = SNPRINTF_RLEN(numstr, "%d", i);
612 dt,
613 co,
614 numstr,
615 numstr_len,
616 0,
617 (use_edge_tex_sep) ? (use_edge_tex_len) ? -edge_tex_sep : edge_tex_sep : 0,
618 txt_flag,
619 col,
620 true,
621 false);
622 }
623 }
624 }
625 }
626
627 if (em->selectmode & SCE_SELECT_FACE) {
628 BMFace *f;
629
630 if (use_coords) {
632 }
633
634 BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
636 float3 co;
637
638 if (use_coords) {
639 BM_face_calc_center_median_vcos(bm, f, co, vert_positions);
640 }
641 else {
643 }
644
645 co = math::transform_point(ob->object_to_world(), co);
646
647 const size_t numstr_len = SNPRINTF_RLEN(numstr, "%d", i);
648 DRW_text_cache_add(dt, co, numstr, numstr_len, 0, 0, txt_flag, col, true, false);
649 }
650 }
651 }
652 }
653}
654
655} // namespace blender
General operations, lookup, etc. for blender objects.
#define RAD2DEGF(_rad)
#define SNPRINTF_RLEN(dst, format,...)
#define BLI_STR_UTF8_DEGREE_SIGN
Object is a sort of wrapper for general info.
#define UI_SCALE_FAC
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
#define IS_CLIPPED
Definition ED_view3d.hh:269
Read Blender memory allocation and freeing.
#define BM_elem_index_get(ele)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_test_bool(ele, hflag)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition btVector3.h:356
StringRefNull copy_string(StringRef str)
constexpr bool is_empty() const
Definition BLI_span.hh:264
constexpr StringRef()
constexpr int64_t size() const
constexpr const char * data() const
#define str(s)
T interpolate(const T &a, const T &b, const FactorT &t)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void get_color_4ubv(int colorid, unsigned char col[4])
void get_color_3ubv(int colorid, unsigned char col[3])
const uiStyle * style_get()
BMesh Iterators.
const Mesh * BKE_object_get_pre_modified_mesh(const Object *object)
Definition object.cc:4444
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
@ V3D_PROJ_RET_OK
Definition ED_view3d.hh:273
VecBase< uint8_t, 4 > uchar4
const Mesh * BKE_object_get_editmesh_eval_cage(const Object *object)
Definition object.cc:4492
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
void wmOrtho2_region_pixelspace(const ARegion *region)
void BLF_shadow_offset(int fontid, int x, int y)
Definition blf.cc:979
MINLINE void copy_v3_v3(float r[3], const float a[3])
static void drw_text_cache_draw_ex(DRWTextStore *dt, const ARegion *region)
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
Definition blf.cc:967
void GPU_clip_distances(int distances_enabled)
Definition gpu_state.cc:116
MINLINE unsigned char srgb_to_grayscale_byte(const unsigned char rgb[3])
void GPU_matrix_identity_set()
float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT
@ DRW_TEXT_CACHE_GLOBALSPACE
@ DRW_TEXT_CACHE_STRING_PTR
Span< float3 > BKE_mesh_wrapper_face_normals(Mesh *mesh)
void DRW_text_cache_destroy(DRWTextStore *dt)
@ TH_DRAWEXTRA_EDGELEN
@ TH_DRAWEXTRA_EDGEANG
@ TH_DRAWEXTRA_FACEANG
@ TH_DRAWEXTRA_FACEAREA
ATTR_WARN_UNUSED_RESULT const BMVert * v
MatBase< float, 4, 4 > float4x4
void BLF_disable(int fontid, FontFlags flag)
Definition blf.cc:331
void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3])
Global G
Definition blender.cc:57
void BM_face_calc_center_median_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], const Span< float3 > vert_positions)
void mul_m4_v3(const float M[4][4], float r[3])
int BLF_set_default()
unsigned char uchar
Definition BKE_text.h:58
void DRW_text_cache_add(DRWTextStore *dt, const float co[3], const char *str, const int str_len, short xoffs, short yoffs, short flag, const uchar col[4], const bool shadow, const bool align_center)
int BLF_default()
void BM_face_calc_center_bounds_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], const Span< float3 > vert_positions)
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
void DRW_text_cache_draw(DRWTextStore *dt, const ARegion *region, const View3D *v3d)
bool BKE_editmesh_eval_orig_map_available(const Mesh &mesh_eval, const Mesh *mesh_orig)
Definition editmesh.cc:93
eV3DProjStatus ED_view3d_project_short_ex(const ARegion *region, float perspmat[4][4], bool is_local, const float co[3], short r_co[2], eV3DProjTest flag)
void GPU_matrix_projection_set(const float m[4][4])
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
size_t BKE_unit_value_as_string_scaled(char *str, int str_maxncpy, double value, int prec, int type, const UnitSettings &settings, bool pad, bool do_unit_suffix)
Definition unit.cc:1944
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
Definition blf.cc:454
void DRW_text_edit_mesh_measure_stats(const ARegion *region, const View3D *v3d, const Object *ob, const UnitSettings &unit, DRWTextStore *dt)
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
void ED_view3d_clipping_calc(BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect)
float area_tri_v3(const float v1[3], const float v2[3], const float v3[3])
Definition math_geom.cc:104
void BLI_rctf_transform_calc_m4_pivot_min(const rctf *dst, const rctf *src, float matrix[4][4])
Definition rct.cc:565
@ V3D_PROJ_TEST_CLIP_NEAR
Definition ED_view3d.hh:298
@ V3D_PROJ_TEST_CLIP_WIN
Definition ED_view3d.hh:297
@ V3D_PROJ_TEST_CLIP_BB
Definition ED_view3d.hh:296
Span< float3 > BKE_mesh_wrapper_vert_coords(const Mesh *mesh)
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
Definition editmesh.cc:65
@ G_TRANSFORM_EDIT
@ V3D_OVERLAY_EDIT_FACE_AREA
@ V3D_OVERLAY_EDIT_EDGE_ANG
@ V3D_OVERLAY_EDIT_EDGE_LEN
@ V3D_OVERLAY_EDIT_FACE_ANG
@ V3D_OVERLAY_EDIT_INDICES
DRWTextStore * DRW_text_cache_create()
VecBase< float, 3 > float3
const float(* GPU_matrix_projection_get(float m[4][4]))[4]
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
bool clip_segment_v3_plane_n(const float p1[3], const float p2[3], const float plane_array[][4], int plane_num, float r_p1[3], float r_p2[3])
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
Definition blf.cc:822
@ B_UNIT_AREA
Definition BKE_unit.hh:167
@ B_UNIT_LENGTH
Definition BKE_unit.hh:166
void GPU_matrix_pop()
void BLF_default_size(float size)
void BLF_enable(int fontid, FontFlags flag)
Definition blf.cc:322
@ BLF_SHADOW
Definition BLF_enums.hh:38
void GPU_matrix_push()
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
Array< std::array< BMLoop *, 3 > > looptris
struct BMLoop * next
struct BMLoop * prev
struct BMVert * v
struct BMFace * f
Vector< ViewCachedString > cache_strings
LinearAllocator string_allocator
const c_style_mat & ptr() const
eView3DOverlay_EditFlag edit_flag
View3DOverlay overlay
union blender::ViewCachedString::@156370331223125104020067304300057256241105014127 col