MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / appendAction

Method appendAction

source/MRViewer/MRHistoryStore.cpp:21–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void HistoryStore::appendAction( std::shared_ptr<HistoryAction> action )
22{
23 assert( !undoRedoInProgress_ );
24 if ( undoRedoInProgress_ )
25 return;
26 if ( !action )
27 return;
28 changedSignal( *this, ChangeType::PreAppendAction, action );
29 if ( scopedBlock_ )
30 {
31 scopedBlock_->push_back( std::move( action ) );
32 changedSignal( *this, ChangeType::PostAppendAction, scopedBlock_->back() );
33 return;
34 }
35 spdlog::info( "History action append: \"{}\"", action->name() );
36 assert( !action->name().empty() );
37
38 stack_.resize( firstRedoIndex_ + 1 );
39 stack_[firstRedoIndex_] = std::move( action );
40 ++firstRedoIndex_;
41
42 changedSignal( *this, ChangeType::PostAppendAction, stack_.back() );
43
44 filterByMemoryLimit_();
45}
46
47void HistoryStore::clear()
48{

Callers 3

~ScopeHistoryMethod · 0.80
appendHistoryActionMethod · 0.80
AppendHistoryFunction · 0.80

Calls 4

push_backMethod · 0.80
nameMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected