[Marble-devel] Review Request 118717: Added 'click on highlight' feature.

Abhinav Gangwar abhgang at gmail.com
Mon Jun 16 18:17:31 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118717/
-----------------------------------------------------------

(Updated June 17, 2014, 12:47 a.m.)


Review request for Marble, Dennis Nienhüser and Torsten Rahn.


Changes
-------

Moved handleMouseClick() from MarbleModel to MarbleMap.


Repository: marble


Description
-------

Modifications:

1. Modified Pn2Runner so that it now handles MULTIGEOMETRY also ( we can now ignore https://git.reviewboard.kde.org/r/118620/ ) .
2. Added support to specify highlight color in dgml file.
3. Highlighting is done the following way:

-> Input handler emits mouseClickGeoPostion( qreal lon, qreal lat, GeoDataCoordinates::Unit unit ) whenever a click is detected on map. 
-> Signal mouseClickGeoPostion() is connected to the slot MarbleModel::handleClick() .

-> Also, GeoGraphicsItem contains a member 'bool m_isHighlightStyle' which is true whenever highlight style should be used otherwise use normal.

-> MarbleModel::handleClick() processes the coordinates and finds which placemarks ( in different layers ) they belong to. It further emits 
   signal announceHighlight( QVector<GeoDataPlacemark *>, QColor) . Vector contains all the placemarks which are under mouse . The QColor 
   here is the highlight color. Highlight color is specified in <map> tag as its attribute in dgml file.

-> The slot GeoSceneGraphics::applyHighlight() is connected to MarbleModel::announceHighlight() signal .
-> In GeoSceneGraphics we find QList<TileId> for a feature, which is detected under mouse , from GeoSceneGraphics::m_features and then for every
   TileId we find QList<GeoGraphicsItem*> and then set GeoGraphicsItem::m_isHighlight true for all items which have 
   GeoGraphicsItem::m_feature equal to clicked placemark.

-> Modify GeoGraphicsItem::style() so that it returns appropriate style on basis of GeoGraphicsItem::m_isHighlight .


That's it . Need feedback :)


Diffs (updated)
-----

  data/maps/earth/political/political.dgml abfb8d9 
  data/naturalearth/ne_10m_admin_0_boundary_lines_land.pn2 37d4033 
  data/naturalearth/ne_10m_rivers_lake_centerlines.pn2 01c764c 
  data/naturalearth/ne_50m_admin_0_boundary_lines_land.pn2 f01c4cd 
  data/naturalearth/ne_50m_admin_0_boundary_lines_maritime_indicator.pn2 029a94e 
  data/naturalearth/ne_50m_admin_0_breakaway_disputed_areas.pn2 22a9b64 
  data/naturalearth/ne_50m_admin_0_countries.pn2 a982356 
  data/naturalearth/ne_50m_admin_0_pacific_groupings.pn2 4e3146a 
  data/naturalearth/ne_50m_admin_1_states_provinces_lines.pn2 3e81207 
  data/naturalearth/ne_50m_antarctic_ice_shelves_lines.pn2 b18610c 
  data/naturalearth/ne_50m_antarctic_ice_shelves_polys.pn2 f45940f 
  data/naturalearth/ne_50m_coastline.pn2 1c1326e 
  data/naturalearth/ne_50m_glaciated_areas.pn2 6112136 
  data/naturalearth/ne_50m_lakes.pn2 e30a90e 
  data/naturalearth/ne_50m_lakes_historic.pn2 2ac5be6 
  data/naturalearth/ne_50m_playas.pn2 f1abfe0 
  data/naturalearth/ne_50m_rivers_lake_centerlines.pn2 05b91fa 
  data/naturalearth/ne_50m_urban_areas.pn2 fbfb15a 
  src/lib/marble/GeoGraphicsScene.h 869c3d8 
  src/lib/marble/GeoGraphicsScene.cpp f84c532 
  src/lib/marble/MarbleInputHandler.h 58107e5 
  src/lib/marble/MarbleInputHandler.cpp 3fce19a 
  src/lib/marble/MarbleMap.h e7ec453 
  src/lib/marble/MarbleMap.cpp 0e1c70d 
  src/lib/marble/MarbleModel.h 9643186 
  src/lib/marble/MarbleModel.cpp 2c56476 
  src/lib/marble/MarbleWidget.h e8148a9 
  src/lib/marble/MarbleWidget.cpp d58db8e 
  src/lib/marble/geodata/graphicsitem/GeoPolygonGraphicsItem.cpp b161d06 
  src/lib/marble/geodata/handlers/dgml/DgmlAttributeDictionary.h cf4dd76 
  src/lib/marble/geodata/handlers/dgml/DgmlAttributeDictionary.cpp 85f10fb 
  src/lib/marble/geodata/handlers/dgml/DgmlMapTagHandler.cpp fb7ff0f 
  src/lib/marble/geodata/scene/GeoSceneMap.h 498bb3a 
  src/lib/marble/geodata/scene/GeoSceneMap.cpp 7f94c11 
  src/lib/marble/graphicsview/GeoGraphicsItem.h 653fef0 
  src/lib/marble/graphicsview/GeoGraphicsItem.cpp 1227316 
  src/lib/marble/graphicsview/GeoGraphicsItem_p.h 618cddf 
  src/lib/marble/layers/GeometryLayer.h f868f26 
  src/lib/marble/layers/GeometryLayer.cpp daea513 
  src/plugins/runner/pn2/Pn2Runner.h 520b367 
  src/plugins/runner/pn2/Pn2Runner.cpp 74fa848 
  src/plugins/runner/shp/ShpRunner.cpp 0ec98dc 
  tools/shp2pn2/shp2pn2.cpp 639b30f 

Diff: https://git.reviewboard.kde.org/r/118717/diff/


Testing
-------


File Attachments
----------------

pn2DataNew.zip
  https://git.reviewboard.kde.org/media/uploaded/files/2014/06/13/e541a355-80be-40a8-8158-afea0677bd0e__pn2DataNew.zip
color10.png
  https://git.reviewboard.kde.org/media/uploaded/files/2014/06/13/f04644e8-6318-4b9a-a8d1-2747b405f73b__color10.png
color11.png
  https://git.reviewboard.kde.org/media/uploaded/files/2014/06/13/5f07bac3-3bcb-4086-b8d6-5b836b8f18dc__color11.png


Thanks,

Abhinav Gangwar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20140616/8a8cd1ee/attachment.html>


More information about the Marble-devel mailing list