Changeset View
Changeset View
Standalone View
Standalone View
tools/osm-simplify/PlacemarkFilter.cpp
1 | // | ||||
---|---|---|---|---|---|
2 | // This file is part of the Marble Virtual Globe. | ||||
3 | // | ||||
4 | // This program is free software licensed under the GNU LGPL. You can | ||||
5 | // find a copy of this license in LICENSE.txt in the top directory of | ||||
6 | // the source code. | ||||
7 | // | ||||
8 | // Copyright 2016 David Kolozsvari <freedawson@gmail.com> | ||||
9 | // | ||||
10 | | ||||
1 | #include "PlacemarkFilter.h" | 11 | #include "PlacemarkFilter.h" | ||
2 | 12 | | |||
3 | #include "GeoDataPlacemark.h" | 13 | #include "GeoDataPlacemark.h" | ||
4 | 14 | | |||
5 | PlacemarkFilter::PlacemarkFilter(GeoDataDocument *document, const char *type) : | 15 | PlacemarkFilter::PlacemarkFilter(GeoDataDocument *document) : | ||
6 | BaseFilter(document, GeoDataTypes::GeoDataPlacemarkType) | 16 | BaseFilter(document, GeoDataTypes::GeoDataPlacemarkType) | ||
7 | { | 17 | { | ||
8 | QList<GeoDataObject*> toRemove; | 18 | qDebug() << "Placemark count:" << m_objects.size(); | ||
9 | foreach (GeoDataObject* placemark, m_objects) { | | |||
10 | if( static_cast<GeoDataPlacemark*>(placemark)->geometry()->nodeType() != type) { | | |||
11 | toRemove.append(placemark); | | |||
12 | } | | |||
13 | } | | |||
14 | | ||||
15 | foreach (GeoDataObject* placemark, toRemove) { | | |||
16 | m_objects.removeOne(placemark); | | |||
17 | } | | |||
18 | } | 19 | } | ||
19 | 20 | |