76 return MEM_new<DRWTextStore>(__func__);
96 const bool align_center)
121 int col_pack_prev = 0;
123 float original_proj[4][4];
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;
139 if (col_pack_prev != vos.
col.pack) {
142 outline_is_dark = lightness > 96;
143 col_pack_prev = vos.
col.pack;
150 vos.
xoffs -= short(width / 2.0f);
151 vos.
yoffs -= short(height / 2.0f);
159 outline_is_dark ? outline_dark_color : outline_light_color);
203 if (rv3d_clipping_enabled) {
209 if (rv3d_clipping_enabled) {
253 const char *conv_float;
254 uchar4 col = {0, 0, 0, 255};
262 const bool use_coords = !vert_positions.
is_empty();
265 short edge_tex_count = 0;
275 const short edge_tex_sep = short((edge_tex_count - 1) * 5.0f *
UI_SCALE_FAC);
282 else if (grid <= 0.1f) {
285 else if (grid <= 1.0f) {
288 else if (grid <= 10.0f) {
333 0.5 * (v1_clip + v2_clip));
336 v1 = ob->object_to_world().view<3, 3>() * v1;
337 v2 = ob->object_to_world().view<3, 3>() *
v2;
340 const size_t numstr_len = unit.
system ?
401 0.5 * (v1_clip + v2_clip));
443 const int f_corner_tris_len = f->
len - 2;
448 const std::array<BMLoop *, 3> *ltri_array = &em->
looptris[tri_index];
449 for (
int j = 0; j < f_corner_tris_len; j++) {
458 v1 = ltri_array[j][0]->v->co;
459 v2 = ltri_array[j][1]->v->
co;
460 v3 = ltri_array[j][2]->v->co;
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;
477 vmid *= 1.0f /
float(n);
480 const size_t numstr_len =
482 numstr,
sizeof(numstr), area, 3,
B_UNIT_AREA, unit,
false,
true) :
487 tri_index += f_corner_tris_len;
504 if (is_face_sel || do_moving) {
507 bool is_first =
true;
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;
589 const bool use_edge_tex_sep = (edge_tex_count == 2);
608 0.5 * (v1_clip + v2_clip));
617 (use_edge_tex_sep) ? (use_edge_tex_len) ? -edge_tex_sep : edge_tex_sep : 0,
General operations, lookup, etc. for blender objects.
#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)
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.
StringRefNull copy_string(StringRef str)
constexpr bool is_empty() const
constexpr int64_t size() const
constexpr const char * data() const
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()
const Mesh * BKE_object_get_pre_modified_mesh(const Object *object)
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)
VecBase< uint8_t, 4 > uchar4
const Mesh * BKE_object_get_editmesh_eval_cage(const Object *object)
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)
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)
void GPU_clip_distances(int distances_enabled)
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
@ DRW_TEXT_CACHE_LOCALCLIP
Span< float3 > BKE_mesh_wrapper_face_normals(Mesh *mesh)
void DRW_text_cache_destroy(DRWTextStore *dt)
ATTR_WARN_UNUSED_RESULT const BMVert * v
MatBase< float, 4, 4 > float4x4
void BLF_disable(int fontid, FontFlags flag)
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], const Span< float3 > vert_positions)
void mul_m4_v3(const float M[4][4], float r[3])
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 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)
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)
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
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])
void BLI_rctf_transform_calc_m4_pivot_min(const rctf *dst, const rctf *src, float matrix[4][4])
@ V3D_PROJ_TEST_CLIP_NEAR
Span< float3 > BKE_mesh_wrapper_vert_coords(const Mesh *mesh)
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
@ 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()
void BLF_default_size(float size)
void BLF_enable(int fontid, FontFlags flag)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
Array< std::array< BMLoop *, 3 > > looptris
Vector< ViewCachedString > cache_strings
LinearAllocator string_allocator
const c_style_mat & ptr() const
eView3DOverlay_EditFlag edit_flag
union blender::ViewCachedString::@156370331223125104020067304300057256241105014127 col