Blender  V2.93
Classes
arrow3d_gizmo.c File Reference
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_view3d_types.h"
#include "BKE_context.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_matrix.h"
#include "GPU_select.h"
#include "GPU_state.h"
#include "MEM_guardedalloc.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_gizmo_library.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "UI_interface.h"
#include "../gizmo_geometry.h"
#include "../gizmo_library_intern.h"

Go to the source code of this file.

Classes

struct  ArrowGizmo3D
 

Functions

Arrow Gizmo API
void ED_gizmo_arrow3d_set_ui_range (wmGizmo *gz, const float min, const float max)
 
void ED_gizmo_arrow3d_set_range_fac (wmGizmo *gz, const float range_fac)
 
static void GIZMO_GT_arrow_3d (wmGizmoType *gzt)
 
void ED_gizmotypes_arrow_3d (void)
 

Arrow Gizmo

Simple arrow gizmo which is dragged into a certain direction. The arrow head can have varying shapes, e.g. cone, box, etc.

2D/3D Gizmo

  • matrix[0] is derived from Y and Z.
  • matrix[1] is 'up' for gizmo types that have an up.
  • matrix[2] is the arrow direction (for all arrows).
typedef struct ArrowGizmo3D ArrowGizmo3D
 
static void gizmo_arrow_matrix_basis_get (const wmGizmo *gz, float r_matrix[4][4])
 
static void arrow_draw_geom (const ArrowGizmo3D *arrow, const bool select, const float color[4])
 
static void arrow_draw_intern (ArrowGizmo3D *arrow, const bool select, const bool highlight)
 
static void gizmo_arrow_draw_select (const bContext *UNUSED(C), wmGizmo *gz, int select_id)
 
static void gizmo_arrow_draw (const bContext *UNUSED(C), wmGizmo *gz)
 
static int gizmo_arrow_test_select (bContext *UNUSED(C), wmGizmo *gz, const int mval[2])
 
static int gizmo_arrow_modal (bContext *C, wmGizmo *gz, const wmEvent *event, eWM_GizmoFlagTweak tweak_flag)
 
static void gizmo_arrow_setup (wmGizmo *gz)
 
static int gizmo_arrow_invoke (bContext *UNUSED(C), wmGizmo *gz, const wmEvent *event)
 
static void gizmo_arrow_property_update (wmGizmo *gz, wmGizmoProperty *gz_prop)
 
static void gizmo_arrow_exit (bContext *C, wmGizmo *gz, const bool cancel)
 

Typedef Documentation

◆ ArrowGizmo3D

typedef struct ArrowGizmo3D ArrowGizmo3D

Function Documentation

◆ arrow_draw_geom()

static void arrow_draw_geom ( const ArrowGizmo3D arrow,
const bool  select,
const float  color[4] 
)
static

◆ arrow_draw_intern()

static void arrow_draw_intern ( ArrowGizmo3D arrow,
const bool  select,
const bool  highlight 
)
static

◆ ED_gizmo_arrow3d_set_range_fac()

void ED_gizmo_arrow3d_set_range_fac ( wmGizmo gz,
const float  range_fac 
)

Define a custom factor for arrow min/max distance

Note
Needs to be called before WM_gizmo_target_property_def_rna!

Definition at line 475 of file arrow3d_gizmo.c.

References BLI_assert, ArrowGizmo3D::data, GizmoCommonData::range_fac, WM_gizmo_target_property_find(), and WM_gizmo_target_property_is_valid().

Referenced by WIDGETGROUP_camera_refresh(), WIDGETGROUP_forcefield_setup(), and WIDGETGROUP_light_spot_setup().

◆ ED_gizmo_arrow3d_set_ui_range()

void ED_gizmo_arrow3d_set_ui_range ( wmGizmo gz,
const float  min,
const float  max 
)

Define a custom property UI range

Note
Needs to be called before WM_gizmo_target_property_def_rna!

Definition at line 456 of file arrow3d_gizmo.c.

References BLI_assert, ArrowGizmo3D::data, GizmoCommonData::is_custom_range_set, GizmoCommonData::max, max, min, GizmoCommonData::min, GizmoCommonData::range, WM_gizmo_target_property_find(), and WM_gizmo_target_property_is_valid().

Referenced by WIDGETGROUP_forcefield_setup().

◆ ED_gizmotypes_arrow_3d()

void ED_gizmotypes_arrow_3d ( void  )

Definition at line 541 of file arrow3d_gizmo.c.

References GIZMO_GT_arrow_3d(), and WM_gizmotype_append().

Referenced by ED_spacetypes_init().

◆ gizmo_arrow_draw()

static void gizmo_arrow_draw ( const bContext UNUSEDC,
wmGizmo gz 
)
static

Definition at line 224 of file arrow3d_gizmo.c.

References arrow_draw_intern(), wmGizmo::state, and WM_GIZMO_STATE_HIGHLIGHT.

Referenced by GIZMO_GT_arrow_3d().

◆ gizmo_arrow_draw_select()

static void gizmo_arrow_draw_select ( const bContext UNUSEDC,
wmGizmo gz,
int  select_id 
)
static

Definition at line 218 of file arrow3d_gizmo.c.

References arrow_draw_intern(), and GPU_select_load_id().

Referenced by GIZMO_GT_arrow_3d().

◆ gizmo_arrow_exit()

static void gizmo_arrow_exit ( bContext C,
wmGizmo gz,
const bool  cancel 
)
static

◆ gizmo_arrow_invoke()

static int gizmo_arrow_invoke ( bContext UNUSEDC,
wmGizmo gz,
const wmEvent event 
)
static

◆ gizmo_arrow_matrix_basis_get()

static void gizmo_arrow_matrix_basis_get ( const wmGizmo gz,
float  r_matrix[4][4] 
)
static

◆ gizmo_arrow_modal()

static int gizmo_arrow_modal ( bContext C,
wmGizmo gz,
const wmEvent event,
eWM_GizmoFlagTweak  tweak_flag 
)
static

◆ gizmo_arrow_property_update()

static void gizmo_arrow_property_update ( wmGizmo gz,
wmGizmoProperty gz_prop 
)
static

◆ gizmo_arrow_setup()

static void gizmo_arrow_setup ( wmGizmo gz)
static

◆ gizmo_arrow_test_select()

static int gizmo_arrow_test_select ( bContext UNUSEDC,
wmGizmo gz,
const int  mval[2] 
)
static

◆ GIZMO_GT_arrow_3d()

static void GIZMO_GT_arrow_3d ( wmGizmoType gzt)
static