Blender V5.3
gizmo_library_intern.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2016 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_userdef_types.h"
12
13#include "gizmo_geometry.h"
14
15namespace blender {
16
17struct IDProperty;
18struct bContext;
19struct wmGizmo;
20struct wmGizmoProperty;
21
22#define DIAL_RESOLUTION 48
23
28#define WM_GIZMO_SELECT_BIAS 6.0f
29
30static inline float WM_gizmo_select_bias(bool select)
31{
33}
34
39 float range_fac; /* factor for arrow min/max distance */
40 float offset;
41
42 /* property range for constrained gizmos */
43 float range;
44 /* min/max value for constrained gizmos */
45 float min, max;
46
48};
49
51 float init_value; /* initial property value */
52 float init_mval[2];
54 float init_matrix_final[4][4];
55 float init_matrix_basis[4][4];
56
57 /* offset of last handling step */
59 /* Total offset added by precision tweaking.
60 * Needed to allow toggling precision on/off without causing jumps */
62};
63
64float gizmo_offset_from_value(GizmoCommonData *data, float value, bool constrained, bool inverted);
66 GizmoInteraction *inter,
67 float offset,
68 bool constrained,
69 bool inverted,
70 bool use_precision);
71
73 wmGizmo *gz, GizmoCommonData *data, wmGizmoProperty *gz_prop, bool constrained, bool inverted);
74
76 const wmGizmo *gz,
77 GizmoInteraction *inter,
78 wmGizmoProperty *gz_prop);
79
80/* -------------------------------------------------------------------- */
81
82void gizmo_color_get(const wmGizmo *gz, bool highlight, float r_color[4]);
83
89 bContext *C, const wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2]);
90
92 bContext *C, const wmGizmo *gz, const float mval[2], bool use_offset, float r_co[3]);
93
94/* -------------------------------------------------------------------- */
95/* Gizmo RNA Utils. */
96
98 const int spacetype,
99 const int regionid);
100
101/* -------------------------------------------------------------------- */
102/* Gizmo drawing */
103
107void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, bool select, const float color[4]);
109 const float color[4], const float (*verts)[3], uint vert_count, uint pos, uint primitive_type);
110
111} // namespace blender
#define UI_SCALE_FAC
#define C
Definition RandGen.cpp:29
#define WM_GIZMO_SELECT_BIAS
ccl_device_inline float3x3 inverted(const float3x3 m)
BMesh Iterators.
float gizmo_offset_from_value(GizmoCommonData *data, float value, bool constrained, bool inverted)
void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, const bool, const float color[4])
unsigned int uint
Definition BKE_text.h:55
bool gizmo_window_project_3d(bContext *C, const wmGizmo *gz, const float mval[2], bool use_offset, float r_co[3])
static float WM_gizmo_select_bias(bool select)
void wm_gizmo_vec_draw(const float color[4], const float(*verts)[3], uint vert_count, uint pos, uint primitive_type)
float gizmo_value_from_offset(GizmoCommonData *data, GizmoInteraction *inter, float offset, bool constrained, bool inverted, bool use_precision)
BMesh const char void * data
wmGizmo * gizmo_find_from_properties(const IDProperty *properties, const int spacetype, const int regionid)
void gizmo_color_get(const wmGizmo *gz, bool highlight, float r_color[4])
void gizmo_property_data_update(wmGizmo *gz, GizmoCommonData *data, wmGizmoProperty *gz_prop, bool constrained, bool inverted)
bool gizmo_window_project_2d(bContext *C, const wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2])
void gizmo_property_value_reset(bContext *C, const wmGizmo *gz, GizmoInteraction *inter, wmGizmoProperty *gz_prop)