100 const bool align_center)
107 alloc_len =
sizeof(
void *);
110 alloc_len = str_len + 1;
127 memcpy(vos->
str, &
str, alloc_len);
130 memcpy(vos->
str,
str, alloc_len);
138 int col_pack_prev = 0;
140 float original_proj[4][4];
150 float outline_dark_color[4] = {0, 0, 0, 0.8f};
151 float outline_light_color[4] = {1, 1, 1, 0.8f};
152 bool outline_is_dark =
true;
157 if (col_pack_prev != vos->
col.
pack) {
160 outline_is_dark = lightness > 96;
173 vos->
xoffs -= short(width / 2.0f);
174 vos->
yoffs -= short(height / 2.0f);
182 outline_is_dark ? outline_dark_color : outline_light_color);
230 if (rv3d_clipping_enabled) {
236 if (rv3d_clipping_enabled) {
281 const char *conv_float;
290 const bool use_coords = !vert_positions.
is_empty();
293 short edge_tex_count = 0;
303 const short edge_tex_sep = short((edge_tex_count - 1) * 5.0f *
UI_SCALE_FAC);
310 else if (grid <= 0.1f) {
313 else if (grid <= 1.0f) {
316 else if (grid <= 10.0f) {
361 0.5 * (v1_clip + v2_clip));
364 v1 = ob->object_to_world().view<3, 3>() * v1;
365 v2 = ob->object_to_world().view<3, 3>() *
v2;
368 const size_t numstr_len =
424 0.5 * (v1_clip + v2_clip));
466 const int f_corner_tris_len = f->
len - 2;
471 const std::array<BMLoop *, 3> *ltri_array = &em->
looptris[tri_index];
472 for (
int j = 0; j < f_corner_tris_len; j++) {
481 v1 = ltri_array[j][0]->v->co;
482 v2 = ltri_array[j][1]->v->co;
483 v3 = ltri_array[j][2]->v->co;
492 v1 = ob->object_to_world().view<3, 3>() * v1;
493 v2 = ob->object_to_world().view<3, 3>() *
v2;
494 v3 = ob->object_to_world().view<3, 3>() * v3;
500 vmid *= 1.0f /
float(n);
503 const size_t numstr_len =
505 numstr,
sizeof(numstr), area, 3,
B_UNIT_AREA, unit,
false) :
510 tri_index += f_corner_tris_len;
527 if (is_face_sel || do_moving) {
530 bool is_first =
true;
564 v1 = ob->object_to_world().view<3, 3>() * v1;
565 v2 = ob->object_to_world().view<3, 3>() *
v2;
566 v3 = ob->object_to_world().view<3, 3>() * v3;
612 const bool use_edge_tex_sep = (edge_tex_count == 2);
631 0.5 * (v1_clip + v2_clip));
640 (use_edge_tex_sep) ? (use_edge_tex_len) ? -edge_tex_sep : edge_tex_sep : 0,
bool BKE_editmesh_eval_orig_map_available(const Mesh &mesh_eval, const Mesh *mesh_orig)
blender::Span< blender::float3 > BKE_mesh_wrapper_face_normals(Mesh *mesh)
blender::Span< blender::float3 > BKE_mesh_wrapper_vert_coords(const Mesh *mesh)
General operations, lookup, etc. for blender objects.
const Mesh * BKE_object_get_editmesh_eval_cage(const Object *object)
const Mesh * BKE_object_get_pre_modified_mesh(const Object *object)
size_t BKE_unit_value_as_string_scaled(char *str, int str_maxncpy, double value, int prec, int type, const UnitSettings &settings, bool pad)
void BLF_enable(int fontid, FontFlags flag)
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
void BLF_shadow_offset(int fontid, int x, int y)
void BLF_default_size(float size)
void BLF_disable(int fontid, FontFlags flag)
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
MINLINE unsigned char srgb_to_grayscale_byte(const unsigned char rgb[3])
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])
float area_tri_v3(const float v1[3], const float v2[3], const float v3[3])
void mul_m4_v3(const float M[4][4], float r[3])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
void BLI_memiter_destroy(BLI_memiter *mi) ATTR_NONNULL(1)
void * BLI_memiter_iter_step(BLI_memiter_handle *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_memiter * BLI_memiter_create(unsigned int chunk_size_min) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
void * BLI_memiter_alloc(BLI_memiter *mi, unsigned int elem_size) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
void BLI_memiter_iter_init(BLI_memiter *mi, BLI_memiter_handle *iter) ATTR_NONNULL(1
void BLI_rctf_transform_calc_m4_pivot_min(const rctf *dst, const rctf *src, float matrix[4][4])
#define SNPRINTF_RLEN(dst, format,...)
#define BLI_STR_UTF8_DEGREE_SIGN
Object is a sort of wrapper for general info.
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
@ V3D_OVERLAY_EDIT_INDICES
@ V3D_OVERLAY_EDIT_FACE_AREA
@ V3D_OVERLAY_EDIT_EDGE_ANG
@ V3D_OVERLAY_EDIT_FACE_ANG
@ V3D_OVERLAY_EDIT_EDGE_LEN
void ED_view3d_clipping_calc(BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect)
@ V3D_PROJ_TEST_CLIP_NEAR
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_identity_set()
#define GPU_matrix_projection_get(x)
#define GPU_matrix_projection_set(x)
void GPU_clip_distances(int distances_enabled)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Read Guarded memory(de)allocation.
const uiStyle * UI_style_get()
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
#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)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3])
void BM_face_calc_center_bounds_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], const blender::Span< blender::float3 > vert_positions)
void BM_face_calc_center_median_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], const blender::Span< blender::float3 > vert_positions)
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)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
ATTR_WARN_UNUSED_RESULT const BMVert * v
constexpr bool is_empty() const
static void drw_text_cache_draw_ex(const DRWTextStore *dt, const ARegion *region)
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)
void DRW_text_cache_draw(const DRWTextStore *dt, const ARegion *region, const View3D *v3d)
DRWTextStore * DRW_text_cache_create()
void DRW_text_edit_mesh_measure_stats(const ARegion *region, const View3D *v3d, const Object *ob, const UnitSettings &unit, DRWTextStore *dt)
void DRW_text_cache_destroy(DRWTextStore *dt)
@ DRW_TEXT_CACHE_LOCALCLIP
@ DRW_TEXT_CACHE_GLOBALSPACE
@ DRW_TEXT_CACHE_STRING_PTR
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
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)
MatBase< float, 4, 4 > float4x4
blender::VecBase< uint8_t, 4 > uchar4
VecBase< float, 3 > float3
blender::Array< std::array< BMLoop *, 3 > > looptris
BLI_memiter * cache_strings
MeshRuntimeHandle * runtime
union ViewCachedString::@212360372223235011205204371145153043271204115255 col
const c_style_mat & ptr() const
void wmOrtho2_region_pixelspace(const ARegion *region)