MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / removeInstances

Method removeInstances

Gui/MultiInstancePanel.cpp:939–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937};
938
939void
940MultiInstancePanel::removeInstances(const std::list<NodePtr>& instances)
941{
942 NodePtr mainInstance = getMainInstance();
943 std::list<NodePtr>::const_iterator next = instances.begin();
944
945 if ( next != instances.end() ) {
946 ++next;
947 }
948
949 for (std::list<NodePtr>::const_iterator it = instances.begin();
950 it != instances.end();
951 ++it) {
952 int index = getNodeIndex(*it);
953 assert(index != -1);
954 removeRow(index);
955 bool isMainInstance = (*it) == mainInstance;
956 (*it)->deactivate( std::list<NodePtr>(), false, false, !isMainInstance, next == instances.end() );
957
958 // increment for next iteration
959 if ( next != instances.end() ) {
960 ++next;
961 }
962 } // for(it)
963}
964
965void
966MultiInstancePanel::addInstances(const std::list<NodePtr>& instances)

Callers 3

RemoveNodeCommandClass · 0.80
undoMethod · 0.80
redoMethod · 0.80

Calls 4

getMainInstanceFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
deactivateMethod · 0.45

Tested by

no test coverage detected