84 switch (modal_state) {
184 if (wait_for_input) {
211 switch (event->
val) {
244 switch (event->
type) {
250 else if (gesture->
move) {
265 #ifdef WITH_INPUT_NDOF
375 bool is_circle_size =
false;
376 bool is_finished =
false;
379 switch (event->
val) {
381 fac = 0.3f * (
event->y -
event->prevy);
388 if (rect->
xmax < 1) {
391 is_circle_size =
true;
395 is_circle_size =
true;
399 if (rect->
xmax < 1) {
402 is_circle_size =
true;
434 if (is_circle_size) {
441 #ifdef WITH_INPUT_NDOF
470 ot->
name =
"Circle Gesture";
471 ot->
idname =
"WM_OT_circle_gesture";
472 ot->
description =
"Enter rotate mode with a circular gesture";
494 bool gesture_end =
false;
496 switch (event->
type) {
652 for (i = 0; i < gesture->
points; i++, lasso += 2) {
674 switch (event->
val) {
682 switch (event->
type) {
696 const int x = ((
event->x - gesture->
winrct.
xmin) - lasso[gesture->
points - 1][0]);
697 const int y = ((
event->y - gesture->
winrct.
ymin) - lasso[gesture->
points - 1][1]);
701 for (
int i = 0; i < gesture->
points; i++) {
757 int *r_mcoords_len))[2]
760 int(*mcoords)[2] =
NULL;
774 mcoords[i][0] = (int)loc[0];
775 mcoords[i][1] = (int)loc[1];
780 *r_mcoords_len =
len;
799 printf(
"Location: %f %f\n", loc[0], loc[1]);
810 ot->
name =
"Lasso Gesture";
812 ot->
description =
"Select objects within the lasso as you move the pointer";
816 ot->
exec = gesture_lasso_exec;
900 #define STRAIGHTLINE_SNAP_DEG 15.0f
903 const float line_start[2] = {rect->
xmin, rect->
ymin};
904 const float line_end[2] = {rect->
xmax, rect->
ymax};
905 const float x_axis[2] = {1.0f, 0.0f};
907 float line_direction[2];
915 const float angle_snapped =
DEG2RAD(angle_snapped_deg);
917 float line_snapped_end[2];
919 mul_v2_fl(line_snapped_end, line_length);
922 rect->
xmax = (int)line_snapped_end[0];
923 rect->
ymax = (int)line_snapped_end[1];
938 switch (event->
val) {
975 switch (event->
type) {
981 else if (gesture->
move) {
1023 switch (event->
val) {
1066 switch (event->
type) {
1072 else if (gesture->
move) {
1108 ot->
name =
"Straight Line Gesture";
1109 ot->
idname =
"WM_OT_straightline_gesture";
1110 ot->
description =
"Draw a straight line as you move the pointer";
1114 ot->
exec = gesture_straightline_exec;
struct ScrArea * CTX_wm_area(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
MINLINE int min_ii(int a, int b)
MINLINE float pow2f(float x)
MINLINE int max_ii(int a, int b)
void rotate_v2_v2fl(float r[2], const float p[2], const float angle)
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void add_v2_v2(float r[2], const float a[2])
float angle_signed_v2v2(const float v1[2], const float v2[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])
void BLI_rcti_translate(struct rcti *rect, int x, int y)
#define UNUSED_FUNCTION(x)
#define OPERATOR_RETVAL_CHECK(ret)
void ED_area_tag_redraw(ScrArea *area)
void ED_region_tag_redraw(struct ARegion *region)
_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 y
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
#define RNA_BEGIN(sptr, itemptr, propname)
#define RNA_PROP_BEGIN(sptr, itemptr, prop)
StructRNA RNA_OperatorMousePath
#define WM_GESTURE_STRAIGHTLINE
#define WM_GESTURE_CIRCLE
#define WM_GESTURE_CROSS_RECT
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void *(* MEM_mallocN)(size_t len, const char *str)
void RNA_collection_clear(PointerRNA *ptr, const char *name)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
int RNA_int_get(PointerRNA *ptr, const char *name)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
void RNA_def_property_struct_runtime(StructOrFunctionRNA *cont, PropertyRNA *prop, StructRNA *type)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
struct wmGizmoMap * gizmo_map
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type
ccl_device_inline float2 floor(const float2 &a)
ccl_device_inline float3 ceil(const float3 &a)
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
wmEvent * wm_event_add_ex(wmWindow *win, const wmEvent *event_to_add, const wmEvent *event_to_add_after)
void wm_event_init_from_window(wmWindow *win, wmEvent *event)
#define ISTWEAK(event_type)
@ GESTURE_MODAL_CIRCLE_SIZE
@ GESTURE_MODAL_CIRCLE_ADD
@ GESTURE_MODAL_CIRCLE_SUB
#define ISTIMER(event_type)
wmGesture * WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type)
void wm_gesture_tag_redraw(wmWindow *win)
int wm_gesture_evaluate(wmGesture *gesture, const wmEvent *event)
void WM_gesture_end(wmWindow *win, wmGesture *gesture)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
#define STRAIGHTLINE_SNAP_DEG
static bool gesture_box_apply(bContext *C, wmOperator *op)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void gesture_modal_end(bContext *C, wmOperator *op)
static int UNUSED_FUNCTION() gesture_modal_state_from_operator(wmOperator *op)
void WM_gesture_straightline_cancel(bContext *C, wmOperator *op)
void WM_gesture_lines_cancel(bContext *C, wmOperator *op)
int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bool gesture_straightline_apply(bContext *C, wmOperator *op)
void wm_tweakevent_test(bContext *C, const wmEvent *event, int action)
void WM_gesture_circle_cancel(bContext *C, wmOperator *op)
static void gesture_circle_apply(bContext *C, wmOperator *op)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bool gesture_box_apply_rect(wmOperator *op)
int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void gesture_tweak_modal(bContext *C, const wmEvent *event)
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const int(* WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *r_mcoords_len))[2]
static void gesture_modal_state_to_operator(wmOperator *op, int modal_state)
static int gesture_lasso_apply(bContext *C, wmOperator *op)
int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_straightline_oneshot_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void wm_gesture_straightline_do_angle_snap(rcti *rect)
int WM_gesture_straightline_active_side_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool WM_gizmomap_tag_delay_refresh_for_tweak_check(wmGizmoMap *gzmap)
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
bool WM_operator_winactive(bContext *C)