Skip to content

Commit

Permalink
saver string list handling
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10236 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Feb 25, 2009
1 parent 083422c commit bda8d4a
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 12 deletions.
2 changes: 1 addition & 1 deletion python/configure.py.in
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions python/core/core.sip
Expand Up @@ -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
Expand All @@ -25,13 +32,15 @@
%Include qgsgraduatedsymbolrenderer.sip
%Include qgslabel.sip
%Include qgslabelattributes.sip
%Include qgslegendmodel.sip
%Include qgslogger.sip
%Include qgsmaplayer.sip
%Include qgsmaplayerregistry.sip
%Include qgsmaprenderer.sip
%Include qgsmaptopixel.sip
%Include qgsmarkercatalogue.sip
%Include qgsmessageoutput.sip
%Include qgspaperitem.sip
%Include qgspoint.sip
%Include qgsproject.sip
%Include qgsprovidermetadata.sip
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/gui/gui.sip
Expand Up @@ -7,8 +7,8 @@

%Import core/core.sip


%Include qgisinterface.sip
%Include qgscomposerview.sip
%Include qgsencodingfiledialog.sip
%Include qgsgenericprojectionselector.sip
%Include qgsmapcanvas.sip
Expand Down
5 changes: 5 additions & 0 deletions python/gui/qgisinterface.sip
Expand Up @@ -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<QgsComposerView*> composerViews()=0;

virtual QList< QPair<QMainWindow*, QgsComposerView*> > composerList() = 0;

/** Add action to the plugins menu */
virtual void addPluginToMenu(QString name, QAction* action)=0;
/** Remove action from the plugins menu */
Expand Down
8 changes: 7 additions & 1 deletion src/app/composer/qgscomposerscalebarwidget.cpp
Expand Up @@ -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 )
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -24,6 +24,7 @@

#include "qgisappinterface.h"
#include "qgisapp.h"
#include "qgscomposer.h"
#include "qgsmaplayer.h"
#include "qgsmaplayerregistry.h"
#include "qgsmapcanvas.h"
Expand Down Expand Up @@ -138,6 +139,45 @@ QWidget * QgisAppInterface::mainWindow()
return qgis;
}

#if 0
QList<QgsComposerView*> QgisAppInterface::composerViews()
{
QList<QgsComposerView*> 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<QMainWindow*, QgsComposerView*> > QgisAppInterface::composerList()
{

QList< QPair<QMainWindow*, QgsComposerView*> > 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 );
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -92,6 +92,11 @@ class QgisAppInterface : public QgisInterface
*/
QWidget * mainWindow();

/** Return pointers to the composer views of the running instance (currently only one)*/
//QList<QgsComposerView*> composerViews();

QList< QPair<QMainWindow*, QgsComposerView*> > composerList();

/** Add action to the plugins menu */
void addPluginToMenu( QString name, QAction* action );
/** Remove action from the plugins menu */
Expand Down
6 changes: 0 additions & 6 deletions src/core/composer/qgscomposermap.h
Expand Up @@ -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
Expand All @@ -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 );

Expand Down
10 changes: 10 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -23,12 +23,16 @@ class QAction;
class QMenu;
class QToolBar;
class QDockWidget;
class QMainWindow;
class QWidget;
#include <QObject>
#include <QPair>

#include <map>


class QgisApp;
class QgsComposerView;
class QgsMapLayer;
class QgsMapCanvas;
class QgsRasterLayer;
Expand Down Expand Up @@ -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<QgsComposerView*> composerViews() = 0;

/**Return mainwindows / composer views of running composer instances (currently only one)*/
virtual QList< QPair<QMainWindow*, QgsComposerView*> > composerList() = 0;

/** Add action to the plugins menu */
virtual void addPluginToMenu( QString name, QAction* action ) = 0;
/** Remove action from the plugins menu */
Expand Down
2 changes: 1 addition & 1 deletion 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)
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/interpolation/qgsinterpolator.cpp
Expand Up @@ -76,6 +76,8 @@ int QgsInterpolator::cacheBaseData()

QgsFeature theFeature;
double attributeValue = 0.0;
bool attributeConversionOk = false;

while ( provider->nextFeature( theFeature ) )
{
if ( !zCoordInterpolation )
Expand All @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion 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)
Expand Down

0 comments on commit bda8d4a

Please sign in to comment.