Blender  V3.3
transform_input.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <math.h>
8 #include <stdlib.h>
9 
10 #include "DNA_screen_types.h"
11 #include "DNA_space_types.h"
12 
13 #include "BKE_context.h"
14 
15 #include "BLI_math.h"
16 #include "BLI_utildefines.h"
17 
18 #include "WM_api.h"
19 #include "WM_types.h"
20 
21 #include "transform.h"
22 #include "transform_mode.h"
23 
24 #include "MEM_guardedalloc.h"
25 
26 /* -------------------------------------------------------------------- */
31 static void InputVector(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
32 {
33  convertViewVec(t, output, mval[0] - mi->imval[0], mval[1] - mi->imval[1]);
34 }
35 
37 static void InputSpring(TransInfo *UNUSED(t),
38  MouseInput *mi,
39  const double mval[2],
40  float output[3])
41 {
42  double dx, dy;
43  float ratio;
44 
45  dx = ((double)mi->center[0] - mval[0]);
46  dy = ((double)mi->center[1] - mval[1]);
47  ratio = hypot(dx, dy) / (double)mi->factor;
48 
49  output[0] = ratio;
50 }
51 
53 static void InputSpringFlip(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
54 {
55  InputSpring(t, mi, mval, output);
56 
57  /* flip scale */
58  /* values can become really big when zoomed in so use longs T26598. */
59  if (((int64_t)((int)mi->center[0] - mval[0]) * (int64_t)((int)mi->center[0] - mi->imval[0]) +
60  (int64_t)((int)mi->center[1] - mval[1]) * (int64_t)((int)mi->center[1] - mi->imval[1])) <
61  0) {
62  output[0] *= -1.0f;
63  }
64 }
65 
67 static void InputSpringDelta(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
68 {
69  InputSpring(t, mi, mval, output);
70  output[0] -= 1.0f;
71 }
72 
75  MouseInput *mi,
76  const double mval[2],
77  float output[3])
78 {
79  output[0] = (float)(mi->imval[1] - mval[1]);
80  output[1] = (float)(mval[0] - mi->imval[0]);
81 
82  output[0] *= mi->factor;
83  output[1] *= mi->factor;
84 }
85 
88  MouseInput *mi,
89  const double mval[2],
90  float output[3])
91 {
92  const int winx = t->region ? t->region->winx : 1;
93 
94  output[0] = ((mval[0] - mi->imval[0]) / winx) * 2.0f;
95 }
96 
99  MouseInput *mi,
100  const double mval[2],
101  float output[3])
102 {
103  float vec[3];
104 
105  InputVector(t, mi, mval, vec);
106  project_v3_v3v3(vec, vec, t->viewinv[0]);
107 
108  output[0] = dot_v3v3(t->viewinv[0], vec) * 2.0f;
109 }
110 
111 static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
112 {
113  const int winy = t->region ? t->region->winy : 1;
114 
115  /* Dragging up increases (matching viewport zoom). */
116  output[0] = ((mval[1] - mi->imval[1]) / winy) * 2.0f;
117 }
118 
121  MouseInput *mi,
122  const double mval[2],
123  float output[3])
124 {
125  float vec[3];
126 
127  InputVector(t, mi, mval, vec);
128  project_v3_v3v3(vec, vec, t->viewinv[1]);
129 
130  /* Dragging up increases (matching viewport zoom). */
131  output[0] = dot_v3v3(t->viewinv[1], vec) * 2.0f;
132 }
133 
136  MouseInput *mi,
137  const double mval[2],
138  float output[3])
139 {
140  double length;
141  double distance;
142  double dx, dy;
143  const int *data = mi->data;
144 
145  if (data) {
146  int mdx, mdy;
147  dx = data[2] - data[0];
148  dy = data[3] - data[1];
149 
150  length = hypot(dx, dy);
151 
152  mdx = mval[0] - data[2];
153  mdy = mval[1] - data[3];
154 
155  distance = (length != 0.0) ? (mdx * dx + mdy * dy) / length : 0.0;
156 
157  output[0] = (length != 0.0) ? (double)(distance / length) : 0.0;
158  }
159 }
160 
162 static void InputCustomRatio(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
163 {
164  InputCustomRatioFlip(t, mi, mval, output);
165  output[0] = -output[0];
166 }
167 
169  double angle;
170  double mval_prev[2];
171 };
172 
174 static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], float output[3])
175 {
176  struct InputAngle_Data *data = mi->data;
177  float dir_prev[2], dir_curr[2], mi_center[2];
178  copy_v2_v2(mi_center, mi->center);
179 
180  sub_v2_v2v2(dir_prev, (const float[2]){UNPACK2(data->mval_prev)}, mi_center);
181  sub_v2_v2v2(dir_curr, (const float[2]){UNPACK2(mval)}, mi_center);
182 
183  if (normalize_v2(dir_prev) && normalize_v2(dir_curr)) {
184  float dphi = angle_normalized_v2v2(dir_prev, dir_curr);
185 
186  if (cross_v2v2(dir_prev, dir_curr) > 0.0f) {
187  dphi = -dphi;
188  }
189 
190  data->angle += ((double)dphi) * (mi->precision ? (double)mi->precision_factor : 1.0);
191 
192  data->mval_prev[0] = mval[0];
193  data->mval_prev[1] = mval[1];
194  }
195 
196  output[0] = data->angle;
197 }
198 
199 static void InputAngleSpring(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
200 {
201  float toutput[3];
202 
203  InputAngle(t, mi, mval, output);
204  InputSpring(t, mi, mval, toutput);
205 
206  output[1] = toutput[0];
207 }
208 
211 /* -------------------------------------------------------------------- */
219  MouseInput *mi,
220  const int mval_start[2],
221  const int mval_end[2])
222 {
223  int *data;
224 
225  mi->data = MEM_reallocN(mi->data, sizeof(int[4]));
226 
227  data = mi->data;
228 
229  data[0] = mval_start[0];
230  data[1] = mval_start[1];
231  data[2] = mval_end[0];
232  data[3] = mval_end[1];
233 }
234 
235 void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2])
236 {
237  BLI_ASSERT_UNIT_V2(dir);
238  const int win_axis = t->region ? ((abs((int)(t->region->winx * dir[0])) +
239  abs((int)(t->region->winy * dir[1]))) /
240  2) :
241  1;
242  const int mval_start[2] = {
243  mi->imval[0] + dir[0] * win_axis,
244  mi->imval[1] + dir[1] * win_axis,
245  };
246  const int mval_end[2] = {mi->imval[0], mi->imval[1]};
247  setCustomPoints(t, mi, mval_start, mval_end);
248 }
249 
252 /* -------------------------------------------------------------------- */
257  TransInfo *t, MouseInput *mi, const float center[2], const int mval[2], const bool precision)
258 {
259  mi->factor = 0;
260  mi->precision = precision;
261 
262  mi->center[0] = center[0];
263  mi->center[1] = center[1];
264 
265  mi->imval[0] = mval[0];
266  mi->imval[1] = mval[1];
267 
268  if ((t->spacetype == SPACE_VIEW3D) && (t->region->regiontype == RGN_TYPE_WINDOW)) {
269  float delta[3] = {mval[0] - center[0], mval[1] - center[1]};
270  ED_view3d_win_to_delta(t->region, delta, t->zfac, delta);
271  add_v3_v3v3(mi->imval_unproj, t->center_global, delta);
272  }
273 
274  mi->post = NULL;
275 }
276 
277 static void calcSpringFactor(MouseInput *mi)
278 {
279  mi->factor = sqrtf(
280  ((float)(mi->center[1] - mi->imval[1])) * ((float)(mi->center[1] - mi->imval[1])) +
281  ((float)(mi->center[0] - mi->imval[0])) * ((float)(mi->center[0] - mi->imval[0])));
282 
283  if (mi->factor == 0.0f) {
284  mi->factor = 1.0f; /* prevent Inf */
285  }
286 }
287 
289 {
290  /* In case we allocate a new value. */
291  void *mi_data_prev = mi->data;
292 
293  mi->use_virtual_mval = true;
294  mi->precision_factor = 1.0f / 10.0f;
295 
296  switch (mode) {
297  case INPUT_VECTOR:
298  mi->apply = InputVector;
299  t->helpline = HLP_NONE;
300  break;
301  case INPUT_SPRING:
302  calcSpringFactor(mi);
303  mi->apply = InputSpring;
304  t->helpline = HLP_SPRING;
305  break;
306  case INPUT_SPRING_FLIP:
307  calcSpringFactor(mi);
308  mi->apply = InputSpringFlip;
309  t->helpline = HLP_SPRING;
310  break;
311  case INPUT_SPRING_DELTA:
312  calcSpringFactor(mi);
313  mi->apply = InputSpringDelta;
314  t->helpline = HLP_SPRING;
315  break;
316  case INPUT_ANGLE:
317  case INPUT_ANGLE_SPRING: {
318  struct InputAngle_Data *data;
319  mi->use_virtual_mval = false;
320  mi->precision_factor = 1.0f / 30.0f;
321  data = MEM_callocN(sizeof(struct InputAngle_Data), "angle accumulator");
322  data->mval_prev[0] = mi->imval[0];
323  data->mval_prev[1] = mi->imval[1];
324  mi->data = data;
325  if (mode == INPUT_ANGLE) {
326  mi->apply = InputAngle;
327  }
328  else {
329  calcSpringFactor(mi);
330  mi->apply = InputAngleSpring;
331  }
332  t->helpline = HLP_ANGLE;
333  break;
334  }
335  case INPUT_TRACKBALL:
336  mi->precision_factor = 1.0f / 30.0f;
337  /* factor has to become setting or so */
338  mi->factor = 0.01f;
339  mi->apply = InputTrackBall;
340  t->helpline = HLP_TRACKBALL;
341  break;
344  t->helpline = HLP_HARROW;
345  break;
348  t->helpline = HLP_HARROW;
349  break;
352  t->helpline = HLP_VARROW;
353  break;
356  t->helpline = HLP_VARROW;
357  break;
358  case INPUT_CUSTOM_RATIO:
359  mi->apply = InputCustomRatio;
360  t->helpline = HLP_CARROW;
361  break;
364  t->helpline = HLP_CARROW;
365  break;
366  case INPUT_NONE:
367  default:
368  mi->apply = NULL;
369  break;
370  }
371 
372  /* setup for the mouse cursor: either set a custom one,
373  * or hide it if it will be drawn with the helpline */
374  wmWindow *win = CTX_wm_window(t->context);
375  switch (t->helpline) {
376  case HLP_NONE:
377  /* INPUT_VECTOR, INPUT_CUSTOM_RATIO, INPUT_CUSTOM_RATIO_FLIP */
378  if (t->flag & T_MODAL) {
379  t->flag |= T_MODAL_CURSOR_SET;
381  }
382  break;
383  case HLP_SPRING:
384  case HLP_ANGLE:
385  case HLP_TRACKBALL:
386  case HLP_HARROW:
387  case HLP_VARROW:
388  case HLP_CARROW:
389  if (t->flag & T_MODAL) {
390  t->flag |= T_MODAL_CURSOR_SET;
392  }
393  break;
394  default:
395  break;
396  }
397 
398  /* if we've allocated new data, free the old data
399  * less hassle than checking before every alloc above */
400  if (mi_data_prev && (mi_data_prev != mi->data)) {
401  MEM_freeN(mi_data_prev);
402  }
403 }
404 
405 void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float values[3]))
406 {
407  mi->post = post;
408 }
409 
410 void applyMouseInput(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
411 {
412  double mval_db[2];
413 
414  if (mi->use_virtual_mval) {
415  /* update accumulator */
416  double mval_delta[2];
417 
418  mval_delta[0] = (mval[0] - mi->imval[0]) - mi->virtual_mval.prev[0];
419  mval_delta[1] = (mval[1] - mi->imval[1]) - mi->virtual_mval.prev[1];
420 
421  mi->virtual_mval.prev[0] += mval_delta[0];
422  mi->virtual_mval.prev[1] += mval_delta[1];
423 
424  if (mi->precision) {
425  mval_delta[0] *= (double)mi->precision_factor;
426  mval_delta[1] *= (double)mi->precision_factor;
427  }
428 
429  mi->virtual_mval.accum[0] += mval_delta[0];
430  mi->virtual_mval.accum[1] += mval_delta[1];
431 
432  mval_db[0] = mi->imval[0] + mi->virtual_mval.accum[0];
433  mval_db[1] = mi->imval[1] + mi->virtual_mval.accum[1];
434  }
435  else {
436  mval_db[0] = mval[0];
437  mval_db[1] = mval[1];
438  }
439 
440  if (mi->apply != NULL) {
441  mi->apply(t, mi, mval_db, output);
442  }
443 
444  if (mi->post) {
445  mi->post(t, output);
446  }
447 }
448 
449 void transform_input_update(TransInfo *t, const float fac)
450 {
451  MouseInput *mi = &t->mouse;
452  t->mouse.factor *= fac;
453  if ((t->spacetype == SPACE_VIEW3D) && (t->region->regiontype == RGN_TYPE_WINDOW)) {
454  projectIntView(t, mi->imval_unproj, mi->imval);
455  }
456  else {
457  int offset[2], center_2d_int[2] = {mi->center[0], mi->center[1]};
458  sub_v2_v2v2_int(offset, mi->imval, center_2d_int);
459  offset[0] *= fac;
460  offset[1] *= fac;
461 
462  center_2d_int[0] = t->center2d[0];
463  center_2d_int[1] = t->center2d[1];
464  add_v2_v2v2_int(mi->imval, center_2d_int, offset);
465  }
466 
467  float center_old[2];
468  copy_v2_v2(center_old, mi->center);
469  copy_v2_v2(mi->center, t->center2d);
470 
471  if (mi->use_virtual_mval) {
472  /* Update accumulator. */
473  double mval_delta[2];
474  sub_v2_v2v2_db(mval_delta, mi->virtual_mval.accum, mi->virtual_mval.prev);
475  mval_delta[0] *= fac;
476  mval_delta[1] *= fac;
478  add_v2_v2_db(mi->virtual_mval.accum, mval_delta);
479  }
480 
481  if (ELEM(mi->apply, InputAngle, InputAngleSpring)) {
482  float offset_center[2];
483  sub_v2_v2v2(offset_center, mi->center, center_old);
484  struct InputAngle_Data *data = mi->data;
485  data->mval_prev[0] += offset_center[0];
486  data->mval_prev[1] += offset_center[1];
487  }
488 
489  if (t->mode == TFM_EDGE_SLIDE) {
491  }
492  else if (t->mode == TFM_VERT_SLIDE) {
494  }
495 }
496 
typedef float(TangentPoint)[2]
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
#define BLI_ASSERT_UNIT_V2(v)
MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2])
float angle_normalized_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
Definition: math_vector.c:461
MINLINE void copy_v2_v2_db(double r[2], const double a[2])
MINLINE void add_v2_v2v2_int(int r[2], const int a[2], const int b[2])
MINLINE void copy_v2_v2(float r[2], const float a[2])
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
Definition: math_vector.c:600
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float normalize_v2(float r[2])
MINLINE void add_v2_v2_db(double r[2], const double a[2])
MINLINE void sub_v2_v2v2_db(double r[2], const double a[2], const double b[2])
#define UNPACK2(a)
#define UNUSED(x)
#define ELEM(...)
typedef double(DMatrix)[4][4]
@ RGN_TYPE_WINDOW
@ SPACE_VIEW3D
@ TFM_EDGE_SLIDE
Definition: ED_transform.h:59
@ TFM_VERT_SLIDE
Definition: ED_transform.h:60
void ED_view3d_win_to_delta(const struct ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define sqrtf(x)
Definition: metal/compat.h:243
INLINE Rall1d< T, V, S > hypot(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
Definition: rall1d.h:383
T length(const vec_base< T, Size > &a)
T distance(const T &a, const T &b)
T abs(const T &a)
__int64 int64_t
Definition: stdint.h:89
void(* apply)(struct TransInfo *t, struct MouseInput *mi, const double mval[2], float output[3])
struct MouseInput::@591 virtual_mval
void(* post)(struct TransInfo *t, float values[3])
void convertViewVec(TransInfo *t, float r_vec[3], double dx, double dy)
Definition: transform.c:170
void projectIntView(TransInfo *t, const float vec[3], int adr[2])
Definition: transform.c:333
static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], float output[3])
static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
static void InputCustomRatioFlip(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], float output[3])
static void InputSpringFlip(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
static void InputAngleSpring(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
void transform_input_update(TransInfo *t, const float fac)
static void InputVector(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
static void InputSpringDelta(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
void setInputPostFct(MouseInput *mi, void(*post)(struct TransInfo *t, float values[3]))
static void InputCustomRatio(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], float output[3])
void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2])
static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const double mval[2], float output[3])
void initMouseInput(TransInfo *t, MouseInput *mi, const float center[2], const int mval[2], const bool precision)
void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, const int mval_start[2], const int mval_end[2])
static void calcSpringFactor(MouseInput *mi)
void applyMouseInput(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], float output[3])
transform modes used by different operators.
void transform_mode_edge_slide_reproject_input(TransInfo *t)
void transform_mode_vert_slide_reproject_input(TransInfo *t)
void WM_cursor_modal_set(wmWindow *win, int val)
Definition: wm_cursors.c:191
@ WM_CURSOR_NSEW_SCROLL
Definition: wm_cursors.h:51
@ WM_CURSOR_NONE
Definition: wm_cursors.h:58