|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BKE_context.hh"#include "GPU_immediate.hh"#include "GPU_immediate_util.hh"#include "GPU_matrix.hh"#include "GPU_select.hh"#include "GPU_state.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_gizmo_library.hh"#include "ED_screen.hh"#include "ED_transform.hh"#include "ED_view3d.hh"#include "../gizmo_library_intern.hh"Go to the source code of this file.
Classes | |
| struct | DialInteraction |
| struct | Dial3dParams |
Functions | |
Dial Gizmo API | |
| static void | GIZMO_GT_dial_3d (wmGizmoType *gzt) |
| void | ED_gizmotypes_dial_3d () |
Dial Gizmo | |
Circle shaped gizmo for circular interaction. Currently no separate handling, use with operator only. 3D Gizmo
| |
| #define | DIAL_WIDTH 1.0f |
| #define | DIAL_CLIP_BIAS 0.02 |
| static void | dial_3d_draw_util (const float matrix_final[4][4], const float line_width, const float color[4], const bool select, Dial3dParams *params) |
| static void | dial_geom_draw (const float color[4], const float line_width, const bool select, const float clip_plane_mat[4][4], const float clip_plane[4], const float arc_partial_angle, const float arc_inner_factor, const int draw_options) |
| static void | dial_ghostarc_draw_helpline (const float angle, const float co_outer[3], const float color[4], const float line_width) |
| static void | dial_ghostarc_draw_incremental_angle (const float incremental_angle, const float offset, const float angle_delta) |
| static void | dial_ghostarc_draw (const float angle_ofs, float angle_delta, const float arc_inner_factor, const float color[4]) |
| static void | dial_ghostarc_get_angles (const wmGizmo *gz, const wmEvent *event, const ARegion *region, const float mat[4][4], const float co_outer[3], float *r_start, float *r_delta) |
| static void | dial_ghostarc_draw_with_helplines (const float angle_ofs, const float angle_delta, const float arc_inner_factor, const float color_helpline[4], const int draw_options) |
| static void | dial_draw_intern (const bContext *C, wmGizmo *gz, const bool select, const bool highlight, float clip_plane[4]) |
| static void | gizmo_dial_draw_select (const bContext *C, wmGizmo *gz, int select_id) |
| static void | gizmo_dial_draw (const bContext *C, wmGizmo *gz) |
| static int | gizmo_dial_modal (bContext *C, wmGizmo *gz, const wmEvent *event, eWM_GizmoFlagTweak tweak_flag) |
| static void | gizmo_dial_exit (bContext *C, wmGizmo *gz, const bool cancel) |
| static void | gizmo_dial_setup (wmGizmo *gz) |
| static int | gizmo_dial_invoke (bContext *, wmGizmo *gz, const wmEvent *event) |
| #define DIAL_CLIP_BIAS 0.02 |
Definition at line 77 of file dial3d_gizmo.cc.
Referenced by gizmo_dial_draw(), and gizmo_dial_draw_select().
| #define DIAL_WIDTH 1.0f |
Definition at line 74 of file dial3d_gizmo.cc.
Referenced by dial_ghostarc_draw(), dial_ghostarc_draw_incremental_angle(), dial_ghostarc_draw_with_helplines(), and gizmo_dial_modal().
|
static |
Definition at line 623 of file dial3d_gizmo.cc.
References dial_geom_draw(), dial_ghostarc_draw_incremental_angle(), dial_ghostarc_draw_with_helplines(), ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR, ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE, GPU_matrix_mul, GPU_matrix_pop(), GPU_matrix_push(), GPU_polygon_smooth(), M_PI, params, and select().
Referenced by dial_draw_intern().
|
static |
Definition at line 404 of file dial3d_gizmo.cc.
References DialInteraction::angle_delta, DialInteraction::angle_increment, DialInteraction::angle_ofs, BLI_assert, CTX_wm_area(), dial_3d_draw_util(), ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE, wmGizmo::flag, gizmo_color_get(), wmGizmo::interaction_data, wmGizmo::line_width, DialInteraction::output, params, wmGizmo::ptr, RNA_enum_get(), RNA_float_get(), select(), SPACE_VIEW3D, wmGizmo::state, WM_gizmo_calc_matrix_final(), WM_GIZMO_DRAW_VALUE, WM_GIZMO_STATE_MODAL, WM_gizmo_target_property_find(), WM_gizmo_target_property_float_get(), and WM_gizmo_target_property_is_valid().
Referenced by gizmo_dial_draw(), and gizmo_dial_draw_select().
|
static |
Definition at line 95 of file dial3d_gizmo.cc.
References BLI_assert, DIAL_RESOLUTION, ED_GIZMO_DIAL_DRAW_FLAG_FILL, ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR, GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_draw_circle_fill_3d(), imm_draw_circle_partial_wire_3d(), imm_draw_circle_wire_3d(), imm_draw_disk_partial_fill_3d(), immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immUniform4fv(), immUniformColor4fv(), immUniformMatrix4fv(), immVertexFormat(), M_PI, pos, RAD2DEGF, select(), UNUSED_VARS, wm_gizmo_geom_data_dial, and wm_gizmo_geometryinfo_draw().
Referenced by dial_3d_draw_util().
|
static |
Definition at line 259 of file dial3d_gizmo.cc.
References copy_v4_v4(), DIAL_RESOLUTION, DIAL_WIDTH, fabsf, float, floorf, fmod(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), imm_draw_disk_partial_fill_2d(), immBindBuiltinProgram(), immUnbindProgram(), immUniformColor4f(), immUniformColor4fv(), immVertexFormat(), int, M_PI, pos, RAD2DEGF, and UNPACK3.
Referenced by dial_ghostarc_draw_with_helplines().
|
static |
Draws a line from (0, 0, 0) to co_outer, at angle.
Definition at line 185 of file dial3d_gizmo.cc.
References GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_rotate_3f(), GPU_PRIM_LINE_STRIP, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immUniformColor4fv(), immVertex3f(), immVertex3fv(), immVertexFormat(), pos, and RAD2DEGF.
Referenced by dial_ghostarc_draw_with_helplines().
|
static |
Draws segments to indicate the position of each increment.
Definition at line 217 of file dial3d_gizmo.cc.
References cosf, DIAL_WIDTH, fmodf, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immUniformColor3f(), immVertex3fv(), immVertexFormat(), M_PI, mul_v2_fl(), pos, sinf, and v.
Referenced by dial_3d_draw_util().
|
static |
Definition at line 388 of file dial3d_gizmo.cc.
References dial_ghostarc_draw(), dial_ghostarc_draw_helpline(), DIAL_WIDTH, and ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE.
Referenced by dial_3d_draw_util().
|
static |
Definition at line 310 of file dial3d_gizmo.cc.
References DialInteraction::angle, angle_signed_on_axis_v3v3_v3(), angle_wrap_rad(), double(), ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y, ED_view3d_global_to_vector(), ED_view3d_win_to_3d_on_plane(), fabsf, float, fmod(), DialInteraction::init, wmGizmo::interaction_data, M_PI, M_PI_2, wmGizmo::matrix_basis, mul_v3_project_m4_v3(), DialInteraction::mval, normalize_v3_v3(), plane_from_point_normal_v3(), DialInteraction::prev, wmGizmo::ptr, RNA_boolean_get(), RNA_enum_get(), DialInteraction::rotations, sub_v3_v3(), wrap_angle(), and wmEvent::xy.
Referenced by gizmo_dial_modal().
| void ED_gizmotypes_dial_3d | ( | ) |
Definition at line 729 of file dial3d_gizmo.cc.
References GIZMO_GT_dial_3d(), and WM_gizmotype_append().
Referenced by ED_spacetypes_init().
Definition at line 476 of file dial3d_gizmo.cc.
References copy_v3_v3(), CTX_wm_region(), DIAL_CLIP_BIAS, dial_draw_intern(), dot_v3v3(), ED_GIZMO_DIAL_DRAW_FLAG_CLIP, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, wmGizmo::matrix_basis, wmGizmo::ptr, RNA_enum_get(), wmGizmo::state, RegionView3D::viewinv, WM_GIZMO_STATE_HIGHLIGHT, and WM_GIZMO_STATE_MODAL.
Referenced by GIZMO_GT_dial_3d().
Definition at line 457 of file dial3d_gizmo.cc.
References copy_v3_v3(), CTX_wm_region(), DIAL_CLIP_BIAS, dial_draw_intern(), dot_v3v3(), ED_GIZMO_DIAL_DRAW_FLAG_CLIP, GPU_select_load_id(), wmGizmo::matrix_basis, wmGizmo::ptr, RNA_enum_get(), and RegionView3D::viewinv.
Referenced by GIZMO_GT_dial_3d().
Definition at line 547 of file dial3d_gizmo.cc.
References DialInteraction::has_drag, DialInteraction::init, wmGizmo::interaction_data, DialInteraction::prop_angle, wmGizmo::ptr, RNA_property_float_get(), RNA_property_is_set(), RNA_struct_find_property(), WM_gizmo_target_property_anim_autokey(), WM_gizmo_target_property_find(), WM_gizmo_target_property_float_set(), and WM_gizmo_target_property_is_valid().
Referenced by GIZMO_GT_dial_3d().
Definition at line 596 of file dial3d_gizmo.cc.
References wmGizmo::custom_modal, DialInteraction::init, wmGizmo::interaction_data, MEM_callocN, DialInteraction::mval, OPERATOR_RUNNING_MODAL, DialInteraction::prop_angle, WM_gizmo_target_property_find(), WM_gizmo_target_property_float_get(), and WM_gizmo_target_property_is_valid().
Referenced by GIZMO_GT_dial_3d().
|
static |
Definition at line 500 of file dial3d_gizmo.cc.
References DialInteraction::angle_delta, DialInteraction::angle_increment, DialInteraction::angle_ofs, CTX_wm_region(), dial_ghostarc_get_angles(), DIAL_WIDTH, float, DialInteraction::has_drag, DialInteraction::init, wmGizmo::interaction_data, wmGizmo::matrix_basis, MOUSEMOVE, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, DialInteraction::output, DialInteraction::prev, DialInteraction::prop_angle, wmGizmo::ptr, RNA_float_get(), DialInteraction::tweak_flag, wmEvent::type, WM_gizmo_target_property_find(), WM_gizmo_target_property_float_set(), WM_gizmo_target_property_is_valid(), WM_GIZMO_TWEAK_PRECISE, and WM_GIZMO_TWEAK_SNAP.
Referenced by GIZMO_GT_dial_3d().
|
static |
Definition at line 588 of file dial3d_gizmo.cc.
References copy_v3_v3(), and wmGizmo::matrix_basis.
Referenced by GIZMO_GT_dial_3d().
|
static |
Definition at line 669 of file dial3d_gizmo.cc.
References wmGizmoType::draw, wmGizmoType::draw_select, ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR, ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y, ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE, ED_GIZMO_DIAL_DRAW_FLAG_CLIP, ED_GIZMO_DIAL_DRAW_FLAG_FILL, ED_GIZMO_DIAL_DRAW_FLAG_FILL_SELECT, wmGizmoType::exit, FLT_MAX, gizmo_dial_draw(), gizmo_dial_draw_select(), gizmo_dial_exit(), gizmo_dial_invoke(), gizmo_dial_modal(), gizmo_dial_setup(), wmGizmoType::idname, wmGizmoType::invoke, M_PI, wmGizmoType::modal, PROP_FLOAT, RNA_def_boolean(), RNA_def_enum_flag(), RNA_def_float(), RNA_def_float_factor(), wmGizmoType::setup, SNAP_INCREMENTAL_ANGLE, wmGizmoType::srna, wmGizmoType::struct_size, and WM_gizmotype_target_property_def().
Referenced by ED_gizmotypes_dial_3d().