mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Force recollection of hist when checkboxes state is altered
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@2985 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
06946753b2
commit
15af1d01f2
@ -3607,7 +3607,7 @@ void QgsRasterLayer::identify(QgsRect * r)
|
||||
} // void QgsRasterLayer::identify(QgsRect * r)
|
||||
|
||||
|
||||
void QgsRasterLayer::populateHistogram(int theBandNoInt, int theBinCountInt,bool theIgnoreOutOfRangeFlag,bool theThoroughBandScanFlag)
|
||||
void QgsRasterLayer::populateHistogram(int theBandNoInt, int theBinCountInt,bool theIgnoreOutOfRangeFlag,bool theHistogramEstimatedFlag)
|
||||
{
|
||||
|
||||
GDALRasterBand *myGdalBand = gdalDataset->GetRasterBand(theBandNoInt);
|
||||
@ -3617,9 +3617,13 @@ void QgsRasterLayer::populateHistogram(int theBandNoInt, int theBinCountInt,bool
|
||||
//vector is not equal to the number of bins
|
||||
//i.e if the histogram has never previously been generated or the user has
|
||||
//selected a new number of bins.
|
||||
if (myRasterBandStats.histogramVector->size()!=theBinCountInt)
|
||||
if (myRasterBandStats.histogramVector->size()!=theBinCountInt ||
|
||||
theIgnoreOutOfRangeFlag != myRasterBandStats.histogramOutOfRangeFlag ||
|
||||
theHistogramEstimatedFlag != myRasterBandStats.histogramEstimatedFlag)
|
||||
{
|
||||
myRasterBandStats.histogramVector->clear();
|
||||
myRasterBandStats.histogramEstimatedFlag=theHistogramEstimatedFlag;
|
||||
myRasterBandStats.histogramOutOfRangeFlag=theIgnoreOutOfRangeFlag;
|
||||
int myHistogramArray[theBinCountInt];
|
||||
|
||||
|
||||
@ -3635,7 +3639,7 @@ void QgsRasterLayer::populateHistogram(int theBandNoInt, int theBinCountInt,bool
|
||||
* void * pProgressData
|
||||
* )
|
||||
*/
|
||||
myGdalBand->GetHistogram( -0.5, theBinCountInt-.5, theBinCountInt, myHistogramArray ,theIgnoreOutOfRangeFlag ,theThoroughBandScanFlag , GDALDummyProgress, NULL );
|
||||
myGdalBand->GetHistogram( -0.5, theBinCountInt-.5, theBinCountInt, myHistogramArray ,theIgnoreOutOfRangeFlag ,theHistogramEstimatedFlag , GDALDummyProgress, NULL );
|
||||
|
||||
for (int myBin = 0; myBin <theBinCountInt; myBin++)
|
||||
{
|
||||
|
@ -224,6 +224,10 @@ struct RasterBandStats
|
||||
/** \brief Store the histogram for a given layer */
|
||||
typedef QValueVector<int> HistogramVector;
|
||||
HistogramVector * histogramVector;
|
||||
/** \brief whteher histogram values are estimated or completely calculated */
|
||||
bool histogramEstimatedFlag;
|
||||
/** whehter histogram compuation should include out of range values */
|
||||
bool histogramOutOfRangeFlag;
|
||||
/** Color table */
|
||||
QgsColorTable colorTable;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user