Blender  V3.3
gizmo_library_utils.c File Reference
#include "BLI_math.h"
#include "DNA_screen_types.h"
#include "DNA_view3d_types.h"
#include "BKE_context.h"
#include "RNA_access.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_view3d.h"
#include "CLG_log.h"
#include "gizmo_library_intern.h"

Go to the source code of this file.

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_col[4])
 
bool gizmo_window_project_2d (bContext *C, const struct wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2])
 
bool gizmo_window_project_3d (bContext *C, const struct wmGizmo *gz, const float mval[2], bool use_offset, float r_co[3])
 

Macro Definition Documentation

◆ GIZMO_PRECISION_FAC

#define GIZMO_PRECISION_FAC   0.05f

Definition at line 34 of file gizmo_library_utils.c.

Function Documentation

◆ gizmo_color_get()

void gizmo_color_get ( const wmGizmo gz,
const bool  highlight,
float  r_col[4] 
)

◆ gizmo_offset_from_value()

float gizmo_offset_from_value ( GizmoCommonData data,
const float  value,
const bool  constrained,
const bool  inverted 
)

Definition at line 54 of file gizmo_library_utils.c.

References data, and gizmo_offset_from_value_constr().

Referenced by gizmo_arrow_exit(), and gizmo_arrow_modal().

◆ gizmo_offset_from_value_constr()

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 36 of file gizmo_library_utils.c.

References min.

Referenced by gizmo_offset_from_value(), and gizmo_property_data_update().

◆ gizmo_property_data_update()

void gizmo_property_data_update ( wmGizmo gz,
GizmoCommonData data,
wmGizmoProperty gz_prop,
const bool  constrained,
const bool  inverted 
)

◆ gizmo_property_value_reset()

void gizmo_property_value_reset ( bContext C,
const wmGizmo gz,
GizmoInteraction inter,
wmGizmoProperty gz_prop 
)

◆ gizmo_value_from_offset()

float gizmo_value_from_offset ( GizmoCommonData data,
GizmoInteraction inter,
const float  offset,
const bool  constrained,
const bool  inverted,
const bool  use_precision 
)

◆ gizmo_value_from_offset_constr()

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 45 of file gizmo_library_utils.c.

References min.

Referenced by gizmo_value_from_offset().

◆ gizmo_window_project_2d()

bool gizmo_window_project_2d ( bContext C,
const struct wmGizmo gz,
const float  mval[2],
int  axis,
bool  use_offset,
float  r_co[2] 
)

◆ gizmo_window_project_3d()

bool gizmo_window_project_3d ( bContext C,
const struct wmGizmo gz,
const float  mval[2],
bool  use_offset,
float  r_co[3] 
)

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"ed.gizmo.library_utils"}
static

Definition at line 31 of file gizmo_library_utils.c.

Referenced by gizmo_window_project_2d(), and gizmo_window_project_3d().