diff --git a/python/configure.py.in b/python/configure.py.in index ecfbad47812..99403d6348f 100644 --- a/python/configure.py.in +++ b/python/configure.py.in @@ -136,7 +136,7 @@ for mk in [ makefile_core, makefile_gui ]: mk.extra_lib_dirs.append(geos_library_path) if gdal_library_path!="": mk.extra_lib_dirs.append(gdal_library_path) - mk.extra_include_dirs = [src_path+"/src/core", + mk.extra_include_dirs = [src_path+"/src/core", src_path+"/src/core/composer", src_path+"/src/core/raster", src_path+"/src/core/renderer", src_path+"/src/core/spatialindex", diff --git a/python/core/core.sip b/python/core/core.sip index 853c2fd621d..92ae71e38cb 100644 --- a/python/core/core.sip +++ b/python/core/core.sip @@ -11,6 +11,13 @@ %Include qgis.sip %Include qgsapplication.sip +%Include qgscomposeritem.sip +%Include qgscomposerlabel.sip +%Include qgscomposerlegend.sip +%Include qgscomposermap.sip +%Include qgscomposerpicture.sip +%Include qgscomposerscalebar.sip +%Include qgscomposition.sip %Include qgscontexthelp.sip %Include qgscontinuouscolorrenderer.sip %Include qgscontrastenhancement.sip @@ -25,6 +32,7 @@ %Include qgsgraduatedsymbolrenderer.sip %Include qgslabel.sip %Include qgslabelattributes.sip +%Include qgslegendmodel.sip %Include qgslogger.sip %Include qgsmaplayer.sip %Include qgsmaplayerregistry.sip @@ -32,6 +40,7 @@ %Include qgsmaptopixel.sip %Include qgsmarkercatalogue.sip %Include qgsmessageoutput.sip +%Include qgspaperitem.sip %Include qgspoint.sip %Include qgsproject.sip %Include qgsprovidermetadata.sip @@ -47,6 +56,7 @@ %Include qgsrect.sip %Include qgsrendercontext.sip %Include qgsrenderer.sip +%Include qgsscalebarstyle.sip %Include qgsscalecalculator.sip %Include qgssinglesymbolrenderer.sip %Include qgssnapper.sip diff --git a/python/gui/gui.sip b/python/gui/gui.sip index 77a55b5deec..d79460f41a0 100644 --- a/python/gui/gui.sip +++ b/python/gui/gui.sip @@ -7,8 +7,8 @@ %Import core/core.sip - %Include qgisinterface.sip +%Include qgscomposerview.sip %Include qgsencodingfiledialog.sip %Include qgsgenericprojectionselector.sip %Include qgsmapcanvas.sip diff --git a/python/gui/qgisinterface.sip b/python/gui/qgisinterface.sip index 4bf1d6b9b9d..eae0a48f3ac 100644 --- a/python/gui/qgisinterface.sip +++ b/python/gui/qgisinterface.sip @@ -73,6 +73,11 @@ class QgisInterface : QObject /** Return a pointer to the main window (instance of QgisApp in case of QGIS) */ virtual QWidget * mainWindow()=0; + /** Return pointers to the composer views of the running instance (currently only one)*/ + //virtual QList composerViews()=0; + + virtual QList< QPair > composerList() = 0; + /** Add action to the plugins menu */ virtual void addPluginToMenu(QString name, QAction* action)=0; /** Remove action from the plugins menu */ diff --git a/src/app/composer/qgscomposerscalebarwidget.cpp b/src/app/composer/qgscomposerscalebarwidget.cpp index 3b5e471e7e1..ac109528d56 100644 --- a/src/app/composer/qgscomposerscalebarwidget.cpp +++ b/src/app/composer/qgscomposerscalebarwidget.cpp @@ -103,7 +103,13 @@ void QgsComposerScaleBarWidget::on_mMapComboBox_activated( const QString& text ) //extract id int id; bool conversionOk; - QString idString = text.split( " " ).at( 1 ); + QStringList textSplit = text.split( " " ); + if(textSplit.size() < 1) + { + return; + } + + QString idString = textSplit.at( textSplit.size() - 1 ); id = idString.toInt( &conversionOk ); if ( !conversionOk ) diff --git a/src/app/qgisapp.h b/src/app/qgisapp.h index 613fcee0ef8..9681c3e5128 100644 --- a/src/app/qgisapp.h +++ b/src/app/qgisapp.h @@ -137,6 +137,9 @@ class QgisApp : public QMainWindow void saveMapAsImage( QString, QPixmap * ); /** Get the mapcanvas object from the app */ QgsMapCanvas * mapCanvas() { return mMapCanvas; }; + + QgsComposer* printComposer() {return mComposer;} + //! Set theme (icons) void setTheme( QString themeName = "default" ); //! Setup the toolbar popup menus for a given theme diff --git a/src/app/qgisappinterface.cpp b/src/app/qgisappinterface.cpp index 63b1c812d55..5b0b5a3c62d 100644 --- a/src/app/qgisappinterface.cpp +++ b/src/app/qgisappinterface.cpp @@ -24,6 +24,7 @@ #include "qgisappinterface.h" #include "qgisapp.h" +#include "qgscomposer.h" #include "qgsmaplayer.h" #include "qgsmaplayerregistry.h" #include "qgsmapcanvas.h" @@ -138,6 +139,45 @@ QWidget * QgisAppInterface::mainWindow() return qgis; } +#if 0 +QList QgisAppInterface::composerViews() +{ + QList composerViewList; + if(qgis) + { + QgsComposer* c = qgis->printComposer(); + if(c) + { + QgsComposerView* v = c->view(); + if(v) + { + composerViewList.push_back(v); + } + } + } + return composerViewList; +} +#endif //0 + +QList< QPair > QgisAppInterface::composerList() +{ + +QList< QPair > composerList; + if(qgis) + { + QgsComposer* c = qgis->printComposer(); + if(c) + { + QgsComposerView* v = c->view(); + if(v) + { + composerList.push_back(qMakePair((QMainWindow*)(c), v)); + } + } + } + return composerList; +} + void QgisAppInterface::addDockWidget( Qt::DockWidgetArea area, QDockWidget * dockwidget ) { qgis->addDockWidget( area, dockwidget ); diff --git a/src/app/qgisappinterface.h b/src/app/qgisappinterface.h index 17a7b45747d..eb178795f77 100644 --- a/src/app/qgisappinterface.h +++ b/src/app/qgisappinterface.h @@ -92,6 +92,11 @@ class QgisAppInterface : public QgisInterface */ QWidget * mainWindow(); + /** Return pointers to the composer views of the running instance (currently only one)*/ + //QList composerViews(); + + QList< QPair > composerList(); + /** Add action to the plugins menu */ void addPluginToMenu( QString name, QAction* action ); /** Remove action from the plugins menu */ diff --git a/src/core/composer/qgscomposermap.h b/src/core/composer/qgscomposermap.h index 12c05283b7c..a803ed92e97 100644 --- a/src/core/composer/qgscomposermap.h +++ b/src/core/composer/qgscomposermap.h @@ -55,9 +55,6 @@ class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapB Rectangle // Display only rectangle }; - /** \brief Initialise GUI and other settings, shared by constructors */ - void init( void ); - /** \brief Draw to paint device @param extent map extent @param size size in scene coordinates @@ -67,9 +64,6 @@ class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapB /** \brief Reimplementation of QCanvasItem::paint - draw on canvas */ void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ); - /** \brief Recalculate rectangle/extent/scale according to current rule */ - void recalculate( void ); - /** \brief Create cache image */ void cache( void ); diff --git a/src/gui/qgisinterface.h b/src/gui/qgisinterface.h index e552b1a139c..359a9cb63aa 100644 --- a/src/gui/qgisinterface.h +++ b/src/gui/qgisinterface.h @@ -23,12 +23,16 @@ class QAction; class QMenu; class QToolBar; class QDockWidget; +class QMainWindow; class QWidget; #include +#include #include + class QgisApp; +class QgsComposerView; class QgsMapLayer; class QgsMapCanvas; class QgsRasterLayer; @@ -103,6 +107,12 @@ class GUI_EXPORT QgisInterface : public QObject /** Return a pointer to the main window (instance of QgisApp in case of QGIS) */ virtual QWidget * mainWindow() = 0; + /** Return pointers to composer main windows*/ + //virtual QList composerViews() = 0; + + /**Return mainwindows / composer views of running composer instances (currently only one)*/ + virtual QList< QPair > composerList() = 0; + /** Add action to the plugins menu */ virtual void addPluginToMenu( QString name, QAction* action ) = 0; /** Remove action from the plugins menu */ diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index b7aba1f0329..f75d80f1b8a 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,4 +1,4 @@ -SUBDIRS (copyright_label delimited_text interpolation north_arrow scale_bar) +SUBDIRS (copyright_label delimited_text interpolation north_arrow scale_bar beata) IF (POSTGRES_FOUND) SUBDIRS (spit) diff --git a/src/plugins/interpolation/qgsinterpolator.cpp b/src/plugins/interpolation/qgsinterpolator.cpp index b53b167e467..d92ed947772 100644 --- a/src/plugins/interpolation/qgsinterpolator.cpp +++ b/src/plugins/interpolation/qgsinterpolator.cpp @@ -76,6 +76,8 @@ int QgsInterpolator::cacheBaseData() QgsFeature theFeature; double attributeValue = 0.0; + bool attributeConversionOk = false; + while ( provider->nextFeature( theFeature ) ) { if ( !zCoordInterpolation ) @@ -86,7 +88,11 @@ int QgsInterpolator::cacheBaseData() { return 3; } - attributeValue = att_it.value().toDouble(); + attributeValue = att_it.value().toDouble(&attributeConversionOk); + if(!attributeConversionOk) //don't consider vertices with attributes like 'nan' for the interpolation + { + continue; + } } if ( addVerticesToCache( theFeature.geometry(), attributeValue ) != 0 ) diff --git a/src/providers/CMakeLists.txt b/src/providers/CMakeLists.txt index 5b31751877a..78fa1912fe4 100644 --- a/src/providers/CMakeLists.txt +++ b/src/providers/CMakeLists.txt @@ -1,5 +1,5 @@ -SUBDIRS (memory ogr wms delimitedtext) +SUBDIRS (memory ogr wms delimitedtext osm_provider) IF (POSTGRES_FOUND) SUBDIRS (postgres)