Added copy and cut actions on polygons/placemarks
Review Request #119555 - Created July 31, 2014 and submitted - Latest diff uploaded
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.