The whole mechanism still isn't well designed because there too many different use cases that makes it difficult to cover everything with an easy and extendible design.
Thanks. Is there documentation on what number corresponds to what mode?
Inside ViewProvider.h you will find some basic edit modes:
Code: Select all
enum EditMode {Default = 0,
Transform,
Cutting,
Color,
};
The bad thing about this is that each view provider type that defines its own edit modes would extend this list. The downside is that each time you add a new mode the whole GUI part must be completely rebuilt which is a very time-consuming and annoying because it breaks the design rule that the core shouldn't know about implementation details of extension modules. And for the core system it's anyway not needed to know all possible edit modes.
Currently the vast majority of view providers either completely ignore the passed mode number or handle ViewProvider::Default (which is 0) and for all other cases delegate it to the sub-class.
Do you know any example of doing it that I can look at?
Search for the string "::setEdit(" in the code base to see how the different view providers handle it.