Skip to content
Permalink
Browse files
Enable disabled simplification code after merge MTR (1-2)
Disable simplification of geometries in composer by default
  • Loading branch information
ahuarte47 committed May 27, 2014
1 parent 20015e7 commit 4ab24a4f404f44e1ba43af52e2d0ba79e0f0f000
Showing with 9 additions and 5 deletions.
  1. +2 −1 python/core/qgsmapsettings.sip
  2. +3 −3 src/core/composer/qgscomposermap.cpp
  3. +2 −1 src/core/qgsmapsettings.h
  4. +1 −0 src/core/qgsrendercontext.cpp
  5. +1 −0 src/gui/qgsmapcanvas.cpp
@@ -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)
@@ -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() );
@@ -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 )
@@ -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 );
@@ -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

0 comments on commit 4ab24a4

Please sign in to comment.