63 float *clip_xmin =
nullptr, *clip_xmax =
nullptr;
64 float *clip_ymin =
nullptr, *clip_ymax =
nullptr;
65 float *clip_zmin =
nullptr, *clip_zmax =
nullptr;
76 clip_zmin = planes[planes_len++];
79 clip_xmin = planes[planes_len++];
80 clip_xmax = planes[planes_len++];
81 clip_ymin = planes[planes_len++];
82 clip_ymax = planes[planes_len++];
85 clip_zmax = planes[planes_len++];
89 if (planes_len != 0) {
93 projection.
ptr(), clip_xmin, clip_xmax, clip_ymin, clip_ymax, clip_zmin, clip_zmax);
111 const rctf *win_rect,
112 const float content_planes[][4],
113 const int content_planes_len,
115 float r_screen_co_a[2],
116 float r_screen_co_b[2])
119 eV3DProjTest clip_flag_nowin = clip_flag & ~V3D_PROJ_TEST_CLIP_WIN;
122 region, v_a, r_screen_co_a, clip_flag_nowin);
124 region, v_b, r_screen_co_b, clip_flag_nowin);
134 if (content_planes_len == 0) {
149 float v_a_clip[3], v_b_clip[3];
178 float r_screen_co_a[2],
179 float r_screen_co_b[2])
228 const float screen_co_a[2],
229 const float screen_co_b[2],
272 if (!data->hide_vert.is_empty() && data->hide_vert[index]) {
284 data->
func(data->user_data, screen_co, index);
288 void (*func)(
void *user_data,
289 const float screen_co[2],
306 data.user_data = user_data;
307 data.clip_flag = clip_flag;
308 data.hide_vert = *attributes.lookup<
bool>(
".hide_vert", bke::AttrDomain::Point);
336 data->func(data->user_data, eve, screen_co, index);
341 void (*func)(
void *user_data,
BMVert *eve,
const float screen_co[2],
int index),
355 data.user_data = user_data;
356 data.clip_flag = clip_flag;
360 vc->
obedit->object_to_world().ptr());
384 float screen_co_a[2], screen_co_b[2];
390 data->content_planes,
391 data->content_planes_len,
398 data->func(data->user_data, eed, screen_co_a, screen_co_b, index);
402 void (*func)(
void *user_data,
404 const float screen_co_a[2],
405 const float screen_co_b[2],
420 data.win_rect.xmin = 0;
421 data.win_rect.ymin = 0;
426 data.user_data = user_data;
427 data.clip_flag = clip_flag;
431 vc->
obedit->object_to_world().ptr());
436 vc->
region, vc->
obedit, clip_flag, data.content_planes);
439 data.content_planes_len = 0;
469 float v_a_clip[3], v_b_clip[3];
474 float screen_co_a[2], screen_co_b[2];
480 data->content_planes,
481 data->content_planes_len,
488 data->func(data->user_data, eed, screen_co_a, screen_co_b, index);
492 void (*func)(
void *user_data,
494 const float screen_co_a[2],
495 const float screen_co_b[2],
510 data.win_rect.xmin = 0;
511 data.win_rect.ymin = 0;
516 data.user_data = user_data;
517 data.clip_flag = clip_flag;
521 vc->
region, vc->
obedit, clip_flag, data.content_planes);
524 data.content_planes_len = 0;
531 vc->
rv3d, vc->
obedit->object_to_world().ptr());
565 data->func(data->user_data, efa, screen_co, index);
570 void (*func)(
void *user_data,
BMFace *efa,
const float screen_co_b[2],
int index),
584 data.user_data = user_data;
585 data.clip_flag = clip_flag;
589 const int face_dot_tags_num = mesh->runtime->subsurf_face_dot_tags.size();
590 if (face_dot_tags_num && (face_dot_tags_num != mesh->verts_num)) {
607 void (*func)(
void *user_data,
612 bool handles_visible,
613 const float screen_co_b[2]),
627 vc->
obedit->object_to_world().ptr());
632 for (i = 0; i < nu->
pntsu; i++) {
635 if (bezt->
hide == 0) {
640 if (!handles_visible) {
647 func(user_data, nu,
nullptr, bezt, 1,
false, screen_co);
657 func(user_data, nu,
nullptr, bezt, 0,
true, screen_co);
665 func(user_data, nu,
nullptr, bezt, 1,
true, screen_co);
673 func(user_data, nu,
nullptr, bezt, 2,
true, screen_co);
691 func(user_data, nu, bp,
nullptr, -1,
false, screen_co);
706 void (*func)(
void *user_data,
708 const float screen_co_b[2]),
721 func(user_data, ml, screen_co);
733 void (*func)(
void *user_data,
BPoint *bp,
const float screen_co[2]),
743 const float *co = dl ? dl->
verts :
nullptr;
750 obedit->object_to_world().ptr());
753 for (i = 0; i <
N; i++, bp++, co += 3) {
759 func(user_data, bp, screen_co);
772 void (*func)(
void *user_data,
774 const float screen_co_a[2],
775 const float screen_co_b[2]),
783 float content_planes[6][4];
784 int content_planes_len;
796 content_planes_len = 0;
804 float screen_co_a[2], screen_co_b[2];
805 const float *v_a = ebone->
head, *v_b = ebone->
tail;
823 vc->
region, v_a, v_b, clip_flag, screen_co_a, screen_co_b))
829 func(user_data, ebone, screen_co_a, screen_co_b);
840 void (*func)(
void *user_data,
842 const float screen_co_a[2],
843 const float screen_co_b[2]),
855 float content_planes[6][4];
856 int content_planes_len;
861 vc->
region, ob_eval, clip_flag, content_planes);
868 content_planes_len = 0;
877 float screen_co_a[2], screen_co_b[2];
896 vc->
region, v_a, v_b, clip_flag, screen_co_a, screen_co_b))
902 func(user_data, pchan, screen_co_a, screen_co_b);
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
#define PBONE_VISIBLE(arm, bone)
ListBase * BKE_curve_editNurbs_get(Curve *cu)
const CustomData_MeshMasks CD_MASK_BAREMESH
display list (or rather multi purpose list) stuff.
DispList * BKE_displist_find(struct ListBase *lb, int type)
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 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])
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#define BEZT_ISSEL_ANY(bezt)
Object is a sort of wrapper for general info.
#define EBONE_VISIBLE(arm, ebone)
void ED_view3d_check_mats_rv3d(RegionView3D *rv3d)
@ V3D_PROJ_TEST_CLIP_NEAR
@ V3D_PROJ_TEST_CLIP_CONTENT
eV3DProjStatus ED_view3d_project_float_object(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
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 BM_elem_flag_test(ele, hflag)
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)
Mesh * editbmesh_get_eval_cage_from_orig(Depsgraph *depsgraph, const Scene *scene, Object *obedit, const CustomData_MeshMasks *dataMask)
struct EditLatt * editlatt
ObjectRuntimeHandle * runtime
const c_style_mat & ptr() const
float content_planes[6][4]
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)
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])