[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r3487: Bring our patched Marble up to date with Marble trunk. (in marble/trunk: . src src/lib src/lib/AbstractLayer src/lib/Projections src/lib/geodata/data src/lib/geodata/parser src/lib/gps src/plasmoid src/plugins/render/crosshairs src/plugins/render/test tools/iau2kml)
Author: edmanm
Date: 2009-01-31 12:31:35 -0500 (Sat, 31 Jan 2009)
New Revision: 3487
Added:
marble/trunk/Mainpage.dox
marble/trunk/src/lib/PlanetaryConstants.h
Removed:
marble/trunk/src/Mainpage.dox
Modified:
marble/trunk/src/ControlView.cpp
marble/trunk/src/KdeMainWindow.cpp
marble/trunk/src/kdemain.cpp
marble/trunk/src/lib/AbstractLayer/AbstractLayerContainer.cpp
marble/trunk/src/lib/AbstractLayer/AbstractLayerData.cpp
marble/trunk/src/lib/AbstractScanlineTextureMapper.cpp
marble/trunk/src/lib/AbstractScanlineTextureMapper.h
marble/trunk/src/lib/CMakeLists.txt
marble/trunk/src/lib/GpxFileViewItem.cpp
marble/trunk/src/lib/KmlFileViewItem.cpp
marble/trunk/src/lib/MapThemeManager.cpp
marble/trunk/src/lib/MapThemeSortFilterProxyModel.cpp
marble/trunk/src/lib/MarbleAbstractFloatItem.cpp
marble/trunk/src/lib/MarbleControlBox.cpp
marble/trunk/src/lib/MarbleDirs.cpp
marble/trunk/src/lib/MarbleGeoDataModel.cpp
marble/trunk/src/lib/MarbleGeoDataModel.h
marble/trunk/src/lib/MarbleMap.cpp
marble/trunk/src/lib/MarbleModel.cpp
marble/trunk/src/lib/MarbleModel.h
marble/trunk/src/lib/MarblePlacemarkModel.cpp
marble/trunk/src/lib/MarblePlacemarkModel.h
marble/trunk/src/lib/MarbleThemeSelectView.cpp
marble/trunk/src/lib/MarbleWidget.cpp
marble/trunk/src/lib/MarbleWidget.h
marble/trunk/src/lib/MarbleWidgetInputHandler.cpp
marble/trunk/src/lib/MarbleWidgetInputHandler.h
marble/trunk/src/lib/MarbleWidgetPopupMenu.cpp
marble/trunk/src/lib/MarbleWidgetPopupMenu.h
marble/trunk/src/lib/MeasureTool.cpp
marble/trunk/src/lib/MeasureTool.h
marble/trunk/src/lib/MergedLayerDecorator.cpp
marble/trunk/src/lib/MergedLayerDecorator.h
marble/trunk/src/lib/PlaceMarkContainer.cpp
marble/trunk/src/lib/PlaceMarkContainer.h
marble/trunk/src/lib/PlaceMarkLayout.cpp
marble/trunk/src/lib/PlaceMarkLayout.h
marble/trunk/src/lib/PlaceMarkManager.cpp
marble/trunk/src/lib/PlaceMarkManager.h
marble/trunk/src/lib/PlaceMarkPainter.cpp
marble/trunk/src/lib/PluginManager.cpp
marble/trunk/src/lib/Projections/EquirectProjection.cpp
marble/trunk/src/lib/Projections/MercatorProjection.cpp
marble/trunk/src/lib/SphericalScanlineTextureMapper.cpp
marble/trunk/src/lib/SunLocator.cpp
marble/trunk/src/lib/SunLocator.h
marble/trunk/src/lib/TextureColorizer.cpp
marble/trunk/src/lib/TextureTile.cpp
marble/trunk/src/lib/TextureTile.h
marble/trunk/src/lib/TextureTile_p.h
marble/trunk/src/lib/TileLoader.cpp
marble/trunk/src/lib/VectorComposer.cpp
marble/trunk/src/lib/VectorMap.cpp
marble/trunk/src/lib/VisiblePlaceMark.cpp
marble/trunk/src/lib/VisiblePlaceMark.h
marble/trunk/src/lib/geodata/data/GeoDataFeature.cpp
marble/trunk/src/lib/geodata/data/GeoDataFeature.h
marble/trunk/src/lib/geodata/parser/GeoDocument.cpp
marble/trunk/src/lib/geodata/parser/GeoDocument.h
marble/trunk/src/lib/geodata/parser/GeoParser.cpp
marble/trunk/src/lib/global.h
marble/trunk/src/lib/gps/GpsTracking.cpp
marble/trunk/src/lib/gps/GpxSax.cpp
marble/trunk/src/lib/gps/Track.cpp
marble/trunk/src/marble.desktop
marble/trunk/src/marble_part.cpp
marble/trunk/src/marble_part.desktop
marble/trunk/src/marble_part.h
marble/trunk/src/plasmoid/plasma-applet-kworldclock.desktop
marble/trunk/src/plasmoid/worldclock.cpp
marble/trunk/src/plasmoid/worldclockConfig.ui
marble/trunk/src/plugins/render/crosshairs/MarbleCrosshairsPlugin.cpp
marble/trunk/src/plugins/render/test/MarbleTestPlugin.cpp
marble/trunk/tools/iau2kml/iau2kml.cpp
Log:
Bring our patched Marble up to date with Marble trunk.
Added: marble/trunk/Mainpage.dox
===================================================================
--- marble/trunk/Mainpage.dox (rev 0)
+++ marble/trunk/Mainpage.dox 2009-01-31 17:31:35 UTC (rev 3487)
@@ -0,0 +1,53 @@
+/** @mainpage Marble
+
+Marble is an application that displays a view of the earth. It is
+both a valuable application in its own right, but also an example
+program that shows how you can use the Marble widgets in your own
+applications.
+
+We have designed Marble so that you can use its components easily to
+enhance your application with geo services. This manual enumerates the
+components and describes how to use them in your own application.
+
+The Marble application makes use of the following classes and widgets:
+
+1. MarbleWidget, the main widget in any application using the Marble
+ framework. This widget displays a view of the earth or any other
+ globe, depending on which dataset is used. The user can navigate
+ the globe using either a control widget, e.g. the MarbleControlBox,
+ or the mouse.
+
+2. MarbleModel, the data storage class that holds the data that is
+ visualized in the MarbleWidget. You can either create a
+ MarbleModel of your own, or let the MarbleWidget create one for
+ you.
+
+ This data model contains 3 separate datatypes: <b>tiles</b> which
+ provide the background, <b>vectors</b> which provide things like
+ country borders and coastlines and <b>placemarks</b> which can show
+ points of interest, such as cities, mountain tops or the poles.
+
+3. MarbleControlBox, the most advanced control widget for
+ MarbleWidget. It can be used to navigate around the globe, zoom,
+ search for placemarks like cities, control aspects of the view such
+ as showing water bodies, ice, terrain types, and cities. It can
+ also be used to control which dataset is used to provide the
+ background for the image and the projection (currently globe and
+ flat).
+
+These three classes provide the core of the classes that comprise the
+Marble framework. You can use only them and get a very capable
+application if you just provide them with some good datasets.
+
+In addition to this, there is also a simpler control widget called the
+MarbleNavigator that only controls panning and zooming. The
+MarbleNavigator is incorporated into the MarbleControlBox in the first
+tab. This control widget can be used in simpler application where
+theming, searching and other advanced controls are not needed.
+
+@see MarbleWidget
+@see MarbleModel
+@see MarbleControlBox
+@see MarbleNavigator
+
+ */
Modified: marble/trunk/src/ControlView.cpp
===================================================================
--- marble/trunk/src/ControlView.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/ControlView.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -30,24 +30,24 @@
resize( 680, 640 );
- m_control = new MarbleControlBox( this );
+ QVBoxLayout *vlayout = new QVBoxLayout( this );
+ vlayout->setMargin(0);
+
m_splitter = new QSplitter (this);
+ vlayout->addWidget( m_splitter );
+ m_control = new MarbleControlBox( this );
+ m_splitter->addWidget( m_control );
+ m_splitter->setStretchFactor(m_splitter->indexOf(m_control), 0);
+
m_marbleWidget = new MarbleWidget( this );
m_marbleWidget->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding,
QSizePolicy::MinimumExpanding ) );
- QVBoxLayout *vlayout = new QVBoxLayout( this );
-
- m_splitter->addWidget( m_control );
m_splitter->addWidget( m_marbleWidget );
+ m_splitter->setStretchFactor(m_splitter->indexOf(m_marbleWidget), 1);
m_splitter->setSizes( QList<int>() << 180 << width()-180 );
- m_splitter->setStretchFactor(m_splitter->indexOf(m_control), 0);
- m_splitter->setStretchFactor(m_splitter->indexOf(m_marbleWidget), 1);
- vlayout->addWidget( m_splitter );
- vlayout->setMargin(0);
-
m_control->addMarbleWidget( m_marbleWidget );
m_mapThemeManager = new MapThemeManager;
Modified: marble/trunk/src/KdeMainWindow.cpp
===================================================================
--- marble/trunk/src/KdeMainWindow.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/KdeMainWindow.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -38,12 +38,12 @@
setCentralWidget( m_part->widget() );
+ insertChildClient( m_part );
+
setXMLFile( "marbleui.rc" );
setStandardToolBarMenuEnabled( true );
- insertChildClient( m_part );
-
createGUI( 0 );
m_part->createInfoBoxesMenu();
Modified: marble/trunk/src/kdemain.cpp
===================================================================
--- marble/trunk/src/kdemain.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/kdemain.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -33,7 +33,7 @@
{
KAboutData aboutData( "marble", 0,
ki18n( "Marble Desktop Globe" ),
- "Pre-0.7 SVN",
+ MARBLE_VERSION_STRING.toLatin1(),
ki18n( "A World Atlas." ),
KAboutData::License_LGPL, ki18n( "(c) 2007, 2008, 2009" ),
KLocalizedString(),
Modified: marble/trunk/src/lib/AbstractLayer/AbstractLayerContainer.cpp
===================================================================
--- marble/trunk/src/lib/AbstractLayer/AbstractLayerContainer.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/AbstractLayer/AbstractLayerContainer.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -25,7 +25,7 @@
m_data = new QVector<AbstractLayerData*>( size );
m_visible = new QBitArray( size );
m_boundingBox = new BoundingBox();
-
+
m_name = 0;
}
@@ -35,7 +35,7 @@
m_data = new QVector<AbstractLayerData*>( size );
m_visible = new QBitArray( size );
m_boundingBox = new BoundingBox();
-
+
m_name = new QString ( name );
}
@@ -62,7 +62,7 @@
ViewParams *viewParams )
{
const_iterator it;
-
+
for( it = constBegin() ; it < constEnd() ; ++it ) {
(*it)->draw( painter, canvasSize, viewParams );
}
@@ -89,14 +89,14 @@
void AbstractLayerContainer::processVisible()
{
- QVector<AbstractLayerData*>::const_iterator i = m_data -> constBegin();
+ QVector<AbstractLayerData*>::const_iterator i = m_data->constBegin();
int temp;
-
- for ( ; i < m_data -> constEnd() ; ++i ) {
- if ( (*i) -> visible() ) {
+
+ for ( ; i < m_data->constEnd() ; ++i ) {
+ if ( (*i)->visible() ) {
//iterator safety
- temp = m_data -> indexOf ( *i );
- m_visible -> setBit ( temp, true );
+ temp = m_data->indexOf ( *i );
+ m_visible->setBit ( temp, true );
}
}
}
@@ -104,7 +104,7 @@
void AbstractLayerContainer::printToStream( QTextStream & out) const
{
const_iterator it;
-
+
for( it = constBegin(); it < constEnd(); ++it )
{
out << *(*it);
@@ -143,15 +143,11 @@
void AbstractLayerContainer::manageMemory()
{
- for ( int i = 0 ; i < m_visible -> size () ; ++i ) {
- if ( m_visible -> testBit( i ) ) {
- if ( ! ( this -> contains ( m_data -> at( i ) ) ) ) {
- this -> append( m_data -> at( i ) );
+ for ( int i = 0 ; i < m_visible->size () ; ++i ) {
+ if ( m_visible->testBit( i ) ) {
+ if ( ! ( this->contains ( m_data->at( i ) ) ) ) {
+ this->append( m_data->at( i ) );
}
}
}
}
-
-
-
-
Modified: marble/trunk/src/lib/AbstractLayer/AbstractLayerData.cpp
===================================================================
--- marble/trunk/src/lib/AbstractLayer/AbstractLayerData.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/AbstractLayer/AbstractLayerData.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -133,8 +133,8 @@
bool tempBool;
tempBool = getPixelPos( screenSize, viewParams, &tempPoint );
- point -> setX( (int)tempPoint.x() );
- point -> setY( (int)tempPoint.y() );
+ point->setX( (int)tempPoint.x() );
+ point->setY( (int)tempPoint.y() );
return tempBool;
}
Modified: marble/trunk/src/lib/AbstractScanlineTextureMapper.cpp
===================================================================
--- marble/trunk/src/lib/AbstractScanlineTextureMapper.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/AbstractScanlineTextureMapper.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -158,7 +158,7 @@
void AbstractScanlineTextureMapper::centerTiles( ViewParams *viewParams,
- const int tileLevel, qreal& tileCol, qreal& tileRow )
+ int tileLevel, qreal& tileCol, qreal& tileRow )
{
qreal centerLon, centerLat;
viewParams->centerCoordinates( centerLon, centerLat );
@@ -207,8 +207,8 @@
+ m_imageHeight * m_imageHeight / 4 );
}
-void AbstractScanlineTextureMapper::pixelValue(const qreal& lon,
- const qreal& lat,
+void AbstractScanlineTextureMapper::pixelValue(qreal lon,
+ qreal lat,
QRgb* scanLine,
bool smooth )
{
@@ -235,8 +235,7 @@
nextTile( m_posX, m_posY );
}
if (m_tile) {
- QRgb topLeftValue = m_tile->pixel( (int)(m_posX), (int)(m_posY) );
- *scanLine = bilinearSmooth( topLeftValue );
+ *scanLine = m_tile->pixelF( m_posX, m_posY );;
}
else {
*scanLine = 0;
Modified: marble/trunk/src/lib/AbstractScanlineTextureMapper.h
===================================================================
--- marble/trunk/src/lib/AbstractScanlineTextureMapper.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/AbstractScanlineTextureMapper.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -49,7 +49,7 @@
bool interlaced() const;
void setInterlaced( bool enabled );
- void centerTiles( ViewParams *viewParams, const int tileLevel,
+ void centerTiles( ViewParams *viewParams, int tileLevel,
qreal& tileCol, qreal& tileRow );
Q_SIGNALS:
@@ -59,7 +59,7 @@
void notifyMapChanged();
protected:
- void pixelValue( const qreal& lon, const qreal& lat,
+ void pixelValue( qreal lon, qreal lat,
QRgb* scanLine, bool smooth = false );
// method for fast integer calculation
@@ -79,8 +79,6 @@
qreal rad2PixelX( const qreal longitude ) const;
qreal rad2PixelY( const qreal latitude ) const;
- QRgb bilinearSmooth( const QRgb& topLeftValue ) const;
-
// Coordinates on the tile for fast integer calculation
int m_iPosX;
int m_iPosY;
@@ -164,12 +162,12 @@
return m_globalHeight;
}
-inline qreal AbstractScanlineTextureMapper::rad2PixelX( const qreal longitude ) const
+inline qreal AbstractScanlineTextureMapper::rad2PixelX( qreal longitude ) const
{
return longitude * m_normGlobalWidth;
}
-inline qreal AbstractScanlineTextureMapper::rad2PixelY( const qreal lat ) const
+inline qreal AbstractScanlineTextureMapper::rad2PixelY( qreal lat ) const
{
switch ( m_tileProjection ) {
case GeoSceneTexture::Equirectangular:
@@ -199,68 +197,6 @@
return 0.0;
}
-inline QRgb AbstractScanlineTextureMapper::bilinearSmooth( const QRgb& topLeftValue ) const
-{
- qreal fY = m_posY - (int)(m_posY);
-
- // Interpolation in y-direction
- if ( ( m_posY + 1.0 ) < m_tileLoader->tileHeight() ) {
-
- QRgb bottomLeftValue = m_tile->pixel( (int)(m_posX), (int)(m_posY + 1.0) );
-
- // blending the color values of the top left and bottom left point
- int ml_red = (int)( ( 1.0 - fY ) * qRed ( topLeftValue ) + fY * qRed ( bottomLeftValue ) );
- int ml_green = (int)( ( 1.0 - fY ) * qGreen( topLeftValue ) + fY * qGreen( bottomLeftValue ) );
- int ml_blue = (int)( ( 1.0 - fY ) * qBlue ( topLeftValue ) + fY * qBlue ( bottomLeftValue ) );
-
- // Interpolation in x-direction
- if ( ( m_posX + 1.0 ) < m_tileLoader->tileWidth() ) {
-
- qreal fX = m_posX - (int)(m_posX);
-
- QRgb topRightValue = m_tile->pixel( (int)(m_posX + 1.0), (int)(m_posY ) );
- QRgb bottomRightValue = m_tile->pixel( (int)(m_posX + 1.0), (int)(m_posY + 1.0) );
-
- // blending the color values of the top right and bottom right point
- int mr_red = (int)( ( 1.0 - fY ) * qRed ( topRightValue ) + fY * qRed ( bottomRightValue ) );
- int mr_green = (int)( ( 1.0 - fY ) * qGreen( topRightValue ) + fY * qGreen( bottomRightValue ) );
- int mr_blue = (int)( ( 1.0 - fY ) * qBlue ( topRightValue ) + fY * qBlue ( bottomRightValue ) );
-
- // blending the color values of the resulting middle left
- // and middle right points
- int mm_red = (int)( ( 1.0 - fX ) * ml_red + fX * mr_red );
- int mm_green = (int)( ( 1.0 - fX ) * ml_green + fX * mr_green );
- int mm_blue = (int)( ( 1.0 - fX ) * ml_blue + fX * mr_blue );
-
- return qRgb( mm_red, mm_green, mm_blue );
- }
- else {
- return qRgb( ml_red, ml_green, ml_blue );
- }
- }
- else {
- // Interpolation in x-direction
- if ( ( m_posX + 1.0 ) < m_tileLoader->tileWidth() ) {
-
- qreal fX = m_posX - (int)(m_posX);
-
- if ( fX == 0.0 )
- return topLeftValue;
-
- QRgb topRightValue = m_tile->pixel( (int)( m_posX + 1 ), (int)( m_posY ) );
-
- // blending the color values of the top left and top right point
- int tm_red = (int)( ( 1.0 - fX ) * qRed ( topLeftValue ) + fX * qRed ( topRightValue ) );
- int tm_green = (int)( ( 1.0 - fX ) * qGreen( topLeftValue ) + fX * qGreen( topRightValue ) );
- int tm_blue = (int)( ( 1.0 - fX ) * qBlue ( topLeftValue ) + fX * qBlue ( topRightValue ) );
-
- return qRgb( tm_red, tm_green, tm_blue );
- }
- }
-
- return topLeftValue;
}
-}
-
#endif
Modified: marble/trunk/src/lib/CMakeLists.txt
===================================================================
--- marble/trunk/src/lib/CMakeLists.txt 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/CMakeLists.txt 2009-01-31 17:31:35 UTC (rev 3487)
@@ -25,8 +25,8 @@
INCLUDE(geodata/CMakeLists.txt)
if (QTONLY)
- set(GENERIC_LIB_VERSION "0.6.0")
- set(GENERIC_LIB_SOVERSION "6")
+ set(GENERIC_LIB_VERSION "0.7.0")
+ set(GENERIC_LIB_SOVERSION "7")
endif (QTONLY)
if (QTONLY)
Modified: marble/trunk/src/lib/GpxFileViewItem.cpp
===================================================================
--- marble/trunk/src/lib/GpxFileViewItem.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/GpxFileViewItem.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -65,7 +65,7 @@
if( role == Qt::DisplayRole )
return m_gpxFile->display();
else if( role == AbstractFileViewItem::FilePointerRole )
- return m_gpxFile;
+ return qVariantFromValue(m_gpxFile);
else
return QVariant();
}
Modified: marble/trunk/src/lib/KmlFileViewItem.cpp
===================================================================
--- marble/trunk/src/lib/KmlFileViewItem.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/KmlFileViewItem.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -50,7 +50,7 @@
return QString("KML Document");
}
else if( role == AbstractFileViewItem::FilePointerRole ) {
- return &m_document;
+ return qVariantFromValue(&m_document);
}
else
return QVariant();
Modified: marble/trunk/src/lib/MapThemeManager.cpp
===================================================================
--- marble/trunk/src/lib/MapThemeManager.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MapThemeManager.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -173,9 +173,6 @@
}
}
-// for (int i = 0; i < mapFiles.size(); ++i)
-// qDebug() << basePath << "-Files: " << mapFiles.at(i);
-
return mapFiles;
}
@@ -195,9 +192,6 @@
}
}
- for (int i = 0; i < allMapFiles.size(); ++i)
- qDebug() << "Files: " << allMapFiles.at(i);
-
return allMapFiles;
}
@@ -233,6 +227,7 @@
// For now maxIconSize already equals what's expected by the listview.
QSize maxIconSize( 136, 136 );
if ( themeIconPixmap.size() != maxIconSize ) {
+ qDebug() << "Smooth scaling theme icon";
themeIconPixmap = themeIconPixmap.scaled( maxIconSize,
Qt::KeepAspectRatio,
Qt::SmoothTransformation );
@@ -367,31 +362,4 @@
}
}
-/*
-// Should we put this into
-// static QString MapThemeManager::suggestTheme( QString themeSuggestedBySettings );
-// ??
-
- QStringList mapthemedirs = findMapThemes( "maps/" );
- QString selectedmap;
-
- // We need at least one maptheme to run Marble.
- if ( mapthemedirs.count() == 0 ) {
- qDebug() << "Could not find any maps! Exiting ...";
- exit(-1);
- }
-
- // If any map directories were found, try to find the default map:
- // srtm. If we can find that, just grab the first one.
- if ( mapthemedirs.count() >= 1 ) {
- QStringList tmp = mapthemedirs.filter( "srtm.dgml" );
- if ( tmp.count() >= 1 )
- selectedmap = tmp[0];
- else
- selectedmap = mapthemedirs[0];
- }
-
-// setMapTheme( selectedmap, parent, Spherical );
-*/
-
#include "MapThemeManager.moc"
Modified: marble/trunk/src/lib/MapThemeSortFilterProxyModel.cpp
===================================================================
--- marble/trunk/src/lib/MapThemeSortFilterProxyModel.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MapThemeSortFilterProxyModel.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -12,13 +12,13 @@
{
QString leftData = sourceModel()->data( left ).toString();
QString rightData = sourceModel()->data( right ).toString();
- if ( leftData == "Atlas" ||
- leftData == "Satellite View" ||
- leftData == "OpenStreetMap" )
+ if ( leftData == tr("Atlas") ||
+ leftData == tr("Satellite View") ||
+ leftData == tr("OpenStreetMap") )
return true;
- else if ( rightData == "Atlas" ||
- rightData == "Satellite View" ||
- rightData == "OpenStreetMap" )
+ else if ( rightData == tr("Atlas") ||
+ rightData == tr("Satellite View") ||
+ rightData == tr("OpenStreetMap") )
return false;
else
return QSortFilterProxyModel::lessThan( left, right);
Modified: marble/trunk/src/lib/MarbleAbstractFloatItem.cpp
===================================================================
--- marble/trunk/src/lib/MarbleAbstractFloatItem.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleAbstractFloatItem.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -376,7 +376,7 @@
return true;
}
- // Reinitialize cachePixmap if the float item changes its size
+ // Reinitialize cachePixmap if the float item changes its size
// or other important common properties
if ( ( d->s_pixmapCacheEnabled && d->m_newItemProperties ) || d->m_cachePixmap.isNull() ) {
// Add extra space for the border
@@ -468,6 +468,10 @@
return false;
}
+ if ( e->type() == QEvent::MouseMove && !d->m_floatItemMoving ) {
+ return false;
+ }
+
// Move float items
bool cursorAboveFloatItem(false);
if ( e->type() == QEvent::MouseMove
@@ -476,7 +480,7 @@
{
QMouseEvent *event = static_cast<QMouseEvent*>(e);
QRectF floatItemRect = QRectF(positivePosition(QRectF(0,0,widget->width(),
- widget->height())), size());
+ widget->height())), size() + QSize(1,1));
// Click and move above a float item triggers moving the float item
if ( floatItemRect.contains(event->pos()) ) {
@@ -517,7 +521,7 @@
}
setPosition(QPointF(newX,newY));
- QRect newFloatItemRect = QRectF(positivePosition(QRect(0,0,widget->width(),widget->height())), size()).toRect();
+ QRect newFloatItemRect = QRectF(positivePosition(QRect(0,0,widget->width(),widget->height())), size() ).toRect();
d->m_floatItemMoveStartPos = event->pos();
QRegion dirtyRegion(floatItemRect.toRect());
dirtyRegion = dirtyRegion.united(newFloatItemRect);
Modified: marble/trunk/src/lib/MarbleControlBox.cpp
===================================================================
--- marble/trunk/src/lib/MarbleControlBox.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleControlBox.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -161,11 +161,6 @@
connect( d->uiWidget.moveDownButton, SIGNAL( clicked() ),
this, SIGNAL (moveDown() ) );
- connect( d->uiWidget.searchLineEdit, SIGNAL( textChanged( const QString& ) ),
- this, SLOT( searchLineChanged( const QString& ) ) );
- connect( d->uiWidget.searchLineEdit, SIGNAL( returnPressed() ),
- this, SLOT( searchReturnPressed() ) );
-
connect( d->uiWidget.locationListView, SIGNAL( centerOn( const QModelIndex& ) ),
this, SLOT( mapCenterOnSignal( const QModelIndex& ) ) );
@@ -184,9 +179,14 @@
d->uiWidget.projectionComboBox->setEnabled( true );
d->m_runnerManager = new MarbleRunnerManager( this );
-
+
connect( d->m_runnerManager, SIGNAL( modelChanged( MarblePlacemarkModel* ) ),
this, SLOT( setLocations( MarblePlacemarkModel* ) ) );
+
+ connect( d->uiWidget.searchLineEdit, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( searchLineChanged( const QString& ) ) );
+ connect( d->uiWidget.searchLineEdit, SIGNAL( returnPressed() ),
+ this, SLOT( searchReturnPressed() ) );
}
MarbleControlBox::~MarbleControlBox()
@@ -222,8 +222,8 @@
void MarbleControlBox::setupGpsOption()
{
- d->uiWidget.m_gpsDrawBox -> setEnabled( true );
- d->uiWidget.m_gpsGoButton -> setEnabled( false );
+ d->uiWidget.m_gpsDrawBox->setEnabled( true );
+ d->uiWidget.m_gpsGoButton->setEnabled( false );
d->uiWidget.m_latComboBox->setCurrentIndex( 0 );
d->uiWidget.m_lonComboBox->setCurrentIndex( 0 );
@@ -240,8 +240,10 @@
// Make us aware of all the PlaceMarks in the MarbleModel so that
// we can search them.
setLocations( static_cast<MarblePlacemarkModel*>(d->m_widget->placeMarkModel()) );
- d->uiWidget.locationListView->setSelectionModel( d->m_widget->placeMarkSelectionModel() );
+// FIXME: Why does this fail: "selection model works on a different model than the view..." ?
+// d->uiWidget.locationListView->setSelectionModel( d->m_widget->placeMarkSelectionModel() );
+
#ifndef KML_GSOC
//set up everything for the FileModel
d->uiWidget.m_fileView->setModel( widget->fileViewModel() );
@@ -443,8 +445,8 @@
#ifndef KML_GSOC
if ( tmp ) {
- QModelIndex tmpIndex = d->uiWidget.m_fileView ->
- selectionModel() -> currentIndex();
+ QModelIndex tmpIndex =
+ d->uiWidget.m_fileView->selectionModel()->currentIndex();
d->m_widget->gpxFileModel()->setSelectedIndex( tmpIndex );
}
#else
Modified: marble/trunk/src/lib/MarbleDirs.cpp
===================================================================
--- marble/trunk/src/lib/MarbleDirs.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleDirs.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -90,9 +90,6 @@
}
}
- for (int i = 0; i < allFiles.size(); ++i)
- qDebug() << "Files: " << allFiles.at(i);
-
return allFiles;
}
@@ -112,9 +109,6 @@
}
}
- for (int i = 0; i < allFiles.size(); ++i)
- qDebug() << "Files: " << allFiles.at(i);
-
return allFiles;
}
Modified: marble/trunk/src/lib/MarbleGeoDataModel.cpp
===================================================================
--- marble/trunk/src/lib/MarbleGeoDataModel.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleGeoDataModel.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -52,17 +52,6 @@
return 0;
}
-QList<QPersistentModelIndex> MarbleGeoDataModel::persistentIndexList () const
-{
- QList<QPersistentModelIndex> modelIndexList;
- const int constRowCount = rowCount();
-
- for ( int i = 0; i < constRowCount; ++i )
- {
- modelIndexList << index( i, 0 );
- }
- return modelIndexList;
-}
QVariant MarbleGeoDataModel::data( const QModelIndex &index, int role ) const
{
return QVariant();
Modified: marble/trunk/src/lib/MarbleGeoDataModel.h
===================================================================
--- marble/trunk/src/lib/MarbleGeoDataModel.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleGeoDataModel.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -47,8 +47,6 @@
* Destroys the GeoDataModel.
*/
~MarbleGeoDataModel();
-
- QList<QPersistentModelIndex> persistentIndexList () const;
/**
* Return the number of Items in the Model.
Modified: marble/trunk/src/lib/MarbleMap.cpp
===================================================================
--- marble/trunk/src/lib/MarbleMap.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleMap.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -21,14 +21,11 @@
// Qt
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
-#include <QtCore/QLocale>
-#include <QtCore/QTranslator>
#include <QtCore/QAbstractItemModel>
#include <QtCore/QTime>
#include <QtGui/QItemSelectionModel>
#include <QtGui/QSizePolicy>
#include <QtGui/QRegion>
-#include <QtGui/QStyleOptionGraphicsItem>
//#include <QtDBus/QDBusConnection>
@@ -58,6 +55,8 @@
#include "ViewParams.h"
#include "ViewportParams.h"
+#include "MarbleRenderPlugin.h"
+
#include "gps/GpsLayer.h"
using namespace Marble;
@@ -148,7 +147,7 @@
( m_parent->height() - logoPixmap.height() ) / 2 );
painter.drawPixmap( logoPosition, logoPixmap );
- QString message = ""; // "Please assign a map theme!";
+ QString message; // "Please assign a map theme!";
painter.setPen( Qt::white );
@@ -356,11 +355,14 @@
: d( new MarbleMapPrivate( this ) )
{
// QDBusConnection::sessionBus().registerObject("/marble", this, QDBusConnection::QDBusConnection::ExportAllSlots);
-
+ QTime t;
+ t.start();
+
d->m_model = new MarbleModel( this );
d->m_modelIsOwned = true;
d->construct();
+ qDebug("Model: Time elapsed: %d ms", t.elapsed());
}
@@ -629,7 +631,17 @@
bool MarbleMap::showCrosshairs() const
{
- return propertyValue( "crosshairs" );
+ bool visible = false;
+
+ QList<MarbleRenderPlugin *> pluginList = renderPlugins();
+ QList<MarbleRenderPlugin *>::const_iterator i;
+ for (i = pluginList.constBegin(); i != pluginList.constEnd(); ++i) {
+ if ( (*i)->nameId() == "crosshairs" ) {
+ visible = (*i)->visible();
+ }
+ }
+
+ return visible;
}
bool MarbleMap::showPlaces() const
@@ -785,11 +797,7 @@
centerOn( lon * RAD2DEG, lat * RAD2DEG );
selectionModel->select( index, QItemSelectionModel::SelectCurrent );
-// Maybe add some similar functionality later on again:
-// d->m_crosshair.setEnabled( true );
}
-// else
-// d->m_crosshair.setEnabled( false );
}
@@ -1013,7 +1021,13 @@
void MarbleMap::setShowCrosshairs( bool visible )
{
- setPropertyValue( "crosshairs", visible );
+ QList<MarbleRenderPlugin *> pluginList = renderPlugins();
+ QList<MarbleRenderPlugin *>::const_iterator i;
+ for (i = pluginList.constBegin(); i != pluginList.constEnd(); ++i) {
+ if ( (*i)->nameId() == "crosshairs" ) {
+ (*i)->setVisible( visible );
+ }
+ }
}
void MarbleMap::setShowClouds( bool visible )
Modified: marble/trunk/src/lib/MarbleModel.cpp
===================================================================
--- marble/trunk/src/lib/MarbleModel.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleModel.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -394,6 +394,7 @@
}
}
+ d->m_geometrymodel->setGeoDataRoot( 0 );
QStringList loadedContainers = d->m_placemarkmanager->model()->containers();
QStringList loadList;
QVector<GeoSceneLayer*>::const_iterator it = d->m_mapTheme->map()->layers().constBegin();
@@ -770,7 +771,7 @@
d->notifyModelChanged();
}
-QVector<QPersistentModelIndex> MarbleModel::whichFeatureAt( const QPoint& curpos ) const
+QVector<QModelIndex> MarbleModel::whichFeatureAt( const QPoint& curpos ) const
{
return d->m_placeMarkLayout->whichPlaceMarkAt( curpos );
}
@@ -809,6 +810,8 @@
QTimer::singleShot( 0, d->m_tileLoader, SLOT( update() ) );
}
+// FIXME: We'd like to have a targetBody ("planet") class which stores all attributes we need.
+
qreal MarbleModel::planetRadius() const
{
if ( d->m_mapTheme ) {
@@ -852,6 +855,46 @@
return 6378000.0;
}
+QString MarbleModel::planetName() const
+{
+ if ( d->m_mapTheme ) {
+ QString target = d->m_mapTheme->head()->target().toLower();
+
+ // planets
+ if ( target == "mercury" ) {
+ return QString("Mercury");
+ } else if ( target == "venus" ) {
+ return QString("Venus");
+ } else if ( target == "earth" ) {
+ return QString("Earth");
+ } else if ( target == "mars" ) {
+ return QString("Mars");
+ } else if ( target == "jupiter" ) {
+ return QString("Jupiter");
+ } else if ( target == "saturn" ) {
+ return QString("Saturn");
+ } else if ( target == "uranus" ) {
+ return QString("Uranus");
+ } else if ( target == "neptune" ) {
+ return QString("Neptune");
+
+ // dwarf planets ... (everybody likes pluto)
+ } else if ( target == "pluto" ) {
+ return QString("Pluto");
+
+ // sun and moon
+ } else if ( target == "sun" ) {
+ return QString("Sun");
+ } else if ( target == "moon" ) {
+ return QString("Moon");
+ }
+ }
+
+ // Fallback to assuming that we deal with the earth
+ return QString("Earth");
+}
+
+
ExtDateTime* MarbleModel::dateTime() const
{
// qDebug() << "In dateTime, model:" << this;
Modified: marble/trunk/src/lib/MarbleModel.h
===================================================================
--- marble/trunk/src/lib/MarbleModel.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleModel.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -30,7 +30,7 @@
#include <QtCore/QList>
#include <QtCore/QObject>
-#include <QtCore/QPersistentModelIndex>
+#include <QtCore/QModelIndex>
#include <QtCore/QString>
#include <QtCore/QVector>
@@ -204,7 +204,7 @@
void addPlaceMarkData( const QString& data, const QString& key = "data" );
void removePlaceMarkKey( const QString& key );
- QVector<QPersistentModelIndex> whichFeatureAt( const QPoint& ) const;
+ QVector<QModelIndex> whichFeatureAt( const QPoint& ) const;
PlaceMarkLayout *placeMarkLayout() const;
VectorComposer *vectorComposer() const;
@@ -249,6 +249,7 @@
void stopPolling();
qreal planetRadius() const;
+ QString planetName() const;
ExtDateTime* dateTime() const;
SunLocator* sunLocator() const;
Modified: marble/trunk/src/lib/MarblePlacemarkModel.cpp
===================================================================
--- marble/trunk/src/lib/MarblePlacemarkModel.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarblePlacemarkModel.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -44,9 +44,9 @@
MarblePlacemarkModel *m_parent;
PlaceMarkManager *m_manager;
PlaceMarkContainer m_placeMarkContainer;
-
+ QList<QModelIndex> m_indexList;
+
QMap<QString, PlaceMarkContainer*> m_containerMap;
- QList<QPersistentModelIndex> m_persistantIndexList;
};
@@ -73,36 +73,21 @@
delete d;
}
-void MarblePlacemarkModel::indexUpdate()
+void MarblePlacemarkModel::sort( int column, Qt::SortOrder order )
{
- generateIndex();
-}
+ Q_UNUSED( column )
-void MarblePlacemarkModel::generateIndex()
-{
QTime t;
t.start();
- qDebug() << "start generate indexes";
+ qDebug() << "start sorting";
- d->m_persistantIndexList.clear();
+ emit layoutAboutToBeChanged();
+ d->m_placeMarkContainer.sort( order );
+ emit layoutChanged();
- const int constRowCount = rowCount();
-
-
- for ( int i = 0; i < constRowCount; ++i )
- {
- d->m_persistantIndexList << index( i, 0 );
- }
- qDebug() << "generated indexes";
-
- qDebug() << "MarblePlacemarkModel (generateIndex): Time elapsed:" << t.elapsed() << "ms";
+ qDebug() << "MarblePlacemarkModel (sort): Time elapsed:" << t.elapsed() << "ms";
}
-QList<QPersistentModelIndex> MarblePlacemarkModel::persistentIndexList () const
-{
- return d->m_persistantIndexList;
-}
-
int MarblePlacemarkModel::rowCount( const QModelIndex &parent ) const
{
if ( !parent.isValid() )
@@ -221,13 +206,19 @@
bool clearPrevious,
bool finalize )
{
- // For now we simply remove any previous placemarks
+ beginRemoveRows( QModelIndex(), 0, rowCount() );
+
+ // For now we simply remove any previous placemarks
if ( clearPrevious ) {
qDeleteAll( d->m_placeMarkContainer );
d->m_placeMarkContainer.clear();
d->m_containerMap.clear();
}
+ endRemoveRows();
+
+ beginInsertRows( QModelIndex(), 0, d->m_placeMarkContainer.count() );
+
if( !d->m_containerMap.contains( placeMarks.name() ) ) {
createFilterProperties( placeMarks );
@@ -235,19 +226,26 @@
d->m_containerMap[ placeMarks.name() ] = new PlaceMarkContainer( placeMarks );
}
+
+ endInsertRows();
+
+ emit dataChanged( index( 0, 0 ), index( rowCount() - 1, 0 ) );
+
if ( finalize ) {
- generateIndex();
- d->m_placeMarkContainer.sort();
- emit layoutChanged();
+ sort( Qt::DescendingOrder );
}
}
void MarblePlacemarkModel::removePlaceMarks( const QString &containerName,
bool finalize )
{
+ beginRemoveRows( QModelIndex(), 0, rowCount() );
+ endRemoveRows();
+
if( d->m_containerMap.contains( containerName ) ) {
QVector<Marble::GeoDataPlacemark*>::const_iterator iter = d->m_containerMap[ containerName ]->constBegin();
QVector<Marble::GeoDataPlacemark*>::const_iterator end = d->m_containerMap[ containerName ]->constEnd();
+
GeoDataPlacemark* placemark;
for(; iter != end;iter++) {
placemark = *iter;
@@ -257,10 +255,14 @@
delete d->m_containerMap[ containerName ];
d->m_containerMap.remove( containerName );
}
+
+ beginInsertRows( QModelIndex(), 0, d->m_placeMarkContainer.count() );
+ endInsertRows();
+
+ emit dataChanged( index( 0, 0 ), index( rowCount() - 1, 0 ) );
+
if ( finalize ) {
- generateIndex();
- d->m_placeMarkContainer.sort();
- emit layoutChanged();
+ sort( Qt::DescendingOrder );
}
}
@@ -275,7 +277,6 @@
d->m_placeMarkContainer.clear();
d->m_containerMap.clear();
reset();
- d->m_persistantIndexList.clear();
}
void MarblePlacemarkModel::createFilterProperties( PlaceMarkContainer &container )
Modified: marble/trunk/src/lib/MarblePlacemarkModel.h
===================================================================
--- marble/trunk/src/lib/MarblePlacemarkModel.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarblePlacemarkModel.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -21,7 +21,6 @@
#include <QtCore/QAbstractListModel>
#include <QtCore/QList>
#include <QtCore/QModelIndex>
-#include <QtCore/QPersistentModelIndex>
#include <QtCore/QVariant>
#include "marble_export.h"
@@ -76,8 +75,6 @@
* Destroys the place mark model.
*/
~MarblePlacemarkModel();
-
- QList<QPersistentModelIndex> persistentIndexList () const;
/**
* Return the number of Placemarks in the Model.
@@ -123,11 +120,6 @@
* This method returns a list of open Containers (== open kml files)
*/
QStringList containers() const;
- public Q_SLOTS:
- /**
- * This slot should update the persistentIndex
- */
- void indexUpdate();
Q_SIGNALS:
/**
@@ -143,7 +135,7 @@
*/
void clearPlaceMarks();
- void generateIndex();
+ virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
void createFilterProperties( PlaceMarkContainer &container );
Modified: marble/trunk/src/lib/MarbleThemeSelectView.cpp
===================================================================
--- marble/trunk/src/lib/MarbleThemeSelectView.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleThemeSelectView.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -55,8 +55,6 @@
QString currentmaptheme = (model->data( colindex )).toString();
qDebug() << currentmaptheme;
emit selectMapTheme( currentmaptheme );
-
- // qDebug() << currentmaptheme;
}
Modified: marble/trunk/src/lib/MarbleWidget.cpp
===================================================================
--- marble/trunk/src/lib/MarbleWidget.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleWidget.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -15,8 +15,7 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
-#include <QtCore/QLocale>
-#include <QtCore/QTranslator>
+#include <QtCore/QTimer>
#include <QtCore/QAbstractItemModel>
#include <QtGui/QItemSelectionModel>
#include <QtGui/QSizePolicy>
@@ -112,6 +111,8 @@
QString m_proxyHost;
qint16 m_proxyPort;
+
+ void _q_initGui();
};
@@ -123,6 +124,9 @@
// QDBusConnection::sessionBus().registerObject("/marble", this, QDBusConnection::QDBusConnection::ExportAllSlots);
d->construct();
+
+ // Delayed model initialization
+ QTimer::singleShot( 0, this, SLOT( _q_initGui() ) );
}
@@ -133,6 +137,9 @@
// QDBusConnection::sessionBus().registerObject("/marble", this, QDBusConnection::QDBusConnection::ExportAllSlots);
d->construct();
+
+ // Delayed model initialization
+ QTimer::singleShot( 0, this, SLOT( _q_initGui() ) );
}
MarbleWidget::~MarbleWidget()
@@ -183,21 +190,6 @@
// displayed on the widget background.
m_widget->setAutoFillBackground( true );
- m_inputhandler = 0;
- m_popupmenu = new MarbleWidgetPopupMenu( m_widget, m_model );
-
- // Handle mouse and keyboard input.
- m_widget->setInputHandler( new MarbleWidgetDefaultInputHandler );
- m_widget->setMouseTracking( true );
-
- // The interface to the measure tool consists of a RMB popup menu
- // and some signals.
- MeasureTool *measureTool = m_map->measureTool();
- m_widget->connect( m_popupmenu, SIGNAL( addMeasurePoint( qreal, qreal ) ),
- measureTool, SLOT( addMeasurePoint( qreal, qreal ) ) );
- m_widget->connect( m_popupmenu, SIGNAL( removeMeasurePoints() ),
- measureTool, SLOT( removeMeasurePoints( ) ) );
-
// Track the GPS current point at timely intervals.
m_widget->connect( m_model, SIGNAL( timeout() ),
m_widget, SLOT( updateGps() ) );
@@ -208,8 +200,6 @@
m_logZoom = 0;
- m_widget->goHome();
-
m_widget->connect( m_model->sunLocator(), SIGNAL( reenableWidgetInput() ),
m_widget, SLOT( enableInput() ) );
@@ -220,6 +210,23 @@
m_widget, SLOT( updateAnimation( qreal ) ) );
}
+void MarbleWidgetPrivate::_q_initGui() {
+ m_popupmenu = new MarbleWidgetPopupMenu( m_widget, m_model );
+
+ // Handle mouse and keyboard input.
+ m_inputhandler = 0;
+ m_widget->setInputHandler( new MarbleWidgetDefaultInputHandler );
+ m_widget->setMouseTracking( true );
+
+ // The interface to the measure tool consists of a RMB popup menu
+ // and some signals.
+ MeasureTool *measureTool = m_map->measureTool();
+ m_widget->connect( m_popupmenu, SIGNAL( addMeasurePoint( qreal, qreal ) ),
+ measureTool, SLOT( addMeasurePoint( qreal, qreal ) ) );
+ m_widget->connect( m_popupmenu, SIGNAL( removeMeasurePoints() ),
+ measureTool, SLOT( removeMeasurePoints( ) ) );
+}
+
// ----------------------------------------------------------------
@@ -714,11 +721,13 @@
void MarbleWidget::resizeEvent (QResizeEvent*)
{
+ setUpdatesEnabled( false );
d->m_map->setSize( width(), height() );
setAttribute(Qt::WA_NoSystemBackground, d->m_map->mapCoversViewport() && !mapThemeId().isEmpty() );
repaint();
+ setUpdatesEnabled( true );
}
void MarbleWidget::connectNotify ( const char * signal )
@@ -918,7 +927,7 @@
void MarbleWidget::setShowCrosshairs( bool visible )
{
-// d->m_map->setShowCrosshairs( visible );
+ d->m_map->setShowCrosshairs( visible );
repaint();
}
Modified: marble/trunk/src/lib/MarbleWidget.h
===================================================================
--- marble/trunk/src/lib/MarbleWidget.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleWidget.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -980,6 +980,8 @@
private:
Q_DISABLE_COPY( MarbleWidget )
MarbleWidgetPrivate * const d;
+
+ Q_PRIVATE_SLOT( d, void _q_initGui() )
};
}
Modified: marble/trunk/src/lib/MarbleWidgetInputHandler.cpp
===================================================================
--- marble/trunk/src/lib/MarbleWidgetInputHandler.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleWidgetInputHandler.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -32,10 +32,10 @@
MarbleWidgetInputHandler::MarbleWidgetInputHandler()
: m_widget( 0 ),
- m_model( 0 )
+ m_model( 0 ),
+ m_positionSignalConnected( false ),
+ m_mouseWheelTimer( new QTimer(this) )
{
- m_positionSignalConnected = false;
- m_mouseWheelTimer = new QTimer(this);
connect( m_mouseWheelTimer, SIGNAL( timeout() ),
this, SLOT( restoreViewContext() ) );
}
@@ -106,81 +106,33 @@
{
Q_UNUSED( o );
+ if ( keyEvent( m_widget->map(), e ) ) {
+ m_widget->repaint();
+ return true;
+ }
+
int polarity = m_widget->map()->viewParams()->viewport()->polarity();
- // if ( o == marbleWidget ){
- if ( e->type() == QEvent::KeyPress ) {
- QKeyEvent const * const k = dynamic_cast<QKeyEvent const * const>( e );
- Q_ASSERT( k );
-
- dirx = 0;
- diry = 0;
- switch ( k->key() ) {
- case Qt::Key_Left:
-
- // Depending on whether the planet is "upright" or
- // "upside down" we need to choose the direction
- // of the rotation
-
- if ( polarity < 0 )
- dirx = -1;
- else
- dirx = 1;
- break;
- case Qt::Key_Up:
- diry = 1;
- break;
- case Qt::Key_Right:
-
- // Depending on whether the planet is "upright" or
- // "upside down" we need to choose the direction
- // of the rotation
-
- if ( polarity < 0 )
- dirx = 1;
- else
- dirx = -1;
- break;
- case Qt::Key_Down:
- diry = -1;
- break;
- case Qt::Key_Plus:
- m_widget->zoomIn();
- break;
- case Qt::Key_Minus:
- m_widget->zoomOut();
- break;
- case Qt::Key_Home:
- m_widget->goHome();
- break;
- default:
- break;
- }
-
- if ( dirx != 0 || diry != 0 ) {
- m_widget->rotateBy( -m_widget->moveStep() * (qreal)(dirx),
- -m_widget->moveStep() * (qreal)(diry) );
- }
-
- return true;
- }
- else if ( e->type() == QEvent::MouseMove
+ if ( e->type() == QEvent::MouseMove
|| e->type() == QEvent::MouseButtonPress
|| e->type() == QEvent::MouseButtonRelease ) {
QMouseEvent *event = static_cast<QMouseEvent*>(e);
QRegion activeRegion = m_widget->activeRegion();
- dirx = 0;
- diry = 0;
+ m_dirX = 0;
+ m_dirY = 0;
- // Do not handle (and therefore eat) mouse events that occur above visible float items
+ // Do not handle (and therefore eat) mouse press and release events
+ // that occur above visible float items. Mouse motion events are still
+ // handled, however.
foreach( MarbleAbstractFloatItem *floatItem, m_widget->floatItems() ) {
QRectF widgetRect(0,0,m_widget->width(),m_widget->height());
QRectF floatItemRect = QRectF(floatItem->positivePosition(widgetRect),
floatItem->size());
if ( floatItem->enabled() && floatItem->visible()
- && floatItemRect.contains(event->pos()))
+ && floatItemRect.contains(event->pos())
+ && e->type() != QEvent::MouseMove )
{
return false;
}
@@ -367,33 +319,33 @@
if ( boundingRect.width() != 0 )
{
- dirx = (int)( 3 * ( event->x() - boundingRect.left() ) / boundingRect.width() ) - 1;
+ m_dirX = (int)( 3 * ( event->x() - boundingRect.left() ) / boundingRect.width() ) - 1;
}
- if ( dirx > 1 )
- dirx = 1;
- if ( dirx < -1 )
- dirx = -1;
+ if ( m_dirX > 1 )
+ m_dirX = 1;
+ if ( m_dirX < -1 )
+ m_dirX = -1;
if ( boundingRect.height() != 0 )
{
- diry = (int)( 3 * ( event->y() - boundingRect.top() ) / boundingRect.height() ) - 1;
+ m_dirY = (int)( 3 * ( event->y() - boundingRect.top() ) / boundingRect.height() ) - 1;
}
- if ( diry > 1 )
- diry = 1;
- if ( diry < -1 )
- diry = -1;
+ if ( m_dirY > 1 )
+ m_dirY = 1;
+ if ( m_dirY < -1 )
+ m_dirY = -1;
if ( event->button() == Qt::LeftButton
&& e->type() == QEvent::MouseButtonPress ) {
if ( polarity < 0 )
- m_widget->rotateBy( -m_widget->moveStep() * (qreal)(+dirx),
- m_widget->moveStep() * (qreal)(+diry) );
+ m_widget->rotateBy( -m_widget->moveStep() * (qreal)(+m_dirX),
+ m_widget->moveStep() * (qreal)(+m_dirY) );
else
- m_widget->rotateBy( -m_widget->moveStep() * (qreal)(-dirx),
- m_widget->moveStep() * (qreal)(+diry) );
+ m_widget->rotateBy( -m_widget->moveStep() * (qreal)(-m_dirX),
+ m_widget->moveStep() * (qreal)(+m_dirY) );
}
}
@@ -412,7 +364,7 @@
arrowcur [1][1] = QCursor(Qt::PointingHandCursor);
}
- m_widget->setCursor(arrowcur[dirx+1][diry+1]);
+ m_widget->setCursor(arrowcur[m_dirX+1][m_dirY+1]);
return false; // let others, especially float items, still process the event
}
@@ -431,5 +383,69 @@
}
}
+bool MarbleWidgetDefaultInputHandler::keyEvent( MarbleMap * map, QEvent* e )
+{
+ int polarity = map->viewParams()->viewport()->polarity();
+ // if ( o == marbleWidget ){
+ if ( e->type() == QEvent::KeyPress ) {
+ QKeyEvent const * const k = dynamic_cast<QKeyEvent const * const>( e );
+ Q_ASSERT( k );
+
+ int dirx = 0;
+ int diry = 0;
+ switch ( k->key() ) {
+ case Qt::Key_Left:
+
+ // Depending on whether the planet is "upright" or
+ // "upside down" we need to choose the direction
+ // of the rotation
+
+ if ( polarity < 0 )
+ dirx = -1;
+ else
+ dirx = 1;
+ break;
+ case Qt::Key_Up:
+ diry = 1;
+ break;
+ case Qt::Key_Right:
+
+ // Depending on whether the planet is "upright" or
+ // "upside down" we need to choose the direction
+ // of the rotation
+
+ if ( polarity < 0 )
+ dirx = 1;
+ else
+ dirx = -1;
+ break;
+ case Qt::Key_Down:
+ diry = -1;
+ break;
+ case Qt::Key_Plus:
+ map->zoomIn();
+ break;
+ case Qt::Key_Minus:
+ map->zoomOut();
+ break;
+ case Qt::Key_Home:
+ map->goHome();
+ break;
+ default:
+ break;
+ }
+
+ if ( dirx != 0 || diry != 0 ) {
+ map->rotateBy( -map->moveStep() * (qreal)(dirx),
+ -map->moveStep() * (qreal)(diry) );
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+
#include "MarbleWidgetInputHandler.moc"
Modified: marble/trunk/src/lib/MarbleWidgetInputHandler.h
===================================================================
--- marble/trunk/src/lib/MarbleWidgetInputHandler.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleWidgetInputHandler.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -36,6 +36,7 @@
class MarbleModel;
class MarbleWidget;
+class MarbleMap;
class MARBLE_EXPORT MarbleWidgetInputHandler : public QObject
{
@@ -79,6 +80,8 @@
public:
MarbleWidgetDefaultInputHandler();
+ static bool keyEvent( MarbleMap * map, QEvent* e );
+
protected:
bool eventFilter( QObject *, QEvent * );
@@ -94,8 +97,8 @@
QCursor arrowcur[3][3];
- int dirx;
- int diry;
+ int m_dirX;
+ int m_dirY;
bool m_leftpressed;
bool m_midpressed;
Modified: marble/trunk/src/lib/MarbleWidgetPopupMenu.cpp
===================================================================
--- marble/trunk/src/lib/MarbleWidgetPopupMenu.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleWidgetPopupMenu.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -40,9 +40,9 @@
void MarbleWidgetPopupMenu::createActions()
{
// Property actions (Left mouse button)
- // m_earthaction = new QAction(QIcon("icon.png"), tr("&Earth"), this);
- m_earthaction = new QAction( tr( "&Earth" ), this );
- m_earthaction->setData( 0 );
+ // m_planetAction = new QAction(QIcon("icon.png"), tr("&Earth"), this);
+ m_planetAction = new QAction( tr( "&Earth" ), this );
+ m_planetAction->setData( 0 );
m_copyCoordinateAction = new QAction( tr( "0 N 0 W" ), this );
// Tool actions (Right mouse button)
@@ -78,11 +78,11 @@
m_lmbMenu->clear();
QPoint curpos = QPoint( xpos, ypos );
- m_featurelist = m_model-> whichFeatureAt( curpos );
+ m_featurelist = m_model->whichFeatureAt( curpos );
int actionidx = 1;
- QVector<QPersistentModelIndex>::const_iterator it;
+ QVector<QModelIndex>::const_iterator it;
for ( it = m_featurelist.constBegin();
it != m_featurelist.constEnd(); ++it )
{
@@ -94,11 +94,20 @@
}
// Not implemented yet ;-)
- m_earthaction->setEnabled( false );
+ m_planetAction->setEnabled( false );
- m_lmbMenu->addAction( m_earthaction );
+ m_lmbMenu->addAction( m_planetAction );
m_lmbMenu->addSeparator();
+ // Setting the proper planet name
+ QString targetString = m_model->planetName();
+ qDebug() << "targetString" << targetString;
+ // FIXME: this should be removed later on ...
+ if ( targetString == "Earth" )
+ targetString = tr( "&Earth" );
+
+ m_planetAction->setText( targetString );
+
qreal lat;
qreal lon;
@@ -130,7 +139,7 @@
int actionidx = action->data().toInt();
if ( actionidx > 0 ) {
- QPersistentModelIndex index = m_featurelist.at( actionidx -1 );
+ QModelIndex index = m_featurelist.at( actionidx -1 );
PlaceMarkInfoDialog dialog( index, m_widget );
dialog.exec();
Modified: marble/trunk/src/lib/MarbleWidgetPopupMenu.h
===================================================================
--- marble/trunk/src/lib/MarbleWidgetPopupMenu.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MarbleWidgetPopupMenu.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -19,7 +19,7 @@
#include <QtCore/QObject>
-#include <QtCore/QPersistentModelIndex>
+#include <QtCore/QModelIndex>
#include <QtCore/QVector>
@@ -65,11 +65,11 @@
MarbleModel *m_model;
MarbleWidget *m_widget;
- QVector<QPersistentModelIndex> m_featurelist;
+ QVector<QModelIndex> m_featurelist;
QMenu *m_lmbMenu;
QMenu *m_rmbMenu;
- QAction *m_earthaction;
+ QAction *m_planetAction;
QAction *m_copyCoordinateAction;
QAction *m_setHomePointAction;
Modified: marble/trunk/src/lib/MeasureTool.cpp
===================================================================
--- marble/trunk/src/lib/MeasureTool.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MeasureTool.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -48,8 +48,6 @@
m_fontheight = QFontMetrics( m_font_regular ).height();
m_fontascent = QFontMetrics( m_font_regular ).ascent();
- m_useworkaround = testBug();
-
m_pen.setColor( QColor( Qt::red ) );
m_pen.setWidthF( 2.0 );
}
@@ -407,36 +405,4 @@
m_pMeasurePointList.clear();
}
-
-bool MeasureTool::testBug()
-{
- QString testchar( "K" );
- QFont font( "Sans Serif", 10 );
-
- int fontHeight = QFontMetrics( font ).height();
- int fontwidth = QFontMetrics( font ).width( testchar );
- int fontascent = QFontMetrics( font ).ascent();
-
- QPixmap pixmap ( fontwidth, fontHeight );
- pixmap.fill( Qt::transparent );
-
- QPainter textpainter;
- textpainter.begin( &pixmap );
- textpainter.setPen( QColor( 0, 0, 0, 255 ) );
- textpainter.setFont( font );
- textpainter.drawText( 0, fontascent, testchar );
- textpainter.end();
-
- QImage image = pixmap.toImage();
-
- for ( int x = 0; x < fontwidth; ++x )
- for ( int y = 0; y < fontHeight; ++y ) {
- if ( qAlpha( image.pixel( x, y ) ) > 0 )
- return false;
- }
-
- return true;
-}
-
-
#include "MeasureTool.moc"
Modified: marble/trunk/src/lib/MeasureTool.h
===================================================================
--- marble/trunk/src/lib/MeasureTool.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MeasureTool.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -57,8 +57,6 @@
void drawTotalDistanceLabel( GeoPainter *painter,
qreal totalDistance );
- bool testBug();
-
private:
Q_DISABLE_COPY( MeasureTool )
@@ -72,8 +70,6 @@
int m_fontascent;
QPen m_pen;
-
- bool m_useworkaround;
};
}
Modified: marble/trunk/src/lib/MergedLayerDecorator.cpp
===================================================================
--- marble/trunk/src/lib/MergedLayerDecorator.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MergedLayerDecorator.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -37,20 +37,21 @@
: m_sunLocator(sunLocator),
m_cloudlayer(true),
m_showTileId(false),
- m_cityLightsTheme(MapThemeManager::loadMapTheme("earth/citylights/citylights.dgml")),
- m_blueMarbleTheme(MapThemeManager::loadMapTheme("earth/bluemarble/bluemarble.dgml")),
+ m_cityLightsTheme(0),
+ m_blueMarbleTheme(0),
m_cityLightsTextureLayer(0),
m_cloudsTextureLayer(0)
{
+}
+
+void MergedLayerDecorator::initClouds(){
// look for the texture layers inside the themes
// As long as we don't have an Layer Management Class we just lookup
// the name of the layer that has the same name as the theme ID
- if (m_cityLightsTheme) {
- QString cityLightsId = m_cityLightsTheme->head()->theme();
- m_cityLightsTextureLayer = static_cast<GeoSceneTexture*>(
- m_cityLightsTheme->map()->layer( cityLightsId )->datasets().first() );
- }
+
// the clouds texture layer is a layer in the bluemarble theme
+
+ m_blueMarbleTheme = MapThemeManager::loadMapTheme("earth/bluemarble/bluemarble.dgml");
if (m_blueMarbleTheme) {
QString blueMarbleId = m_blueMarbleTheme->head()->theme();
m_cloudsTextureLayer = static_cast<GeoSceneTexture*>(
@@ -58,6 +59,19 @@
}
}
+void MergedLayerDecorator::initCityLights(){
+ // look for the texture layers inside the themes
+ // As long as we don't have an Layer Management Class we just lookup
+ // the name of the layer that has the same name as the theme ID
+
+ m_cityLightsTheme = MapThemeManager::loadMapTheme("earth/citylights/citylights.dgml");
+ if (m_cityLightsTheme) {
+ QString cityLightsId = m_cityLightsTheme->head()->theme();
+ m_cityLightsTextureLayer = static_cast<GeoSceneTexture*>(
+ m_cityLightsTheme->map()->layer( cityLightsId )->datasets().first() );
+ }
+}
+
MergedLayerDecorator::~MergedLayerDecorator()
{
delete m_cityLightsTheme;
@@ -66,17 +80,30 @@
void MergedLayerDecorator::paint( const QString& themeId, GeoSceneDocument *mapTheme )
{
+ if ( !m_blueMarbleTheme ) {
+ initClouds();
+ }
if ( m_cloudlayer && m_tile->depth() == 32 && m_level < 2 ) {
bool show;
if ( mapTheme && mapTheme->settings()->propertyAvailable( "clouds", show ) ) {
+
+ // Initialize clouds if it hasn't happened already
+ if ( !m_blueMarbleTheme ) {
+ initClouds();
+ }
paintClouds();
}
}
if ( m_sunLocator->getShow() && mapTheme ) {
- if ( mapTheme->head()->target() == "earth"
- || mapTheme->head()->target() == "moon" ) {
+// if ( mapTheme->head()->target() == "earth"
+// || mapTheme->head()->target() == "moon" ) {
+
+ // Initialize citylights layer if it hasn't happened already
+ if ( !m_cityLightsTheme ) {
+ initCityLights();
+ }
paintSunShading();
- }
+// }
}
if ( m_showTileId )
paintTileId( themeId );
@@ -177,7 +204,6 @@
// First we determine the supporting point interval for the interpolation.
const int n = maxDivisor( 30, tileWidth );
- const qreal nInverse = 1.0 / (qreal)(n);
const int ipRight = n * (int)( tileWidth / n );
if ( m_sunLocator->getCitylights() ) {
@@ -188,48 +214,61 @@
qreal lat = lat_scale * ( m_y * tileHeight + cur_y ) - 0.5*M_PI;
QRgb* scanline = (QRgb*)m_tile->scanLine( cur_y );
QRgb* nscanline = (QRgb*)nighttile.scanLine( cur_y );
- qreal lastShade = 0.0;
- for ( int cur_x = 0; cur_x < tileWidth; ++cur_x) {
+ qreal shade = 0;
+ qreal lastShade = -10.0;
- bool interpolate = ( cur_x != 0 && cur_x < ipRight );
+ int cur_x = 0;
- if ( interpolate == true ) cur_x+= n - 1;
+ while ( cur_x < tileWidth ) {
- qreal lon = lon_scale * (m_x * tileWidth + cur_x);
- qreal shade = m_sunLocator->shading( lon, lat );
+ bool interpolate = ( cur_x != 0 && cur_x < ipRight && cur_x + n < tileWidth );
if ( interpolate == true ) {
+ int check = cur_x + n;
+ qreal checklon = lon_scale * ( m_x * tileWidth + check );
+ shade = m_sunLocator->shading(checklon, lat);
// if the shading didn't change across the interpolation
// interval move on and don't change anything.
if ( shade == lastShade && shade == 1.0 ) {
scanline += n;
nscanline += n;
+ cur_x += n;
continue;
}
- else {
- qreal interpolatedShade = lastShade;
- const qreal shadeDiff = ( shade - lastShade ) * nInverse;
-
- // Now we do linear interpolation across the tile width
- for ( int t = 1; t < n; ++t )
+ if ( shade == lastShade && shade == 0.0 ) {
+ for ( int t = 0; t < n; ++t )
{
- interpolatedShade += shadeDiff;
- m_sunLocator->shadePixelComposite( *scanline, *nscanline, interpolatedShade );
- scanline++;
- nscanline++;
+ m_sunLocator->shadePixelComposite( *scanline, *nscanline, shade );
+ ++scanline;
+ ++nscanline;
}
+ cur_x += n;
+ continue;
}
+ for ( int t = 0; t < n ; ++t )
+ {
+ qreal lon = lon_scale * ( m_x * tileWidth + cur_x );
+ shade = m_sunLocator->shading(lon, lat);
+ m_sunLocator->shadePixelComposite( *scanline, *nscanline, shade );
+ ++scanline;
+ ++nscanline;
+ ++cur_x;
+ }
}
- // Make sure we don't exceed the image memory
- if ( cur_x < tileWidth ) {
- m_sunLocator->shadePixelComposite( *scanline, *nscanline, shade );
- scanline++;
- nscanline++;
+ else {
+ // Make sure we don't exceed the image memory
+ if ( cur_x < tileWidth ) {
+ qreal lon = lon_scale * ( m_x * tileWidth + cur_x );
+ shade = m_sunLocator->shading(lon, lat);
+ m_sunLocator->shadePixelComposite( *scanline, *nscanline, shade );
+ ++scanline;
+ ++nscanline;
+ ++cur_x;
+ }
}
-
lastShade = shade;
}
}
@@ -238,45 +277,56 @@
qreal lat = lat_scale * (m_y * tileHeight + cur_y) - 0.5*M_PI;
QRgb* scanline = (QRgb*)m_tile->scanLine( cur_y );
- qreal lastShade = 0.0;
+ qreal shade = 0;
+ qreal lastShade = -10.0;
- for ( int cur_x = 0; cur_x <= tileWidth; ++cur_x ) {
+ int cur_x = 0;
- bool interpolate = ( cur_x != 0 && cur_x < ipRight );
+ while ( cur_x < tileWidth ) {
- if ( interpolate == true ) cur_x+= n - 1;
+ bool interpolate = ( cur_x != 0 && cur_x < ipRight && cur_x + n < tileWidth );
- qreal lon = lon_scale * ( m_x * tileWidth + cur_x );
- qreal shade = m_sunLocator->shading(lon, lat);
-
if ( interpolate == true ) {
+ int check = cur_x + n;
+ qreal checklon = lon_scale * ( m_x * tileWidth + check );
+ shade = m_sunLocator->shading(checklon, lat);
// if the shading didn't change across the interpolation
// interval move on and don't change anything.
if ( shade == lastShade && shade == 1.0 ) {
scanline += n;
+ cur_x += n;
continue;
}
- else {
- qreal interpolatedShade = lastShade;
- const qreal shadeDiff = ( shade - lastShade ) * nInverse;
-
- // Now we do linear interpolation across the tile width
- for ( int t = 1; t < n; ++t )
+ if ( shade == lastShade && shade == 0.0 ) {
+ for ( int t = 0; t < n; ++t )
{
- interpolatedShade += shadeDiff;
- m_sunLocator->shadePixel( *scanline, interpolatedShade );
- scanline++;
+ m_sunLocator->shadePixel( *scanline, shade );
+ ++scanline;
}
+ cur_x += n;
+ continue;
}
+ for ( int t = 0; t < n ; ++t )
+ {
+ qreal lon = lon_scale * ( m_x * tileWidth + cur_x );
+ shade = m_sunLocator->shading(lon, lat);
+ m_sunLocator->shadePixel( *scanline, shade );
+ ++scanline;
+ ++cur_x;
+ }
}
- // Make sure we don't exceed the image memory
- if ( cur_x < tileWidth ) {
- m_sunLocator->shadePixel( *scanline, shade );
- scanline++;
+ else {
+ // Make sure we don't exceed the image memory
+ if ( cur_x < tileWidth ) {
+ qreal lon = lon_scale * ( m_x * tileWidth + cur_x );
+ shade = m_sunLocator->shading(lon, lat);
+ m_sunLocator->shadePixel( *scanline, shade );
+ ++scanline;
+ ++cur_x;
+ }
}
-
lastShade = shade;
}
}
Modified: marble/trunk/src/lib/MergedLayerDecorator.h
===================================================================
--- marble/trunk/src/lib/MergedLayerDecorator.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/MergedLayerDecorator.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -60,6 +60,10 @@
private:
QImage loadDataset( GeoSceneTexture *textureLayer );
int maxDivisor( int maximum, int fullLength );
+
+ void initClouds();
+ void initCityLights();
+
void paintSunShading();
void paintClouds();
Modified: marble/trunk/src/lib/PlaceMarkContainer.cpp
===================================================================
--- marble/trunk/src/lib/PlaceMarkContainer.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/PlaceMarkContainer.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -60,8 +60,10 @@
return m_name;
}
+void PlaceMarkContainer::sort( Qt::SortOrder order )
+{
+ // FIXME: use order
+ Q_UNUSED( order )
-void PlaceMarkContainer::sort()
-{
qStableSort( begin(), end(), populationLessThan );
}
Modified: marble/trunk/src/lib/PlaceMarkContainer.h
===================================================================
--- marble/trunk/src/lib/PlaceMarkContainer.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/PlaceMarkContainer.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -63,7 +63,7 @@
void setName( const QString& name );
/// @brief Sort the placemarks in descending order by population.
- void sort();
+ void sort( Qt::SortOrder order = Qt::AscendingOrder );
/**
* @brief the assignment operator
Modified: marble/trunk/src/lib/PlaceMarkLayout.cpp
===================================================================
--- marble/trunk/src/lib/PlaceMarkLayout.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/PlaceMarkLayout.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -119,13 +119,13 @@
m_visiblePlaceMarks.clear();
}
-QVector<QPersistentModelIndex> PlaceMarkLayout::whichPlaceMarkAt( const QPoint& curpos )
+QVector<QModelIndex> PlaceMarkLayout::whichPlaceMarkAt( const QPoint& curpos )
{
if ( m_styleResetRequested == true ) {
styleReset();
}
- QVector<QPersistentModelIndex> ret;
+ QVector<QModelIndex> ret;
QVector<VisiblePlaceMark*>::ConstIterator it;
QVector<VisiblePlaceMark*>::ConstIterator itEnd = m_paintOrder.constEnd();
@@ -195,7 +195,7 @@
m_styleResetRequested = false;
styleReset();
qDebug() << "RESET started";
- m_persistentIndexList = qobject_cast<const MarblePlacemarkModel*>( model )->persistentIndexList();
+// m_indexList = qobject_cast<const MarblePlacemarkModel*>( model )->getPersistentIndexList();
qDebug() << "RESET stopped";
m_maxLabelHeight = maxLabelHeight( model, selectionModel );
@@ -293,7 +293,7 @@
// If there is no visible placemark yet for this index,
// create a new one...
mark = new VisiblePlaceMark;
- mark->setModelIndex( QPersistentModelIndex( index ) );
+ mark->setModelIndex( QModelIndex( index ) );
m_visiblePlaceMarks.insert( index, mark );
}
@@ -328,12 +328,11 @@
? true : false;
const QItemSelection selection = selectionModel->selection();
- QList<QPersistentModelIndex>::ConstIterator it;
- QList<QPersistentModelIndex>::ConstIterator itEnd = m_persistentIndexList.constEnd();
+ const int rowCount = model->rowCount();
- for ( it = m_persistentIndexList.constBegin(); it != itEnd; ++it )
+ for ( int i = 0; i != rowCount; ++i )
{
- const QPersistentModelIndex& index = *it;
+ const QModelIndex& index = model->index( i, 0 );
if( !index.isValid() ) {
qDebug() << "invalid index!!!";
continue;
Modified: marble/trunk/src/lib/PlaceMarkLayout.h
===================================================================
--- marble/trunk/src/lib/PlaceMarkLayout.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/PlaceMarkLayout.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -19,7 +19,7 @@
#include <QtCore/QHash>
-#include <QtCore/QPersistentModelIndex>
+#include <QtCore/QModelIndex>
#include <QtCore/QRect>
#include <QtCore/QVector>
@@ -90,7 +90,7 @@
/**
* Returns a list of model indexes that are at position @p pos.
*/
- QVector<QPersistentModelIndex> whichPlaceMarkAt( const QPoint &pos );
+ QVector<QModelIndex> whichPlaceMarkAt( const QPoint &pos );
PlaceMarkPainter* placeMarkPainter() const;
@@ -115,9 +115,9 @@
QVector<VisiblePlaceMark*> m_paintOrder;
QVector<VisiblePlaceMark*> m_placeMarkPool;
- QHash<QPersistentModelIndex, VisiblePlaceMark*> m_visiblePlaceMarks;
+ QHash<QModelIndex, VisiblePlaceMark*> m_visiblePlaceMarks;
- QList<QPersistentModelIndex> m_persistentIndexList;
+ QModelIndexList m_indexList;
QVector< int > m_weightfilter;
Modified: marble/trunk/src/lib/PlaceMarkManager.cpp
===================================================================
--- marble/trunk/src/lib/PlaceMarkManager.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/PlaceMarkManager.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -76,33 +76,11 @@
m_model->clearPlaceMarks();
}
-void PlaceMarkManager::loadStandardPlaceMarks( const QString& target )
+void PlaceMarkManager::addPlaceMarkFile( const QString& filepath, bool finalized )
{
- if ( target != m_target )
- {
- clearPlaceMarks();
-
- if ( target == "earth" ){
- addPlaceMarkFile( "cityplacemarks" );
- addPlaceMarkFile( "baseplacemarks" );
- addPlaceMarkFile( "elevplacemarks" );
- addPlaceMarkFile( "otherplacemarks" );
- addPlaceMarkFile( "boundaryplacemarks" );
- }
- if ( target == "moon" ){
- addPlaceMarkFile( "moonterrain" );
- addPlaceMarkFile( "moonlandingsites" );
- }
-
- m_target = target;
- }
-}
-
-void PlaceMarkManager::addPlaceMarkFile( const QString& filepath, bool finalize )
-{
- m_finalized = finalize;
+ m_finalized = finalized;
if( !(m_model->containers().contains( filepath ) ) ) {
- qDebug() << "adding container:" << filepath << finalize;
+ qDebug() << "adding container:" << filepath << finalized;
PlaceMarkLoader* loader = new PlaceMarkLoader( this, filepath );
connect ( loader, SIGNAL( placeMarksLoaded( PlaceMarkLoader*, PlaceMarkContainer * ) ),
this, SLOT( loadPlaceMarkContainer( PlaceMarkLoader*, PlaceMarkContainer * ) ) );
@@ -113,6 +91,10 @@
m_loaderList.append( loader );
loader->start();
}
+ else {
+ if( finalized )
+ emit finalize();
+ }
}
void PlaceMarkManager::cleanupLoader( PlaceMarkLoader* loader )
Modified: marble/trunk/src/lib/PlaceMarkManager.h
===================================================================
--- marble/trunk/src/lib/PlaceMarkManager.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/PlaceMarkManager.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -78,13 +78,6 @@
void clearPlaceMarks();
/**
- * This methods loads the standard place mark files.
- *
- * Note: Call this method after you have create a method!
- */
- void loadStandardPlaceMarks( const QString& target = QString() );
-
- /**
* Loads a new place mark file into the manager.
*/
void addPlaceMarkFile( const QString &fileName, bool finalize = true );
Modified: marble/trunk/src/lib/PlaceMarkPainter.cpp
===================================================================
--- marble/trunk/src/lib/PlaceMarkPainter.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/PlaceMarkPainter.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -12,7 +12,7 @@
#include "PlaceMarkPainter.h"
#include <QtCore/QDebug>
-#include <QtCore/QPersistentModelIndex>
+#include <QtCore/QModelIndex>
#include <QtCore/QPoint>
#include <QtGui/QItemSelectionModel>
#include <QtGui/QPainter>
@@ -150,7 +150,7 @@
QPainter labelPainter;
QPixmap labelPixmap;
- const QPersistentModelIndex &index = mark->modelIndex();
+ QModelIndex index = mark->modelIndex();
GeoDataStyle* style = ( ( MarblePlacemarkModel* )index.model() )->styleData( index );
// GeoDataStyle* style = index.data( MarblePlacemarkModel::StyleRole ).value<GeoDataStyle*>();
@@ -236,8 +236,8 @@
QImage image = pixmap.toImage();
- for ( int x = 0; x < fontwidth; x++ ) {
- for ( int y = 0; y < fontheight; y++ ) {
+ for ( int x = 0; x < fontwidth; ++x ) {
+ for ( int y = 0; y < fontheight; ++y ) {
if ( qAlpha( image.pixel( x, y ) ) > 0 )
return false;
}
Added: marble/trunk/src/lib/PlanetaryConstants.h
===================================================================
--- marble/trunk/src/lib/PlanetaryConstants.h (rev 0)
+++ marble/trunk/src/lib/PlanetaryConstants.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -0,0 +1,95 @@
+// Copyright 2009 David Roberts <dvdr18@xxxxxxxxx>
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+
+#ifndef PLANETARYCONSTANTS_H
+#define PLANETARYCONSTANTS_H
+
+#define pc_deg2rad(x) x*M_PI/180.0
+
+struct PlanetaryConstants {
+ qreal M_0, M_1; // for calculating mean anomaly
+ qreal C_1, C_2, C_3, C_4, C_5, C_6; // for calculating equation of center
+ qreal Pi; // ecliptic longitude of the perihelion
+ qreal epsilon; // obliquity of the ecliptic plane
+ qreal theta_0, theta_1; // for calculating sidereal time
+};
+
+// constants taken from http://www.astro.uu.nl/~strous/AA/en/reken/zonpositie.html
+PlanetaryConstants PC_MERCURY = {
+ pc_deg2rad(174.7948), pc_deg2rad(4.09233445),
+ pc_deg2rad(23.4400), pc_deg2rad(2.9818), pc_deg2rad(0.5255), pc_deg2rad(0.1058), pc_deg2rad(0.0241), pc_deg2rad(0.0055),
+ pc_deg2rad(111.5943),
+ pc_deg2rad(0.02),
+ pc_deg2rad(13.5964), pc_deg2rad(6.1385025)
+};
+PlanetaryConstants PC_VENUS = {
+ pc_deg2rad(50.4161), pc_deg2rad(1.60213034),
+ pc_deg2rad(0.7758), pc_deg2rad(0.0033), pc_deg2rad(0.0000), pc_deg2rad(0.0000), pc_deg2rad(0.0000), pc_deg2rad(0.0000),
+ pc_deg2rad(73.9519),
+ pc_deg2rad(2.64),
+ pc_deg2rad(215.2995), pc_deg2rad(-1.4813688)
+};
+PlanetaryConstants PC_EARTH = {
+ pc_deg2rad(357.5291), pc_deg2rad(0.98560028),
+ pc_deg2rad(1.9148), pc_deg2rad(0.0200), pc_deg2rad(0.0003), pc_deg2rad(0.0000), pc_deg2rad(0.0000), pc_deg2rad(0.0000),
+ pc_deg2rad(102.9372),
+ pc_deg2rad(23.45),
+ pc_deg2rad(280.1600), pc_deg2rad(360.9856235),
+};
+PlanetaryConstants PC_MARS = {
+ pc_deg2rad(19.3730), pc_deg2rad(0.52402068),
+ pc_deg2rad(10.6912), pc_deg2rad(0.6228), pc_deg2rad(0.0503), pc_deg2rad(0.0046), pc_deg2rad(0.0005), pc_deg2rad(0.0000),
+ pc_deg2rad(70.9812),
+ pc_deg2rad(25.19),
+ pc_deg2rad(313.4803), pc_deg2rad(350.89198226)
+};
+PlanetaryConstants PC_JUPITER = {
+ pc_deg2rad(20.0202), pc_deg2rad(0.08308529),
+ pc_deg2rad(5.5549), pc_deg2rad(0.1683), pc_deg2rad(0.0071), pc_deg2rad(0.0003), pc_deg2rad(0.0000), pc_deg2rad(0.0000),
+ pc_deg2rad(237.2074),
+ pc_deg2rad(3.12),
+ pc_deg2rad(146.0727), pc_deg2rad(870.5366420)
+};
+PlanetaryConstants PC_SATURN = {
+ pc_deg2rad(317.0207), pc_deg2rad(0.03344414),
+ pc_deg2rad(6.3585), pc_deg2rad(0.2204), pc_deg2rad(0.0106), pc_deg2rad(0.0006), pc_deg2rad(0.0000), pc_deg2rad(0.0000),
+ pc_deg2rad(99.4571),
+ pc_deg2rad(26.74),
+ pc_deg2rad(174.3479), pc_deg2rad(810.7939024)
+};
+PlanetaryConstants PC_URANUS = {
+ pc_deg2rad(141.0498), pc_deg2rad(0.01172834),
+ pc_deg2rad(5.3042), pc_deg2rad(0.1534), pc_deg2rad(0.0062), pc_deg2rad(0.0003), pc_deg2rad(0.0000), pc_deg2rad(0.0000),
+ pc_deg2rad(5.4639),
+ pc_deg2rad(82.22),
+ pc_deg2rad(17.9705), pc_deg2rad(-501.1600928)
+};
+PlanetaryConstants PC_NEPTUNE = {
+ pc_deg2rad(256.2250), pc_deg2rad(0.00598103),
+ pc_deg2rad(1.0302), pc_deg2rad(0.0058), pc_deg2rad(0.0000), pc_deg2rad(0.0000), pc_deg2rad(0.0000), pc_deg2rad(0.0000),
+ pc_deg2rad(182.1957),
+ pc_deg2rad(27.84),
+ pc_deg2rad(52.3996), pc_deg2rad(536.3128492)
+};
+PlanetaryConstants PC_PLUTO = {
+ pc_deg2rad(14.882), pc_deg2rad(0.00396),
+ pc_deg2rad(28.3150), pc_deg2rad(4.3408), pc_deg2rad(0.9214), pc_deg2rad(0.2235), pc_deg2rad(0.0627), pc_deg2rad(0.0174),
+ pc_deg2rad(4.5433),
+ pc_deg2rad(57.46),
+ pc_deg2rad(56.3183), pc_deg2rad(-56.3623195)
+};
+
+#endif
Modified: marble/trunk/src/lib/PluginManager.cpp
===================================================================
--- marble/trunk/src/lib/PluginManager.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/PluginManager.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -92,13 +92,16 @@
qDebug() << fileName << " - " << MarbleDirs::pluginPath( fileName );
QPluginLoader loader( MarbleDirs::pluginPath( fileName ) );
- QObject *obj = loader.instance();
- MarbleRenderPlugin* layerPlugin = qobject_cast<MarbleRenderPlugin *>(obj);
- MarbleRenderPlugin* instance = layerPlugin->instance();
+ QObject * obj = loader.instance();
- if( layerPlugin && instance ) {
- d->m_renderPlugins.append( instance );
+ MarbleRenderPlugin * layerPlugin;
+ if ( obj ) {
+ layerPlugin = qobject_cast<MarbleRenderPlugin *>(obj);
}
+
+ if( obj && layerPlugin ) {
+ d->m_renderPlugins.append( layerPlugin );
+ }
else {
qDebug() << "Plugin Failure: " << fileName << " is not a valid Marble Plugin:";
qDebug() << loader.errorString();
Modified: marble/trunk/src/lib/Projections/EquirectProjection.cpp
===================================================================
--- marble/trunk/src/lib/Projections/EquirectProjection.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/Projections/EquirectProjection.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -186,7 +186,152 @@
const ViewportParams *viewport,
QVector<QPolygonF *> &polygons )
{
- return false;
+ // Compare bounding box size of the line string with the angularResolution
+ // Immediately return if the latLonAltBox is smaller.
+
+ if ( !viewport->resolves( lineString.latLonAltBox() ) ) {
+// qDebug() << "Object too small to be resolved";
+ return false;
+ }
+
+ int x = 0;
+ int y = 0;
+ bool globeHidesPoint = false;
+ bool isVisible = false;
+
+ int previousX = -1;
+ int previousY = -1;
+ bool previousGlobeHidesPoint = false;
+ bool previousIsVisible = false;
+
+ QPolygonF *polygon = new QPolygonF;
+
+ GeoDataLineString::ConstIterator itCoords = lineString.constBegin();
+ GeoDataLineString::ConstIterator itPreviousCoords = lineString.constBegin();
+
+ GeoDataCoordinates previousCoords;
+ GeoDataCoordinates currentCoords;
+
+ GeoDataLineString::ConstIterator itEnd = lineString.constEnd();
+
+ bool processingLastNode = false;
+
+ // We use a while loop to be able to cover linestrings as well as linear rings:
+ // Linear rings require to tessellate the path from the last node to the first node
+ // which isn't really convenient to achieve with a for loop ...
+
+ const qreal precision = 20.0;
+ const bool isLong = lineString.size() > 50;
+
+ while ( itCoords != itEnd )
+ {
+ // Optimization for line strings with a big amount of nodes
+ bool skipNode = isLong && viewport->resolves( **itPreviousCoords, **itCoords);
+
+ if ( !skipNode ) {
+
+ previousCoords = **itPreviousCoords;
+ currentCoords = **itCoords;
+
+ isVisible = screenCoordinates( currentCoords, viewport, x, y, globeHidesPoint );
+
+ // Initializing variables that store the values of the previous iteration
+ if ( !processingLastNode && itCoords == lineString.constBegin() ) {
+ previousGlobeHidesPoint = globeHidesPoint;
+ previousIsVisible = isVisible;
+ itPreviousCoords = itCoords;
+ previousX = x;
+ previousY = y;
+ }
+
+ // TODO: on flat maps we need to take the date line into account right here.
+
+ // This if-clause contains the section that tessellates the line
+ // segments of a linestring. If you are about to learn how the code of
+ // this class works you can safely ignore this section for a start.
+
+ if ( lineString.tessellate() && ( isVisible || previousIsVisible ) ) {
+ // let the line segment follow the spherical surface
+ // if the distance between the previous point and the current point
+ // on screen is too big
+
+ // We take the manhattan length as a distance approximation
+ // that can be too big by a factor of sqrt(2)
+ qreal distance = fabs((qreal)(x - previousX)) + fabs((qreal)(y - previousY));
+
+ // FIXME: This is a work around: remove as soon as we handle horizon crossing
+ if ( globeHidesPoint || previousGlobeHidesPoint ) {
+ distance = 350;
+ }
+
+ const qreal safeDistance = - 0.5 * distance;
+
+ // Interpolate additional nodes if the current or previous nodes are visible
+ // or if the line segment that connects them might cross the viewport.
+ // The latter can pretty safely be excluded for most projections if both points
+ // are located on the same side relative to the viewport boundaries and if they are
+ // located more than half the line segment distance away from the viewport.
+
+ if ( !( x < safeDistance && previousX < safeDistance )
+ || !( y < safeDistance && previousY < safeDistance )
+ || !( x + safeDistance > viewport->width()
+ && previousX + safeDistance > viewport->width() )
+ || !( y + safeDistance > viewport->height()
+ && previousY + safeDistance > viewport->height() )
+ ){
+ int suggestedCount = (int)( distance / precision );
+
+ if ( distance > precision ) {
+ // qDebug() << "Distance: " << distance;
+ *polygon << tessellateLineSegment( previousCoords, currentCoords,
+ suggestedCount, viewport,
+ lineString.tessellationFlags() );
+ }
+ }
+ }
+
+ if ( !globeHidesPoint ) {
+ polygon->append( QPointF( x, y ) );
+ }
+ else {
+ if ( !previousGlobeHidesPoint
+ && !lineString.isClosed() // FIXME: this probably needs to take rotation
+ // into account for some cases
+ ) {
+ polygons.append( polygon );
+ polygon = new QPolygonF;
+ }
+ }
+
+ previousGlobeHidesPoint = globeHidesPoint;
+ previousIsVisible = isVisible;
+ itPreviousCoords = itCoords;
+ previousX = x;
+ previousY = y;
+ }
+
+ // Here we modify the condition to be able to process the
+ // first node after the last node in a LinearRing.
+
+ if ( processingLastNode ) {
+ break;
+ }
+ ++itCoords;
+
+ if ( itCoords == itEnd && lineString.isClosed() ) {
+ itCoords = lineString.constBegin();
+ processingLastNode = true;
+ }
+ }
+
+ if ( polygon->size() > 1 ){
+ polygons.append( polygon );
+ }
+ else {
+ delete polygon;
+ }
+
+ return polygons.isEmpty();
}
Modified: marble/trunk/src/lib/Projections/MercatorProjection.cpp
===================================================================
--- marble/trunk/src/lib/Projections/MercatorProjection.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/Projections/MercatorProjection.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -192,7 +192,152 @@
const ViewportParams *viewport,
QVector<QPolygonF *> &polygons )
{
- return false;
+ // Compare bounding box size of the line string with the angularResolution
+ // Immediately return if the latLonAltBox is smaller.
+
+ if ( !viewport->resolves( lineString.latLonAltBox() ) ) {
+// qDebug() << "Object too small to be resolved";
+ return false;
+ }
+
+ int x = 0;
+ int y = 0;
+ bool globeHidesPoint = false;
+ bool isVisible = false;
+
+ int previousX = -1;
+ int previousY = -1;
+ bool previousGlobeHidesPoint = false;
+ bool previousIsVisible = false;
+
+ QPolygonF *polygon = new QPolygonF;
+
+ GeoDataLineString::ConstIterator itCoords = lineString.constBegin();
+ GeoDataLineString::ConstIterator itPreviousCoords = lineString.constBegin();
+
+ GeoDataCoordinates previousCoords;
+ GeoDataCoordinates currentCoords;
+
+ GeoDataLineString::ConstIterator itEnd = lineString.constEnd();
+
+ bool processingLastNode = false;
+
+ // We use a while loop to be able to cover linestrings as well as linear rings:
+ // Linear rings require to tessellate the path from the last node to the first node
+ // which isn't really convenient to achieve with a for loop ...
+
+ const qreal precision = 20.0;
+ const bool isLong = lineString.size() > 50;
+
+ while ( itCoords != itEnd )
+ {
+ // Optimization for line strings with a big amount of nodes
+ bool skipNode = isLong && viewport->resolves( **itPreviousCoords, **itCoords);
+
+ if ( !skipNode ) {
+
+ previousCoords = **itPreviousCoords;
+ currentCoords = **itCoords;
+
+ isVisible = screenCoordinates( currentCoords, viewport, x, y, globeHidesPoint );
+
+ // Initializing variables that store the values of the previous iteration
+ if ( !processingLastNode && itCoords == lineString.constBegin() ) {
+ previousGlobeHidesPoint = globeHidesPoint;
+ previousIsVisible = isVisible;
+ itPreviousCoords = itCoords;
+ previousX = x;
+ previousY = y;
+ }
+
+ // TODO: on flat maps we need to take the date line into account right here.
+
+ // This if-clause contains the section that tessellates the line
+ // segments of a linestring. If you are about to learn how the code of
+ // this class works you can safely ignore this section for a start.
+
+ if ( lineString.tessellate() && ( isVisible || previousIsVisible ) ) {
+ // let the line segment follow the spherical surface
+ // if the distance between the previous point and the current point
+ // on screen is too big
+
+ // We take the manhattan length as a distance approximation
+ // that can be too big by a factor of sqrt(2)
+ qreal distance = fabs((qreal)(x - previousX)) + fabs((qreal)(y - previousY));
+
+ // FIXME: This is a work around: remove as soon as we handle horizon crossing
+ if ( globeHidesPoint || previousGlobeHidesPoint ) {
+ distance = 350;
+ }
+
+ const qreal safeDistance = - 0.5 * distance;
+
+ // Interpolate additional nodes if the current or previous nodes are visible
+ // or if the line segment that connects them might cross the viewport.
+ // The latter can pretty safely be excluded for most projections if both points
+ // are located on the same side relative to the viewport boundaries and if they are
+ // located more than half the line segment distance away from the viewport.
+
+ if ( !( x < safeDistance && previousX < safeDistance )
+ || !( y < safeDistance && previousY < safeDistance )
+ || !( x + safeDistance > viewport->width()
+ && previousX + safeDistance > viewport->width() )
+ || !( y + safeDistance > viewport->height()
+ && previousY + safeDistance > viewport->height() )
+ ){
+ int suggestedCount = (int)( distance / precision );
+
+ if ( distance > precision ) {
+ // qDebug() << "Distance: " << distance;
+ *polygon << tessellateLineSegment( previousCoords, currentCoords,
+ suggestedCount, viewport,
+ lineString.tessellationFlags() );
+ }
+ }
+ }
+
+ if ( !globeHidesPoint ) {
+ polygon->append( QPointF( x, y ) );
+ }
+ else {
+ if ( !previousGlobeHidesPoint
+ && !lineString.isClosed() // FIXME: this probably needs to take rotation
+ // into account for some cases
+ ) {
+ polygons.append( polygon );
+ polygon = new QPolygonF;
+ }
+ }
+
+ previousGlobeHidesPoint = globeHidesPoint;
+ previousIsVisible = isVisible;
+ itPreviousCoords = itCoords;
+ previousX = x;
+ previousY = y;
+ }
+
+ // Here we modify the condition to be able to process the
+ // first node after the last node in a LinearRing.
+
+ if ( processingLastNode ) {
+ break;
+ }
+ ++itCoords;
+
+ if ( itCoords == itEnd && lineString.isClosed() ) {
+ itCoords = lineString.constBegin();
+ processingLastNode = true;
+ }
+ }
+
+ if ( polygon->size() > 1 ){
+ polygons.append( polygon );
+ }
+ else {
+ delete polygon;
+ }
+
+ return polygons.isEmpty();
}
bool MercatorProjection::geoCoordinates( int x, int y,
Modified: marble/trunk/src/lib/SphericalScanlineTextureMapper.cpp
===================================================================
--- marble/trunk/src/lib/SphericalScanlineTextureMapper.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/SphericalScanlineTextureMapper.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -156,7 +156,7 @@
const int xLeft = ( ( m_imageWidth / 2 - rx > 0 )
? m_imageWidth / 2 - rx : 0 );
const int xRight = ( ( m_imageWidth / 2 - rx > 0 )
- ? xLeft + rx + rx : canvasImage -> width() );
+ ? xLeft + rx + rx : canvasImage->width() );
m_scanLine = (QRgb*)( canvasImage->scanLine( y ) ) + xLeft;
@@ -286,26 +286,31 @@
if ( fabs(stepLon) < M_PI ) {
if ( smooth ) {
- const qreal itStepLon = ( rad2PixelX( lon ) - rad2PixelX( m_prevLon ) ) * m_nInverse;
- const qreal itStepLat = ( rad2PixelY( lat ) - rad2PixelY( m_prevLat ) ) * m_nInverse;
-
+
m_prevLon = rad2PixelX( m_prevLon );
m_prevLat = rad2PixelY( m_prevLat );
-
+
+ const qreal itStepLon = ( rad2PixelX( lon ) - m_prevLon ) * m_nInverse;
+ const qreal itStepLat = ( rad2PixelY( lat ) - m_prevLat ) * m_nInverse;
+
// To improve speed we unroll
// AbstractScanlineTextureMapper::pixelValue(...) here and
// calculate the performance critical issues via integers
qreal itLon = m_prevLon + m_toTileCoordinatesLon;
qreal itLat = m_prevLat + m_toTileCoordinatesLat;
-
- for ( int j=1; j < m_n; ++j ) {
+
+ const int tileWidth = m_tileLoader->tileWidth();
+ const int tileHeight = m_tileLoader->tileHeight();
+ const int jmax = m_n;
+
+ for ( int j=1; j < jmax; ++j ) {
m_posX = itLon + itStepLon * j;
m_posY = itLat + itStepLat * j;
- if ( m_posX >= m_tileLoader->tileWidth()
+ if ( m_posX >= tileWidth
|| m_posX < 0.0
- || m_posY >= m_tileLoader->tileHeight()
+ || m_posY >= tileHeight
|| m_posY < 0.0 )
{
nextTile( m_posX, m_posY );
@@ -315,38 +320,37 @@
m_posY = itLat + itStepLat * j;
}
- if ( !smooth ) {
- *scanLine = m_tile->pixel( (int)(m_posX), (int)(m_posY) );
- }
- else {
- QRgb topLeftValue = m_tile->pixel( (int)(m_posX), (int)(m_posY) );
- *scanLine = bilinearSmooth( topLeftValue );
- }
+ *scanLine = m_tile->pixelF( m_posX, m_posY );;
++scanLine;
}
}
else {
- const int itStepLon = (int)( ( rad2PixelX( lon ) - rad2PixelX( m_prevLon ) ) * m_nInverse * 128.0 );
- const int itStepLat = (int)( ( rad2PixelY( lat ) - rad2PixelY( m_prevLat ) ) * m_nInverse * 128.0 );
-
m_prevLon = rad2PixelX( m_prevLon );
m_prevLat = rad2PixelY( m_prevLat );
-
+
+ const int itStepLon = (int)( ( rad2PixelX( lon ) - m_prevLon ) * m_nInverse * 128.0 );
+ const int itStepLat = (int)( ( rad2PixelY( lat ) - m_prevLat ) * m_nInverse * 128.0 );
+
// To improve speed we unroll
// AbstractScanlineTextureMapper::pixelValue(...) here and
// calculate the performance critical issues via integers
int itLon = (int)( ( m_prevLon + m_toTileCoordinatesLon ) * 128.0 );
int itLat = (int)( ( m_prevLat + m_toTileCoordinatesLat ) * 128.0 );
+
+ const int tileWidth = m_tileLoader->tileWidth();
+ const int tileHeight = m_tileLoader->tileHeight();
+ const int jmax = m_n;
+
- for ( int j=1; j < m_n; ++j ) {
+ for ( int j=1; j < jmax; ++j ) {
m_iPosX = ( itLon + itStepLon * j ) >> 7;
m_iPosY = ( itLat + itStepLat * j ) >> 7;
- if ( m_iPosX >= m_tileLoader->tileWidth()
+ if ( m_iPosX >= tileWidth
|| m_iPosX < 0
- || m_iPosY >= m_tileLoader->tileHeight()
+ || m_iPosY >= tileHeight
|| m_iPosY < 0 )
{
nextTile( m_iPosX, m_iPosY );
@@ -355,7 +359,7 @@
m_iPosX = ( itLon + itStepLon * j ) >> 7;
m_iPosY = ( itLat + itStepLat * j ) >> 7;
}
-
+
*scanLine = m_tile->pixel( m_iPosX, m_iPosY );
++scanLine;
@@ -375,7 +379,9 @@
// crossing the dateline from east to west ...
if ( m_prevLon < lon ) {
- for ( int j = 1; j < m_n; ++j ) {
+
+ const int jmax = m_n;
+ for ( int j = 1; j < jmax; ++j ) {
m_prevLat += stepLat;
m_prevLon -= stepLon;
if ( m_prevLon <= -M_PI )
@@ -390,7 +396,8 @@
else {
qreal curStepLon = lon - m_n * stepLon;
- for ( int j = 1; j < m_n; ++j ) {
+ const int jmax = m_n;
+ for ( int j = 1; j < jmax; ++j ) {
m_prevLat += stepLat;
curStepLon += stepLon;
qreal evalLon = curStepLon;
Modified: marble/trunk/src/lib/SunLocator.cpp
===================================================================
--- marble/trunk/src/lib/SunLocator.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/SunLocator.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -1,4 +1,4 @@
-// Copyright 2007-2008 David Roberts <dvdr18@xxxxxxxxx>
+// Copyright 2007-2009 David Roberts <dvdr18@xxxxxxxxx>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@ -16,7 +16,9 @@
#include "SunLocator.h"
#include "ExtDateTime.h"
-
+#include "PlanetaryConstants.h"
+#include "MarbleMath.h"
+
#include <QtCore/QDebug>
using namespace Marble;
@@ -26,6 +28,9 @@
using std::asin;
using std::abs;
+qreal deg2rad(qreal x) { return x*M_PI/180.0; }
+qreal rad2deg(qreal x) { return x*180.0/M_PI; }
+
const int J2000 = 2451545; // epoch J2000 = 1 January 2000, noon Terrestrial Time (11:58:55.816 UTC)
// taking the full moon of 15 January 1900 19:07 UTC as the epoch for the moon
@@ -58,7 +63,6 @@
void SunLocator::updatePosition()
{
- // Find the orientation of the sun.
if( m_body == "moon" ) {
qreal d = (qreal)m_datetime->toJDN() + m_datetime->dayFraction() - MOON_EPOCH; // days since the first full moon of the 20th century
d /= MOON_SYNODIC_PERIOD; // number of orbits the moon has made (relative to the sun as observed from earth)
@@ -69,31 +73,53 @@
m_lon = (1-d) * 2*M_PI;
m_lat = 0.0; // not necessarily accurate but close enough (only differs by about +-6 degrees of this value)
- } else { // default to the earth
- // Find current Julian day number relative to epoch J2000.
- long d = m_datetime->toJDN() - J2000;
-
- // Adapted from http://www.stargazing.net/kepler/sun.html
- qreal L = 4.89497 + 0.0172028 * d; // mean longitude
- qreal g = 6.24004 + 0.0172020 * d; // mean anomaly
- qreal lambda = L + 0.0334 * sin(g) + 3.49e-4 * sin(2*g); // ecliptic longitude
- qreal epsilon = 0.40909 - 7e-9 * d; // obliquity of the ecliptic plane
- qreal delta = asin(sin(epsilon)*sin(lambda)); // declination
-
- // Convert position of sun to coordinates.
- m_lon = M_PI - m_datetime->dayFraction() * 2*M_PI;
- m_lat = -delta;
+
+ return;
}
+
+ PlanetaryConstants pc = PC_EARTH; // default to the earth
+ // planets
+ if ( m_body == "mercury" ) pc = PC_MERCURY;
+ else if ( m_body == "venus" ) pc = PC_VENUS;
+ else if ( m_body == "earth" ) pc = PC_EARTH;
+ else if ( m_body == "mars" ) pc = PC_MARS;
+ else if ( m_body == "jupiter" ) pc = PC_JUPITER;
+ else if ( m_body == "saturn" ) pc = PC_SATURN;
+ else if ( m_body == "uranus" ) pc = PC_URANUS;
+ else if ( m_body == "neptune" ) pc = PC_NEPTUNE;
+ // dwarf planets ... (everybody likes pluto)
+ else if ( m_body == "pluto" ) pc = PC_PLUTO;
+
+ long d = m_datetime->toJDN() - J2000; // find current Julian day number relative to epoch J2000
+
+ // from http://www.astro.uu.nl/~strous/AA/en/reken/zonpositie.html
+ qreal M = pc.M_0 + pc.M_1*d; // mean anomaly
+ qreal C = pc.C_1*sin(M) + pc.C_2*sin(2*M) + pc.C_3*sin(3*M) + pc.C_4*sin(4*M) + pc.C_5*sin(5*M) + pc.C_6*sin(6*M); // equation of center
+ qreal nu = M + C; // true anomaly
+ qreal lambda_sun = nu + pc.Pi + M_PI; // ecliptic longitude of sun as seen from planet
+ qreal delta_sun = asin(sin(pc.epsilon)*sin(lambda_sun)); // declination of sun as seen from planet
+ qreal alpha_sun = atan2(cos(pc.epsilon)*sin(lambda_sun), cos(lambda_sun)); // right ascension of sun as seen from planet
+
+ qreal theta = alpha_sun; // solar noon occurs when sidereal time is equal to alpha_sun
+ m_lon = M_PI - (pc.theta_0 + pc.theta_1 * (d+m_datetime->dayFraction()) - theta); // convert sidereal time to geographic longitude
+ while(m_lon < 0) m_lon += 2*M_PI;
+ m_lat = -delta_sun; // convert positive north to positive south
+
+ qDebug() << "alpha_sun =" << rad2deg(alpha_sun);
+ qDebug() << "delta_sun =" << rad2deg(delta_sun);
+ qDebug() << "m_lon =" << rad2deg(m_lon);
+ qDebug() << "m_lat =" << rad2deg(m_lat);
}
qreal SunLocator::shading(qreal lon, qreal lat)
{
+
// haversine formula
qreal a = sin((lat-m_lat)/2.0);
qreal b = sin((lon-m_lon)/2.0);
- qreal h = (a*a)+cos(lat)*cos(m_lat)*(b*b);
-
+ qreal h = (a*a)+cos(lat)*cos(m_lat)*(b*b);
+
/*
h = 0.0 // directly beneath sun
h = 0.5 // sunrise/sunset line
Modified: marble/trunk/src/lib/SunLocator.h
===================================================================
--- marble/trunk/src/lib/SunLocator.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/SunLocator.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -1,4 +1,4 @@
-// Copyright 2007-2008 David Roberts <dvdr18@xxxxxxxxx>
+// Copyright 2007-2009 David Roberts <dvdr18@xxxxxxxxx>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
Modified: marble/trunk/src/lib/TextureColorizer.cpp
===================================================================
--- marble/trunk/src/lib/TextureColorizer.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/TextureColorizer.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -141,7 +141,7 @@
{
// Cheap Emboss / Bumpmapping
- const uchar& grey = *readData; // qBlue(*data);
+ uchar& grey = *readData; // qBlue(*data);
if ( showRelief ) {
emboss.gpuint.x4 = grey;
@@ -229,13 +229,12 @@
{
// Cheap Embosss / Bumpmapping
- const uchar& grey = *readData; // qBlue(*data);
+ uchar& grey = *readData; // qBlue(*data);
if ( showRelief == true ) {
emboss.buffer = emboss.buffer >> 8;
emboss.gpuint.x4 = grey;
bump = ( emboss.gpuint.x1 + 16 - grey ) >> 1;
-
if ( bump > 15 ) bump = 15;
if ( bump < 0 ) bump = 0;
}
Modified: marble/trunk/src/lib/TextureTile.cpp
===================================================================
--- marble/trunk/src/lib/TextureTile.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/TextureTile.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -77,7 +77,7 @@
uint TextureTilePrivate::pixel( int x, int y ) const
{
- if ( m_depth == 1 || m_depth == 8 ) {
+ if ( m_depth == 8 || m_depth == 1 ) {
if ( !m_isGrayscale )
return m_rawtile.pixel( x, y );
else
@@ -86,6 +86,75 @@
return (jumpTable32)[y][x];
}
+uint TextureTilePrivate::pixelF( qreal x, qreal y ) const
+{
+ // Bilinear interpolation to determine the color of a subpixel
+
+ int iX = (int)(x);
+ int iY = (int)(y);
+
+ QRgb topLeftValue = pixel( iX, iY );
+
+ qreal fY = y - iY;
+
+ // Interpolation in y-direction
+ if ( ( iY + 1 ) < m_rawtile.height() ) {
+
+ QRgb bottomLeftValue = pixel( iX, iY + 1 );
+
+ // blending the color values of the top left and bottom left point
+ qreal ml_red = ( 1.0 - fY ) * qRed ( topLeftValue ) + fY * qRed ( bottomLeftValue );
+ qreal ml_green = ( 1.0 - fY ) * qGreen( topLeftValue ) + fY * qGreen( bottomLeftValue );
+ qreal ml_blue = ( 1.0 - fY ) * qBlue ( topLeftValue ) + fY * qBlue ( bottomLeftValue );
+
+ // Interpolation in x-direction
+ if ( iX + 1 < m_rawtile.width() ) {
+
+ qreal fX = x - iX;
+
+ QRgb topRightValue = pixel( iX + 1, iY );
+ QRgb bottomRightValue = pixel( iX + 1, iY + 1 );
+
+ // blending the color values of the top right and bottom right point
+ qreal mr_red = ( 1.0 - fY ) * qRed ( topRightValue ) + fY * qRed ( bottomRightValue );
+ qreal mr_green = ( 1.0 - fY ) * qGreen( topRightValue ) + fY * qGreen( bottomRightValue );
+ qreal mr_blue = ( 1.0 - fY ) * qBlue ( topRightValue ) + fY * qBlue ( bottomRightValue );
+
+ // blending the color values of the resulting middle left
+ // and middle right points
+ int mm_red = (int)( ( 1.0 - fX ) * ml_red + fX * mr_red );
+ int mm_green = (int)( ( 1.0 - fX ) * ml_green + fX * mr_green );
+ int mm_blue = (int)( ( 1.0 - fX ) * ml_blue + fX * mr_blue );
+
+ return qRgb( mm_red, mm_green, mm_blue );
+ }
+ else {
+ return qRgb( ml_red, ml_green, ml_blue );
+ }
+ }
+ else {
+ // Interpolation in x-direction
+ if ( iX + 1 < m_rawtile.width() ) {
+
+ qreal fX = x - iX;
+
+ if ( fX == 0.0 )
+ return topLeftValue;
+
+ QRgb topRightValue = pixel( iX + 1, iY );
+
+ // blending the color values of the top left and top right point
+ int tm_red = (int)( ( 1.0 - fX ) * qRed ( topLeftValue ) + fX * qRed ( topRightValue ) );
+ int tm_green = (int)( ( 1.0 - fX ) * qGreen( topLeftValue ) + fX * qGreen( topRightValue ) );
+ int tm_blue = (int)( ( 1.0 - fX ) * qBlue ( topLeftValue ) + fX * qBlue ( topRightValue ) );
+
+ return qRgb( tm_red, tm_green, tm_blue );
+ }
+ }
+
+ return topLeftValue;
+}
+
void TextureTilePrivate::scaleTileFrom( Marble::GeoSceneTexture *textureLayer, QImage &tile,
qreal sourceX, qreal sourceY, int sourceLevel,
int targetX, int targetY, int targetLevel )
@@ -318,6 +387,13 @@
return d->pixel( x, y );
}
+uint TextureTile::pixelF( qreal x, qreal y ) const
+{
+ Q_D( const TextureTile );
+
+ return d->pixelF( x, y );
+}
+
int TextureTile::depth() const
{
Q_D( const TextureTile );
Modified: marble/trunk/src/lib/TextureTile.h
===================================================================
--- marble/trunk/src/lib/TextureTile.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/TextureTile.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -59,7 +59,14 @@
// and color ( uint, 4 bytes ) images.
uint pixel( int x, int y ) const;
+
+ // Here we retrieve the color value of the requested subpixel on the tile.
+ // This needs to be done differently for grayscale ( uchar, 1 byte ).
+ // and color ( uint, 4 bytes ) images.
+ // Subpixel calculation is done via bilinear interpolation.
+ uint pixelF( qreal x, qreal y ) const;
+
Q_SIGNALS:
void tileUpdateDone();
void downloadTile(const QUrl& sourceUrl, const QString& destinationFileName,
Modified: marble/trunk/src/lib/TextureTile_p.h
===================================================================
--- marble/trunk/src/lib/TextureTile_p.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/TextureTile_p.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -41,7 +41,8 @@
TextureTilePrivate( const TileId& id );
virtual ~TextureTilePrivate();
- uint pixel( int x, int y ) const;
+ inline uint pixel( int x, int y ) const;
+ inline uint pixelF( qreal x, qreal y ) const;
void scaleTileFrom( Marble::GeoSceneTexture *textureLayer, QImage &tile,
qreal sourceX, qreal sourceY, int sourceLevel,
Modified: marble/trunk/src/lib/TileLoader.cpp
===================================================================
--- marble/trunk/src/lib/TileLoader.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/TileLoader.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -194,7 +194,7 @@
GeoSceneTexture * texture = static_cast<GeoSceneTexture *>( d->m_layer->groundDataset() );
return d->m_tileWidth * TileLoaderHelper::levelToColumn(
- texture ->levelZeroColumns(), level );
+ texture->levelZeroColumns(), level );
}
int TileLoader::globalHeight( int level ) const
@@ -248,7 +248,7 @@
tile = new TextureTile( tileId );
d->m_tileHash[tileId] = tile;
- d->m_datasetProvider->loadDatasets( tile );
+// d->m_datasetProvider->loadDatasets( tile );
if ( d->m_downloadManager != 0 ) {
connect( tile, SIGNAL( downloadTile( QUrl, QString, QString ) ),
@@ -361,7 +361,7 @@
(d->m_tileHash[id])->loadDataset( texture, level, x, y, &( d->m_tileCache ) );
m_parent->paintTile( d->m_tileHash[id], x, y, level, texture, true );
-// (d->m_tileHash[id]) -> reloadTile( x, y, level, d->m_theme );
+// (d->m_tileHash[id])->reloadTile( x, y, level, d->m_theme );
} else {
// Remove "false" tile from cache so it doesn't get loaded anymore
d->m_tileCache.remove( id );
Modified: marble/trunk/src/lib/VectorComposer.cpp
===================================================================
--- marble/trunk/src/lib/VectorComposer.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/VectorComposer.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -108,7 +108,7 @@
QPaintDevice *origimg = viewParams->coastImage();
Quaternion rotAxis = viewParams->planetAxis();
- // m_vectorMap -> clearNodeCount();
+ // m_vectorMap->clearNodeCount();
bool antialiased = false;
@@ -119,25 +119,25 @@
}
// Coastlines
- m_vectorMap -> setzBoundingBoxLimit( 0.4 );
- m_vectorMap -> setzPointLimit( 0 ); // 0.6 results in green pacific
+ m_vectorMap->setzBoundingBoxLimit( 0.4 );
+ m_vectorMap->setzPointLimit( 0 ); // 0.6 results in green pacific
// Draw the coast line vectors
- m_vectorMap -> createFromPntMap( m_coastLines, viewParams->viewport() );
- m_vectorMap -> setPen( m_textureLandPen );
- m_vectorMap -> setBrush( m_textureLandBrush );
- m_vectorMap -> drawMap( origimg, antialiased, viewParams->viewport(),
- viewParams->mapQuality() );
+ m_vectorMap->createFromPntMap( m_coastLines, viewParams->viewport() );
+ m_vectorMap->setPen( m_textureLandPen );
+ m_vectorMap->setBrush( m_textureLandBrush );
+ m_vectorMap->drawMap( origimg, antialiased, viewParams->viewport(),
+ viewParams->mapQuality() );
// Islands
- m_vectorMap -> setzBoundingBoxLimit( 0.8 );
- m_vectorMap -> setzPointLimit( 0.9 );
+ m_vectorMap->setzBoundingBoxLimit( 0.8 );
+ m_vectorMap->setzPointLimit( 0.9 );
- m_vectorMap -> createFromPntMap( m_islands, viewParams->viewport() );
- m_vectorMap -> setPen( m_textureLandPen );
- m_vectorMap -> setBrush( m_textureLandBrush );
- m_vectorMap -> drawMap( origimg, antialiased, viewParams->viewport(),
- viewParams->mapQuality() );
+ m_vectorMap->createFromPntMap( m_islands, viewParams->viewport() );
+ m_vectorMap->setPen( m_textureLandPen );
+ m_vectorMap->setBrush( m_textureLandBrush );
+ m_vectorMap->drawMap( origimg, antialiased, viewParams->viewport(),
+ viewParams->mapQuality() );
bool showWaterbodies, showLakes;
viewParams->propertyValue( "waterbodies", showWaterbodies );
@@ -145,20 +145,20 @@
if ( showWaterbodies && showLakes ) {
// Lakes
- m_vectorMap -> setzBoundingBoxLimit( 0.95 );
- m_vectorMap -> setzPointLimit( 0.98 );
+ m_vectorMap->setzBoundingBoxLimit( 0.95 );
+ m_vectorMap->setzPointLimit( 0.98 );
- m_vectorMap -> createFromPntMap( m_lakes, viewParams->viewport() );
- m_vectorMap -> setPen( Qt::NoPen );
- m_vectorMap -> setBrush( m_textureLakeBrush );
- m_vectorMap -> drawMap( origimg, antialiased, viewParams->viewport(),
- viewParams->mapQuality() );
+ m_vectorMap->createFromPntMap( m_lakes, viewParams->viewport() );
+ m_vectorMap->setPen( Qt::NoPen );
+ m_vectorMap->setBrush( m_textureLakeBrush );
+ m_vectorMap->drawMap( origimg, antialiased, viewParams->viewport(),
+ viewParams->mapQuality() );
- m_vectorMap -> createFromPntMap( m_lakeislands, viewParams->viewport() );
- m_vectorMap -> setPen( Qt::NoPen );
- m_vectorMap -> setBrush( m_textureLandBrush );
- m_vectorMap -> drawMap( origimg, antialiased, viewParams->viewport(),
- viewParams->mapQuality() );
+ m_vectorMap->createFromPntMap( m_lakeislands, viewParams->viewport() );
+ m_vectorMap->setPen( Qt::NoPen );
+ m_vectorMap->setBrush( m_textureLandBrush );
+ m_vectorMap->drawMap( origimg, antialiased, viewParams->viewport(),
+ viewParams->mapQuality() );
}
bool showIce;
@@ -166,14 +166,14 @@
if ( showIce ) {
// Glaciers
- m_vectorMap -> setzBoundingBoxLimit( 0.8 );
- m_vectorMap -> setzPointLimit( 0.9 );
- m_vectorMap -> createFromPntMap( m_glaciers, viewParams->viewport() );
- m_vectorMap -> setPen( Qt::NoPen );
- m_vectorMap -> setBrush( m_textureGlacierBrush );
+ m_vectorMap->setzBoundingBoxLimit( 0.8 );
+ m_vectorMap->setzPointLimit( 0.9 );
+ m_vectorMap->createFromPntMap( m_glaciers, viewParams->viewport() );
+ m_vectorMap->setPen( Qt::NoPen );
+ m_vectorMap->setBrush( m_textureGlacierBrush );
- m_vectorMap -> drawMap( origimg, antialiased, viewParams->viewport(),
- viewParams->mapQuality() );
+ m_vectorMap->drawMap( origimg, antialiased, viewParams->viewport(),
+ viewParams->mapQuality() );
}
// qDebug() << "TextureMap calculated nodes: " << m_vectorMap->nodeCount();
@@ -193,47 +193,47 @@
}
// Paint the background of it all, i.e. the water.
- m_vectorMap -> setPen( m_oceanPen );
- m_vectorMap -> setBrush( m_oceanBrush );
- m_vectorMap -> paintBase( painter, viewParams->viewport(), antialiased );
+ m_vectorMap->setPen( m_oceanPen );
+ m_vectorMap->setBrush( m_oceanBrush );
+ m_vectorMap->paintBase( painter, viewParams->viewport(), antialiased );
// Coastlines
- m_vectorMap -> setzBoundingBoxLimit( 0.4 );
- m_vectorMap -> setzPointLimit( 0 ); // 0.6 results in green pacific
+ m_vectorMap->setzBoundingBoxLimit( 0.4 );
+ m_vectorMap->setzPointLimit( 0 ); // 0.6 results in green pacific
bool showCoastlines;
viewParams->propertyValue( "coastlines", showCoastlines );
if ( showCoastlines ) {
- m_vectorMap -> setPen( m_landPen );
- m_vectorMap -> setBrush( Qt::NoBrush );
+ m_vectorMap->setPen( m_landPen );
+ m_vectorMap->setBrush( Qt::NoBrush );
}
else
{
- m_vectorMap -> setPen( Qt::NoPen );
- m_vectorMap -> setBrush( m_landBrush );
+ m_vectorMap->setPen( Qt::NoPen );
+ m_vectorMap->setBrush( m_landBrush );
}
- m_vectorMap -> createFromPntMap( m_coastLines, viewParams->viewport() );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->createFromPntMap( m_coastLines, viewParams->viewport() );
+ m_vectorMap->paintMap( painter, antialiased );
// Islands
- m_vectorMap -> setzBoundingBoxLimit( 0.8 );
- m_vectorMap -> setzPointLimit( 0.9 );
+ m_vectorMap->setzBoundingBoxLimit( 0.8 );
+ m_vectorMap->setzPointLimit( 0.9 );
- m_vectorMap -> createFromPntMap( m_islands, viewParams->viewport() );
+ m_vectorMap->createFromPntMap( m_islands, viewParams->viewport() );
if ( showCoastlines ) {
- m_vectorMap -> setPen( m_landPen );
- m_vectorMap -> setBrush( Qt::NoBrush );
+ m_vectorMap->setPen( m_landPen );
+ m_vectorMap->setBrush( Qt::NoBrush );
}
else
{
- m_vectorMap -> setPen( Qt::NoPen );
- m_vectorMap -> setBrush( m_landBrush );
+ m_vectorMap->setPen( Qt::NoPen );
+ m_vectorMap->setBrush( m_landBrush );
}
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->paintMap( painter, antialiased );
bool showWaterbodies, showLakes;
viewParams->propertyValue( "waterbodies", showWaterbodies );
@@ -241,24 +241,24 @@
if ( ( showWaterbodies && showLakes ) || showCoastlines ) {
// Lakes
- m_vectorMap -> setzBoundingBoxLimit( 0.95 );
- m_vectorMap -> setzPointLimit( 0.98 );
+ m_vectorMap->setzBoundingBoxLimit( 0.95 );
+ m_vectorMap->setzPointLimit( 0.98 );
- m_vectorMap -> createFromPntMap( m_lakes, viewParams->viewport() );
- m_vectorMap -> setPen( m_lakePen );
- m_vectorMap -> setBrush( m_lakeBrush );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->createFromPntMap( m_lakes, viewParams->viewport() );
+ m_vectorMap->setPen( m_lakePen );
+ m_vectorMap->setBrush( m_lakeBrush );
+ m_vectorMap->paintMap( painter, antialiased );
- m_vectorMap -> createFromPntMap( m_lakeislands, viewParams->viewport() );
- m_vectorMap -> setBrush( m_landBrush );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->createFromPntMap( m_lakeislands, viewParams->viewport() );
+ m_vectorMap->setBrush( m_landBrush );
+ m_vectorMap->paintMap( painter, antialiased );
}
}
void VectorComposer::paintVectorMap( GeoPainter *painter,
ViewParams *viewParams )
{
- // m_vectorMap -> clearNodeCount();
+ // m_vectorMap->clearNodeCount();
Quaternion rotAxis = viewParams->planetAxis();
@@ -275,33 +275,33 @@
viewParams->propertyValue( "coastlines", showCoastlines );
if ( showCoastlines ) {
- m_vectorMap -> setzBoundingBoxLimit( 0.4 );
- m_vectorMap -> setzPointLimit( 0 ); // 0.6 results in green pacific
+ m_vectorMap->setzBoundingBoxLimit( 0.4 );
+ m_vectorMap->setzPointLimit( 0 ); // 0.6 results in green pacific
- m_vectorMap -> createFromPntMap( m_coastLines, viewParams->viewport() );
- m_vectorMap -> setPen( m_landPen );
- m_vectorMap -> setBrush( Qt::NoBrush );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->createFromPntMap( m_coastLines, viewParams->viewport() );
+ m_vectorMap->setPen( m_landPen );
+ m_vectorMap->setBrush( Qt::NoBrush );
+ m_vectorMap->paintMap( painter, antialiased );
- m_vectorMap -> setzBoundingBoxLimit( 0.8 );
- m_vectorMap -> setzPointLimit( 0.9 );
+ m_vectorMap->setzBoundingBoxLimit( 0.8 );
+ m_vectorMap->setzPointLimit( 0.9 );
- m_vectorMap -> createFromPntMap( m_islands, viewParams->viewport() );
- m_vectorMap -> setPen( m_landPen );
- m_vectorMap -> setBrush( Qt::NoBrush );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->createFromPntMap( m_islands, viewParams->viewport() );
+ m_vectorMap->setPen( m_landPen );
+ m_vectorMap->setBrush( Qt::NoBrush );
+ m_vectorMap->paintMap( painter, antialiased );
// Lakes
- m_vectorMap -> setzBoundingBoxLimit( 0.95 );
- m_vectorMap -> setzPointLimit( 0.98 );
+ m_vectorMap->setzBoundingBoxLimit( 0.95 );
+ m_vectorMap->setzPointLimit( 0.98 );
- m_vectorMap -> createFromPntMap( m_lakes, viewParams->viewport() );
- m_vectorMap -> setPen( m_landPen );
- m_vectorMap -> setBrush( Qt::NoBrush );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->createFromPntMap( m_lakes, viewParams->viewport() );
+ m_vectorMap->setPen( m_landPen );
+ m_vectorMap->setBrush( Qt::NoBrush );
+ m_vectorMap->paintMap( painter, antialiased );
- m_vectorMap -> createFromPntMap( m_lakeislands, viewParams->viewport() );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->createFromPntMap( m_lakeislands, viewParams->viewport() );
+ m_vectorMap->paintMap( painter, antialiased );
}
bool showWaterbodies, showRivers;
@@ -310,13 +310,13 @@
if ( showWaterbodies && showRivers ) {
// Rivers
- m_vectorMap -> setzBoundingBoxLimit( -1.0 );
- m_vectorMap -> setzPointLimit( -1.0 );
- m_vectorMap -> createFromPntMap( m_rivers, viewParams->viewport() );
+ m_vectorMap->setzBoundingBoxLimit( -1.0 );
+ m_vectorMap->setzPointLimit( -1.0 );
+ m_vectorMap->createFromPntMap( m_rivers, viewParams->viewport() );
- m_vectorMap -> setPen( m_riverPen );
- m_vectorMap -> setBrush( m_riverBrush );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->setPen( m_riverPen );
+ m_vectorMap->setBrush( m_riverBrush );
+ m_vectorMap->paintMap( painter, antialiased );
}
bool showBorders;
@@ -324,9 +324,9 @@
if ( showBorders ) {
// Countries
- m_vectorMap -> setzBoundingBoxLimit( -1.0 );
- m_vectorMap -> setzPointLimit( -1.0 );
- m_vectorMap -> createFromPntMap( m_countries, viewParams->viewport() );
+ m_vectorMap->setzBoundingBoxLimit( -1.0 );
+ m_vectorMap->setzPointLimit( -1.0 );
+ m_vectorMap->createFromPntMap( m_countries, viewParams->viewport() );
// Fancy Boundaries Hack:
// FIXME: Find a clean solution that allows for all the
@@ -343,14 +343,14 @@
QColor penColor = m_countryPen.color();
QPen borderDashPen( Qt::black );
- m_vectorMap -> setBrush( m_countryBrush );
+ m_vectorMap->setBrush( m_countryBrush );
if ( viewParams->mapQuality() == Marble::High
|| viewParams->mapQuality() == Marble::Print ) {
countryPen.setColor( penColor );
- m_vectorMap -> setPen( countryPen );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->setPen( countryPen );
+ m_vectorMap->paintMap( painter, antialiased );
// Only paint fancy style if the coast line doesn't get painted as well
// (as it looks a bit awkward otherwise)
@@ -358,8 +358,8 @@
if ( !showCoastlines ) {
borderDashPen.setDashPattern( QVector<qreal>() << 1 << 5 );
borderDashPen.setWidthF( penWidth * 0.5 );
- m_vectorMap -> setPen( borderDashPen );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->setPen( borderDashPen );
+ m_vectorMap->paintMap( painter, antialiased );
}
}
if ( viewParams->mapQuality() == Marble::Normal ) {
@@ -371,13 +371,13 @@
countryPen.setColor( penColor.darker(110) );
}
- m_vectorMap -> setPen( countryPen );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->setPen( countryPen );
+ m_vectorMap->paintMap( painter, antialiased );
if ( !showCoastlines ) {
borderDashPen.setStyle( Qt::DotLine );
- m_vectorMap -> setPen( borderDashPen );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->setPen( borderDashPen );
+ m_vectorMap->paintMap( painter, antialiased );
}
}
if ( viewParams->mapQuality() == Marble::Outline
@@ -387,27 +387,27 @@
countryPen.setWidthF( 1.0 );
countryPen.setColor( penColor.darker(115) );
}
- m_vectorMap -> setPen( countryPen );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->setPen( countryPen );
+ m_vectorMap->paintMap( painter, antialiased );
}
// US-States
- m_vectorMap -> setzBoundingBoxLimit( -1.0 );
- m_vectorMap -> setzPointLimit( -1.0 );
- m_vectorMap -> createFromPntMap( m_usaStates, viewParams->viewport() );
+ m_vectorMap->setzBoundingBoxLimit( -1.0 );
+ m_vectorMap->setzPointLimit( -1.0 );
+ m_vectorMap->createFromPntMap( m_usaStates, viewParams->viewport() );
- m_vectorMap -> setPen( m_statePen );
- m_vectorMap -> setBrush( m_stateBrush );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->setPen( m_statePen );
+ m_vectorMap->setBrush( m_stateBrush );
+ m_vectorMap->paintMap( painter, antialiased );
// International Dateline
- m_vectorMap -> setzBoundingBoxLimit( -1.0 );
- m_vectorMap -> setzPointLimit( -1.0 );
- m_vectorMap -> createFromPntMap( m_dateLine, viewParams->viewport() );
+ m_vectorMap->setzBoundingBoxLimit( -1.0 );
+ m_vectorMap->setzPointLimit( -1.0 );
+ m_vectorMap->createFromPntMap( m_dateLine, viewParams->viewport() );
- m_vectorMap -> setPen( m_dateLinePen );
- m_vectorMap -> setBrush( m_dateLineBrush );
- m_vectorMap -> paintMap( painter, antialiased );
+ m_vectorMap->setPen( m_dateLinePen );
+ m_vectorMap->setBrush( m_dateLineBrush );
+ m_vectorMap->paintMap( painter, antialiased );
}
// qDebug() << "M_VectorMap calculated nodes: " << m_vectorMap->nodeCount();
@@ -418,4 +418,3 @@
{
m_vectorMap->resizeMap( width, height );
}
-
Modified: marble/trunk/src/lib/VectorMap.cpp
===================================================================
--- marble/trunk/src/lib/VectorMap.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/VectorMap.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -124,6 +124,8 @@
{
// This sorts out polygons by bounding box which aren't visible at all.
GeoDataCoordinates::PtrVector boundary = (*itPolyLine)->getBoundary();
+ // rather paint an invalid line then crashing here if the boundaries are not loaded yet
+ if(boundary.size() < 5) continue;
for ( int i = 0; i < 5; ++i ) {
qbound = boundary[i]->quaternion();
@@ -182,6 +184,10 @@
// Let's just use the top left and the bottom right bounding
// box point for this projection.
+
+ // rather paint an invalid line then crashing here if the boundaries are not loaded yet
+ if(boundary.size() < 3) continue;
+
for ( int i = 1; i < 3; ++i ) {
boundary[i]->geoCoordinates(lon, lat);
x = (qreal)(m_imgwidth) / 2.0 - rad2Pixel * (centerLon - lon);
@@ -276,6 +282,10 @@
// Let's just use the top left and the bottom right bounding box point for
// this projection
+
+ // rather paint an invalid line then crashing here if the boundaries are not loaded yet
+ if(boundary.size() < 3) continue;
+
for ( int i = 1; i < 3; ++i ) {
boundary[i]->geoCoordinates(lon, lat);
x = (qreal)(m_imgwidth) / 2.0 + rad2Pixel * (lon - centerLon);
Modified: marble/trunk/src/lib/VisiblePlaceMark.cpp
===================================================================
--- marble/trunk/src/lib/VisiblePlaceMark.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/VisiblePlaceMark.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -26,12 +26,12 @@
{
}
-const QPersistentModelIndex& VisiblePlaceMark::modelIndex() const
+const QModelIndex& VisiblePlaceMark::modelIndex() const
{
return m_modelIndex;
}
-void VisiblePlaceMark::setModelIndex( const QPersistentModelIndex &modelIndex )
+void VisiblePlaceMark::setModelIndex( const QModelIndex &modelIndex )
{
m_modelIndex = modelIndex;
}
Modified: marble/trunk/src/lib/VisiblePlaceMark.h
===================================================================
--- marble/trunk/src/lib/VisiblePlaceMark.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/VisiblePlaceMark.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -18,7 +18,7 @@
#define VISIBLEPLACEMARK_H
#include <QtGui/QPixmap>
-#include <QtCore/QPersistentModelIndex>
+#include <QtCore/QModelIndex>
#include <QtCore/QPoint>
#include <QtCore/QRect>
#include <QtCore/QString>
@@ -47,15 +47,15 @@
/**
* Returns the index of the place mark model which
- * is associated with this visible plave mark.
+ * is associated with this visible place mark.
*/
- const QPersistentModelIndex& modelIndex() const;
+ const QModelIndex& modelIndex() const;
/**
* Sets the @p index of the place mark model which
* is associated with this visible plave mark.
*/
- void setModelIndex( const QPersistentModelIndex &index );
+ void setModelIndex( const QModelIndex &index );
/**
* Returns the name of the place mark.
@@ -98,7 +98,7 @@
void setLabelRect( const QRect& area );
private:
- QPersistentModelIndex m_modelIndex;
+ QModelIndex m_modelIndex;
// View stuff
QPoint m_symbolPosition; // position of the placemark's symbol
Modified: marble/trunk/src/lib/geodata/data/GeoDataFeature.cpp
===================================================================
--- marble/trunk/src/lib/geodata/data/GeoDataFeature.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/geodata/data/GeoDataFeature.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -212,7 +212,7 @@
= new GeoDataStyle( QPixmap(),
QFont( defaultFamily, (int)(defaultSize * 1.2 ), 75, false ), QColor( "#404040" ) );
// Align area labels centered
- s_defaultStyle[Nation] -> labelStyle() -> setAlignment( GeoDataLabelStyle::Center );
+ s_defaultStyle[Nation]->labelStyle()->setAlignment( GeoDataLabelStyle::Center );
s_defaultStyle[Mountain]
= new GeoDataStyle( QPixmap( MarbleDirs::path( "bitmaps/mountain_1.png" ) ),
@@ -234,13 +234,13 @@
= new GeoDataStyle( QPixmap(),
QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, false ), QColor( "#bf0303" ) );
// Align area labels centered
- s_defaultStyle[Continent] -> labelStyle() -> setAlignment( GeoDataLabelStyle::Center );
+ s_defaultStyle[Continent]->labelStyle()->setAlignment( GeoDataLabelStyle::Center );
s_defaultStyle[Ocean]
= new GeoDataStyle( QPixmap(),
QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, true ), QColor( "#2c72c7" ) );
// Align area labels centered
- s_defaultStyle[Ocean] -> labelStyle() -> setAlignment( GeoDataLabelStyle::Center );
+ s_defaultStyle[Ocean]->labelStyle()->setAlignment( GeoDataLabelStyle::Center );
s_defaultStyle[OtherTerrain]
= new GeoDataStyle( QPixmap( MarbleDirs::path( "bitmaps/other.png" ) ),
@@ -254,7 +254,7 @@
= new GeoDataStyle( QPixmap(),
QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, false ), QColor( "#bf0303" ) );
// Align area labels centered
- s_defaultStyle[Mare] -> labelStyle() -> setAlignment( GeoDataLabelStyle::Center );
+ s_defaultStyle[Mare]->labelStyle()->setAlignment( GeoDataLabelStyle::Center );
s_defaultStyle[GeographicPole]
= new GeoDataStyle( QPixmap( MarbleDirs::path( "bitmaps/pole_1.png" ) ),
@@ -309,37 +309,37 @@
#if QT_VERSION >= 0x040400
// Fonts for areas ...
- tmp = s_defaultStyle[Continent] -> labelStyle()-> font();
+ tmp = s_defaultStyle[Continent]->labelStyle()->font();
tmp.setLetterSpacing( QFont::AbsoluteSpacing, 2 );
tmp.setCapitalization( QFont::SmallCaps );
tmp.setBold( true );
- s_defaultStyle[Continent] -> labelStyle()-> setFont( tmp );
+ s_defaultStyle[Continent]->labelStyle()->setFont( tmp );
// Fonts for areas ...
- tmp = s_defaultStyle[Mare] -> labelStyle()-> font();
+ tmp = s_defaultStyle[Mare]->labelStyle()->font();
tmp.setLetterSpacing( QFont::AbsoluteSpacing, 2 );
tmp.setCapitalization( QFont::SmallCaps );
tmp.setBold( true );
- s_defaultStyle[Mare] -> labelStyle()-> setFont( tmp );
+ s_defaultStyle[Mare]->labelStyle()->setFont( tmp );
#endif
// Now we need to underline the capitals ...
- tmp = s_defaultStyle[SmallNationCapital] -> labelStyle()-> font();
+ tmp = s_defaultStyle[SmallNationCapital]->labelStyle()->font();
tmp.setUnderline( true );
- s_defaultStyle[SmallNationCapital] -> labelStyle()-> setFont( tmp );
+ s_defaultStyle[SmallNationCapital]->labelStyle()->setFont( tmp );
- tmp = s_defaultStyle[MediumNationCapital] -> labelStyle()-> font();
+ tmp = s_defaultStyle[MediumNationCapital]->labelStyle()->font();
tmp.setUnderline( true );
- s_defaultStyle[MediumNationCapital] -> labelStyle()-> setFont( tmp );
+ s_defaultStyle[MediumNationCapital]->labelStyle()->setFont( tmp );
- tmp = s_defaultStyle[BigNationCapital] -> labelStyle()-> font();
+ tmp = s_defaultStyle[BigNationCapital]->labelStyle()->font();
tmp.setUnderline( true );
- s_defaultStyle[BigNationCapital] -> labelStyle()-> setFont( tmp );
+ s_defaultStyle[BigNationCapital]->labelStyle()->setFont( tmp );
- tmp = s_defaultStyle[LargeNationCapital] -> labelStyle()-> font();
+ tmp = s_defaultStyle[LargeNationCapital]->labelStyle()->font();
tmp.setUnderline( true );
- s_defaultStyle[LargeNationCapital] -> labelStyle()-> setFont( tmp );
+ s_defaultStyle[LargeNationCapital]->labelStyle()->setFont( tmp );
}
QFont GeoDataFeature::defaultFont()
Modified: marble/trunk/src/lib/geodata/data/GeoDataFeature.h
===================================================================
--- marble/trunk/src/lib/geodata/data/GeoDataFeature.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/geodata/data/GeoDataFeature.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -57,7 +57,7 @@
virtual ~GeoDataFeature();
GeoDataFeature& operator=( const GeoDataFeature& other );
- bool operator==( const GeoDataFeature& other ) const { return false; };
+ bool operator==( const GeoDataFeature& ) const { return false; };
virtual bool isFolder() const { return false; }
virtual bool isPlacemark() const { return false; }
Modified: marble/trunk/src/lib/geodata/parser/GeoDocument.cpp
===================================================================
--- marble/trunk/src/lib/geodata/parser/GeoDocument.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/geodata/parser/GeoDocument.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -21,29 +21,15 @@
#include "GeoDocument.h"
-#if DUMP_GEONODE_LEAKS > 0
-#include <cstdio>
-#endif
-
namespace Marble
{
-#if DUMP_GEONODE_LEAKS > 0
-unsigned long GeoDocument::s_leakProtector = 0;
-#endif
-
GeoDocument::GeoDocument()
{
}
GeoDocument::~GeoDocument()
{
-#if DUMP_GEONODE_LEAKS > 0
- if ( s_leakProtector != 0 ) {
- std::fprintf( stderr, "Found %lu GeoNode object LEAKS!\n", s_leakProtector );
- s_leakProtector = 0;
- }
-#endif
}
bool GeoDocument::isGeoDataDocument() const
@@ -59,26 +45,10 @@
GeoNode::GeoNode()
{
-#if DUMP_GEONODE_LEAKS > 0
- GeoDocument::s_leakProtector++;
-
-#if DUMP_GEONODE_LEAKS > 1
- fprintf( stderr, "Constructed new GeoNode object, leak protection count: %lu\n",
- GeoDocument::s_leakProtector );
-#endif
-#endif
}
GeoNode::~GeoNode()
{
-#if DUMP_GEONODE_LEAKS > 0
- --GeoDocument::s_leakProtector;
-
-#if DUMP_GEONODE_LEAKS > 1
- fprintf( stderr, "Destructed GeoNode object, leak protection count: %lu\n",
- GeoDocument::s_leakProtector );
-#endif
-#endif
}
}
Modified: marble/trunk/src/lib/geodata/parser/GeoDocument.h
===================================================================
--- marble/trunk/src/lib/geodata/parser/GeoDocument.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/geodata/parser/GeoDocument.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -23,12 +23,6 @@
#ifndef GeoDocument_h
#define GeoDocument_h
-
-// Set to a value greater than 0, to enable leak tracking of GeoNode objects
-// Set to a value greater than 1, to enable detailed tracking of construction/destruction of GeoNode objects
-#define DUMP_GEONODE_LEAKS 1
-
-
#include "geodata_export.h"
namespace Marble
@@ -42,10 +36,6 @@
GeoDocument();
public:
-#if DUMP_GEONODE_LEAKS > 0
- static unsigned long s_leakProtector;
-#endif
-
virtual ~GeoDocument();
virtual bool isGeoDataDocument() const;
Modified: marble/trunk/src/lib/geodata/parser/GeoParser.cpp
===================================================================
--- marble/trunk/src/lib/geodata/parser/GeoParser.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/geodata/parser/GeoParser.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -155,7 +155,7 @@
// DGMLNameTagHandler assumes that <name> only contains textual
// children, and reads the joined value of all children using
// readElementText(). This implicates that tags like <name>
- // don't contain any children that would need to be procesed using
+ // don't contain any children that would need to be processed using
// this parseDocument() function.
if ( processChildren ) {
m_nodeStack.push( stackItem );
Modified: marble/trunk/src/lib/global.h
===================================================================
--- marble/trunk/src/lib/global.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/global.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -133,7 +133,7 @@
// Version definitions to use with an external application (as digiKam)
// String for about dialog.
-const QString MARBLE_VERSION_STRING = QString::fromLatin1( "pre 0.7 SVN" );
+const QString MARBLE_VERSION_STRING = QString::fromLatin1( "0.7" );
// API Version id:
// form : 0xMMmmpp
Modified: marble/trunk/src/lib/gps/GpsTracking.cpp
===================================================================
--- marble/trunk/src/lib/gps/GpsTracking.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/gps/GpsTracking.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -82,11 +82,11 @@
bool draw = false;
- draw = m_gpsCurrentPosition -> getPixelPos( canvasSize, viewParams,
- &position );
+ draw = m_gpsCurrentPosition->getPixelPos( canvasSize, viewParams,
+ &position );
- draw = m_gpsPreviousPosition -> getPixelPos( canvasSize, viewParams,
- &previousPosition );
+ draw = m_gpsPreviousPosition->getPixelPos( canvasSize, viewParams,
+ &previousPosition );
if ( !draw ) {
m_currentDraw.clear();
@@ -199,8 +199,8 @@
//m_gpsdData has been successully set
if ( m_gpsdData != 0 ){
m_gpsdData =m_gpsd->query( "p" );
- m_gpsTracking ->setPosition( m_gpsdData->fix.latitude,
- m_gpsdData->fix.longitude );
+ m_gpsTracking->setPosition( m_gpsdData->fix.latitude,
+ m_gpsdData->fix.longitude );
if (m_gpsTrackSeg == 0 ){
m_gpsTrackSeg = new TrackSegment();
Modified: marble/trunk/src/lib/gps/GpxSax.cpp
===================================================================
--- marble/trunk/src/lib/gps/GpxSax.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/gps/GpxSax.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -90,7 +90,7 @@
if ( qName == "trkseg") {
m_trackSeg->createBoundingBox();
- m_track -> append( m_trackSeg );
+ m_track->append( m_trackSeg );
m_trackSeg = 0;
}
else if ( qName == "trk") {
Modified: marble/trunk/src/lib/gps/Track.cpp
===================================================================
--- marble/trunk/src/lib/gps/Track.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/lib/gps/Track.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -41,7 +41,7 @@
{
const_iterator it;
for ( it = this->constBegin(); it < this->constEnd(); ++it ) {
- ( *it ) -> draw( painter, canvasSize, viewParams );
+ (*it)->draw( painter, canvasSize, viewParams );
}
}
@@ -70,7 +70,7 @@
#endif
const_iterator it;
for( it = this->constBegin(); it < this->constEnd(); ++it ) {
- ( *it ) -> draw( painter, canvasSize, viewParams );
+ (*it)->draw( painter, canvasSize, viewParams );
}
}
Modified: marble/trunk/src/marble.desktop
===================================================================
--- marble/trunk/src/marble.desktop 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/marble.desktop 2009-01-31 17:31:35 UTC (rev 3487)
@@ -13,7 +13,7 @@
GenericName[bg]=Планетариум за работния плот
GenericName[ca]=Planetari per a l'escriptori
GenericName[csb]=Globùs na pùlce
-GenericName[da]=Desktopglobus
+GenericName[da]=Skrivebordsglobus
GenericName[de]=Schreibtischglobus
GenericName[el]=Υδρόγειος επιφάνειας εργασίας
GenericName[eo]=Tabula globo
@@ -32,7 +32,7 @@
GenericName[ja]=デスクトップ地球儀
GenericName[km]=ផ្ទៃតុសកល
GenericName[ko]=데스크톱 지구본
-GenericName[lt]=Darbastalio gaublys
+GenericName[lt]=Darbalaukio gaublys
GenericName[lv]=Darbvirsmas globuss
GenericName[ml]=പണിയിട ഭൂഗോളം
GenericName[nb]=Skrivebordsglobus
@@ -43,7 +43,7 @@
GenericName[pa]=ਡੈਸਕਟਾਪ ਗਲੋਬ
GenericName[pl]=Ziemia na biurku
GenericName[pt]=Globo
-GenericName[pt_BR]=Planetário do ambiente de trabalho
+GenericName[pt_BR]=Globo terrestre do ambiente de trabalho
GenericName[ro]=Glob de birou
GenericName[ru]=Настольный глобус
GenericName[sl]=Namizni globus
@@ -55,5 +55,5 @@
GenericName[zh_TW]=桌面星象儀
Icon=marble
Terminal=false
-Categories=Qt;KDE;Education;Science;
+Categories=Qt;KDE;Education;Geography;
X-DocPath=marble/index.html
Modified: marble/trunk/src/marble_part.cpp
===================================================================
--- marble/trunk/src/marble_part.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/marble_part.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -130,7 +130,7 @@
KAboutData *MarblePart::createAboutData()
{
- return new KAboutData( I18N_NOOP( "marble_part" ), 0, ki18n( "A Desktop Globe" ), "Pre-0.7 SVN" );
+ return new KAboutData( I18N_NOOP( "marble_part" ), 0, ki18n( "A Desktop Globe" ), MARBLE_VERSION_STRING.toLatin1() );
}
bool MarblePart::openUrl( const KUrl &url )
@@ -229,13 +229,6 @@
m_showAtmosphereAction->setChecked( isChecked ); // Sync state with the GUI
}
-void MarblePart::setShowCrosshairs( bool isChecked )
-{
- m_controlView->marbleWidget()->setShowCrosshairs( isChecked );
-
- m_showCrosshairsAction->setChecked( isChecked ); // Sync state with the GUI
-}
-
void MarblePart::showFullScreen( bool isChecked )
{
if ( isChecked ) {
@@ -534,7 +527,7 @@
actionCollection() );
// Action: Get hot new stuff
- m_newStuffAction = KNS::standardAction( i18n("Maps..."), this, SLOT(showNewStuffDialog()), actionCollection(), "new_stuff");
+ m_newStuffAction = KNS::standardAction( i18n("Download Maps..."), this, SLOT(showNewStuffDialog()), actionCollection(), "new_stuff");
m_newStuffAction->setStatusTip(i18n("&Download new maps"));
m_newStuffAction->setShortcut( Qt::CTRL + Qt::Key_N );
@@ -564,15 +557,16 @@
connect( m_showAtmosphereAction, SIGNAL( triggered( bool ) ),
this, SLOT( setShowAtmosphere( bool ) ) );
- // Action: Show Clouds option
- m_showCrosshairsAction = new KAction( this );
- actionCollection()->addAction( "show_crosshairs", m_showCrosshairsAction );
- m_showCrosshairsAction->setCheckable( true );
- m_showCrosshairsAction->setChecked( true );
- m_showCrosshairsAction->setText( i18n( "Cross&hairs" ) );
- connect( m_showCrosshairsAction, SIGNAL( triggered( bool ) ),
- this, SLOT( setShowCrosshairs( bool ) ) );
+ // Action: Show Crosshairs option
+ QList<MarbleRenderPlugin *> pluginList = m_controlView->marbleWidget()->renderPlugins();
+ QList<MarbleRenderPlugin *>::const_iterator i;
+ for (i = pluginList.constBegin(); i != pluginList.constEnd(); ++i) {
+ if ( (*i)->nameId() == "crosshairs" ) {
+ actionCollection()->addAction( "show_crosshairs", (*i)->action() );
+ }
+ }
+
// Action: Show Clouds option
m_showCloudsAction = new KAction( this );
actionCollection()->addAction( "show_clouds", m_showCloudsAction );
Modified: marble/trunk/src/marble_part.desktop
===================================================================
--- marble/trunk/src/marble_part.desktop 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/marble_part.desktop 2009-01-31 17:31:35 UTC (rev 3487)
@@ -17,6 +17,7 @@
Name[ja]=Marble コンポーネント
Name[km]=ផ្នែកថ្មម៉ាប
Name[ko]=Marble 부분
+Name[lt]=Marble dalis
Name[ml]=മാര്ബിള് പാര്ട്ട്
Name[nds]=Marble-Komponent
Name[ne]=मार्बल अंश
Modified: marble/trunk/src/marble_part.h
===================================================================
--- marble/trunk/src/marble_part.h 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/marble_part.h 2009-01-31 17:31:35 UTC (rev 3487)
@@ -62,7 +62,6 @@
void setShowClouds( bool );
void setShowAtmosphere( bool );
void setShowCurrentLocation( bool );
- void setShowCrosshairs( bool );
void showFullScreen( bool );
void showSideBar( bool );
void showStatusBar( bool );
@@ -100,7 +99,6 @@
KAction *m_copyMapAction;
KAction *m_copyCoordinatesAction;
KAction *m_currentLocationAction;
- KAction *m_showCrosshairsAction;
KAction *m_showCloudsAction;
KAction *m_showAtmosphereAction;
KAction *m_sideBarAct;
Modified: marble/trunk/src/plasmoid/plasma-applet-kworldclock.desktop
===================================================================
--- marble/trunk/src/plasmoid/plasma-applet-kworldclock.desktop 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/plasmoid/plasma-applet-kworldclock.desktop 2009-01-31 17:31:35 UTC (rev 3487)
@@ -22,6 +22,7 @@
Name[nds]=Weltklock
Name[nl]=Wereldklok
Name[nn]=Verdsklokke
+Name[pa]=ਸੰਸਾਰ ਘੜੀ
Name[pl]=Zegar światowy
Name[pt]=Relógio Mundial
Name[pt_BR]=Relógio mundial
@@ -32,21 +33,26 @@
Name[zh_CN]=世界时钟
Name[zh_TW]=世界時鐘
Comment=Shows the time in different parts of the world
+Comment[ca]=Mostra l'hora en diverses parts del món
+Comment[da]=Viser tiden i forskellige dele af verden
Comment[de]=Zeigt die Zeit in verschiedenen Erdteilen
Comment[el]=Εμφάνιση της ώρας σε διάφορα μέρη του κόσμου
Comment[es]=Muestra la hora en las diferentes partes del mundo
Comment[et]=Kellaaja näitamine maailma eri kohtades
Comment[fr]=Affiche l'heure dans les différentes parties du monde
+Comment[ga]=Taispeáin an t-am in áiteanna ar fud an domhain
Comment[gl]=Mostra a hora en diferentes partes do mundo
Comment[gu]=દુનિયાનાં જુદા જુદા ભાગોનો સમય બતાવે છે
Comment[it]=Mostra il tempo in diverse parti del mondo
Comment[ja]=世界各地の時刻を表示します
Comment[km]=បង្ហាញពេលវេលានៅក្នុងផ្នែកផ្សេងរបស់ពាក្យ
+Comment[lt]=Rodo laiką skirtingose pasaulio dalyse
Comment[lv]=Rāda laiku dažādas pasaules vietās
Comment[nb]=Viser tiden i forskjellige deler av verden
Comment[nds]=Wiest de Tiet in verscheden Rebeden vun de Eer
Comment[nl]=Tijdklok voor de hele wereld
Comment[nn]=Vis kva klokka er ulike stader i verda
+Comment[pa]=ਸੰਸਾਰ ਦੇ ਵੱਖ ਵੱਖ ਭਾਗਾਂ ਵਿੱਚ ਟਾਈਮ ਵੇਖੋ
Comment[pt]=Mostra a hora em diferentes partes do mundo
Comment[pt_BR]=Exibe o tempo em diferentes partes do mundo
Comment[sv]=Visar tiden i olika delar av världen
Modified: marble/trunk/src/plasmoid/worldclock.cpp
===================================================================
--- marble/trunk/src/plasmoid/worldclock.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/plasmoid/worldclock.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -61,7 +61,7 @@
m_map(0),
m_sun(0)
{
- KGlobal::locale()->insertCatalog("Marble");
+ KGlobal::locale()->insertCatalog("marble");
setHasConfigurationInterface(true);
setAcceptHoverEvents(true);
//The applet needs a 2:1 ratio
Modified: marble/trunk/src/plasmoid/worldclockConfig.ui
===================================================================
--- marble/trunk/src/plasmoid/worldclockConfig.ui 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/plasmoid/worldclockConfig.ui 2009-01-31 17:31:35 UTC (rev 3487)
@@ -43,7 +43,7 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex" >
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
@@ -102,7 +102,7 @@
</widget>
</item>
<item row="1" column="1" >
- <widget class="Marble::LatLonEdit" name="longitudeEdit" />
+ <widget class="Marble::LatLonEdit" native="1" name="longitudeEdit" />
</item>
<item row="2" column="0" >
<widget class="QRadioButton" name="daylightButton" >
Modified: marble/trunk/src/plugins/render/crosshairs/MarbleCrosshairsPlugin.cpp
===================================================================
--- marble/trunk/src/plugins/render/crosshairs/MarbleCrosshairsPlugin.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/plugins/render/crosshairs/MarbleCrosshairsPlugin.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -31,7 +31,7 @@
QStringList MarbleCrosshairsPlugin::renderPosition() const
{
- return QStringList( "FLOAT_ITEM" ); // although this is not a float item we choose the position of one
+ return QStringList( "ALWAYS_ON_TOP" ); // although this is not a float item we choose the position of one
}
QString MarbleCrosshairsPlugin::name() const
@@ -73,31 +73,32 @@
const QString& renderPos,
GeoSceneLayer * layer )
{
- int centerx = viewport->width() / 2;
- int centery = viewport->height() / 2;
- int boxwidth = 6;
- int boxheight = 2;
- int boxoffset = 4;
+ if ( renderPos == "ALWAYS_ON_TOP" ) {
+ int centerx = viewport->width() / 2;
+ int centery = viewport->height() / 2;
+ int boxwidth = 6;
+ int boxheight = 2;
+ int boxoffset = 4;
- painter->save();
+ painter->save();
- painter->setRenderHint( QPainter::Antialiasing, false );
- painter->setPen( QColor( Qt::black ) );
- painter->setBrush( QColor( Qt::white ) );
- painter->drawRect( centerx - boxoffset - boxwidth, centery - 1, boxwidth, boxheight );
- painter->drawRect( centerx + boxoffset, centery - 1, boxwidth, boxheight );
+ painter->setRenderHint( QPainter::Antialiasing, false );
+ painter->setPen( QColor( Qt::black ) );
+ painter->setBrush( QColor( Qt::white ) );
+ painter->drawRect( centerx - boxoffset - boxwidth, centery - 1, boxwidth, boxheight );
+ painter->drawRect( centerx + boxoffset, centery - 1, boxwidth, boxheight );
- painter->drawRect( centerx - 1, centery - boxoffset - boxwidth, boxheight, boxwidth );
- painter->drawRect( centerx - 1, centery + boxoffset, boxheight, boxwidth );
-
-/*
- painter->drawLine( centerx - halfsize, centery,
- centerx + halfsize, centery );
- painter->drawLine( centerx, centery - halfsize,
- centerx, centery + halfsize );
-*/
- painter->restore();
-
+ painter->drawRect( centerx - 1, centery - boxoffset - boxwidth, boxheight, boxwidth );
+ painter->drawRect( centerx - 1, centery + boxoffset, boxheight, boxwidth );
+
+ /*
+ painter->drawLine( centerx - halfsize, centery,
+ centerx + halfsize, centery );
+ painter->drawLine( centerx, centery - halfsize,
+ centerx, centery + halfsize );
+ */
+ painter->restore();
+ }
return true;
}
Modified: marble/trunk/src/plugins/render/test/MarbleTestPlugin.cpp
===================================================================
--- marble/trunk/src/plugins/render/test/MarbleTestPlugin.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/src/plugins/render/test/MarbleTestPlugin.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -213,16 +213,16 @@
// Example: draw annotations
- GeoDataCoordinates sotm(-8.6, 52.66, 0.0, GeoDataCoordinates::Degree );
+ GeoDataCoordinates sotm(4.89, 52.37, 0.0, GeoDataCoordinates::Degree );
painter->setPen( QColor( 198, 99, 99, 255 ) );
brush.setColor( QColor( 255, 255, 255, 200 ) );
brush.setStyle( Qt::SolidPattern );
painter->setBrush( brush );
- painter->drawAnnotation ( sotm, "State of the Map,\n 12-13 July 2008,\n OSM conference" );
+ painter->drawAnnotation ( sotm, "State of the Map,\n 10-12 July 2009,\n OSM conference", QSize(140,100), 10, 30, 15, 15 );
- GeoDataCoordinates akademy2008(4.5, 51.068, 0.0, GeoDataCoordinates::Degree );
+ GeoDataCoordinates akademy2009( -15.43, 28.1, 0.0, GeoDataCoordinates::Degree );
painter->setPen( QColor( 99, 99, 0 ) );
@@ -235,7 +235,7 @@
QBrush gradientBrush( radialGrad );
painter->setBrush( gradientBrush );
- painter->drawAnnotation ( akademy2008, "Akademy 2008,\n 9-15 August 2008,\n KDE conference", QSize(130, 120), 10, 30, 15, 15 );
+ painter->drawAnnotation ( akademy2009, "Akademy 2009,\n 3-11 July 2009,\n KDE conference" );
return true;
}
Modified: marble/trunk/tools/iau2kml/iau2kml.cpp
===================================================================
--- marble/trunk/tools/iau2kml/iau2kml.cpp 2009-01-31 04:32:04 UTC (rev 3486)
+++ marble/trunk/tools/iau2kml/iau2kml.cpp 2009-01-31 17:31:35 UTC (rev 3487)
@@ -90,7 +90,8 @@
while ( !sourcestream.atEnd() ) {
rawline = sourcestream.readLine();
- if ( !rawline.startsWith("\"E\"|\"m\"|\"" ) ) {
+// if ( !rawline.startsWith("\"E\"|\"m\"|\"" ) ) {
+ if ( !rawline.startsWith("\"M\"|\"M\"|\"" ) ) {
continue;
}
rawline = rawline.replace( "\"|", "|" );
@@ -123,6 +124,11 @@
lon = lonString.toFloat();
+ if ( !rawline.startsWith("\"M\"|\"M\"|\"" ) ) {
+ if ( lon > 180.0 ) lon = lon - 360.0;
+ lon = -lon;
+ }
+
lat = latString.toFloat();
description = description.remove('"');
@@ -154,6 +160,6 @@
return 0;
}
- qDebug(" asc2kml -o targetfile sourcefile");
+ qDebug(" iau2kml -o targetfile sourcefile");
app.exit();
}