Skip to content

Commit

Permalink
Enable disabled simplification code after merge MTR (1-2)
Browse files Browse the repository at this point in the history
Disable simplification of geometries in composer by default
  • Loading branch information
ahuarte47 committed May 27, 2014
1 parent 20015e7 commit 4ab24a4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion python/core/qgsmapsettings.sip
Expand Up @@ -45,7 +45,8 @@ public:
DrawEditingInfo = 0x02,
ForceVectorOutput = 0x04,
UseAdvancedEffects = 0x08,
DrawLabeling = 0x10
DrawLabeling = 0x10,
UseRenderingOptimization = 0x20
// TODO: ignore scale-based visibiity (overview)
};
//Q_DECLARE_FLAGS(Flags, Flag)
Expand Down
6 changes: 3 additions & 3 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -201,13 +201,13 @@ void QgsComposerMap::draw( QPainter *painter, const QgsRectangle& extent, const
jobMapSettings.setDestinationCrs( ms.destinationCrs() );
jobMapSettings.setCrsTransformEnabled( ms.hasCrsTransformEnabled() );
jobMapSettings.setFlags( ms.flags() );
/* TODO[MD] fix after merge

if ( mComposition->plotStyle() == QgsComposition::Print ||
mComposition->plotStyle() == QgsComposition::Postscript )
{
//if outputing composer, disable optimisations like layer simplification
theRendererContext->setUseRenderingOptimization( false );
}*/
jobMapSettings.setFlag( QgsMapSettings::UseRenderingOptimization, false );
}

//update $map variable. Use QgsComposerItem's id since that is user-definable
QgsExpression::setSpecialColumn( "$map", QgsComposerItem::id() );
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsmapsettings.h
Expand Up @@ -60,7 +60,8 @@ class CORE_EXPORT QgsMapSettings
DrawEditingInfo = 0x02,
ForceVectorOutput = 0x04,
UseAdvancedEffects = 0x08,
DrawLabeling = 0x10
DrawLabeling = 0x10,
UseRenderingOptimization = 0x20,
// TODO: ignore scale-based visibility (overview)
};
Q_DECLARE_FLAGS( Flags, Flag )
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsrendercontext.cpp
Expand Up @@ -48,6 +48,7 @@ QgsRenderContext QgsRenderContext::fromMapSettings( const QgsMapSettings& mapSet
ctx.setDrawEditingInformation( mapSettings.testFlag( QgsMapSettings::DrawEditingInfo ) );
ctx.setForceVectorOutput( mapSettings.testFlag( QgsMapSettings::ForceVectorOutput ) );
ctx.setUseAdvancedEffects( mapSettings.testFlag( QgsMapSettings::UseAdvancedEffects ) );
ctx.setUseRenderingOptimization( mapSettings.testFlag( QgsMapSettings::UseRenderingOptimization ) );
ctx.setCoordinateTransform( 0 );
ctx.setSelectionColor( mapSettings.selectionColor() );
ctx.setRasterScaleFactor( 1.0 );
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -206,6 +206,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
this, SLOT( writeProject( QDomDocument & ) ) );

mSettings.setFlag( QgsMapSettings::DrawEditingInfo );
mSettings.setFlag( QgsMapSettings::UseRenderingOptimization );

// class that will sync most of the changes between canvas and (legacy) map renderer
// it is parented to map canvas, will be deleted automatically
Expand Down

0 comments on commit 4ab24a4

Please sign in to comment.