Skip to content
Permalink
Browse files

Reclassify debug messages while rendering

  • Loading branch information
m-kuhn committed Jul 14, 2016
1 parent b61641d commit 97861cd4d818c72a32fa446396ed2c122465add5
@@ -553,7 +553,7 @@ QgsRectangle QgsCoordinateTransform::transformBoundingBox( const QgsRectangle &r
QVector<double> y( nXPoints * nYPoints );
QVector<double> z( nXPoints * nYPoints );

QgsDebugMsg( "Entering transformBoundingBox..." );
QgsDebugMsgLevel( "Entering transformBoundingBox...", 4 );

// Populate the vectors

@@ -622,11 +622,11 @@ QgsRectangle QgsCoordinateTransform::transformBoundingBox( const QgsRectangle &r
bb_rect.setXMaximum( bb_rect.xMaximum() - 360.0 );
}

QgsDebugMsg( "Projected extent: " + bb_rect.toString() );
QgsDebugMsgLevel( "Projected extent: " + bb_rect.toString(), 4 );

if ( bb_rect.isEmpty() )
{
QgsDebugMsg( "Original extent: " + rect.toString() );
QgsDebugMsgLevel( "Original extent: " + rect.toString(), 4 );
}

return bb_rect;
@@ -90,12 +90,12 @@ bool QgsMapRendererJob::reprojectToLayerExtent( const QgsMapLayer *ml, const Qgs
QgsRectangle extent1 = ct->transformBoundingBox( extent, QgsCoordinateTransform::ReverseTransform );
QgsRectangle extent2 = ct->transformBoundingBox( extent1, QgsCoordinateTransform::ForwardTransform );

QgsDebugMsg( QString( "\n0:%1 %2x%3\n1:%4\n2:%5 %6x%7 (w:%8 h:%9)" )
.arg( extent.toString() ).arg( extent.width() ).arg( extent.height() )
.arg( extent1.toString(), extent2.toString() ).arg( extent2.width() ).arg( extent2.height() )
.arg( fabs( 1.0 - extent2.width() / extent.width() ) )
.arg( fabs( 1.0 - extent2.height() / extent.height() ) )
);
QgsDebugMsgLevel( QString( "\n0:%1 %2x%3\n1:%4\n2:%5 %6x%7 (w:%8 h:%9)" )
.arg( extent.toString() ).arg( extent.width() ).arg( extent.height() )
.arg( extent1.toString(), extent2.toString() ).arg( extent2.width() ).arg( extent2.height() )
.arg( fabs( 1.0 - extent2.width() / extent.width() ) )
.arg( fabs( 1.0 - extent2.height() / extent.height() ) )
, 3 );

if ( fabs( 1.0 - extent2.width() / extent.width() ) < 0.5 &&
fabs( 1.0 - extent2.height() / extent.height() ) < 0.5 )
@@ -189,7 +189,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin
{
QString layerId = li.previous();

QgsDebugMsg( "Rendering at layer item " + layerId );
QgsDebugMsgLevel( "Rendering at layer item " + layerId, 2 );

QgsMapLayer *ml = QgsMapLayerRegistry::instance()->mapLayer( layerId );

@@ -199,17 +199,17 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin
continue;
}

QgsDebugMsg( QString( "layer %1: minscale:%2 maxscale:%3 scaledepvis:%4 blendmode:%5" )
.arg( ml->name() )
.arg( ml->minimumScale() )
.arg( ml->maximumScale() )
.arg( ml->hasScaleBasedVisibility() )
.arg( ml->blendMode() )
);
QgsDebugMsgLevel( QString( "layer %1: minscale:%2 maxscale:%3 scaledepvis:%4 blendmode:%5" )
.arg( ml->name() )
.arg( ml->minimumScale() )
.arg( ml->maximumScale() )
.arg( ml->hasScaleBasedVisibility() )
.arg( ml->blendMode() )
, 3 );

if ( !ml->isInScaleRange( mSettings.scale() ) ) //|| mOverview )
{
QgsDebugMsg( "Layer not rendered because it is not within the defined visibility scale range" );
QgsDebugMsgLevel( "Layer not rendered because it is not within the defined visibility scale range", 3 );
continue;
}

@@ -223,7 +223,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin
{
reprojectToLayerExtent( ml, ct, r1, r2 );
}
QgsDebugMsg( "extent: " + r1.toString() );
QgsDebugMsgLevel( "extent: " + r1.toString(), 3 );
if ( !r1.isFinite() || !r2.isFinite() )
{
mErrors.append( Error( layerId, tr( "There was a problem transforming the layer's extent. Layer skipped." ) ) );
@@ -237,7 +237,7 @@ void QgsMapRendererParallelJob::renderLayerStatic( LayerRenderJob& job )

QTime t;
t.start();
QgsDebugMsg( QString( "job %1 start (layer %2)" ).arg( reinterpret_cast< ulong >( &job ), 0, 16 ).arg( job.layerId ) );
QgsDebugMsgLevel( QString( "job %1 start (layer %2)" ).arg( reinterpret_cast< ulong >( &job ), 0, 16 ).arg( job.layerId ), 2 );

try
{
@@ -259,7 +259,7 @@ void QgsMapRendererParallelJob::renderLayerStatic( LayerRenderJob& job )
}

job.renderingTime = t.elapsed();
QgsDebugMsg( QString( "job %1 end [%2 ms] (layer %3)" ).arg( reinterpret_cast< ulong >( &job ), 0, 16 ).arg( job.renderingTime ).arg( job.layerId ) );
QgsDebugMsgLevel( QString( "job %1 end [%2 ms] (layer %3)" ).arg( reinterpret_cast< ulong >( &job ), 0, 16 ).arg( job.renderingTime ).arg( job.layerId ), 2 );
}


@@ -37,7 +37,7 @@ double QgsScaleCalculator::dpi()

void QgsScaleCalculator::setMapUnits( QGis::UnitType mapUnits )
{
QgsDebugMsg( QString( "Map units set to %1" ).arg( QString::number( mapUnits ) ) );
QgsDebugMsgLevel( QString( "Map units set to %1" ).arg( QString::number( mapUnits ) ), 3 );
mMapUnits = mapUnits;
}

@@ -92,7 +92,7 @@ QgsVectorLayerRenderer::QgsVectorLayerRenderer( QgsVectorLayer* layer, QgsRender
if ( !mRendererV2 )
return;

QgsDebugMsg( "rendering v2:\n " + mRendererV2->dump() );
QgsDebugMsgLevel( "rendering v2:\n " + mRendererV2->dump(), 2 );

if ( mDrawVertexMarkers )
{
@@ -191,8 +191,8 @@ bool QgsVectorLayerRenderer::render()
QgsRectangle sourceRect = QgsRectangle( center.x(), center.y(), center.x() + rectSize, center.y() + rectSize );
QgsRectangle targetRect = ct->transform( sourceRect );

QgsDebugMsg( QString( "Simplify - SourceTransformRect=%1" ).arg( sourceRect.toString( 16 ) ) );
QgsDebugMsg( QString( "Simplify - TargetTransformRect=%1" ).arg( targetRect.toString( 16 ) ) );
QgsDebugMsgLevel( QString( "Simplify - SourceTransformRect=%1" ).arg( sourceRect.toString( 16 ) ), 4 );
QgsDebugMsgLevel( QString( "Simplify - TargetTransformRect=%1" ).arg( targetRect.toString( 16 ) ), 4 );

if ( !sourceRect.isEmpty() && sourceRect.isFinite() && !targetRect.isEmpty() && targetRect.isFinite() )
{
@@ -204,8 +204,8 @@ bool QgsVectorLayerRenderer::render()
double sourceHypothenuse = sqrt( minimumSrcPoint.sqrDist( maximumSrcPoint ) );
double targetHypothenuse = sqrt( minimumDstPoint.sqrDist( maximumDstPoint ) );

QgsDebugMsg( QString( "Simplify - SourceHypothenuse=%1" ).arg( sourceHypothenuse ) );
QgsDebugMsg( QString( "Simplify - TargetHypothenuse=%1" ).arg( targetHypothenuse ) );
QgsDebugMsgLevel( QString( "Simplify - SourceHypothenuse=%1" ).arg( sourceHypothenuse ), 4 );
QgsDebugMsgLevel( QString( "Simplify - TargetHypothenuse=%1" ).arg( targetHypothenuse ), 4 );

if ( !qgsDoubleNear( targetHypothenuse, 0.0 ) )
map2pixelTol *= ( sourceHypothenuse / targetHypothenuse );
@@ -893,7 +893,7 @@ void QgsRuleBasedRendererV2::startRender( QgsRenderContext& context, const QgsFi
{
zLevelsToNormLevels[zLevel] = ++maxNormLevel;
mRenderQueue.append( RenderLevel( zLevel ) );
QgsDebugMsg( QString( "zLevel %1 -> %2" ).arg( zLevel ).arg( maxNormLevel ) );
QgsDebugMsgLevel( QString( "zLevel %1 -> %2" ).arg( zLevel ).arg( maxNormLevel ), 4 );
}

mRootRule->setNormZLevels( zLevelsToNormLevels );
@@ -701,7 +701,7 @@ void QgsMapCanvas::refreshMap()
{
Q_ASSERT( mRefreshScheduled );

QgsDebugMsg( "CANVAS refresh!" );
QgsDebugMsgLevel( "CANVAS refresh!", 3 );

stopRendering(); // if any...

0 comments on commit 97861cd

Please sign in to comment.
You can’t perform that action at this time.