[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Sun Nov 7 10:43:24 CET 2010
SVN commit 1193816 by beschow:
mark the map as dirty when the planet axis is changed
* removes some FIXMEs
M +4 -12 MarbleMap.cpp
M +0 -5 MarbleMap_p.h
M +0 -26 ViewParams.cpp
M +0 -6 ViewParams.h
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1193815:1193816
@@ -157,12 +157,8 @@
}
m_model->paintGlobe( &painter, &m_viewParams,
- needsUpdate() || m_viewParams.canvasImage()->isNull(),
+ m_justModified || m_viewParams.canvasImage()->isNull(),
dirtyRect );
- // FIXME: this is ugly, add method updatePlanetAxis() to ViewParams
- m_viewParams.setPlanetAxisUpdated( m_viewParams.planetAxis() );
- // FIXME: this is ugly, add method updateRadius() to ViewParams
- m_viewParams.setRadiusUpdated( m_viewParams.radius() );
m_justModified = false;
}
@@ -333,13 +329,6 @@
emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
}
-bool MarbleMapPrivate::needsUpdate() const
-{
- return ( m_justModified
- || m_viewParams.radius() != m_viewParams.radiusUpdated()
- || !( m_viewParams.planetAxis() == m_viewParams.planetAxisUpdated() ) );
-}
-
void MarbleMap::setNeedsUpdate()
{
d->m_justModified = true;
@@ -629,6 +618,7 @@
void MarbleMap::rotateBy( const Quaternion& incRot )
{
d->m_viewParams.setPlanetAxis( incRot * d->m_viewParams.planetAxis() );
+ setNeedsUpdate();
emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
}
@@ -642,6 +632,7 @@
axis *= rotPhi;
axis.normalize();
d->m_viewParams.setPlanetAxis( axis );
+ setNeedsUpdate();
emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
}
@@ -651,6 +642,7 @@
Quaternion quat;
quat.createFromEuler( -lat * DEG2RAD, lon * DEG2RAD, 0.0 );
d->m_viewParams.setPlanetAxis( quat );
+ setNeedsUpdate();
emit visibleLatLonAltBoxChanged( d->m_viewParams.viewport()->viewLatLonAltBox() );
}
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap_p.h #1193815:1193816
@@ -48,11 +48,6 @@
void paintOverlay( GeoPainter &painter, QRect &dirtyRect);
void paintFps( GeoPainter &painter, QRect &dirtyRect, qreal fps);
- /**
- * @brief return if the map needs to be updated.
- */
- bool needsUpdate() const;
-
MarbleMap *m_parent;
// The model we are showing.
--- trunk/KDE/kdeedu/marble/src/lib/ViewParams.cpp #1193815:1193816
@@ -42,10 +42,6 @@
MapQuality m_mapQuality;
- // FIXME: We should try to get rid of these two:
- Quaternion m_planetAxisUpdated;
- int m_radiusUpdated;
-
// Parameters that determine the painting
// Show/don't show options
@@ -75,8 +71,6 @@
: m_mapTheme( 0 ),
m_viewport(),
m_mapQuality( NormalQuality ),
- m_planetAxisUpdated(),
- m_radiusUpdated( 0 ),
// Show / don't show parameters
m_showAtmosphere( true ),
m_showElevationModel( false ),
@@ -307,16 +301,6 @@
d->m_coastImage = image;
}
-int ViewParams::radiusUpdated() const
-{
- return d->m_radiusUpdated;
-}
-
-void ViewParams::setRadiusUpdated( const int radiusUpdated )
-{
- d->m_radiusUpdated = radiusUpdated;
-}
-
bool ViewParams::showGps() const
{
return d->m_showGps;
@@ -361,14 +345,4 @@
d->propagateGlobalToLocalSettings();
}
-Quaternion ViewParams::planetAxisUpdated() const
-{
- return d->m_planetAxisUpdated;
}
-
-void ViewParams::setPlanetAxisUpdated( const Quaternion & planetAxisUpdated )
-{
- d->m_planetAxisUpdated = planetAxisUpdated;
-}
-
-}
--- trunk/KDE/kdeedu/marble/src/lib/ViewParams.h #1193815:1193816
@@ -123,12 +123,6 @@
bool showClouds() const;
void setShowClouds( bool const );
- // FIXME: We should try to get rid of these
- int radiusUpdated() const;
- void setRadiusUpdated( const int );
- Quaternion planetAxisUpdated() const;
- void setPlanetAxisUpdated( const Quaternion & );
-
private:
Q_DISABLE_COPY( ViewParams )
ViewParamsPrivate * const d;
More information about the Marble-commits
mailing list