68 switch (modal_state) {
170 if (wait_for_input) {
197 switch (event->
val) {
230 switch (event->
type) {
236 else if (gesture->
move) {
251 #ifdef WITH_INPUT_NDOF
363 bool is_circle_size =
false;
364 bool is_finished =
false;
367 switch (event->
val) {
369 fac = 0.3f * (
event->xy[1] -
event->prev_xy[1]);
376 if (rect->
xmax < 1) {
379 is_circle_size =
true;
383 is_circle_size =
true;
387 if (rect->
xmax < 1) {
390 is_circle_size =
true;
422 if (is_circle_size) {
429 #ifdef WITH_INPUT_NDOF
458 ot->
name =
"Circle Gesture";
459 ot->
idname =
"WM_OT_circle_gesture";
460 ot->
description =
"Enter rotate mode with a circular gesture";
527 for (i = 0; i < gesture->
points; i++, lasso += 2) {
549 switch (event->
val) {
557 switch (event->
type) {
571 const int x = ((
event->xy[0] - gesture->
winrct.
xmin) - lasso[gesture->
points - 1][0]);
572 const int y = ((
event->xy[1] - gesture->
winrct.
ymin) - lasso[gesture->
points - 1][1]);
576 for (
int i = 0; i < gesture->
points; i++) {
627 int *r_mcoords_len))[2]
630 int(*mcoords)[2] =
NULL;
644 mcoords[i][0] = (int)loc[0];
645 mcoords[i][1] = (int)loc[1];
650 *r_mcoords_len =
len;
669 printf(
"Location: %f %f\n", loc[0], loc[1]);
680 ot->
name =
"Lasso Gesture";
682 ot->
description =
"Select objects within the lasso as you move the pointer";
686 ot->
exec = gesture_lasso_exec;
768 #define STRAIGHTLINE_SNAP_DEG 15.0f
771 const float line_start[2] = {rect->
xmin, rect->
ymin};
772 const float line_end[2] = {rect->
xmax, rect->
ymax};
773 const float x_axis[2] = {1.0f, 0.0f};
775 float line_direction[2];
783 const float angle_snapped =
DEG2RAD(angle_snapped_deg);
785 float line_snapped_end[2];
787 mul_v2_fl(line_snapped_end, line_length);
790 rect->
xmax = (int)line_snapped_end[0];
791 rect->
ymax = (int)line_snapped_end[1];
801 switch (event->
val) {
840 switch (event->
type) {
846 else if (gesture->
move) {
881 switch (event->
val) {
925 switch (event->
type) {
931 else if (gesture->
move) {
967 ot->
name =
"Straight Line Gesture";
968 ot->
idname =
"WM_OT_straightline_gesture";
969 ot->
description =
"Draw a straight line as you move the pointer";
973 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)
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])
void rotate_v2_v2fl(float r[2], const float p[2], float angle)
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)
_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)
@ OPTYPE_DEPENDS_ON_CURSOR
#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)
ccl_device_inline float3 ceil(const float3 &a)
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)
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
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
bool WM_event_is_mouse_drag_or_press(const wmEvent *event)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
@ GESTURE_MODAL_CIRCLE_SIZE
@ GESTURE_MODAL_CIRCLE_ADD
@ GESTURE_MODAL_CIRCLE_SUB
wmGesture * WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type)
void wm_gesture_tag_redraw(wmWindow *win)
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_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)
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)
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
bool WM_operator_winactive(bContext *C)