New ideas for grouping



Taking these notes off of the Dia Twiki at
http://faemalia.org/wiki/view/Technical/GroupDisconnect, I'd like to
hear comments on this idea.  Note that there's two fairly separate
parts, groups-as-parents and multiple-parents.  They do not require each
other, but would allow some cool functionality.


Here's a major change from the old group scheme:

*Grouping should be done with parenting*

A group is simply an object that can parent, has only its handles as
physical representation, and that grabs selection from its children.

This has the following advantages:

      * Only one grouping scheme in Dia.
      * Grouped objects are still in the diagram (see problems with
        bezier selection)
      * Simpler load/save functions.
      * Grouped connections don't need to be broken off.
      * Groups can easily be opened/closed.
      * Groups become more real objects that can have extra
        functionality.
      * This would solve the reordering problem (that grouped objects
        can lose their stacking order relative to non-grouped objects).

A few disadvantages, though:

      * This entails a major change in the save file format, requiring
        tools to be updated.
      * The XML save files won't show the structure of groups
        explicitly, only through 'parent' relationships. Though explicit
        ordering disallows an object belonging to multiple groups.
      * The importers/exporters that understand groups will need
        rewriting, too.

However, it is entirely likely that someone would want to have a group
with some but not all objects parented. This ought to be legal. So
instead of each object having a parent, it should have a list of
parents. Nothing odious about this, it'd have to check bounds and
selection against each of them. It would also mean that an object can
belong to more than one group, giving rise to a slight problem of what
group gets selected when the object is selected. We could just disallow
overlapping groups till we figure that out (though groups without groups
would be fine, the inner group would just become a parent of the
selected objects, and the outer group a parent of the inner group). It's
easy to check if a grouping is legal, just see if all objects have the
same parent group.

-Lars




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]