[Marble-commits] KDE/kdeedu/marble/src

Torsten Rahn tackat at kde.org
Wed Jul 22 03:38:08 CEST 2009


SVN commit 1000794 by rahn:

- Make it faster.



 M  +12 -3     lib/GeoPainter.cpp  
 M  +2 -2      plugins/render/geodata/GeoRendererPlugin.cpp  
 M  +5 -1      plugins/render/osmannotate/OsmAnnotatePlugin.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/GeoPainter.cpp #1000793:1000794
@@ -380,7 +380,10 @@
                                 LabelPositionFlags labelPositionFlags )
 {
     // If the object is not visible in the viewport return 
-    if ( ! d->m_viewport->viewLatLonAltBox().intersects( lineString.latLonAltBox() ) )
+    if ( ! d->m_viewport->viewLatLonAltBox().intersects( lineString.latLonAltBox() ) ||
+    // If the size of the object is below the resolution of the viewport then return
+         ! d->m_viewport->resolves( lineString.latLonAltBox() )
+        )
     {
 //        qDebug() << "LineString doesn't get displayed on the viewport";
         return;
@@ -427,7 +430,10 @@
 void GeoPainter::drawPolygon ( const GeoDataLinearRing & linearRing, Qt::FillRule fillRule )
 {
     // If the object is not visible in the viewport return
-    if ( ! d->m_viewport->viewLatLonAltBox().intersects( linearRing.latLonAltBox() ) )
+    if ( ! d->m_viewport->viewLatLonAltBox().intersects( linearRing.latLonAltBox() ) ||
+    // If the size of the object is below the resolution of the viewport then return
+         ! d->m_viewport->resolves( linearRing.latLonAltBox() )
+        )
     {
 //        qDebug() << "Polygon doesn't get displayed on the viewport";
         return;
@@ -475,7 +481,10 @@
 void GeoPainter::drawPolygon ( const GeoDataPolygon & polygon, Qt::FillRule fillRule )
 {
     // If the object is not visible in the viewport return 
-    if ( ! d->m_viewport->viewLatLonAltBox().intersects( polygon.outerBoundary().latLonAltBox() ) )
+    if ( ! d->m_viewport->viewLatLonAltBox().intersects( polygon.outerBoundary().latLonAltBox() ) ||
+    // If the size of the object is below the resolution of the viewport then return
+         ! d->m_viewport->resolves( polygon.outerBoundary().latLonAltBox() )
+        )
     {
 //        qDebug() << "Polygon doesn't get displayed on the viewport";
         return;
--- trunk/KDE/kdeedu/marble/src/plugins/render/geodata/GeoRendererPlugin.cpp #1000793:1000794
@@ -61,7 +61,7 @@
 
 QStringList GeoRendererPlugin::renderPosition() const
 {
-    return QStringList( "SURFACE" );
+    return QStringList( "HOVERS_ABOVE_SURFACE" );
 }
 
 QString GeoRendererPlugin::name() const
@@ -107,7 +107,7 @@
     Q_UNUSED( renderPos )
     Q_UNUSED( layer )
 
-    if ( renderPos != "SURFACE" ) {
+    if ( renderPos != "HOVERS_ABOVE_SURFACE" ) {
         return true;
     }
 
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/OsmAnnotatePlugin.cpp #1000793:1000794
@@ -51,7 +51,7 @@
 
 QStringList OsmAnnotatePlugin::renderPosition() const
 {
-    return QStringList( "ALWAYS_ON_TOP" );
+    return QStringList( "HOVERS_ABOVE_SURFACE" );
 }
 
 QString OsmAnnotatePlugin::name() const
@@ -119,6 +119,10 @@
 
 bool OsmAnnotatePlugin::render( GeoPainter *painter, ViewportParams *viewport, const QString& renderPos, GeoSceneLayer * layer )
 {
+    if ( renderPos != "HOVERS_ABOVE_SURFACE" ) {
+        return true;
+    }
+    
     if( !widgetInitalised ) {
         MarbleWidget* marbleWidget = (MarbleWidget*) painter->device();
         m_marbleWidget = marbleWidget;


More information about the Marble-commits mailing list