Blender V4.3
gizmo_library_utils.cc File Reference
#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
wmGizmogizmo_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])
 

Macro Definition Documentation

◆ GIZMO_PRECISION_FAC

#define GIZMO_PRECISION_FAC   0.05f

Definition at line 40 of file gizmo_library_utils.cc.

Referenced by gizmo_value_from_offset().

Function Documentation

◆ gizmo_color_get()

◆ gizmo_find_from_properties()

wmGizmo * gizmo_find_from_properties ( const IDProperty * properties,
const int spacetype,
const int regionid )

◆ gizmo_offset_from_value()

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().

◆ 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 42 of file gizmo_library_utils.cc.

References min, and range.

Referenced by gizmo_offset_from_value(), and gizmo_property_data_update().

◆ gizmo_property_data_update()

◆ 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 51 of file gizmo_library_utils.cc.

References min.

Referenced by gizmo_value_from_offset().

◆ gizmo_window_project_2d()

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

◆ gizmo_window_project_3d()

Variable Documentation

◆ LOG

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

Definition at line 37 of file gizmo_library_utils.cc.

Referenced by gizmo_window_project_2d(), and gizmo_window_project_3d().