|
Blender V4.3
|
#include <algorithm>#include "MEM_guardedalloc.h"#include "BLI_math_matrix.h"#include "BLI_math_vector_types.hh"#include "BLI_sort_utils.h"#include "BKE_context.hh"#include "GPU_batch.hh"#include "GPU_immediate.hh"#include "GPU_matrix.hh"#include "GPU_state.hh"#include "BLF_api.hh"#include "UI_interface.hh"#include "UI_resources.hh"#include "WM_api.hh"#include "WM_types.hh"#include "view3d_intern.hh"Go to the source code of this file.
Custom Orientation/Navigation Gizmo for the 3D View | |
Simple gizmo to axis and translate.
| |
| #define | WIDGET_RADIUS ((U.gizmo_size_navigate_v3d / 2.0f) * UI_SCALE_FAC) |
| #define | AXIS_HANDLE_SIZE 0.20f |
| #define | AXIS_LINE_WIDTH ((U.gizmo_size_navigate_v3d / 40.0f) * U.pixelsize) |
| #define | AXIS_RING_WIDTH ((U.gizmo_size_navigate_v3d / 60.0f) * U.pixelsize) |
| #define | AXIS_TEXT_SIZE (WIDGET_RADIUS * AXIS_HANDLE_SIZE * 1.25f) |
| #define | AXIS_DEPTH_BIAS 0.01f |
| static void | gizmo_axis_draw (const bContext *C, wmGizmo *gz) |
| static int | gizmo_axis_test_select (bContext *, wmGizmo *gz, const int mval[2]) |
| static int | gizmo_axis_cursor_get (wmGizmo *) |
| static bool | gizmo_axis_screen_bounds_get (bContext *C, wmGizmo *gz, rcti *r_bounding_box) |
| void | VIEW3D_GT_navigate_rotate (wmGizmoType *gzt) |
| #define AXIS_DEPTH_BIAS 0.01f |
Definition at line 53 of file view3d_gizmo_navigate_type.cc.
Referenced by gizmo_axis_draw().
| #define AXIS_HANDLE_SIZE 0.20f |
Definition at line 46 of file view3d_gizmo_navigate_type.cc.
Referenced by gizmo_axis_draw().
| #define AXIS_LINE_WIDTH ((U.gizmo_size_navigate_v3d / 40.0f) * U.pixelsize) |
Definition at line 48 of file view3d_gizmo_navigate_type.cc.
Referenced by gizmo_axis_draw().
| #define AXIS_RING_WIDTH ((U.gizmo_size_navigate_v3d / 60.0f) * U.pixelsize) |
Definition at line 49 of file view3d_gizmo_navigate_type.cc.
Referenced by gizmo_axis_draw().
| #define AXIS_TEXT_SIZE (WIDGET_RADIUS * AXIS_HANDLE_SIZE * 1.25f) |
Definition at line 50 of file view3d_gizmo_navigate_type.cc.
Referenced by gizmo_axis_draw().
| #define WIDGET_RADIUS ((U.gizmo_size_navigate_v3d / 2.0f) * UI_SCALE_FAC) |
Definition at line 43 of file view3d_gizmo_navigate_type.cc.
Referenced by gizmo_axis_draw(), and gizmo_axis_screen_bounds_get().
Definition at line 344 of file view3d_gizmo_navigate_type.cc.
References WM_CURSOR_DEFAULT.
Referenced by VIEW3D_GT_navigate_rotate().
Definition at line 55 of file view3d_gizmo_navigate_type.cc.
References ARRAY_SIZE, AXIS_DEPTH_BIAS, AXIS_HANDLE_SIZE, AXIS_LINE_WIDTH, AXIS_RING_WIDTH, AXIS_TEXT_SIZE, BLF_ASPECT, BLF_BOLD, BLF_color4fv(), BLF_default(), BLF_disable(), BLF_draw(), BLF_enable(), BLF_position(), BLF_ROTATION, BLF_SHADOW, BLF_size(), BLF_width_and_height(), BLF_WORD_WRAP, BLI_sortutil_cmp_float(), wmGizmo::color_hi, copy_m3_m3(), copy_m3_m4(), copy_m4_m3(), CTX_data_scene(), CTX_wm_view3d(), ED_view3d_background_color_get(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_matrix_mul, GPU_MATRIX_ORTHO_CLIP_NEAR_DEFAULT, GPU_matrix_ortho_set_z(), GPU_matrix_pop(), GPU_matrix_pop_projection(), GPU_matrix_push(), GPU_matrix_push_projection(), GPU_matrix_scale_1f(), GPU_matrix_translate_3fv(), GPU_polygon_smooth(), GPU_PRIM_LINES, GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), wmGizmo::highlight_part, immAttr4fv(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immVertex3fv(), immVertexFormat(), interp_v4_v4v4(), invert_m3(), len_squared_v2(), wmGizmo::matrix_offset, mul_m3_m3m3(), mul_m3_v3(), mul_v3_m3v3(), mul_v3_v3fl(), params, wmGizmo::scale_final, wmGizmo::state, TH_AXIS_X, UI_CNR_ALL, UI_draw_roundbox_4fv(), UI_draw_roundbox_4fv_ex(), UI_draw_roundbox_corner_set(), UI_GetThemeColor3fv(), unit_m4(), v, WIDGET_RADIUS, WM_gizmo_calc_matrix_final_params(), WM_GIZMO_STATE_HIGHLIGHT, rctf::xmin, and zero_v4().
Referenced by VIEW3D_GT_navigate_rotate().
|
static |
Definition at line 349 of file view3d_gizmo_navigate_type.cc.
References CTX_wm_area(), wmGizmo::matrix_basis, WIDGET_RADIUS, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by VIEW3D_GT_navigate_rotate().
Definition at line 291 of file view3d_gizmo_navigate_type.cc.
References float, FLT_MAX, len_squared_v2(), len_squared_v2v2(), wmGizmo::matrix_basis, wmGizmo::matrix_offset, mul_v2_fl(), wmGizmo::scale_final, and sub_v2_v2().
Referenced by VIEW3D_GT_navigate_rotate().
| void VIEW3D_GT_navigate_rotate | ( | wmGizmoType * | gzt | ) |
Definition at line 360 of file view3d_gizmo_navigate_type.cc.
References wmGizmoType::cursor_get, wmGizmoType::draw, gizmo_axis_cursor_get(), gizmo_axis_draw(), gizmo_axis_screen_bounds_get(), gizmo_axis_test_select(), wmGizmoType::idname, wmGizmoType::screen_bounds_get, wmGizmoType::struct_size, and wmGizmoType::test_select.
Referenced by view3d_widgets().