Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_memiter.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BKE_editmesh.h"
#include "BKE_editmesh_cache.h"
#include "BKE_global.h"
#include "BKE_unit.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_view3d_types.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "BLF_api.h"
#include "WM_api.h"
#include "draw_manager_text.h"
#include "intern/bmesh_polygon.h"
Go to the source code of this file.
Classes | |
struct | ViewCachedString |
struct | DRWTextStore |
Typedefs | |
typedef struct ViewCachedString | ViewCachedString |
typedef struct DRWTextStore | DRWTextStore |
Functions | |
DRWTextStore * | DRW_text_cache_create (void) |
void | DRW_text_cache_destroy (struct DRWTextStore *dt) |
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]) |
static void | drw_text_cache_draw_ex (DRWTextStore *dt, ARegion *region) |
void | DRW_text_cache_draw (DRWTextStore *dt, ARegion *region, struct View3D *v3d) |
void | DRW_text_edit_mesh_measure_stats (ARegion *region, View3D *v3d, Object *ob, const UnitSettings *unit) |
typedef struct DRWTextStore DRWTextStore |
typedef struct ViewCachedString ViewCachedString |
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] | ||
) |
Definition at line 73 of file draw_manager_text.c.
References BLI_assert, BLI_memiter_alloc(), DRWTextStore::cache_strings, ViewCachedString::col, col, copy_v3_v3(), copy_v4_v4_uchar(), DRW_TEXT_CACHE_STRING_PTR, ViewCachedString::flag, str, ViewCachedString::str, ViewCachedString::str_len, ViewCachedString::ub, ViewCachedString::vec, ViewCachedString::xoffs, and ViewCachedString::yoffs.
Referenced by camera_view3d_reconstruction(), draw_bone_name(), DRW_text_edit_mesh_measure_stats(), motion_path_cache(), OVERLAY_edit_uv_cache_init(), overlay_gpencil_draw_stroke_color_name(), and OVERLAY_object_name().
DRWTextStore* DRW_text_cache_create | ( | void | ) |
Definition at line 60 of file draw_manager_text.c.
References BLI_memiter_create(), DRWTextStore::cache_strings, and MEM_callocN.
Referenced by DRW_text_cache_ensure().
void DRW_text_cache_destroy | ( | struct DRWTextStore * | dt | ) |
Definition at line 67 of file draw_manager_text.c.
References BLI_memiter_destroy(), DRWTextStore::cache_strings, and MEM_freeN.
Referenced by draw_viewport_engines_data_clear(), and drw_engines_cache_init().
void DRW_text_cache_draw | ( | DRWTextStore * | dt, |
ARegion * | region, | ||
struct View3D * | v3d | ||
) |
Definition at line 150 of file draw_manager_text.c.
References BLI_memiter_iter_init(), BLI_memiter_iter_step(), BLI_rctf_transform_calc_m4_pivot_min(), DRWTextStore::cache_strings, copy_v3_v3(), View2D::cur, drw_text_cache_draw_ex(), DRW_TEXT_CACHE_GLOBALSPACE, DRW_TEXT_CACHE_LOCALCLIP, ED_view3d_project_short_ex(), ViewCachedString::flag, GPU_clip_distances(), IS_CLIPPED, mul_m4_v3(), RegionView3D::persmat, RegionView3D::persmatob, ARegion::regiondata, RV3D_CLIPPING_ENABLED, ViewCachedString::sco, ARegion::v2d, V3D_PROJ_RET_OK, V3D_PROJ_TEST_CLIP_BB, V3D_PROJ_TEST_CLIP_NEAR, V3D_PROJ_TEST_CLIP_WIN, ViewCachedString::vec, ARegion::winx, and ARegion::winy.
Referenced by drw_engines_draw_text().
|
static |
Definition at line 111 of file draw_manager_text.c.
References BLF_color4ubv(), BLF_default(), BLF_draw(), BLF_position(), BLF_size(), BLI_memiter_iter_init(), BLI_memiter_iter_step(), DRWTextStore::cache_strings, ViewCachedString::col, DRW_TEXT_CACHE_STRING_PTR, ViewCachedString::flag, GPU_matrix_identity_set(), GPU_matrix_pop(), GPU_matrix_projection_get, GPU_matrix_projection_set, GPU_matrix_push(), IS_CLIPPED, ViewCachedString::pack, uiFontStyle::points, ViewCachedString::sco, ViewCachedString::str, ViewCachedString::str_len, ViewCachedString::ub, UI_style_get(), uiStyle::widget, wmOrtho2_region_pixelspace(), ViewCachedString::xoffs, and ViewCachedString::yoffs.
Referenced by DRW_text_cache_draw().
void DRW_text_edit_mesh_measure_stats | ( | ARegion * | region, |
View3D * | v3d, | ||
Object * | ob, | ||
const UnitSettings * | unit | ||
) |
Definition at line 211 of file draw_manager_text.c.
References add_v3_v3(), angle(), angle_normalized_v3v3(), angle_v3v3v3(), blender::compositor::area(), area_tri_v3(), B_UNIT_AREA, B_UNIT_LENGTH, BKE_editmesh_cache_ensure_poly_normals(), BKE_unit_value_as_string(), BLI_snprintf_rlen(), BMEditMesh::bm, BM_edge_loop_pair(), BM_EDGES_OF_MESH, BM_elem_flag_test, BM_elem_flag_test_bool, BM_elem_index_get, BM_ELEM_SELECT, BM_FACE, BM_face_calc_center_bounds(), BM_face_calc_center_bounds_vcos(), BM_face_calc_center_median(), BM_face_calc_center_median_vcos(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_LOOPS_OF_FACE, BM_mesh_elem_index_ensure(), BM_VERT, BM_VERTS_OF_MESH, clip_segment_v3_plane_n(), BMVert::co, col, copy_v3_v3(), Object::data, DRW_text_cache_add(), DRW_text_cache_ensure(), DRW_TEXT_CACHE_GLOBALSPACE, ED_view3d_clipping_calc(), Mesh_Runtime::edit_data, View3DOverlay::edit_flag, Mesh::edit_mesh, BMLoop::f, View3D::flag, float(), G, G_TRANSFORM_EDIT, View3D::grid, Object::imat, interp_v3_v3v3(), l, l_b, BMFace::len, len_v3v3(), BMEditMesh::looptris, mid_v3_v3v3(), mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), BMLoop::next, BMFace::no, normalize_v3(), NULL, Object::obmat, View3D::overlay, EditMeshData::polyNos, BMLoop::prev, RAD2DEGF, Mesh::runtime, UnitSettings::scale_length, SCE_SELECT_EDGE, SCE_SELECT_FACE, SCE_SELECT_VERTEX, BMEditMesh::selectmode, UnitSettings::system, UnitSettings::system_rotation, TH_DRAWEXTRA_EDGEANG, TH_DRAWEXTRA_EDGELEN, TH_DRAWEXTRA_FACEANG, TH_DRAWEXTRA_FACEAREA, UI_GetThemeColor3ubv(), USER_UNIT_ROT_RADIANS, BMLoop::v, v, BMEdge::v1, v1, BMEdge::v2, v2, V3D_GLOBAL_STATS, V3D_OVERLAY_EDIT_EDGE_ANG, V3D_OVERLAY_EDIT_EDGE_LEN, V3D_OVERLAY_EDIT_FACE_ANG, V3D_OVERLAY_EDIT_FACE_AREA, V3D_OVERLAY_EDIT_INDICES, EditMeshData::vertexCos, ARegion::winx, ARegion::winy, and zero_v3().
Referenced by OVERLAY_edit_mesh_cache_populate().