[Marble-devel] [Differential] [Request, 1, 255 lines] D1181: More flexible rendering order in GeometryLayer/GeoGraphicsScene

nienhueser (Dennis Nienhüser) noreply at phabricator.kde.org
Sat Mar 19 17:37:41 UTC 2016


nienhueser created this revision.
nienhueser added reviewers: Marble, rahn.
nienhueser set the repository for this revision to rMARBLE Marble.
nienhueser added a project: Marble.

REVISION SUMMARY
  The Vector OSM map theme has some rendering order problems right now that result in some item combinations to look odd. This patch provides a more fine-granular control of the rendering order. It also refactors the decorators previously used and merges them into that approach.
  
  - Extend paint() of GeographicsItem to take another argument, a string layer
  - Each GeographicsItem specifies a list of such layers it wants to paint
  - GeometryLayer defines the order of layers and paints them that way
  
  E.g. currently a highway behaves like this:
  
  - GeoLineStringItem is created, and internally creates a copy of itself which is its decorator, assigns a z-value
  - GeometryLayer queries all decorators during paint, sorts them by z-value
  - GeoLineStringItem tests whether it is a decorator during painting, changes rendering based on that
  
  The patch changes this to
  
  - GeoLineStringItem is created and asks for three layers to be rendered: ".../outline", ".../inline" and ".../label"
  - GeometryLayer queries all layers during paint, sorts them by render order
  - GeoLineStringItem changes rendering based on the provided layer name
  
  This avoids having to treat decorators as special and duplicated items internally, and also allows an important render order behavior change: It is now possible to render e.g. all visible streets first and all their labels afterwards. Previously it was only possible to render one street after the other, so e.g. the second street could overpaint the label of the first.
  
  The graphic below shows some rendering order problems that are fixed by the patch.
  
  F97882: pasted_file <https://phabricator.kde.org/F97882>

REPOSITORY
  rMARBLE Marble

REVISION DETAIL
  https://phabricator.kde.org/D1181

AFFECTED FILES
  src/lib/marble/geodata/data/GeoDataFeature.cpp
  src/lib/marble/geodata/data/GeoDataFeature.h
  src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
  src/lib/marble/geodata/graphicsitem/GeoLineStringGraphicsItem.h
  src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp
  src/lib/marble/geodata/graphicsitem/GeoPhotoGraphicsItem.h
  src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.cpp
  src/lib/marble/geodata/graphicsitem/GeoPointGraphicsItem.h
  src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp
  src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.h
  src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.cpp
  src/lib/marble/geodata/graphicsitem/GeoTrackGraphicsItem.h
  src/lib/marble/graphicsview/GeoGraphicsItem.cpp
  src/lib/marble/graphicsview/GeoGraphicsItem.h
  src/lib/marble/graphicsview/GeoGraphicsItem_p.h
  src/lib/marble/layers/GeometryLayer.cpp
  src/plugins/render/annotate/AnnotatePlugin.cpp
  src/plugins/render/annotate/AreaAnnotation.cpp
  src/plugins/render/annotate/AreaAnnotation.h
  src/plugins/render/annotate/GroundOverlayFrame.cpp
  src/plugins/render/annotate/GroundOverlayFrame.h
  src/plugins/render/annotate/PlacemarkTextAnnotation.cpp
  src/plugins/render/annotate/PlacemarkTextAnnotation.h
  src/plugins/render/annotate/PolylineAnnotation.cpp
  src/plugins/render/annotate/PolylineAnnotation.h

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: nienhueser, Marble, rahn
Cc: cmihalache, marble-devel


More information about the Marble-devel mailing list