Open zmoth opened 1 year ago
Your changes totally make sense.
What do you think about this one ? #147 And the corresponding PR https://github.com/paceholder/nodeeditor/pull/163
thanks
std::vector
to store the RegisteredModelsCategory
, and since the class seems to be used only to generate the Scene Menu, just traversing it without using lookups, using std::vector
not only sorts the classes in the order they are registered, but also reduces the performance loss (though not by much)ret->sortCategories()
to sort at the end of the registration model. Because I won't know which model will be loaded last in my plugin_extension
branch because of the plugin name change.Is there anything else you think we should recommend or improve? Thanks
Sort button function
auto ret = std::make_shared<NodeDelegateModelRegistry>();
ret->registerModel<NumberSourceDataModel>("Sources");
ret->registerModel<NumberDisplayDataModel>("Displays");
ret->registerModel<AdditionModel>("Operators");
ret->registerModel<SubtractionModel>("Operators");
ret->registerModel<MultiplicationModel>("Operators");
ret->registerModel<DivisionModel>("Operators");
registry->categories()
to create parent itemsCategoriesSet
I looked up where
CategoriesSet
is used in v2 and v3 and found that it is only used when creating menus.RegisteredModelsCategoryMap
is perfectly capable of doing the job ofCategoriesSet
.So I think the
CategoriesSet
can now be removed.Please contact me if I have any incomplete considerations. Thanks.