Skip to content

Commit

Permalink
- Better colors
Browse files Browse the repository at this point in the history
- Better boundaries


svn path=/trunk/KDE/kdeedu/marble/; revision=849673
  • Loading branch information
Torsten Rahn committed Aug 19, 2008
1 parent d781f54 commit e0be931
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 27 deletions.
22 changes: 11 additions & 11 deletions data/landcolors.leg
@@ -1,11 +1,11 @@
#c39d55=1.00
#c39d55=0.95
#dcbd80=0.90
#f0da98=0.83
#f1e7ad=0.77
#d7d399=0.70
#bcc48a=0.59
#98b47a=0.52
#81a96d=0.45
#689961=0.38
#689961=0.00
#f9f6ef=1.00
#efe9dd=0.95
#e0d1b5=0.90
#bd974f=0.83
#d6b678=0.77
#e3dc9d=0.70
#cecf91=0.59
#a9ba7e=0.52
#84ab68=0.45
#669b5f=0.38
#669b5f=0.00
18 changes: 9 additions & 9 deletions data/maps/earth/srtm/srtm.dgml
Expand Up @@ -263,39 +263,39 @@
<heading>Elevation</heading>

<item name="topography7000">
<icon color="#c39d55"/>
<icon color="#efe9dd"/>
<text>7000 m</text>
</item>
<item name="topography5000">
<icon color="#dcbd80"/>
<icon color="#e0d1b5"/>
<text>5000 m</text>
</item>
<item name="topography3500">
<icon color="#f0da96"/>
<icon color="#bd974f"/>
<text>3500 m</text>
</item>
<item name="topography2000">
<icon color="#f1e7ad"/>
<icon color="#d6b678"/>
<text>2000 m</text>
</item>
<item name="topography1000">
<icon color="#d7d399"/>
<icon color="#e3dc9d"/>
<text>1000 m</text>
</item>
<item name="topography500">
<icon color="#bcc48a"/>
<icon color="#cecf91"/>
<text>500 m</text>
</item>
<item name="topography200">
<icon color="#98b47a"/>
<icon color="#a9ba7e"/>
<text>200 m</text>
</item>
<item name="topography50">
<icon color="#81a96d"/>
<icon color="#84ab68"/>
<text>50 m</text>
</item>
<item name="topography0">
<icon color="#689961"/>
<icon color="#669b5f"/>
<text>0 m</text>
</item>
<item name="topography-0">
Expand Down
72 changes: 65 additions & 7 deletions src/lib/VectorComposer.cpp
Expand Up @@ -254,7 +254,7 @@ void VectorComposer::paintVectorMap( GeoPainter *painter,
if ( viewParams->mapQuality() == Marble::High
|| viewParams->mapQuality() == Marble::Print )
{
antialiased = true;
antialiased = true;
}

// Coastlines
Expand Down Expand Up @@ -315,11 +315,70 @@ void VectorComposer::paintVectorMap( GeoPainter *painter,
m_vectorMap -> setzPointLimit( -1.0 );
m_vectorMap -> createFromPntMap( m_countries, viewParams->viewport() );

m_vectorMap -> setPen( m_countryPen );
m_vectorMap -> setBrush( m_countryBrush );
m_vectorMap -> paintMap( painter, antialiased );

// US-States
// Fancy Boundaries Hack:
// FIXME: Find a clean solution that allows for all the
// tuning necessary for the different quality levels.

int radius = viewParams->radius();
qreal penWidth = (double)(radius) / 400.0;
if ( radius < 400.0 ) penWidth = 1.0;
if ( radius > 800.0 ) penWidth = 1.75;
if ( showCoastlines ) penWidth = 1.0;

QPen countryPen( m_countryPen);
countryPen.setWidthF( penWidth );
QColor penColor = m_countryPen.color();

QPen borderDashPen( Qt::black );
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 );

// Only paint fancy style if the coast line doesn't get painted as well
// (as it looks a bit awkward otherwise)

if ( !showCoastlines ) {
borderDashPen.setDashPattern( QVector<qreal>() << 1 << 5 );
borderDashPen.setWidthF( penWidth * 0.5 );
m_vectorMap -> setPen( borderDashPen );
m_vectorMap -> paintMap( painter, antialiased );
}
}
if ( viewParams->mapQuality() == Marble::Normal ) {

// Only paint fancy style if the coast line doesn't get painted as well
// (as it looks a bit awkward otherwise)

if ( !showCoastlines ) {
countryPen.setColor( penColor.darker(110) );
}

m_vectorMap -> setPen( countryPen );
m_vectorMap -> paintMap( painter, antialiased );

if ( !showCoastlines ) {
borderDashPen.setStyle( Qt::DotLine );
m_vectorMap -> setPen( borderDashPen );
m_vectorMap -> paintMap( painter, antialiased );
}
}
if ( viewParams->mapQuality() == Marble::Outline
|| viewParams->mapQuality() == Marble::Low ) {

if ( !showCoastlines ) {
countryPen.setWidthF( 1.0 );
countryPen.setColor( penColor.darker(115) );
}
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() );
Expand All @@ -336,7 +395,6 @@ void VectorComposer::paintVectorMap( GeoPainter *painter,
m_vectorMap -> setPen( m_dateLinePen );
m_vectorMap -> setBrush( m_dateLineBrush );
m_vectorMap -> paintMap( painter, antialiased );

}

// qDebug() << "M_VectorMap calculated nodes: " << m_vectorMap->nodeCount();
Expand Down

0 comments on commit e0be931

Please sign in to comment.