|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "BLI_ghash.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_mempool.h"#include "BLI_utildefines.h"#include "BKE_customdata.h"#include "bmesh.h"#include "bmesh_log.h"#include "range_tree.h"#include "BLI_strict_flags.h"Go to the source code of this file.
Classes | |
| struct | BMLogEntry |
| struct | BMLog |
| struct | BMLogVert |
| struct | BMLogFace |
Macros | |
| #define | logkey_hash BLI_ghashutil_inthash_p_simple |
| #define | logkey_cmp BLI_ghashutil_intcmp |
The BMLog is an interface for storing undo/redo steps as a BMesh is modified. It only stores changes to the BMesh, not full copies.
Currently it supports the following types of changes:
Definition in file bmesh_log.c.
| #define logkey_cmp BLI_ghashutil_intcmp |
Definition at line 126 of file bmesh_log.c.
| #define logkey_hash BLI_ghashutil_inthash_p_simple |
Definition at line 125 of file bmesh_log.c.
Definition at line 987 of file bmesh_log.c.
References BLI_ghash_len(), BLI_ghash_reserve(), bm, BM_FACES_OF_MESH, BM_ITER_MESH, BM_log_face_added(), BM_log_vert_added(), BM_VERTS_OF_MESH, CD_PAINT_MASK, CustomData_get_offset(), KDL::log(), BMesh::totface, BMesh::totvert, v, and BMesh::vdata.
Referenced by sculpt_symmetrize_exec(), and sculpt_undo_bmesh_push().
Definition at line 361 of file bmesh_log.c.
References bm, BM_FACES_OF_MESH, BM_ITER_MESH, bm_log_face_id_set(), bm_log_vert_id_set(), BM_VERTS_OF_MESH, KDL::log(), and v.
Referenced by BM_log_create().
Definition at line 1015 of file bmesh_log.c.
References bm, BM_FACES_OF_MESH, BM_ITER_MESH, BM_log_face_removed(), BM_log_vert_removed(), BM_VERTS_OF_MESH, CD_PAINT_MASK, CustomData_get_offset(), KDL::log(), v, and BMesh::vdata.
Referenced by sculpt_symmetrize_exec(), and sculpt_undo_bmesh_push().
| void BM_log_cleanup_entry | ( | BMLogEntry * | entry | ) |
Definition at line 487 of file bmesh_log.c.
References BMLogEntry::added_faces, BMLogEntry::added_verts, BLI_ghash_clear(), bm_log_id_ghash_retake(), BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, KDL::log(), BMLogEntry::log, BMLogEntry::modified_faces, BMLogEntry::modified_verts, and NULL.
Definition at line 441 of file bmesh_log.c.
References BLI_ghash_insert(), BLI_ghash_int_new_ex(), POINTER_FROM_UINT, and uint_compare().
Referenced by BM_log_mesh_elems_reorder().
Definition at line 472 of file bmesh_log.c.
References BLI_ghash_new_ex(), BLI_ghash_ptr_new_ex(), bm, bm_log_assign_ids(), KDL::log(), logkey_cmp, logkey_hash, MEM_callocN, BMesh::totface, and BMesh::totvert.
Referenced by BM_log_from_existing_entries_create(), and SCULPT_dynamic_topology_enable_ex().
| BMLogEntry* BM_log_current_entry | ( | BMLog * | log | ) |
Definition at line 1106 of file bmesh_log.c.
References KDL::log().
| BMLogEntry* BM_log_entry_add | ( | BMLog * | log | ) |
Definition at line 652 of file bmesh_log.c.
References BLI_addtail(), BLI_freelinkN(), bm_log_entry_create(), bm_log_entry_free(), KDL::log(), BMLogEntry::log, BMLogEntry::next, and next.
Referenced by sculpt_undo_bmesh_push().
|
static |
Definition at line 381 of file bmesh_log.c.
References BMLogEntry::added_faces, BMLogEntry::added_verts, BLI_ghash_new(), BLI_mempool_create(), BLI_MEMPOOL_NOP, BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, logkey_cmp, logkey_hash, MEM_callocN, BMLogEntry::modified_faces, BMLogEntry::modified_verts, BMLogEntry::pool_faces, and BMLogEntry::pool_verts.
Referenced by BM_log_entry_add().
| void BM_log_entry_drop | ( | BMLogEntry * | entry | ) |
Definition at line 688 of file bmesh_log.c.
References BMLogEntry::added_faces, BMLogEntry::added_verts, BLI_assert, BLI_freelinkN(), bm_log_entry_free(), bm_log_id_ghash_release(), KDL::log(), BMLogEntry::log, MEM_freeN, BMLogEntry::next, NULL, and BMLogEntry::prev.
Referenced by sculpt_undo_free_list().
|
static |
Definition at line 401 of file bmesh_log.c.
References BMLogEntry::added_faces, BMLogEntry::added_verts, BLI_ghash_free(), BLI_mempool_destroy(), BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, BMLogEntry::modified_faces, BMLogEntry::modified_verts, NULL, BMLogEntry::pool_faces, and BMLogEntry::pool_verts.
Referenced by BM_log_entry_add(), and BM_log_entry_drop().
Definition at line 894 of file bmesh_log.c.
References BLI_assert, BLI_ghash_insert(), bm_log_face_alloc(), bm_log_face_id_set(), BMFace::len, KDL::log(), and POINTER_FROM_UINT.
Referenced by BM_log_all_added(), and pbvh_bmesh_face_create().
Definition at line 220 of file bmesh_log.c.
References BLI_assert, BLI_mempool_alloc(), BM_face_as_array_vert_tri(), bm_log_vert_id_get(), BMFace::head, BMHeader::hflag, BMLogFace::hflag, BMFace::len, KDL::log(), BMLogEntry::pool_faces, v, and BMLogFace::v_ids.
Referenced by BM_log_face_added(), BM_log_face_modified(), and BM_log_face_removed().
Definition at line 169 of file bmesh_log.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), KDL::log(), and POINTER_FROM_UINT.
Referenced by bm_log_face_values_swap(), and bm_log_faces_unmake().
Definition at line 153 of file bmesh_log.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), KDL::log(), and POINTER_AS_UINT.
Referenced by BM_log_face_modified(), BM_log_face_removed(), and BM_log_mesh_elems_reorder().
Definition at line 160 of file bmesh_log.c.
References BLI_ghash_reinsert(), KDL::log(), NULL, and POINTER_FROM_UINT.
Referenced by bm_log_assign_ids(), BM_log_face_added(), and bm_log_faces_restore().
Definition at line 878 of file bmesh_log.c.
References BLI_ghash_insert(), bm_log_face_alloc(), bm_log_face_id_get(), KDL::log(), and POINTER_FROM_UINT.
Referenced by sculpt_undo_bmesh_push().
Definition at line 965 of file bmesh_log.c.
References BMLogEntry::added_faces, BLI_assert, BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_remove(), bm_log_face_alloc(), bm_log_face_id_get(), BMLogEntry::deleted_faces, KDL::log(), NULL, and POINTER_FROM_UINT.
Referenced by BM_log_before_all_removed(), and pbvh_bmesh_face_remove().
Definition at line 345 of file bmesh_log.c.
References BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), bm_log_face_from_id(), faces, GHASH_ITER, BMFace::head, BMHeader::hflag, BMLogFace::hflag, KDL::log(), POINTER_AS_UINT, and SWAP.
Referenced by BM_log_redo(), and BM_log_undo().
Definition at line 302 of file bmesh_log.c.
References BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), bm, BM_CREATE_NOP, BM_face_create_verts(), bm_log_face_id_set(), bm_log_vert_from_id(), faces, GHASH_ITER, BMFace::head, BMHeader::hflag, BMLogFace::hflag, KDL::log(), NULL, POINTER_AS_UINT, v, and BMLogFace::v_ids.
Referenced by BM_log_redo(), and BM_log_undo().
Definition at line 260 of file bmesh_log.c.
References BLI_ghashIterator_getKey(), bm, BM_edge_is_wire(), BM_edge_kill(), BM_FACE_FIRST_LOOP, BM_face_kill(), bm_log_face_from_id(), BMLoop::e, faces, GHASH_ITER, KDL::log(), BMLoop::next, and POINTER_AS_UINT.
Referenced by BM_log_redo(), and BM_log_undo().
| void BM_log_free | ( | BMLog * | log | ) |
Definition at line 559 of file bmesh_log.c.
References BLI_ghash_free(), KDL::log(), BMLogEntry::log, MEM_freeN, BMLogEntry::next, and NULL.
Referenced by BKE_sculptsession_free(), and SCULPT_dynamic_topology_disable_ex().
| BMLog* BM_log_from_existing_entries_create | ( | BMesh * | bm, |
| BMLogEntry * | entry | ||
| ) |
Definition at line 517 of file bmesh_log.c.
References BMLogEntry::added_faces, BMLogEntry::added_verts, bm, BM_log_create(), bm_log_id_ghash_retake(), BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, KDL::log(), BMLogEntry::log, BMLogEntry::modified_faces, BMLogEntry::modified_verts, BMLogEntry::next, NULL, and BMLogEntry::prev.
Referenced by sculpt_undo_bmesh_enable().
Definition at line 458 of file bmesh_log.c.
References BLI_ghashIterator_getKey(), GHASH_ITER, KDL::log(), and POINTER_AS_UINT.
Referenced by BM_log_entry_drop().
|
static |
Definition at line 414 of file bmesh_log.c.
References BLI_ghashIterator_getKey(), GHASH_ITER, and POINTER_AS_UINT.
Referenced by BM_log_cleanup_entry(), and BM_log_from_existing_entries_create().
| int BM_log_length | ( | const BMLog * | log | ) |
Definition at line 585 of file bmesh_log.c.
References BLI_listbase_count(), and KDL::log().
Definition at line 591 of file bmesh_log.c.
References BLI_ghash_free(), BLI_ghash_lookup(), bm, BM_FACES_OF_MESH, BM_ITER_MESH_INDEX, bm_log_compress_ids_to_indices(), bm_log_face_id_get(), bm_log_vert_id_get(), BM_mesh_remap(), BM_VERTS_OF_MESH, KDL::log(), MEM_freeN, MEM_mallocN, NULL, POINTER_AS_UINT, POINTER_FROM_UINT, BMesh::totface, BMesh::totvert, and v.
Referenced by sculptsession_bm_to_me_update_data_only().
Definition at line 1072 of file bmesh_log.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm_log_vert_id_get(), KDL::log(), BMLogVert::mask, BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
Referenced by SCULPT_orig_vert_data_update().
Definition at line 1036 of file bmesh_log.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm_log_vert_id_get(), BMLogVert::co, KDL::log(), BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
Referenced by sculpt_combine_proxies_task_cb().
| void BM_log_original_vert_data | ( | BMLog * | log, |
| BMVert * | v, | ||
| const float ** | r_co, | ||
| const short ** | r_no | ||
| ) |
Definition at line 1087 of file bmesh_log.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm_log_vert_id_get(), BMLogVert::co, KDL::log(), BMLogEntry::modified_verts, BMLogVert::no, POINTER_FROM_UINT, and v.
Referenced by calc_area_normal_and_center_task_cb(), and SCULPT_orig_vert_data_update().
Definition at line 1054 of file bmesh_log.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm_log_vert_id_get(), KDL::log(), BMLogEntry::modified_verts, BMLogVert::no, POINTER_FROM_UINT, and v.
Definition at line 781 of file bmesh_log.c.
References BMLogEntry::added_faces, BMLogEntry::added_verts, bm, bm_log_face_values_swap(), bm_log_faces_restore(), bm_log_faces_unmake(), bm_log_vert_values_swap(), bm_log_verts_restore(), bm_log_verts_unmake(), BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, KDL::log(), BMLogEntry::modified_faces, BMLogEntry::modified_verts, and BMLogEntry::next.
Referenced by sculpt_undo_bmesh_restore_begin(), and sculpt_undo_bmesh_restore_generic().
Definition at line 757 of file bmesh_log.c.
References BMLogEntry::added_faces, BMLogEntry::added_verts, bm, bm_log_face_values_swap(), bm_log_faces_restore(), bm_log_faces_unmake(), bm_log_vert_values_swap(), bm_log_verts_restore(), bm_log_verts_unmake(), BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, KDL::log(), BMLogEntry::modified_faces, BMLogEntry::modified_verts, and BMLogEntry::prev.
Referenced by sculpt_undo_bmesh_restore_end(), and sculpt_undo_bmesh_restore_generic().
| RangeTreeUInt* BM_log_unused_ids | ( | BMLog * | log | ) |
Definition at line 1112 of file bmesh_log.c.
References KDL::log().
Definition at line 862 of file bmesh_log.c.
References BLI_ghash_insert(), bm_log_vert_alloc(), bm_log_vert_id_set(), KDL::log(), POINTER_FROM_UINT, and v.
Referenced by BM_log_all_added(), and pbvh_bmesh_vert_create().
|
static |
Definition at line 209 of file bmesh_log.c.
References BLI_mempool_alloc(), bm_log_vert_bmvert_copy(), KDL::log(), BMLogEntry::pool_verts, and v.
Referenced by BM_log_vert_added(), BM_log_vert_before_modified(), and BM_log_vert_removed().
Definition at line 838 of file bmesh_log.c.
References BMLogEntry::added_verts, BLI_ghash_ensure_p(), BLI_ghash_lookup(), bm_log_vert_alloc(), bm_log_vert_bmvert_copy(), bm_log_vert_id_get(), KDL::log(), BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
Referenced by pbvh_bmesh_collapse_edge(), and sculpt_undo_bmesh_push().
|
static |
Definition at line 200 of file bmesh_log.c.
References BMVert::co, BMLogVert::co, copy_v3_v3(), BMVert::head, BMHeader::hflag, BMLogVert::hflag, BMLogVert::mask, BMVert::no, BMLogVert::no, normal_float_to_short_v3(), v, and vert_mask_get().
Referenced by bm_log_vert_alloc(), BM_log_vert_before_modified(), and bm_log_verts_unmake().
Definition at line 145 of file bmesh_log.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), KDL::log(), and POINTER_FROM_UINT.
Referenced by bm_log_faces_restore(), bm_log_vert_values_swap(), and bm_log_verts_unmake().
Definition at line 129 of file bmesh_log.c.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), KDL::log(), POINTER_AS_UINT, and v.
Referenced by bm_log_face_alloc(), BM_log_mesh_elems_reorder(), BM_log_original_mask(), BM_log_original_vert_co(), BM_log_original_vert_data(), BM_log_original_vert_no(), BM_log_vert_before_modified(), and BM_log_vert_removed().
Definition at line 136 of file bmesh_log.c.
References BLI_ghash_reinsert(), KDL::log(), NULL, POINTER_FROM_UINT, and v.
Referenced by bm_log_assign_ids(), BM_log_vert_added(), and bm_log_verts_restore().
Definition at line 924 of file bmesh_log.c.
References BMLogEntry::added_verts, BLI_assert, BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_remove(), bm_log_vert_alloc(), bm_log_vert_id_get(), BMLogEntry::deleted_verts, KDL::log(), BMLogEntry::modified_verts, NULL, POINTER_FROM_UINT, and v.
Referenced by BM_log_before_all_removed(), and pbvh_bmesh_collapse_edge().
Definition at line 321 of file bmesh_log.c.
References BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), bm, bm_log_vert_from_id(), CD_PAINT_MASK, BMVert::co, BMLogVert::co, copy_v3_v3_short(), CustomData_get_offset(), GHASH_ITER, BMVert::head, BMHeader::hflag, BMLogVert::hflag, KDL::log(), mask(), BMLogVert::mask, BMVert::no, BMLogVert::no, normal, normal_float_to_short_v3(), normal_short_to_float_v3(), POINTER_AS_UINT, SWAP, swap_v3_v3(), v, BMesh::vdata, vert_mask_get(), vert_mask_set(), and verts.
Referenced by BM_log_redo(), and BM_log_undo().
Definition at line 286 of file bmesh_log.c.
References BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), bm, BM_CREATE_NOP, bm_log_vert_id_set(), BM_vert_create(), CD_PAINT_MASK, BMLogVert::co, CustomData_get_offset(), GHASH_ITER, BMVert::head, BMHeader::hflag, BMLogVert::hflag, KDL::log(), BMLogVert::mask, BMVert::no, BMLogVert::no, normal_short_to_float_v3(), NULL, POINTER_AS_UINT, v, BMesh::vdata, vert_mask_set(), and verts.
Referenced by BM_log_redo(), and BM_log_undo().
Definition at line 241 of file bmesh_log.c.
References BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), bm, bm_log_vert_bmvert_copy(), bm_log_vert_from_id(), BM_vert_kill(), CD_PAINT_MASK, CustomData_get_offset(), GHASH_ITER, KDL::log(), POINTER_AS_UINT, v, BMesh::vdata, and verts.
Referenced by BM_log_redo(), and BM_log_undo().
|
static |
Definition at line 426 of file bmesh_log.c.
References Freestyle::a.
Referenced by bm_log_compress_ids_to_indices().
Definition at line 181 of file bmesh_log.c.
References BM_ELEM_CD_GET_FLOAT, and v.
Referenced by bm_log_vert_bmvert_copy(), and bm_log_vert_values_swap().
|
static |
Definition at line 192 of file bmesh_log.c.
References BM_ELEM_CD_SET_FLOAT, and v.
Referenced by bm_log_vert_values_swap(), and bm_log_verts_restore().