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

Method SetExpressionCommand

Gui/KnobUndoCommand.cpp:799–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797} // RestoreDefaultsCommand::redo
798
799SetExpressionCommand::SetExpressionCommand(const KnobIPtr & knob,
800 bool hasRetVar,
801 int dimension,
802 const std::string& expr,
803 QUndoCommand *parent)
804 : QUndoCommand(parent)
805 , _knob(knob)
806 , _oldExprs()
807 , _hadRetVar()
808 , _newExpr(expr)
809 , _hasRetVar(hasRetVar)
810 , _dimension(dimension)
811{
812 for (int i = 0; i < knob->getDimension(); ++i) {
813 _oldExprs.push_back( knob->getExpression(i) );
814 _hadRetVar.push_back( knob->isExpressionUsingRetVariable(i) );
815 }
816 setText( tr("Set expression") );
817}
818
819void
820SetExpressionCommand::undo()

Callers

nothing calls this directly

Calls 5

setTextFunction · 0.85
getDimensionMethod · 0.45
push_backMethod · 0.45
getExpressionMethod · 0.45

Tested by

no test coverage detected