Commit d3bc6745 authored by Torsten Rahn's avatar Torsten Rahn
Browse files

- Fixing Marble Designer Plugin (except for the projection change)


svn path=/trunk/KDE/kdeedu/marble/; revision=842057
parent 263a7adc
......@@ -157,6 +157,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -149,6 +149,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -37,6 +37,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -138,6 +138,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -168,6 +168,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -168,6 +168,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -145,12 +145,12 @@
<available>true</available>
</property>
<property name="international-boundaries">
<available>false</available>
<value>false</value>
<available>true</available>
<value>true</value>
</property>
<property name="state-boundaries">
<available>false</available>
<value>false</value>
<available>true</available>
<value>true</value>
</property>
</group>
<group name="Water Bodies">
......@@ -159,12 +159,12 @@
<value>true</value>
</property>
<property name="lakes">
<available>false</available>
<value>false</value>
<available>true</available>
<value>true</value>
</property>
<property name="rivers">
<available>false</available>
<value>false</value>
<available>true</available>
<value>true</value>
</property>
</group>
<group name="Surface">
......@@ -182,6 +182,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -168,6 +168,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -168,6 +168,10 @@
<value>true</value>
<available>true</available>
</property>
<property name="overviewmap">
<value>true</value>
<available>true</available>
</property>
<property name="compass">
<value>true</value>
<available>true</available>
......
......@@ -363,6 +363,11 @@ bool MarbleMap::propertyValue( const QString& name ) const
return value;
}
bool MarbleMap::showOverviewMap() const
{
return propertyValue( "overviewmap" );
}
bool MarbleMap::showScaleBar() const
{
return propertyValue( "scalebar" );
......@@ -866,6 +871,11 @@ void MarbleMap::setPropertyValue( const QString& name, bool value )
d->m_viewParams.setPropertyValue( name, value );
}
void MarbleMap::setShowOverviewMap( bool visible )
{
setPropertyValue( "overviewmap", visible );
}
void MarbleMap::setShowScaleBar( bool visible )
{
setPropertyValue( "scalebar", visible );
......@@ -917,6 +927,8 @@ void MarbleMap::setShowOtherPlaces( bool visible )
void MarbleMap::setShowRelief( bool visible )
{
setPropertyValue( "relief", visible );
// Update texture map during the repaint that follows:
setNeedsUpdate();
}
void MarbleMap::setShowElevationModel( bool visible )
......@@ -929,6 +941,8 @@ void MarbleMap::setShowElevationModel( bool visible )
void MarbleMap::setShowIceLayer( bool visible )
{
setPropertyValue( "ice", visible );
// Update texture map during the repaint that follows:
setNeedsUpdate();
}
void MarbleMap::setShowBorders( bool visible )
......@@ -944,6 +958,8 @@ void MarbleMap::setShowRivers( bool visible )
void MarbleMap::setShowLakes( bool visible )
{
setPropertyValue( "lakes", visible );
// Update texture map during the repaint that follows:
setNeedsUpdate();
}
void MarbleMap::setShowFrameRate( bool visible )
......
......@@ -295,6 +295,12 @@ class MARBLE_EXPORT MarbleMap : public QObject
*/
bool propertyValue( const QString& name) const;
/**
* @brief Return whether the overview map is visible.
* @return The overview map visibility.
*/
bool showOverviewMap() const;
/**
* @brief Return whether the scale bar is visible.
* @return The scale bar visibility.
......@@ -588,6 +594,12 @@ class MARBLE_EXPORT MarbleMap : public QObject
*/
void setPropertyValue( const QString& name, bool value );
/**
* @brief Set whether the overview map overlay is visible
* @param visible visibility of the overview map
*/
void setShowOverviewMap( bool visible );
/**
* @brief Set whether the scale bar overlay is visible
* @param visible visibility of the scale bar
......
......@@ -140,8 +140,6 @@ MarbleModel::MarbleModel( QObject *parent )
d->m_texmapper = 0;
d->m_veccomposer = new VectorComposer();
d->m_placeMarkLayout = 0;
d->m_gridmap = new GridMap();
d->m_texcolorizer = new TextureColorizer( MarbleDirs::path( "seacolors.leg" ),
MarbleDirs::path( "landcolors.leg" ) );
......@@ -154,6 +152,13 @@ MarbleModel::MarbleModel( QObject *parent )
d->m_placemarkmodel = new MarblePlacemarkModel( d->m_placemarkmanager, this );
d->m_placemarkselectionmodel = new QItemSelectionModel( d->m_placemarkmodel );
d->m_placeMarkLayout = new PlaceMarkLayout( this );
connect( d->m_placemarkselectionmodel, SIGNAL( selectionChanged( QItemSelection,
QItemSelection) ),
d->m_placeMarkLayout, SLOT( requestStyleReset() ) );
connect( d->m_placemarkmodel, SIGNAL( modelReset() ),
d->m_placeMarkLayout, SLOT( requestStyleReset() ) );
d->m_placemarkmanager->loadStandardPlaceMarks();
d->m_gpxFileModel = new GpxFileModel( this );
......@@ -351,15 +356,6 @@ void MarbleModel::setMapTheme( GeoSceneDocument* mapTheme,
}
}
if ( d->m_placeMarkLayout == 0) {
d->m_placeMarkLayout = new PlaceMarkLayout( this );
connect( d->m_placemarkselectionmodel, SIGNAL( selectionChanged( QItemSelection,
QItemSelection) ),
d->m_placeMarkLayout, SLOT( requestStyleReset() ) );
connect( d->m_placemarkmodel, SIGNAL( modelReset() ),
d->m_placeMarkLayout, SLOT( requestStyleReset() ) );
}
d->m_placeMarkLayout->requestStyleReset();
// FIXME: To be removed after MapTheme / KML refactoring
......
......@@ -355,6 +355,11 @@ QPixmap MarbleWidget::mapScreenShot()
return QPixmap::grabWidget( this );
}
bool MarbleWidget::showOverviewMap() const
{
return d->m_map->showOverviewMap();
}
bool MarbleWidget::showScaleBar() const
{
return d->m_map->showScaleBar();
......@@ -875,6 +880,13 @@ void MarbleWidget::setPropertyValue( const QString& name, bool value )
repaint();
}
void MarbleWidget::setShowOverviewMap( bool visible )
{
d->m_map->setShowOverviewMap( visible );
repaint();
}
void MarbleWidget::setShowScaleBar( bool visible )
{
d->m_map->setShowScaleBar( visible );
......
......@@ -124,6 +124,7 @@ class MARBLE_EXPORT MarbleWidget : public QWidget
Q_PROPERTY(double longitude READ centerLongitude WRITE setCenterLongitude)
Q_PROPERTY(double latitude READ centerLatitude WRITE setCenterLatitude)
Q_PROPERTY(bool showOverviewMap READ showOverviewMap WRITE setShowOverviewMap)
Q_PROPERTY(bool showScaleBar READ showScaleBar WRITE setShowScaleBar)
Q_PROPERTY(bool showCompass READ showCompass WRITE setShowCompass)
Q_PROPERTY(bool showGrid READ showGrid WRITE setShowGrid)
......@@ -349,6 +350,12 @@ class MARBLE_EXPORT MarbleWidget : public QWidget
*/
QPixmap mapScreenShot();
/**
* @brief Return whether the overview map is visible.
* @return The overview map visibility.
*/
bool showOverviewMap() const;
/**
* @brief Return whether the scale bar is visible.
* @return The scale bar visibility.
......@@ -653,6 +660,12 @@ class MARBLE_EXPORT MarbleWidget : public QWidget
*/
void setPropertyValue( const QString& name, bool value );
/**
* @brief Set whether the overview map overlay is visible
* @param visible visibility of the overview map
*/
void setShowOverviewMap( bool visible );
/**
* @brief Set whether the scale bar overlay is visible
* @param visible visibility of the scale bar
......
......@@ -130,7 +130,7 @@ void VectorComposer::drawTextureMap(ViewParams *viewParams)
viewParams->propertyValue( "waterbodies", showWaterbodies );
viewParams->propertyValue( "lakes", showLakes );
if ( showWaterbodies || showLakes ) {
if ( showWaterbodies && showLakes ) {
// Lakes
m_vectorMap -> setzBoundingBoxLimit( 0.95 );
m_vectorMap -> setzPointLimit( 0.98 );
......@@ -226,7 +226,7 @@ void VectorComposer::paintBaseVectorMap( GeoPainter *painter,
viewParams->propertyValue( "waterbodies", showWaterbodies );
viewParams->propertyValue( "lakes", showLakes );
if ( showWaterbodies || showLakes ) {
if ( showWaterbodies && showLakes ) {
// Lakes
m_vectorMap -> setzBoundingBoxLimit( 0.95 );
m_vectorMap -> setzPointLimit( 0.98 );
......@@ -283,7 +283,7 @@ void VectorComposer::paintVectorMap( GeoPainter *painter,
viewParams->propertyValue( "waterbodies", showWaterbodies );
viewParams->propertyValue( "rivers", showRivers );
if ( showWaterbodies || showRivers ) {
if ( showWaterbodies && showRivers ) {
// Rivers
m_vectorMap -> setzBoundingBoxLimit( -1.0 );
m_vectorMap -> setzPointLimit( -1.0 );
......
......@@ -41,9 +41,11 @@ bool MarbleWidgetPlugin::isInitialized() const
QWidget *MarbleWidgetPlugin::createWidget(QWidget *parent)
{
// Create the Model (Globe) and one view.
//MarbleModel *model = new MarbleModel( parent );
return new MarbleWidget( parent );
MarbleWidget* marbleWidget = new MarbleWidget( parent );
marbleWidget->setMapThemeId("earth/srtm/srtm.dgml");
marbleWidget->setDownloadUrl( "http://download.kde.org/apps/marble/" );
return marbleWidget;
}
QString MarbleWidgetPlugin::name() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment