Bug 299959 - GeoDataLatLonBox default ctor is little intuitive
Summary: GeoDataLatLonBox default ctor is little intuitive
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-13 20:47 UTC by Dennis Nienhüser
Modified: 2012-07-24 20:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Nienhüser 2012-05-13 20:47:05 UTC
The ctor without arguments creates a latlonbox that covers the full globe. Being used to QRect and similar I find this little intuitive and would expect an empty sized box instead.

Here are two examples why this is not intuitive:

1)
GeoDataLatLonBox one;
one.isEmpty(); // true
one.isNull(); // false

GeoDataLatLonBox two(0,0,0,0);
two.isEmpty(); // false
two.isNull(); // true

In my opinion isNull()==true should imply isEmpty()==true which is not the case for box two.

2)
GeoDataLatLonBox box;
GeoDataLatLonBox otherBox(1,2,3,4);
box = box.united(otherBox);

In 2) I'd like to have box == otherBox, which would work if the default ctor was constructing a null box.

On a related note, the latter case (uniting with a default constructed box) leads to a possible bug in the bound calculation. For example, uniting (showing west and east bounds in degrees now for each)
[-180 180] with [8.41941 8.42429] results in [180 8.42429]


Reproducible: Always
Comment 1 Dennis Nienhüser 2012-05-13 21:10:21 UTC
Git commit 7bfbed43730a7a840ab3156fe219ab6eb05c4085 by Dennis Nienhüser.
Committed on 13/05/2012 at 22:49.
Pushed by nienhueser into branch 'master'.

Fix bounds calculation

M  +1    -1    src/lib/routing/Route.cpp

http://commits.kde.org/marble/7bfbed43730a7a840ab3156fe219ab6eb05c4085
Comment 2 Dennis Nienhüser 2012-05-20 08:17:27 UTC
Git commit b4db6767d8e4d6b88a7445c07e8fa1890303d021 by Dennis Nienhüser.
Committed on 20/05/2012 at 10:14.
Pushed by nienhueser into branch 'master'.

Fix unification with bboxes spanning the entire longitudinal range.

M  +2    -2    src/lib/geodata/data/GeoDataLatLonBox.cpp
M  +3    -0    tests/TestGeoDataLatLonAltBox.cpp

http://commits.kde.org/marble/b4db6767d8e4d6b88a7445c07e8fa1890303d021
Comment 3 Dennis Nienhüser 2012-05-20 11:15:34 UTC
Git commit b296eb97811c57be01eacfbbe7d6bf98447d4064 by Dennis Nienhüser.
Committed on 20/05/2012 at 12:45.
Pushed by nienhueser into branch 'master'.

Handle viewport IDL crossing when calculating visible items.
Related: bug 298498
Note that commit 635dc5db mentioned in bug 298498#c0 did not cause the
bug itself, but only revealed it: Previously the bounding box was only
set in setLineString(), but not in the ctor which took the linestring
as well. Hence when using the ctor alone (which is what we do), the
bbox was not set to the correct one, but an empty one. Now the default
ctor of the bbox returns a sphere sized bbox, hence seemingly making it
work (hiding both the bbox calculation bug as well as the negative
performance implications). To me that's another argument to change the
default ctor of GeoDataLatLon*Box.

M  +17   -0    src/lib/GeoGraphicsScene.cpp

http://commits.kde.org/marble/b296eb97811c57be01eacfbbe7d6bf98447d4064
Comment 4 Dennis Nienhüser 2012-05-25 08:52:19 UTC
Git commit d641bde789a91ca5a296cecebc6fd39f99a2425d by Dennis Nienhüser.
Committed on 25/05/2012 at 09:38.
Pushed by nienhueser into branch 'master'.

Have GeoDataLatLonBox(void) create empty boxes.
REVIEW: 105038

M  +18   -6    src/lib/geodata/data/GeoDataLatLonBox.cpp
M  +1    -1    src/lib/geodata/data/GeoDataLatLonBox.h
M  +28   -0    tests/TestGeoDataLatLonAltBox.cpp

http://commits.kde.org/marble/d641bde789a91ca5a296cecebc6fd39f99a2425d
Comment 5 Dennis Nienhüser 2012-06-25 18:15:54 UTC
Git commit 216dc034a916a1ec5509f5c040e0c3eff02ca80d by Dennis Nienhüser.
Committed on 25/06/2012 at 20:13.
Pushed by nienhueser into branch 'master'.

Fix visibility of points, images and ground overlays in the geoscene.
CCMAIL: e.konrad@mpegcode.com

M  +5    -0    src/lib/geodata/graphicsitem/GeoImageGraphicsItem.cpp
M  +3    -0    src/lib/geodata/graphicsitem/GeoImageGraphicsItem.h
M  +5    -0    src/lib/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp
M  +3    -0    src/lib/geodata/graphicsitem/GeoPhotoGraphicsItem.h
M  +5    -0    src/lib/geodata/graphicsitem/GeoPointGraphicsItem.cpp
M  +3    -0    src/lib/geodata/graphicsitem/GeoPointGraphicsItem.h

http://commits.kde.org/marble/216dc034a916a1ec5509f5c040e0c3eff02ca80d
Comment 6 Dennis Nienhüser 2012-07-24 20:48:50 UTC
Git commit 2dd24ffff10a3fc572deb6a01cf32519d9307f47 by Dennis Nienhüser.
Committed on 25/06/2012 at 20:13.
Pushed by nienhueser into branch 'sok-2012-plasma-active'.

Fix visibility of points, images and ground overlays in the geoscene.
CCMAIL: e.konrad@mpegcode.com

M  +5    -0    src/lib/geodata/graphicsitem/GeoImageGraphicsItem.cpp
M  +3    -0    src/lib/geodata/graphicsitem/GeoImageGraphicsItem.h
M  +5    -0    src/lib/geodata/graphicsitem/GeoPhotoGraphicsItem.cpp
M  +3    -0    src/lib/geodata/graphicsitem/GeoPhotoGraphicsItem.h
M  +5    -0    src/lib/geodata/graphicsitem/GeoPointGraphicsItem.cpp
M  +3    -0    src/lib/geodata/graphicsitem/GeoPointGraphicsItem.h

http://commits.kde.org/marble/2dd24ffff10a3fc572deb6a01cf32519d9307f47