Blender  V2.93
tracking_select.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2011 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include "MEM_guardedalloc.h"
25 
26 #include "DNA_movieclip_types.h"
27 #include "DNA_scene_types.h"
28 
29 #include "BLI_lasso_2d.h"
30 #include "BLI_math.h"
31 #include "BLI_rect.h"
32 #include "BLI_utildefines.h"
33 
34 #include "BKE_context.h"
35 #include "BKE_tracking.h"
36 
37 #include "WM_api.h"
38 #include "WM_types.h"
39 
40 #include "ED_clip.h"
41 #include "ED_mask.h"
42 #include "ED_screen.h"
43 #include "ED_select_utils.h"
44 
45 #include "RNA_access.h"
46 #include "RNA_define.h"
47 
48 #include "UI_view2d.h"
49 
50 #include "DEG_depsgraph.h"
51 
52 #include "clip_intern.h" /* own include */
53 #include "tracking_ops_intern.h" /* own include */
54 
55 static float dist_to_crns(const float co[2], const float pos[2], const float crns[4][2]);
56 
57 /********************** mouse select operator *********************/
58 
59 static int mouse_on_side(
60  const float co[2], float x1, float y1, float x2, float y2, float epsx, float epsy)
61 {
62  if (x1 > x2) {
63  SWAP(float, x1, x2);
64  }
65 
66  if (y1 > y2) {
67  SWAP(float, y1, y2);
68  }
69 
70  return (co[0] >= x1 - epsx && co[0] <= x2 + epsx) && (co[1] >= y1 - epsy && co[1] <= y2 + epsy);
71 }
72 
73 static int mouse_on_rect(const float co[2],
74  const float pos[2],
75  const float min[2],
76  const float max[2],
77  float epsx,
78  float epsy)
79 {
80  return mouse_on_side(
81  co, pos[0] + min[0], pos[1] + min[1], pos[0] + max[0], pos[1] + min[1], epsx, epsy) ||
83  co, pos[0] + min[0], pos[1] + min[1], pos[0] + min[0], pos[1] + max[1], epsx, epsy) ||
85  co, pos[0] + min[0], pos[1] + max[1], pos[0] + max[0], pos[1] + max[1], epsx, epsy) ||
87  co, pos[0] + max[0], pos[1] + min[1], pos[0] + max[0], pos[1] + max[1], epsx, epsy);
88 }
89 
90 static int mouse_on_crns(
91  const float co[2], const float pos[2], const float crns[4][2], float epsx, float epsy)
92 {
93  float dist = dist_to_crns(co, pos, crns);
94 
95  return dist < max_ff(epsx, epsy);
96 }
97 
98 static int track_mouse_area(const bContext *C, const float co[2], MovieTrackingTrack *track)
99 {
101  int framenr = ED_space_clip_get_clip_frame_number(sc);
102  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
103  float pat_min[2], pat_max[2];
104  float epsx, epsy;
105  int width, height;
106 
108 
109  BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
110 
111  epsx = min_ffff(pat_min[0] - marker->search_min[0],
112  marker->search_max[0] - pat_max[0],
113  fabsf(pat_min[0]),
114  fabsf(pat_max[0])) /
115  2;
116  epsy = min_ffff(pat_min[1] - marker->search_min[1],
117  marker->search_max[1] - pat_max[1],
118  fabsf(pat_min[1]),
119  fabsf(pat_max[1])) /
120  2;
121 
122  epsx = max_ff(epsx, 2.0f / width);
123  epsy = max_ff(epsy, 2.0f / height);
124 
125  if (sc->flag & SC_SHOW_MARKER_SEARCH) {
126  if (mouse_on_rect(co, marker->pos, marker->search_min, marker->search_max, epsx, epsy)) {
127  return TRACK_AREA_SEARCH;
128  }
129  }
130 
131  if ((marker->flag & MARKER_DISABLED) == 0) {
132  if (sc->flag & SC_SHOW_MARKER_PATTERN) {
133  if (mouse_on_crns(co, marker->pos, marker->pattern_corners, epsx, epsy)) {
134  return TRACK_AREA_PAT;
135  }
136  }
137 
138  epsx = 12.0f / width;
139  epsy = 12.0f / height;
140 
141  if (fabsf(co[0] - marker->pos[0] - track->offset[0]) < epsx &&
142  fabsf(co[1] - marker->pos[1] - track->offset[1]) <= epsy) {
143  return TRACK_AREA_POINT;
144  }
145  }
146 
147  return TRACK_AREA_NONE;
148 }
149 
150 static float dist_to_rect(const float co[2],
151  const float pos[2],
152  const float min[2],
153  const float max[2])
154 {
155  float d1, d2, d3, d4;
156  const float p[2] = {co[0] - pos[0], co[1] - pos[1]};
157  const float v1[2] = {min[0], min[1]}, v2[2] = {max[0], min[1]};
158  const float v3[2] = {max[0], max[1]}, v4[2] = {min[0], max[1]};
159 
161  d2 = dist_squared_to_line_segment_v2(p, v2, v3);
162  d3 = dist_squared_to_line_segment_v2(p, v3, v4);
163  d4 = dist_squared_to_line_segment_v2(p, v4, v1);
164 
165  return sqrtf(min_ffff(d1, d2, d3, d4));
166 }
167 
168 /* Distance to quad defined by its corners, corners are relative to pos */
169 static float dist_to_crns(const float co[2], const float pos[2], const float crns[4][2])
170 {
171  float d1, d2, d3, d4;
172  const float p[2] = {co[0] - pos[0], co[1] - pos[1]};
173  const float *v1 = crns[0], *v2 = crns[1];
174  const float *v3 = crns[2], *v4 = crns[3];
175 
177  d2 = dist_squared_to_line_segment_v2(p, v2, v3);
178  d3 = dist_squared_to_line_segment_v2(p, v3, v4);
179  d4 = dist_squared_to_line_segment_v2(p, v4, v1);
180 
181  return sqrtf(min_ffff(d1, d2, d3, d4));
182 }
183 
184 /* Same as above, but all the coordinates are absolute */
185 static float dist_to_crns_abs(const float co[2], const float corners[4][2])
186 {
187  float d1, d2, d3, d4;
188  const float *v1 = corners[0], *v2 = corners[1];
189  const float *v3 = corners[2], *v4 = corners[3];
190 
192  d2 = dist_squared_to_line_segment_v2(co, v2, v3);
193  d3 = dist_squared_to_line_segment_v2(co, v3, v4);
194  d4 = dist_squared_to_line_segment_v2(co, v4, v1);
195 
196  return sqrtf(min_ffff(d1, d2, d3, d4));
197 }
198 
200  ListBase *tracksbase,
201  const float co[2],
202  float *r_distance)
203 {
204  MovieTrackingTrack *track = NULL, *cur;
205  float mindist = 0.0f;
206  int framenr = ED_space_clip_get_clip_frame_number(sc);
207 
208  cur = tracksbase->first;
209  while (cur) {
210  MovieTrackingMarker *marker = BKE_tracking_marker_get(cur, framenr);
211 
212  if (((cur->flag & TRACK_HIDDEN) == 0) && MARKER_VISIBLE(sc, cur, marker)) {
213  float dist, d1, d2 = FLT_MAX, d3 = FLT_MAX;
214 
215  /* distance to marker point */
216  d1 = sqrtf(
217  (co[0] - marker->pos[0] - cur->offset[0]) * (co[0] - marker->pos[0] - cur->offset[0]) +
218  (co[1] - marker->pos[1] - cur->offset[1]) * (co[1] - marker->pos[1] - cur->offset[1]));
219 
220  /* distance to pattern boundbox */
221  if (sc->flag & SC_SHOW_MARKER_PATTERN) {
222  d2 = dist_to_crns(co, marker->pos, marker->pattern_corners);
223  }
224 
225  /* distance to search boundbox */
226  if (sc->flag & SC_SHOW_MARKER_SEARCH && TRACK_VIEW_SELECTED(sc, cur)) {
227  d3 = dist_to_rect(co, marker->pos, marker->search_min, marker->search_max);
228  }
229 
230  /* choose minimal distance. useful for cases of overlapped markers. */
231  dist = min_fff(d1, d2, d3);
232 
233  if (track == NULL || dist < mindist) {
234  track = cur;
235  mindist = dist;
236  }
237  }
238 
239  cur = cur->next;
240  }
241 
242  *r_distance = mindist;
243 
244  return track;
245 }
246 
248  ListBase *plane_tracks_base,
249  const float co[2],
250  float *r_distance)
251 {
252  MovieTrackingPlaneTrack *plane_track = NULL, *current_plane_track;
253  float min_distance = 0.0f;
254  int framenr = ED_space_clip_get_clip_frame_number(sc);
255 
256  for (current_plane_track = plane_tracks_base->first; current_plane_track;
257  current_plane_track = current_plane_track->next) {
258  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(current_plane_track,
259  framenr);
260 
261  if ((current_plane_track->flag & TRACK_HIDDEN) == 0) {
262  float distance = dist_to_crns_abs(co, plane_marker->corners);
263  if (plane_track == NULL || distance < min_distance) {
264  plane_track = current_plane_track;
265  min_distance = distance;
266  }
267  }
268  }
269 
270  *r_distance = min_distance;
271 
272  return plane_track;
273 }
274 
276 {
277  MovieTrackingTrack *track;
278  for (track = tracks_base->first; track != NULL; track = track->next) {
280  }
281 }
282 
284 {
285  MovieTrackingPlaneTrack *plane_track;
286  for (plane_track = plane_tracks_base->first; plane_track != NULL;
287  plane_track = plane_track->next) {
288  plane_track->flag &= ~SELECT;
289  }
290 }
291 
292 static int mouse_select(bContext *C, const float co[2], const bool extend, const bool deselect_all)
293 {
295  MovieClip *clip = ED_space_clip_get_clip(sc);
296  MovieTracking *tracking = &clip->tracking;
297  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
298  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
299  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
300  MovieTrackingTrack *track;
301  MovieTrackingPlaneTrack *plane_track;
302  float distance_to_track, distance_to_plane_track;
303 
304  track = find_nearest_track(sc, tracksbase, co, &distance_to_track);
305  plane_track = find_nearest_plane_track(sc, plane_tracks_base, co, &distance_to_plane_track);
306 
307  ClipViewLockState lock_state;
308  ED_clip_view_lock_state_store(C, &lock_state);
309 
310  /* Do not select beyond some reasonable distance, that is useless and
311  * prevents the 'deselect on nothing' behavior. */
312  if (distance_to_track > 0.05f) {
313  track = NULL;
314  }
315  if (distance_to_plane_track > 0.05f) {
316  plane_track = NULL;
317  }
318 
319  /* Between track and plane we choose closest to the mouse for selection here. */
320  if (track && plane_track) {
321  if (distance_to_track < distance_to_plane_track) {
322  plane_track = NULL;
323  }
324  else {
325  track = NULL;
326  }
327  }
328 
329  if (track) {
330  if (!extend) {
331  ed_tracking_deselect_all_plane_tracks(plane_tracks_base);
332  }
333 
334  int area = track_mouse_area(C, co, track);
335 
336  if (!extend || !TRACK_VIEW_SELECTED(sc, track)) {
338  }
339 
340  if (extend && TRACK_AREA_SELECTED(track, area)) {
341  if (track == act_track) {
343  }
344  else {
345  clip->tracking.act_track = track;
346  clip->tracking.act_plane_track = NULL;
347  }
348  }
349  else {
350  if (area == TRACK_AREA_POINT) {
352  }
353 
354  BKE_tracking_track_select(tracksbase, track, area, extend);
355  clip->tracking.act_track = track;
356  clip->tracking.act_plane_track = NULL;
357  }
358  }
359  else if (plane_track) {
360  if (!extend) {
362  }
363 
364  if (PLANE_TRACK_VIEW_SELECTED(plane_track)) {
365  if (extend) {
366  plane_track->flag &= ~SELECT;
367  }
368  }
369  else {
370  plane_track->flag |= SELECT;
371  }
372 
373  clip->tracking.act_track = NULL;
374  clip->tracking.act_plane_track = plane_track;
375  }
376  else if (deselect_all) {
378  ed_tracking_deselect_all_plane_tracks(plane_tracks_base);
379  /* Mask as well if we are in combined mask / track view. */
381  }
382 
384 
386 
389 
390  /* Pass-through + finished to allow tweak to transform. */
392 }
393 
394 static bool select_poll(bContext *C)
395 {
397 
398  if (sc) {
399  return sc->clip && sc->view == SC_VIEW_CLIP;
400  }
401 
402  return false;
403 }
404 
405 static int select_exec(bContext *C, wmOperator *op)
406 {
407  float co[2];
408 
409  RNA_float_get_array(op->ptr, "location", co);
410  const bool extend = RNA_boolean_get(op->ptr, "extend");
411  const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
412 
413  return mouse_select(C, co, extend, deselect_all);
414 }
415 
416 static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
417 {
419  ARegion *region = CTX_wm_region(C);
420 
421  float co[2];
422  const bool extend = RNA_boolean_get(op->ptr, "extend");
423 
424  if (!extend) {
426 
427  if (track) {
428  MovieClip *clip = ED_space_clip_get_clip(sc);
429 
430  clip->tracking.act_track = track;
431 
434 
435  return OPERATOR_PASS_THROUGH;
436  }
437  }
438 
439  ED_clip_mouse_pos(sc, region, event->mval, co);
440  RNA_float_set_array(op->ptr, "location", co);
441 
442  return select_exec(C, op);
443 }
444 
446 {
447  /* identifiers */
448  ot->name = "Select";
449  ot->description = "Select tracking markers";
450  ot->idname = "CLIP_OT_select";
451 
452  /* api callbacks */
453  ot->exec = select_exec;
455  ot->poll = select_poll;
456 
457  /* flags */
458  ot->flag = OPTYPE_UNDO;
459 
460  /* properties */
461  PropertyRNA *prop;
463  "extend",
464  0,
465  "Extend",
466  "Extend selection rather than clearing the existing selection");
467  prop = RNA_def_boolean(ot->srna,
468  "deselect_all",
469  false,
470  "Deselect On Nothing",
471  "Deselect all when nothing under the cursor");
473 
475  ot->srna,
476  "location",
477  2,
478  NULL,
479  -FLT_MAX,
480  FLT_MAX,
481  "Location",
482  "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds",
483  -100.0f,
484  100.0f);
485 }
486 
488 {
489  /* To avoid conflicts with mask select deselect all in empty space. */
490  return select_poll(C);
491 }
492 
493 /********************** box select operator *********************/
494 
496 {
498  ARegion *region = CTX_wm_region(C);
499 
500  MovieClip *clip = ED_space_clip_get_clip(sc);
501  MovieTracking *tracking = &clip->tracking;
502  MovieTrackingTrack *track;
503  MovieTrackingPlaneTrack *plane_track;
504  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
505  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
506  rcti rect;
507  rctf rectf;
508  bool changed = false;
509  int framenr = ED_space_clip_get_clip_frame_number(sc);
510 
511  /* get rectangle from operator */
513 
514  ED_clip_point_stable_pos(sc, region, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
515  ED_clip_point_stable_pos(sc, region, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
516 
517  const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
518  const bool select = (sel_op != SEL_OP_SUB);
519  if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
521  changed = true;
522  }
523 
524  /* do actual selection */
525  track = tracksbase->first;
526  while (track) {
527  if ((track->flag & TRACK_HIDDEN) == 0) {
528  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
529 
530  if (MARKER_VISIBLE(sc, track, marker)) {
531  if (BLI_rctf_isect_pt_v(&rectf, marker->pos)) {
532  if (select) {
534  }
535  else {
537  }
538  }
539  changed = true;
540  }
541  }
542 
543  track = track->next;
544  }
545 
546  for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) {
547  if ((plane_track->flag & PLANE_TRACK_HIDDEN) == 0) {
548  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr);
549 
550  for (int i = 0; i < 4; i++) {
551  if (BLI_rctf_isect_pt_v(&rectf, plane_marker->corners[i])) {
552  if (select) {
553  plane_track->flag |= SELECT;
554  }
555  else {
556  plane_track->flag &= ~SELECT;
557  }
558  }
559  }
560  changed = true;
561  }
562  }
563 
564  if (changed) {
566 
569 
570  return OPERATOR_FINISHED;
571  }
572 
573  return OPERATOR_CANCELLED;
574 }
575 
577 {
578  /* identifiers */
579  ot->name = "Box Select";
580  ot->description = "Select markers using box selection";
581  ot->idname = "CLIP_OT_select_box";
582 
583  /* api callbacks */
588 
589  /* flags */
590  ot->flag = OPTYPE_UNDO;
591 
592  /* properties */
595 }
596 
597 /********************** lasso select operator *********************/
598 
600  const int mcoords[][2],
601  const int mcoords_len,
602  bool select)
603 {
605  ARegion *region = CTX_wm_region(C);
606 
607  MovieClip *clip = ED_space_clip_get_clip(sc);
608  MovieTracking *tracking = &clip->tracking;
609  MovieTrackingTrack *track;
610  MovieTrackingPlaneTrack *plane_track;
611  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
612  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
613  rcti rect;
614  bool changed = false;
615  int framenr = ED_space_clip_get_clip_frame_number(sc);
616 
617  /* get rectangle from operator */
618  BLI_lasso_boundbox(&rect, mcoords, mcoords_len);
619 
620  /* do actual selection */
621  track = tracksbase->first;
622  while (track) {
623  if ((track->flag & TRACK_HIDDEN) == 0) {
624  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
625 
626  if (MARKER_VISIBLE(sc, track, marker)) {
627  float screen_co[2];
628 
629  /* marker in screen coords */
630  ED_clip_point_stable_pos__reverse(sc, region, marker->pos, screen_co);
631 
632  if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
634  mcoords, mcoords_len, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) {
635  if (select) {
637  }
638  else {
640  }
641  }
642 
643  changed = true;
644  }
645  }
646 
647  track = track->next;
648  }
649 
650  for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) {
651  if ((plane_track->flag & PLANE_TRACK_HIDDEN) == 0) {
652  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr);
653 
654  for (int i = 0; i < 4; i++) {
655  float screen_co[2];
656 
657  /* marker in screen coords */
658  ED_clip_point_stable_pos__reverse(sc, region, plane_marker->corners[i], screen_co);
659 
660  if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
662  mcoords, mcoords_len, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) {
663  if (select) {
664  plane_track->flag |= SELECT;
665  }
666  else {
667  plane_track->flag &= ~SELECT;
668  }
669  }
670  }
671 
672  changed = true;
673  }
674  }
675 
676  if (changed) {
678 
681  }
682 
683  return changed;
684 }
685 
687 {
688  int mcoords_len;
689  const int(*mcoords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcoords_len);
690 
691  if (mcoords) {
692  const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
693  const bool select = (sel_op != SEL_OP_SUB);
694  if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
697  }
698 
699  do_lasso_select_marker(C, mcoords, mcoords_len, select);
700 
701  MEM_freeN((void *)mcoords);
702 
703  return OPERATOR_FINISHED;
704  }
705  return OPERATOR_PASS_THROUGH;
706 }
707 
709 {
710  /* identifiers */
711  ot->name = "Lasso Select";
712  ot->description = "Select markers using lasso selection";
713  ot->idname = "CLIP_OT_select_lasso";
714 
715  /* api callbacks */
721 
722  /* flags */
723  ot->flag = OPTYPE_UNDO;
724 
725  /* properties */
728 }
729 
730 /********************** circle select operator *********************/
731 
732 static int point_inside_ellipse(const float point[2],
733  const float offset[2],
734  const float ellipse[2])
735 {
736  /* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
737  float x, y;
738 
739  x = (point[0] - offset[0]) * ellipse[0];
740  y = (point[1] - offset[1]) * ellipse[1];
741 
742  return x * x + y * y < 1.0f;
743 }
744 
746  const float offset[2],
747  const float ellipse[2])
748 {
749  return point_inside_ellipse(marker->pos, offset, ellipse);
750 }
751 
753 {
755  ARegion *region = CTX_wm_region(C);
756 
757  MovieClip *clip = ED_space_clip_get_clip(sc);
758  MovieTracking *tracking = &clip->tracking;
759  MovieTrackingTrack *track;
760  MovieTrackingPlaneTrack *plane_track;
761  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
762  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
763  int width, height;
764  bool changed = false;
765  float zoomx, zoomy, offset[2], ellipse[2];
766  int framenr = ED_space_clip_get_clip_frame_number(sc);
767 
768  /* get operator properties */
769  const int x = RNA_int_get(op->ptr, "x");
770  const int y = RNA_int_get(op->ptr, "y");
771  const int radius = RNA_int_get(op->ptr, "radius");
772 
773  const eSelectOp sel_op = ED_select_op_modal(RNA_enum_get(op->ptr, "mode"),
775  const bool select = (sel_op != SEL_OP_SUB);
776  if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
778  changed = true;
779  }
780 
781  /* compute ellipse and position in unified coordinates */
783  ED_space_clip_get_zoom(sc, region, &zoomx, &zoomy);
784 
785  ellipse[0] = width * zoomx / radius;
786  ellipse[1] = height * zoomy / radius;
787 
788  ED_clip_point_stable_pos(sc, region, x, y, &offset[0], &offset[1]);
789 
790  /* do selection */
791  track = tracksbase->first;
792  while (track) {
793  if ((track->flag & TRACK_HIDDEN) == 0) {
794  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
795 
796  if (MARKER_VISIBLE(sc, track, marker) && marker_inside_ellipse(marker, offset, ellipse)) {
797  if (select) {
799  }
800  else {
802  }
803  changed = true;
804  }
805  }
806 
807  track = track->next;
808  }
809 
810  for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) {
811  if ((plane_track->flag & PLANE_TRACK_HIDDEN) == 0) {
812  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr);
813 
814  for (int i = 0; i < 4; i++) {
815  if (point_inside_ellipse(plane_marker->corners[i], offset, ellipse)) {
816  if (select) {
817  plane_track->flag |= SELECT;
818  }
819  else {
820  plane_track->flag &= ~SELECT;
821  }
822  }
823  }
824 
825  changed = true;
826  }
827  }
828 
829  if (changed) {
831 
834 
835  return OPERATOR_FINISHED;
836  }
837 
838  return OPERATOR_CANCELLED;
839 }
840 
842 {
843  /* identifiers */
844  ot->name = "Circle Select";
845  ot->description = "Select markers using circle selection";
846  ot->idname = "CLIP_OT_select_circle";
847 
848  /* api callbacks */
853 
854  /* flags */
856 
857  /* properties */
860 }
861 
862 /********************** select all operator *********************/
863 
865 {
867  MovieClip *clip = ED_space_clip_get_clip(sc);
868  MovieTracking *tracking = &clip->tracking;
869 
870  const int action = RNA_enum_get(op->ptr, "action");
871 
872  ClipViewLockState lock_state;
873  ED_clip_view_lock_state_store(C, &lock_state);
874 
875  bool has_selection = false;
876  ED_clip_select_all(sc, action, &has_selection);
877 
878  if (has_selection) {
880  }
881 
883 
886 
887  return OPERATOR_FINISHED;
888 }
889 
891 {
892  /* identifiers */
893  ot->name = "(De)select All";
894  ot->description = "Change selection of all tracking markers";
895  ot->idname = "CLIP_OT_select_all";
896 
897  /* api callbacks */
900 
901  /* flags */
903 
905 }
906 
907 /********************** select grouped operator *********************/
908 
910 {
912  MovieClip *clip = ED_space_clip_get_clip(sc);
913  MovieTrackingTrack *track;
914  MovieTrackingMarker *marker;
915  MovieTracking *tracking = &clip->tracking;
916  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
917  int group = RNA_enum_get(op->ptr, "group");
918  int framenr = ED_space_clip_get_clip_frame_number(sc);
919 
920  track = tracksbase->first;
921  while (track) {
922  bool ok = false;
923 
924  marker = BKE_tracking_marker_get(track, framenr);
925 
926  if (group == 0) { /* Keyframed */
927  ok = marker->framenr == framenr && (marker->flag & MARKER_TRACKED) == 0;
928  }
929  else if (group == 1) { /* Estimated */
930  ok = marker->framenr != framenr;
931  }
932  else if (group == 2) { /* tracked */
933  ok = marker->framenr == framenr && (marker->flag & MARKER_TRACKED);
934  }
935  else if (group == 3) { /* locked */
936  ok = track->flag & TRACK_LOCKED;
937  }
938  else if (group == 4) { /* disabled */
939  ok = marker->flag & MARKER_DISABLED;
940  }
941  else if (group == 5) { /* color */
942  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
943 
944  if (act_track) {
945  ok = (track->flag & TRACK_CUSTOMCOLOR) == (act_track->flag & TRACK_CUSTOMCOLOR);
946 
947  if (ok && track->flag & TRACK_CUSTOMCOLOR) {
948  ok = equals_v3v3(track->color, act_track->color);
949  }
950  }
951  }
952  else if (group == 6) { /* failed */
953  ok = (track->flag & TRACK_HAS_BUNDLE) == 0;
954  }
955 
956  if (ok) {
957  track->flag |= SELECT;
958  if (sc->flag & SC_SHOW_MARKER_PATTERN) {
959  track->pat_flag |= SELECT;
960  }
961  if (sc->flag & SC_SHOW_MARKER_SEARCH) {
962  track->search_flag |= SELECT;
963  }
964  }
965 
966  track = track->next;
967  }
968 
970 
973 
974  return OPERATOR_FINISHED;
975 }
976 
978 {
979  static const EnumPropertyItem select_group_items[] = {
980  {0, "KEYFRAMED", 0, "Keyframed Tracks", "Select all keyframed tracks"},
981  {1, "ESTIMATED", 0, "Estimated Tracks", "Select all estimated tracks"},
982  {2, "TRACKED", 0, "Tracked Tracks", "Select all tracked tracks"},
983  {3, "LOCKED", 0, "Locked Tracks", "Select all locked tracks"},
984  {4, "DISABLED", 0, "Disabled Tracks", "Select all disabled tracks"},
985  {5,
986  "COLOR",
987  0,
988  "Tracks with Same Color",
989  "Select all tracks with same color as active track"},
990  {6, "FAILED", 0, "Failed Tracks", "Select all tracks which failed to be reconstructed"},
991  {0, NULL, 0, NULL, NULL},
992  };
993 
994  /* identifiers */
995  ot->name = "Select Grouped";
996  ot->description = "Select all tracks from specified group";
997  ot->idname = "CLIP_OT_select_grouped";
998 
999  /* api callbacks */
1002 
1003  /* flags */
1005 
1006  /* properties */
1007  RNA_def_enum(ot->srna,
1008  "group",
1009  select_group_items,
1011  "Action",
1012  "Clear action to execute");
1013 }
struct SpaceClip * CTX_wm_space_clip(const bContext *C)
Definition: context.c:899
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
void BKE_tracking_track_deselect(struct MovieTrackingTrack *track, int area)
Definition: tracking.c:1367
#define TRACK_AREA_ALL
Definition: BKE_tracking.h:524
struct ListBase * BKE_tracking_get_active_tracks(struct MovieTracking *tracking)
Definition: tracking.c:365
void BKE_tracking_track_flag_clear(struct MovieTrackingTrack *track, int area, int flag)
Definition: tracking.c:775
#define PLANE_TRACK_VIEW_SELECTED(plane_track)
Definition: BKE_tracking.h:503
#define MARKER_VISIBLE(sc, track, marker)
Definition: BKE_tracking.h:506
void BKE_tracking_track_flag_set(struct MovieTrackingTrack *track, int area, int flag)
Definition: tracking.c:753
struct MovieTrackingPlaneMarker * BKE_tracking_plane_marker_get(struct MovieTrackingPlaneTrack *plane_track, int framenr)
Definition: tracking.c:1994
struct MovieTrackingTrack * BKE_tracking_track_get_active(struct MovieTracking *tracking)
Definition: tracking.c:1170
void BKE_tracking_dopesheet_tag_update(struct MovieTracking *tracking)
Definition: tracking.c:3321
void BKE_tracking_track_select(struct ListBase *tracksbase, struct MovieTrackingTrack *track, int area, bool extend)
Definition: tracking.c:1340
struct ListBase * BKE_tracking_get_active_plane_tracks(struct MovieTracking *tracking)
Definition: tracking.c:377
#define TRACK_AREA_SEARCH
Definition: BKE_tracking.h:522
#define TRACK_AREA_PAT
Definition: BKE_tracking.h:521
#define TRACK_AREA_NONE
Definition: BKE_tracking.h:519
#define TRACK_CLEAR_REMAINED
Definition: BKE_tracking.h:511
#define TRACK_AREA_POINT
Definition: BKE_tracking.h:520
#define TRACK_VIEW_SELECTED(sc, track)
Definition: BKE_tracking.h:497
void BKE_tracking_marker_pattern_minmax(const struct MovieTrackingMarker *marker, float min[2], float max[2])
#define TRACK_AREA_SELECTED(track, area)
Definition: BKE_tracking.h:492
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1523
void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], const unsigned int mcoords_len)
Definition: lasso_2d.c:31
bool BLI_lasso_is_point_inside(const int mcoords[][2], const unsigned int mcoords_len, const int sx, const int sy, const int error_value)
Definition: lasso_2d.c:54
MINLINE float max_ff(float a, float b)
MINLINE float min_ffff(float a, float b, float c, float d)
MINLINE float min_fff(float a, float b, float c)
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
Definition: math_geom.c:338
MINLINE bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
bool BLI_rcti_isect_pt(const struct rcti *rect, const int x, const int y)
#define SWAP(type, a, b)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_SELECT
Definition: DNA_ID.h:638
@ SC_VIEW_CLIP
@ SC_SHOW_MARKER_SEARCH
@ SC_SHOW_MARKER_PATTERN
@ TRACK_CUSTOMCOLOR
@ TRACK_HIDDEN
@ TRACK_LOCKED
@ TRACK_HAS_BUNDLE
@ PLANE_TRACK_HIDDEN
@ MARKER_TRACKED
@ MARKER_DISABLED
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_PASS_THROUGH
void ED_clip_point_stable_pos__reverse(struct SpaceClip *sc, struct ARegion *region, const float co[2], float r_co[2])
the reverse of ED_clip_point_stable_pos(), gets the marker region coords. better name here?...
Definition: clip_editor.c:518
int ED_space_clip_get_clip_frame_number(struct SpaceClip *sc)
Definition: clip_editor.c:227
void ED_clip_view_lock_state_restore_no_jump(const struct bContext *C, const ClipViewLockState *state)
void ED_space_clip_get_zoom(struct SpaceClip *sc, struct ARegion *region, float *zoomx, float *zoomy)
Definition: clip_editor.c:159
void ED_space_clip_get_size(struct SpaceClip *sc, int *width, int *height)
Definition: clip_editor.c:141
void ED_clip_mouse_pos(struct SpaceClip *sc, struct ARegion *region, const int mval[2], float co[2])
Definition: clip_editor.c:543
bool ED_space_clip_tracking_poll(struct bContext *C)
Definition: clip_editor.c:98
void ED_clip_point_stable_pos(struct SpaceClip *sc, struct ARegion *region, float x, float y, float *xr, float *yr)
Definition: clip_editor.c:480
void ED_clip_select_all(struct SpaceClip *sc, int action, bool *r_has_selection)
Definition: clip_editor.c:371
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
Definition: clip_editor.c:572
void ED_clip_view_lock_state_store(const struct bContext *C, ClipViewLockState *state)
void ED_mask_deselect_all(const struct bContext *C)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
@ SEL_DESELECT
eSelectOp ED_select_op_modal(const eSelectOp sel_op, const bool is_first)
Definition: select_utils.c:77
eSelectOp
@ SEL_OP_SUB
_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 y1
_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 width
_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 x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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
_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 v1
Read Guarded memory(de)allocation.
@ PROP_SKIP_SAVE
Definition: RNA_types.h:204
#define C
Definition: RandGen.cpp:39
#define V2D_IS_CLIPPED
Definition: UI_view2d.h:40
#define NC_GEOM
Definition: WM_types.h:294
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define ND_DISPLAY
Definition: WM_types.h:391
#define NC_MOVIECLIP
Definition: WM_types.h:298
#define ND_SELECT
Definition: WM_types.h:407
ATTR_WARN_UNUSED_RESULT const BMVert * v2
struct MovieTrackingTrack * tracking_marker_check_slide(struct bContext *C, const struct wmEvent *event, int *r_area, int *r_action, int *r_corner)
#define SELECT
uint pos
#define fabsf(x)
#define sqrtf(x)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
Definition: rna_access.c:6378
int RNA_int_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6308
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:6390
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3851
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3771
#define min(a, b)
Definition: sort.c:51
void * first
Definition: DNA_listBase.h:47
struct MovieTracking tracking
struct MovieTrackingPlaneTrack * next
struct MovieTrackingTrack * next
MovieTrackingPlaneTrack * act_plane_track
MovieTrackingTrack * act_track
struct MovieClip * clip
float xmax
Definition: DNA_vec_types.h:85
float xmin
Definition: DNA_vec_types.h:85
float ymax
Definition: DNA_vec_types.h:86
float ymin
Definition: DNA_vec_types.h:86
int ymin
Definition: DNA_vec_types.h:80
int ymax
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int xmax
Definition: DNA_vec_types.h:79
int mval[2]
Definition: WM_types.h:583
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:768
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:760
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
struct PointerRNA * ptr
static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int mouse_on_side(const float co[2], float x1, float y1, float x2, float y2, float epsx, float epsy)
static int select_exec(bContext *C, wmOperator *op)
static int select_all_exec(bContext *C, wmOperator *op)
void CLIP_OT_select_circle(wmOperatorType *ot)
void ed_tracking_deselect_all_tracks(ListBase *tracks_base)
static int box_select_exec(bContext *C, wmOperator *op)
static int clip_lasso_select_exec(bContext *C, wmOperator *op)
static MovieTrackingTrack * find_nearest_track(SpaceClip *sc, ListBase *tracksbase, const float co[2], float *r_distance)
void CLIP_OT_select_lasso(wmOperatorType *ot)
static int mouse_on_rect(const float co[2], const float pos[2], const float min[2], const float max[2], float epsx, float epsy)
static float dist_to_rect(const float co[2], const float pos[2], const float min[2], const float max[2])
void CLIP_OT_select_all(wmOperatorType *ot)
static int circle_select_exec(bContext *C, wmOperator *op)
bool ED_clip_can_select(bContext *C)
void CLIP_OT_select_box(wmOperatorType *ot)
static float dist_to_crns(const float co[2], const float pos[2], const float crns[4][2])
static int do_lasso_select_marker(bContext *C, const int mcoords[][2], const int mcoords_len, bool select)
static int point_inside_ellipse(const float point[2], const float offset[2], const float ellipse[2])
void CLIP_OT_select_grouped(wmOperatorType *ot)
static int mouse_select(bContext *C, const float co[2], const bool extend, const bool deselect_all)
static MovieTrackingPlaneTrack * find_nearest_plane_track(SpaceClip *sc, ListBase *plane_tracks_base, const float co[2], float *r_distance)
static int select_grouped_exec(bContext *C, wmOperator *op)
void CLIP_OT_select(wmOperatorType *ot)
static int mouse_on_crns(const float co[2], const float pos[2], const float crns[4][2], float epsx, float epsy)
static float dist_to_crns_abs(const float co[2], const float corners[4][2])
static int marker_inside_ellipse(MovieTrackingMarker *marker, const float offset[2], const float ellipse[2])
void ed_tracking_deselect_all_plane_tracks(ListBase *plane_tracks_base)
static int track_mouse_area(const bContext *C, const float co[2], MovieTrackingTrack *track)
static bool select_poll(bContext *C)
float max
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: util_avxb.h:167
ccl_device_inline float distance(const float2 &a, const float2 &b)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition: wm_files.c:3156
bool WM_gesture_is_modal_first(const wmGesture *gesture)
Definition: wm_gesture.c:124
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_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
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]
void WM_operator_properties_border_to_rcti(struct wmOperator *op, rcti *rect)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)