Blender
V3.3
|
#include "intern/bmesh_structure_inline.h"
Go to the source code of this file.
The lowest level of functionality for manipulating bmesh structures. None of these functions should ever be exported to the rest of Blender.
in the vast majority of cases there shouldn't be used directly. if absolutely necessary, see function definitions in code for descriptive comments. but seriously, don't use this stuff.
Definition in file bmesh_structure.h.
NOTE(@joeedh): this is somewhat outdated, though bits of its API are still used.
Cycles are circular doubly linked lists that form the basis of adjacency information in the BME modeler. Full adjacency relations can be derived from examining these cycles very quickly. Although each cycle is a double circular linked list, each one is considered to have a 'base' or 'head', and care must be taken by Euler code when modifying the contents of a cycle.
The contents of this file are split into two parts. First there are the bmesh_cycle family of functions which are generic circular double linked list procedures. The second part contains higher level procedures for supporting modification of specific cycle types.
The three cycles explicitly stored in the BM data structure are as follows: 1: The Disk Cycle - A circle of edges around a vertex Base: vertex->edge pointer.
This cycle is the most complicated in terms of its structure. Each bmesh_Edge contains two bmesh_CycleNode structures to keep track of that edges membership in the disk cycle of each of its vertices. However for any given vertex it may be the first in some edges in its disk cycle and the second for others. The bmesh_disk_XXX family of functions contain some nice utilities for navigating disk cycles in a way that hides this detail from the tool writer.
Note that the disk cycle is completely independent from face data. One advantage of this is that wire edges are fully integrated into the topology database. Another is that the the disk cycle has no problems dealing with non-manifold conditions involving faces.
Functions relating to this cycle:
The radial cycle is similar to the radial cycle in the radial edge data structure.* Unlike the radial edge however, the radial cycle does not require a large amount of memory to store non-manifold conditions since BM does not keep track of region/shell information.
Functions relating to this cycle:
The loop cycle keeps track of a faces vertices and edges. It should be noted that the direction of a loop cycle is either CW or CCW depending on the face normal, and is not oriented to the faces edit-edges.
Functions relating to this cycle:
Definition at line 136 of file bmesh_structure.c.
References BMVert::e, e, BMDiskLink::next, NULL, BMDiskLink::prev, and v.
Referenced by BM_edge_create(), bmesh_disk_vert_replace(), and bmesh_kernel_split_edge_make_vert().
Definition at line 183 of file bmesh_structure.c.
References BM_verts_in_edge(), bmesh_disk_edge_next(), NULL, v1, and v2.
BLI_INLINE BMEdge* bmesh_disk_edge_next | ( | const BMEdge * | e, |
const BMVert * | v | ||
) |
Referenced by bm_decim_edge_collapse(), BM_disk_dissolve(), bm_edge_collapse_is_degenerate_topology(), BM_edge_exists(), BM_edge_find_double(), bm_edges_sort_winding(), BM_mesh_separate_faces(), BM_vert_calc_edge_angle_ex(), BM_vert_calc_normal(), BM_vert_calc_normal_ex(), BM_vert_collapse_edge(), BM_vert_collapse_faces(), BM_vert_face_check(), BM_vert_hide_set(), BM_vert_is_boundary(), bm_vert_is_edge_select_any_other(), bm_vert_is_edge_visible_any(), BM_vert_is_manifold(), bm_vert_is_manifold_flagged(), BM_vert_is_wire(), BM_vert_normal_update_all(), bm_vert_systag_count_disk(), bmesh_disk_count(), bmesh_disk_count_at_most(), bmesh_disk_edge_exists(), bmesh_disk_faceedge_find_first(), bmesh_disk_faceedge_find_next(), bmesh_disk_faceloop_find_first(), bmesh_disk_faceloop_find_first_visible(), bmesh_disk_facevert_count(), bmesh_disk_facevert_count_at_most(), bmesh_disk_validate(), bmesh_kernel_join_edge_kill_vert(), bmesh_kernel_unglue_region_make_vert(), bmesh_kernel_unglue_region_make_vert_multi(), bmesh_kernel_vert_separate(), and bmiter__edge_of_vert_step().
BLI_INLINE BMEdge* bmesh_disk_edge_next_safe | ( | const BMEdge * | e, |
const BMVert * | v | ||
) |
BLI_INLINE BMEdge* bmesh_disk_edge_prev | ( | const BMEdge * | e, |
const BMVert * | v | ||
) |
Referenced by bmesh_disk_validate().
BLI_INLINE BMEdge* bmesh_disk_edge_prev_safe | ( | const BMEdge * | e, |
const BMVert * | v | ||
) |
Definition at line 161 of file bmesh_structure.c.
References BMVert::e, e, BMDiskLink::next, NULL, BMDiskLink::prev, and v.
Referenced by BM_edge_kill(), BM_face_kill_loose(), bmesh_disk_vert_replace(), bmesh_kernel_join_edge_kill_vert(), bmesh_kernel_join_face_kill_edge(), and bmesh_kernel_split_edge_make_vert().
FIND FIRST FACE EDGE.
Finds the first edge in a vertices Disk cycle that has one of this vert's loops attached to it.
Definition at line 289 of file bmesh_structure.c.
References bmesh_disk_edge_next(), BMLoop::e, e, BMEdge::l, BMLoop::next, NULL, BMLoop::v, and v.
Definition at line 330 of file bmesh_structure.c.
References bmesh_disk_edge_next(), bmesh_radial_facevert_check(), e, BMEdge::l, and v.
Referenced by bmiter__face_of_vert_step(), and bmiter__loop_of_vert_step().
Special case for BM_LOOPS_OF_VERT & BM_FACES_OF_VERT, avoids 2x calls.
The returned BMLoop.e matches the result of bmesh_disk_faceedge_find_first
Definition at line 300 of file bmesh_structure.c.
References bmesh_disk_edge_next(), e, BMEdge::l, BMLoop::next, NULL, BMLoop::v, and v.
Referenced by BM_vert_find_first_loop(), bmiter__face_of_vert_begin(), and bmiter__loop_of_vert_begin().
A version of bmesh_disk_faceloop_find_first that ignores hidden faces.
Definition at line 311 of file bmesh_structure.c.
References BM_elem_flag_test, BM_ELEM_HIDDEN, bmesh_disk_edge_next(), e, BMLoop::f, BMEdge::l, BMLoop::next, NULL, BMLoop::radial_next, BMLoop::v, and v.
Referenced by BM_vert_find_first_loop_visible().
int bmesh_disk_facevert_count | ( | const BMVert * | v | ) |
DISK COUNT FACE VERT.
Counts the number of loop users for this vertex. Note that this is equivalent to counting the number of faces incident upon this vertex
Definition at line 250 of file bmesh_structure.c.
References bmesh_disk_edge_next(), bmesh_radial_facevert_count(), count, BMVert::e, BMEdge::l, and v.
Referenced by BM_vert_face_count(), bmiter__face_of_vert_begin(), and bmiter__loop_of_vert_begin().
int bmesh_disk_facevert_count_at_most | ( | const BMVert * | v, |
int | count_max | ||
) |
Definition at line 268 of file bmesh_structure.c.
References bmesh_disk_edge_next(), bmesh_radial_facevert_count_at_most(), count, BMVert::e, BMEdge::l, and v.
Referenced by BM_vert_face_count_at_most().
Definition at line 229 of file bmesh_structure.c.
References BM_vert_in_edge(), bmesh_disk_count_at_most(), bmesh_disk_edge_next(), bmesh_disk_edge_prev(), e, len, and v.
Referenced by bmesh_kernel_join_edge_kill_vert(), and bmesh_kernel_split_edge_make_vert().
Definition at line 57 of file bmesh_structure.c.
References BLI_assert, bmesh_disk_edge_append(), bmesh_disk_edge_remove(), bmesh_disk_vert_swap(), and e.
Referenced by BM_vert_separate_tested_edges(), bmesh_edge_vert_swap(), bmesh_edge_vert_swap__recursive(), bmesh_kernel_join_edge_kill_vert(), bmesh_kernel_split_edge_make_vert(), and bmesh_kernel_unglue_region_make_vert_multi().
MISC utility functions.
Definition at line 19 of file bmesh_structure.c.
References BLI_assert, e, and NULL.
Referenced by bmesh_disk_vert_replace().
Handles all connected data, use with care.
Assumes caller has setup correct state before the swap is done.
Definition at line 34 of file bmesh_structure.c.
References BLI_assert, bmesh_disk_vert_replace(), e, BMLoop::next, BMLoop::prev, BMLoop::radial_next, and BMLoop::v.
Referenced by BM_vert_splice(), bmesh_kernel_join_vert_kill_edge(), bmesh_kernel_unglue_region_make_vert(), and bmesh_kernel_vert_separate().
Definition at line 536 of file bmesh_structure.c.
References BM_FACE_FIRST_LOOP, BMLoop::f, BMFace::len, len, BMLoop::next, next, NULL, blender::meshintersect::prev(), and BMLoop::prev.
Referenced by bmesh_kernel_join_edge_kill_vert(), and bmesh_kernel_join_face_kill_edge().
BME RADIAL FIND FIRST FACE VERT.
Finds the first loop of v around radial cycle
Definition at line 442 of file bmesh_structure.c.
References l, NULL, BMLoop::radial_next, BMLoop::v, and v.
Referenced by bmiter__face_of_vert_step(), and bmiter__loop_of_vert_step().
Definition at line 454 of file bmesh_structure.c.
References l, BMLoop::radial_next, BMLoop::v, and v.
Referenced by bmiter__face_of_vert_step(), and bmiter__loop_of_vert_step().
RADIAL CHECK FACE VERT.
Quicker check for bmesh_radial_facevert_count(...) != 0
.
Definition at line 523 of file bmesh_structure.c.
References l, BMLoop::radial_next, BMLoop::v, and v.
Referenced by bmesh_disk_faceedge_find_next().
RADIAL COUNT FACE VERT.
Returns the number of times a vertex appears in a radial cycle
Definition at line 492 of file bmesh_structure.c.
References count, l, BMLoop::radial_next, BMLoop::v, and v.
Referenced by bmesh_disk_facevert_count().
Definition at line 506 of file bmesh_structure.c.
References count, l, BMLoop::radial_next, BMLoop::v, and v.
Referenced by bmesh_disk_facevert_count_at_most().
Definition at line 375 of file bmesh_structure.c.
References BMESH_ASSERT, BMLoop::e, e, l, NULL, BMLoop::radial_next, BMLoop::radial_prev, and UNLIKELY.
Referenced by BM_edge_splice(), bm_face_boundary_add(), BM_face_create(), bmesh_kernel_edge_separate(), bmesh_kernel_loop_reverse(), bmesh_kernel_split_edge_make_vert(), bmesh_kernel_split_face_make_edge(), and bmesh_kernel_unglue_region_make_vert_multi().
BMESH RADIAL REMOVE LOOP.
Removes a loop from an radial cycle. If edge e is non-NULL it should contain the radial cycle, and it will also get updated (in the case that the edge's link into the radial cycle was the loop which is being removed from the cycle).
Definition at line 399 of file bmesh_structure.c.
References BMESH_ASSERT, BMLoop::e, e, l, NULL, BMLoop::radial_next, BMLoop::radial_prev, and UNLIKELY.
Referenced by BM_edge_splice(), BM_face_kill(), BM_face_kill_loose(), bmesh_kernel_edge_separate(), bmesh_kernel_loop_reverse(), and bmesh_kernel_unglue_region_make_vert_multi().
A version of bmesh_radial_loop_remove which only performs the radial unlink, leaving the edge untouched.
Definition at line 429 of file bmesh_structure.c.
References BMLoop::e, l, NULL, BMLoop::radial_next, and BMLoop::radial_prev.
Referenced by bmesh_kernel_split_edge_make_vert().
Definition at line 342 of file bmesh_structure.c.
References BM_LOOP_RADIAL_MAX, BMESH_ASSERT, bmesh_radial_length(), BMLoop::e, ELEM, l, BMLoop::radial_next, UNLIKELY, BMLoop::v, BMEdge::v1, and BMEdge::v2.
Referenced by bmesh_elem_check(), bmesh_kernel_join_edge_kill_vert(), and bmesh_kernel_split_edge_make_vert().