Blender V4.3
editmesh_extrude_spin_gizmo.cc File Reference
#include "BLI_listbase.h"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BKE_context.hh"
#include "BKE_scene.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "WM_toolsystem.hh"
#include "WM_types.hh"
#include "ED_gizmo_utils.hh"
#include "ED_screen.hh"
#include "ED_view3d.hh"
#include "UI_resources.hh"
#include "MEM_guardedalloc.h"
#include "mesh_intern.hh"
#include "ED_transform.hh"
#include "ED_gizmo_library.hh"
#include "ED_undo.hh"

Go to the source code of this file.

Classes

struct  GizmoGroupData_SpinInit
 
struct  GizmoGroupData_SpinRedo
 

Macros

#define ORTHO_AXIS_OFFSET   2
 

Variables

static const float dial_angle_partial = M_PI_2
 
static const float dial_angle_partial_margin = 0.92f
 

Spin Tool Gizmo

#define USE_DIAL_HOVER
 
#define INIT_SCALE_BASE   2.3f
 
#define INIT_SCALE_BUTTON   0.15f
 
static const uchar shape_plus []
 
static void gizmo_mesh_spin_init_setup (const bContext *, wmGizmoGroup *gzgroup)
 
static void gizmo_mesh_spin_init_refresh (const bContext *C, wmGizmoGroup *gzgroup)
 
static void gizmo_mesh_spin_init_refresh_axis_orientation (wmGizmoGroup *gzgroup, int axis_index, const float axis_vec[3], const float axis_tan[3])
 
static void gizmo_mesh_spin_init_draw_prepare (const bContext *C, wmGizmoGroup *gzgroup)
 
static void gizmo_mesh_spin_init_invoke_prepare (const bContext *, wmGizmoGroup *gzgroup, wmGizmo *gz, const wmEvent *)
 
static void gizmo_mesh_spin_init_message_subscribe (const bContext *C, wmGizmoGroup *gzgroup, wmMsgBus *mbus)
 
void MESH_GGT_spin (wmGizmoGroupType *gzgt)
 

Spin Redo Gizmo

#define USE_ANGLE_Z_ORIENT
 
static void gizmo_spin_exec (GizmoGroupData_SpinRedo *ggd)
 
static void gizmo_mesh_spin_redo_update_orient_axis (GizmoGroupData_SpinRedo *ggd, const float plane_no[3])
 
static void gizmo_mesh_spin_redo_update_from_op (GizmoGroupData_SpinRedo *ggd)
 
static void gizmo_spin_prop_depth_get (const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
 
static void gizmo_spin_prop_depth_set (const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p)
 
static void gizmo_spin_prop_translate_get (const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
 
static void gizmo_spin_prop_translate_set (const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value)
 
static void gizmo_spin_prop_axis_angle_get (const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
 
static void gizmo_spin_prop_axis_angle_set (const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p)
 
static void gizmo_spin_prop_angle_get (const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
 
static void gizmo_spin_prop_angle_set (const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p)
 
static bool gizmo_mesh_spin_redo_poll (const bContext *C, wmGizmoGroupType *gzgt)
 
static void gizmo_mesh_spin_redo_modal_from_setup (const bContext *C, wmGizmoGroup *gzgroup)
 
static void gizmo_mesh_spin_redo_setup (const bContext *C, wmGizmoGroup *gzgroup)
 
static void gizmo_mesh_spin_redo_draw_prepare (const bContext *, wmGizmoGroup *gzgroup)
 
void MESH_GGT_spin_redo (wmGizmoGroupType *gzgt)
 

Macro Definition Documentation

◆ INIT_SCALE_BASE

#define INIT_SCALE_BASE   2.3f

◆ INIT_SCALE_BUTTON

#define INIT_SCALE_BUTTON   0.15f

◆ ORTHO_AXIS_OFFSET

#define ORTHO_AXIS_OFFSET   2

Definition at line 55 of file editmesh_extrude_spin_gizmo.cc.

Referenced by gizmo_mesh_spin_init_refresh().

◆ USE_ANGLE_Z_ORIENT

#define USE_ANGLE_Z_ORIENT

Orient the dial so the 'arc' starts where the mouse cursor is, this is simply to keep the gizmo displaying where the cursor starts. It's not needed for practical functionality.

Definition at line 479 of file editmesh_extrude_spin_gizmo.cc.

◆ USE_DIAL_HOVER

#define USE_DIAL_HOVER

Definition at line 91 of file editmesh_extrude_spin_gizmo.cc.

Function Documentation

◆ gizmo_mesh_spin_init_draw_prepare()

◆ gizmo_mesh_spin_init_invoke_prepare()

static void gizmo_mesh_spin_init_invoke_prepare ( const bContext * ,
wmGizmoGroup * gzgroup,
wmGizmo * gz,
const wmEvent *  )
static

◆ gizmo_mesh_spin_init_message_subscribe()

◆ gizmo_mesh_spin_init_refresh()

◆ gizmo_mesh_spin_init_refresh_axis_orientation()

◆ gizmo_mesh_spin_init_setup()

◆ gizmo_mesh_spin_redo_draw_prepare()

◆ gizmo_mesh_spin_redo_modal_from_setup()

◆ gizmo_mesh_spin_redo_poll()

static bool gizmo_mesh_spin_redo_poll ( const bContext * C,
wmGizmoGroupType * gzgt )
static

◆ gizmo_mesh_spin_redo_setup()

static void gizmo_mesh_spin_redo_setup ( const bContext * C,
wmGizmoGroup * gzgroup )
static

Definition at line 806 of file editmesh_extrude_spin_gizmo.cc.

References wmWindow::active, GizmoGroupData_SpinRedo::angle_z, wmGizmo::color, wmGizmo::color_hi, GizmoGroupData_SpinRedo::context, copy_m3_m3(), copy_v3_fl(), copy_v3_v3(), CTX_wm_region(), CTX_wm_view3d(), CTX_wm_window(), wmGizmoGroup::customdata, GizmoGroupData_SpinInit::data, GizmoGroupData_SpinRedo::data, ED_GIZMO_ARROW_STYLE_NORMAL, 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_MOVE_STYLE_RING_2D, ED_view3d_win_to_3d_int(), ED_view3d_win_to_3d_on_plane_int(), wmWindow::eventstate, gizmo_mesh_spin_redo_modal_from_setup(), gizmo_mesh_spin_redo_update_from_op(), gizmo_mesh_spin_redo_update_orient_axis(), gizmo_spin_prop_angle_get(), gizmo_spin_prop_angle_set(), gizmo_spin_prop_axis_angle_get(), gizmo_spin_prop_axis_angle_set(), gizmo_spin_prop_depth_get(), gizmo_spin_prop_depth_set(), gizmo_spin_prop_translate_get(), gizmo_spin_prop_translate_set(), GizmoGroupData_SpinInit::gizmos, invert_m3_m3(), GizmoGroupData_SpinInit::invoke, is_zero_v3(), M_PI, wmGizmo::matrix_basis, MEM_callocN, mul_m3_v3(), normalize_v3(), GizmoGroupData_SpinRedo::op, GizmoGroupData_SpinRedo::orient_axis_relative, GizmoGroupData_SpinInit::orient_mat, GizmoGroupData_SpinRedo::orient_mat, GizmoGroupData_SpinInit::ortho_axis_active, GizmoGroupData_SpinRedo::ot, ot, params, plane_from_point_normal_v3(), GizmoGroupData_SpinRedo::prop_angle, GizmoGroupData_SpinRedo::prop_axis_co, GizmoGroupData_SpinRedo::prop_axis_no, wmGizmo::ptr, wmOperator::ptr, RNA_boolean_set(), RNA_enum_set(), RNA_float_set(), RNA_property_float_get_array(), RNA_struct_type_find_property(), GizmoGroupData_SpinRedo::rotate_view, GizmoGroupData_SpinRedo::rotate_xy, wmOperatorType::srna, sub_v3_v3v3(), TH_AXIS_X, TH_GIZMO_PRIMARY, GizmoGroupData_SpinRedo::translate_c, GizmoGroupData_SpinRedo::translate_xy, wmOperator::type, UI_GetThemeColor3fv(), unit_m3(), UNLIKELY, WM_GIZMO_DRAW_VALUE, WM_gizmo_new_ptr(), WM_gizmo_set_flag(), WM_gizmo_set_line_width(), WM_gizmo_set_scale(), WM_gizmo_target_property_def_func(), WM_gizmomap_group_find(), WM_gizmotype_find(), WM_operator_last_redo(), WM_operatortype_find(), WM_window_get_active_screen(), GizmoGroupData_SpinInit::xyz_view, and zero_v4().

Referenced by MESH_GGT_spin_redo().

◆ gizmo_mesh_spin_redo_update_from_op()

◆ gizmo_mesh_spin_redo_update_orient_axis()

static void gizmo_mesh_spin_redo_update_orient_axis ( GizmoGroupData_SpinRedo * ggd,
const float plane_no[3] )
static

◆ gizmo_spin_exec()

static void gizmo_spin_exec ( GizmoGroupData_SpinRedo * ggd)
static

◆ gizmo_spin_prop_angle_get()

◆ gizmo_spin_prop_angle_set()

◆ gizmo_spin_prop_axis_angle_get()

◆ gizmo_spin_prop_axis_angle_set()

◆ gizmo_spin_prop_depth_get()

◆ gizmo_spin_prop_depth_set()

◆ gizmo_spin_prop_translate_get()

◆ gizmo_spin_prop_translate_set()

◆ MESH_GGT_spin()

◆ MESH_GGT_spin_redo()

Variable Documentation

◆ dial_angle_partial

const float dial_angle_partial = M_PI_2
static

Orient the handles towards the selection (can be slow with high-poly mesh!).

Definition at line 52 of file editmesh_extrude_spin_gizmo.cc.

Referenced by gizmo_mesh_spin_init_draw_prepare(), gizmo_mesh_spin_init_refresh(), and gizmo_mesh_spin_init_setup().

◆ dial_angle_partial_margin

const float dial_angle_partial_margin = 0.92f
static

◆ shape_plus

const uchar shape_plus[]
static
Initial value:
= {
0x73, 0x73, 0x73, 0x36, 0x8c, 0x36, 0x8c, 0x73, 0xc9, 0x73, 0xc9, 0x8c, 0x8c,
0x8c, 0x8c, 0xc9, 0x73, 0xc9, 0x73, 0x8c, 0x36, 0x8c, 0x36, 0x73, 0x36, 0x73,
}

Definition at line 96 of file editmesh_extrude_spin_gizmo.cc.

Referenced by gizmo_mesh_spin_init_setup().