summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <[email protected]>2016-07-03 21:13:56 +0200
committerDennis Nienhüser <[email protected]>2016-07-03 21:13:56 +0200
commit06658a446179d1082665d18fd451ed84ee8d23c0 (patch)
treef446f44bd565a254a67c4c7bc73f4a4081c83ff0
parentb4dd2682b3a2722cf466506fc24d617c918839d7 (diff)
Reduce memory consumption a bit
-rw-r--r--src/lib/marble/geodata/data/GeoDataCoordinates.cpp6
-rw-r--r--src/lib/marble/geodata/data/GeoDataCoordinates.h4
-rw-r--r--src/lib/marble/geodata/data/GeoDataCoordinates_p.h2
-rw-r--r--src/lib/marble/geodata/data/GeoDataLineString.cpp8
-rw-r--r--src/lib/marble/geodata/data/GeoDataLineString_p.h6
5 files changed, 14 insertions, 12 deletions
diff --git a/src/lib/marble/geodata/data/GeoDataCoordinates.cpp b/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
index 74175ea..f5700f8 100644
--- a/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
+++ b/src/lib/marble/geodata/data/GeoDataCoordinates.cpp
@@ -1285,15 +1285,15 @@ qreal GeoDataCoordinates::utmNorthing() const{
return GeoDataCoordinatesPrivate::lonLatToNorthing(d->m_lon, d->m_lat);
}
-int GeoDataCoordinates::detail() const
+quint8 GeoDataCoordinates::detail() const
{
return d->m_detail;
}
-void GeoDataCoordinates::setDetail( const int det )
+void GeoDataCoordinates::setDetail(quint8 detail)
{
detach();
- d->m_detail = det;
+ d->m_detail = detail;
}
GeoDataCoordinates GeoDataCoordinates::rotateAround( const GeoDataCoordinates &axis, qreal angle, Unit unit ) const
diff --git a/src/lib/marble/geodata/data/GeoDataCoordinates.h b/src/lib/marble/geodata/data/GeoDataCoordinates.h
index 3754c53..7d83119 100644
--- a/src/lib/marble/geodata/data/GeoDataCoordinates.h
+++ b/src/lib/marble/geodata/data/GeoDataCoordinates.h
@@ -255,13 +255,13 @@ class GEODATA_EXPORT GeoDataCoordinates
* @brief return the detail flag
* detail range: 0 for most important points, 5 for least important
*/
- int detail() const;
+ quint8 detail() const;
/**
* @brief set the detail flag
* @param det detail
*/
- void setDetail( const int detail );
+ void setDetail(quint8 detail);
/**
* @brief Rotates one coordinate around another.
diff --git a/src/lib/marble/geodata/data/GeoDataCoordinates_p.h b/src/lib/marble/geodata/data/GeoDataCoordinates_p.h
index b246e1a..e38ee2f 100644
--- a/src/lib/marble/geodata/data/GeoDataCoordinates_p.h
+++ b/src/lib/marble/geodata/data/GeoDataCoordinates_p.h
@@ -206,7 +206,7 @@ class GeoDataCoordinatesPrivate
qreal m_lon;
qreal m_lat;
qreal m_altitude; // in meters above sea level
- int m_detail;
+ quint8 m_detail;
QAtomicInt ref;
/* UTM Ellipsoid model constants (actual values here are for WGS84) */
diff --git a/src/lib/marble/geodata/data/GeoDataLineString.cpp b/src/lib/marble/geodata/data/GeoDataLineString.cpp
index 7ffcded..41f5593 100644
--- a/src/lib/marble/geodata/data/GeoDataLineString.cpp
+++ b/src/lib/marble/geodata/data/GeoDataLineString.cpp
@@ -132,7 +132,7 @@ GeoDataCoordinates GeoDataLineStringPrivate::findDateLine( const GeoDataCoordina
return findDateLine( previousCoords, interpolatedCoords, recursionCounter );
}
-int GeoDataLineStringPrivate::levelForResolution(qreal resolution) const {
+quint8 GeoDataLineStringPrivate::levelForResolution(qreal resolution) const {
if (m_previousResolution == resolution) return m_level;
m_previousResolution = resolution;
@@ -227,10 +227,10 @@ void GeoDataLineStringPrivate::optimize (GeoDataLineString& lineString) const
if (lineString.size() < 2) return;
// Calculate the least non-zero detail-level by checking the bounding box
- int startLevel = levelForResolution( ( lineString.latLonAltBox().width() + lineString.latLonAltBox().height() ) / 2 );
+ quint8 startLevel = levelForResolution( ( lineString.latLonAltBox().width() + lineString.latLonAltBox().height() ) / 2 );
- int currentLevel = startLevel;
- int maxLevel = startLevel;
+ quint8 currentLevel = startLevel;
+ quint8 maxLevel = startLevel;
GeoDataCoordinates currentCoords;
lineString.first().setDetail(startLevel);
diff --git a/src/lib/marble/geodata/data/GeoDataLineString_p.h b/src/lib/marble/geodata/data/GeoDataLineString_p.h
index a0157df..3ba145e 100644
--- a/src/lib/marble/geodata/data/GeoDataLineString_p.h
+++ b/src/lib/marble/geodata/data/GeoDataLineString_p.h
@@ -87,7 +87,7 @@ class GeoDataLineStringPrivate : public GeoDataGeometryPrivate
const GeoDataCoordinates & currentCoords,
int recursionCounter ) const;
- int levelForResolution(qreal resolution) const;
+ quint8 levelForResolution(qreal resolution) const;
qreal resolutionForLevel(int level) const;
void optimize(GeoDataLineString& lineString) const;
@@ -101,7 +101,9 @@ class GeoDataLineStringPrivate : public GeoDataGeometryPrivate
// been calculated. Saves performance.
TessellationFlags m_tessellationFlags;
mutable qreal m_previousResolution;
- mutable qreal m_level;};
+ mutable quint8 m_level;
+
+};
} // namespace Marble