Blender V5.0
view3d_iterators.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10#include "DNA_curve_types.h"
11#include "DNA_lattice_types.h"
12#include "DNA_meta_types.h"
13#include "DNA_object_types.h"
14#include "DNA_screen_types.h"
15
16#include "BLI_listbase.h"
17#include "BLI_math_geom.h"
18#include "BLI_rect.h"
19
20#include "BKE_action.hh"
21#include "BKE_armature.hh"
22#include "BKE_attribute.hh"
23#include "BKE_curve.hh"
24#include "BKE_displist.h"
25#include "BKE_editmesh.hh"
26#include "BKE_mesh.hh"
27#include "BKE_mesh_iterators.hh"
28#include "BKE_mesh_runtime.hh"
29#include "BKE_mesh_wrapper.hh"
30#include "BKE_object.hh"
31#include "BKE_object_types.hh"
32
34
35#include "ANIM_armature.hh"
36
37#include "bmesh.hh"
38
39#include "ED_armature.hh"
40#include "ED_view3d.hh"
41
42/* -------------------------------------------------------------------- */
45
54static int content_planes_from_clip_flag(const ARegion *region,
55 const Object *ob,
56 const eV3DProjTest clip_flag,
57 float planes[6][4])
58{
60
61 float *clip_xmin = nullptr, *clip_xmax = nullptr;
62 float *clip_ymin = nullptr, *clip_ymax = nullptr;
63 float *clip_zmin = nullptr, *clip_zmax = nullptr;
64
65 int planes_len = 0;
66
67 /* The order of `planes` has been selected based on the likelihood of points being fully
68 * outside the plane to increase the chance of an early exit in #clip_segment_v3_plane_n.
69 * With "near" being most likely and "far" being unlikely.
70 *
71 * Otherwise the order of axes in `planes` isn't significant. */
72
73 if (clip_flag & V3D_PROJ_TEST_CLIP_NEAR) {
74 clip_zmin = planes[planes_len++];
75 }
76 if (clip_flag & V3D_PROJ_TEST_CLIP_WIN) {
77 clip_xmin = planes[planes_len++];
78 clip_xmax = planes[planes_len++];
79 clip_ymin = planes[planes_len++];
80 clip_ymax = planes[planes_len++];
81 }
82 if (clip_flag & V3D_PROJ_TEST_CLIP_FAR) {
83 clip_zmax = planes[planes_len++];
84 }
85
86 BLI_assert(planes_len <= 6);
87 if (planes_len != 0) {
88 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
89 const blender::float4x4 projection = ED_view3d_ob_project_mat_get(rv3d, ob);
91 projection.ptr(), clip_xmin, clip_xmax, clip_ymin, clip_ymax, clip_zmin, clip_zmax);
92 }
93 return planes_len;
94}
95
105 const ARegion *region,
106 const float v_a[3],
107 const float v_b[3],
108 const eV3DProjTest clip_flag,
109 const rctf *win_rect,
110 const float content_planes[][4],
111 const int content_planes_len,
112 /* Output. */
113 float r_screen_co_a[2],
114 float r_screen_co_b[2])
115{
116 /* Clipping already handled, no need to check in projection. */
117 eV3DProjTest clip_flag_nowin = clip_flag & ~V3D_PROJ_TEST_CLIP_WIN;
118
120 region, v_a, r_screen_co_a, clip_flag_nowin);
122 region, v_b, r_screen_co_b, clip_flag_nowin);
123
124 if ((status_a == V3D_PROJ_RET_OK) && (status_b == V3D_PROJ_RET_OK)) {
125 if (clip_flag & V3D_PROJ_TEST_CLIP_WIN) {
126 if (!BLI_rctf_isect_segment(win_rect, r_screen_co_a, r_screen_co_b)) {
127 return false;
128 }
129 }
130 }
131 else {
132 if (content_planes_len == 0) {
133 return false;
134 }
135
136 /* Both too near, ignore. */
137 if ((status_a & V3D_PROJ_TEST_CLIP_NEAR) && (status_b & V3D_PROJ_TEST_CLIP_NEAR)) {
138 return false;
139 }
140
141 /* Both too far, ignore. */
142 if ((status_a & V3D_PROJ_TEST_CLIP_FAR) && (status_b & V3D_PROJ_TEST_CLIP_FAR)) {
143 return false;
144 }
145
146 /* Simple cases have been ruled out, clip by viewport planes, then re-project. */
147 float v_a_clip[3], v_b_clip[3];
148 if (!clip_segment_v3_plane_n(v_a, v_b, content_planes, content_planes_len, v_a_clip, v_b_clip))
149 {
150 return false;
151 }
152
153 if ((ED_view3d_project_float_object(region, v_a_clip, r_screen_co_a, clip_flag_nowin) !=
155 (ED_view3d_project_float_object(region, v_b_clip, r_screen_co_b, clip_flag_nowin) !=
157 {
158 return false;
159 }
160
161 /* No need for #V3D_PROJ_TEST_CLIP_WIN check here,
162 * clipping the segment by planes handle this. */
163 }
164
165 return true;
166}
167
172 const float v_a[3],
173 const float v_b[3],
174 const eV3DProjTest clip_flag,
175 /* Output. */
176 float r_screen_co_a[2],
177 float r_screen_co_b[2])
178{
179 int count = 0;
180
181 if (ED_view3d_project_float_object(region, v_a, r_screen_co_a, clip_flag) == V3D_PROJ_RET_OK) {
182 count++;
183 }
184 else {
185 r_screen_co_a[0] = IS_CLIPPED; /* weak */
186 /* screen_co_a[1]: intentionally don't set this so we get errors on misuse */
187 }
188
189 if (ED_view3d_project_float_object(region, v_b, r_screen_co_b, clip_flag) == V3D_PROJ_RET_OK) {
190 count++;
191 }
192 else {
193 r_screen_co_b[0] = IS_CLIPPED; /* weak */
194 /* screen_co_b[1]: intentionally don't set this so we get errors on misuse */
195 }
196
197 /* Caller may want to know this value, for now it's not needed. */
198 return count != 0;
199}
200
202
203/* -------------------------------------------------------------------- */
206
214
216 void (*func)(void *user_data, BMVert *eve, const float screen_co[2], int index);
220};
221
224 void (*func)(void *user_data,
225 BMEdge *eed,
226 const float screen_co_a[2],
227 const float screen_co_b[2],
228 int index);
232
233 rctf win_rect; /* copy of: vc.region->winx/winy, use for faster tests, minx/y will always be 0 */
234
239 float content_planes[6][4];
241};
242
244 void (*func)(void *user_data, BMFace *efa, const float screen_co_b[2], int index);
248};
249
256
258
259/* -------------------------------------------------------------------- */
262
263static void meshobject_foreachScreenVert__mapFunc(void *user_data,
264 int index,
265 const float co[3],
266 const float /*no*/[3])
267{
269 user_data);
270 if (!data->hide_vert.is_empty() && data->hide_vert[index]) {
271 return;
272 }
273
274 float screen_co[2];
275
276 if (ED_view3d_project_float_object(data->vc.region, co, screen_co, data->clip_flag) !=
278 {
279 return;
280 }
281
282 data->func(data->user_data, screen_co, index);
283}
284
286 void (*func)(void *user_data,
287 const float screen_co[2],
288 int index),
289 void *user_data,
290 eV3DProjTest clip_flag)
291{
292 using namespace blender;
293 BLI_assert((clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) == 0);
295
296 const Object *ob_eval = DEG_get_evaluated(vc->depsgraph, vc->obact);
297 const Mesh *mesh = BKE_object_get_evaluated_mesh(ob_eval);
298 const bke::AttributeAccessor attributes = mesh->attributes();
299
301
302 data.vc = *vc;
303 data.func = func;
304 data.user_data = user_data;
305 data.clip_flag = clip_flag;
306 data.hide_vert = *attributes.lookup<bool>(".hide_vert", bke::AttrDomain::Point);
307
308 if (clip_flag & V3D_PROJ_TEST_CLIP_BB) {
309 ED_view3d_clipping_local(vc->rv3d, vc->obact->object_to_world().ptr());
310 }
311
314}
315
316static void mesh_foreachScreenVert__mapFunc(void *user_data,
317 int index,
318 const float co[3],
319 const float /*no*/[3])
320{
322 BMVert *eve = BM_vert_at_index(data->vc.em->bm, index);
324 return;
325 }
326
327 float screen_co[2];
328 if (ED_view3d_project_float_object(data->vc.region, co, screen_co, data->clip_flag) !=
330 {
331 return;
332 }
333
334 data->func(data->user_data, eve, screen_co, index);
335}
336
338 const ViewContext *vc,
339 void (*func)(void *user_data, BMVert *eve, const float screen_co[2], int index),
340 void *user_data,
341 eV3DProjTest clip_flag)
342{
344
346 vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH);
348
350
351 data.vc = *vc;
352 data.func = func;
353 data.user_data = user_data;
354 data.clip_flag = clip_flag;
355
356 if (clip_flag & V3D_PROJ_TEST_CLIP_BB) {
358 vc->obedit->object_to_world().ptr()); /* for local clipping lookups */
359 }
360
363}
364
366
367/* -------------------------------------------------------------------- */
370
371static void mesh_foreachScreenEdge__mapFunc(void *user_data,
372 int index,
373 const float v_a[3],
374 const float v_b[3])
375{
377 BMEdge *eed = BM_edge_at_index(data->vc.em->bm, index);
379 return;
380 }
381
382 float screen_co_a[2], screen_co_b[2];
384 v_a,
385 v_b,
386 data->clip_flag,
387 &data->win_rect,
388 data->content_planes,
389 data->content_planes_len,
390 screen_co_a,
391 screen_co_b))
392 {
393 return;
394 }
395
396 data->func(data->user_data, eed, screen_co_a, screen_co_b, index);
397}
398
400 void (*func)(void *user_data,
401 BMEdge *eed,
402 const float screen_co_a[2],
403 const float screen_co_b[2],
404 int index),
405 void *user_data,
406 eV3DProjTest clip_flag)
407{
409
411 vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH);
413
415
416 data.vc = *vc;
417
418 data.win_rect.xmin = 0;
419 data.win_rect.ymin = 0;
420 data.win_rect.xmax = vc->region->winx;
421 data.win_rect.ymax = vc->region->winy;
422
423 data.func = func;
424 data.user_data = user_data;
425 data.clip_flag = clip_flag;
426
427 if (clip_flag & V3D_PROJ_TEST_CLIP_BB) {
429 vc->obedit->object_to_world().ptr()); /* for local clipping lookups */
430 }
431
432 if (clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) {
433 data.content_planes_len = content_planes_from_clip_flag(
434 vc->region, vc->obedit, clip_flag, data.content_planes);
435 }
436 else {
437 data.content_planes_len = 0;
438 }
439
442}
443
445
446/* -------------------------------------------------------------------- */
449
455 int index,
456 const float v_a[3],
457 const float v_b[3])
458{
460 BMEdge *eed = BM_edge_at_index(data->vc.em->bm, index);
462 return;
463 }
464
466
467 float v_a_clip[3], v_b_clip[3];
468 if (!clip_segment_v3_plane_n(v_a, v_b, data->vc.rv3d->clip_local, 4, v_a_clip, v_b_clip)) {
469 return;
470 }
471
472 float screen_co_a[2], screen_co_b[2];
474 v_a_clip,
475 v_b_clip,
476 data->clip_flag,
477 &data->win_rect,
478 data->content_planes,
479 data->content_planes_len,
480 screen_co_a,
481 screen_co_b))
482 {
483 return;
484 }
485
486 data->func(data->user_data, eed, screen_co_a, screen_co_b, index);
487}
488
490 void (*func)(void *user_data,
491 BMEdge *eed,
492 const float screen_co_a[2],
493 const float screen_co_b[2],
494 int index),
495 void *user_data,
496 eV3DProjTest clip_flag)
497{
499
501 vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH);
503
505
506 data.vc = *vc;
507
508 data.win_rect.xmin = 0;
509 data.win_rect.ymin = 0;
510 data.win_rect.xmax = vc->region->winx;
511 data.win_rect.ymax = vc->region->winy;
512
513 data.func = func;
514 data.user_data = user_data;
515 data.clip_flag = clip_flag;
516
517 if (clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) {
518 data.content_planes_len = content_planes_from_clip_flag(
519 vc->region, vc->obedit, clip_flag, data.content_planes);
520 }
521 else {
522 data.content_planes_len = 0;
523 }
524
526
527 if ((clip_flag & V3D_PROJ_TEST_CLIP_BB) && (vc->rv3d->clipbb != nullptr)) {
529 vc->rv3d, vc->obedit->object_to_world().ptr()); /* for local clipping lookups. */
532 }
533 else {
536 }
537}
538
540
541/* -------------------------------------------------------------------- */
544
545static void mesh_foreachScreenFace__mapFunc(void *user_data,
546 int index,
547 const float cent[3],
548 const float /*no*/[3])
549{
551 BMFace *efa = BM_face_at_index(data->vc.em->bm, index);
553 return;
554 }
555
556 float screen_co[2];
557 if (ED_view3d_project_float_object(data->vc.region, cent, screen_co, data->clip_flag) !=
559 {
560 return;
561 }
562
563 data->func(data->user_data, efa, screen_co, index);
564}
565
567 const ViewContext *vc,
568 void (*func)(void *user_data, BMFace *efa, const float screen_co_b[2], int index),
569 void *user_data,
570 const eV3DProjTest clip_flag)
571{
572 BLI_assert((clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) == 0);
574
576 vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH);
579
580 data.vc = *vc;
581 data.func = func;
582 data.user_data = user_data;
583 data.clip_flag = clip_flag;
584
586
587 const int face_dot_tags_num = mesh->runtime->subsurf_face_dot_tags.size();
588 if (face_dot_tags_num && (face_dot_tags_num != mesh->verts_num)) {
591 }
592 else {
595 }
596}
597
599
600/* -------------------------------------------------------------------- */
603
605 void (*func)(void *user_data,
606 Nurb *nu,
607 BPoint *bp,
608 BezTriple *bezt,
609 int beztindex,
610 bool handles_visible,
611 const float screen_co_b[2]),
612 void *user_data,
613 const eV3DProjTest clip_flag)
614{
615 Curve *cu = static_cast<Curve *>(vc->obedit->data);
616 int i;
618 /* If no point in the triple is selected, the handles are invisible. */
619 const bool only_selected = (vc->v3d->overlay.handle_display == CURVE_HANDLE_SELECTED);
620
622
623 if (clip_flag & V3D_PROJ_TEST_CLIP_BB) {
625 vc->obedit->object_to_world().ptr()); /* for local clipping lookups */
626 }
627
628 LISTBASE_FOREACH (Nurb *, nu, nurbs) {
629 if (nu->type == CU_BEZIER) {
630 for (i = 0; i < nu->pntsu; i++) {
631 BezTriple *bezt = &nu->bezt[i];
632
633 if (bezt->hide == 0) {
635 (!only_selected || BEZT_ISSEL_ANY(bezt));
636 float screen_co[2];
637
638 if (!handles_visible) {
640 vc->region,
641 bezt->vec[1],
642 screen_co,
644 {
645 func(user_data, nu, nullptr, bezt, 1, false, screen_co);
646 }
647 }
648 else {
650 vc->region,
651 bezt->vec[0],
652 screen_co,
654 {
655 func(user_data, nu, nullptr, bezt, 0, true, screen_co);
656 }
658 vc->region,
659 bezt->vec[1],
660 screen_co,
662 {
663 func(user_data, nu, nullptr, bezt, 1, true, screen_co);
664 }
666 vc->region,
667 bezt->vec[2],
668 screen_co,
670 {
671 func(user_data, nu, nullptr, bezt, 2, true, screen_co);
672 }
673 }
674 }
675 }
676 }
677 else {
678 for (i = 0; i < nu->pntsu * nu->pntsv; i++) {
679 BPoint *bp = &nu->bp[i];
680
681 if (bp->hide == 0) {
682 float screen_co[2];
684 vc->region,
685 bp->vec,
686 screen_co,
688 {
689 func(user_data, nu, bp, nullptr, -1, false, screen_co);
690 }
691 }
692 }
693 }
694 }
695}
696
698
699/* -------------------------------------------------------------------- */
702
704 void (*func)(void *user_data,
705 MetaElem *ml,
706 const float screen_co_b[2]),
707 void *user_data,
708 const eV3DProjTest clip_flag)
709{
710 MetaBall *mb = (MetaBall *)vc->obedit->data;
711
713
714 LISTBASE_FOREACH (MetaElem *, ml, mb->editelems) {
715 float screen_co[2];
716 if (ED_view3d_project_float_object(vc->region, &ml->x, screen_co, clip_flag) ==
718 {
719 func(user_data, ml, screen_co);
720 }
721 }
722}
723
725
726/* -------------------------------------------------------------------- */
729
731 void (*func)(void *user_data, BPoint *bp, const float screen_co[2]),
732 void *user_data,
733 const eV3DProjTest clip_flag)
734{
735 Object *obedit = vc->obedit;
736 Lattice *lt = static_cast<Lattice *>(obedit->data);
737 BPoint *bp = lt->editlatt->latt->def;
738 DispList *dl = obedit->runtime->curve_cache ?
739 BKE_displist_find(&obedit->runtime->curve_cache->disp, DL_VERTS) :
740 nullptr;
741 const float *co = dl ? dl->verts : nullptr;
742 int i, N = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
743
745
746 if (clip_flag & V3D_PROJ_TEST_CLIP_BB) {
748 obedit->object_to_world().ptr()); /* for local clipping lookups */
749 }
750
751 for (i = 0; i < N; i++, bp++, co += 3) {
752 if (bp->hide == 0) {
753 float screen_co[2];
754 if (ED_view3d_project_float_object(vc->region, dl ? co : bp->vec, screen_co, clip_flag) ==
756 {
757 func(user_data, bp, screen_co);
758 }
759 }
760 }
761}
762
764
765/* -------------------------------------------------------------------- */
768
770 void (*func)(void *user_data,
771 EditBone *ebone,
772 const float screen_co_a[2],
773 const float screen_co_b[2]),
774 void *user_data,
775 const eV3DProjTest clip_flag)
776{
777 bArmature *arm = static_cast<bArmature *>(vc->obedit->data);
778
780
781 float content_planes[6][4];
782 int content_planes_len;
783 rctf win_rect;
784
785 if (clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) {
786 content_planes_len = content_planes_from_clip_flag(
787 vc->region, vc->obedit, clip_flag, content_planes);
788 win_rect.xmin = 0;
789 win_rect.ymin = 0;
790 win_rect.xmax = vc->region->winx;
791 win_rect.ymax = vc->region->winy;
792 }
793 else {
794 content_planes_len = 0;
795 }
796
797 LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) {
798 if (!blender::animrig::bone_is_visible(arm, ebone)) {
799 continue;
800 }
801
802 float screen_co_a[2], screen_co_b[2];
803 const float *v_a = ebone->head, *v_b = ebone->tail;
804
805 if (clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) {
807 v_a,
808 v_b,
809 clip_flag,
810 &win_rect,
811 content_planes,
812 content_planes_len,
813 screen_co_a,
814 screen_co_b))
815 {
816 continue;
817 }
818 }
819 else {
821 vc->region, v_a, v_b, clip_flag, screen_co_a, screen_co_b))
822 {
823 continue;
824 }
825 }
826
827 func(user_data, ebone, screen_co_a, screen_co_b);
828 }
829}
830
832
833/* -------------------------------------------------------------------- */
836
838 void (*func)(void *user_data,
839 bPoseChannel *pchan,
840 const float screen_co_a[2],
841 const float screen_co_b[2]),
842 void *user_data,
843 const eV3DProjTest clip_flag)
844{
845 /* Almost _exact_ copy of #armature_foreachScreenBone */
846
847 const Object *ob_eval = DEG_get_evaluated(vc->depsgraph, vc->obact);
848 const bArmature *arm_eval = static_cast<const bArmature *>(ob_eval->data);
849 bPose *pose = vc->obact->pose;
850
852
853 float content_planes[6][4];
854 int content_planes_len;
855 rctf win_rect;
856
857 if (clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) {
858 content_planes_len = content_planes_from_clip_flag(
859 vc->region, ob_eval, clip_flag, content_planes);
860 win_rect.xmin = 0;
861 win_rect.ymin = 0;
862 win_rect.xmax = vc->region->winx;
863 win_rect.ymax = vc->region->winy;
864 }
865 else {
866 content_planes_len = 0;
867 }
868
869 LISTBASE_FOREACH (bPoseChannel *, pchan, &pose->chanbase) {
870 if (!blender::animrig::bone_is_visible(arm_eval, pchan)) {
871 continue;
872 }
873
874 bPoseChannel *pchan_eval = BKE_pose_channel_find_name(ob_eval->pose, pchan->name);
875 float screen_co_a[2], screen_co_b[2];
876 const float *v_a = pchan_eval->pose_head, *v_b = pchan_eval->pose_tail;
877
878 if (clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) {
880 v_a,
881 v_b,
882 clip_flag,
883 &win_rect,
884 content_planes,
885 content_planes_len,
886 screen_co_a,
887 screen_co_b))
888 {
889 continue;
890 }
891 }
892 else {
894 vc->region, v_a, v_b, clip_flag, screen_co_a, screen_co_b))
895 {
896 continue;
897 }
898 }
899
900 func(user_data, pchan, screen_co_a, screen_co_b);
901 }
902}
903
Functions to deal with Armatures.
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
ListBase * BKE_curve_editNurbs_get(Curve *cu)
Definition curve.cc:419
const CustomData_MeshMasks CD_MASK_BAREMESH
display list (or rather multi purpose list) stuff.
DispList * BKE_displist_find(struct ListBase *lb, int type)
Definition displist.cc:71
@ DL_VERTS
@ MESH_FOREACH_NOP
void BKE_mesh_foreach_mapped_edge(Mesh *mesh, int tot_edges, void(*func)(void *user_data, int index, const float v0co[3], const float v1co[3]), void *user_data)
void BKE_mesh_foreach_mapped_face_center(Mesh *mesh, void(*func)(void *user_data, int index, const float cent[3], const float no[3]), void *user_data, MeshForeachFlag flag)
void BKE_mesh_foreach_mapped_subdiv_face_center(Mesh *mesh, void(*func)(void *user_data, int index, const float cent[3], const float no[3]), void *user_data, MeshForeachFlag flag)
void BKE_mesh_foreach_mapped_vert(const Mesh *mesh, void(*func)(void *user_data, int index, const float co[3], const float no[3]), void *user_data, MeshForeachFlag flag)
Mesh * BKE_mesh_wrapper_ensure_subdivision(Mesh *mesh)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_evaluated_mesh(const Object *object_eval)
#define BLI_assert(a)
Definition BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
bool clip_segment_v3_plane_n(const float p1[3], const float p2[3], const float plane_array[][4], int plane_num, float r_p1[3], float r_p2[3])
void planes_from_projmat(const float mat[4][4], float left[4], float right[4], float bottom[4], float top[4], float near[4], float far[4])
bool BLI_rctf_isect_segment(const struct rctf *rect, const float s1[2], const float s2[2])
#define UNLIKELY(x)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ CU_BEZIER
#define BEZT_ISSEL_ANY(bezt)
Object is a sort of wrapper for general info.
@ CURVE_HANDLE_NONE
@ CURVE_HANDLE_SELECTED
void ED_view3d_check_mats_rv3d(RegionView3D *rv3d)
eV3DProjTest
Definition ED_view3d.hh:278
@ V3D_PROJ_TEST_CLIP_FAR
Definition ED_view3d.hh:283
@ V3D_PROJ_TEST_CLIP_NEAR
Definition ED_view3d.hh:282
@ V3D_PROJ_TEST_CLIP_CONTENT
Definition ED_view3d.hh:305
@ V3D_PROJ_TEST_CLIP_WIN
Definition ED_view3d.hh:281
@ V3D_PROJ_TEST_CLIP_BB
Definition ED_view3d.hh:280
eV3DProjStatus ED_view3d_project_float_object(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
eV3DProjStatus
Definition ED_view3d.hh:255
@ V3D_PROJ_RET_CLIP_WIN
Definition ED_view3d.hh:271
@ V3D_PROJ_RET_CLIP_BB
Definition ED_view3d.hh:269
@ V3D_PROJ_RET_OK
Definition ED_view3d.hh:256
void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4])
blender::float4x4 ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const Object *ob)
#define IS_CLIPPED
Definition ED_view3d.hh:252
@ BM_ELEM_HIDDEN
#define BM_elem_flag_test(ele, hflag)
BMesh const char void * data
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
BLI_INLINE BMEdge * BM_edge_at_index(BMesh *bm, const int index)
BLI_INLINE BMVert * BM_vert_at_index(BMesh *bm, const int index)
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
#define BM_FACE
#define BM_EDGE
#define BM_VERT
AttributeSet attributes
GAttributeReader lookup(const StringRef attribute_id) const
int count
static bool handles_visible(KeyframeEditData *ked, BezTriple *bezt)
#define N
bool bone_is_visible(const bArmature *armature, const Bone *bone)
Mesh * editbmesh_get_eval_cage_from_orig(Depsgraph *depsgraph, const Scene *scene, Object *obedit, const CustomData_MeshMasks *dataMask)
MatBase< float, 4, 4 > float4x4
void * regiondata
int totedge
float vec[4]
float vec[3][3]
float * verts
float tail[3]
float head[3]
struct Lattice * latt
struct EditLatt * editlatt
struct BPoint * def
MeshRuntimeHandle * runtime
int verts_num
ListBase * editelems
short type
BezTriple * bezt
BPoint * bp
struct bPose * pose
ObjectRuntimeHandle * runtime
struct BoundBox * clipbb
View3DOverlay overlay
RegionView3D * rv3d
Definition ED_view3d.hh:80
ARegion * region
Definition ED_view3d.hh:77
Scene * scene
Definition ED_view3d.hh:73
BMEditMesh * em
Definition ED_view3d.hh:81
View3D * v3d
Definition ED_view3d.hh:78
Object * obact
Definition ED_view3d.hh:75
Object * obedit
Definition ED_view3d.hh:76
Depsgraph * depsgraph
Definition ED_view3d.hh:72
ListBase * edbo
ListBase chanbase
const c_style_mat & ptr() const
void(* func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
void(* func)(void *user_data, BMFace *efa, const float screen_co_b[2], int index)
blender::VArraySpan< bool > hide_vert
void(* func)(void *user_data, const float screen_co[2], int index)
void(* func)(void *user_data, BMVert *eve, const float screen_co[2], int index)
float xmax
float xmin
float ymax
float ymin
i
Definition text_draw.cc:230
void pose_foreachScreenBone(const ViewContext *vc, void(*func)(void *user_data, bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2]), void *user_data, const eV3DProjTest clip_flag)
void mesh_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BMVert *eve, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
static void mesh_foreachScreenVert__mapFunc(void *user_data, int index, const float co[3], const float[3])
static bool view3d_project_segment_to_screen_with_clip_tag(const ARegion *region, const float v_a[3], const float v_b[3], const eV3DProjTest clip_flag, float r_screen_co_a[2], float r_screen_co_b[2])
static void mesh_foreachScreenEdge__mapFunc(void *user_data, int index, const float v_a[3], const float v_b[3])
void mesh_foreachScreenFace(const ViewContext *vc, void(*func)(void *user_data, BMFace *efa, const float screen_co_b[2], int index), void *user_data, const eV3DProjTest clip_flag)
void mesh_foreachScreenEdge(const ViewContext *vc, void(*func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *user_data, eV3DProjTest clip_flag)
void armature_foreachScreenBone(const ViewContext *vc, void(*func)(void *user_data, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2]), void *user_data, const eV3DProjTest clip_flag)
static void mesh_foreachScreenFace__mapFunc(void *user_data, int index, const float cent[3], const float[3])
static void meshobject_foreachScreenVert__mapFunc(void *user_data, int index, const float co[3], const float[3])
void mball_foreachScreenElem(const ViewContext *vc, void(*func)(void *user_data, MetaElem *ml, const float screen_co_b[2]), void *user_data, const eV3DProjTest clip_flag)
void nurbs_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, bool handles_visible, const float screen_co_b[2]), void *user_data, const eV3DProjTest clip_flag)
static void mesh_foreachScreenEdge_clip_bb_segment__mapFunc(void *user_data, int index, const float v_a[3], const float v_b[3])
static int content_planes_from_clip_flag(const ARegion *region, const Object *ob, const eV3DProjTest clip_flag, float planes[6][4])
void mesh_foreachScreenEdge_clip_bb_segment(const ViewContext *vc, void(*func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *user_data, eV3DProjTest clip_flag)
void lattice_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BPoint *bp, const float screen_co[2]), void *user_data, const eV3DProjTest clip_flag)
void meshobject_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
static bool view3d_project_segment_to_screen_with_content_clip_planes(const ARegion *region, const float v_a[3], const float v_b[3], const eV3DProjTest clip_flag, const rctf *win_rect, const float content_planes[][4], const int content_planes_len, float r_screen_co_a[2], float r_screen_co_b[2])