Blender V5.0
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
15struct IDProperty;
16struct bContext;
17struct wmGizmo;
18struct wmGizmoProperty;
19
20#define DIAL_RESOLUTION 48
21
26#define WM_GIZMO_SELECT_BIAS 6.0f
27
28static inline float WM_gizmo_select_bias(bool select)
29{
31}
32
37 float range_fac; /* factor for arrow min/max distance */
38 float offset;
39
40 /* property range for constrained gizmos */
41 float range;
42 /* min/max value for constrained gizmos */
43 float min, max;
44
46};
47
49 float init_value; /* initial property value */
50 float init_mval[2];
52 float init_matrix_final[4][4];
53 float init_matrix_basis[4][4];
54
55 /* offset of last handling step */
57 /* Total offset added by precision tweaking.
58 * Needed to allow toggling precision on/off without causing jumps */
60};
61
62float gizmo_offset_from_value(GizmoCommonData *data, float value, bool constrained, bool inverted);
64 GizmoInteraction *inter,
65 float offset,
66 bool constrained,
67 bool inverted,
68 bool use_precision);
69
71 wmGizmo *gz, GizmoCommonData *data, wmGizmoProperty *gz_prop, bool constrained, bool inverted);
72
74 const wmGizmo *gz,
75 GizmoInteraction *inter,
76 wmGizmoProperty *gz_prop);
77
78/* -------------------------------------------------------------------- */
79
80void gizmo_color_get(const wmGizmo *gz, bool highlight, float r_color[4]);
81
87 bContext *C, const wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2]);
88
90 bContext *C, const wmGizmo *gz, const float mval[2], bool use_offset, float r_co[3]);
91
92/* -------------------------------------------------------------------- */
93/* Gizmo RNA Utils. */
94
96 const int spacetype,
97 const int regionid);
98
99/* -------------------------------------------------------------------- */
100/* Gizmo drawing */
101
105void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, bool select, const float color[4]);
107 const float color[4], const float (*verts)[3], uint vert_count, uint pos, uint primitive_type);
unsigned int uint
#define UI_SCALE_FAC
#define C
Definition RandGen.cpp:29
BMesh const char void * data
static float verts[][3]
float gizmo_value_from_offset(GizmoCommonData *data, GizmoInteraction *inter, float offset, bool constrained, bool inverted, bool use_precision)
wmGizmo * gizmo_find_from_properties(const IDProperty *properties, const int spacetype, const int regionid)
float gizmo_offset_from_value(GizmoCommonData *data, float value, bool constrained, bool inverted)
void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, bool select, const float color[4])
void gizmo_color_get(const wmGizmo *gz, bool highlight, float r_color[4])
bool gizmo_window_project_3d(bContext *C, const wmGizmo *gz, const float mval[2], bool use_offset, float r_co[3])
bool gizmo_window_project_2d(bContext *C, const wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2])
#define WM_GIZMO_SELECT_BIAS
void gizmo_property_data_update(wmGizmo *gz, GizmoCommonData *data, wmGizmoProperty *gz_prop, bool constrained, bool inverted)
void wm_gizmo_vec_draw(const float color[4], const float(*verts)[3], uint vert_count, uint pos, uint primitive_type)
static float WM_gizmo_select_bias(bool select)
void gizmo_property_value_reset(bContext *C, const wmGizmo *gz, GizmoInteraction *inter, wmGizmoProperty *gz_prop)
uint pos
#define select(A, B, C)