Blender  V3.3
Classes
snap3d_gizmo.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_main.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 "RNA_prototypes.h"
#include "WM_api.h"
#include "../gizmo_library_intern.h"

Go to the source code of this file.

Classes

struct  SnapGizmo3D
 

Functions

ED_gizmo_library specific API
SnapObjectContextED_gizmotypes_snap_3d_context_ensure (Scene *scene, wmGizmo *UNUSED(gz))
 
void ED_gizmotypes_snap_3d_flag_set (struct wmGizmo *gz, int flag)
 
void ED_gizmotypes_snap_3d_flag_clear (struct wmGizmo *gz, int flag)
 
bool ED_gizmotypes_snap_3d_flag_test (struct wmGizmo *gz, int flag)
 
bool ED_gizmotypes_snap_3d_invert_snap_get (struct wmGizmo *UNUSED(gz))
 
bool ED_gizmotypes_snap_3d_is_enabled (const wmGizmo *UNUSED(gz))
 
void ED_gizmotypes_snap_3d_data_get (const struct bContext *C, wmGizmo *gz, float r_loc[3], float r_nor[3], int r_elem_index[3], eSnapMode *r_snap_elem)
 
RNA callbacks
static SnapGizmo3Dgizmo_snap_rna_find_operator (PointerRNA *ptr)
 
static V3DSnapCursorStategizmo_snap_state_from_rna_get (struct PointerRNA *ptr)
 
static int gizmo_snap_rna_snap_elements_force_get_fn (struct PointerRNA *ptr, struct PropertyRNA *UNUSED(prop))
 
static void gizmo_snap_rna_snap_elements_force_set_fn (struct PointerRNA *ptr, struct PropertyRNA *UNUSED(prop), int value)
 
static void gizmo_snap_rna_prevpoint_get_fn (struct PointerRNA *ptr, struct PropertyRNA *UNUSED(prop), float *values)
 
static void gizmo_snap_rna_prevpoint_set_fn (struct PointerRNA *ptr, struct PropertyRNA *UNUSED(prop), const float *values)
 
static void gizmo_snap_rna_location_get_fn (struct PointerRNA *UNUSED(ptr), struct PropertyRNA *UNUSED(prop), float *values)
 
static void gizmo_snap_rna_location_set_fn (struct PointerRNA *UNUSED(ptr), struct PropertyRNA *UNUSED(prop), const float *values)
 
static void gizmo_snap_rna_normal_get_fn (struct PointerRNA *UNUSED(ptr), struct PropertyRNA *UNUSED(prop), float *values)
 
static void gizmo_snap_rna_snap_elem_index_get_fn (struct PointerRNA *UNUSED(ptr), struct PropertyRNA *UNUSED(prop), int *values)
 
GIZMO_GT_snap_3d
static void snap_gizmo_setup (wmGizmo *gz)
 
static void snap_gizmo_draw (const bContext *UNUSED(C), wmGizmo *UNUSED(gz))
 
static int snap_gizmo_test_select (bContext *C, wmGizmo *gz, const int mval[2])
 
static int snap_gizmo_modal (bContext *UNUSED(C), wmGizmo *UNUSED(gz), const wmEvent *UNUSED(event), eWM_GizmoFlagTweak UNUSED(tweak_flag))
 
static int snap_gizmo_invoke (bContext *UNUSED(C), wmGizmo *UNUSED(gz), const wmEvent *UNUSED(event))
 
static void snap_gizmo_free (wmGizmo *gz)
 
static void GIZMO_GT_snap_3d (wmGizmoType *gzt)
 
void ED_gizmotypes_snap_3d (void)
 

Snap Gizmo

Snap gizmo which exposes the location, normal and index in the props.

3D Gizmo

typedef struct SnapGizmo3D SnapGizmo3D
 
static void snap_gizmo_snap_elements_update (SnapGizmo3D *snap_gizmo)
 

Typedef Documentation

◆ SnapGizmo3D

typedef struct SnapGizmo3D SnapGizmo3D

Function Documentation

◆ ED_gizmotypes_snap_3d()

void ED_gizmotypes_snap_3d ( void  )

Definition at line 412 of file snap3d_gizmo.c.

References GIZMO_GT_snap_3d(), and WM_gizmotype_append().

Referenced by ED_spacetypes_init().

◆ ED_gizmotypes_snap_3d_context_ensure()

SnapObjectContext* ED_gizmotypes_snap_3d_context_ensure ( Scene scene,
wmGizmo UNUSEDgz 
)

Definition at line 59 of file snap3d_gizmo.c.

References ED_view3d_cursor_snap_context_ensure(), and scene.

Referenced by view3d_ruler_item_mousemove().

◆ ED_gizmotypes_snap_3d_data_get()

void ED_gizmotypes_snap_3d_data_get ( const struct bContext C,
wmGizmo gz,
float  r_loc[3],
float  r_nor[3],
int  r_elem_index[3],
eSnapMode r_snap_elem 
)

◆ ED_gizmotypes_snap_3d_flag_clear()

void ED_gizmotypes_snap_3d_flag_clear ( struct wmGizmo gz,
int  flag 
)

Definition at line 70 of file snap3d_gizmo.c.

References V3DSnapCursorState::flag.

◆ ED_gizmotypes_snap_3d_flag_set()

void ED_gizmotypes_snap_3d_flag_set ( struct wmGizmo gz,
int  flag 
)

Definition at line 64 of file snap3d_gizmo.c.

References V3DSnapCursorState::flag.

Referenced by WIDGETGROUP_ruler_setup().

◆ ED_gizmotypes_snap_3d_flag_test()

bool ED_gizmotypes_snap_3d_flag_test ( struct wmGizmo gz,
int  flag 
)

Definition at line 76 of file snap3d_gizmo.c.

References V3DSnapCursorState::flag.

◆ ED_gizmotypes_snap_3d_invert_snap_get()

bool ED_gizmotypes_snap_3d_invert_snap_get ( struct wmGizmo UNUSEDgz)

◆ ED_gizmotypes_snap_3d_is_enabled()

bool ED_gizmotypes_snap_3d_is_enabled ( const wmGizmo UNUSEDgz)

◆ GIZMO_GT_snap_3d()

static void GIZMO_GT_snap_3d ( wmGizmoType gzt)
static

◆ gizmo_snap_rna_find_operator()

static SnapGizmo3D* gizmo_snap_rna_find_operator ( PointerRNA ptr)
static

◆ gizmo_snap_rna_location_get_fn()

static void gizmo_snap_rna_location_get_fn ( struct PointerRNA UNUSEDptr,
struct PropertyRNA UNUSEDprop,
float values 
)
static

Definition at line 206 of file snap3d_gizmo.c.

References copy_v3_v3(), ED_view3d_cursor_snap_data_get(), and V3DSnapCursorData::loc.

Referenced by GIZMO_GT_snap_3d().

◆ gizmo_snap_rna_location_set_fn()

static void gizmo_snap_rna_location_set_fn ( struct PointerRNA UNUSEDptr,
struct PropertyRNA UNUSEDprop,
const float values 
)
static

Definition at line 214 of file snap3d_gizmo.c.

References copy_v3_v3(), ED_view3d_cursor_snap_data_get(), and V3DSnapCursorData::loc.

Referenced by GIZMO_GT_snap_3d().

◆ gizmo_snap_rna_normal_get_fn()

static void gizmo_snap_rna_normal_get_fn ( struct PointerRNA UNUSEDptr,
struct PropertyRNA UNUSEDprop,
float values 
)
static

Definition at line 222 of file snap3d_gizmo.c.

References copy_v3_v3(), ED_view3d_cursor_snap_data_get(), and V3DSnapCursorData::nor.

Referenced by GIZMO_GT_snap_3d().

◆ gizmo_snap_rna_prevpoint_get_fn()

static void gizmo_snap_rna_prevpoint_get_fn ( struct PointerRNA ptr,
struct PropertyRNA UNUSEDprop,
float values 
)
static

◆ gizmo_snap_rna_prevpoint_set_fn()

static void gizmo_snap_rna_prevpoint_set_fn ( struct PointerRNA ptr,
struct PropertyRNA UNUSEDprop,
const float values 
)
static

◆ gizmo_snap_rna_snap_elem_index_get_fn()

static void gizmo_snap_rna_snap_elem_index_get_fn ( struct PointerRNA UNUSEDptr,
struct PropertyRNA UNUSEDprop,
int *  values 
)
static

◆ gizmo_snap_rna_snap_elements_force_get_fn()

static int gizmo_snap_rna_snap_elements_force_get_fn ( struct PointerRNA ptr,
struct PropertyRNA UNUSEDprop 
)
static

◆ gizmo_snap_rna_snap_elements_force_set_fn()

static void gizmo_snap_rna_snap_elements_force_set_fn ( struct PointerRNA ptr,
struct PropertyRNA UNUSEDprop,
int  value 
)
static

◆ gizmo_snap_state_from_rna_get()

static V3DSnapCursorState* gizmo_snap_state_from_rna_get ( struct PointerRNA ptr)
static

◆ snap_gizmo_draw()

static void snap_gizmo_draw ( const bContext UNUSEDC,
wmGizmo UNUSEDgz 
)
static

Definition at line 256 of file snap3d_gizmo.c.

Referenced by GIZMO_GT_snap_3d().

◆ snap_gizmo_free()

static void snap_gizmo_free ( wmGizmo gz)
static

Definition at line 307 of file snap3d_gizmo.c.

References ED_view3d_cursor_snap_deactive(), and SnapGizmo3D::snap_state.

Referenced by GIZMO_GT_snap_3d().

◆ snap_gizmo_invoke()

static int snap_gizmo_invoke ( bContext UNUSEDC,
wmGizmo UNUSEDgz,
const wmEvent UNUSEDevent 
)
static

Definition at line 300 of file snap3d_gizmo.c.

References OPERATOR_RUNNING_MODAL.

Referenced by GIZMO_GT_snap_3d().

◆ snap_gizmo_modal()

static int snap_gizmo_modal ( bContext UNUSEDC,
wmGizmo UNUSEDgz,
const wmEvent UNUSEDevent,
eWM_GizmoFlagTweak   UNUSEDtweak_flag 
)
static

Definition at line 292 of file snap3d_gizmo.c.

References OPERATOR_RUNNING_MODAL.

Referenced by GIZMO_GT_snap_3d().

◆ snap_gizmo_setup()

static void snap_gizmo_setup ( wmGizmo gz)
static

◆ snap_gizmo_snap_elements_update()

static void snap_gizmo_snap_elements_update ( SnapGizmo3D snap_gizmo)
static

◆ snap_gizmo_test_select()

static int snap_gizmo_test_select ( bContext C,
wmGizmo gz,
const int  mval[2] 
)
static