[Marble-commits] KDE/kdeedu/marble/src
Andrew Manson
g.real.ate at gmail.com
Mon Aug 3 11:22:25 CEST 2009
SVN commit 1006225 by mansona:
fix high FPS with continuous repainting in the OSMAnnotate plugin
fix the interleaving of GeoWidgetBubble and Weather Items by adding annother
renderposition
M +1 -1 lib/MarbleModel.cpp
M +4 -1 lib/Projections/AbstractProjection.h
M +1 -0 lib/RenderPluginInterface.h
M +5 -5 plugins/render/osmannotate/GeoWidgetBubble.cpp
M +0 -1 plugins/render/osmannotate/GeoWidgetBubble.h
M +25 -19 plugins/render/osmannotate/OsmAnnotatePlugin.cpp
M +11 -3 plugins/render/osmannotate/PlacemarkTextAnnotation.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1006224:1006225
@@ -643,7 +643,7 @@
renderPositions.clear();
renderPositions << "HOVERS_ABOVE_SURFACE" << "ATMOSPHERE"
- << "ORBIT" << "ALWAYS_ON_TOP" << "FLOAT_ITEM";
+ << "ORBIT" << "ALWAYS_ON_TOP" << "FLOAT_ITEM" << "USER_TOOLS";
d->m_layerManager->renderLayers( painter, viewParams, renderPositions );
}
--- trunk/KDE/kdeedu/marble/src/lib/Projections/AbstractProjection.h #1006224:1006225
@@ -206,7 +206,10 @@
// The usage of the following methods is DEPRECATED!
- /* DEPRECATED */
+ /**
+ * @deprecated
+ * use @see screenCoordinates(qreal,qreal,const ViewportParams*,qreal&,qreal&)
+ */
bool screenCoordinates( qreal lon, qreal lat,
const ViewportParams *viewport,
int& x, int& y );
--- trunk/KDE/kdeedu/marble/src/lib/RenderPluginInterface.h #1006224:1006225
@@ -87,6 +87,7 @@
* "ORBIT"
* "ALWAYS_ON_TOP"
* "FLOAT_ITEM"
+ * "USER_TOOLS"
*/
virtual QStringList renderPosition() const = 0;
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/GeoWidgetBubble.cpp #1006224:1006225
@@ -97,15 +97,15 @@
m_screenPosition = pos;
}
-void GeoWidgetBubble::hide()
+void GeoWidgetBubble::setHidden( bool hide )
{
- setHidden(true);
-}
+ if( m_hidden == hide ) {
+ return;
+ }
-void GeoWidgetBubble::setHidden( bool hide )
-{
//if its not hidden and we want to hide
if( hide && !m_hidden ) {
+ m_widget->setVisible( m_hidden );
m_hidden = true ;
}
else if ( !hide && m_hidden ) {
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/GeoWidgetBubble.h #1006224:1006225
@@ -36,7 +36,6 @@
bool marbleWidgetIsInitalised() const;
void moveTo( QPoint screenPos );
- void hide();
void setHidden( bool hide );
bool isHidden() const;
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/OsmAnnotatePlugin.cpp #1006224:1006225
@@ -51,7 +51,10 @@
QStringList OsmAnnotatePlugin::renderPosition() const
{
- return QStringList( "HOVERS_ABOVE_SURFACE" );
+ QStringList positions;
+ positions.append( "HOVERS_ABOVE_SURFACE" );
+ positions.append( "USER_TOOLS" );
+ return positions;
}
QString OsmAnnotatePlugin::name() const
@@ -109,7 +112,7 @@
bool OsmAnnotatePlugin::render( GeoPainter *painter, ViewportParams *viewport, const QString& renderPos, GeoSceneLayer * layer )
{
- if ( renderPos != "HOVERS_ABOVE_SURFACE" ) {
+ if ( renderPos != "HOVERS_ABOVE_SURFACE" && renderPos != "USER_TOOLS" ) {
return true;
}
@@ -123,31 +126,34 @@
widgetInitalised = true;
}
- painter->autoMapQuality();
- //so the user can keep track of the current polygon drawing
- if( m_tmp_lineString ) {
- painter->drawPolyline( *m_tmp_lineString );
+ if( renderPos == "HOVERS_ABOVE_SURFACE" ) {
+ painter->autoMapQuality();
+
+ //so the user can keep track of the current polygon drawing
+ if( m_tmp_lineString ) {
+ painter->drawPolyline( *m_tmp_lineString );
+ }
+
+ if( m_itemModel ) {
+ QListIterator<GeoGraphicsItem*> it( *m_itemModel );
+
+ while( it.hasNext() ) {
+ GeoGraphicsItem* i = it.next();
+ if( i->flags() & GeoGraphicsItem::ItemIsVisible ) {
+ i->paint( painter, viewport, renderPos, layer );
+ }
+ }
+ }
}
-
+
QListIterator<TmpGraphicsItem*> i(model);
-
+
while(i.hasNext()) {
TmpGraphicsItem* tmp= i.next();
tmp->paint(painter, viewport, renderPos, layer);
}
- if( m_itemModel ) {
- QListIterator<GeoGraphicsItem*> it( *m_itemModel );
-
- while( it.hasNext() ) {
- GeoGraphicsItem* i = it.next();
- if( i->flags() & GeoGraphicsItem::ItemIsVisible ) {
- i->paint( painter, viewport, renderPos, layer );
- }
- }
- }
-
return true;
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/PlacemarkTextAnnotation.cpp #1006224:1006225
@@ -77,15 +77,23 @@
bool hidden;
bool visable = viewport->currentProjection()->screenCoordinates( coordinate(), viewport, x, y, hidden );
- if( visable && !hidden ) {
- QList<QRegion> list;
+ if( renderPos == "HOVERS_ABOVE_SURFACE" ) {
+ painter->drawPixmap( coordinate(),
+ QPixmap( MarbleDirs::path( "bitmaps/annotation.png" ) ) );
+ QList<QRegion> list;
list.append( QRegion( x -10 , y-10 , 20 , 20 ) );
setRegions( list );
painter->drawRect( regions().at(0).boundingRect() );
+ return;
+ }
+
+
+
+ if( visable && !hidden ) {
bubble->moveTo( QPoint( x, y ) );
bubble->paint( painter, viewport, renderPos, layer );
} else {
- bubble->hide();
+ bubble->setHidden(true );
}
//FIXME This shouldn't really be a part of this method at all as each item should
More information about the Marble-commits
mailing list