Bug 310575 - Implement the KML random color mode
Summary: Implement the KML random color mode
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.6 (KDE 4.11)
Platform: unspecified Linux
: NOR task
Target Milestone: 1.6 (KDE 4.11)
Assignee: Mohammed Nafees
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2012-11-23 22:05 UTC by Dennis Nienhüser
Modified: 2012-11-30 21:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Nienhüser 2012-11-23 22:05:32 UTC
It's possible to define random colors in .kml files. Make Marble calculate suitable values and display them.

Random colors (as per colormode=random) are already read from kml files and available in GeoDataColorStyle. Extend it to implement a QColor paintColor() const method which returns, acoording to the colormode, either the original color or a randomized color. Randomized colors need to be calculated according to the kml spec, see https://developers.google.com/kml/documentation/kmlreference#colormode
Comment 1 Dennis Nienhüser 2012-11-24 10:01:39 UTC
Git commit 3a519c30734d0acc92c4b67c8c1df1840086c2cd by Dennis Nienhüser.
Committed on 24/11/2012 at 10:56.
Pushed by nienhueser into branch 'master'.

Fix reading of random colormode

colorstyle is an abstract kml element, so we need to check if the parent
element derives from it.

M  +6    -5    src/lib/geodata/handlers/kml/KmlColorModeTagHandler.cpp

http://commits.kde.org/marble/3a519c30734d0acc92c4b67c8c1df1840086c2cd
Comment 2 Dennis Nienhüser 2012-11-24 10:01:39 UTC
Git commit a5d09cd770c8a90dea4a5537a4816cb5eef94960 by Dennis Nienhüser.
Committed on 24/11/2012 at 10:58.
Pushed by nienhueser into branch 'master'.

Fix writing random colormode. Don't write default values.

REVIEW: 102611

M  +12   -4    src/lib/geodata/writers/kml/KmlColorStyleTagWriter.cpp

http://commits.kde.org/marble/a5d09cd770c8a90dea4a5537a4816cb5eef94960
Comment 3 Dennis Nienhüser 2012-11-30 21:39:47 UTC
Git commit da6a59508b17b934478b46a09ecfde0db13aaccc by Dennis Nienhüser, on behalf of Mohammed Nafees.
Committed on 30/11/2012 at 22:36.
Pushed by nienhueser into branch 'kitchen'.

Respect KML random color mode in rendering
REVIEW: 107478

M  +19   -0    src/lib/geodata/data/GeoDataColorStyle.cpp
M  +11   -1    src/lib/geodata/data/GeoDataColorStyle.h
M  +4    -4    src/lib/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp
M  +4    -4    src/lib/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp

http://commits.kde.org/marble/da6a59508b17b934478b46a09ecfde0db13aaccc