
2014-04-21 23:44 GMT+02:00 Bryce Harrington <bryce@...961...>:
Also, I am not familiar enough with the Inkscape codebase to know what to do with the very old looking SPTag stuff, which is why it isn't in my branch yet. If anyone wants to take a look and advise me on how to refactor this to make it work, the tag stuff is here: http://sta.sh/01etufm3jqvt (seriously, what the heck is an SPObjectClass? is that some sort of impls thing?)
I'm not even sure that functionality is really needed. Couldn't this be done better using groups or layers?
A few times I have run into a problem where I wanted to group objects which were not consecutive in the Z order. Imagine for example drawing the planetary ring on the planet in this picture:
http://2.bp.blogspot.com/-6SdVF12kots/UBSikNLslvI/AAAAAAAACEo/4wvTAmWt2eo/s1...
Clearly you will need two objects - one for the part that goes behind the planet and one for the part that goes above it. Right now there is no way to logically associate these objects so that they are always selected together. So I think this feature has some merit, but it needs to be implemented carefully so that it doesn't create confusion with groups and layers. Perhaps we could create a group if the selected objects are consecutive in the Z-order and create a "tag" (or "selection set", or whatever) when they are not.
Digression: this ties into a very important refactoring item. Many of the functions implementing well-known UI commands take Inkscape::Selection or SPDesktop as a parameter, even though what they actually need is just a list of selected objects with an enforced invariant that no object in the list is an ancestor of another. Therefore we need a base class for Inkscape::Selection, called e.g. Inkscape::ObjectSet (though ideally this base should be called Inkscape::Selection and the UI-related derived class should be called Inkscape::UI::DesktopSelection). Inkscape::ObjectSet would become the parameter type for functions currently in selection-chemistry.cpp, or those functions could become methods of ObjectSet. This would massively simplify internal coding, since there would be no need to work around UI code when you want to do reuse an operation you already know from the UI.
Regards, Krzysztof