@@ -180,16 +180,10 @@ void QgsMapRenderer::adjustExtentToSize()
180
180
dymax = mExtent .yMaximum () + whitespace;
181
181
}
182
182
183
- #ifdef QGISDEBUG
184
- QString myMessage = " +-------------------MapRenderer--------------------------------+\n " ;
185
- myMessage += QString ( " Map units per pixel (x,y) : %1, %2\n " ).arg ( mapUnitsPerPixelX ).arg ( mapUnitsPerPixelY );
186
- myMessage += QString ( " Pixmap dimensions (x,y) : %1, %2\n " ).arg ( myWidth ).arg ( myHeight );
187
- myMessage += QString ( " Extent dimensions (x,y) : %1, %2\n " ).arg ( mExtent .width () ).arg ( mExtent .height () );
188
- myMessage += mExtent .toString ();
189
- std::cout << myMessage.toLocal8Bit ().constData () << std::endl; // OK
190
-
191
- #endif
192
-
183
+ QgsDebugMsg ( QString (" Map units per pixel (x,y) : %1, %2\n " ).arg ( mapUnitsPerPixelX ).arg ( mapUnitsPerPixelY ) );
184
+ QgsDebugMsg ( QString (" Pixmap dimensions (x,y) : %1, %2\n " ).arg ( myWidth ).arg ( myHeight ) );
185
+ QgsDebugMsg ( QString (" Extent dimensions (x,y) : %1, %2\n " ).arg ( mExtent .width () ).arg ( mExtent .height () ) );
186
+ QgsDebugMsg ( mExtent .toString () );
193
187
194
188
// update extent
195
189
mExtent .setXMinimum ( dxmin );
@@ -200,9 +194,7 @@ void QgsMapRenderer::adjustExtentToSize()
200
194
// update the scale
201
195
updateScale ();
202
196
203
- #ifdef QGISDEBUG
204
- QgsLogger::debug ( " Scale (assuming meters as map units) = 1" , mScale , 1 , __FILE__, __FUNCTION__, __LINE__ );
205
- #endif
197
+ QgsDebugMsg ( QString (" Scale (assuming meters as map units) = 1:%1" ).arg ( mScale ) );
206
198
207
199
newCoordXForm.setParameters ( mMapUnitsPerPixel , dxmin, dymin, myHeight );
208
200
mRenderContext .setMapToPixel ( newCoordXForm );
@@ -221,7 +213,7 @@ void QgsMapRenderer::render( QPainter* painter )
221
213
222
214
if ( mExtent .isEmpty () )
223
215
{
224
- QgsLogger::debug ( " empty extent... not rendering" );
216
+ QgsDebugMsg ( " empty extent... not rendering" );
225
217
return ;
226
218
}
227
219
@@ -343,7 +335,7 @@ void QgsMapRenderer::render( QPainter* painter )
343
335
344
336
if ( !ml )
345
337
{
346
- QgsLogger::warning ( " Layer not found in registry!" );
338
+ QgsDebugMsg ( " Layer not found in registry!" );
347
339
continue ;
348
340
}
349
341
@@ -472,8 +464,9 @@ void QgsMapRenderer::render( QPainter* painter )
472
464
}
473
465
else
474
466
{
475
- QgsDebugMsg ( " \n\n\n Layer rendered without issues\n\n\n " );
467
+ QgsDebugMsg ( " Layer rendered without issues" );
476
468
}
469
+
477
470
if ( split )
478
471
{
479
472
mRenderContext .setExtent ( r2 );
@@ -708,7 +701,7 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRectangle& extent
708
701
catch ( QgsCsException &cse )
709
702
{
710
703
Q_UNUSED ( cse );
711
- QgsLogger::warning ( " Transform error caught in " + QString ( __FILE__ ) + " , line " + QString::number ( __LINE__ ) );
704
+ QgsDebugMsg ( " Transform error caught" );
712
705
extent = QgsRectangle ( -DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX );
713
706
r2 = QgsRectangle ( -DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX );
714
707
}
@@ -752,7 +745,7 @@ QgsPoint QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
752
745
catch ( QgsCsException &cse )
753
746
{
754
747
Q_UNUSED ( cse );
755
- QgsDebugMsg ( QString ( " Transform error caught:%s " ).arg ( cse.what () ) );
748
+ QgsDebugMsg ( QString ( " Transform error caught: %1 " ).arg ( cse.what () ) );
756
749
}
757
750
}
758
751
else
@@ -773,7 +766,7 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
773
766
}
774
767
catch ( QgsCsException &cse )
775
768
{
776
- QgsDebugMsg ( QString ( " Transform error caught: %s " ).arg ( cse.what () ) );
769
+ QgsDebugMsg ( QString ( " Transform error caught: %1 " ).arg ( cse.what () ) );
777
770
throw cse; // let client classes know there was a transformation error
778
771
}
779
772
}
@@ -820,7 +813,7 @@ void QgsMapRenderer::updateFullExtent()
820
813
QgsMapLayer * lyr = registry->mapLayer ( *it );
821
814
if ( lyr == NULL )
822
815
{
823
- QgsLogger::warning ( " WARNING: layer '" + ( *it ) + " ' not found in map layer registry!" );
816
+ QgsDebugMsg ( QString ( " WARNING: layer '%1 ' not found in map layer registry!" ). arg ( *it ) );
824
817
}
825
818
else
826
819
{
0 commit comments