Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Feb 23, 2014
1 parent bc87d51 commit 5a25570b7e2835e0c759fd7fc7faf90fddeaf24a
Showing with 1,508 additions and 1,507 deletions.
  1. +34 −34 src/app/composer/qgscomposermapwidget.cpp
  2. +19 −19 src/app/maprenderertest.cpp
  3. +59 −59 src/app/maprenderertest.h
  4. +2 −2 src/app/qgisapp.cpp
  5. +2 −2 src/app/qgslabelengineconfigdialog.cpp
  6. +2 −2 src/app/qgsmaptoollabel.cpp
  7. +7 −7 src/core/composer/qgscomposermap.cpp
  8. +5 −5 src/core/composer/qgscomposition.cpp
  9. +1 −1 src/core/pal/pal.cpp
  10. +1 −1 src/core/pal/pal.h
  11. +2 −2 src/core/qgsdiagramrendererv2.cpp
  12. +19 −19 src/core/qgsfeatureiterator.h
  13. +8 −8 src/core/qgsfeaturerequest.h
  14. +12 −12 src/core/qgsmaplayerrenderer.h
  15. +3 −3 src/core/qgsmaprenderer.cpp
  16. +3 −3 src/core/qgsmaprenderercache.cpp
  17. +116 −116 src/core/qgsmaprendererjob.cpp
  18. +137 −137 src/core/qgsmaprendererjob.h
  19. +13 −13 src/core/qgsmapsettings.cpp
  20. +106 −106 src/core/qgsmapsettings.h
  21. +4 −4 src/core/qgspallabeling.cpp
  22. +11 −11 src/core/qgspallabeling.h
  23. +15 −15 src/core/qgspluginlayer.cpp
  24. +2 −2 src/core/qgssnapper.cpp
  25. +61 −61 src/core/qgsspatialindex.cpp
  26. +2 −2 src/core/qgstolerance.cpp
  27. +1 −1 src/core/qgstolerance.h
  28. +2 −2 src/core/qgsvectordataprovider.h
  29. +3 −3 src/core/qgsvectorlayer.cpp
  30. +20 −20 src/core/qgsvectorlayerfeatureiterator.h
  31. +13 −13 src/core/qgsvectorlayerrenderer.cpp
  32. +40 −40 src/core/qgsvectorlayerrenderer.h
  33. +7 −7 src/core/qgsxmlutils.h
  34. +5 −5 src/core/raster/qgsrasterdataprovider.h
  35. +3 −3 src/core/raster/qgsrasterlayerrenderer.cpp
  36. +9 −9 src/core/raster/qgsrasterlayerrenderer.h
  37. +35 −35 src/gui/qgsmapcanvas.cpp
  38. +16 −16 src/gui/qgsmapcanvas.h
  39. +1 −1 src/gui/qgsmapcanvasitem.cpp
  40. +4 −4 src/gui/qgsmapcanvasmap.cpp
  41. +7 −7 src/gui/qgsmapoverviewcanvas.cpp
  42. +10 −10 src/plugins/georeferencer/qgsgcpcanvasitem.cpp
  43. +19 −19 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.cpp
  44. +28 −28 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.h
  45. +4 −4 src/providers/gpx/qgsgpxfeatureiterator.cpp
  46. +11 −11 src/providers/gpx/qgsgpxfeatureiterator.h
  47. +1 −1 src/providers/gpx/qgsgpxprovider.h
  48. +9 −9 src/providers/grass/qgsgrassfeatureiterator.cpp
  49. +15 −15 src/providers/grass/qgsgrassfeatureiterator.h
  50. +1 −1 src/providers/grass/qgsgrassprovider.h
  51. +4 −4 src/providers/memory/qgsmemoryfeatureiterator.cpp
  52. +9 −9 src/providers/memory/qgsmemoryfeatureiterator.h
  53. +13 −13 src/providers/ogr/qgsogrfeatureiterator.h
  54. +4 −4 src/providers/ogr/qgsogrprovider.h
  55. +12 −12 src/providers/oracle/qgsoraclefeatureiterator.cpp
  56. +20 −20 src/providers/oracle/qgsoraclefeatureiterator.h
  57. +1 −1 src/providers/oracle/qgsoracleprovider.cpp
  58. +24 −24 src/providers/oracle/qgsoracleprovider.h
  59. +3 −3 src/providers/postgres/qgspostgresconnpool.cpp
  60. +32 −32 src/providers/postgres/qgspostgresconnpool.h
  61. +188 −188 src/providers/postgres/qgspostgresfeatureiterator.cpp
  62. +19 −19 src/providers/postgres/qgspostgresfeatureiterator.h
  63. +2 −2 src/providers/postgres/qgspostgresprovider.cpp
  64. +31 −31 src/providers/postgres/qgspostgresprovider.h
  65. +14 −14 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
  66. +23 −23 src/providers/spatialite/qgsspatialitefeatureiterator.h
  67. +4 −4 src/providers/spatialite/qgsspatialiteprovider.h
  68. +16 −16 src/providers/wcs/qgswcsprovider.cpp
  69. +17 −17 src/providers/wcs/qgswcsprovider.h
  70. +3 −3 src/providers/wfs/qgswfsfeatureiterator.cpp
  71. +9 −9 src/providers/wfs/qgswfsfeatureiterator.h
  72. +64 −64 src/providers/wms/qgswmsprovider.h
  73. +3 −3 tests/src/core/testmaprendererjob.cpp
  74. +74 −73 tests/src/core/testqgsspatialindex.cpp
  75. +9 −9 tests/src/gui/testqgsmapcanvas.cpp
@@ -296,41 +296,41 @@ void QgsComposerMapWidget::on_mSetToMapCanvasExtentButton_clicked()
{
if ( mComposerMap )
{
QgsRectangle newExtent = mComposerMap->composition()->mapSettings().visibleExtent();

//Make sure the width/height ratio is the same as in current composer map extent.
//This is to keep the map item frame and the page layout fixed
QgsRectangle currentMapExtent = *( mComposerMap->currentMapExtent() );
double currentWidthHeightRatio = currentMapExtent.width() / currentMapExtent.height();
double newWidthHeightRatio = newExtent.width() / newExtent.height();

if ( currentWidthHeightRatio < newWidthHeightRatio )
{
//enlarge height of new extent, ensuring the map center stays the same
double newHeight = newExtent.width() / currentWidthHeightRatio;
double deltaHeight = newHeight - newExtent.height();
newExtent.setYMinimum( newExtent.yMinimum() - deltaHeight / 2 );
newExtent.setYMaximum( newExtent.yMaximum() + deltaHeight / 2 );
}
else
{
//enlarge width of new extent, ensuring the map center stays the same
double newWidth = currentWidthHeightRatio * newExtent.height();
double deltaWidth = newWidth - newExtent.width();
newExtent.setXMinimum( newExtent.xMinimum() - deltaWidth / 2 );
newExtent.setXMaximum( newExtent.xMaximum() + deltaWidth / 2 );
}

//fill text into line edits
mXMinLineEdit->setText( QString::number( newExtent.xMinimum() ) );
mXMaxLineEdit->setText( QString::number( newExtent.xMaximum() ) );
mYMinLineEdit->setText( QString::number( newExtent.yMinimum() ) );
mYMaxLineEdit->setText( QString::number( newExtent.yMaximum() ) );

mComposerMap->beginCommand( tr( "Map extent changed" ) );
mComposerMap->setNewExtent( newExtent );
mComposerMap->endCommand();
QgsRectangle newExtent = mComposerMap->composition()->mapSettings().visibleExtent();

//Make sure the width/height ratio is the same as in current composer map extent.
//This is to keep the map item frame and the page layout fixed
QgsRectangle currentMapExtent = *( mComposerMap->currentMapExtent() );
double currentWidthHeightRatio = currentMapExtent.width() / currentMapExtent.height();
double newWidthHeightRatio = newExtent.width() / newExtent.height();

if ( currentWidthHeightRatio < newWidthHeightRatio )
{
//enlarge height of new extent, ensuring the map center stays the same
double newHeight = newExtent.width() / currentWidthHeightRatio;
double deltaHeight = newHeight - newExtent.height();
newExtent.setYMinimum( newExtent.yMinimum() - deltaHeight / 2 );
newExtent.setYMaximum( newExtent.yMaximum() + deltaHeight / 2 );
}
else
{
//enlarge width of new extent, ensuring the map center stays the same
double newWidth = currentWidthHeightRatio * newExtent.height();
double deltaWidth = newWidth - newExtent.width();
newExtent.setXMinimum( newExtent.xMinimum() - deltaWidth / 2 );
newExtent.setXMaximum( newExtent.xMaximum() + deltaWidth / 2 );
}

//fill text into line edits
mXMinLineEdit->setText( QString::number( newExtent.xMinimum() ) );
mXMaxLineEdit->setText( QString::number( newExtent.xMaximum() ) );
mYMinLineEdit->setText( QString::number( newExtent.yMinimum() ) );
mYMaxLineEdit->setText( QString::number( newExtent.yMaximum() ) );

mComposerMap->beginCommand( tr( "Map extent changed" ) );
mComposerMap->setNewExtent( newExtent );
mComposerMap->endCommand();
}
}

void QgsComposerMapWidget::on_mXMinLineEdit_editingFinished()
@@ -13,31 +13,31 @@
#include "qgsmapoverviewcanvas.h"
#include "qgsmaptoolpan.h"

int main(int argc, char* argv[])
int main( int argc, char* argv[] )
{
QApplication app(argc, argv);
QApplication app( argc, argv );

QgsApplication::setPrefixPath("/home/martin/qgis/git-master/creator/output", true);
QgsApplication::setPrefixPath( "/home/martin/qgis/git-master/creator/output", true );
QgsApplication::initQgis();

QString uri = "dbname='/data/gis/praha.osm.db' table=\"praha_polygons\" (geometry) sql=";
QString uri2 = "dbname='/data/gis/praha.osm.db' table=\"praha_polylines\" (geometry) sql=";
//QString uri = "/data/gis/cr-shp-wgs84/plochy/kraje_pseudo.shp";
QgsVectorLayer* layer = new QgsVectorLayer(uri, "praha", "spatialite");
if (!layer->isValid())
QgsVectorLayer* layer = new QgsVectorLayer( uri, "praha", "spatialite" );
if ( !layer->isValid() )
{
qDebug("invalid layer");
qDebug( "invalid layer" );
return 1;
}
QgsMapLayerRegistry::instance()->addMapLayer(layer);
QgsMapLayerRegistry::instance()->addMapLayer( layer );

QgsVectorLayer* layer2 = new QgsVectorLayer(uri2, "praha", "spatialite");
if (!layer2->isValid())
QgsVectorLayer* layer2 = new QgsVectorLayer( uri2, "praha", "spatialite" );
if ( !layer2->isValid() )
{
qDebug("invalid layer");
qDebug( "invalid layer" );
return 1;
}
QgsMapLayerRegistry::instance()->addMapLayer(layer2);
QgsMapLayerRegistry::instance()->addMapLayer( layer2 );

// open a window and do the rendering!
/*TestWidget l(layer);
@@ -46,23 +46,23 @@ int main(int argc, char* argv[])


QgsMapCanvas canvas;
canvas.setCanvasColor(Qt::white);
canvas.setExtent(layer->extent());
canvas.setCanvasColor( Qt::white );
canvas.setExtent( layer->extent() );
canvas.show();

// test overview
QgsMapOverviewCanvas overview( 0, &canvas );
overview.resize(200,200);
overview.resize( 200, 200 );
canvas.enableOverviewMode( &overview );
overview.show();

QList<QgsMapCanvasLayer> layers;
layers.append(QgsMapCanvasLayer(layer2, true, true));
layers.append(QgsMapCanvasLayer(layer));
canvas.setLayerSet(layers);
layers.append( QgsMapCanvasLayer( layer2, true, true ) );
layers.append( QgsMapCanvasLayer( layer ) );
canvas.setLayerSet( layers );

QgsMapTool* pan = new QgsMapToolPan(&canvas);
canvas.setMapTool(pan);
QgsMapTool* pan = new QgsMapToolPan( &canvas );
canvas.setMapTool( pan );

return app.exec();
}
@@ -13,81 +13,81 @@

class TestWidget : public QLabel
{
Q_OBJECT
public:
TestWidget(QgsMapLayer* layer)
{
job = 0;

// init renderer
ms.setLayers(QStringList(layer->id()));
ms.setExtent(layer->extent());
ms.setOutputSize(size());

if (ms.hasValidSettings())
qDebug("map renderer settings valid");

connect(&timer, SIGNAL(timeout()), SLOT(onMapUpdateTimeout()));
timer.setInterval(100);
}

void mousePressEvent(QMouseEvent * event)
{
if (event->button() == Qt::RightButton)
Q_OBJECT
public:
TestWidget( QgsMapLayer* layer )
{
qDebug("cancelling!");
job = 0;

if (job)
{
job->cancel();
delete job;
job = 0;
}
// init renderer
ms.setLayers( QStringList( layer->id() ) );
ms.setExtent( layer->extent() );
ms.setOutputSize( size() );

if ( ms.hasValidSettings() )
qDebug( "map renderer settings valid" );

connect( &timer, SIGNAL( timeout() ), SLOT( onMapUpdateTimeout() ) );
timer.setInterval( 100 );
}
else
{
qDebug("starting!");

if (job)
void mousePressEvent( QMouseEvent * event )
{
if ( event->button() == Qt::RightButton )
{
qDebug("need to cancel first!");
job->cancel();
delete job;
job = 0;
qDebug( "cancelling!" );

if ( job )
{
job->cancel();
delete job;
job = 0;
}
}
else
{
qDebug( "starting!" );

job = new QgsMapRendererSequentialJob(ms);
connect(job, SIGNAL(finished()), SLOT(f()));
if ( job )
{
qDebug( "need to cancel first!" );
job->cancel();
delete job;
job = 0;
}

job->start();
job = new QgsMapRendererSequentialJob( ms );
connect( job, SIGNAL( finished() ), SLOT( f() ) );

timer.start();
job->start();

timer.start();
}
}
}

protected slots:
void f()
{
qDebug("finished!");
protected slots:
void f()
{
qDebug( "finished!" );

timer.stop();
timer.stop();

if (job)
setPixmap(QPixmap::fromImage( job->renderedImage() ));
}
if ( job )
setPixmap( QPixmap::fromImage( job->renderedImage() ) );
}

void onMapUpdateTimeout()
{
qDebug("update timer!");
void onMapUpdateTimeout()
{
qDebug( "update timer!" );

if (job)
setPixmap(QPixmap::fromImage( job->renderedImage() ));
}
if ( job )
setPixmap( QPixmap::fromImage( job->renderedImage() ) );
}

protected:
QgsMapSettings ms;
QgsMapRendererQImageJob* job;
QTimer timer;
protected:
QgsMapSettings ms;
QgsMapRendererQImageJob* job;
QTimer timer;
};


@@ -2094,7 +2094,7 @@ void QgisApp::createOverview()

mMapCanvas->setCachingEnabled( mySettings.value( "/qgis/enable_render_caching", false ).toBool() );

mMapCanvas->setParallelRenderingEnabled( mySettings.value( "/qgis/parallel_rendering", false).toBool() );
mMapCanvas->setParallelRenderingEnabled( mySettings.value( "/qgis/parallel_rendering", false ).toBool() );

mMapCanvas->setMapUpdateInterval( mySettings.value( "/qgis/map_update_interval", 250 ).toInt() );
}
@@ -6849,7 +6849,7 @@ void QgisApp::showOptionsDialog( QWidget *parent, QString currentPage )

mMapCanvas->setCachingEnabled( mySettings.value( "/qgis/enable_render_caching", false ).toBool() );

mMapCanvas->setParallelRenderingEnabled( mySettings.value( "/qgis/parallel_rendering", false).toBool() );
mMapCanvas->setParallelRenderingEnabled( mySettings.value( "/qgis/parallel_rendering", false ).toBool() );

mMapCanvas->setMapUpdateInterval( mySettings.value( "/qgis/map_update_interval", 250 ).toInt() );

@@ -57,8 +57,8 @@ void QgsLabelEngineConfigDialog::onOK()
lbl.setSearchMethod(( QgsPalLabeling::Search ) cboSearchMethod->currentIndex() );

lbl.setNumCandidatePositions( spinCandPoint->value(),
spinCandLine->value(),
spinCandPolygon->value() );
spinCandLine->value(),
spinCandPolygon->value() );

lbl.setShowingCandidates( chkShowCandidates->isChecked() );
lbl.setShowingShadowRectangles( mShadowDebugRectChkBox->isChecked() );
@@ -26,7 +26,7 @@
#include <QMouseEvent>

QgsMapToolLabel::QgsMapToolLabel( QgsMapCanvas* canvas ): QgsMapTool( canvas ), mLabelRubberBand( 0 ), mFeatureRubberBand( 0 ), mFixPointRubberBand( 0 )
, mCurrentLayer( 0 )
, mCurrentLayer( 0 )
{
}

@@ -138,7 +138,7 @@ QgsPalLayerSettings& QgsMapToolLabel::currentLabelSettings( bool* ok )
mCurrentSettings = QgsPalLayerSettings::fromLayer( vlayer );

if ( ok )
*ok = true;
*ok = true;

return mCurrentSettings;
}
@@ -184,13 +184,13 @@ void QgsComposerMap::draw( QPainter *painter, const QgsRectangle& extent, const
jobMapSettings.setDestinationCrs( ms.destinationCrs() );
jobMapSettings.setCrsTransformEnabled( ms.hasCrsTransformEnabled() );
jobMapSettings.setFlags( ms.flags() );
/* TODO[MD] fix after merge
if ( mComposition->plotStyle() == QgsComposition::Print ||
mComposition->plotStyle() == QgsComposition::Postscript )
{
//if outputing composer, disable optimisations like layer simplification
theRendererContext->setUseRenderingOptimization( false );
}*/
/* TODO[MD] fix after merge
if ( mComposition->plotStyle() == QgsComposition::Print ||
mComposition->plotStyle() == QgsComposition::Postscript )
{
//if outputing composer, disable optimisations like layer simplification
theRendererContext->setUseRenderingOptimization( false );
}*/

//update $map variable. Use QgsComposerItem's id since that is user-definable
QgsExpression::setSpecialColumn( "$map", QgsComposerItem::id() );
@@ -60,10 +60,10 @@ QgsComposition::QgsComposition( QgsMapRenderer* mapRenderer )
}

QgsComposition::QgsComposition( const QgsMapSettings& mapSettings )
: QGraphicsScene( 0 )
, mMapRenderer( 0 )
, mMapSettings( mapSettings )
, mAtlasComposition( this )
: QGraphicsScene( 0 )
, mMapRenderer( 0 )
, mMapSettings( mapSettings )
, mAtlasComposition( this )
{
init();
}
@@ -98,7 +98,7 @@ void QgsComposition::init()

setBackgroundBrush( QColor( 215, 215, 215 ) );
createDefaultPageStyleSymbol();

addPaperItem();

updateBounds();
@@ -819,7 +819,7 @@ namespace pal
return solution;
}

void Pal::registerCancellationCallback(Pal::FnIsCancelled fnCancelled, void *context)
void Pal::registerCancellationCallback( Pal::FnIsCancelled fnCancelled, void *context )
{
fnIsCancelled = fnCancelled;
fnIsCancelledContext = context;

0 comments on commit 5a25570

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