Skip to content

Commit

Permalink
Reclassify debug messages while rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 14, 2016
1 parent b61641d commit 97861cd
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions src/core/qgscoordinatetransform.cpp
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down
32 changes: 16 additions & 16 deletions src/core/qgsmaprendererjob.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 );

Expand All @@ -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;
}

Expand All @@ -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." ) ) );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaprendererparalleljob.cpp
Expand Up @@ -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
{
Expand All @@ -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 );
}


Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsscalecalculator.cpp
Expand Up @@ -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;
}

Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsvectorlayerrenderer.cpp
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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() )
{
Expand All @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -701,7 +701,7 @@ void QgsMapCanvas::refreshMap()
{
Q_ASSERT( mRefreshScheduled );

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

stopRendering(); // if any...

Expand Down

0 comments on commit 97861cd

Please sign in to comment.