|
Blender
V2.93
|
#include "BLI_listbase.h"#include "BLI_math.h"#include "DNA_scene_types.h"#include "BKE_context.h"#include "BKE_global.h"#include "BKE_main.h"#include "GPU_immediate.h"#include "GPU_state.h"#include "ED_gizmo_library.h"#include "ED_screen.h"#include "ED_transform_snap_object_context.h"#include "ED_view3d.h"#include "UI_resources.h"#include "RNA_access.h"#include "RNA_define.h"#include "DEG_depsgraph_query.h"#include "WM_api.h"#include "WM_types.h"#include "../gizmo_geometry.h"#include "../gizmo_library_intern.h"Go to the source code of this file.
Classes | |
| struct | SnapGizmo3D |
Snap Gizmo | |
Snap gizmo which exposes the location, normal and index in the props. 3D Gizmo | |
| typedef struct SnapGizmo3D | SnapGizmo3D |
| static bool | eventstate_has_changed (SnapGizmo3D *snap_gizmo, const wmWindowManager *wm) |
| static void | eventstate_save (SnapGizmo3D *snap_gizmo, const wmWindowManager *wm) |
| static bool | invert_snap (SnapGizmo3D *snap_gizmo, const wmWindowManager *wm) |
| static short | snap_gizmo_snap_elements (SnapGizmo3D *snap_gizmo) |
| typedef struct SnapGizmo3D SnapGizmo3D |
| void ED_gizmotypes_snap_3d | ( | void | ) |
Definition at line 768 of file snap3d_gizmo.c.
References GIZMO_GT_snap_3d(), and WM_gizmotype_append().
Referenced by ED_spacetypes_init().
| SnapObjectContext* ED_gizmotypes_snap_3d_context_ensure | ( | Scene * | scene, |
| const ARegion * | region, | ||
| const View3D * | v3d, | ||
| wmGizmo * | gz | ||
| ) |
Definition at line 271 of file snap3d_gizmo.c.
References ED_transform_snap_object_context_create_view3d(), NULL, scene, and SnapGizmo3D::snap_context_v3d.
Referenced by ED_gizmotypes_snap_3d_update(), view3d_interactive_add_calc_plane(), and view3d_ruler_item_mousemove().
| void ED_gizmotypes_snap_3d_data_get | ( | wmGizmo * | gz, |
| float | r_loc[3], | ||
| float | r_nor[3], | ||
| int | r_elem_index[3], | ||
| int * | r_snap_elem | ||
| ) |
Definition at line 412 of file snap3d_gizmo.c.
References BLI_assert, copy_v3_v3(), copy_v3_v3_int(), SnapGizmo3D::elem_index, SnapGizmo3D::is_enabled, SnapGizmo3D::loc, SnapGizmo3D::nor, and SnapGizmo3D::snap_elem.
Referenced by view3d_interactive_add_modal(), and view3d_ruler_item_mousemove().
| void ED_gizmotypes_snap_3d_draw_util | ( | RegionView3D * | rv3d, |
| const float | loc_prev[3], | ||
| const float | loc_curr[3], | ||
| const float | normal[3], | ||
| const uchar | color_line[4], | ||
| const uchar | color_point[4], | ||
| const short | snap_elem_type | ||
| ) |
Definition at line 181 of file snap3d_gizmo.c.
References add_v3_v3(), add_v3_v3v3(), copy_m4_m4(), ED_view3d_pixel_size(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_drawcircball(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2f(), immUniformColor4ubv(), immVertex3f(), immVertex3fv(), immVertexFormat(), mul_v3_v3fl(), negate_v3_v3(), normal, pos, SCE_SNAP_MODE_EDGE_PERPENDICULAR, sub_v3_v3v3(), TH_VERTEX_SIZE, UI_GetThemeValuef(), v1, v2, and RegionView3D::viewinv.
Referenced by drawSnapping(), and snap_gizmo_draw().
| void ED_gizmotypes_snap_3d_flag_clear | ( | struct wmGizmo * | gz, |
| eSnapGizmo | flag | ||
| ) |
Definition at line 290 of file snap3d_gizmo.c.
References SnapGizmo3D::flag.
Referenced by view3d_interactive_add_modal().
| void ED_gizmotypes_snap_3d_flag_set | ( | struct wmGizmo * | gz, |
| eSnapGizmo | flag | ||
| ) |
Definition at line 284 of file snap3d_gizmo.c.
References SnapGizmo3D::flag.
Referenced by view3d_interactive_add_modal().
| bool ED_gizmotypes_snap_3d_flag_test | ( | struct wmGizmo * | gz, |
| eSnapGizmo | flag | ||
| ) |
Definition at line 296 of file snap3d_gizmo.c.
References SnapGizmo3D::flag.
| bool ED_gizmotypes_snap_3d_invert_snap_get | ( | struct wmGizmo * | gz | ) |
Definition at line 302 of file snap3d_gizmo.c.
References SnapGizmo3D::invert_snap.
Referenced by view3d_interactive_add_begin().
| bool ED_gizmotypes_snap_3d_is_enabled | ( | wmGizmo * | gz | ) |
Definition at line 312 of file snap3d_gizmo.c.
References SnapGizmo3D::is_enabled.
Referenced by view3d_interactive_add_calc_plane(), and view3d_ruler_item_mousemove().
| short ED_gizmotypes_snap_3d_update | ( | wmGizmo * | gz, |
| struct Depsgraph * | depsgraph, | ||
| const ARegion * | region, | ||
| const View3D * | v3d, | ||
| const wmWindowManager * | wm, | ||
| const float | mval_fl[2] | ||
| ) |
Definition at line 318 of file snap3d_gizmo.c.
References copy_v3_v3(), copy_v3_v3_int(), DEG_get_input_scene(), depsgraph, ED_gizmotypes_snap_3d_context_ensure(), ED_SNAPGIZMO_TOGGLE_ALWAYS_TRUE, ED_transform_snap_object_project_view3d_ex(), ED_view3d_win_to_3d(), SnapGizmo3D::elem_index, eventstate_save(), SnapGizmo3D::flag, SnapGizmo3D::invert_snap, invert_snap(), SnapGizmo3D::is_enabled, SnapGizmo3D::loc, SnapGizmo3D::nor, NULL, RegionView3D::ofs, SnapGizmo3D::prevpoint, ARegion::regiondata, SCE_SNAP, SCE_SNAP_MODE_EDGE, SCE_SNAP_MODE_EDGE_MIDPOINT, SCE_SNAP_MODE_EDGE_PERPENDICULAR, SCE_SNAP_MODE_FACE, SCE_SNAP_MODE_VERTEX, scene, SnapGizmo3D::snap_context_v3d, SnapGizmo3D::snap_elem, ToolSettings::snap_flag, snap_gizmo_snap_elements(), Scene::toolsettings, and zero_v3().
Referenced by snap_gizmo_test_select(), view3d_interactive_add_begin(), view3d_interactive_add_modal(), and view3d_ruler_item_mousemove().
|
static |
Definition at line 97 of file snap3d_gizmo.c.
References SnapGizmo3D::alt, SnapGizmo3D::ctrl, wmWindow::eventstate, SnapGizmo3D::last_eventstate, SnapGizmo3D::oskey, SnapGizmo3D::shift, wmWindowManager::winactive, SnapGizmo3D::x, and SnapGizmo3D::y.
Referenced by snap_gizmo_draw(), and snap_gizmo_test_select().
|
static |
Definition at line 114 of file snap3d_gizmo.c.
References SnapGizmo3D::alt, SnapGizmo3D::ctrl, wmWindow::eventstate, SnapGizmo3D::last_eventstate, SnapGizmo3D::oskey, SnapGizmo3D::shift, wmWindowManager::winactive, SnapGizmo3D::x, and SnapGizmo3D::y.
Referenced by ED_gizmotypes_snap_3d_update().
|
static |
Definition at line 666 of file snap3d_gizmo.c.
References BLI_assert, wmGizmoType::draw, free(), wmGizmoType::free, gizmo_snap_rna_location_get_fn(), gizmo_snap_rna_location_set_fn(), gizmo_snap_rna_normal_get_fn(), gizmo_snap_rna_prevpoint_get_fn(), gizmo_snap_rna_prevpoint_set_fn(), gizmo_snap_rna_snap_elem_index_get_fn(), gizmo_snap_rna_snap_elements_force_get_fn(), gizmo_snap_rna_snap_elements_force_set_fn(), wmGizmoType::idname, wmGizmoType::invoke, wmGizmoType::modal, NULL, PROP_ENUM, RNA_def_enum_flag(), RNA_def_float_array(), RNA_def_float_translation(), RNA_def_float_vector_xyz(), RNA_def_int_vector(), RNA_def_property_enum_funcs_runtime(), RNA_def_property_float_array_funcs_runtime(), RNA_def_property_int_array_funcs_runtime(), rna_enum_snap_element_items, RNA_pointer_create(), RNA_property_enum_items(), RNA_struct_find_property(), RNA_ToolSettings, SCE_SNAP_MODE_EDGE, SCE_SNAP_MODE_FACE, SCE_SNAP_MODE_VERTEX, wmGizmoType::setup, snap_gizmo_draw(), snap_gizmo_free(), snap_gizmo_invoke(), snap_gizmo_modal(), snap_gizmo_setup(), snap_gizmo_test_select(), wmGizmoType::srna, wmGizmoType::struct_size, wmGizmoType::test_select, and WM_gizmotype_target_property_def().
Referenced by ED_gizmotypes_snap_3d().
|
static |
Definition at line 438 of file snap3d_gizmo.c.
References blender::compositor::area(), PointerRNA::data, G_MAIN, LISTBASE_FOREACH, NULL, ptr, RGN_TYPE_WINDOW, SPACE_VIEW3D, and WM_gizmomap_group_list().
Referenced by gizmo_snap_rna_location_get_fn(), gizmo_snap_rna_location_set_fn(), gizmo_snap_rna_normal_get_fn(), gizmo_snap_rna_prevpoint_get_fn(), gizmo_snap_rna_prevpoint_set_fn(), gizmo_snap_rna_snap_elem_index_get_fn(), gizmo_snap_rna_snap_elements_force_get_fn(), and gizmo_snap_rna_snap_elements_force_set_fn().
|
static |
Definition at line 509 of file snap3d_gizmo.c.
References copy_v3_v3(), gizmo_snap_rna_find_operator(), SnapGizmo3D::loc, and ptr.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 519 of file snap3d_gizmo.c.
References copy_v3_v3(), gizmo_snap_rna_find_operator(), SnapGizmo3D::loc, and ptr.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 529 of file snap3d_gizmo.c.
References copy_v3_v3(), gizmo_snap_rna_find_operator(), SnapGizmo3D::nor, and ptr.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 483 of file snap3d_gizmo.c.
References copy_v3_v3(), gizmo_snap_rna_find_operator(), SnapGizmo3D::prevpoint_stack, and ptr.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 493 of file snap3d_gizmo.c.
References copy_v3_v3(), gizmo_snap_rna_find_operator(), NULL, SnapGizmo3D::prevpoint, SnapGizmo3D::prevpoint_stack, and ptr.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 539 of file snap3d_gizmo.c.
References copy_v3_v3_int(), SnapGizmo3D::elem_index, gizmo_snap_rna_find_operator(), and ptr.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 463 of file snap3d_gizmo.c.
References gizmo_snap_rna_find_operator(), ptr, and SnapGizmo3D::snap_elem_force.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 473 of file snap3d_gizmo.c.
References gizmo_snap_rna_find_operator(), ptr, and SnapGizmo3D::snap_elem_force.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 128 of file snap3d_gizmo.c.
References SnapGizmo3D::alt, SnapGizmo3D::ctrl, ELEM, wmWindow::eventstate, EVT_LEFTALTKEY, EVT_LEFTCTRLKEY, EVT_LEFTSHIFTKEY, EVT_OSKEY, EVT_RIGHTALTKEY, EVT_RIGHTCTRLKEY, EVT_RIGHTSHIFTKEY, ListBase::first, SnapGizmo3D::invert_snap, wmKeyMap::items, SnapGizmo3D::keymap, KMI_INACTIVE, SnapGizmo3D::last_eventstate, SnapGizmo3D::oskey, SnapGizmo3D::shift, SnapGizmo3D::snap_on, wmWindowManager::winactive, and WM_keymap_active().
Referenced by ED_gizmotypes_snap_3d_update().
Definition at line 567 of file snap3d_gizmo.c.
References C, wmGizmo::color, CTX_wm_manager(), CTX_wm_region_data(), ED_gizmotypes_snap_3d_draw_util(), eventstate_has_changed(), GPU_line_smooth(), GPU_line_width(), SnapGizmo3D::loc, NULL, SnapGizmo3D::prevpoint, RegionView3D::rflag, rgba_float_to_uchar(), RV3D_NAVIGATING, SCE_SNAP_MODE_EDGE_PERPENDICULAR, SnapGizmo3D::snap_elem, snap_gizmo_snap_elements(), TH_TRANSFORM, and UI_GetThemeColor3ubv().
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 657 of file snap3d_gizmo.c.
References ED_transform_snap_object_context_destroy(), NULL, and SnapGizmo3D::snap_context_v3d.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 650 of file snap3d_gizmo.c.
References OPERATOR_RUNNING_MODAL.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 642 of file snap3d_gizmo.c.
References OPERATOR_RUNNING_MODAL.
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 555 of file snap3d_gizmo.c.
References wmGizmo::flag, wmGizmoGroupType::keyconf, SnapGizmo3D::keymap, wmKeyMap::modal_items, wmGizmo::parent_gzgroup, RNA_enum_value_from_id(), SnapGizmo3D::snap_on, wmGizmoGroup::type, WM_GIZMO_NO_TOOLTIP, and WM_modalkeymap_find().
Referenced by GIZMO_GT_snap_3d().
|
static |
Definition at line 164 of file snap3d_gizmo.c.
References SnapGizmo3D::gizmo, wmGizmoProperty::prop, wmGizmoProperty::ptr, RNA_property_enum_get(), SCE_SNAP_MODE_EDGE, SCE_SNAP_MODE_EDGE_MIDPOINT, SCE_SNAP_MODE_EDGE_PERPENDICULAR, SCE_SNAP_MODE_FACE, SCE_SNAP_MODE_VERTEX, SnapGizmo3D::snap_elem_force, and WM_gizmo_target_property_find().
Referenced by ED_gizmotypes_snap_3d_update(), and snap_gizmo_draw().
Definition at line 608 of file snap3d_gizmo.c.
References C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_view3d(), ED_gizmotypes_snap_3d_update(), ED_region_tag_redraw_editor_overlays(), equals_v2v2_int(), wmWindow::eventstate, eventstate_has_changed(), SnapGizmo3D::snap_elem, UNPACK2, wmWindowManager::winactive, ARegion::winrct, wmEvent::x, rcti::xmin, and rcti::ymin.
Referenced by GIZMO_GT_snap_3d().