|
Blender V4.3
|
Go to the source code of this file.
Log all vertices/faces in the BMesh as added.
Definition at line 874 of file bmesh_log.cc.
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_PROP_FLOAT, CustomData_get_offset_named(), log(), BMesh::totface, BMesh::totvert, v, and BMesh::vdata.
Referenced by blender::ed::sculpt_paint::undo::bmesh_push(), and blender::ed::sculpt_paint::symmetrize_exec().
Log all vertices/faces in the BMesh as removed.
Definition at line 902 of file bmesh_log.cc.
References bm, BM_FACES_OF_MESH, BM_ITER_MESH, BM_log_face_removed(), BM_log_vert_removed(), BM_VERTS_OF_MESH, CD_PROP_FLOAT, CustomData_get_offset_named(), log(), v, and BMesh::vdata.
Referenced by blender::ed::sculpt_paint::undo::bmesh_push(), and blender::ed::sculpt_paint::symmetrize_exec().
| void BM_log_cleanup_entry | ( | BMLogEntry * | entry | ) |
Mark all used ids as unused for this node
Definition at line 482 of file bmesh_log.cc.
References BMLogEntry::added_faces, BMLogEntry::added_verts, BLI_ghash_clear(), bm_log_id_ghash_retake(), BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, BMLogEntry::log, log(), BMLogEntry::modified_faces, and BMLogEntry::modified_verts.
Allocate, initialize, and assign a new BMLog.
Definition at line 467 of file bmesh_log.cc.
References BLI_ghash_new_ex(), BLI_ghash_ptr_new_ex(), bm, bm_log_assign_ids(), log(), logkey_cmp, logkey_hash, MEM_callocN, BMesh::totface, and BMesh::totvert.
Referenced by BM_log_from_existing_entries_create(), and blender::ed::sculpt_paint::dyntopo::enable_ex().
| BMLogEntry * BM_log_current_entry | ( | BMLog * | log | ) |
For internal use only (unit testing).
Definition at line 1006 of file bmesh_log.cc.
References log().
| BMLogEntry * BM_log_entry_add | ( | BMLog * | log | ) |
Start a new log entry and update the log entry list.
If the log entry list is empty, or if the current log entry is the last entry, the new entry is simply appended to the end.
Otherwise, the new entry is added after the current entry and all following entries are deleted.
In either case, the new entry is set as the current log entry.
Definition at line 624 of file bmesh_log.cc.
References BLI_addtail(), BLI_freelinkN(), bm_log_entry_create(), bm_log_entry_free(), BMLogEntry::log, log(), BMLogEntry::next, and next.
Referenced by blender::ed::sculpt_paint::undo::bmesh_push().
| void BM_log_entry_drop | ( | BMLogEntry * | entry | ) |
Remove an entry from the log.
Uses entry->log as the log. If the log is NULL, the entry will be freed but not removed from any list, nor shall its IDs be released.
This operation is only valid on the first and last entries in the log. Deleting from the middle will assert.
Definition at line 651 of file bmesh_log.cc.
References BMLogEntry::added_faces, BMLogEntry::added_verts, BLI_assert, BLI_assert_msg, BLI_freelinkN(), bm_log_entry_free(), bm_log_id_ghash_release(), BMLogEntry::log, log(), MEM_freeN(), BMLogEntry::next, and BMLogEntry::prev.
Referenced by blender::ed::sculpt_paint::undo::free_step_data().
Log a new face as added to the BMesh.
The new face gets a unique ID assigned. It is then added to a map of added faces, with the key being its ID and the value containing everything needed to reconstruct that face.
Definition at line 811 of file bmesh_log.cc.
References BLI_assert, BLI_ghash_insert(), bm_log_face_alloc(), bm_log_face_id_set(), BMFace::len, log(), and POINTER_FROM_UINT.
Referenced by BM_log_all_added(), and blender::bke::pbvh::pbvh_bmesh_face_create().
Log a face before it is modified.
This is intended to handle only header flags and we always assume face has been added before.
Definition at line 801 of file bmesh_log.cc.
References BLI_ghash_insert(), bm_log_face_alloc(), bm_log_face_id_get(), log(), and POINTER_FROM_UINT.
Referenced by blender::ed::sculpt_paint::undo::bmesh_push().
Log a face as removed from the BMesh.
A couple things can happen here:
If the face was added as part of the current log entry, then it's deleted and forgotten about entirely. Its unique ID is returned to the unused pool.
If the face was already part of the BMesh before the current log entry, it is added to a map of deleted faces, with the key being its ID and the value containing everything needed to reconstruct that face.
Definition at line 853 of file bmesh_log.cc.
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, log(), and POINTER_FROM_UINT.
Referenced by BM_log_before_all_removed(), and blender::bke::pbvh::pbvh_bmesh_face_remove().
Search the log for the original vertex coordinates.
Does not modify the log or the vertex.
Definition at line 921 of file bmesh_log.cc.
References BLI_ghash_lookup(), bm_log_vert_id_get(), BMLogVert::co, log(), BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
Referenced by blender::bke::pbvh::copy_original_vert(), and blender::ed::sculpt_paint::undo::restore_position_from_undo_step().
Search the log for the original vertex mask.
Does not modify the log or the vertex.
Definition at line 932 of file bmesh_log.cc.
References BLI_ghash_lookup(), bm_log_vert_id_get(), log(), BMLogVert::mask, BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
Referenced by blender::ed::sculpt_paint::undo::restore_mask_from_undo_step().
| void BM_log_free | ( | BMLog * | log | ) |
Free all the data in a BMLog including the log itself.
Definition at line 545 of file bmesh_log.cc.
References BLI_ghash_free(), LISTBASE_FOREACH, log(), and MEM_freeN().
Referenced by blender::ed::sculpt_paint::dyntopo::disable(), and SculptSession::~SculptSession().
| BMLog * BM_log_from_existing_entries_create | ( | BMesh * | bm, |
| BMLogEntry * | entry ) |
Allocate and initialize a new BMLog using existing #BMLogEntries
The 'entry' should be the last entry in the BMLog. Its prev pointer will be followed back to find the first entry.
The unused IDs field of the log will be initialized by taking all keys from all GHashes in the log entry.
Definition at line 504 of file bmesh_log.cc.
References BMLogEntry::added_faces, BMLogEntry::added_verts, bm, BM_log_create(), bm_log_id_ghash_retake(), BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, BMLogEntry::log, log(), BMLogEntry::modified_faces, BMLogEntry::modified_verts, BMLogEntry::next, and BMLogEntry::prev.
Referenced by blender::ed::sculpt_paint::undo::bmesh_enable().
Get the number of log entries.
Definition at line 568 of file bmesh_log.cc.
References BLI_listbase_count(), and log().
Apply a consistent ordering to BMesh vertices and faces.
Definition at line 573 of file bmesh_log.cc.
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, log(), MEM_freeN(), MEM_mallocN, POINTER_AS_UINT, POINTER_FROM_UINT, BMesh::totface, BMesh::totvert, and v.
Referenced by sculptsession_bm_to_me_update_data_only().
Get the logged mask of a vertex
Does not modify the log or the vertex.
Definition at line 973 of file bmesh_log.cc.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm_log_vert_id_get(), log(), BMLogVert::mask, BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
Get the logged coordinates of a vertex.
Does not modify the log or the vertex.
Definition at line 943 of file bmesh_log.cc.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm_log_vert_id_get(), BMLogVert::co, log(), BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
| void BM_log_original_vert_data | ( | BMLog * | log, |
| BMVert * | v, | ||
| const float ** | r_co, | ||
| const float ** | r_no ) |
Get the logged data of a vertex (avoid multiple lookups).
Definition at line 988 of file bmesh_log.cc.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm_log_vert_id_get(), BMLogVert::co, log(), BMLogEntry::modified_verts, BMLogVert::no, POINTER_FROM_UINT, and v.
Referenced by blender::ed::sculpt_paint::orig_position_data_gather_bmesh().
Get the logged normal of a vertex
Does not modify the log or the vertex.
Definition at line 958 of file bmesh_log.cc.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_lookup(), bm_log_vert_id_get(), log(), BMLogEntry::modified_verts, BMLogVert::no, POINTER_FROM_UINT, and v.
| void BM_log_print_entry | ( | BMesh * | bm, |
| BMLogEntry * | entry ) |
Definition at line 1034 of file bmesh_log.cc.
References BMLogEntry::added_faces, BMLogEntry::added_verts, BLI_ghash_len(), bm, BMLogEntry::deleted_faces, BMLogEntry::deleted_verts, BMLogEntry::modified_faces, BMLogEntry::modified_verts, printf, BMesh::totedge, BMesh::totface, BMesh::totloop, and BMesh::totvert.
Redo one BMLogEntry.
Has no effect if there's nothing left to redo.
Definition at line 738 of file bmesh_log.cc.
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, log(), BMLogEntry::modified_faces, BMLogEntry::modified_verts, and BMLogEntry::next.
Referenced by blender::ed::sculpt_paint::undo::bmesh_restore_begin(), and blender::ed::sculpt_paint::undo::bmesh_restore_generic().
Undo one BMLogEntry.
Has no effect if there's nothing left to undo.
Definition at line 717 of file bmesh_log.cc.
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, log(), BMLogEntry::modified_faces, BMLogEntry::modified_verts, and BMLogEntry::prev.
Referenced by blender::ed::sculpt_paint::undo::bmesh_restore_end(), and blender::ed::sculpt_paint::undo::bmesh_restore_generic().
| struct RangeTreeUInt * BM_log_unused_ids | ( | BMLog * | log | ) |
For internal use only (unit testing)
Definition at line 1011 of file bmesh_log.cc.
References log().
Log a new vertex as added to the BMesh.
The new vertex gets a unique ID assigned. It is then added to a map of added vertices, with the key being its ID and the value containing everything needed to reconstruct that vertex.
Definition at line 790 of file bmesh_log.cc.
References BLI_ghash_insert(), bm_log_vert_alloc(), bm_log_vert_id_set(), log(), POINTER_FROM_UINT, and v.
Referenced by BM_log_all_added(), and blender::bke::pbvh::pbvh_bmesh_vert_create().
Log a vertex before it is modified.
Before modifying vertex coordinates, masks, or hflags, call this function to log its current values. This is better than logging after the coordinates have been modified, because only those vertices that are modified need to have their original values stored.
Handles two separate cases:
If the vertex was added in the current log entry, update the vertex in the map of added vertices.
If the vertex already existed prior to the current log entry, a separate key/value map of modified vertices is used (using the vertex's ID as the key). The values stored in that case are the vertex's original state so that an undo can restore the previous state.
On undo, the current vertex state will be swapped with the stored state so that a subsequent redo operation will restore the newer vertex state.
Definition at line 772 of file bmesh_log.cc.
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(), log(), BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
Referenced by blender::ed::sculpt_paint::undo::bmesh_push(), and blender::bke::pbvh::pbvh_bmesh_collapse_edge().
Log a vertex as removed from the BMesh.
A couple things can happen here:
If the vertex was added as part of the current log entry, then it's deleted and forgotten about entirely. Its unique ID is returned to the unused pool.
If the vertex was already part of the BMesh before the current log entry, it is added to a map of deleted vertices, with the key being its ID and the value containing everything needed to reconstruct that vertex.
If there's a move record for the vertex, that's used as the vertices original location, then the move record is deleted.
Definition at line 825 of file bmesh_log.cc.
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, log(), BMLogEntry::modified_verts, POINTER_FROM_UINT, and v.
Referenced by BM_log_before_all_removed(), and blender::bke::pbvh::pbvh_bmesh_collapse_edge().