But then wouldn't you end up with a large amount of command classes?
Depends. Generally yes, but you are not going to avoid that alltogether. Its way better to have a lot of classes then a giant if statements because 1) the classes are independant of each other and thus 2) all the classes can be organized and managed better. You still have to realize that if you have different parameters that you want to couple to your UI, you will at least have to write SOME code for letting your application know that this parameter exists and what to do with it.
But if you want to reduce the amount of code for parameters, here is what you can do. Instead of writing a different class for each parameter, you use a template class (for the type) and store a function pointer:
template<typename Type, typename Object>
class ParameterCommand : public ICommand
{
using FunctionPointer = void ()(Type);
public:
ParameterCommand(Type value, Object& targetObject, FunctionPointer targetFunction),
pTargetObject(&targetObject), targetFunction(targetFunction)
{
}
private:
Type value;
TargetObject* pTargetObject;
FunctionPointer targetFunction;
}
And then you can just do:
ParameterCommand<float, Brush> radiusCommand(5.0, brush, &Brush::SetRadius);
This is just an example and might not even perfectly fit your use-case, but you get the idea. Command pattern, unlike your nested if-list, allows you to use all the class/template magic of C++ to reduce the amount of things you have to write. But you have to write some code for each parameter... wait, you are using C++, right? There might be even easier tools in other languages based on reflection, but command pattern is still a viable top-level solution which allows you to solve the specific subsets of your problem the way that your language makes it the easiest.
On an unrelated note, was the brush-example an artifical example or do you really plan on making those undoable too? I'd advice against it, I hate nothing more than wanting to undo a series of changes I made, and having the application undo all my brush/tool changes in the mix. Might be personal opinion but not many applications even do that which I've seen.