Implemented decorations for GeoGraphicsItem.
Review Request #124154 - Created June 23, 2015 and submitted
This patch introduces a new virtual method
GeoGraphicsItem::createDecoration()to enable the easy creation of decoration for every class thet is inherited from
There are two new decorations implemented in this patch:
- Outlines for
GeoLineStringGraphicsItem, for better street rendering in OSM vector tiles;
- Fake3D effect for
GeoPolygonGraphicsItemif they represent buildings in OSM vector tiles.
For performance reasons these decorations are only painted when the map quality is set to noraml or higher.
- Changed some of the color styles of OSM related items, e.g. streets, to match the default color scheme of openstreetmap maps;
- Implemented two new OSM feature:
In the end, I've decided to cache the decorations for every item, and thus the performance is much better than in the previous review request.
This patch works for me and the results are better than I expected.
Looks lovely. I also tested it on my system and changed the animation rendering quality to high to see the view-dependent shadows change while dragging. Awesome :)
If it doesn't take too much time, please split off the changes in this patch which clean up whitespace and commit them directly to master. That way the real changes are easier to spot (here and in the future when looking at the git history).
Looks great most times. For large viewports and small buildings the offset seems a bit high to me though, maybe tweak it a bit for that case?
One way could be to take the screen size of the polygon into account.
Is there a situation where m_isDecoration is not the same as (m_cachedDecoration != nullptr)? Otherwise I'd favor returning that here and spare the m_isDecoration member (to avoid redundancy).
- Updated the algorithm which computes the offset for the "fake3D" decoration.
- Whitespace-changes removed, they will be moved into a separate review-request.