Skip to content

Commit 9b5849d

Browse files
author
timlinux
committed
Remove debug overlay from api and code base
git-svn-id: http://svn.osgeo.org/qgis/trunk@9309 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f15c010 commit 9b5849d

File tree

3 files changed

+11
-89
lines changed

3 files changed

+11
-89
lines changed

src/app/qgsrasterlayerproperties.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,6 @@ void QgsRasterLayerProperties::apply()
14371437
*/
14381438
mRasterLayer->setLayerName( leDisplayName->text() );
14391439

1440-
mRasterLayer->setShowDebugOverlayFlag( true );
14411440

14421441
// set up the scale based layer visibility stuff....
14431442
mRasterLayer->setScaleBasedVisibility( chkUseScaleDependentRendering->isChecked() );

src/core/raster/qgsrasterlayer.cpp

+11-71
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ QgsRasterLayer::QgsRasterLayer(
310310
TRSTRING_NOT_SET( tr( "Not Set" ) ),
311311
mRasterXDim( std::numeric_limits<int>::max() ),
312312
mRasterYDim( std::numeric_limits<int>::max() ),
313-
mDebugOverlayFlag( false ),
314313
mInvertPixelsFlag( false ),
315314
mStandardDeviations( 0 ),
316315
mDataProvider( 0 )
@@ -1325,12 +1324,6 @@ void QgsRasterLayer::draw( QPainter * theQPainter,
13251324

13261325
}
13271326

1328-
//see if debug info is wanted
1329-
if ( mDebugOverlayFlag )
1330-
{
1331-
showDebugOverlay( theQPainter, theRasterViewPort );
1332-
};
1333-
13341327
} //end of draw method
13351328

13361329

@@ -2035,37 +2028,6 @@ void QgsRasterLayer::filterLayer( QImage * theQImage )
20352028
//return;
20362029
}
20372030

2038-
/**
2039-
Print some debug info to the qpainter
2040-
*/
2041-
2042-
void QgsRasterLayer::showDebugOverlay( QPainter * theQPainter, QgsRasterViewPort * theRasterViewPort )
2043-
{
2044-
2045-
2046-
QFont myQFont( "arial", 10, QFont::Bold );
2047-
theQPainter->setFont( myQFont );
2048-
theQPainter->setPen( Qt::black );
2049-
QBrush myQBrush( qRgba( 128, 128, 164, 50 ), Qt::Dense6Pattern ); //semi transparent
2050-
theQPainter->setBrush( myQBrush ); // set the yellow brush
2051-
theQPainter->drawRect( 5, 5, theQPainter->window().width() - 10, 60 );
2052-
theQPainter->setBrush( Qt::NoBrush ); // do not fill
2053-
2054-
theQPainter->drawText( 10, 20, "QPainter: "
2055-
+ QString::number( theQPainter->window().width() ) + " x " + QString::number( theQPainter->window().height() ) );
2056-
theQPainter->drawText( 10, 32, tr( "Raster Extent: " )
2057-
+ QString::number( theRasterViewPort->drawableAreaXDim )
2058-
+ "," + QString::number( theRasterViewPort->drawableAreaYDim ) );
2059-
theQPainter->drawText( 10, 44, tr( "Clipped area: " )
2060-
+ QString::number( theRasterViewPort->clippedXMin )
2061-
+ "," + QString::number( theRasterViewPort->clippedYMin )
2062-
+ " - " + QString::number( theRasterViewPort->clippedXMax )
2063-
+ "," + QString::number( theRasterViewPort->clippedYMin ) );
2064-
2065-
return;
2066-
2067-
2068-
} //end of main draw method
20692031

20702032
const QgsRasterBandStats QgsRasterLayer::getRasterBandStats( QString const & theBandName )
20712033
{
@@ -3834,7 +3796,6 @@ double QgsRasterLayer::readValue( void *data, GDALDataType type, int index )
38343796
<zorder>0</zorder>
38353797
<transparencyLevelInt>255</transparencyLevelInt>
38363798
<rasterproperties>
3837-
<mDebugOverlayFlag boolean="false"/>
38383799
<drawingStyle>SINGLE_BAND_GRAY</drawingStyle>
38393800
<mInvertPixelsFlag boolean="false"/>
38403801
<mStandardDeviations>0</mStandardDeviations>
@@ -3912,14 +3873,8 @@ bool QgsRasterLayer::readXml( QDomNode & layer_node )
39123873
}
39133874

39143875
QDomNode mnl = layer_node.namedItem( "rasterproperties" );
3915-
3916-
QDomNode snode = mnl.namedItem( "mDebugOverlayFlag" );
3876+
QDomNode snode = mnl.namedItem( "drawingStyle" );
39173877
QDomElement myElement = snode.toElement();
3918-
QVariant myQVariant = ( QVariant ) myElement.attribute( "boolean" );
3919-
setShowDebugOverlayFlag( myQVariant.toBool() );
3920-
3921-
snode = mnl.namedItem( "drawingStyle" );
3922-
myElement = snode.toElement();
39233878
setDrawingStyle( myElement.text() );
39243879

39253880
snode = mnl.namedItem( "mColorShadingAlgorithm" );
@@ -3928,8 +3883,8 @@ bool QgsRasterLayer::readXml( QDomNode & layer_node )
39283883

39293884
snode = mnl.namedItem( "mInvertPixelsFlag" );
39303885
myElement = snode.toElement();
3931-
myQVariant = ( QVariant ) myElement.attribute( "boolean" );
3932-
setInvertHistogramFlag( myQVariant.toBool() );
3886+
QVariant myVariant = ( QVariant ) myElement.attribute( "boolean" );
3887+
setInvertHistogramFlag( myVariant.toBool() );
39333888

39343889
snode = mnl.namedItem( "mRedBandName" );
39353890
myElement = snode.toElement();
@@ -3954,23 +3909,23 @@ bool QgsRasterLayer::readXml( QDomNode & layer_node )
39543909

39553910
snode = mnl.namedItem( "mUserDefinedRGBMinMaxFlag" );
39563911
myElement = snode.toElement();
3957-
myQVariant = ( QVariant ) myElement.attribute( "boolean" );
3958-
setUserDefinedRGBMinMax( myQVariant.toBool() );
3912+
myVariant = ( QVariant ) myElement.attribute( "boolean" );
3913+
setUserDefinedRGBMinMax( myVariant.toBool() );
39593914

39603915
snode = mnl.namedItem( "mRGBActualMinimumMaximum" );
39613916
myElement = snode.toElement();
3962-
myQVariant = ( QVariant ) myElement.attribute( "boolean" );
3963-
setActualRGBMinMaxFlag( myQVariant.toBool() );
3917+
myVariant = ( QVariant ) myElement.attribute( "boolean" );
3918+
setActualRGBMinMaxFlag( myVariant.toBool() );
39643919

39653920
snode = mnl.namedItem( "mUserDefinedGrayMinMaxFlag" );
39663921
myElement = snode.toElement();
3967-
myQVariant = ( QVariant ) myElement.attribute( "boolean" );
3968-
setUserDefinedGrayMinMax( myQVariant.toBool() );
3922+
myVariant = ( QVariant ) myElement.attribute( "boolean" );
3923+
setUserDefinedGrayMinMax( myVariant.toBool() );
39693924

39703925
snode = mnl.namedItem( "mGrayActualMinimumMaximum" );
39713926
myElement = snode.toElement();
3972-
myQVariant = ( QVariant ) myElement.attribute( "boolean" );
3973-
setActualGrayMinMaxFlag( myQVariant.toBool() );
3927+
myVariant = ( QVariant ) myElement.attribute( "boolean" );
3928+
setActualGrayMinMaxFlag( myVariant.toBool() );
39743929

39753930
snode = mnl.namedItem( "mContrastEnhancementAlgorithm" );
39763931
myElement = snode.toElement();
@@ -4172,20 +4127,6 @@ bool QgsRasterLayer::writeXml( QDomNode & layer_node,
41724127

41734128
}
41744129

4175-
// <mDebugOverlayFlag>
4176-
QDomElement mDebugOverlayFlagElement = document.createElement( "mDebugOverlayFlag" );
4177-
4178-
if ( getShowDebugOverlayFlag() )
4179-
{
4180-
mDebugOverlayFlagElement.setAttribute( "boolean", "true" );
4181-
}
4182-
else
4183-
{
4184-
mDebugOverlayFlagElement.setAttribute( "boolean", "false" );
4185-
}
4186-
4187-
rasterPropertiesElement.appendChild( mDebugOverlayFlagElement );
4188-
41894130
// <drawingStyle>
41904131
QDomElement drawStyleElement = document.createElement( "drawingStyle" );
41914132
QDomText drawStyleText = document.createTextNode( getDrawingStyleAsQString() );
@@ -4610,7 +4551,6 @@ QgsRasterLayer::QgsRasterLayer( int dummy,
46104551
: QgsMapLayer( RASTER, baseName, rasterLayerPath ),
46114552
mRasterXDim( std::numeric_limits<int>::max() ),
46124553
mRasterYDim( std::numeric_limits<int>::max() ),
4613-
mDebugOverlayFlag( false ),
46144554
mInvertPixelsFlag( false ),
46154555
mStandardDeviations( 0 ),
46164556
mProviderKey( providerKey ),

src/core/raster/qgsrasterlayer.h

-17
Original file line numberDiff line numberDiff line change
@@ -429,19 +429,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
429429
}
430430
/** \brief Mutator for gray band name mapping. */
431431
void setGrayBandName( const QString & theBandName );
432-
//
433-
// Accessor and mutator for mDebugOverlayFlag
434-
//
435-
/** \brief Accessor for a flag that determines whether to show some debug info on the image. */
436-
bool getShowDebugOverlayFlag()
437-
{
438-
return mDebugOverlayFlag;
439-
}
440-
/** \brief Mutator for a flag that determines whether to show some debug info on the image. */
441-
void setShowDebugOverlayFlag( bool theFlag )
442-
{
443-
mDebugOverlayFlag = theFlag;
444-
}
445432

446433
// Accessor and mutator for minimum maximum values
447434
//TODO: Move these out of the header file...
@@ -912,8 +899,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
912899
//
913900
// Private methods
914901
//
915-
/** \brief Paint debug information onto the output image. */
916-
void showDebugOverlay( QPainter * theQPainter, QgsRasterViewPort * theRasterViewPort );
917902

918903
//
919904
// Grayscale Imagery
@@ -1033,8 +1018,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
10331018
double mNoDataValue;
10341019
/** \brief Flag indicating if the nodatavalue is valid*/
10351020
bool mValidNoDataValue;
1036-
/** \brief Flag to indicate whether debug info overlay should be rendered onto the raster. */
1037-
bool mDebugOverlayFlag;
10381021
/** \brief Pointer to the gdaldataset. */
10391022
GDALDatasetH mGdalBaseDataset;
10401023
/** \brief Pointer to the gdaldataset (possibly warped vrt). */

0 commit comments

Comments
 (0)