Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_sort_utils.h"
#include "BKE_context.h"
#include "GPU_batch.h"
#include "GPU_batch_presets.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "BLF_api.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_screen.h"
#include "view3d_intern.h"
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_DPI_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 *UNUSED(C), wmGizmo *gz, const int mval[2]) |
static int | gizmo_axis_cursor_get (wmGizmo *UNUSED(gz)) |
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 55 of file view3d_gizmo_navigate_type.c.
#define AXIS_HANDLE_SIZE 0.20f |
Definition at line 48 of file view3d_gizmo_navigate_type.c.
#define AXIS_LINE_WIDTH ((U.gizmo_size_navigate_v3d / 40.0f) * U.pixelsize) |
Definition at line 50 of file view3d_gizmo_navigate_type.c.
#define AXIS_RING_WIDTH ((U.gizmo_size_navigate_v3d / 60.0f) * U.pixelsize) |
Definition at line 51 of file view3d_gizmo_navigate_type.c.
#define AXIS_TEXT_SIZE (WIDGET_RADIUS * AXIS_HANDLE_SIZE * 1.25f) |
Definition at line 52 of file view3d_gizmo_navigate_type.c.
#define WIDGET_RADIUS ((U.gizmo_size_navigate_v3d / 2.0f) * UI_DPI_FAC) |
Definition at line 45 of file view3d_gizmo_navigate_type.c.
|
static |
Definition at line 356 of file view3d_gizmo_navigate_type.c.
References WM_CURSOR_DEFAULT.
Referenced by VIEW3D_GT_navigate_rotate().
Definition at line 57 of file view3d_gizmo_navigate_type.c.
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_MATRIX, BLF_position(), BLF_ROTATION, BLF_SHADOW, BLF_size(), BLF_width_and_height(), BLF_WORD_WRAP, BLI_sortutil_cmp_float(), C, 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, id, immAttr4fv(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immVertex3fv(), immVertexFormat(), interp_v4_v4v4(), invert_m3(), len_squared_v2(), wmGizmo::matrix_offset, MIN2, mul_m3_m3m3(), mul_m3_v3(), mul_v3_m3v3(), mul_v3_v3fl(), NULL, 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, and zero_v4().
Referenced by VIEW3D_GT_navigate_rotate().
|
static |
Definition at line 361 of file view3d_gizmo_navigate_type.c.
References blender::compositor::area(), C, 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 303 of file view3d_gizmo_navigate_type.c.
References len_squared_v2(), len_squared_v2v2(), wmGizmo::matrix_basis, wmGizmo::matrix_offset, mul_v2_fl(), wmGizmo::scale_final, sub_v2_v2(), and UNPACK2.
Referenced by VIEW3D_GT_navigate_rotate().
void VIEW3D_GT_navigate_rotate | ( | wmGizmoType * | gzt | ) |
Definition at line 372 of file view3d_gizmo_navigate_type.c.
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().