|
Blender V4.3
|
#include "DNA_screen_types.h"#include "DNA_view3d_types.h"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_main.hh"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "RNA_access.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_screen.hh"#include "ED_view3d.hh"#include "CLG_log.h"#include "gizmo_library_intern.hh"Go to the source code of this file.
Functions | |
RNA Utils | |
| wmGizmo * | gizmo_find_from_properties (const IDProperty *properties, const int spacetype, const int regionid) |
Gizmo Library Utilities | |
This file contains functions for common behaviors of gizmos. | |
| #define | GIZMO_PRECISION_FAC 0.05f |
| static CLG_LogRef | LOG = {"ed.gizmo.library_utils"} |
| BLI_INLINE float | gizmo_offset_from_value_constr (const float range_fac, const float min, const float range, const float value, const bool inverted) |
| BLI_INLINE float | gizmo_value_from_offset_constr (const float range_fac, const float min, const float range, const float value, const bool inverted) |
| float | gizmo_offset_from_value (GizmoCommonData *data, const float value, const bool constrained, const bool inverted) |
| float | gizmo_value_from_offset (GizmoCommonData *data, GizmoInteraction *inter, const float offset, const bool constrained, const bool inverted, const bool use_precision) |
| void | gizmo_property_data_update (wmGizmo *gz, GizmoCommonData *data, wmGizmoProperty *gz_prop, const bool constrained, const bool inverted) |
| void | gizmo_property_value_reset (bContext *C, const wmGizmo *gz, GizmoInteraction *inter, wmGizmoProperty *gz_prop) |
| void | gizmo_color_get (const wmGizmo *gz, const bool highlight, float r_color[4]) |
| bool | gizmo_window_project_2d (bContext *C, const wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2]) |
| bool | gizmo_window_project_3d (bContext *C, const wmGizmo *gz, const float mval[2], bool use_offset, float r_co[3]) |
| #define GIZMO_PRECISION_FAC 0.05f |
Definition at line 40 of file gizmo_library_utils.cc.
Referenced by gizmo_value_from_offset().
Definition at line 156 of file gizmo_library_utils.cc.
References wmGizmo::color, wmGizmo::color_hi, copy_v4_v4(), wmGizmo::flag, and WM_GIZMO_DRAW_HOVER.
Referenced by arrow_draw_intern(), button2d_draw_intern(), dial_draw_intern(), ed_gizmo_draw_preset_geometry(), gizmo_cage2d_draw_intern(), gizmo_cage3d_draw_intern(), gizmo_primitive_draw_intern(), and move3d_draw_intern().
| wmGizmo * gizmo_find_from_properties | ( | const IDProperty * | properties, |
| const int | spacetype, | ||
| const int | regionid ) |
Definition at line 256 of file gizmo_library_utils.cc.
References ELEM, G_MAIN, LISTBASE_FOREACH, RGN_TYPE_ANY, SPACE_TYPE_ANY, and WM_gizmomap_group_list().
Referenced by gizmo_primitive_rna_find_operator(), and gizmo_snap_rna_find_operator().
| float gizmo_offset_from_value | ( | GizmoCommonData * | data, |
| const float | value, | ||
| const bool | constrained, | ||
| const bool | inverted ) |
Definition at line 60 of file gizmo_library_utils.cc.
References gizmo_offset_from_value_constr().
Referenced by gizmo_arrow_exit(), and gizmo_arrow_modal().
| BLI_INLINE float gizmo_offset_from_value_constr | ( | const float | range_fac, |
| const float | min, | ||
| const float | range, | ||
| const float | value, | ||
| const bool | inverted ) |
Definition at line 42 of file gizmo_library_utils.cc.
Referenced by gizmo_offset_from_value(), and gizmo_property_data_update().
| void gizmo_property_data_update | ( | wmGizmo * | gz, |
| GizmoCommonData * | data, | ||
| wmGizmoProperty * | gz_prop, | ||
| const bool | constrained, | ||
| const bool | inverted ) |
Definition at line 108 of file gizmo_library_utils.cc.
References BLI_assert, wmGizmoProperty::custom_func, gizmo_offset_from_value_constr(), wmGizmoProperty::prop, wmGizmoProperty::value_get_fn, WM_gizmo_target_property_float_get(), and WM_gizmo_target_property_float_range_get().
Referenced by gizmo_arrow_property_update().
| void gizmo_property_value_reset | ( | bContext * | C, |
| const wmGizmo * | gz, | ||
| GizmoInteraction * | inter, | ||
| wmGizmoProperty * | gz_prop ) |
Definition at line 146 of file gizmo_library_utils.cc.
References GizmoInteraction::init_value, and WM_gizmo_target_property_float_set().
Referenced by gizmo_arrow_exit().
| float gizmo_value_from_offset | ( | GizmoCommonData * | data, |
| GizmoInteraction * | inter, | ||
| const float | offset, | ||
| const bool | constrained, | ||
| const bool | inverted, | ||
| const bool | use_precision ) |
Definition at line 73 of file gizmo_library_utils.cc.
References CLAMP, GIZMO_PRECISION_FAC, gizmo_value_from_offset_constr(), GizmoInteraction::init_offset, GizmoInteraction::precision_offset, and GizmoInteraction::prev_offset.
Referenced by gizmo_arrow_modal().
| BLI_INLINE float gizmo_value_from_offset_constr | ( | const float | range_fac, |
| const float | min, | ||
| const float | range, | ||
| const float | value, | ||
| const bool | inverted ) |
Definition at line 51 of file gizmo_library_utils.cc.
References min.
Referenced by gizmo_value_from_offset().
| bool gizmo_window_project_2d | ( | bContext * | C, |
| const wmGizmo * | gz, | ||
| const float | mval[2], | ||
| int | axis, | ||
| bool | use_offset, | ||
| float | r_co[2] ) |
Takes mouse coordinates and returns them in relation to the gizmo. Both 2D & 3D supported, use so we can use 2D gizmos in the 3D view.
Definition at line 168 of file gizmo_library_utils.cc.
References CLOG_WARN, copy_v2_v2(), CTX_wm_region(), ED_view3d_win_to_3d_on_plane(), wmGizmoGroupType::flag, wmGizmoGroupType::idname, wmGizmoType::idname, invert_m4_m4(), LOG, mul_m4_v3(), params, wmGizmo::parent_gzgroup, plane_from_point_normal_v3(), wmGizmo::type, wmGizmoGroup::type, unit_m4(), WM_gizmo_calc_matrix_final_params(), and WM_GIZMOGROUPTYPE_3D.
Referenced by gizmo_button2d_test_select(), gizmo_cage2d_invoke(), gizmo_cage2d_modal(), gizmo_cage2d_test_select(), gizmo_move_modal(), and gizmo_move_test_select().
| bool gizmo_window_project_3d | ( | bContext * | C, |
| const wmGizmo * | gz, | ||
| const float | mval[2], | ||
| bool | use_offset, | ||
| float | r_co[3] ) |
Definition at line 213 of file gizmo_library_utils.cc.
References CLOG_WARN, copy_v2_v2(), CTX_wm_region(), CTX_wm_view3d(), ED_view3d_win_to_3d(), wmGizmoGroupType::flag, wmGizmoGroupType::idname, wmGizmoType::idname, invert_m4_m4(), LOG, mul_m4_v3(), params, wmGizmo::parent_gzgroup, wmGizmo::type, wmGizmoGroup::type, unit_m4(), WM_gizmo_calc_matrix_final_params(), and WM_GIZMOGROUPTYPE_3D.
Referenced by gizmo_cage3d_invoke(), and gizmo_cage3d_modal().
|
static |
Definition at line 37 of file gizmo_library_utils.cc.
Referenced by gizmo_window_project_2d(), and gizmo_window_project_3d().