Blender  V2.93
draw_manager_text.c
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  * Copyright 2016, Blender Foundation.
17  */
18 
23 #include "MEM_guardedalloc.h"
24 
25 #include "BLI_math.h"
26 #include "BLI_memiter.h"
27 #include "BLI_rect.h"
28 #include "BLI_string.h"
29 
30 #include "BKE_editmesh.h"
31 #include "BKE_editmesh_cache.h"
32 #include "BKE_global.h"
33 #include "BKE_unit.h"
34 
35 #include "DNA_mesh_types.h"
36 #include "DNA_object_types.h"
37 #include "DNA_scene_types.h"
38 #include "DNA_screen_types.h"
39 #include "DNA_view3d_types.h"
40 
41 #include "GPU_matrix.h"
42 #include "GPU_state.h"
43 
44 #include "ED_screen.h"
45 #include "ED_view3d.h"
46 
47 #include "UI_interface.h"
48 #include "UI_resources.h"
49 
50 #include "BLF_api.h"
51 #include "WM_api.h"
52 
53 #include "draw_manager_text.h"
54 #include "intern/bmesh_polygon.h"
55 
56 typedef struct ViewCachedString {
57  float vec[3];
58  union {
59  uchar ub[4];
60  int pack;
61  } col;
62  short sco[2];
63  short xoffs, yoffs;
64  short flag;
65  int str_len;
66 
67  /* str is allocated past the end */
68  char str[0];
70 
71 typedef struct DRWTextStore {
74 
76 {
77  DRWTextStore *dt = MEM_callocN(sizeof(*dt), __func__);
78  dt->cache_strings = BLI_memiter_create(1 << 14); /* 16kb */
79  return dt;
80 }
81 
83 {
85  MEM_freeN(dt);
86 }
87 
89  const float co[3],
90  const char *str,
91  const int str_len,
92  short xoffs,
93  short yoffs,
94  short flag,
95  const uchar col[4])
96 {
97  int alloc_len;
98  ViewCachedString *vos;
99 
100  if (flag & DRW_TEXT_CACHE_STRING_PTR) {
101  BLI_assert(str_len == strlen(str));
102  alloc_len = sizeof(void *);
103  }
104  else {
105  alloc_len = str_len + 1;
106  }
107 
108  vos = BLI_memiter_alloc(dt->cache_strings, sizeof(ViewCachedString) + alloc_len);
109 
110  copy_v3_v3(vos->vec, co);
111  copy_v4_v4_uchar(vos->col.ub, col);
112  vos->xoffs = xoffs;
113  vos->yoffs = yoffs;
114  vos->flag = flag;
115  vos->str_len = str_len;
116 
117  /* allocate past the end */
118  if (flag & DRW_TEXT_CACHE_STRING_PTR) {
119  memcpy(vos->str, &str, alloc_len);
120  }
121  else {
122  memcpy(vos->str, str, alloc_len);
123  }
124 }
125 
126 static void drw_text_cache_draw_ex(DRWTextStore *dt, ARegion *region)
127 {
128  ViewCachedString *vos;
130  int col_pack_prev = 0;
131 
132  float original_proj[4][4];
133  GPU_matrix_projection_get(original_proj);
135 
136  GPU_matrix_push();
138 
139  const int font_id = BLF_default();
140 
141  const uiStyle *style = UI_style_get();
142 
143  BLF_size(font_id, style->widget.points * U.pixelsize, U.dpi);
144 
146  while ((vos = BLI_memiter_iter_step(&it))) {
147  if (vos->sco[0] != IS_CLIPPED) {
148  if (col_pack_prev != vos->col.pack) {
149  BLF_color4ubv(font_id, vos->col.ub);
150  col_pack_prev = vos->col.pack;
151  }
152 
153  BLF_position(
154  font_id, (float)(vos->sco[0] + vos->xoffs), (float)(vos->sco[1] + vos->yoffs), 2.0f);
155 
157  font_id,
158  (vos->flag & DRW_TEXT_CACHE_STRING_PTR) ? *((const char **)vos->str) : vos->str,
159  vos->str_len);
160  }
161  }
162 
163  GPU_matrix_pop();
164  GPU_matrix_projection_set(original_proj);
165 }
166 
167 void DRW_text_cache_draw(DRWTextStore *dt, ARegion *region, struct View3D *v3d)
168 {
169  ViewCachedString *vos;
170  if (v3d) {
171  RegionView3D *rv3d = region->regiondata;
172  int tot = 0;
173  /* project first and test */
176  while ((vos = BLI_memiter_iter_step(&it))) {
178  region,
179  (vos->flag & DRW_TEXT_CACHE_GLOBALSPACE) ? rv3d->persmat : rv3d->persmatob,
180  (vos->flag & DRW_TEXT_CACHE_LOCALCLIP) != 0,
181  vos->vec,
182  vos->sco,
184  V3D_PROJ_RET_OK) {
185  tot++;
186  }
187  else {
188  vos->sco[0] = IS_CLIPPED;
189  }
190  }
191 
192  if (tot) {
193  /* Disable clipping for text */
194  const bool rv3d_clipping_enabled = RV3D_CLIPPING_ENABLED(v3d, rv3d);
195  if (rv3d_clipping_enabled) {
197  }
198 
199  drw_text_cache_draw_ex(dt, region);
200 
201  if (rv3d_clipping_enabled) {
203  }
204  }
205  }
206  else {
207  /* project first */
210  View2D *v2d = &region->v2d;
211  float viewmat[4][4];
212  rctf region_space = {0.0f, region->winx, 0.0f, region->winy};
213  BLI_rctf_transform_calc_m4_pivot_min(&v2d->cur, &region_space, viewmat);
214 
215  while ((vos = BLI_memiter_iter_step(&it))) {
216  float p[3];
217  copy_v3_v3(p, vos->vec);
218  mul_m4_v3(viewmat, p);
219 
220  vos->sco[0] = p[0];
221  vos->sco[1] = p[1];
222  }
223 
224  drw_text_cache_draw_ex(dt, region);
225  }
226 }
227 
228 /* Copied from drawobject.c */
230  View3D *v3d,
231  Object *ob,
232  const UnitSettings *unit)
233 {
234  /* Do not use ascii when using non-default unit system, some unit chars are utf8 (micro, square,
235  * etc.). See bug T36090.
236  */
237  struct DRWTextStore *dt = DRW_text_cache_ensure();
238  const short txt_flag = DRW_TEXT_CACHE_GLOBALSPACE | (unit->system ? 0 : DRW_TEXT_CACHE_ASCII);
239  Mesh *me = ob->data;
240  BMEditMesh *em = me->edit_mesh;
241  float v1[3], v2[3], v3[3], vmid[3], fvec[3];
242  char numstr[32]; /* Stores the measurement display text here */
243  size_t numstr_len;
244  const char *conv_float; /* Use a float conversion matching the grid size */
245  uchar col[4] = {0, 0, 0, 255}; /* color of the text to draw */
246  float area; /* area of the face */
247  float grid = unit->system ? unit->scale_length : v3d->grid;
248  const bool do_global = (v3d->flag & V3D_GLOBAL_STATS) != 0;
249  const bool do_moving = (G.moving & G_TRANSFORM_EDIT) != 0;
250  float clip_planes[4][4];
251  /* allow for displaying shape keys and deform mods */
252  BMIter iter;
253  const float(*vert_coords)[3] = (me->runtime.edit_data ? me->runtime.edit_data->vertexCos : NULL);
254  const bool use_coords = (vert_coords != NULL);
255 
256  /* when 2 or more edge-info options are enabled, space apart */
257  short edge_tex_count = 0;
259  edge_tex_count += 1;
260  }
262  edge_tex_count += 1;
263  }
265  edge_tex_count += 1;
266  }
267  const short edge_tex_sep = (short)((edge_tex_count - 1) * 5.0f * U.dpi_fac);
268 
269  /* make the precision of the display value proportionate to the gridsize */
270 
271  if (grid <= 0.01f) {
272  conv_float = "%.6g";
273  }
274  else if (grid <= 0.1f) {
275  conv_float = "%.5g";
276  }
277  else if (grid <= 1.0f) {
278  conv_float = "%.4g";
279  }
280  else if (grid <= 10.0f) {
281  conv_float = "%.3g";
282  }
283  else {
284  conv_float = "%.2g";
285  }
286 
287  if (v3d->overlay.edit_flag &
289  BoundBox bb;
290  const rcti rect = {0, region->winx, 0, region->winy};
291 
292  ED_view3d_clipping_calc(&bb, clip_planes, region, ob, &rect);
293  }
294 
296  BMEdge *eed;
297 
299 
300  if (use_coords) {
302  }
303 
304  BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
305  /* draw selected edges, or edges next to selected verts while dragging */
306  if (BM_elem_flag_test(eed, BM_ELEM_SELECT) ||
307  (do_moving && (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
309  float v1_clip[3], v2_clip[3];
310 
311  if (vert_coords) {
312  copy_v3_v3(v1, vert_coords[BM_elem_index_get(eed->v1)]);
313  copy_v3_v3(v2, vert_coords[BM_elem_index_get(eed->v2)]);
314  }
315  else {
316  copy_v3_v3(v1, eed->v1->co);
317  copy_v3_v3(v2, eed->v2->co);
318  }
319 
320  if (clip_segment_v3_plane_n(v1, v2, clip_planes, 4, v1_clip, v2_clip)) {
321 
322  mid_v3_v3v3(vmid, v1_clip, v2_clip);
323  mul_m4_v3(ob->obmat, vmid);
324 
325  if (do_global) {
326  mul_mat3_m4_v3(ob->obmat, v1);
327  mul_mat3_m4_v3(ob->obmat, v2);
328  }
329 
330  if (unit->system) {
331  numstr_len = BKE_unit_value_as_string(numstr,
332  sizeof(numstr),
333  len_v3v3(v1, v2) * unit->scale_length,
334  3,
336  unit,
337  false);
338  }
339  else {
340  numstr_len = BLI_snprintf_rlen(numstr, sizeof(numstr), conv_float, len_v3v3(v1, v2));
341  }
342 
343  DRW_text_cache_add(dt, vmid, numstr, numstr_len, 0, edge_tex_sep, txt_flag, col);
344  }
345  }
346  }
347  }
348 
350  const bool is_rad = (unit->system_rotation == USER_UNIT_ROT_RADIANS);
351  BMEdge *eed;
352 
354 
355  const float(*poly_normals)[3] = NULL;
356  if (use_coords) {
359  poly_normals = me->runtime.edit_data->polyNos;
360  }
361 
362  BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
363  BMLoop *l_a, *l_b;
364  if (BM_edge_loop_pair(eed, &l_a, &l_b)) {
365  /* Draw selected edges, or edges next to selected verts while dragging. */
366  if (BM_elem_flag_test(eed, BM_ELEM_SELECT) ||
367  (do_moving && (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
369  /* Special case, this is useful to show when verts connected
370  * to this edge via a face are being transformed. */
375  float v1_clip[3], v2_clip[3];
376 
377  if (vert_coords) {
378  copy_v3_v3(v1, vert_coords[BM_elem_index_get(eed->v1)]);
379  copy_v3_v3(v2, vert_coords[BM_elem_index_get(eed->v2)]);
380  }
381  else {
382  copy_v3_v3(v1, eed->v1->co);
383  copy_v3_v3(v2, eed->v2->co);
384  }
385 
386  if (clip_segment_v3_plane_n(v1, v2, clip_planes, 4, v1_clip, v2_clip)) {
387  float no_a[3], no_b[3];
388  float angle;
389 
390  mid_v3_v3v3(vmid, v1_clip, v2_clip);
391  mul_m4_v3(ob->obmat, vmid);
392 
393  if (use_coords) {
394  copy_v3_v3(no_a, poly_normals[BM_elem_index_get(l_a->f)]);
395  copy_v3_v3(no_b, poly_normals[BM_elem_index_get(l_b->f)]);
396  }
397  else {
398  copy_v3_v3(no_a, l_a->f->no);
399  copy_v3_v3(no_b, l_b->f->no);
400  }
401 
402  if (do_global) {
403  mul_mat3_m4_v3(ob->imat, no_a);
404  mul_mat3_m4_v3(ob->imat, no_b);
405  normalize_v3(no_a);
406  normalize_v3(no_b);
407  }
408 
409  angle = angle_normalized_v3v3(no_a, no_b);
410 
411  numstr_len = BLI_snprintf_rlen(numstr,
412  sizeof(numstr),
413  "%.3f%s",
414  (is_rad) ? angle : RAD2DEGF(angle),
415  (is_rad) ? "r" : "°");
416 
417  DRW_text_cache_add(dt, vmid, numstr, numstr_len, 0, -edge_tex_sep, txt_flag, col);
418  }
419  }
420  }
421  }
422  }
423 
425  /* would be nice to use BM_face_calc_area, but that is for 2d faces
426  * so instead add up tessellation triangle areas */
427 
429 
430  int i, n;
431  BMFace *f = NULL;
432  /* Alternative to using `poly_to_tri_count(i, BM_elem_index_get(f->l_first))`
433  * without having to add an extra loop. */
434  int looptri_index = 0;
435  BM_ITER_MESH_INDEX (f, &iter, em->bm, BM_FACES_OF_MESH, i) {
436  const int f_looptri_len = f->len - 2;
438  n = 0;
439  area = 0;
440  zero_v3(vmid);
441  BMLoop *(*l)[3] = &em->looptris[looptri_index];
442  for (int j = 0; j < f_looptri_len; j++) {
443 
444  if (use_coords) {
445  copy_v3_v3(v1, vert_coords[BM_elem_index_get(l[j][0]->v)]);
446  copy_v3_v3(v2, vert_coords[BM_elem_index_get(l[j][1]->v)]);
447  copy_v3_v3(v3, vert_coords[BM_elem_index_get(l[j][2]->v)]);
448  }
449  else {
450  copy_v3_v3(v1, l[j][0]->v->co);
451  copy_v3_v3(v2, l[j][1]->v->co);
452  copy_v3_v3(v3, l[j][2]->v->co);
453  }
454 
455  add_v3_v3(vmid, v1);
456  add_v3_v3(vmid, v2);
457  add_v3_v3(vmid, v3);
458  n += 3;
459 
460  if (do_global) {
461  mul_mat3_m4_v3(ob->obmat, v1);
462  mul_mat3_m4_v3(ob->obmat, v2);
463  mul_mat3_m4_v3(ob->obmat, v3);
464  }
465 
466  area += area_tri_v3(v1, v2, v3);
467  }
468 
469  mul_v3_fl(vmid, 1.0f / (float)n);
470  mul_m4_v3(ob->obmat, vmid);
471 
472  if (unit->system) {
473  numstr_len = BKE_unit_value_as_string(
474  numstr,
475  sizeof(numstr),
476  (double)(area * unit->scale_length * unit->scale_length),
477  3,
478  B_UNIT_AREA,
479  unit,
480  false);
481  }
482  else {
483  numstr_len = BLI_snprintf_rlen(numstr, sizeof(numstr), conv_float, area);
484  }
485 
486  DRW_text_cache_add(dt, vmid, numstr, numstr_len, 0, 0, txt_flag, col);
487  }
488  looptri_index += f_looptri_len;
489  }
490  }
491 
493  BMFace *efa;
494  const bool is_rad = (unit->system_rotation == USER_UNIT_ROT_RADIANS);
495 
497 
498  if (use_coords) {
500  }
501 
502  BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
503  const bool is_face_sel = BM_elem_flag_test_bool(efa, BM_ELEM_SELECT);
504 
505  if (is_face_sel || do_moving) {
506  BMIter liter;
507  BMLoop *loop;
508  bool is_first = true;
509 
510  BM_ITER_ELEM (loop, &liter, efa, BM_LOOPS_OF_FACE) {
511  if (is_face_sel || (do_moving && (BM_elem_flag_test(loop->v, BM_ELEM_SELECT) ||
513  BM_elem_flag_test(loop->next->v, BM_ELEM_SELECT)))) {
514  float v2_local[3];
515 
516  /* lazy init center calc */
517  if (is_first) {
518  if (use_coords) {
519  BM_face_calc_center_bounds_vcos(em->bm, efa, vmid, vert_coords);
520  }
521  else {
522  BM_face_calc_center_bounds(efa, vmid);
523  }
524  is_first = false;
525  }
526  if (use_coords) {
527  copy_v3_v3(v1, vert_coords[BM_elem_index_get(loop->prev->v)]);
528  copy_v3_v3(v2, vert_coords[BM_elem_index_get(loop->v)]);
529  copy_v3_v3(v3, vert_coords[BM_elem_index_get(loop->next->v)]);
530  }
531  else {
532  copy_v3_v3(v1, loop->prev->v->co);
533  copy_v3_v3(v2, loop->v->co);
534  copy_v3_v3(v3, loop->next->v->co);
535  }
536 
537  copy_v3_v3(v2_local, v2);
538 
539  if (do_global) {
540  mul_mat3_m4_v3(ob->obmat, v1);
541  mul_mat3_m4_v3(ob->obmat, v2);
542  mul_mat3_m4_v3(ob->obmat, v3);
543  }
544 
545  float angle = angle_v3v3v3(v1, v2, v3);
546 
547  numstr_len = BLI_snprintf_rlen(numstr,
548  sizeof(numstr),
549  "%.3f%s",
550  (is_rad) ? angle : RAD2DEGF(angle),
551  (is_rad) ? "r" : "°");
552  interp_v3_v3v3(fvec, vmid, v2_local, 0.8f);
553  mul_m4_v3(ob->obmat, fvec);
554  DRW_text_cache_add(dt, fvec, 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 with
562  * --debug */
564  int i;
565 
566  /* For now, reuse an appropriate theme color */
568 
569  if (em->selectmode & SCE_SELECT_VERTEX) {
570  BMVert *v;
571 
572  if (use_coords) {
574  }
575  BM_ITER_MESH_INDEX (v, &iter, em->bm, BM_VERTS_OF_MESH, i) {
577  if (use_coords) {
578  copy_v3_v3(v1, vert_coords[BM_elem_index_get(v)]);
579  }
580  else {
581  copy_v3_v3(v1, v->co);
582  }
583 
584  mul_m4_v3(ob->obmat, v1);
585 
586  numstr_len = BLI_snprintf_rlen(numstr, sizeof(numstr), "%d", i);
587  DRW_text_cache_add(dt, v1, numstr, numstr_len, 0, 0, txt_flag, col);
588  }
589  }
590  }
591 
592  if (em->selectmode & SCE_SELECT_EDGE) {
593  BMEdge *eed;
594 
595  const bool use_edge_tex_sep = (edge_tex_count == 2);
596  const bool use_edge_tex_len = (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_EDGE_LEN);
597 
598  BM_ITER_MESH_INDEX (eed, &iter, em->bm, BM_EDGES_OF_MESH, i) {
599  if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
600  float v1_clip[3], v2_clip[3];
601 
602  if (use_coords) {
603  copy_v3_v3(v1, vert_coords[BM_elem_index_get(eed->v1)]);
604  copy_v3_v3(v2, vert_coords[BM_elem_index_get(eed->v2)]);
605  }
606  else {
607  copy_v3_v3(v1, eed->v1->co);
608  copy_v3_v3(v2, eed->v2->co);
609  }
610 
611  if (clip_segment_v3_plane_n(v1, v2, clip_planes, 4, v1_clip, v2_clip)) {
612  mid_v3_v3v3(vmid, v1_clip, v2_clip);
613  mul_m4_v3(ob->obmat, vmid);
614 
615  numstr_len = BLI_snprintf_rlen(numstr, sizeof(numstr), "%d", i);
617  dt,
618  vmid,
619  numstr,
620  numstr_len,
621  0,
622  (use_edge_tex_sep) ? (use_edge_tex_len) ? -edge_tex_sep : edge_tex_sep : 0,
623  txt_flag,
624  col);
625  }
626  }
627  }
628  }
629 
630  if (em->selectmode & SCE_SELECT_FACE) {
631  BMFace *f;
632 
633  if (use_coords) {
635  }
636 
637  BM_ITER_MESH_INDEX (f, &iter, em->bm, BM_FACES_OF_MESH, i) {
639 
640  if (use_coords) {
641  BM_face_calc_center_median_vcos(em->bm, f, v1, vert_coords);
642  }
643  else {
645  }
646 
647  mul_m4_v3(ob->obmat, v1);
648 
649  numstr_len = BLI_snprintf_rlen(numstr, sizeof(numstr), "%d", i);
650  DRW_text_cache_add(dt, v1, numstr, numstr_len, 0, 0, txt_flag, col);
651  }
652  }
653  }
654  }
655 }
typedef float(TangentPoint)[2]
void BKE_editmesh_cache_ensure_poly_normals(struct BMEditMesh *em, struct EditMeshData *emd)
@ G_TRANSFORM_EDIT
Definition: BKE_global.h:219
@ B_UNIT_AREA
Definition: BKE_unit.h:80
@ B_UNIT_LENGTH
Definition: BKE_unit.h:79
size_t BKE_unit_value_as_string(char *str, int len_max, double value, int prec, int type, const struct UnitSettings *settings, bool pad)
int BLF_default(void)
Definition: blf_default.c:55
void BLF_draw_ascii(int fontid, const char *str, size_t len) ATTR_NONNULL(2)
Definition: blf.c:573
void BLF_draw(int fontid, const char *str, size_t len) ATTR_NONNULL(2)
Definition: blf.c:542
void BLF_size(int fontid, int size, int dpi)
Definition: blf.c:367
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
Definition: blf.c:387
void BLF_position(int fontid, float x, float y, float z)
Definition: blf.c:312
#define BLI_assert(a)
Definition: BLI_assert.h:58
float area_tri_v3(const float v1[3], const float v2[3], const float v3[3])
Definition: math_geom.c:116
bool clip_segment_v3_plane_n(const float p1[3], const float p2[3], const float plane_array[][4], const int plane_tot, float r_p1[3], float r_p2[3])
Definition: math_geom.c:3679
void mul_mat3_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:794
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:732
#define RAD2DEGF(_rad)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
Definition: math_vector.c:49
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
Definition: math_vector.c:270
MINLINE void zero_v3(float r[3])
float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT
Definition: math_vector.c:417
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
Definition: math_vector.c:505
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_memiter_destroy(BLI_memiter *mi) ATTR_NONNULL(1)
Definition: BLI_memiter.c:241
void BLI_memiter_iter_init(BLI_memiter *mi, BLI_memiter_handle *iter) ATTR_NONNULL()
Definition: BLI_memiter.c:299
void * BLI_memiter_iter_step(BLI_memiter_handle *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: BLI_memiter.c:336
BLI_memiter * BLI_memiter_create(unsigned int chunk_size) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
Definition: BLI_memiter.c:137
void * BLI_memiter_alloc(BLI_memiter *mi, unsigned int size) ATTR_RETURNS_NONNULL ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition: BLI_memiter.c:154
void BLI_rctf_transform_calc_m4_pivot_min(const rctf *dst, const rctf *src, float matrix[4][4])
Definition: rct.c:592
size_t BLI_snprintf_rlen(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
unsigned char uchar
Definition: BLI_sys_types.h:86
Object is a sort of wrapper for general info.
#define SCE_SELECT_FACE
#define SCE_SELECT_VERTEX
#define USER_UNIT_ROT_RADIANS
#define SCE_SELECT_EDGE
#define V3D_GLOBAL_STATS
@ V3D_OVERLAY_EDIT_INDICES
@ V3D_OVERLAY_EDIT_FACE_AREA
@ V3D_OVERLAY_EDIT_EDGE_ANG
@ V3D_OVERLAY_EDIT_FACE_ANG
@ V3D_OVERLAY_EDIT_EDGE_LEN
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
@ V3D_PROJ_TEST_CLIP_NEAR
Definition: ED_view3d.h:196
@ V3D_PROJ_TEST_CLIP_WIN
Definition: ED_view3d.h:195
@ V3D_PROJ_TEST_CLIP_BB
Definition: ED_view3d.h:194
@ V3D_PROJ_RET_OK
Definition: ED_view3d.h:176
#define IS_CLIPPED
Definition: ED_view3d.h:172
eV3DProjStatus ED_view3d_project_short_ex(const struct ARegion *region, float perspmat[4][4], const bool is_local, const float co[3], short r_co[2], const eV3DProjTest flag)
void ED_view3d_clipping_calc(struct BoundBox *bb, float planes[4][4], const struct ARegion *region, const struct Object *ob, const struct rcti *rect)
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
void GPU_matrix_pop(void)
Definition: gpu_matrix.cc:142
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:135
#define GPU_matrix_projection_get(x)
Definition: GPU_matrix.h:227
#define GPU_matrix_projection_set(x)
Definition: GPU_matrix.h:225
void GPU_matrix_identity_set(void)
Definition: gpu_matrix.cc:184
void GPU_clip_distances(int distances_enabled)
Definition: gpu_state.cc:131
Read Guarded memory(de)allocation.
const struct uiStyle * UI_style_get(void)
@ TH_DRAWEXTRA_EDGEANG
Definition: UI_resources.h:237
@ TH_DRAWEXTRA_FACEANG
Definition: UI_resources.h:239
@ TH_DRAWEXTRA_EDGELEN
Definition: UI_resources.h:236
@ TH_DRAWEXTRA_FACEAREA
Definition: UI_resources.h:238
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
Definition: resources.c:1350
@ BM_FACE
Definition: bmesh_class.h:386
@ BM_VERT
Definition: bmesh_class.h:383
@ BM_ELEM_SELECT
Definition: bmesh_class.h:471
#define BM_elem_index_get(ele)
Definition: bmesh_inline.h:124
#define BM_elem_flag_test(ele, hflag)
Definition: bmesh_inline.h:26
#define BM_elem_flag_test_bool(ele, hflag)
Definition: bmesh_inline.h:27
#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)
@ BM_EDGES_OF_MESH
@ BM_VERTS_OF_MESH
@ BM_FACES_OF_MESH
@ BM_LOOPS_OF_FACE
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
Definition: bmesh_mesh.c:2152
void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3])
void BM_face_calc_center_median_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], float const (*vertexCos)[3])
void BM_face_calc_center_bounds_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], float const (*vertexCos)[3])
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
Definition: bmesh_query.c:753
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
ATTR_WARN_UNUSED_RESULT const BMVert * v
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
struct DRWTextStore * DRW_text_cache_ensure(void)
void DRW_text_edit_mesh_measure_stats(ARegion *region, View3D *v3d, Object *ob, const UnitSettings *unit)
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])
struct ViewCachedString ViewCachedString
void DRW_text_cache_draw(DRWTextStore *dt, ARegion *region, struct View3D *v3d)
static void drw_text_cache_draw_ex(DRWTextStore *dt, ARegion *region)
DRWTextStore * DRW_text_cache_create(void)
void DRW_text_cache_destroy(struct DRWTextStore *dt)
struct DRWTextStore DRWTextStore
@ DRW_TEXT_CACHE_LOCALCLIP
@ DRW_TEXT_CACHE_GLOBALSPACE
@ DRW_TEXT_CACHE_STRING_PTR
@ DRW_TEXT_CACHE_ASCII
#define str(s)
uint col
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static void area(int d1, int d2, int e1, int e2, float weights[2])
void * regiondata
BMVert * v1
Definition: bmesh_class.h:134
BMVert * v2
Definition: bmesh_class.h:134
short selectmode
Definition: BKE_editmesh.h:72
struct BMLoop *(* looptris)[3]
Definition: BKE_editmesh.h:60
struct BMesh * bm
Definition: BKE_editmesh.h:52
int len
Definition: bmesh_class.h:279
float no[3]
Definition: bmesh_class.h:280
struct BMVert * v
Definition: bmesh_class.h:165
struct BMLoop * prev
Definition: bmesh_class.h:245
struct BMFace * f
Definition: bmesh_class.h:183
struct BMLoop * next
Definition: bmesh_class.h:245
float co[3]
Definition: bmesh_class.h:99
BLI_memiter * cache_strings
float const (* polyNos)[3]
const float(* vertexCos)[3]
struct EditMeshData * edit_data
struct BMEditMesh * edit_mesh
Mesh_Runtime runtime
float imat[4][4]
float obmat[4][4]
void * data
float persmat[4][4]
float persmatob[4][4]
View3DOverlay overlay
union ViewCachedString::@297 col
uiFontStyle widget
#define G(x, y, z)
void wmOrtho2_region_pixelspace(const ARegion *region)
Definition: wm_subwindow.c:120