[Marble-devel] ModelIndex for GeoDataGeometry objects in GeoDataTreeModel

Javi Becerra javi.becerra at gmail.com
Thu Oct 6 10:57:59 UTC 2011


Hi!

I'm checking my review request #102610 for support for geometry types.
I have found that the GeoDataTreeModel assigns a ModelIndex to Geometry
objects that are contained in a MultiGeometry, but no ModelIndex is
created for Geometry objects in other cases (i.e, a Point contained in a
MultiGeometry will get an index, but a Point contained in a Placemark
will not).

I guess this choice was made because a Placemark can only contain a
geometry child, but a multigeometry can contain many children. In that
case, should the model support an index for a polygon's outer and
innerboundaries?

>From the point of view of the add/remove functions that are being
implemented, having all the GeometryTypes behave the same way
independently of the type of their parent would make things simpler, but
I guess that changing the model's behaviour regarding geometries might
well have some unexpected side-effects.

So, my question is, should I respect the existing behaviour (my patch
will become slightly more complex, but there should not be any major
problem) or make the model return an index for every geometry object,
independent of their parent (that would be more consistent imho, but
surely would be less efficient for most cases)?

Javier



More information about the Marble-devel mailing list