Bug 331672 - Equality operators for GeoDataPoint, GeoDataLineString, GeoDataLinearRing, GeoDataPolygon
Summary: Equality operators for GeoDataPoint, GeoDataLineString, GeoDataLinearRing, Ge...
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.7 (KDE 4.12)
Platform: unspecified Linux
: NOR task
Target Milestone: ---
Assignee: Cruceru Calin-Cristian
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2014-03-02 07:54 UTC by Dennis Nienhüser
Modified: 2014-03-05 17:19 UTC (History)
1 user (show)

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 2014-03-02 07:54:35 UTC
Add a protected method
bool equals(const GeoDataGeometry &other) const
to GeoDataGeometry. It should check whether extrude and altitudeMode are equal.

Make it possible to check for equality using operator== in the following classes:
- GeoDataPoint (first check GeoDataGeometry::equals(), then the coordinates)
- GeoDataLineString (first check GeoDataGeometry::equals(), tesselate() and size(), afterwards iterate over all points and check them. If one differs, return false)
- GeoDataLinearRing (same as line string, but check isClosed() as well)
- GeoDataPolygon (first check GeoDataGeometry::equals(), isClosed(), tesselate(), outerBoundary(), each of innerBoundaries())

Add unit test method to tests/TestEquality for each of the classes. Make sure to compile Marble with the following cmake options enabled: BUILD_MARBLE_TESTS=TRUE, BUILD_MARBLE_TOOLS=TRUE. Execute tests/TestEquality and make sure no errors come up. Use tools/kml2kml to analyze errors and fix the tag writers, if needed. Submit a review request at https://git.reviewboard.kde.org with the marble group as reviewers.

Please leave a comment here (e.g. "I want to work on this task.") if you start working on this task to avoid multiple people working on it at the same time.
Comment 1 Cruceru Calin-Cristian 2014-03-02 08:32:31 UTC
I want to work on this task.
Comment 2 Dennis Nienhüser 2014-03-05 17:19:45 UTC
Git commit b098a5cba497e59966b0e83ca7414eae33824072 by Dennis Nienhüser, on behalf of Cruceru Calin-Cristian.
Committed on 05/03/2014 at 17:14.
Pushed by nienhueser into branch 'master'.

Equality operators for GDPoint, GDLineString, GDLinearRing, GDPolygon

REVIEW: 116553

M  +6    -0    src/lib/marble/geodata/data/GeoDataGeometry.cpp
M  +3    -0    src/lib/marble/geodata/data/GeoDataGeometry.h
M  +28   -0    src/lib/marble/geodata/data/GeoDataLineString.cpp
M  +7    -0    src/lib/marble/geodata/data/GeoDataLineString.h
M  +11   -0    src/lib/marble/geodata/data/GeoDataLinearRing.cpp
M  +9    -0    src/lib/marble/geodata/data/GeoDataLinearRing.h
M  +11   -0    src/lib/marble/geodata/data/GeoDataPoint.cpp
M  +3    -0    src/lib/marble/geodata/data/GeoDataPoint.h
M  +27   -0    src/lib/marble/geodata/data/GeoDataPolygon.cpp
M  +7    -0    src/lib/marble/geodata/data/GeoDataPolygon.h
M  +180  -0    tests/TestEquality.cpp

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