Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:qgis/Quantum-GIS

  • Loading branch information
timlinux committed Sep 18, 2012
2 parents 117e6f9 + 9c6ebdd commit 78cb4e01a6e4641f1449af8070e5b1d3c442cc1b
@@ -6,10 +6,10 @@ qgis (1.9.0) UNRELEASED; urgency=low
* symbology-ng-style now in sqlite3
* include cpt-city files
* support DEB_BUILD_OPTIONS' parallel=n
* add python-unittest2 build dependency for lucid, maverick and squeeze
* add python-unittest2 build dependency for maverick and squeeze
* add python-qscintilla2 dependency to python-qgis

-- Jürgen E. Fischer <jef@norbit.de> Sat, 15 Sep 2012 22:51:38 +0200
-- Jürgen E. Fischer <jef@norbit.de> Mon, 17 Sep 2012 18:08:47 +0200

qgis (1.8.0) UNRELEASED; urgency=low

@@ -29,7 +29,6 @@ Build-Depends:
python-qt4-dev (>=4.1.0),
python-sip (>= 4.5.0),
python-sip-dev (>= 4.5.0),
python-unittest2,
git-core,
doxygen,
graphviz,
@@ -84,22 +84,31 @@ class QgsRasterInterface

virtual double noDataValue() const;

//void * block( int bandNo, QgsRectangle const & extent, int width, int height );
virtual void * block( int bandNo, const QgsRectangle & extent, int width, int height );

//virtual void * readBlock( int bandNo, QgsRectangle const & extent, int width, int height );
virtual void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );

virtual bool setInput( QgsRasterInterface* input );

virtual QgsRasterInterface * input () const;

virtual bool on( );

virtual void setOn( bool on );

virtual QgsRasterInterface * srcInput();
QgsRasterInterface * srcInput();

QImage * createImage( int width, int height, QImage::Format format );

void setStatsOn( bool on );

double time( bool cumulative = false );

static QString printValue( double value );

protected:
static double readValue( void *data, QgsRasterInterface::DataType type, int index );

static void writeValue( void *data, QgsRasterInterface::DataType type, int index, double value );
};

@@ -5671,6 +5671,10 @@ void QgisApp::options()
{
mScaleEdit->updateScales();
}

qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureDist )->updateSettings();
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureArea )->updateSettings();
qobject_cast<QgsMapToolMeasureAngle*>( mMapTools.mMeasureAngle )->updateSettings();
}

delete optionsDialog;
@@ -6824,6 +6828,10 @@ void QgisApp::projectProperties()
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt );
mMapCanvas->setCanvasColor( myColor ); // this is fill color before rendering onto canvas

qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureDist )->updateSettings();
qobject_cast<QgsMeasureTool*>( mMapTools.mMeasureArea )->updateSettings();
qobject_cast<QgsMapToolMeasureAngle*>( mMapTools.mMeasureAngle )->updateSettings();

// Set the window title.
setTitleBarText_( *this );

@@ -24,36 +24,20 @@ QgsDisplayAngle::QgsDisplayAngle( QgsMapToolMeasureAngle * tool, Qt::WFlags f )
: QDialog( tool->canvas()->topLevelWidget(), f ), mTool( tool )
{
setupUi( this );
QSettings settings;

// Update whenever the canvas has refreshed. Maybe more often than needed,
// but at least every time any canvas related settings changes
connect( mTool->canvas(), SIGNAL( mapCanvasRefreshed() ),
this, SLOT( updateSettings() ) );

updateSettings();
}

QgsDisplayAngle::~QgsDisplayAngle()
{

}


void QgsDisplayAngle::setValueInRadians( double value )
{
mValue = value;
updateUi();
}

void QgsDisplayAngle::updateSettings()
{
emit changeProjectionEnabledState();
}

void QgsDisplayAngle::updateUi()
{

QSettings settings;
QString unitString = settings.value( "/qgis/measure/angleunits", "degrees" ).toString();
int decimals = settings.value( "/qgis/measure/decimalplaces", "3" ).toInt();
@@ -31,14 +31,6 @@ class QgsDisplayAngle: public QDialog, private Ui::QgsDisplayAngleBase
be converted to degrees / gon automatically if necessary*/
void setValueInRadians( double value );

signals:
void changeProjectionEnabledState();

private slots:

//! When any external settings change
void updateSettings();

private:
//! pointer to tool which owns this dialog
QgsMapToolMeasureAngle * mTool;
@@ -27,6 +27,9 @@
QgsMapToolMeasureAngle::QgsMapToolMeasureAngle( QgsMapCanvas* canvas ): QgsMapTool( canvas ), mRubberBand( 0 ), mResultDisplay( 0 )
{
mSnapper.setMapCanvas( canvas );

connect( canvas->mapRenderer(), SIGNAL( destinationSrsChanged() ),
this, SLOT( updateSettings() ) );
}

QgsMapToolMeasureAngle::~QgsMapToolMeasureAngle()
@@ -87,8 +90,6 @@ void QgsMapToolMeasureAngle::canvasReleaseEvent( QMouseEvent * e )
{
mResultDisplay = new QgsDisplayAngle( this );
QObject::connect( mResultDisplay, SIGNAL( rejected() ), this, SLOT( stopMeasuring() ) );
QObject::connect( mResultDisplay, SIGNAL( changeProjectionEnabledState() ),
this, SLOT( changeProjectionEnabledState() ) );
}
configureDistanceArea();
createRubberBand();
@@ -147,10 +148,11 @@ QgsPoint QgsMapToolMeasureAngle::snapPoint( const QPoint& p )
}
}

void QgsMapToolMeasureAngle::changeProjectionEnabledState()
void QgsMapToolMeasureAngle::updateSettings()
{
if ( mAnglePoints.size() != 3 )
return;

if ( !mResultDisplay )
return;

@@ -173,8 +175,8 @@ void QgsMapToolMeasureAngle::changeProjectionEnabledState()
resultAngle = -M_PI + ( resultAngle - M_PI );
}
}
mResultDisplay->setValueInRadians( resultAngle );

mResultDisplay->setValueInRadians( resultAngle );
}

void QgsMapToolMeasureAngle::configureDistanceArea()
@@ -193,6 +195,3 @@ void QgsMapToolMeasureAngle::configureDistanceArea()
mDa.setEllipsoidalMode( false );
}
}



@@ -59,14 +59,15 @@ class QgsMapToolMeasureAngle: public QgsMapTool
/** tool for measuring */
QgsDistanceArea mDa;

public slots:
/** recalculate angle if projection state changed*/
void updateSettings();

private slots:
/**Deletes the rubber band and the dialog*/
void stopMeasuring();

/** recalculate angle if projection state changed*/
void changeProjectionEnabledState();

//! Configures distance area objects with ellipsoid / output crs
/** Configures distance area objects with ellipsoid / output crs*/
void configureDistanceArea();

};
@@ -48,19 +48,11 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool* tool, Qt::WFlags f )
item->setTextAlignment( 0, Qt::AlignRight );
mTable->addTopLevelItem( item );

// Update whenever the canvas has refreshed. Maybe more often than needed,
// but at least every time any canvas related settings changes
connect( mTool->canvas(), SIGNAL( mapCanvasRefreshed() ),
this, SLOT( updateSettings() ) );

updateSettings();
}

void QgsMeasureDialog::updateSettings()
{
if ( !isVisible() )
return;

QSettings settings;

mDecimalPlaces = settings.value( "/qgis/measure/decimalplaces", "3" ).toInt();
@@ -106,7 +98,6 @@ void QgsMeasureDialog::restart()

void QgsMeasureDialog::mousePress( QgsPoint &point )
{

show();
raise();
if ( ! mTool->done() )
@@ -152,7 +143,6 @@ void QgsMeasureDialog::addPoint( QgsPoint &p )
{
Q_UNUSED( p );

QgsDebugMsg( "Entering" );
int numPoints = mTool->points().size();
if ( mMeasureArea && numPoints > 2 )
{
@@ -40,12 +40,15 @@ QgsMeasureTool::QgsMeasureTool( QgsMapCanvas* canvas, bool measureArea )
QPixmap myCrossHairQPixmap = QPixmap(( const char ** ) cross_hair_cursor );
mCursor = QCursor( myCrossHairQPixmap, 8, 8 );

mDone = false;
mDone = true;
// Append point we will move
mPoints.append( QgsPoint( 0, 0 ) );

mDialog = new QgsMeasureDialog( this );
mSnapper.setMapCanvas( canvas );

connect( canvas->mapRenderer(), SIGNAL( destinationSrsChanged() ),
this, SLOT( updateSettings() ) );
}

QgsMeasureTool::~QgsMeasureTool()
@@ -100,14 +103,14 @@ void QgsMeasureTool::restart()
{
mPoints.clear();
// Append point we will move
mPoints.append( QgsPoint( 0, 0 ) );
// mPoints.append( QgsPoint( 0, 0 ) );

mRubberBand->reset( mMeasureArea );

// re-read settings
updateSettings();

mDone = false;
mDone = true;
mWrongProjectProjection = false;

}
@@ -120,7 +123,7 @@ void QgsMeasureTool::updateSettings()
int myGreen = settings.value( "/qgis/default_measure_color_green", 180 ).toInt();
int myBlue = settings.value( "/qgis/default_measure_color_blue", 180 ).toInt();
mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );

mDialog->updateSettings();
}

//////////////////////////
@@ -132,9 +135,10 @@ void QgsMeasureTool::canvasPressEvent( QMouseEvent * e )
if ( mDone )
{
mDialog->restart();
QgsPoint point = snapPoint( e->pos() );
addPoint( point );
mDone = false;
}
QgsPoint idPoint = snapPoint( e->pos() );
// mDialog->mousePress( idPoint );
}
}

@@ -542,9 +542,22 @@ void QgsRasterLayerProperties::sync()
}

//add current NoDataValue to NoDataValue line edit
if ( mRasterLayer->isNoDataValueValid() )
// TODO: should be per band
// TODO: no data ranges
if ( mRasterLayer->dataProvider()->srcHasNoDataValue( 1 ) )
{
lblSrcNoDataValue->setText( QgsRasterInterface::printValue( mRasterLayer->dataProvider()->noDataValue( 1 ) ) );
}
else
{
lblSrcNoDataValue->setText( tr( "not defined" ) );
}

QList<QgsRasterInterface::Range> noDataRangeList = mRasterLayer->dataProvider()->userNoDataValue( 1 );
QgsDebugMsg( QString( "noDataRangeList.size = %1" ).arg( noDataRangeList.size() ) );
if ( noDataRangeList.size() > 0 )
{
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'g' ) );
leNoDataValue->insert( QgsRasterInterface::printValue( noDataRangeList.value( 0 ).min ) );
}
else
{
@@ -650,11 +663,18 @@ void QgsRasterLayerProperties::apply()
bool myDoubleOk = false;
if ( "" != leNoDataValue->text() )
{
QList<QgsRasterInterface::Range> myNoDataRangeList;
double myNoDataValue = leNoDataValue->text().toDouble( &myDoubleOk );
if ( myDoubleOk )
{
mRasterLayer->setNoDataValue( myNoDataValue );
QgsRasterInterface::Range myNoDataRange;
myNoDataRange.min = myNoDataValue;
myNoDataRange.max = myNoDataValue;

myNoDataRangeList << myNoDataRange;
}
mRasterLayer->dataProvider()->setUserNoDataValue( 1, myNoDataRangeList );
}

//set renderer from widget
@@ -1551,6 +1571,7 @@ void QgsRasterLayerProperties::on_pbnSaveStyleAs_clicked()
settings.setValue( "style/lastStyleDir", QFileInfo( outputFileName ).absolutePath() );
}

#if 0
void QgsRasterLayerProperties::on_btnResetNull_clicked( )
{
//If reset NoDataValue is checked do this first, will ignore what ever is in the LineEdit
@@ -1564,6 +1585,7 @@ void QgsRasterLayerProperties::on_btnResetNull_clicked( )
leNoDataValue->clear();
}
}
#endif

void QgsRasterLayerProperties::toggleBuildPyramidsButton()
{
@@ -76,7 +76,7 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
void on_pbnRemoveSelectedRow_clicked();
/** \brief slot executed when the single band radio button is pressed. */
/** \brief slot executed when the reset null value to file default icon is selected */
void on_btnResetNull_clicked( );
//void on_btnResetNull_clicked( );

void pixelSelected( const QgsPoint& );
/** \brief slot executed when the transparency level changes. */
@@ -537,6 +537,28 @@ void QgsProjectFileTransform::transform1800to1900()
void QgsProjectFileTransform::convertRasterProperties( QDomDocument& doc, QDomNode& parentNode,
QDomElement& rasterPropertiesElem, QgsRasterLayer* rlayer )
{
//no data
//TODO: We would need to set no data on all bands, but we dont know number of bands here
QDomNode noDataNode = rasterPropertiesElem.namedItem( "mNoDataValue" );
QDomElement noDataElement = noDataNode.toElement();
if ( !noDataElement.text().isEmpty() )
{
QgsDebugMsg( "mNoDataValue = " + noDataElement.text() );
QDomElement noDataElem = doc.createElement( "noData" );

QDomElement noDataRangeList = doc.createElement( "noDataRangeList" );
noDataRangeList.setAttribute( "bandNo", 1 );

QDomElement noDataRange = doc.createElement( "noDataRange" );
noDataRange.setAttribute( "min", noDataElement.text() );
noDataRange.setAttribute( "max", noDataElement.text() );
noDataRangeList.appendChild( noDataRange );

noDataElem.appendChild( noDataRangeList );

parentNode.appendChild( noDataElem );
}

QDomElement rasterRendererElem = doc.createElement( "rasterrenderer" );
//convert general properties

0 comments on commit 78cb4e0

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