[Marble-commits] KDE/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Wed Dec 29 18:26:47 CET 2010
SVN commit 1210131 by beschow:
move m_veccomposer into TextureColorizer
M +9 -1 TextureColorizer.cpp
M +11 -2 TextureColorizer.h
M +2 -9 TextureLayer.cpp
M +3 -1 VectorComposer.cpp
--- trunk/KDE/kdeedu/marble/src/lib/TextureColorizer.cpp #1210130:1210131
@@ -49,8 +49,11 @@
} GpFifo;
-TextureColorizer::TextureColorizer()
+TextureColorizer::TextureColorizer( QObject *parent )
+ : QObject( parent )
+ , m_veccomposer( this )
{
+ connect( &m_veccomposer, SIGNAL( datasetLoaded() ), SIGNAL( datasetLoaded() ) );
}
// This function takes two images, both in viewParams:
@@ -72,6 +75,9 @@
void TextureColorizer::colorize(ViewParams *viewParams)
{
+ // update coastimg
+ m_veccomposer.drawTextureMap( viewParams );
+
QImage *origimg = viewParams->canvasImage();
const QImage *coastimg = viewParams->coastImage();
const qint64 radius = viewParams->radius();
@@ -376,3 +382,5 @@
}
}
+
+#include "TextureColorizer.moc"
--- trunk/KDE/kdeedu/marble/src/lib/TextureColorizer.h #1210130:1210131
@@ -16,6 +16,8 @@
#ifndef MARBLE_TEXTURECOLORIZER_H
#define MARBLE_TEXTURECOLORIZER_H
+#include "VectorComposer.h"
+
#include <QtCore/QString>
namespace Marble
@@ -23,17 +25,24 @@
class ViewParams;
-class TextureColorizer
+class TextureColorizer : public QObject
{
+ Q_OBJECT
+
public:
- TextureColorizer();
+ TextureColorizer( QObject *parent = 0 );
virtual ~TextureColorizer(){}
void colorize(ViewParams *viewParams);
void setSeaFileLandFile( const QString& seafile,
const QString& landfile );
+
+ Q_SIGNALS:
+ void datasetLoaded();
+
private:
+ VectorComposer m_veccomposer;
QString m_seafile;
QString m_landfile;
uint texturepalette[16][512];
--- trunk/KDE/kdeedu/marble/src/lib/TextureLayer.cpp #1210130:1210131
@@ -33,7 +33,6 @@
#include "StackedTileLoader.h"
#include "TextureColorizer.h"
#include "TileLoader.h"
-#include "VectorComposer.h"
#include "ViewParams.h"
namespace Marble
@@ -55,7 +54,6 @@
TextureColorizer m_texcolorizer;
TileLoader m_loader;
StackedTileLoader m_tileLoader;
- VectorComposer m_veccomposer;
AbstractScanlineTextureMapper *m_texmapper;
GeoSceneDocument *m_mapTheme;
bool m_justModified;
@@ -66,7 +64,6 @@
, m_texcolorizer()
, m_loader( downloadManager, mapThemeManager )
, m_tileLoader( &m_loader, sunLocator )
- , m_veccomposer( parent )
, m_texmapper( 0 )
, m_mapTheme( 0 )
, m_justModified( true )
@@ -137,7 +134,7 @@
: QObject()
, d( new Private( mapThemeManager, downloadManager, sunLocator, this ) )
{
- connect( &d->m_veccomposer, SIGNAL( datasetLoaded() ), SLOT( mapChanged() ) );
+ connect( &d->m_texcolorizer, SIGNAL( datasetLoaded() ), SLOT( mapChanged() ) );
connect( &d->m_tileLoader, SIGNAL( tileUpdateAvailable() ), SLOT( mapChanged() ) );
}
@@ -170,13 +167,9 @@
&& layer->role() == "dem"
&& !d->m_mapTheme->map()->filters().isEmpty() ) {
- GeoSceneFilter *filter= d->m_mapTheme->map()->filters().first();
- viewParams->coastImage()->fill( Qt::transparent );
- // Create VectorMap
- d->m_veccomposer.drawTextureMap( viewParams );
-
// Colorize using settings from when the map was loaded
// there's no need to check the palette because it's set with the map theme
+ GeoSceneFilter *filter= d->m_mapTheme->map()->filters().first();
if( filter->type() == "colorize" ) {
d->m_texcolorizer.colorize( viewParams );
}
--- trunk/KDE/kdeedu/marble/src/lib/VectorComposer.cpp #1210130:1210131
@@ -150,9 +150,11 @@
{
loadCoastlines();
- QPaintDevice *origimg = viewParams->coastImage();
+ QImage *origimg = viewParams->coastImage();
Quaternion rotAxis = viewParams->planetAxis();
+ origimg->fill( Qt::transparent );
+
// m_vectorMap->clearNodeCount();
bool antialiased = false;
More information about the Marble-commits
mailing list