Added copy and cut actions on polygons/placemarks
Review Request #119555 - Created July 31, 2014 and submitted
As the title says, I decided to add Copy/Cut actions on Annotate Plugin's scene graphic items. However, I ended up implementing these two actions only on polygons and placemarks because, as you know, ground overlays are not very consistent in implementation with the other ones, since it makes use of the texture layer to get rendered. However, if the issues I will mention below regarding this implementation will be solved, I will implement those too, so that even if it is not consistent with the others regarding the implementation, at least to look consistent to the user, which, in the end, is the most important.
So I decided to implement these actions mainly because I thought they will add consistency to annotate plugin and would improve its flexibility. It also improved the way Annotate Plugin treats scene graphic items since, as you can see in the patch, there is only one implementation of cut/copy/paste and not one for each annotate item.
How it works: simply right click on placemarks or polygons and click copy/cut. At this point, the item you selected is added to a clipboard. Then, right click anywhere on the map and click 'Paste Graphic Item'. This is an action I added to the m_marbleWidget->popupMenu() (this is disabled when the clipboard is empty).
What are the issues:
- placemark related:
- copy works fine;
- there is some weird behaviour when cutting, which sometimes leads to crashes. I uploaded a video to show it better. There is obvious something related to the prime meridian, but I couldn't figure out what exactly. I really need help on this one. I also uploaded a crash log.
- polygon related:
- when I try to copy a polygon and then paste it, it leads to some weird behaviour in which there are (seemingly) two polygons with the same geometry, rendered one over the other. I also uploaded a screencast which shows better this behaviour.
- cutting works fine; However, there is also the problem which is already known: the cutting is done by actually moving the whole polygon from the first clicked point to the point where the 'Paste Graphic Item' action has been triggered. This causes the polygon to change its shape due to the way the moving is done at the moment.
I'm waiting feedback and, very important, suggestions on what is causing the mentioned issues.
Ok, so I found another problem which I'm sure is directly related to this one.
When adding a new placemark, normally, if immediately after this the 'Cancel' button is pressed, the placemark is removed. But, as you can see in this new screencat I added, when moving the placemark over the other 'side' of the dateline and pressing the 'Cancel' button, the application crushes. What makes me more confuse is that it doesn't crush somewhere inside any of the functions of AnnotatePlugin, but, as the crash log I submitted shows, it happens in GeoDataPlacemark::coordinate( const QDateTime &dateTime, bool *iconAtCoordinates ) which is called from PlacemarkLayout at some point.
Looking at the video (they look all still really nice inspite of the bugs!) I guess you mean "Prime Meridian" instead of "Dateline". The "Dateline" is mostly the "Antimeridian" on the other side. :)
Other than that the weird behaviors I spotted in the video didn't ring a bell.
I have ideas how to tackle the shape change during moving but that opens up a whole new chapter. Maybe we can look into this at Randa :)
That is the Prime Meridian not the dateline/
another_error.avi: - Another error when moving placemarks over the dateline + Another error when moving placemarks over the prime meridian