| qgisinterface.h | | qgisinterface.h | |
| | | | |
| skipping to change at line 18 | | skipping to change at line 18 | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| #ifndef QGISINTERFACE_H | | #ifndef QGISINTERFACE_H | |
| #define QGISINTERFACE_H | | #define QGISINTERFACE_H | |
| | | | |
| class QAction; | | class QAction; | |
| class QMenu; | | class QMenu; | |
| class QToolBar; | | class QToolBar; | |
| class QDockWidget; | | class QDockWidget; | |
| class QMainWindow; | | class QMainWindow; | |
| class QWidget; | | class QWidget; | |
| | | | |
| | | | |
| skipping to change at line 120 | | skipping to change at line 119 | |
| //! returns true if the layer exists, false otherwise | | //! returns true if the layer exists, false otherwise | |
| //! added in 1.4 | | //! added in 1.4 | |
| virtual bool setActiveLayer( QgsMapLayer * ) = 0; | | virtual bool setActiveLayer( QgsMapLayer * ) = 0; | |
| | | | |
| //! Add an icon to the plugins toolbar | | //! Add an icon to the plugins toolbar | |
| virtual int addToolBarIcon( QAction *qAction ) = 0; | | virtual int addToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| //! Remove an action (icon) from the plugin toolbar | | //! Remove an action (icon) from the plugin toolbar | |
| virtual void removeToolBarIcon( QAction *qAction ) = 0; | | virtual void removeToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
|
| | | //! Add an icon to the Raster toolbar | |
| | | //! @note added in 2.0 | |
| | | virtual int addRasterToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| | | //! Remove an action (icon) from the Raster toolbar | |
| | | //! @note added in 2.0 | |
| | | virtual void removeRasterToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| | | //! Add an icon to the Vector toolbar | |
| | | //! @note added in 2.0 | |
| | | virtual int addVectorToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| | | //! Remove an action (icon) from the Vector toolbar | |
| | | //! @note added in 2.0 | |
| | | virtual void removeVectorToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| | | //! Add an icon to the Database toolbar | |
| | | //! @note added in 2.0 | |
| | | virtual int addDatabaseToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| | | //! Remove an action (icon) from the Database toolbar | |
| | | //! @note added in 2.0 | |
| | | virtual void removeDatabaseToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| | | //! Add an icon to the Web toolbar | |
| | | //! @note added in 2.0 | |
| | | virtual int addWebToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| | | //! Remove an action (icon) from the Web toolbar | |
| | | //! @note added in 2.0 | |
| | | virtual void removeWebToolBarIcon( QAction *qAction ) = 0; | |
| | | | |
| //! Add toolbar with specified name | | //! Add toolbar with specified name | |
| virtual QToolBar * addToolBar( QString name ) = 0; | | virtual QToolBar * addToolBar( QString name ) = 0; | |
| | | | |
| /** Return a pointer to the map canvas */ | | /** Return a pointer to the map canvas */ | |
| virtual QgsMapCanvas * mapCanvas() = 0; | | virtual QgsMapCanvas * mapCanvas() = 0; | |
| | | | |
| /** Return a pointer to the main window (instance of QgisApp in case of
QGIS) */ | | /** Return a pointer to the main window (instance of QgisApp in case of
QGIS) */ | |
| virtual QWidget * mainWindow() = 0; | | virtual QWidget * mainWindow() = 0; | |
| | | | |
| /**Return mainwindows / composer views of running composer instances (c
urrently only one)*/ | | /**Return mainwindows / composer views of running composer instances (c
urrently only one)*/ | |
| | | | |
| skipping to change at line 158 | | skipping to change at line 189 | |
| /** Add action to the Database menu | | /** Add action to the Database menu | |
| * @note added in 1.7 | | * @note added in 1.7 | |
| */ | | */ | |
| virtual void addPluginToDatabaseMenu( QString name, QAction* action ) =
0; | | virtual void addPluginToDatabaseMenu( QString name, QAction* action ) =
0; | |
| | | | |
| /** Remove action from the Database menu | | /** Remove action from the Database menu | |
| * @note added in 1.7 | | * @note added in 1.7 | |
| */ | | */ | |
| virtual void removePluginDatabaseMenu( QString name, QAction* action )
= 0; | | virtual void removePluginDatabaseMenu( QString name, QAction* action )
= 0; | |
| | | | |
|
| | | /** Add action to the Raster menu | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | virtual void addPluginToRasterMenu( QString name, QAction* action ) = 0 | |
| | | ; | |
| | | | |
| | | /** Remove action from the Raster menu | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | virtual void removePluginRasterMenu( QString name, QAction* action ) = | |
| | | 0; | |
| | | | |
| | | /** Add action to the Vector menu | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | virtual void addPluginToVectorMenu( QString name, QAction* action ) = 0 | |
| | | ; | |
| | | | |
| | | /** Remove action from the Vector menu | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | virtual void removePluginVectorMenu( QString name, QAction* action ) = | |
| | | 0; | |
| | | | |
| | | /** Add action to the Web menu | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | virtual void addPluginToWebMenu( QString name, QAction* action ) = 0; | |
| | | | |
| | | /** Remove action from the Web menu | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | virtual void removePluginWebMenu( QString name, QAction* action ) = 0; | |
| | | | |
| /** Add a dock widget to the main window */ | | /** Add a dock widget to the main window */ | |
| virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget * dock
widget ) = 0; | | virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget * dock
widget ) = 0; | |
| | | | |
| /** Remove specified dock widget from main window (doesn't delete it). | | /** Remove specified dock widget from main window (doesn't delete it). | |
| * @note Added in 1.1 | | * @note Added in 1.1 | |
| */ | | */ | |
| virtual void removeDockWidget( QDockWidget * dockwidget ) = 0; | | virtual void removeDockWidget( QDockWidget * dockwidget ) = 0; | |
| | | | |
| /** refresh the legend of a layer | | /** refresh the legend of a layer | |
| \deprecated use QgsLegendInterface::refreshLayerSymbology | | \deprecated use QgsLegendInterface::refreshLayerSymbology | |
| | | | |
| skipping to change at line 226 | | skipping to change at line 287 | |
| * An item can be inserted before any existing action. | | * An item can be inserted before any existing action. | |
| */ | | */ | |
| | | | |
| //! Menus | | //! Menus | |
| virtual QMenu *fileMenu() = 0; | | virtual QMenu *fileMenu() = 0; | |
| virtual QMenu *editMenu() = 0; | | virtual QMenu *editMenu() = 0; | |
| virtual QMenu *viewMenu() = 0; | | virtual QMenu *viewMenu() = 0; | |
| virtual QMenu *layerMenu() = 0; | | virtual QMenu *layerMenu() = 0; | |
| virtual QMenu *settingsMenu() = 0; | | virtual QMenu *settingsMenu() = 0; | |
| virtual QMenu *pluginMenu() = 0; | | virtual QMenu *pluginMenu() = 0; | |
|
| | | virtual QMenu *rasterMenu() = 0; | |
| | | /** \note added in 1.7 | |
| | | */ | |
| | | virtual QMenu *databaseMenu() = 0; | |
| | | /** \note added in 2.0 | |
| | | */ | |
| | | virtual QMenu *vectorMenu() = 0; | |
| | | /** \note added in 2.0 | |
| | | */ | |
| | | virtual QMenu *webMenu() = 0; | |
| virtual QMenu *firstRightStandardMenu() = 0; | | virtual QMenu *firstRightStandardMenu() = 0; | |
| virtual QMenu *windowMenu() = 0; | | virtual QMenu *windowMenu() = 0; | |
| virtual QMenu *helpMenu() = 0; | | virtual QMenu *helpMenu() = 0; | |
| | | | |
| //! ToolBars | | //! ToolBars | |
| virtual QToolBar *fileToolBar() = 0; | | virtual QToolBar *fileToolBar() = 0; | |
| virtual QToolBar *layerToolBar() = 0; | | virtual QToolBar *layerToolBar() = 0; | |
| virtual QToolBar *mapNavToolToolBar() = 0; | | virtual QToolBar *mapNavToolToolBar() = 0; | |
| virtual QToolBar *digitizeToolBar() = 0; | | virtual QToolBar *digitizeToolBar() = 0; | |
| virtual QToolBar *advancedDigitizeToolBar() = 0; // added in v1.5 | | virtual QToolBar *advancedDigitizeToolBar() = 0; // added in v1.5 | |
| virtual QToolBar *attributesToolBar() = 0; | | virtual QToolBar *attributesToolBar() = 0; | |
| virtual QToolBar *pluginToolBar() = 0; | | virtual QToolBar *pluginToolBar() = 0; | |
| virtual QToolBar *helpToolBar() = 0; | | virtual QToolBar *helpToolBar() = 0; | |
| /** \note added in 1.7 | | /** \note added in 1.7 | |
| */ | | */ | |
| virtual QToolBar *rasterToolBar() = 0; | | virtual QToolBar *rasterToolBar() = 0; | |
|
| | | /** \note added in 2.0 | |
| | | */ | |
| | | virtual QToolBar *vectorToolBar() = 0; | |
| | | /** \note added in 2.0 | |
| | | */ | |
| | | virtual QToolBar *databaseToolBar() = 0; | |
| | | /** \note added in 2.0 | |
| | | */ | |
| | | virtual QToolBar *webToolBar() = 0; | |
| | | | |
| //! File menu actions | | //! File menu actions | |
| virtual QAction *actionNewProject() = 0; | | virtual QAction *actionNewProject() = 0; | |
| virtual QAction *actionOpenProject() = 0; | | virtual QAction *actionOpenProject() = 0; | |
| #ifndef Q_MOC_RUN | | #ifndef Q_MOC_RUN | |
| Q_DECL_DEPRECATED | | Q_DECL_DEPRECATED | |
| #endif | | #endif | |
| virtual QAction *actionFileSeparator1() = 0; | | virtual QAction *actionFileSeparator1() = 0; | |
| virtual QAction *actionSaveProject() = 0; | | virtual QAction *actionSaveProject() = 0; | |
| virtual QAction *actionSaveProjectAs() = 0; | | virtual QAction *actionSaveProjectAs() = 0; | |
| | | | |
| skipping to change at line 277 | | skipping to change at line 357 | |
| virtual QAction *actionExit() = 0; | | virtual QAction *actionExit() = 0; | |
| | | | |
| //! Edit menu actions | | //! Edit menu actions | |
| virtual QAction *actionCutFeatures() = 0; | | virtual QAction *actionCutFeatures() = 0; | |
| virtual QAction *actionCopyFeatures() = 0; | | virtual QAction *actionCopyFeatures() = 0; | |
| virtual QAction *actionPasteFeatures() = 0; | | virtual QAction *actionPasteFeatures() = 0; | |
| #ifndef Q_MOC_RUN | | #ifndef Q_MOC_RUN | |
| Q_DECL_DEPRECATED | | Q_DECL_DEPRECATED | |
| #endif | | #endif | |
| virtual QAction *actionEditSeparator1() = 0; | | virtual QAction *actionEditSeparator1() = 0; | |
|
| | | virtual QAction *actionAddFeature() = 0; | |
| | | #ifndef Q_MOC_RUN | |
| | | Q_DECL_DEPRECATED | |
| | | #endif | |
| virtual QAction *actionCapturePoint() = 0; | | virtual QAction *actionCapturePoint() = 0; | |
|
| | | #ifndef Q_MOC_RUN | |
| | | Q_DECL_DEPRECATED | |
| | | #endif | |
| virtual QAction *actionCaptureLine() = 0; | | virtual QAction *actionCaptureLine() = 0; | |
|
| | | #ifndef Q_MOC_RUN | |
| | | Q_DECL_DEPRECATED | |
| | | #endif | |
| virtual QAction *actionCapturePolygon() = 0; | | virtual QAction *actionCapturePolygon() = 0; | |
| virtual QAction *actionDeleteSelected() = 0; | | virtual QAction *actionDeleteSelected() = 0; | |
| virtual QAction *actionMoveFeature() = 0; | | virtual QAction *actionMoveFeature() = 0; | |
| virtual QAction *actionSplitFeatures() = 0; | | virtual QAction *actionSplitFeatures() = 0; | |
| #ifndef Q_MOC_RUN | | #ifndef Q_MOC_RUN | |
| Q_DECL_DEPRECATED | | Q_DECL_DEPRECATED | |
| #endif | | #endif | |
| virtual QAction *actionAddVertex() = 0; | | virtual QAction *actionAddVertex() = 0; | |
| #ifndef Q_MOC_RUN | | #ifndef Q_MOC_RUN | |
| Q_DECL_DEPRECATED | | Q_DECL_DEPRECATED | |
| #endif | | #endif | |
| virtual QAction *actionDeleteVertex() = 0; | | virtual QAction *actionDeleteVertex() = 0; | |
| #ifndef Q_MOC_RUN | | #ifndef Q_MOC_RUN | |
| Q_DECL_DEPRECATED | | Q_DECL_DEPRECATED | |
| #endif | | #endif | |
| virtual QAction *actionMoveVertex() = 0; | | virtual QAction *actionMoveVertex() = 0; | |
| virtual QAction *actionAddRing() = 0; | | virtual QAction *actionAddRing() = 0; | |
|
| | | #ifndef Q_MOC_RUN | |
| | | Q_DECL_DEPRECATED | |
| | | #endif | |
| virtual QAction *actionAddIsland() = 0; | | virtual QAction *actionAddIsland() = 0; | |
|
| | | virtual QAction *actionAddPart() = 0; | |
| virtual QAction *actionSimplifyFeature() = 0; | | virtual QAction *actionSimplifyFeature() = 0; | |
| virtual QAction *actionDeleteRing() = 0; | | virtual QAction *actionDeleteRing() = 0; | |
| virtual QAction *actionDeletePart() = 0; | | virtual QAction *actionDeletePart() = 0; | |
| virtual QAction *actionNodeTool() = 0; | | virtual QAction *actionNodeTool() = 0; | |
| #ifndef Q_MOC_RUN | | #ifndef Q_MOC_RUN | |
| Q_DECL_DEPRECATED | | Q_DECL_DEPRECATED | |
| #endif | | #endif | |
| virtual QAction *actionEditSeparator2() = 0; | | virtual QAction *actionEditSeparator2() = 0; | |
| | | | |
| //! View menu actions | | //! View menu actions | |
| virtual QAction *actionPan() = 0; | | virtual QAction *actionPan() = 0; | |
|
| | | virtual QAction *actionPanToSelected() = 0; | |
| virtual QAction *actionZoomIn() = 0; | | virtual QAction *actionZoomIn() = 0; | |
| virtual QAction *actionZoomOut() = 0; | | virtual QAction *actionZoomOut() = 0; | |
| virtual QAction *actionSelect() = 0; | | virtual QAction *actionSelect() = 0; | |
| virtual QAction *actionSelectRectangle() = 0; | | virtual QAction *actionSelectRectangle() = 0; | |
| virtual QAction *actionSelectPolygon() = 0; | | virtual QAction *actionSelectPolygon() = 0; | |
| virtual QAction *actionSelectFreehand() = 0; | | virtual QAction *actionSelectFreehand() = 0; | |
| virtual QAction *actionSelectRadius() = 0; | | virtual QAction *actionSelectRadius() = 0; | |
| virtual QAction *actionIdentify() = 0; | | virtual QAction *actionIdentify() = 0; | |
| virtual QAction *actionMeasure() = 0; | | virtual QAction *actionMeasure() = 0; | |
| virtual QAction *actionMeasureArea() = 0; | | virtual QAction *actionMeasureArea() = 0; | |
| | | | |
End of changes. 11 change blocks. |
| 1 lines changed or deleted | | 100 lines changed or added | |
|
| qgsapplication.h | | qgsapplication.h | |
| | | | |
| skipping to change at line 15 | | skipping to change at line 15 | |
| Copyright : (C) 2006 by Tom Elwertowski | | Copyright : (C) 2006 by Tom Elwertowski | |
| Email : telwertowski at users dot sourceforge dot net | | Email : telwertowski at users dot sourceforge dot net | |
| **************************************************************************
* | | **************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| #ifndef QGSAPPLICATION_H | | #ifndef QGSAPPLICATION_H | |
| #define QGSAPPLICATION_H | | #define QGSAPPLICATION_H | |
| | | | |
| #include <QApplication> | | #include <QApplication> | |
| #include <QEvent> | | #include <QEvent> | |
|
| | | #include <QStringList> | |
| | | | |
| #include <qgis.h> | | #include <qgis.h> | |
| | | | |
|
| | | #define ABISYM(x) x ## VERSION_INT | |
| | | | |
| /** \ingroup core | | /** \ingroup core | |
| * Extends QApplication to provide access to QGIS specific resources such | | * Extends QApplication to provide access to QGIS specific resources such | |
| * as theme paths, database paths etc. | | * as theme paths, database paths etc. | |
| */ | | */ | |
| class CORE_EXPORT QgsApplication: public QApplication | | class CORE_EXPORT QgsApplication: public QApplication | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| public: | | public: | |
| //! @note customConfigDir parameter added in v1.6 | | //! @note customConfigDir parameter added in v1.6 | |
| QgsApplication( int & argc, char ** argv, bool GUIenabled, QString cust
omConfigPath = QString() ); | | QgsApplication( int & argc, char ** argv, bool GUIenabled, QString cust
omConfigPath = QString() ); | |
| virtual ~QgsApplication(); | | virtual ~QgsApplication(); | |
| | | | |
|
| | | /** This method initialises paths etc for QGIS. Called by the ctor or c | |
| | | all it manually | |
| | | when your app does not extend the QApplication class. | |
| | | @note you will probably want to call initQgis too to load the provi | |
| | | ders in | |
| | | the above case. | |
| | | */ | |
| | | static void init( QString customConfigPath = QString() ); | |
| | | | |
| //! Watch for QFileOpenEvent. | | //! Watch for QFileOpenEvent. | |
| virtual bool event( QEvent * event ); | | virtual bool event( QEvent * event ); | |
| | | | |
| //! Catch exceptions when sending event to receiver. | | //! Catch exceptions when sending event to receiver. | |
| virtual bool notify( QObject * receiver, QEvent * event ); | | virtual bool notify( QObject * receiver, QEvent * event ); | |
| | | | |
| //! Set the FileOpen event receiver | | //! Set the FileOpen event receiver | |
| static void setFileOpenEventReceiver( QObject * receiver ); | | static void setFileOpenEventReceiver( QObject * receiver ); | |
| | | | |
| /** Set the active theme to the specified theme. | | /** Set the active theme to the specified theme. | |
| | | | |
| skipping to change at line 88 | | skipping to change at line 97 | |
| @note this function was added in version 1.2*/ | | @note this function was added in version 1.2*/ | |
| static const QString donorsFilePath(); | | static const QString donorsFilePath(); | |
| | | | |
| /** | | /** | |
| * Returns the path to the sponsors file. | | * Returns the path to the sponsors file. | |
| * @note This was added in QGIS 1.1 | | * @note This was added in QGIS 1.1 | |
| */ | | */ | |
| static const QString translatorsFilePath(); | | static const QString translatorsFilePath(); | |
| | | | |
| //! Returns the path to the developer image directory. | | //! Returns the path to the developer image directory. | |
|
| static const QString developerPath(); | | //! @deprecated images are not provided anymore :-P | |
| | | Q_DECL_DEPRECATED static const QString developerPath(); | |
| | | | |
| //! Returns the path to the help application. | | //! Returns the path to the help application. | |
| static const QString helpAppPath(); | | static const QString helpAppPath(); | |
| | | | |
| //! Returns the path to the translation directory. | | //! Returns the path to the translation directory. | |
| static const QString i18nPath(); | | static const QString i18nPath(); | |
| | | | |
| //! Returns the path to the master qgis.db file. | | //! Returns the path to the master qgis.db file. | |
| static const QString qgisMasterDbFilePath(); | | static const QString qgisMasterDbFilePath(); | |
| | | | |
| | | | |
| skipping to change at line 148 | | skipping to change at line 158 | |
| //! First it tries to use the active theme path, then default theme pat
h | | //! First it tries to use the active theme path, then default theme pat
h | |
| //! @note Added in 1.5 | | //! @note Added in 1.5 | |
| static QString iconPath( QString iconFile ); | | static QString iconPath( QString iconFile ); | |
| | | | |
| //! Returns the path to user's style. Added in QGIS 1.4 | | //! Returns the path to user's style. Added in QGIS 1.4 | |
| static const QString userStyleV2Path(); | | static const QString userStyleV2Path(); | |
| | | | |
| //! Returns the path to default style (works as a starting point). Adde
d in QGIS 1.4 | | //! Returns the path to default style (works as a starting point). Adde
d in QGIS 1.4 | |
| static const QString defaultStyleV2Path(); | | static const QString defaultStyleV2Path(); | |
| | | | |
|
| | | //! Returns the path containing qgis_core, qgis_gui, qgispython (and ot | |
| | | her) libraries | |
| | | //! @note Added in 2.0 | |
| | | static const QString libraryPath(); | |
| | | | |
| | | //! Returns the path with utility executables (help viewer, crssync, .. | |
| | | .) | |
| | | //! @note Added in 2.0 | |
| | | static const QString libexecPath(); | |
| | | | |
| //! Alters prefix path - used by 3rd party apps | | //! Alters prefix path - used by 3rd party apps | |
| static void setPrefixPath( const QString thePrefixPath, bool useDefault
Paths = false ); | | static void setPrefixPath( const QString thePrefixPath, bool useDefault
Paths = false ); | |
| | | | |
| //! Alters plugin path - used by 3rd party apps | | //! Alters plugin path - used by 3rd party apps | |
| static void setPluginPath( const QString thePluginPath ); | | static void setPluginPath( const QString thePluginPath ); | |
| | | | |
| //! Alters pkg data path - used by 3rd party apps | | //! Alters pkg data path - used by 3rd party apps | |
| static void setPkgDataPath( const QString thePkgDataPath ); | | static void setPkgDataPath( const QString thePkgDataPath ); | |
| | | | |
| //! Alters default svg paths - used by 3rd party apps. Added in QGIS 1.
5 | | //! Alters default svg paths - used by 3rd party apps. Added in QGIS 1.
5 | |
| | | | |
| skipping to change at line 204 | | skipping to change at line 222 | |
| */ | | */ | |
| static void registerOgrDrivers(); | | static void registerOgrDrivers(); | |
| | | | |
| /**Converts absolute path to path relative to target | | /**Converts absolute path to path relative to target | |
| @note: this method was added in version 1.6*/ | | @note: this method was added in version 1.6*/ | |
| static QString absolutePathToRelativePath( QString apath, QString targe
tPath ); | | static QString absolutePathToRelativePath( QString apath, QString targe
tPath ); | |
| /**Converts path relative to target to an absolute path | | /**Converts path relative to target to an absolute path | |
| @note: this method was added in version 1.6*/ | | @note: this method was added in version 1.6*/ | |
| static QString relativePathToAbsolutePath( QString rpath, QString targe
tPath ); | | static QString relativePathToAbsolutePath( QString rpath, QString targe
tPath ); | |
| | | | |
|
| | | /** Indicates whether running from build directory (not installed) | |
| | | @note added in 2.0 */ | |
| | | static bool isRunningFromBuildDir() { return ABISYM( mRunningFromBuildD | |
| | | ir ); } | |
| | | #ifdef _MSC_VER | |
| | | static QString cfgIntDir() { return ABISYM( mCfgIntDir ); } | |
| | | #endif | |
| | | /** Returns path to the source directory. Valid only when running from | |
| | | build directory | |
| | | @note added in 2.0 */ | |
| | | static QString buildSourcePath() { return ABISYM( mBuildSourcePath ); } | |
| | | /** Returns path to the build output directory. Valid only when running | |
| | | from build directory | |
| | | @note added in 2.0 */ | |
| | | static QString buildOutputPath() { return ABISYM( mBuildOutputPath ); } | |
| | | | |
| | | /** Sets the GDAL_SKIP environment variable to include the specified dr | |
| | | iver | |
| | | * and then calls GDALDriverManager::AutoSkipDrivers() to unregister it | |
| | | . The | |
| | | * driver name should be the short format of the Gdal driver name e.g. | |
| | | GTIFF. | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | static void skipGdalDriver( QString theDriver ); | |
| | | | |
| | | /** Sets the GDAL_SKIP environment variable to exclude the specified dr | |
| | | iver | |
| | | * and then calls GDALDriverManager::AutoSkipDrivers() to unregister it | |
| | | . The | |
| | | * driver name should be the short format of the Gdal driver name e.g. | |
| | | GTIFF. | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | static void restoreGdalDriver( QString theDriver ); | |
| | | | |
| | | /** Returns the list of gdal drivers that should be skipped (based on | |
| | | * GDAL_SKIP environment variable) | |
| | | * @note added in 2.0 | |
| | | */ | |
| | | static QStringList skippedGdalDrivers( ) { return ABISYM( mGdalSkipList | |
| | | ); }; | |
| | | | |
| | | /** Apply the skipped drivers list to gdal | |
| | | * @see skipGdalDriver | |
| | | * @see restoreGdalDriver | |
| | | * @see skippedGdalDrivers | |
| | | * @note added in 2.0 */ | |
| | | static void applyGdalSkippedDrivers(); | |
| | | | |
| | | signals: | |
| | | void preNotify( QObject * receiver, QEvent * event, bool * done ); | |
| | | | |
| private: | | private: | |
|
| static QObject* mFileOpenEventReceiver; | | static QObject* ABISYM( mFileOpenEventReceiver ); | |
| static QStringList mFileOpenEventList; | | static QStringList ABISYM( mFileOpenEventList ); | |
| | | | |
|
| static QString mPrefixPath; | | static QString ABISYM( mPrefixPath ); | |
| static QString mPluginPath; | | static QString ABISYM( mPluginPath ); | |
| static QString mPkgDataPath; | | static QString ABISYM( mPkgDataPath ); | |
| static QString mThemeName; | | static QString ABISYM( mLibraryPath ); | |
| static QStringList mDefaultSvgPaths; | | static QString ABISYM( mLibexecPath ); | |
| | | static QString ABISYM( mThemeName ); | |
| | | static QStringList ABISYM( mDefaultSvgPaths ); | |
| | | | |
|
| static QString mConfigPath; | | static QString ABISYM( mConfigPath ); | |
| | | | |
| | | /** true when running from build directory, i.e. without 'make install' | |
| | | */ | |
| | | static bool ABISYM( mRunningFromBuildDir ); | |
| | | /** path to the source directory. valid only when running from build di | |
| | | rectory. */ | |
| | | static QString ABISYM( mBuildSourcePath ); | |
| | | #ifdef _MSC_VER | |
| | | /** configuration internal dir */ | |
| | | static QString ABISYM( mCfgIntDir ); | |
| | | #endif | |
| | | /** path to the output directory of the build. valid only when running | |
| | | from build directory */ | |
| | | static QString ABISYM( mBuildOutputPath ); | |
| | | /** List of gdal drivers to be skipped. Uses GDAL_SKIP to exclude them. | |
| | | * @see skipGdalDriver, restoreGdalDriver | |
| | | * @note added in 2.0 */ | |
| | | static QStringList ABISYM( mGdalSkipList ); | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 10 lines changed or deleted | | 105 lines changed or added | |
|
| qgsattributeaction.h | | qgsattributeaction.h | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| | | | |
| #ifndef QGSATTRIBUTEACTION_H | | #ifndef QGSATTRIBUTEACTION_H | |
| #define QGSATTRIBUTEACTION_H | | #define QGSATTRIBUTEACTION_H | |
| | | | |
| #include <QString> | | #include <QString> | |
| #include <QObject> | | #include <QObject> | |
| | | | |
| #include <qgsfeature.h> | | #include <qgsfeature.h> | |
| | | | |
| class QDomNode; | | class QDomNode; | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 50 | |
| class CORE_EXPORT QgsAction | | class CORE_EXPORT QgsAction | |
| { | | { | |
| public: | | public: | |
| enum ActionType | | enum ActionType | |
| { | | { | |
| Generic, | | Generic, | |
| GenericPython, | | GenericPython, | |
| Mac, | | Mac, | |
| Windows, | | Windows, | |
| Unix, | | Unix, | |
|
| | | OpenUrl, | |
| }; | | }; | |
| | | | |
| QgsAction( ActionType type, QString name, QString action, bool capture
) : | | QgsAction( ActionType type, QString name, QString action, bool capture
) : | |
| mType( type ), mName( name ), mAction( action ), mCaptureOutput( ca
pture ) {} | | mType( type ), mName( name ), mAction( action ), mCaptureOutput( ca
pture ) {} | |
| | | | |
| //! The name of the action | | //! The name of the action | |
| QString name() const { return mName; } | | QString name() const { return mName; } | |
| | | | |
| //! The action | | //! The action | |
| QString action() const { return mAction; } | | QString action() const { return mAction; } | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 73 | |
| ActionType type() const { return mType; } | | ActionType type() const { return mType; } | |
| | | | |
| //! Whether to capture output for display when this action is run | | //! Whether to capture output for display when this action is run | |
| bool capture() const { return mCaptureOutput; } | | bool capture() const { return mCaptureOutput; } | |
| | | | |
| //! Whether the action is runable on the current platform | | //! Whether the action is runable on the current platform | |
| bool runable() const | | bool runable() const | |
| { | | { | |
| return mType == Generic || | | return mType == Generic || | |
| mType == GenericPython || | | mType == GenericPython || | |
|
| | | mType == OpenUrl || | |
| #if defined(Q_OS_WIN) | | #if defined(Q_OS_WIN) | |
| mType == Windows | | mType == Windows | |
| #elif defined(Q_OS_MAC) | | #elif defined(Q_OS_MAC) | |
| mType == Mac | | mType == Mac | |
| #else | | #else | |
| mType == Unix | | mType == Unix | |
| #endif | | #endif | |
| ; | | ; | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 111 | | skipping to change at line 112 | |
| //! Destructor | | //! Destructor | |
| virtual ~QgsAttributeAction() {} | | virtual ~QgsAttributeAction() {} | |
| | | | |
| //! Add an action with the given name and action details. | | //! Add an action with the given name and action details. | |
| // Will happily have duplicate names and actions. If | | // Will happily have duplicate names and actions. If | |
| // capture is true, when running the action using doAction(), | | // capture is true, when running the action using doAction(), | |
| // any stdout from the process will be captured and displayed in a | | // any stdout from the process will be captured and displayed in a | |
| // dialog box. | | // dialog box. | |
| void addAction( QgsAction::ActionType type, QString name, QString actio
n, bool capture = false ); | | void addAction( QgsAction::ActionType type, QString name, QString actio
n, bool capture = false ); | |
| | | | |
|
| //! Does the action using the given values. defaultValueIndex is an | | /*! Does the action using the given values. defaultValueIndex is an | |
| // index into values which indicates which value in the values vector | | * index into values which indicates which value in the values vector | |
| // is to be used if the action has a default placeholder. | | * is to be used if the action has a default placeholder. | |
| // @note parameter executePython deprecated (and missing in python bind | | * @note parameter executePython deprecated (and missing in python bin | |
| ing) | | ding) | |
| | | * @deprecated | |
| | | */ | |
| | | Q_DECL_DEPRECATED void doAction( int index, | |
| | | const QgsAttributeMap &attributes, | |
| | | int defaultValueIndex = 0, | |
| | | void ( *executePython )( const QString | |
| | | & ) = 0 ); | |
| | | | |
| | | /*! Does the given values. defaultValueIndex is the index of the | |
| | | * field to be used if the action has a $currfield placeholder. | |
| | | * @note added in 1.9 | |
| | | */ | |
| void doAction( int index, | | void doAction( int index, | |
|
| const QgsAttributeMap &attributes, | | QgsFeature &feat, | |
| int defaultValueIndex = 0, | | int defaultValueIndex = 0 ); | |
| void ( *executePython )( const QString & ) = 0 ); | | | |
| | | /*! Does the action using the expression builder to expand it | |
| | | * and getting values from the passed feature attribute map. | |
| | | * substitutionMap is used to pass custom substitutions, to replace | |
| | | * each key in the map with the associated value | |
| | | * @note added in 1.9 | |
| | | */ | |
| | | void doAction( int index, | |
| | | QgsFeature &feat, | |
| | | const QMap<QString, QVariant> *substitutionMap = 0 ); | |
| | | | |
| //! Removes all actions | | //! Removes all actions | |
| void clearActions() { mActions.clear(); } | | void clearActions() { mActions.clear(); } | |
| | | | |
|
| //! Expands the given action, replacing all %'s with the value as | | //! Return the layer | |
| // given. | | QgsVectorLayer *layer() { return mLayer; } | |
| | | | |
| | | /*! Expands the given action, replacing all %'s with the value as | |
| | | * given. | |
| | | */ | |
| | | QString expandAction( QString action, const QgsAttributeMap &attributes | |
| | | , uint defaultValueIndex ); | |
| | | | |
| | | /*! Expands the given action using the expression builder | |
| | | * This function currently replaces each expression between [% and %] | |
| | | * placeholders in the action with the result of its evaluation on | |
| | | * the feature passed as argument. | |
| | | * | |
| | | * Additional substitutions can be passed through the substitutionMap | |
| | | * parameter | |
| | | * | |
| | | * @note added in 1.9 | |
| | | */ | |
| QString expandAction( QString action, | | QString expandAction( QString action, | |
|
| const QgsAttributeMap &attributes, | | QgsFeature &feat, | |
| uint defaultValueIndex ); | | const QMap<QString, QVariant> *substitutionMap = | |
| | | 0 ); | |
| | | | |
| //! Writes the actions out in XML format | | //! Writes the actions out in XML format | |
| bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const; | | bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const; | |
| | | | |
| //! Reads the actions in in XML format | | //! Reads the actions in in XML format | |
| bool readXML( const QDomNode& layer_node ); | | bool readXML( const QDomNode& layer_node ); | |
| | | | |
| int size() const { return mActions.size(); } | | int size() const { return mActions.size(); } | |
| QgsAction &at( int idx ) { return mActions[idx]; } | | QgsAction &at( int idx ) { return mActions[idx]; } | |
| QgsAction &operator[]( int idx ) { return mActions[idx]; } | | QgsAction &operator[]( int idx ) { return mActions[idx]; } | |
| | | | |
|
| | | //! @deprecated Initialize QgsPythonRunner instead | |
| static void setPythonExecute( void ( * )( const QString & ) ); | | static void setPythonExecute( void ( * )( const QString & ) ); | |
| | | | |
|
| | | //! Whether the action is the default action | |
| | | int defaultAction() const { return mDefaultAction < 0 || mDefaultAction | |
| | | >= size() ? 0 : mDefaultAction; } | |
| | | void setDefaultAction( int actionNumber ) { mDefaultAction = actionNumb | |
| | | er ; } | |
| | | | |
| private: | | private: | |
| QList<QgsAction> mActions; | | QList<QgsAction> mActions; | |
| QgsVectorLayer *mLayer; | | QgsVectorLayer *mLayer; | |
| static void ( *smPythonExecute )( const QString & ); | | static void ( *smPythonExecute )( const QString & ); | |
|
| | | | |
| | | void runAction( const QgsAction &action, | |
| | | void ( *executePython )( const QString & ) = 0 ); | |
| | | | |
| | | int mDefaultAction; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 13 lines changed or deleted | | 65 lines changed or added | |
|
| qgscomposeritem.h | | qgscomposeritem.h | |
| | | | |
| skipping to change at line 161 | | skipping to change at line 161 | |
| | | | |
| /** sets state from Dom document | | /** sets state from Dom document | |
| * @param itemElem is Dom node corresponding to item tag | | * @param itemElem is Dom node corresponding to item tag | |
| * @param doc is Dom document | | * @param doc is Dom document | |
| */ | | */ | |
| virtual bool readXML( const QDomElement& itemElem, const QDomDocument&
doc ) = 0; | | virtual bool readXML( const QDomElement& itemElem, const QDomDocument&
doc ) = 0; | |
| | | | |
| /**Reads parameter that are not subclass specific in document. Usually
called from readXML methods of subclasses*/ | | /**Reads parameter that are not subclass specific in document. Usually
called from readXML methods of subclasses*/ | |
| bool _readXML( const QDomElement& itemElem, const QDomDocument& doc ); | | bool _readXML( const QDomElement& itemElem, const QDomDocument& doc ); | |
| | | | |
|
| bool frame() const {return mFrame;} | | /** Whether this item has a frame or not. | |
| void setFrame( bool drawFrame ) {mFrame = drawFrame;} | | * @return boolean - true if there is a frame around this item, otherwi | |
| | | se false. | |
| | | * @note deprecated since 1.8 don't use! | |
| | | * @see hasFrame | |
| | | */ | |
| | | Q_DECL_DEPRECATED bool frame() const {return hasFrame();} | |
| | | /** Whether this item has a frame or not. | |
| | | * @returns true if there is a frame around this item, otherwise false. | |
| | | * @note introduced since 1.8 | |
| | | */ | |
| | | bool hasFrame() const {return mFrame;} | |
| | | /** Set whether this item has a frame drawn around it or not. | |
| | | * @returns void | |
| | | * @note deprecated since 1.8 don't use! | |
| | | * @see setFrameEnabled | |
| | | */ | |
| | | Q_DECL_DEPRECATED void setFrame( bool drawFrame ) { setFrameEnabled( dr | |
| | | awFrame );} | |
| | | /** Set whether this item has a frame drawn around it or not. | |
| | | * @param drawFrame draw frame | |
| | | * @returns nothing | |
| | | * @note introduced in 1.8 | |
| | | * @see hasFrame | |
| | | */ | |
| | | void setFrameEnabled( bool drawFrame ) {mFrame = drawFrame;} | |
| | | | |
| /**Composite operations for item groups do nothing per default*/ | | /**Composite operations for item groups do nothing per default*/ | |
| virtual void addItem( QgsComposerItem* item ) { Q_UNUSED( item ); } | | virtual void addItem( QgsComposerItem* item ) { Q_UNUSED( item ); } | |
| virtual void removeItems() {} | | virtual void removeItems() {} | |
| | | | |
| const QgsComposition* composition() const {return mComposition;} | | const QgsComposition* composition() const {return mComposition;} | |
| | | | |
| /**Starts new composer undo command | | /**Starts new composer undo command | |
| @param commandText command title | | @param commandText command title | |
| @param c context for mergeable commands (unknown for non-mergeable co
mmands*/ | | @param c context for mergeable commands (unknown for non-mergeable co
mmands*/ | |
| void beginCommand( const QString& commandText, QgsComposerMergeCommand:
:Context c = QgsComposerMergeCommand::Unknown ); | | void beginCommand( const QString& commandText, QgsComposerMergeCommand:
:Context c = QgsComposerMergeCommand::Unknown ); | |
| /**Finish current command and push it onto the undo stack */ | | /**Finish current command and push it onto the undo stack */ | |
| void endCommand(); | | void endCommand(); | |
| void cancelCommand(); | | void cancelCommand(); | |
| | | | |
| //functions that encapsulate the workaround for the Qt font bug (that i
s to scale the font size up and then scale the | | //functions that encapsulate the workaround for the Qt font bug (that i
s to scale the font size up and then scale the | |
| //painter down by the same factor for drawing | | //painter down by the same factor for drawing | |
| | | | |
| /**Draws Text. Takes care about all the composer specific issues (calcu
lation to pixel, scaling of font and painter | | /**Draws Text. Takes care about all the composer specific issues (calcu
lation to pixel, scaling of font and painter | |
|
| to work arount the Qt font bug)*/ | | to work around the Qt font bug)*/ | |
| void drawText( QPainter* p, double x, double y, const QString& text, co
nst QFont& font ) const; | | void drawText( QPainter* p, double x, double y, const QString& text, co
nst QFont& font ) const; | |
| | | | |
| /**Like the above, but with a rectangle for multiline text*/ | | /**Like the above, but with a rectangle for multiline text*/ | |
| void drawText( QPainter* p, const QRectF& rect, const QString& text, co
nst QFont& font, Qt::AlignmentFlag halignement = Qt::AlignLeft, Qt::Alignme
ntFlag valignement = Qt::AlignTop ) const; | | void drawText( QPainter* p, const QRectF& rect, const QString& text, co
nst QFont& font, Qt::AlignmentFlag halignement = Qt::AlignLeft, Qt::Alignme
ntFlag valignement = Qt::AlignTop ) const; | |
| | | | |
| /**Returns the font width in millimeters (considers upscaling and downs
caling with FONT_WORKAROUND_SCALE*/ | | /**Returns the font width in millimeters (considers upscaling and downs
caling with FONT_WORKAROUND_SCALE*/ | |
| double textWidthMillimeters( const QFont& font, const QString& text ) c
onst; | | double textWidthMillimeters( const QFont& font, const QString& text ) c
onst; | |
| | | | |
| /**Returns the font height of a character in millimeters | | /**Returns the font height of a character in millimeters | |
| @note this method was added in version 1.7*/ | | @note this method was added in version 1.7*/ | |
| | | | |
| skipping to change at line 218 | | skipping to change at line 240 | |
| /**Returns position lock for mouse drags (true means locked) | | /**Returns position lock for mouse drags (true means locked) | |
| @note this method was added in version 1.2*/ | | @note this method was added in version 1.2*/ | |
| bool positionLock() const {return mItemPositionLocked;} | | bool positionLock() const {return mItemPositionLocked;} | |
| | | | |
| /**Update mouse cursor at (item) position | | /**Update mouse cursor at (item) position | |
| @note this method was added in version 1.2*/ | | @note this method was added in version 1.2*/ | |
| void updateCursor( const QPointF& itemPos ); | | void updateCursor( const QPointF& itemPos ); | |
| | | | |
| double rotation() const {return mRotation;} | | double rotation() const {return mRotation;} | |
| | | | |
|
| | | /**Updates item, with the possibility to do custom update for subclasse | |
| | | s*/ | |
| | | virtual void updateItem() { QGraphicsRectItem::update(); } | |
| | | | |
| | | /**Get item identification name | |
| | | @note this method was added in version 1.7*/ | |
| | | QString id() const { return mId; } | |
| | | | |
| | | /**Set item identification name | |
| | | @note this method was added in version 1.7 | |
| | | This method was moved from qgscomposerlabel so that ev | |
| | | ery object can have a | |
| | | id (NathanW)*/ | |
| | | void setId( const QString& id ) { mId = id; } | |
| | | | |
| public slots: | | public slots: | |
| virtual void setRotation( double r ); | | virtual void setRotation( double r ); | |
| void repaint(); | | void repaint(); | |
| | | | |
| protected: | | protected: | |
| | | | |
| QgsComposition* mComposition; | | QgsComposition* mComposition; | |
| | | | |
| QgsComposerItem::MouseMoveAction mCurrentMouseMoveAction; | | QgsComposerItem::MouseMoveAction mCurrentMouseMoveAction; | |
| /**Start point of the last mouse move action (in scene coordinates)*/ | | /**Start point of the last mouse move action (in scene coordinates)*/ | |
| | | | |
| skipping to change at line 286 | | skipping to change at line 321 | |
| | | | |
| /**Draw background*/ | | /**Draw background*/ | |
| virtual void drawBackground( QPainter* p ); | | virtual void drawBackground( QPainter* p ); | |
| | | | |
| /**Draws arrowhead*/ | | /**Draws arrowhead*/ | |
| void drawArrowHead( QPainter* p, double x, double y, double angle, doub
le arrowHeadWidth ) const; | | void drawArrowHead( QPainter* p, double x, double y, double angle, doub
le arrowHeadWidth ) const; | |
| | | | |
| /**Returns angle of the line from p1 to p2 (clockwise, starting at N)*/ | | /**Returns angle of the line from p1 to p2 (clockwise, starting at N)*/ | |
| double angle( const QPointF& p1, const QPointF& p2 ) const; | | double angle( const QPointF& p1, const QPointF& p2 ) const; | |
| | | | |
|
| /**Returns the current (zoom level dependent) tolerance to decide if mo
use position is close enough to the \ | | /**Returns the current (zoom level dependent) tolerance to decide if mo
use position is close enough to the | |
| item border for resizing*/ | | item border for resizing*/ | |
| double rectHandlerBorderTolerance() const; | | double rectHandlerBorderTolerance() const; | |
| | | | |
| /**Returns the size of the lock symbol depending on the composer zoom l
evel and the item size | | /**Returns the size of the lock symbol depending on the composer zoom l
evel and the item size | |
| @note: this function was introduced in version 1.2*/ | | @note: this function was introduced in version 1.2*/ | |
| double lockSymbolSize() const; | | double lockSymbolSize() const; | |
| | | | |
| /**Returns the zoom factor of the graphics view. | | /**Returns the zoom factor of the graphics view. | |
| @return the factor or -1 in case of error (e.g. graphic view does not
exist) | | @return the factor or -1 in case of error (e.g. graphic view does not
exist) | |
| @note: this function was introduced in version 1.2*/ | | @note: this function was introduced in version 1.2*/ | |
| double horizontalViewScaleFactor() const; | | double horizontalViewScaleFactor() const; | |
| | | | |
| //some utility functions | | //some utility functions | |
| | | | |
| /**Calculates width and hight of the picture (in mm) such that it fits
into the item frame with the given rotation*/ | | /**Calculates width and hight of the picture (in mm) such that it fits
into the item frame with the given rotation*/ | |
| bool imageSizeConsideringRotation( double& width, double& height ) cons
t; | | bool imageSizeConsideringRotation( double& width, double& height ) cons
t; | |
| /**Calculates corner point after rotation and scaling*/ | | /**Calculates corner point after rotation and scaling*/ | |
| bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double wi
dth, double height ) const; | | bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double wi
dth, double height ) const; | |
|
| /**Returns a point on the line from startPoint to directionPoint that i | | | |
| s a certain distance away from the starting point*/ | | | |
| QPointF pointOnLineWithDistance( const QPointF& startPoint, const QPoin | | | |
| tF& directionPoint, double distance ) const; | | | |
| /**Calculates width / height of the bounding box of a rotated rectangle
(mRotation)*/ | | /**Calculates width / height of the bounding box of a rotated rectangle
(mRotation)*/ | |
| void sizeChangedByRotation( double& width, double& height ); | | void sizeChangedByRotation( double& width, double& height ); | |
| /**Rotates a point / vector | | /**Rotates a point / vector | |
| @param angle rotation angle in degrees, counterclockwise | | @param angle rotation angle in degrees, counterclockwise | |
| @param x in/out: x coordinate before / after the rotation | | @param x in/out: x coordinate before / after the rotation | |
| @param y in/out: y cooreinate before / after the rotation*/ | | @param y in/out: y cooreinate before / after the rotation*/ | |
| void rotate( double angle, double& x, double& y ) const; | | void rotate( double angle, double& x, double& y ) const; | |
| | | | |
| signals: | | signals: | |
| /**Is emitted on rotation change to notify north arrow pictures*/ | | /**Is emitted on rotation change to notify north arrow pictures*/ | |
| void rotationChanged( double newRotation ); | | void rotationChanged( double newRotation ); | |
| /**Used e.g. by the item widgets to update the gui elements*/ | | /**Used e.g. by the item widgets to update the gui elements*/ | |
| void itemChanged(); | | void itemChanged(); | |
|
| | | private: | |
| | | // Label id (unique within the same composition) | |
| | | QString mId; | |
| | | | |
| | | void init( bool manageZValue ); | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 8 lines changed or deleted | | 49 lines changed or added | |
|
| qgscomposerview.h | | qgscomposerview.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| #ifndef QGSCOMPOSERVIEW_H | | #ifndef QGSCOMPOSERVIEW_H | |
| #define QGSCOMPOSERVIEW_H | | #define QGSCOMPOSERVIEW_H | |
| | | | |
| #include <QGraphicsView> | | #include <QGraphicsView> | |
| #include "qgsaddremoveitemcommand.h" | | #include "qgsaddremoveitemcommand.h" | |
| | | | |
|
| | | class QDomDocument; | |
| | | class QDomElement; | |
| class QKeyEvent; | | class QKeyEvent; | |
| class QMainWindow; | | class QMainWindow; | |
| class QMouseEvent; | | class QMouseEvent; | |
| class QgsComposition; | | class QgsComposition; | |
| class QgsComposerArrow; | | class QgsComposerArrow; | |
| class QgsComposerItem; | | class QgsComposerItem; | |
| class QgsComposerLabel; | | class QgsComposerLabel; | |
| class QgsComposerLegend; | | class QgsComposerLegend; | |
| class QgsComposerMap; | | class QgsComposerMap; | |
| class QgsComposerPicture; | | class QgsComposerPicture; | |
| | | | |
| skipping to change at line 61 | | skipping to change at line 62 | |
| /**Current tool*/ | | /**Current tool*/ | |
| enum Tool | | enum Tool | |
| { | | { | |
| Select = 0, // Select/Move item | | Select = 0, // Select/Move item | |
| AddArrow, //add arrow | | AddArrow, //add arrow | |
| AddMap, // add new map | | AddMap, // add new map | |
| AddLegend, // add vector legend | | AddLegend, // add vector legend | |
| AddLabel, // add label | | AddLabel, // add label | |
| AddScalebar, // add scalebar | | AddScalebar, // add scalebar | |
| AddPicture, // add raster/vector picture | | AddPicture, // add raster/vector picture | |
|
| AddShape, //add shape item (ellipse, rectangle, triangle) | | AddRectangle, | |
| | | AddEllipse, | |
| | | AddTriangle, | |
| AddTable, //add attribute table | | AddTable, //add attribute table | |
| MoveItemContent //move content of item (e.g. content of map) | | MoveItemContent //move content of item (e.g. content of map) | |
| }; | | }; | |
| | | | |
| QgsComposerView( QWidget* parent = 0, const char* name = 0, Qt::WFlags
f = 0 ); | | QgsComposerView( QWidget* parent = 0, const char* name = 0, Qt::WFlags
f = 0 ); | |
| | | | |
| /**Add an item group containing the selected items*/ | | /**Add an item group containing the selected items*/ | |
| void groupItems(); | | void groupItems(); | |
| | | | |
| /**Ungroups the selected items*/ | | /**Ungroups the selected items*/ | |
| void ungroupItems(); | | void ungroupItems(); | |
| | | | |
| QgsComposerView::Tool currentTool() const {return mCurrentTool;} | | QgsComposerView::Tool currentTool() const {return mCurrentTool;} | |
| void setCurrentTool( QgsComposerView::Tool t ) {mCurrentTool = t;} | | void setCurrentTool( QgsComposerView::Tool t ) {mCurrentTool = t;} | |
| | | | |
| /**Sets composition (derived from QGraphicsScene)*/ | | /**Sets composition (derived from QGraphicsScene)*/ | |
| void setComposition( QgsComposition* c ); | | void setComposition( QgsComposition* c ); | |
| /**Returns the composition or 0 in case of error*/ | | /**Returns the composition or 0 in case of error*/ | |
| QgsComposition* composition(); | | QgsComposition* composition(); | |
| | | | |
|
| /**Adds an arrow item to the graphics scene and advices composer to cre | | | |
| ate a widget for it (through signal)*/ | | | |
| void addComposerArrow( QgsComposerArrow* arrow ); | | | |
| /**Adds label to the graphics scene and advices composer to create a wi | | | |
| dget for it (through signal)*/ | | | |
| void addComposerLabel( QgsComposerLabel* label ); | | | |
| /**Adds map to the graphics scene and advices composer to create a widg | | | |
| et for it (through signal)*/ | | | |
| void addComposerMap( QgsComposerMap* map ); | | | |
| /**Adds scale bar to the graphics scene and advices composer to create | | | |
| a widget for it (through signal)*/ | | | |
| void addComposerScaleBar( QgsComposerScaleBar* scaleBar ); | | | |
| /**Adds legend to the graphics scene and advices composer to create a w | | | |
| idget for it (through signal)*/ | | | |
| void addComposerLegend( QgsComposerLegend* legend ); | | | |
| /**Adds picture to the graphics scene and advices composer to create a | | | |
| widget for it (through signal)*/ | | | |
| void addComposerPicture( QgsComposerPicture* picture ); | | | |
| /**Adds a composer shape to the graphics scene and advices composer to | | | |
| create a widget for it (through signal)*/ | | | |
| void addComposerShape( QgsComposerShape* shape ); | | | |
| /**Adds a composer table to the graphics scene and advices composer to | | | |
| create a widget for it (through signal)*/ | | | |
| void addComposerTable( QgsComposerAttributeTable* table ); | | | |
| | | | |
| /**Returns the composer main window*/ | | /**Returns the composer main window*/ | |
| QMainWindow* composerWindow(); | | QMainWindow* composerWindow(); | |
| | | | |
| void setPaintingEnabled( bool enabled ) { mPaintingEnabled = enabled; } | | void setPaintingEnabled( bool enabled ) { mPaintingEnabled = enabled; } | |
| bool paintingEnabled() const { return mPaintingEnabled; } | | bool paintingEnabled() const { return mPaintingEnabled; } | |
| | | | |
|
| /**Convenience function to create a QgsAddRemoveItemCommand, connect it | | | |
| s signals and push it to the undo stack*/ | | | |
| void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, | | | |
| QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added ); | | | |
| | | | |
| protected: | | protected: | |
| void mousePressEvent( QMouseEvent* ); | | void mousePressEvent( QMouseEvent* ); | |
| void mouseReleaseEvent( QMouseEvent* ); | | void mouseReleaseEvent( QMouseEvent* ); | |
| void mouseMoveEvent( QMouseEvent* ); | | void mouseMoveEvent( QMouseEvent* ); | |
| void mouseDoubleClickEvent( QMouseEvent* e ); | | void mouseDoubleClickEvent( QMouseEvent* e ); | |
| | | | |
| void keyPressEvent( QKeyEvent * e ); | | void keyPressEvent( QKeyEvent * e ); | |
| void keyReleaseEvent( QKeyEvent * e ); | | void keyReleaseEvent( QKeyEvent * e ); | |
| | | | |
| void wheelEvent( QWheelEvent* event ); | | void wheelEvent( QWheelEvent* event ); | |
| | | | |
| void paintEvent( QPaintEvent* event ); | | void paintEvent( QPaintEvent* event ); | |
| | | | |
|
| | | void hideEvent( QHideEvent* e ); | |
| | | void showEvent( QShowEvent* e ); | |
| | | | |
| private: | | private: | |
| /**Status of shift key (used for multiple selection)*/ | | /**Status of shift key (used for multiple selection)*/ | |
| bool mShiftKeyPressed; | | bool mShiftKeyPressed; | |
| /**Current composer tool*/ | | /**Current composer tool*/ | |
| QgsComposerView::Tool mCurrentTool; | | QgsComposerView::Tool mCurrentTool; | |
| /**Rubber band item*/ | | /**Rubber band item*/ | |
| QGraphicsRectItem* mRubberBandItem; | | QGraphicsRectItem* mRubberBandItem; | |
| /**Rubber band item for arrows*/ | | /**Rubber band item for arrows*/ | |
| QGraphicsLineItem* mRubberBandLineItem; | | QGraphicsLineItem* mRubberBandLineItem; | |
| /**Item to move content*/ | | /**Item to move content*/ | |
| QgsComposerItem* mMoveContentItem; | | QgsComposerItem* mMoveContentItem; | |
| /**Start position of content move*/ | | /**Start position of content move*/ | |
| QPointF mMoveContentStartPos; | | QPointF mMoveContentStartPos; | |
| /**Start of rubber band creation*/ | | /**Start of rubber band creation*/ | |
| QPointF mRubberBandStartPos; | | QPointF mRubberBandStartPos; | |
| | | | |
| bool mPaintingEnabled; | | bool mPaintingEnabled; | |
| | | | |
|
| void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c ); | | /** Draw a shape on the canvas */ | |
| | | void addShape( Tool currentTool ); | |
| | | | |
|
| public slots: | | //void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c ); | |
| /**Casts object to the proper subclass type and calls corresponding ite | | | |
| mAdded signal*/ | | | |
| void sendItemAddedSignal( QgsComposerItem* item ); | | | |
| | | | |
| signals: | | signals: | |
| /**Is emitted when selected item changed. If 0, no item is selected*/ | | /**Is emitted when selected item changed. If 0, no item is selected*/ | |
| void selectedItemChanged( QgsComposerItem* selected ); | | void selectedItemChanged( QgsComposerItem* selected ); | |
|
| /**Is emitted when new composer arrow has been added to the view*/ | | | |
| void composerArrowAdded( QgsComposerArrow* arrow ); | | | |
| /**Is emitted when new composer label has been added to the view*/ | | | |
| void composerLabelAdded( QgsComposerLabel* label ); | | | |
| /**Is emitted when new composer map has been added to the view*/ | | | |
| void composerMapAdded( QgsComposerMap* map ); | | | |
| /**Is emitted when new composer scale bar has been added*/ | | | |
| void composerScaleBarAdded( QgsComposerScaleBar* scalebar ); | | | |
| /**Is emitted when a new composer legend has been added*/ | | | |
| void composerLegendAdded( QgsComposerLegend* legend ); | | | |
| /**Is emitted when a new composer picture has been added*/ | | | |
| void composerPictureAdded( QgsComposerPicture* picture ); | | | |
| /**Is emitted when a new composer shape has been added*/ | | | |
| void composerShapeAdded( QgsComposerShape* shape ); | | | |
| /**Is emitted when a new composer table has been added*/ | | | |
| void composerTableAdded( QgsComposerAttributeTable* table ); | | | |
| /**Is emitted when a composer item has been removed from the scene*/ | | | |
| void itemRemoved( QgsComposerItem* ); | | void itemRemoved( QgsComposerItem* ); | |
| /**Current action (e.g. adding composer map) has been finished. The pur
pose of this signal is that | | /**Current action (e.g. adding composer map) has been finished. The pur
pose of this signal is that | |
| QgsComposer may set the selection tool again*/ | | QgsComposer may set the selection tool again*/ | |
| void actionFinished(); | | void actionFinished(); | |
|
| | | | |
| | | /**Emitted before composerview is shown*/ | |
| | | void composerViewShow( QgsComposerView* ); | |
| | | /**Emitted before composerview is hidden*/ | |
| | | void composerViewHide( QgsComposerView* ); | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 54 lines changed or deleted | | 16 lines changed or added | |
|
| qgscomposition.h | | qgscomposition.h | |
| | | | |
| skipping to change at line 25 | | skipping to change at line 25 | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| #ifndef QGSCOMPOSITION_H | | #ifndef QGSCOMPOSITION_H | |
| #define QGSCOMPOSITION_H | | #define QGSCOMPOSITION_H | |
| | | | |
| #include <QDomDocument> | | #include <QDomDocument> | |
| #include <QGraphicsScene> | | #include <QGraphicsScene> | |
| #include <QLinkedList> | | #include <QLinkedList> | |
| #include <QUndoStack> | | #include <QUndoStack> | |
| | | | |
| #include "qgscomposeritemcommand.h" | | #include "qgscomposeritemcommand.h" | |
|
| | | #include "qgsaddremoveitemcommand.h" | |
| | | | |
| class QgsComposerItem; | | class QgsComposerItem; | |
| class QgsComposerMap; | | class QgsComposerMap; | |
| class QgsPaperItem; | | class QgsPaperItem; | |
| class QGraphicsRectItem; | | class QGraphicsRectItem; | |
| class QgsMapRenderer; | | class QgsMapRenderer; | |
|
| | | | |
| class QDomElement; | | class QDomElement; | |
|
| | | class QgsComposerArrow; | |
| | | class QgsComposerItem; | |
| | | class QgsComposerLabel; | |
| | | class QgsComposerLegend; | |
| | | class QgsComposerMap; | |
| | | class QgsComposerPicture; | |
| | | class QgsComposerScaleBar; | |
| | | class QgsComposerShape; | |
| | | class QgsComposerAttributeTable; | |
| | | | |
| /** \ingroup MapComposer | | /** \ingroup MapComposer | |
| * Graphics scene for map printing. The class manages the paper item which
always | | * Graphics scene for map printing. The class manages the paper item which
always | |
| * is the item in the back (z-value 0). It maintains the z-Values of the it
ems and stores | | * is the item in the back (z-value 0). It maintains the z-Values of the it
ems and stores | |
| * them in a list in ascending z-Order. This list can be changed to lower/r
aise items one position | | * them in a list in ascending z-Order. This list can be changed to lower/r
aise items one position | |
| * or to bring them to front/back. | | * or to bring them to front/back. | |
| * */ | | * */ | |
| class CORE_EXPORT QgsComposition: public QGraphicsScene | | class CORE_EXPORT QgsComposition: public QGraphicsScene | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 121 | |
| /**Returns the composer map with specified id | | /**Returns the composer map with specified id | |
| @return id or 0 pointer if the composer map item does not exist*/ | | @return id or 0 pointer if the composer map item does not exist*/ | |
| const QgsComposerMap* getComposerMapById( int id ) const; | | const QgsComposerMap* getComposerMapById( int id ) const; | |
| | | | |
| int printResolution() const {return mPrintResolution;} | | int printResolution() const {return mPrintResolution;} | |
| void setPrintResolution( int dpi ) {mPrintResolution = dpi;} | | void setPrintResolution( int dpi ) {mPrintResolution = dpi;} | |
| | | | |
| bool printAsRaster() const {return mPrintAsRaster;} | | bool printAsRaster() const {return mPrintAsRaster;} | |
| void setPrintAsRaster( bool enabled ) { mPrintAsRaster = enabled; } | | void setPrintAsRaster( bool enabled ) { mPrintAsRaster = enabled; } | |
| | | | |
|
| | | double selectionTolerance() const { return mSelectionTolerance; } | |
| | | void setSelectionTolerance( double tol ); | |
| | | | |
| /**Returns pointer to map renderer of qgis map canvas*/ | | /**Returns pointer to map renderer of qgis map canvas*/ | |
| QgsMapRenderer* mapRenderer() {return mMapRenderer;} | | QgsMapRenderer* mapRenderer() {return mMapRenderer;} | |
| | | | |
| QgsComposition::PlotStyle plotStyle() const {return mPlotStyle;} | | QgsComposition::PlotStyle plotStyle() const {return mPlotStyle;} | |
| void setPlotStyle( QgsComposition::PlotStyle style ) {mPlotStyle = styl
e;} | | void setPlotStyle( QgsComposition::PlotStyle style ) {mPlotStyle = styl
e;} | |
| | | | |
| /**Returns the pixel font size for a font that has point size set. | | /**Returns the pixel font size for a font that has point size set. | |
| The result depends on the resolution (dpi) and of the preview mode. Ea
ch item that sets | | The result depends on the resolution (dpi) and of the preview mode. Ea
ch item that sets | |
| a font should call this function before drawing text*/ | | a font should call this function before drawing text*/ | |
| int pixelFontSize( double pointSize ) const; | | int pixelFontSize( double pointSize ) const; | |
| | | | |
| /**Does the inverse calculation and returns points for pixels (equals t
o mm in QgsComposition)*/ | | /**Does the inverse calculation and returns points for pixels (equals t
o mm in QgsComposition)*/ | |
| double pointFontSize( int pixelSize ) const; | | double pointFontSize( int pixelSize ) const; | |
| | | | |
| /**Writes settings to xml (paper dimension)*/ | | /**Writes settings to xml (paper dimension)*/ | |
| bool writeXML( QDomElement& composerElem, QDomDocument& doc ); | | bool writeXML( QDomElement& composerElem, QDomDocument& doc ); | |
| | | | |
| /**Reads settings from xml file*/ | | /**Reads settings from xml file*/ | |
| bool readXML( const QDomElement& compositionElem, const QDomDocument& d
oc ); | | bool readXML( const QDomElement& compositionElem, const QDomDocument& d
oc ); | |
| | | | |
|
| | | /**Add items from XML representation to the graphics scene (for project | |
| | | file reading, pasting items from clipboard) | |
| | | @param elem items parent element, e.g. \verbatim <Composer> \endverba | |
| | | tim or \verbatim <ComposerItemClipboard> \endverbatim | |
| | | @param doc xml document | |
| | | @param mapsToRestore for reading from project file: set preview move | |
| | | 'rectangle' to all maps and save the preview states to show composer maps o | |
| | | n demand | |
| | | @param addUndoCommands insert AddItem commands if true (e.g. for copy | |
| | | /paste) | |
| | | @param pos item position. Optional, take position from xml if 0*/ | |
| | | void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, | |
| | | QMap< QgsComposerMap*, int >* mapsToRestore = 0, | |
| | | bool addUndoCommands = false, QPointF* pos = 0 ); | |
| | | | |
| /**Adds item to z list. Usually called from constructor of QgsComposerI
tem*/ | | /**Adds item to z list. Usually called from constructor of QgsComposerI
tem*/ | |
| void addItemToZList( QgsComposerItem* item ); | | void addItemToZList( QgsComposerItem* item ); | |
| /**Removes item from z list. Usually called from destructor of QgsCompo
serItem*/ | | /**Removes item from z list. Usually called from destructor of QgsCompo
serItem*/ | |
| void removeItemFromZList( QgsComposerItem* item ); | | void removeItemFromZList( QgsComposerItem* item ); | |
| | | | |
| //functions to move selected items in hierarchy | | //functions to move selected items in hierarchy | |
| void raiseSelectedItems(); | | void raiseSelectedItems(); | |
| void raiseItem( QgsComposerItem* item ); | | void raiseItem( QgsComposerItem* item ); | |
| void lowerSelectedItems(); | | void lowerSelectedItems(); | |
| void lowerItem( QgsComposerItem* item ); | | void lowerItem( QgsComposerItem* item ); | |
| | | | |
| skipping to change at line 173 | | skipping to change at line 194 | |
| @param item target item | | @param item target item | |
| @param commandText descriptive command text | | @param commandText descriptive command text | |
| @param c context for merge commands (unknown for non-mergeable comman
ds)*/ | | @param c context for merge commands (unknown for non-mergeable comman
ds)*/ | |
| void beginCommand( QgsComposerItem* item, const QString& commandText, Q
gsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown ); | | void beginCommand( QgsComposerItem* item, const QString& commandText, Q
gsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown ); | |
| | | | |
| /**Saves end state of item and pushes command to the undo history*/ | | /**Saves end state of item and pushes command to the undo history*/ | |
| void endCommand(); | | void endCommand(); | |
| /**Deletes current command*/ | | /**Deletes current command*/ | |
| void cancelCommand(); | | void cancelCommand(); | |
| | | | |
|
| | | /**Adds an arrow item to the graphics scene and advices composer to cre | |
| | | ate a widget for it (through signal)*/ | |
| | | void addComposerArrow( QgsComposerArrow* arrow ); | |
| | | /**Adds label to the graphics scene and advices composer to create a wi | |
| | | dget for it (through signal)*/ | |
| | | void addComposerLabel( QgsComposerLabel* label ); | |
| | | /**Adds map to the graphics scene and advices composer to create a widg | |
| | | et for it (through signal)*/ | |
| | | void addComposerMap( QgsComposerMap* map, bool setDefaultPreviewStyle = | |
| | | true ); | |
| | | /**Adds scale bar to the graphics scene and advices composer to create | |
| | | a widget for it (through signal)*/ | |
| | | void addComposerScaleBar( QgsComposerScaleBar* scaleBar ); | |
| | | /**Adds legend to the graphics scene and advices composer to create a w | |
| | | idget for it (through signal)*/ | |
| | | void addComposerLegend( QgsComposerLegend* legend ); | |
| | | /**Adds picture to the graphics scene and advices composer to create a | |
| | | widget for it (through signal)*/ | |
| | | void addComposerPicture( QgsComposerPicture* picture ); | |
| | | /**Adds a composer shape to the graphics scene and advices composer to | |
| | | create a widget for it (through signal)*/ | |
| | | void addComposerShape( QgsComposerShape* shape ); | |
| | | /**Adds a composer table to the graphics scene and advices composer to | |
| | | create a widget for it (through signal)*/ | |
| | | void addComposerTable( QgsComposerAttributeTable* table ); | |
| | | | |
| | | /**Remove item from the graphics scene. Additionally to QGraphicsScene: | |
| | | :removeItem, this function considers undo/redo command*/ | |
| | | void removeComposerItem( QgsComposerItem* item ); | |
| | | | |
| | | /**Convenience function to create a QgsAddRemoveItemCommand, connect it | |
| | | s signals and push it to the undo stack*/ | |
| | | void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, | |
| | | QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added ); | |
| | | | |
| | | public slots: | |
| | | /**Casts object to the proper subclass type and calls corresponding ite | |
| | | mAdded signal*/ | |
| | | void sendItemAddedSignal( QgsComposerItem* item ); | |
| | | | |
| private: | | private: | |
| /**Pointer to map renderer of QGIS main map*/ | | /**Pointer to map renderer of QGIS main map*/ | |
| QgsMapRenderer* mMapRenderer; | | QgsMapRenderer* mMapRenderer; | |
| QgsComposition::PlotStyle mPlotStyle; | | QgsComposition::PlotStyle mPlotStyle; | |
| QgsPaperItem* mPaperItem; | | QgsPaperItem* mPaperItem; | |
| | | | |
| /**Maintains z-Order of items. Starts with item at position 1 (position
0 is always paper item)*/ | | /**Maintains z-Order of items. Starts with item at position 1 (position
0 is always paper item)*/ | |
| QLinkedList<QgsComposerItem*> mItemZList; | | QLinkedList<QgsComposerItem*> mItemZList; | |
| | | | |
| /**Dpi for printout*/ | | /**Dpi for printout*/ | |
| int mPrintResolution; | | int mPrintResolution; | |
| | | | |
| /**Flag if map should be printed as a raster (via QImage). False by def
ault*/ | | /**Flag if map should be printed as a raster (via QImage). False by def
ault*/ | |
| bool mPrintAsRaster; | | bool mPrintAsRaster; | |
| | | | |
|
| | | /**Distance tolerance for item selection (in mm)*/ | |
| | | double mSelectionTolerance; | |
| | | | |
| /**Parameters for snap to grid function*/ | | /**Parameters for snap to grid function*/ | |
| bool mSnapToGrid; | | bool mSnapToGrid; | |
| double mSnapGridResolution; | | double mSnapGridResolution; | |
| double mSnapGridOffsetX; | | double mSnapGridOffsetX; | |
| double mSnapGridOffsetY; | | double mSnapGridOffsetY; | |
| QPen mGridPen; | | QPen mGridPen; | |
| GridStyle mGridStyle; | | GridStyle mGridStyle; | |
| | | | |
| QUndoStack mUndoStack; | | QUndoStack mUndoStack; | |
| | | | |
| | | | |
| skipping to change at line 209 | | skipping to change at line 260 | |
| | | | |
| QgsComposition(); //default constructor is forbidden | | QgsComposition(); //default constructor is forbidden | |
| | | | |
| /**Reset z-values of items based on position in z list*/ | | /**Reset z-values of items based on position in z list*/ | |
| void updateZValues(); | | void updateZValues(); | |
| | | | |
| /**Returns the bounding rectangle of the selected items in scene coordi
nates | | /**Returns the bounding rectangle of the selected items in scene coordi
nates | |
| @return 0 in case of success*/ | | @return 0 in case of success*/ | |
| int boundingRectOfSelectedItems( QRectF& bRect ); | | int boundingRectOfSelectedItems( QRectF& bRect ); | |
| | | | |
|
| void loadGridAppearanceSettings(); | | void loadSettings(); | |
| void saveGridAppearanceSettings(); | | void saveSettings(); | |
| | | | |
| | | void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c ); | |
| | | | |
| signals: | | signals: | |
| void paperSizeChanged(); | | void paperSizeChanged(); | |
|
| | | | |
| | | /**Is emitted when selected item changed. If 0, no item is selected*/ | |
| | | void selectedItemChanged( QgsComposerItem* selected ); | |
| | | /**Is emitted when new composer arrow has been added to the view*/ | |
| | | void composerArrowAdded( QgsComposerArrow* arrow ); | |
| | | /**Is emitted when new composer label has been added to the view*/ | |
| | | void composerLabelAdded( QgsComposerLabel* label ); | |
| | | /**Is emitted when new composer map has been added to the view*/ | |
| | | void composerMapAdded( QgsComposerMap* map ); | |
| | | /**Is emitted when new composer scale bar has been added*/ | |
| | | void composerScaleBarAdded( QgsComposerScaleBar* scalebar ); | |
| | | /**Is emitted when a new composer legend has been added*/ | |
| | | void composerLegendAdded( QgsComposerLegend* legend ); | |
| | | /**Is emitted when a new composer picture has been added*/ | |
| | | void composerPictureAdded( QgsComposerPicture* picture ); | |
| | | /**Is emitted when a new composer shape has been added*/ | |
| | | void composerShapeAdded( QgsComposerShape* shape ); | |
| | | /**Is emitted when a new composer table has been added*/ | |
| | | void composerTableAdded( QgsComposerAttributeTable* table ); | |
| | | /**Is emitted when a composer item has been removed from the scene*/ | |
| | | void itemRemoved( QgsComposerItem* ); | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 3 lines changed or deleted | | 96 lines changed or added | |
|
| qgscoordinatereferencesystem.h | | qgscoordinatereferencesystem.h | |
| | | | |
| skipping to change at line 173 | | skipping to change at line 173 | |
| | | | |
| /*! Set up this srs from a string definition, by default a WKT definiti
on. Otherwise | | /*! Set up this srs from a string definition, by default a WKT definiti
on. Otherwise | |
| * the string defines a authority, followed by a colon, followed by the
definition. | | * the string defines a authority, followed by a colon, followed by the
definition. | |
| * The authority can be one of "epsg", "postgis", "internal" for intege
r definitions, | | * The authority can be one of "epsg", "postgis", "internal" for intege
r definitions, | |
| * and "wkt" or "proj4" for string definitions. The implementation of
each authority | | * and "wkt" or "proj4" for string definitions. The implementation of
each authority | |
| * uses the corresponding createFrom... function. | | * uses the corresponding createFrom... function. | |
| * @param theDefinition A String containing a coordinate reference syst
em definition. | | * @param theDefinition A String containing a coordinate reference syst
em definition. | |
| */ | | */ | |
| bool createFromString( const QString theDefinition ); | | bool createFromString( const QString theDefinition ); | |
| | | | |
|
| | | /*! Set up this srs from a various text formats. | |
| | | * | |
| | | * Valid formats: WKT string, "EPSG:n", "EPSGA:n", "AUTO:proj_id,unit_i | |
| | | d,lon0,lat0", | |
| | | * "urn:ogc:def:crs:EPSG::n", PROJ.4 string, filename (with WKT, XML or | |
| | | PROJ.4 string), | |
| | | * well known name (such as NAD27, NAD83, WGS84 or WGS72), | |
| | | * ESRI::[WKT string] (directly or in a file), "IGNF:xxx" | |
| | | * | |
| | | * For more details on supported formats see OGRSpatialReference::SetFr | |
| | | omUserInput() | |
| | | * ( http://www.gdal.org/ogr/classOGRSpatialReference.html#aec3c6a49533 | |
| | | fe457ddc763d699ff8796 ) | |
| | | * @note this function generates a WKT string using OSRSetFromUserInput | |
| | | () and | |
| | | * passes it to createFromWkt() function. | |
| | | * @param theDefinition A String containing a coordinate reference syst | |
| | | em definition. | |
| | | */ | |
| | | bool createFromUserInput( const QString theDefinition ); | |
| | | | |
| | | /*! Make sure that ESRI WKT import is done properly. | |
| | | * This is required for proper shapefile CRS import when using gdal>= 1 | |
| | | .9. | |
| | | * @note This function is called by createFromUserInput() and QgsOgrPro | |
| | | vider::crs(), there is usually | |
| | | * no need to call it from elsewhere. | |
| | | * @note This function sets CPL config option GDAL_FIX_ESRI_WKT to a pr | |
| | | oper value, | |
| | | * unless it has been set by the user through the commandline or an env | |
| | | ironment variable. | |
| | | * For more details refer to OGRSpatialReference::morphFromESRI() . | |
| | | * @note added in 1.8 | |
| | | */ | |
| | | static void setupESRIWktFix(); | |
| | | | |
| /*! Find out whether this CRS is correctly initialised and usable */ | | /*! Find out whether this CRS is correctly initialised and usable */ | |
| bool isValid() const; | | bool isValid() const; | |
| | | | |
| /*! Perform some validation on this CRS. If the sts doesn't validate th
e | | /*! Perform some validation on this CRS. If the sts doesn't validate th
e | |
| * default behaviour settings for layers with unknown CRS will be | | * default behaviour settings for layers with unknown CRS will be | |
| * consulted and acted on accordingly. By hell or high water this | | * consulted and acted on accordingly. By hell or high water this | |
| * method will do its best to make sure that this CRS is valid - even | | * method will do its best to make sure that this CRS is valid - even | |
| * if that involves resorting to a hard coded default of geocs:wgs84. | | * if that involves resorting to a hard coded default of geocs:wgs84. | |
| * | | * | |
| * @note It is not usually necessary to use this function, unless you | | * @note It is not usually necessary to use this function, unless you | |
| | | | |
| skipping to change at line 203 | | skipping to change at line 229 | |
| * There are some gotchas with using ogr isSame() srs comparison, but | | * There are some gotchas with using ogr isSame() srs comparison, but | |
| * its more effective than using straight string comparison of proj4pa
rams. | | * its more effective than using straight string comparison of proj4pa
rams. | |
| * @note The ellipsoid and projection acronyms must be set as well as
the proj4string! | | * @note The ellipsoid and projection acronyms must be set as well as
the proj4string! | |
| * @return long the SrsId of the matched CRS | | * @return long the SrsId of the matched CRS | |
| */ | | */ | |
| long findMatchingProj(); | | long findMatchingProj(); | |
| | | | |
| /*! Overloaded == operator used to compare to CRS's. | | /*! Overloaded == operator used to compare to CRS's. | |
| * Internally it will delegate to the equals method described below | | * Internally it will delegate to the equals method described below | |
| */ | | */ | |
|
| bool operator==( const QgsCoordinateReferenceSystem &theSrs ); | | bool operator==( const QgsCoordinateReferenceSystem &theSrs ) const; | |
| /*! Overloaded != operator used to compare to CRS's. | | /*! Overloaded != operator used to compare to CRS's. | |
| * Returns opposite bool value to operator == | | * Returns opposite bool value to operator == | |
| */ | | */ | |
|
| bool operator!=( const QgsCoordinateReferenceSystem &theSrs ); | | bool operator!=( const QgsCoordinateReferenceSystem &theSrs ) const; | |
| /*! Overloaded == operator used to compare to CRS's. | | /*! Overloaded == operator used to compare to CRS's. | |
| * Internally it will use OGR isSameCRS() or isSameGeoCRS() methods as
appropriate. | | * Internally it will use OGR isSameCRS() or isSameGeoCRS() methods as
appropriate. | |
| * Additionally logic may also be applied if the result from the OGR m
ethods | | * Additionally logic may also be applied if the result from the OGR m
ethods | |
| * is inconclusive. | | * is inconclusive. | |
|
| | | * @deprecated in 1.8 as the same proj.4 string not necessarily means t
he same CRS | |
| */ | | */ | |
|
| bool equals( QString theProj4String ); | | Q_DECL_DEPRECATED bool equals( QString theProj4String ); | |
| | | | |
| /*! Restores state from the given Dom node. | | /*! Restores state from the given Dom node. | |
| * @param theNode The node from which state will be restored | | * @param theNode The node from which state will be restored | |
| * @return bool True on success, False on failure | | * @return bool True on success, False on failure | |
| */ | | */ | |
| bool readXML( QDomNode & theNode ); | | bool readXML( QDomNode & theNode ); | |
| /*! Stores state to the given Dom node in the given document. | | /*! Stores state to the given Dom node in the given document. | |
| * Below is an example of the generated tag. | | * Below is an example of the generated tag. | |
| \verbatim | | \verbatim | |
| <spatialrefsys> | | <spatialrefsys> | |
| | | | |
| skipping to change at line 309 | | skipping to change at line 336 | |
| * @return QString theProj4String Proj4 format specifies that define t
his srs. | | * @return QString theProj4String Proj4 format specifies that define t
his srs. | |
| * @note A zero length string will be returned if the toProj4 is uninit
ialised | | * @note A zero length string will be returned if the toProj4 is uninit
ialised | |
| */ | | */ | |
| QString toProj4() const; | | QString toProj4() const; | |
| | | | |
| /*! Get this Geographic? flag | | /*! Get this Geographic? flag | |
| * @return bool theGeoFlag Whether this is a geographic or projected c
oordinate system | | * @return bool theGeoFlag Whether this is a geographic or projected c
oordinate system | |
| */ | | */ | |
| bool geographicFlag() const; | | bool geographicFlag() const; | |
| | | | |
|
| | | /*! return if axis is inverted (eg. for WMS 1.3) | |
| | | * @return bool Whether this is crs axis is inverted | |
| | | * @note added in 1.9.90 | |
| | | */ | |
| | | bool axisInverted() const; | |
| | | | |
| /*! Get the units that the projection is in | | /*! Get the units that the projection is in | |
| * @return QGis::UnitType that gives the units for the coordinate syste
m | | * @return QGis::UnitType that gives the units for the coordinate syste
m | |
| */ | | */ | |
| QGis::UnitType mapUnits() const; | | QGis::UnitType mapUnits() const; | |
| | | | |
| // Mutators ----------------------------------- | | // Mutators ----------------------------------- | |
| /*! Set user hint for validation | | /*! Set user hint for validation | |
| */ | | */ | |
| void setValidationHint( QString html ); | | void setValidationHint( QString html ); | |
| | | | |
| /*! Get user hint for validation | | /*! Get user hint for validation | |
| */ | | */ | |
| QString validationHint(); | | QString validationHint(); | |
|
| | | /*! Update proj.4 parameters in our database from proj.4 | |
| | | * @returns number of updated CRS on success and | |
| | | * negative number of failed updates in case of errors. | |
| | | * @note added in 1.8 | |
| | | */ | |
| | | static int syncDb(); | |
| | | | |
| // Mutators ----------------------------------- | | // Mutators ----------------------------------- | |
| // We don't want to expose these to the public api since they wont crea
te | | // We don't want to expose these to the public api since they wont crea
te | |
| // a fully valid crs. Programmers should use the createFrom* methods ra
ther | | // a fully valid crs. Programmers should use the createFrom* methods ra
ther | |
| private: | | private: | |
| /** A static helper function to find out the proj4 string for a srsid | | /** A static helper function to find out the proj4 string for a srsid | |
| * @param theSrsId The srsid used for the lookup | | * @param theSrsId The srsid used for the lookup | |
| * @return QString The proj4 string | | * @return QString The proj4 string | |
| */ | | */ | |
| static QString proj4FromSrsId( const int theSrsId ); | | static QString proj4FromSrsId( const int theSrsId ); | |
| | | | |
| | | | |
| skipping to change at line 345 | | skipping to change at line 385 | |
| void setInternalId( long theSrsId ); | | void setInternalId( long theSrsId ); | |
| /*! Set the postgis srid | | /*! Set the postgis srid | |
| * @param theSrid The postgis spatial_ref_sys key for this srs | | * @param theSrid The postgis spatial_ref_sys key for this srs | |
| */ | | */ | |
| void setSrid( long theSrid ); | | void setSrid( long theSrid ); | |
| /*! Set the Description | | /*! Set the Description | |
| * @param theDescription A textual description of the srs. | | * @param theDescription A textual description of the srs. | |
| */ | | */ | |
| void setDescription( QString theDescription ); | | void setDescription( QString theDescription ); | |
| /* Set the Proj Proj4String. | | /* Set the Proj Proj4String. | |
|
| * @param QString theProj4String Proj4 format specifies (excluding pro | | * @param QString theProj4String Proj4 format specifies | |
| j and ellips) that define this srs. | | * (excluding proj and ellips) that define this srs. | |
| | | * @note some content of the PROJ4 string may be stripped off by this | |
| | | * method due to the parsing of the string by OSRNewSpatialReference . | |
| | | * For example input: | |
| | | * +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs | |
| | | * Gets stored in the CRS as: | |
| | | * +proj=longlat +datum=WGS84 +no_defs | |
| */ | | */ | |
| void setProj4String( QString theProj4String ); | | void setProj4String( QString theProj4String ); | |
| /*! Set this Geographic? flag | | /*! Set this Geographic? flag | |
| * @param theGeoFlag Whether this is a geographic or projected coordina
te system | | * @param theGeoFlag Whether this is a geographic or projected coordina
te system | |
| */ | | */ | |
| void setGeographicFlag( bool theGeoFlag ); | | void setGeographicFlag( bool theGeoFlag ); | |
| | | | |
| /*! Set the EpsgCrsId identifier for this srs | | /*! Set the EpsgCrsId identifier for this srs | |
| * @param theEpsg the ESPG identifier for this srs (defaults to 0) | | * @param theEpsg the ESPG identifier for this srs (defaults to 0) | |
| */ | | */ | |
| | | | |
| skipping to change at line 385 | | skipping to change at line 432 | |
| /*! A string based associative array used for passing records around */ | | /*! A string based associative array used for passing records around */ | |
| typedef QMap<QString, QString> RecordMap; | | typedef QMap<QString, QString> RecordMap; | |
| /*! Get a record from the srs.db or qgis.db backends, given an sql stat
ment. | | /*! Get a record from the srs.db or qgis.db backends, given an sql stat
ment. | |
| * @note only handles queries that return a single record. | | * @note only handles queries that return a single record. | |
| * @note it will first try the system srs.db then the users qgis.db! | | * @note it will first try the system srs.db then the users qgis.db! | |
| * @param theSql The sql query to execute | | * @param theSql The sql query to execute | |
| * @return An associative array of field name <-> value pairs | | * @return An associative array of field name <-> value pairs | |
| */ | | */ | |
| RecordMap getRecord( QString theSql ); | | RecordMap getRecord( QString theSql ); | |
| | | | |
|
| // Open SQLite db and show message if ccannot be opened | | // Open SQLite db and show message if cannot be opened | |
| // returns the same code as sqlite3_open | | // returns the same code as sqlite3_open | |
|
| static int openDb( QString path, sqlite3 **db ); | | static int openDb( QString path, sqlite3 **db, bool readonly = true ); | |
| | | | |
| //!The internal sqlite3 srs.db primary key for this srs | | //!The internal sqlite3 srs.db primary key for this srs | |
| long mSrsId; | | long mSrsId; | |
| //!A textual description of the srs. | | //!A textual description of the srs. | |
| QString mDescription; | | QString mDescription; | |
| //!The official proj4 acronym for the projection family | | //!The official proj4 acronym for the projection family | |
| QString mProjectionAcronym ; | | QString mProjectionAcronym ; | |
| //!The official proj4 acronym for the ellipoid | | //!The official proj4 acronym for the ellipoid | |
| QString mEllipsoidAcronym; | | QString mEllipsoidAcronym; | |
| //!Whether this is a geographic or projected coordinate system | | //!Whether this is a geographic or projected coordinate system | |
| | | | |
| skipping to change at line 418 | | skipping to change at line 465 | |
| //! Work out the projection units and set the appropriate local variabl
e | | //! Work out the projection units and set the appropriate local variabl
e | |
| void setMapUnits(); | | void setMapUnits(); | |
| | | | |
| //! Save the proj4-string as a custom CRS | | //! Save the proj4-string as a custom CRS | |
| bool saveAsUserCRS(); | | bool saveAsUserCRS(); | |
| | | | |
| //! Helper for getting number of user CRS already in db | | //! Helper for getting number of user CRS already in db | |
| long getRecordCount(); | | long getRecordCount(); | |
| | | | |
| //! Helper for sql-safe value quoting | | //! Helper for sql-safe value quoting | |
|
| QString quotedValue( QString value ); | | static QString quotedValue( QString value ); | |
| | | | |
| void *mCRS; | | void *mCRS; | |
| | | | |
| bool loadFromDb( QString db, QString expression, QString value ); | | bool loadFromDb( QString db, QString expression, QString value ); | |
| | | | |
| QString mValidationHint; | | QString mValidationHint; | |
|
| | | mutable QString mWkt; | |
| | | | |
| | | //!Whether this is a coordinate system has inverted axis | |
| | | mutable int mAxisInverted; | |
| | | | |
| static CUSTOM_CRS_VALIDATION mCustomSrsValidation; | | static CUSTOM_CRS_VALIDATION mCustomSrsValidation; | |
| }; | | }; | |
| | | | |
| //! Output stream operator | | //! Output stream operator | |
| inline std::ostream& operator << ( std::ostream& os, const QgsCoordinateRef
erenceSystem &r ) | | inline std::ostream& operator << ( std::ostream& os, const QgsCoordinateRef
erenceSystem &r ) | |
| { | | { | |
| QString mySummary( "\n\tSpatial Reference System:" ); | | QString mySummary( "\n\tSpatial Reference System:" ); | |
| mySummary += "\n\t\tDescription : "; | | mySummary += "\n\t\tDescription : "; | |
| if ( !r.description().isNull() ) | | if ( !r.description().isNull() ) | |
| | | | |
End of changes. 12 change blocks. |
| 8 lines changed or deleted | | 68 lines changed or added | |
|
| qgsfillsymbollayerv2.h | | qgsfillsymbollayerv2.h | |
|
| | | /************************************************************************** | |
| | | * | |
| | | qgsfillsymbollayerv2.h | |
| | | --------------------- | |
| | | begin : November 2009 | |
| | | copyright : (C) 2009 by Martin Dobias | |
| | | email : wonder.sk at gmail.com | |
| | | ************************************************************************** | |
| | | * | |
| | | * | |
| | | * | |
| | | * This program is free software; you can redistribute it and/or modify | |
| | | * | |
| | | * it under the terms of the GNU General Public License as published by | |
| | | * | |
| | | * the Free Software Foundation; either version 2 of the License, or | |
| | | * | |
| | | * (at your option) any later version. | |
| | | * | |
| | | * | |
| | | * | |
| | | ************************************************************************** | |
| | | */ | |
| | | | |
| #ifndef QGSFILLSYMBOLLAYERV2_H | | #ifndef QGSFILLSYMBOLLAYERV2_H | |
| #define QGSFILLSYMBOLLAYERV2_H | | #define QGSFILLSYMBOLLAYERV2_H | |
| | | | |
| #include "qgssymbollayerv2.h" | | #include "qgssymbollayerv2.h" | |
| | | | |
| #define DEFAULT_SIMPLEFILL_COLOR QColor(0,0,255) | | #define DEFAULT_SIMPLEFILL_COLOR QColor(0,0,255) | |
| #define DEFAULT_SIMPLEFILL_STYLE Qt::SolidPattern | | #define DEFAULT_SIMPLEFILL_STYLE Qt::SolidPattern | |
| #define DEFAULT_SIMPLEFILL_BORDERCOLOR QColor(0,0,0) | | #define DEFAULT_SIMPLEFILL_BORDERCOLOR QColor(0,0,0) | |
| #define DEFAULT_SIMPLEFILL_BORDERSTYLE Qt::SolidLine | | #define DEFAULT_SIMPLEFILL_BORDERSTYLE Qt::SolidLine | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 42 | |
| public: | | public: | |
| QgsSimpleFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR, | | QgsSimpleFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR, | |
| Qt::BrushStyle style = DEFAULT_SIMPLEFILL_S
TYLE, | | Qt::BrushStyle style = DEFAULT_SIMPLEFILL_S
TYLE, | |
| QColor borderColor = DEFAULT_SIMPLEFILL_BOR
DERCOLOR, | | QColor borderColor = DEFAULT_SIMPLEFILL_BOR
DERCOLOR, | |
| Qt::PenStyle borderStyle = DEFAULT_SIMPLEFI
LL_BORDERSTYLE, | | Qt::PenStyle borderStyle = DEFAULT_SIMPLEFI
LL_BORDERSTYLE, | |
| double borderWidth = DEFAULT_SIMPLEFILL_BOR
DERWIDTH ); | | double borderWidth = DEFAULT_SIMPLEFILL_BOR
DERWIDTH ); | |
| | | | |
| // static stuff | | // static stuff | |
| | | | |
| static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | |
|
| | | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |
| | | | |
| // implemented from base classes | | // implemented from base classes | |
| | | | |
| QString layerType() const; | | QString layerType() const; | |
| | | | |
| void startRender( QgsSymbolV2RenderContext& context ); | | void startRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void stopRender( QgsSymbolV2RenderContext& context ); | | void stopRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q
gsSymbolV2RenderContext& context ); | | void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q
gsSymbolV2RenderContext& context ); | |
| | | | |
| QgsStringMap properties() const; | | QgsStringMap properties() const; | |
| | | | |
| QgsSymbolLayerV2* clone() const; | | QgsSymbolLayerV2* clone() const; | |
| | | | |
|
| | | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props | |
| | | ) const; | |
| | | | |
| Qt::BrushStyle brushStyle() const { return mBrushStyle; } | | Qt::BrushStyle brushStyle() const { return mBrushStyle; } | |
| void setBrushStyle( Qt::BrushStyle style ) { mBrushStyle = style; } | | void setBrushStyle( Qt::BrushStyle style ) { mBrushStyle = style; } | |
| | | | |
| QColor borderColor() const { return mBorderColor; } | | QColor borderColor() const { return mBorderColor; } | |
| void setBorderColor( QColor borderColor ) { mBorderColor = borderColor;
} | | void setBorderColor( QColor borderColor ) { mBorderColor = borderColor;
} | |
| | | | |
| Qt::PenStyle borderStyle() const { return mBorderStyle; } | | Qt::PenStyle borderStyle() const { return mBorderStyle; } | |
| void setBorderStyle( Qt::PenStyle borderStyle ) { mBorderStyle = border
Style; } | | void setBorderStyle( Qt::PenStyle borderStyle ) { mBorderStyle = border
Style; } | |
| | | | |
| double borderWidth() const { return mBorderWidth; } | | double borderWidth() const { return mBorderWidth; } | |
| | | | |
| skipping to change at line 70 | | skipping to change at line 87 | |
| QBrush mSelBrush; | | QBrush mSelBrush; | |
| Qt::BrushStyle mBrushStyle; | | Qt::BrushStyle mBrushStyle; | |
| QColor mBorderColor; | | QColor mBorderColor; | |
| Qt::PenStyle mBorderStyle; | | Qt::PenStyle mBorderStyle; | |
| double mBorderWidth; | | double mBorderWidth; | |
| QPen mPen; | | QPen mPen; | |
| | | | |
| QPointF mOffset; | | QPointF mOffset; | |
| }; | | }; | |
| | | | |
|
| | | /**Base class for polygon renderers generating texture images*/ | |
| | | class CORE_EXPORT QgsImageFillSymbolLayer: public QgsFillSymbolLayerV2 | |
| | | { | |
| | | public: | |
| | | QgsImageFillSymbolLayer(); | |
| | | virtual ~QgsImageFillSymbolLayer(); | |
| | | void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q | |
| | | gsSymbolV2RenderContext& context ); | |
| | | | |
| | | virtual QgsSymbolV2* subSymbol() { return mOutline; } | |
| | | virtual bool setSubSymbol( QgsSymbolV2* symbol ); | |
| | | | |
| | | protected: | |
| | | QBrush mBrush; | |
| | | | |
| | | /**Outline width*/ | |
| | | double mOutlineWidth; | |
| | | /**Custom outline*/ | |
| | | QgsLineSymbolV2* mOutline; | |
| | | }; | |
| | | | |
| /**A class for svg fill patterns. The class automatically scales the patter
n to | | /**A class for svg fill patterns. The class automatically scales the patter
n to | |
| the appropriate pixel dimensions of the output device*/ | | the appropriate pixel dimensions of the output device*/ | |
|
| class CORE_EXPORT QgsSVGFillSymbolLayer: public QgsFillSymbolLayerV2 | | class CORE_EXPORT QgsSVGFillSymbolLayer: public QgsImageFillSymbolLayer | |
| { | | { | |
| public: | | public: | |
| QgsSVGFillSymbolLayer( const QString& svgFilePath = "", double width =
20, double rotation = 0.0 ); | | QgsSVGFillSymbolLayer( const QString& svgFilePath = "", double width =
20, double rotation = 0.0 ); | |
| QgsSVGFillSymbolLayer( const QByteArray& svgData, double width = 20, do
uble rotation = 0.0 ); | | QgsSVGFillSymbolLayer( const QByteArray& svgData, double width = 20, do
uble rotation = 0.0 ); | |
| ~QgsSVGFillSymbolLayer(); | | ~QgsSVGFillSymbolLayer(); | |
| | | | |
| static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | |
|
| | | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |
| | | | |
| // implemented from base classes | | // implemented from base classes | |
| | | | |
| QString layerType() const; | | QString layerType() const; | |
| | | | |
| void startRender( QgsSymbolV2RenderContext& context ); | | void startRender( QgsSymbolV2RenderContext& context ); | |
| void stopRender( QgsSymbolV2RenderContext& context ); | | void stopRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
|
| void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q | | | |
| gsSymbolV2RenderContext& context ); | | | |
| | | | |
| QgsStringMap properties() const; | | QgsStringMap properties() const; | |
| | | | |
| QgsSymbolLayerV2* clone() const; | | QgsSymbolLayerV2* clone() const; | |
| | | | |
|
| | | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props | |
| | | ) const; | |
| | | | |
| //getters and setters | | //getters and setters | |
| void setSvgFilePath( const QString& svgPath ); | | void setSvgFilePath( const QString& svgPath ); | |
| QString svgFilePath() const { return mSvgFilePath; } | | QString svgFilePath() const { return mSvgFilePath; } | |
| void setPatternWidth( double width ) { mPatternWidth = width;} | | void setPatternWidth( double width ) { mPatternWidth = width;} | |
| double patternWidth() const { return mPatternWidth; } | | double patternWidth() const { return mPatternWidth; } | |
| | | | |
|
| QgsSymbolV2* subSymbol() { return mOutline; } | | void setSvgFillColor( const QColor& c ) { mSvgFillColor = c; } | |
| bool setSubSymbol( QgsSymbolV2* symbol ); | | QColor svgFillColor() const { return mSvgFillColor; } | |
| | | void setSvgOutlineColor( const QColor& c ) { mSvgOutlineColor = c; } | |
| | | QColor svgOutlineColor() const { return mSvgOutlineColor; } | |
| | | void setSvgOutlineWidth( double w ) { mSvgOutlineWidth = w; } | |
| | | double svgOutlineWidth() const { return mSvgOutlineWidth; } | |
| | | | |
| protected: | | protected: | |
| /**Width of the pattern (in QgsSymbolV2 output units)*/ | | /**Width of the pattern (in QgsSymbolV2 output units)*/ | |
| double mPatternWidth; | | double mPatternWidth; | |
| /**SVG data*/ | | /**SVG data*/ | |
| QByteArray mSvgData; | | QByteArray mSvgData; | |
| /**Path to the svg file (or empty if constructed directly from data)*/ | | /**Path to the svg file (or empty if constructed directly from data)*/ | |
| QString mSvgFilePath; | | QString mSvgFilePath; | |
| /**SVG view box (to keep the aspect ratio */ | | /**SVG view box (to keep the aspect ratio */ | |
| QRectF mSvgViewBox; | | QRectF mSvgViewBox; | |
|
| /**Brush that receives rendered pixel image in startRender() method*/ | | | |
| QBrush mBrush; | | //param(fill), param(outline), param(outline-width) are going | |
| /**Outline width*/ | | //to be replaced in memory | |
| double mOutlineWidth; | | QColor mSvgFillColor; | |
| /**Custom outline*/ | | QColor mSvgOutlineColor; | |
| QgsLineSymbolV2* mOutline; | | double mSvgOutlineWidth; | |
| | | | |
| private: | | private: | |
| /**Helper function that gets the view box from the byte array*/ | | /**Helper function that gets the view box from the byte array*/ | |
| void storeViewBox(); | | void storeViewBox(); | |
|
| | | void setDefaultSvgParams(); //fills mSvgFillColor, mSvgOutlineColor, mS | |
| | | vgOutlineWidth with default values for mSvgFilePath | |
| | | }; | |
| | | | |
| | | class CORE_EXPORT QgsLinePatternFillSymbolLayer: public QgsImageFillSymbolL | |
| | | ayer | |
| | | { | |
| | | public: | |
| | | QgsLinePatternFillSymbolLayer(); | |
| | | ~QgsLinePatternFillSymbolLayer(); | |
| | | | |
| | | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt | |
| | | ringMap() ); | |
| | | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |
| | | | |
| | | QString layerType() const; | |
| | | | |
| | | void startRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| | | void stopRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| | | QgsStringMap properties() const; | |
| | | | |
| | | QgsSymbolLayerV2* clone() const; | |
| | | | |
| | | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props | |
| | | ) const; | |
| | | | |
| | | //getters and setters | |
| | | void setLineAngle( double a ) { mLineAngle = a; } | |
| | | double lineAngle() const { return mLineAngle; } | |
| | | void setDistance( double d ) { mDistance = d; } | |
| | | double distance() const { return mDistance; } | |
| | | void setLineWidth( double w ) { mLineWidth = w; } | |
| | | double lineWidth() const { return mLineWidth; } | |
| | | void setColor( const QColor& c ) { mColor = c; } | |
| | | QColor color() const { return mColor; } | |
| | | void setOffset( double offset ) { mOffset = offset; } | |
| | | double offset() const { return mOffset; } | |
| | | | |
| | | protected: | |
| | | /**Distance (in mm or map units) between lines*/ | |
| | | double mDistance; | |
| | | /**Line width (in mm or map units)*/ | |
| | | double mLineWidth; | |
| | | QColor mColor; | |
| | | /**Vector line angle in degrees (0 = horizontal, counterclockwise)*/ | |
| | | double mLineAngle; | |
| | | /**Offset perpendicular to line direction*/ | |
| | | double mOffset; | |
| | | }; | |
| | | | |
| | | class CORE_EXPORT QgsPointPatternFillSymbolLayer: public QgsImageFillSymbol | |
| | | Layer | |
| | | { | |
| | | public: | |
| | | QgsPointPatternFillSymbolLayer(); | |
| | | ~QgsPointPatternFillSymbolLayer(); | |
| | | | |
| | | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt | |
| | | ringMap() ); | |
| | | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |
| | | | |
| | | QString layerType() const; | |
| | | | |
| | | void startRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| | | void stopRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| | | QgsStringMap properties() const; | |
| | | | |
| | | QgsSymbolLayerV2* clone() const; | |
| | | | |
| | | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props | |
| | | ) const; | |
| | | | |
| | | //getters and setters | |
| | | double distanceX() const { return mDistanceX; } | |
| | | void setDistanceX( double d ) { mDistanceX = d; } | |
| | | | |
| | | double distanceY() const { return mDistanceY; } | |
| | | void setDistanceY( double d ) { mDistanceY = d; } | |
| | | | |
| | | double displacementX() const { return mDisplacementX; } | |
| | | void setDisplacementX( double d ) { mDisplacementX = d; } | |
| | | | |
| | | double displacementY() const { return mDisplacementY; } | |
| | | void setDisplacementY( double d ) { mDisplacementY = d; } | |
| | | | |
| | | bool setSubSymbol( QgsSymbolV2* symbol ); | |
| | | virtual QgsSymbolV2* subSymbol() { return mMarkerSymbol; } | |
| | | | |
| | | protected: | |
| | | QgsMarkerSymbolV2* mMarkerSymbol; | |
| | | double mDistanceX; | |
| | | double mDistanceY; | |
| | | double mDisplacementX; | |
| | | double mDisplacementY; | |
| }; | | }; | |
| | | | |
| class CORE_EXPORT QgsCentroidFillSymbolLayerV2 : public QgsFillSymbolLayerV
2 | | class CORE_EXPORT QgsCentroidFillSymbolLayerV2 : public QgsFillSymbolLayerV
2 | |
| { | | { | |
| public: | | public: | |
| QgsCentroidFillSymbolLayerV2(); | | QgsCentroidFillSymbolLayerV2(); | |
| ~QgsCentroidFillSymbolLayerV2(); | | ~QgsCentroidFillSymbolLayerV2(); | |
| | | | |
| // static stuff | | // static stuff | |
| | | | |
| static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | |
|
| | | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |
| | | | |
| // implemented from base classes | | // implemented from base classes | |
| | | | |
| QString layerType() const; | | QString layerType() const; | |
| | | | |
| void startRender( QgsSymbolV2RenderContext& context ); | | void startRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void stopRender( QgsSymbolV2RenderContext& context ); | | void stopRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q
gsSymbolV2RenderContext& context ); | | void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q
gsSymbolV2RenderContext& context ); | |
| | | | |
| QgsStringMap properties() const; | | QgsStringMap properties() const; | |
| | | | |
| QgsSymbolLayerV2* clone() const; | | QgsSymbolLayerV2* clone() const; | |
| | | | |
|
| | | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props | |
| | | ) const; | |
| | | | |
| void setColor( const QColor& color ); | | void setColor( const QColor& color ); | |
| | | | |
| QgsSymbolV2* subSymbol(); | | QgsSymbolV2* subSymbol(); | |
| bool setSubSymbol( QgsSymbolV2* symbol ); | | bool setSubSymbol( QgsSymbolV2* symbol ); | |
| | | | |
| protected: | | protected: | |
| QgsMarkerSymbolV2* mMarker; | | QgsMarkerSymbolV2* mMarker; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 13 change blocks. |
| 12 lines changed or deleted | | 167 lines changed or added | |
|
| qgsgeometry.h | | qgsgeometry.h | |
| | | | |
| skipping to change at line 15 | | skipping to change at line 15 | |
| Copyright : (C) 2005 by Brendan Morley | | Copyright : (C) 2005 by Brendan Morley | |
| email : morb at ozemail dot com dot au | | email : morb at ozemail dot com dot au | |
| **************************************************************************
* | | **************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| | | | |
| #ifndef QGSGEOMETRY_H | | #ifndef QGSGEOMETRY_H | |
| #define QGSGEOMETRY_H | | #define QGSGEOMETRY_H | |
| | | | |
| #include <QString> | | #include <QString> | |
| #include <QVector> | | #include <QVector> | |
| | | | |
| #include "qgis.h" | | #include "qgis.h" | |
| | | | |
| #include <geos_c.h> | | #include <geos_c.h> | |
| | | | |
| skipping to change at line 241 | | skipping to change at line 240 | |
| * @param point Specifiest the point for search | | * @param point Specifiest the point for search | |
| * @param atVertex Receives index of the closest vertex | | * @param atVertex Receives index of the closest vertex | |
| * @return The squared cartesian distance is also returned in sqrDist,
negative number on error | | * @return The squared cartesian distance is also returned in sqrDist,
negative number on error | |
| */ | | */ | |
| double closestVertexWithContext( const QgsPoint& point, int& atVertex )
; | | double closestVertexWithContext( const QgsPoint& point, int& atVertex )
; | |
| | | | |
| /** | | /** | |
| * Searches for the closest segment of geometry to the given point | | * Searches for the closest segment of geometry to the given point | |
| * @param point Specifies the point for search | | * @param point Specifies the point for search | |
| * @param minDistPoint Receives the nearest point on the segment | | * @param minDistPoint Receives the nearest point on the segment | |
|
| * @param beforeVertex Receives index of the vertex before the closest | | * @param afterVertex Receives index of the vertex after the closest se | |
| segment. The vertex | | gment. The vertex | |
| * after the closest segment is always beforeVertex + 1 | | * before the closest segment is always afterVertex - 1 | |
| | | * @param leftOf Out: Returns if the point lies on the left of right si | |
| | | de of the segment ( < 0 means left, > 0 means right ) | |
| | | * @param epsilon epsilon for segment snapping (added in 1.8) | |
| * @return The squared cartesian distance is also returned in sqrDist,
negative number on error | | * @return The squared cartesian distance is also returned in sqrDist,
negative number on error | |
| */ | | */ | |
|
| double closestSegmentWithContext( const QgsPoint& point, QgsPoint& minD
istPoint, int& beforeVertex ); | | double closestSegmentWithContext( const QgsPoint& point, QgsPoint& minD
istPoint, int& afterVertex, double* leftOf = 0, double epsilon = DEFAULT_SE
GMENT_EPSILON ); | |
| | | | |
| /**Adds a new ring to this geometry. This makes only sense for polygon
and multipolygons. | | /**Adds a new ring to this geometry. This makes only sense for polygon
and multipolygons. | |
| @return 0 in case of success (ring added), 1 problem with geometry typ
e, 2 ring not closed, | | @return 0 in case of success (ring added), 1 problem with geometry typ
e, 2 ring not closed, | |
| 3 ring is not valid geometry, 4 ring not disjoint with existing rings,
5 no polygon found which contained the ring*/ | | 3 ring is not valid geometry, 4 ring not disjoint with existing rings,
5 no polygon found which contained the ring*/ | |
| int addRing( const QList<QgsPoint>& ring ); | | int addRing( const QList<QgsPoint>& ring ); | |
| | | | |
| /**Adds a new island polygon to a multipolygon feature | | /**Adds a new island polygon to a multipolygon feature | |
| @return 0 in case of success, 1 if not a multipolygon, 2 if ring is no
t a valid geometry, 3 if new polygon ring | | @return 0 in case of success, 1 if not a multipolygon, 2 if ring is no
t a valid geometry, 3 if new polygon ring | |
| not disjoint with existing polygons of the feature*/ | | not disjoint with existing polygons of the feature*/ | |
|
| int addIsland( const QList<QgsPoint>& ring ); | | int addPart( const QList<QgsPoint> &points ); | |
| | | Q_DECL_DEPRECATED int addIsland( const QList<QgsPoint> &points ) { retu | |
| | | rn addPart( points ); } | |
| | | | |
| /**Translate this geometry by dx, dy | | /**Translate this geometry by dx, dy | |
| @return 0 in case of success*/ | | @return 0 in case of success*/ | |
| int translate( double dx, double dy ); | | int translate( double dx, double dy ); | |
| | | | |
| /**Transform this geometry as described by CoordinateTranasform ct | | /**Transform this geometry as described by CoordinateTranasform ct | |
| @return 0 in case of success*/ | | @return 0 in case of success*/ | |
| int transform( const QgsCoordinateTransform& ct ); | | int transform( const QgsCoordinateTransform& ct ); | |
| | | | |
| /**Splits this geometry according to a given line. Note that the geomet
ry is only split once. If there are several intersections | | /**Splits this geometry according to a given line. Note that the geomet
ry is only split once. If there are several intersections | |
| | | | |
| skipping to change at line 361 | | skipping to change at line 363 | |
| QgsGeometry* difference( QgsGeometry* geometry ); | | QgsGeometry* difference( QgsGeometry* geometry ); | |
| | | | |
| /** Returns a Geometry representing the points making up this Geometry
that do not make up other. */ | | /** Returns a Geometry representing the points making up this Geometry
that do not make up other. */ | |
| QgsGeometry* symDifference( QgsGeometry* geometry ); | | QgsGeometry* symDifference( QgsGeometry* geometry ); | |
| | | | |
| /** Exports the geometry to mWkt | | /** Exports the geometry to mWkt | |
| @return true in case of success and false else | | @return true in case of success and false else | |
| */ | | */ | |
| QString exportToWkt(); | | QString exportToWkt(); | |
| | | | |
|
| | | /** Exports the geometry to mGeoJSON | |
| | | @return true in case of success and false else | |
| | | */ | |
| | | QString exportToGeoJSON(); | |
| | | | |
| /* Accessor functions for getting geometry data */ | | /* Accessor functions for getting geometry data */ | |
| | | | |
| /** return contents of the geometry as a point | | /** return contents of the geometry as a point | |
| if wkbType is WKBPoint, otherwise returns [0,0] */ | | if wkbType is WKBPoint, otherwise returns [0,0] */ | |
| QgsPoint asPoint(); | | QgsPoint asPoint(); | |
| | | | |
| /** return contents of the geometry as a polyline | | /** return contents of the geometry as a polyline | |
| if wkbType is WKBLineString, otherwise an empty list */ | | if wkbType is WKBLineString, otherwise an empty list */ | |
| QgsPolyline asPolyline(); | | QgsPolyline asPolyline(); | |
| | | | |
| | | | |
| skipping to change at line 422 | | skipping to change at line 429 | |
| * @note added in 1.5 | | * @note added in 1.5 | |
| */ | | */ | |
| int avoidIntersections(); | | int avoidIntersections(); | |
| | | | |
| class Error | | class Error | |
| { | | { | |
| QString message; | | QString message; | |
| QgsPoint location; | | QgsPoint location; | |
| bool hasLocation; | | bool hasLocation; | |
| public: | | public: | |
|
| | | Error() : message( "none" ), hasLocation( false ) {} | |
| Error( QString m ) : message( m ), hasLocation( false ) {} | | Error( QString m ) : message( m ), hasLocation( false ) {} | |
| Error( QString m, QgsPoint p ) : message( m ), location( p ), hasLo
cation( true ) {} | | Error( QString m, QgsPoint p ) : message( m ), location( p ), hasLo
cation( true ) {} | |
| | | | |
| QString what() { return message; }; | | QString what() { return message; }; | |
| QgsPoint where() { return location; } | | QgsPoint where() { return location; } | |
| bool hasWhere() { return hasLocation; } | | bool hasWhere() { return hasLocation; } | |
| }; | | }; | |
| | | | |
| /** Validate geometry and produce a list of geometry errors | | /** Validate geometry and produce a list of geometry errors | |
| * @note added in 1.5 | | * @note added in 1.5 | |
| **/ | | **/ | |
| void validateGeometry( QList<Error> &errors ); | | void validateGeometry( QList<Error> &errors ); | |
| | | | |
|
| static void validatePolyline( QList<Error> &errors, int i, QgsPolyline | | | |
| polyline, bool ring = false ); | | | |
| static void validatePolygon( QList<Error> &errors, int i, const QgsPoly | | | |
| gon &polygon ); | | | |
| | | | |
| private: | | private: | |
| // Private variables | | // Private variables | |
| | | | |
| // All of these are mutable since there may be on-the-fly | | // All of these are mutable since there may be on-the-fly | |
| // conversions between WKB, GEOS and Wkt; | | // conversions between WKB, GEOS and Wkt; | |
| // However the intent is the const functions do not | | // However the intent is the const functions do not | |
| // semantically change the value that this object represents. | | // semantically change the value that this object represents. | |
| | | | |
| /** pointer to geometry in binary WKB format | | /** pointer to geometry in binary WKB format | |
| This is the class' native implementation | | This is the class' native implementation | |
| | | | |
| skipping to change at line 520 | | skipping to change at line 525 | |
| @param newGeometries new geometries if splitting was successful | | @param newGeometries new geometries if splitting was successful | |
| @return 0 in case of success, 1 if geometry has not been split, error
else*/ | | @return 0 in case of success, 1 if geometry has not been split, error
else*/ | |
| int splitLinearGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>&
newGeometries ); | | int splitLinearGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>&
newGeometries ); | |
| /**Splits polygon/multipolygon geometries | | /**Splits polygon/multipolygon geometries | |
| @return 0 in case of success, 1 if geometry has not been split, erro
r else*/ | | @return 0 in case of success, 1 if geometry has not been split, erro
r else*/ | |
| int splitPolygonGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>&
newGeometries ); | | int splitPolygonGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>&
newGeometries ); | |
| /**Finds out the points that need to be tested for topological correctn
es if this geometry will be split | | /**Finds out the points that need to be tested for topological correctn
es if this geometry will be split | |
| @return 0 in case of success*/ | | @return 0 in case of success*/ | |
| int topologicalTestPointsSplit( const GEOSGeometry* splitLine, QList<Qg
sPoint>& testPoints ) const; | | int topologicalTestPointsSplit( const GEOSGeometry* splitLine, QList<Qg
sPoint>& testPoints ) const; | |
| | | | |
|
| /**Creates a new line from an original line and a reshape line. The par
t of the input line from the first to the last intersection with the \ | | /**Creates a new line from an original line and a reshape line. The par
t of the input line from the first to the last intersection with the | |
| reshape line will be replaced. The calling function takes ownership
of the result. | | reshape line will be replaced. The calling function takes ownership
of the result. | |
| @param origLine the original line | | @param origLine the original line | |
| @param reshapeLineGeos the reshape line | | @param reshapeLineGeos the reshape line | |
| @return the reshaped line or 0 in case of error*/ | | @return the reshaped line or 0 in case of error*/ | |
| static GEOSGeometry* reshapeLine( const GEOSGeometry* origLine, const G
EOSGeometry* reshapeLineGeos ); | | static GEOSGeometry* reshapeLine( const GEOSGeometry* origLine, const G
EOSGeometry* reshapeLineGeos ); | |
| | | | |
| /**Creates a new polygon replacing the part from the first to the secon
d intersection with the reshape line. As a polygon ring is always closed, | | /**Creates a new polygon replacing the part from the first to the secon
d intersection with the reshape line. As a polygon ring is always closed, | |
| the method keeps the longer part of the existing boundary | | the method keeps the longer part of the existing boundary | |
| @param polygon geometry to reshape | | @param polygon geometry to reshape | |
| @param reshapeLineGeos the reshape line | | @param reshapeLineGeos the reshape line | |
| | | | |
| skipping to change at line 565 | | skipping to change at line 570 | |
| | | | |
| /** return point from wkb */ | | /** return point from wkb */ | |
| QgsPoint asPoint( unsigned char*& ptr, bool hasZValue ); | | QgsPoint asPoint( unsigned char*& ptr, bool hasZValue ); | |
| | | | |
| /** return polyline from wkb */ | | /** return polyline from wkb */ | |
| QgsPolyline asPolyline( unsigned char*& ptr, bool hasZValue ); | | QgsPolyline asPolyline( unsigned char*& ptr, bool hasZValue ); | |
| | | | |
| /** return polygon from wkb */ | | /** return polygon from wkb */ | |
| QgsPolygon asPolygon( unsigned char*& ptr, bool hasZValue ); | | QgsPolygon asPolygon( unsigned char*& ptr, bool hasZValue ); | |
| | | | |
|
| static void checkRingIntersections( QList<Error> &errors, | | | |
| int p0, int i0, const QgsPolyline & | | | |
| ring0, | | | |
| int p1, int i1, const QgsPolyline & | | | |
| ring1 ); | | | |
| | | | |
| static bool geosRelOp( char( *op )( const GEOSGeometry*, const GEOSGeom
etry * ), | | static bool geosRelOp( char( *op )( const GEOSGeometry*, const GEOSGeom
etry * ), | |
| QgsGeometry *a, QgsGeometry *b ); | | QgsGeometry *a, QgsGeometry *b ); | |
| | | | |
|
| | | /**Returns < 0 if point(x/y) is left of the line x1,y1 -> x1,y2*/ | |
| | | double leftOf( double x, double y, double& x1, double& y1, double& x2, | |
| | | double& y2 ); | |
| | | | |
| static int refcount; | | static int refcount; | |
| }; // class QgsGeometry | | }; // class QgsGeometry | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 18 lines changed or deleted | | 21 lines changed or added | |
|
| qgsgeometryanalyzer.h | | qgsgeometryanalyzer.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id: qgis.h 9774 2008-12-12 05:41:24Z timlinux $ */ | | | |
| | | | |
| #ifndef QGSGEOMETRYANALYZERH | | #ifndef QGSGEOMETRYANALYZERH | |
| #define QGSGEOMETRYANALYZERH | | #define QGSGEOMETRYANALYZERH | |
| | | | |
| #include "qgsvectorlayer.h" | | #include "qgsvectorlayer.h" | |
| #include "qgsfield.h" | | #include "qgsfield.h" | |
| #include "qgsfeature.h" | | #include "qgsfeature.h" | |
| #include "qgsgeometry.h" | | #include "qgsgeometry.h" | |
| #include "qgsfield.h" | | #include "qgsfield.h" | |
| #include "qgsdistancearea.h" | | #include "qgsdistancearea.h" | |
| | | | |
| skipping to change at line 103 | | skipping to change at line 102 | |
| @param layer input vector layer | | @param layer input vector layer | |
| @param shapefileName path to the output shp | | @param shapefileName path to the output shp | |
| @param onlySelectedFeatures if true, only selected features are consi
dered, else all the features | | @param onlySelectedFeatures if true, only selected features are consi
dered, else all the features | |
| @param uniqueIdField index of the attribute field that contains the u
nique id to dissolve on (or -1 if | | @param uniqueIdField index of the attribute field that contains the u
nique id to dissolve on (or -1 if | |
| all features should be dissolved together) | | all features should be dissolved together) | |
| @param p progress dialog (or 0 if no progress dialog is to be shown) | | @param p progress dialog (or 0 if no progress dialog is to be shown) | |
| @note: added in version 1.4*/ | | @note: added in version 1.4*/ | |
| bool dissolve( QgsVectorLayer* layer, const QString& shapefileName, boo
l onlySelectedFeatures = false, | | bool dissolve( QgsVectorLayer* layer, const QString& shapefileName, boo
l onlySelectedFeatures = false, | |
| int uniqueIdField = -1, QProgressDialog* p = 0 ); | | int uniqueIdField = -1, QProgressDialog* p = 0 ); | |
| | | | |
|
| | | /**Creates an event layer (multipoint or multiline) by locating feature | |
| | | s from a (non-spatial) event table along the features of a line layer. | |
| | | Note that currently (until QgsGeometry supports m-values) the z-coo | |
| | | rdinate of the line layer is used for linear referencing | |
| | | @param lineLayer layer with the line geometry | |
| | | @param eventLayer layer with features and location field | |
| | | @param lineField join index in line layer | |
| | | @param eventField join index in event layer | |
| | | @param outputLayer name of output file (can be empty if a memory laye | |
| | | r is used) | |
| | | @param outputFormat name of output format (can be empty if a memory p | |
| | | rovider is used to store the results) | |
| | | @param unlocatedFeatureIds out: ids of event features where linear re | |
| | | ferencing was not successful | |
| | | @param locationField1 attribute index of location field in event laye | |
| | | r | |
| | | @param locationField2 attribute index of location end field (or -1 fo | |
| | | r point layer) | |
| | | @param offsetField attribute index for offset field. Negative offset | |
| | | value = offset to left side, positive value = offset to right side | |
| | | @param offsetScale factor to scale offset | |
| | | @param forceSingleGeometry force layer to single point/line type. Fea | |
| | | ture attributes are copied in case of multiple matches | |
| | | @param memoryProvider memory provider to write output to (can be 0 if | |
| | | output is written to a file) | |
| | | @param p progress dialog or 0 if no progress dialog should be shown | |
| | | */ | |
| | | bool eventLayer( QgsVectorLayer* lineLayer, QgsVectorLayer* eventLayer, | |
| | | int lineField, int eventField, QList<int>& unlocatedFeatureIds, const QStr | |
| | | ing& outputLayer, | |
| | | const QString& outputFormat, int locationField1, int l | |
| | | ocationField2 = -1, int offsetField = -1, double offsetScale = 1.0, | |
| | | bool forceSingleGeometry = false, QgsVectorDataProvide | |
| | | r* memoryProvider = 0, QProgressDialog* p = 0 ); | |
| | | | |
| | | /**Returns linear reference geometry as a multiline (or 0 if no match). | |
| | | Currently, the z-coordinates are considered to be the measures (no support | |
| | | for m-values in QGIS)*/ | |
| | | QgsGeometry* locateBetweenMeasures( double fromMeasure, double toMeasur | |
| | | e, QgsGeometry* lineGeom ); | |
| | | /**Returns linear reference geometry. Unlike the PostGIS function, this | |
| | | method always returns multipoint or 0 if no match (not geometry collection | |
| | | ). | |
| | | Currently, the z-coordinates are considered to be the measures (no su | |
| | | pport for m-values in QGIS)*/ | |
| | | QgsGeometry* locateAlongMeasure( double measure, QgsGeometry* lineGeom | |
| | | ); | |
| | | | |
| private: | | private: | |
| | | | |
| QList<double> simpleMeasure( QgsGeometry* geometry ); | | QList<double> simpleMeasure( QgsGeometry* geometry ); | |
| double perimeterMeasure( QgsGeometry* geometry, QgsDistanceArea& measur
e ); | | double perimeterMeasure( QgsGeometry* geometry, QgsDistanceArea& measur
e ); | |
| /**Helper function to simplify an individual feature*/ | | /**Helper function to simplify an individual feature*/ | |
| void simplifyFeature( QgsFeature& f, QgsVectorFileWriter* vfw, double t
olerance ); | | void simplifyFeature( QgsFeature& f, QgsVectorFileWriter* vfw, double t
olerance ); | |
| /**Helper function to get the cetroid of an individual feature*/ | | /**Helper function to get the cetroid of an individual feature*/ | |
| void centroidFeature( QgsFeature& f, QgsVectorFileWriter* vfw ); | | void centroidFeature( QgsFeature& f, QgsVectorFileWriter* vfw ); | |
| /**Helper function to buffer an individual feature*/ | | /**Helper function to buffer an individual feature*/ | |
| void bufferFeature( QgsFeature& f, int nProcessedFeatures, QgsVectorFil
eWriter* vfw, bool dissolve, QgsGeometry** dissolveGeometry, | | void bufferFeature( QgsFeature& f, int nProcessedFeatures, QgsVectorFil
eWriter* vfw, bool dissolve, QgsGeometry** dissolveGeometry, | |
| double bufferDistance, int bufferDistanceField ); | | double bufferDistance, int bufferDistanceField ); | |
| /**Helper function to get the convex hull of feature(s)*/ | | /**Helper function to get the convex hull of feature(s)*/ | |
| void convexFeature( QgsFeature& f, int nProcessedFeatures, QgsGeometry*
* dissolveGeometry ); | | void convexFeature( QgsFeature& f, int nProcessedFeatures, QgsGeometry*
* dissolveGeometry ); | |
| /**Helper function to dissolve feature(s)*/ | | /**Helper function to dissolve feature(s)*/ | |
| void dissolveFeature( QgsFeature& f, int nProcessedFeatures, QgsGeometr
y** dissolveGeometry ); | | void dissolveFeature( QgsFeature& f, int nProcessedFeatures, QgsGeometr
y** dissolveGeometry ); | |
| | | | |
|
| | | //helper functions for event layer | |
| | | void addEventLayerFeature( QgsFeature& feature, QgsGeometry* geom, QgsG | |
| | | eometry* lineGeom, QgsVectorFileWriter* fileWriter, QgsFeatureList& memoryF | |
| | | eatures, int offsetField = -1, double offsetScale = 1.0, | |
| | | bool forceSingleType = false ); | |
| | | /**Create geometry offset relative to line geometry. | |
| | | @param geom the geometry to modify | |
| | | @param lineGeom the line geometry to which the feature is reference | |
| | | d | |
| | | @param offset the offset value in layer unit. Negative values mean | |
| | | offset towards left, positive values offset to the right side*/ | |
| | | void createOffsetGeometry( QgsGeometry* geom, QgsGeometry* lineGeom, do | |
| | | uble offset ); | |
| | | QgsPoint createPointOffset( double x, double y, double dist, QgsGeometr | |
| | | y* lineGeom ) const; | |
| | | unsigned char* locateBetweenWkbString( unsigned char* ptr, QgsMultiPoly | |
| | | line& result, double fromMeasure, double toMeasure ); | |
| | | unsigned char* locateAlongWkbString( unsigned char* ptr, QgsMultiPoint& | |
| | | result, double measure ); | |
| | | static bool clipSegmentByRange( double x1, double y1, double m1, double | |
| | | x2, double y2, double m2, double range1, double range2, QgsPoint& pt1, Qgs | |
| | | Point& pt2, bool& secondPointClipped ); | |
| | | static void locateAlongSegment( double x1, double y1, double m1, double | |
| | | x2, double y2, double m2, double measure, bool& pt1Ok, QgsPoint& pt1, bool | |
| | | & pt2Ok, QgsPoint& pt2 ); | |
| }; | | }; | |
| #endif //QGSVECTORANALYZER | | #endif //QGSVECTORANALYZER | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 73 lines changed or added | |
|
| qgslogger.h | | qgslogger.h | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| | | | |
| #ifndef QGSLOGGER_H | | #ifndef QGSLOGGER_H | |
| #define QGSLOGGER_H | | #define QGSLOGGER_H | |
| | | | |
| #include <iostream> | | #include <iostream> | |
| #include <sstream> | | #include <sstream> | |
| #include <QString> | | #include <QString> | |
|
| | | class QFile; | |
| | | | |
| #ifdef QGISDEBUG | | #ifdef QGISDEBUG | |
| #define QgsDebugMsg(str) QgsLogger::debug(QString(str), 1, __FILE__, __FUNC
TION__, __LINE__) | | #define QgsDebugMsg(str) QgsLogger::debug(QString(str), 1, __FILE__, __FUNC
TION__, __LINE__) | |
| #define QgsDebugMsgLevel(str, level) \ | | #define QgsDebugMsgLevel(str, level) \ | |
| { \ | | { \ | |
| if ( QgsLogger::debugLevel() >= (level) && (level) > 0 ) \ | | if ( QgsLogger::debugLevel() >= (level) && (level) > 0 ) \ | |
| QgsLogger::debug(QString(str), (level), __FILE__, __FUNCTION__, __LIN
E__); \ | | QgsLogger::debug(QString(str), (level), __FILE__, __FUNCTION__, __LIN
E__); \ | |
| } | | } | |
| #else | | #else | |
| #define QgsDebugMsg(str) | | #define QgsDebugMsg(str) | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 49 | |
| * QgsLogger is a class to print debug/warning/error messages to the consol
e. | | * QgsLogger is a class to print debug/warning/error messages to the consol
e. | |
| * The advantage of this class over iostream & co. is that the | | * The advantage of this class over iostream & co. is that the | |
| * output can be controlled with environment variables: | | * output can be controlled with environment variables: | |
| * QGIS_DEBUG is an int describing what debug messages are written to the c
onsole. | | * QGIS_DEBUG is an int describing what debug messages are written to the c
onsole. | |
| * If the debug level of a message is <= QGIS_DEBUG, the message is written
to the | | * If the debug level of a message is <= QGIS_DEBUG, the message is written
to the | |
| * console. It the variable QGIS_DEBUG is not defined, it defaults to 1 for
debug | | * console. It the variable QGIS_DEBUG is not defined, it defaults to 1 for
debug | |
| * mode and to 0 for release mode | | * mode and to 0 for release mode | |
| * QGIS_DEBUG_FILE may contain a file name. Only the messages from this fil
e are | | * QGIS_DEBUG_FILE may contain a file name. Only the messages from this fil
e are | |
| * printed (provided they have the right debuglevel). If QGIS_DEBUG_FILE is
not | | * printed (provided they have the right debuglevel). If QGIS_DEBUG_FILE is
not | |
| * set, messages from all files are printed | | * set, messages from all files are printed | |
|
| | | * | |
| | | * QGIS_LOG_FILE may contain a file name. If set, all messages will be appe | |
| | | nded | |
| | | * to this file rather than to stdout. | |
| */ | | */ | |
| | | | |
| class CORE_EXPORT QgsLogger | | class CORE_EXPORT QgsLogger | |
| { | | { | |
| public: | | public: | |
| | | | |
| /**Goes to qDebug. | | /**Goes to qDebug. | |
| @param msg the message to be printed | | @param msg the message to be printed | |
| @param debuglevel | | @param debuglevel | |
| @param file file name where the message comes from | | @param file file name where the message comes from | |
| | | | |
| skipping to change at line 72 | | skipping to change at line 76 | |
| /**Similar to the previous method, but prints a variable int-value pair
*/ | | /**Similar to the previous method, but prints a variable int-value pair
*/ | |
| static void debug( const QString& var, int val, int debuglevel = 1, con
st char* file = NULL, const char* function = NULL, int line = -1 ); | | static void debug( const QString& var, int val, int debuglevel = 1, con
st char* file = NULL, const char* function = NULL, int line = -1 ); | |
| | | | |
| /**Similar to the previous method, but prints a variable double-value p
air*/ | | /**Similar to the previous method, but prints a variable double-value p
air*/ | |
| static void debug( const QString& var, double val, int debuglevel = 1,
const char* file = NULL, const char* function = NULL, int line = -1 ); | | static void debug( const QString& var, double val, int debuglevel = 1,
const char* file = NULL, const char* function = NULL, int line = -1 ); | |
| | | | |
| /**Prints out a variable/value pair for types with overloaded operator<
<*/ | | /**Prints out a variable/value pair for types with overloaded operator<
<*/ | |
| template <typename T> static void debug( const QString& var, T val, con
st char* file = 0, const char* function = 0, | | template <typename T> static void debug( const QString& var, T val, con
st char* file = 0, const char* function = 0, | |
| int line = -1, int debuglevel = 1 ) | | int line = -1, int debuglevel = 1 ) | |
| { | | { | |
|
| | | Q_UNUSED( debuglevel ); | |
| const char* dfile = debugFile(); | | const char* dfile = debugFile(); | |
| if ( dfile ) //exit if QGIS_DEBUG_FILE is set and the message comes f
rom the wrong file | | if ( dfile ) //exit if QGIS_DEBUG_FILE is set and the message comes f
rom the wrong file | |
| { | | { | |
| if ( !file || strcmp( dfile, file ) != 0 ) | | if ( !file || strcmp( dfile, file ) != 0 ) | |
| { | | { | |
| return; | | return; | |
| } | | } | |
| } | | } | |
| std::ostringstream os; | | std::ostringstream os; | |
| os << var.toLocal8Bit().data() << " = " << val; | | os << var.toLocal8Bit().data() << " = " << val; | |
| if ( line == -1 ) | | if ( line == -1 ) | |
| { | | { | |
|
| qDebug( "%s: (%s) %s", file, function, os.str().c_str() ); | | qDebug( "%s: (%s) %s", file + sPrefixLength, function, os.str().c_s
tr() ); | |
| } | | } | |
| else | | else | |
| { | | { | |
| #if defined(_MSC_VER) | | #if defined(_MSC_VER) | |
|
| qDebug( "%s(%d): (%s) %s", file, line, function, os.str().c_str() )
; | | qDebug( "%s(%d): (%s) %s", file + sPrefixLength, line, function, os
.str().c_str() ); | |
| #else | | #else | |
|
| qDebug( "%s: %d: (%s) %s", file, line, function, os.str().c_str() )
; | | qDebug( "%s: %d: (%s) %s", file + sPrefixLength, line, function, os
.str().c_str() ); | |
| #endif | | #endif | |
| } | | } | |
| } | | } | |
| | | | |
| /**Goes to qWarning*/ | | /**Goes to qWarning*/ | |
| static void warning( const QString& msg ); | | static void warning( const QString& msg ); | |
| | | | |
| /**Goes to qCritical*/ | | /**Goes to qCritical*/ | |
| static void critical( const QString& msg ); | | static void critical( const QString& msg ); | |
| | | | |
| /**Goes to qFatal*/ | | /**Goes to qFatal*/ | |
| static void fatal( const QString& msg ); | | static void fatal( const QString& msg ); | |
| | | | |
| /**Reads the environment variable QGIS_DEBUG and converts it to int. If
QGIS_DEBUG is not set, | | /**Reads the environment variable QGIS_DEBUG and converts it to int. If
QGIS_DEBUG is not set, | |
| the function returns 1 if QGISDEBUG is defined and 0 if not*/ | | the function returns 1 if QGISDEBUG is defined and 0 if not*/ | |
| static int debugLevel(); | | static int debugLevel(); | |
| | | | |
|
| | | /** Logs the message passed in to the logfile defined in QGIS_LOG_FILE | |
| | | if any. **/ | |
| | | static void logMessageToFile( QString theMessage ); | |
| | | | |
| private: | | private: | |
|
| | | /**Reads the environment variable QGIS_LOG_FILE. Returns NULL if the va | |
| | | riable is not set, | |
| | | * otherwise returns a file name for writing log messages to.*/ | |
| | | static const QString logFile(); | |
| | | | |
|
| /**Reads the environment variable QGIS_DEBUG_FILE. Returns NULL if the | | /**Reads the environment variable QGIS_DEBUG_FILE. Returns NULL if the | |
| variable is not set*/ | | variable is not set. | |
| | | * If set, only messages from this source file will be sent to logs. */ | |
| static const char* debugFile(); | | static const char* debugFile(); | |
| | | | |
| /** current debug level */ | | /** current debug level */ | |
|
| static int mDebugLevel; | | static int sDebugLevel; | |
| | | static int sPrefixLength; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 6 lines changed or deleted | | 22 lines changed or added | |
|
| qgsmapcanvas.h | | qgsmapcanvas.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| ***************************************************************************
/ | | ***************************************************************************
/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id: qgsmapcanvas.h 5341 2006-04-22 12:11:36Z wonder $ */ | | | |
| | | | |
| #ifndef QGSMAPCANVAS_H | | #ifndef QGSMAPCANVAS_H | |
| #define QGSMAPCANVAS_H | | #define QGSMAPCANVAS_H | |
| | | | |
| #include <list> | | #include <list> | |
| #include <memory> | | #include <memory> | |
| #include <deque> | | #include <deque> | |
| | | | |
| #include "qgsrectangle.h" | | #include "qgsrectangle.h" | |
| #include "qgspoint.h" | | #include "qgspoint.h" | |
| #include "qgis.h" | | #include "qgis.h" | |
| | | | |
| #include <QDomDocument> | | #include <QDomDocument> | |
| #include <QGraphicsView> | | #include <QGraphicsView> | |
| #include <QtCore> | | #include <QtCore> | |
| | | | |
|
| | | #ifdef HAVE_TOUCH | |
| | | #include <QGestureEvent> | |
| | | #endif | |
| | | | |
| class QWheelEvent; | | class QWheelEvent; | |
| class QPixmap; | | class QPixmap; | |
| class QPaintEvent; | | class QPaintEvent; | |
| class QKeyEvent; | | class QKeyEvent; | |
| class ResizeEvent; | | class ResizeEvent; | |
| | | | |
| class QColor; | | class QColor; | |
| class QDomDocument; | | class QDomDocument; | |
| class QPaintDevice; | | class QPaintDevice; | |
| class QMouseEvent; | | class QMouseEvent; | |
| | | | |
| skipping to change at line 159 | | skipping to change at line 162 | |
| //! Zoom to the Next extent (view) | | //! Zoom to the Next extent (view) | |
| void zoomToNextExtent(); | | void zoomToNextExtent(); | |
| | | | |
| // ! Clears the list of extents and sets current extent as first item | | // ! Clears the list of extents and sets current extent as first item | |
| void clearExtentHistory(); | | void clearExtentHistory(); | |
| | | | |
| /** Zoom to the extent of the selected features of current (vector) lay
er. | | /** Zoom to the extent of the selected features of current (vector) lay
er. | |
| Added in version 1.2: optionally specify different than current layer
*/ | | Added in version 1.2: optionally specify different than current layer
*/ | |
| void zoomToSelected( QgsVectorLayer* layer = NULL ); | | void zoomToSelected( QgsVectorLayer* layer = NULL ); | |
| | | | |
|
| | | /** Pan to the selected features of current (vector) layer keeping same | |
| | | extent. | |
| | | @note added in 2.0 */ | |
| | | void panToSelected( QgsVectorLayer* layer = NULL ); | |
| | | | |
| /** \brief Sets the map tool currently being used on the canvas */ | | /** \brief Sets the map tool currently being used on the canvas */ | |
| void setMapTool( QgsMapTool* mapTool ); | | void setMapTool( QgsMapTool* mapTool ); | |
| | | | |
| /** \brief Unset the current map tool or last non zoom tool | | /** \brief Unset the current map tool or last non zoom tool | |
| * | | * | |
| * This is called from destructor of map tools to make sure | | * This is called from destructor of map tools to make sure | |
| * that this map tool won't be used any more. | | * that this map tool won't be used any more. | |
| * You don't have to call it manualy, QgsMapTool takes care of it. | | * You don't have to call it manualy, QgsMapTool takes care of it. | |
| */ | | */ | |
| void unsetMapTool( QgsMapTool* mapTool ); | | void unsetMapTool( QgsMapTool* mapTool ); | |
| | | | |
| skipping to change at line 300 | | skipping to change at line 307 | |
| | | | |
| //! show whatever error is exposed by the QgsMapLayer. | | //! show whatever error is exposed by the QgsMapLayer. | |
| void showError( QgsMapLayer * mapLayer ); | | void showError( QgsMapLayer * mapLayer ); | |
| | | | |
| //! called to read map canvas settings from project | | //! called to read map canvas settings from project | |
| void readProject( const QDomDocument & ); | | void readProject( const QDomDocument & ); | |
| | | | |
| //! called to write map canvas settings to project | | //! called to write map canvas settings to project | |
| void writeProject( QDomDocument & ); | | void writeProject( QDomDocument & ); | |
| | | | |
|
| | | private slots: | |
| | | //! called when current maptool is destroyed | |
| | | void mapToolDestroyed(); | |
| | | | |
| signals: | | signals: | |
| /** Let the owner know how far we are with render operations */ | | /** Let the owner know how far we are with render operations */ | |
| void setProgress( int, int ); | | void setProgress( int, int ); | |
| | | | |
| /** emits current mouse position | | /** emits current mouse position | |
| \note changed in 1.3 */ | | \note changed in 1.3 */ | |
| void xyCoordinates( const QgsPoint & p ); | | void xyCoordinates( const QgsPoint & p ); | |
| | | | |
| //! Emitted when the scale of the map changes | | //! Emitted when the scale of the map changes | |
| void scaleChanged( double ); | | void scaleChanged( double ); | |
| | | | |
| skipping to change at line 352 | | skipping to change at line 363 | |
| | | | |
| //! Emitted when zoom last status changed | | //! Emitted when zoom last status changed | |
| //! @note: this signal was added in version 1.4 | | //! @note: this signal was added in version 1.4 | |
| void zoomLastStatusChanged( bool ); | | void zoomLastStatusChanged( bool ); | |
| | | | |
| //! Emitted when zoom next status changed | | //! Emitted when zoom next status changed | |
| //! @note: this signal was added in version 1.4 | | //! @note: this signal was added in version 1.4 | |
| void zoomNextStatusChanged( bool ); | | void zoomNextStatusChanged( bool ); | |
| | | | |
| protected: | | protected: | |
|
| | | #ifdef HAVE_TOUCH | |
| | | //! Overridden standard event to be gestures aware | |
| | | bool event( QEvent * e ); | |
| | | #endif | |
| | | | |
| //! Overridden key press event | | //! Overridden key press event | |
| void keyPressEvent( QKeyEvent * e ); | | void keyPressEvent( QKeyEvent * e ); | |
| | | | |
| //! Overridden key release event | | //! Overridden key release event | |
| void keyReleaseEvent( QKeyEvent * e ); | | void keyReleaseEvent( QKeyEvent * e ); | |
| | | | |
| //! Overridden mouse double click event | | //! Overridden mouse double click event | |
| void mouseDoubleClickEvent( QMouseEvent * e ); | | void mouseDoubleClickEvent( QMouseEvent * e ); | |
| | | | |
| //! Overridden mouse move event | | //! Overridden mouse move event | |
| | | | |
| skipping to change at line 379 | | skipping to change at line 395 | |
| | | | |
| //! Overridden mouse wheel event | | //! Overridden mouse wheel event | |
| void wheelEvent( QWheelEvent * e ); | | void wheelEvent( QWheelEvent * e ); | |
| | | | |
| //! Overridden resize event | | //! Overridden resize event | |
| void resizeEvent( QResizeEvent * e ); | | void resizeEvent( QResizeEvent * e ); | |
| | | | |
| //! Overridden paint event | | //! Overridden paint event | |
| void paintEvent( QPaintEvent * e ); | | void paintEvent( QPaintEvent * e ); | |
| | | | |
|
| | | //! Overridden drag enter event | |
| | | void dragEnterEvent( QDragEnterEvent * e ); | |
| | | | |
| //! called when panning is in action, reset indicates end of panning | | //! called when panning is in action, reset indicates end of panning | |
| void moveCanvasContents( bool reset = false ); | | void moveCanvasContents( bool reset = false ); | |
| | | | |
| //! called on resize or changed extent to notify canvas items to change
their rectangle | | //! called on resize or changed extent to notify canvas items to change
their rectangle | |
| void updateCanvasItemPositions(); | | void updateCanvasItemPositions(); | |
| | | | |
| /// implementation struct | | /// implementation struct | |
| class CanvasProperties; | | class CanvasProperties; | |
| | | | |
| /// Handle pattern for implementation object | | /// Handle pattern for implementation object | |
| std::auto_ptr<CanvasProperties> mCanvasProperties; | | std::auto_ptr<CanvasProperties> mCanvasProperties; | |
| | | | |
|
| | | private slots: | |
| | | void crsTransformEnabled( bool ); | |
| | | | |
| private: | | private: | |
| /// this class is non-copyable | | /// this class is non-copyable | |
| /** | | /** | |
| @note | | @note | |
| | | | |
| Otherwise std::auto_ptr would pass the object responsiblity on to th
e | | Otherwise std::auto_ptr would pass the object responsiblity on to th
e | |
| copy like a hot potato leaving the copyer in a weird state. | | copy like a hot potato leaving the copyer in a weird state. | |
| */ | | */ | |
| QgsMapCanvas( QgsMapCanvas const & ); | | QgsMapCanvas( QgsMapCanvas const & ); | |
| | | | |
| | | | |
End of changes. 7 change blocks. |
| 1 lines changed or deleted | | 24 lines changed or added | |
|
| qgsmaplayer.h | | qgsmaplayer.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| ***************************************************************************
/ | | ***************************************************************************
/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| | | | |
| #ifndef QGSMAPLAYER_H | | #ifndef QGSMAPLAYER_H | |
| #define QGSMAPLAYER_H | | #define QGSMAPLAYER_H | |
| | | | |
| #include <QDateTime> | | #include <QDateTime> | |
| #include <QObject> | | #include <QObject> | |
| #include <QUndoStack> | | #include <QUndoStack> | |
| #include <QVariant> | | #include <QVariant> | |
| #include <QImage> | | #include <QImage> | |
|
| | | #include <QDomNode> | |
| | | | |
| #include "qgis.h" | | #include "qgis.h" | |
| #include "qgsrectangle.h" | | #include "qgsrectangle.h" | |
| | | | |
| class QgsRenderContext; | | class QgsRenderContext; | |
| class QgsCoordinateReferenceSystem; | | class QgsCoordinateReferenceSystem; | |
| | | | |
|
| class QDomNode; | | | |
| class QDomDocument; | | class QDomDocument; | |
| class QKeyEvent; | | class QKeyEvent; | |
| class QPainter; | | class QPainter; | |
| | | | |
| /** \ingroup core | | /** \ingroup core | |
| * Base class for all map layer types. | | * Base class for all map layer types. | |
| * This is the base class for all map layer types (vector, raster). | | * This is the base class for all map layer types (vector, raster). | |
| */ | | */ | |
| class CORE_EXPORT QgsMapLayer : public QObject | | class CORE_EXPORT QgsMapLayer : public QObject | |
| { | | { | |
| | | | |
| skipping to change at line 91 | | skipping to change at line 90 | |
| /** Set the display name of the layer | | /** Set the display name of the layer | |
| * @param name New name for the layer | | * @param name New name for the layer | |
| */ | | */ | |
| void setLayerName( const QString & name ); | | void setLayerName( const QString & name ); | |
| | | | |
| /** Get the display name of the layer | | /** Get the display name of the layer | |
| * @return the layer name | | * @return the layer name | |
| */ | | */ | |
| QString const & name() const; | | QString const & name() const; | |
| | | | |
|
| | | void setTitle( const QString& title ) { mTitle = title; } | |
| | | const QString& title() const { return mTitle; } | |
| | | | |
| | | void setAbstract( const QString& abstract ) { mAbstract = abstract; } | |
| | | const QString& abstract() const { return mAbstract; } | |
| | | | |
| /**Synchronises with changes in the datasource | | /**Synchronises with changes in the datasource | |
| @note added in version 1.6*/ | | @note added in version 1.6*/ | |
| virtual void reload() {} | | virtual void reload() {} | |
| | | | |
| /** This is the method that does the actual work of | | /** This is the method that does the actual work of | |
| * drawing the layer onto a paint device. | | * drawing the layer onto a paint device. | |
| * @param rendererContext describes the extents, | | * @param rendererContext describes the extents, | |
| * resolumon etc. that should be used when rendering the | | * resolumon etc. that should be used when rendering the | |
| * layer. | | * layer. | |
| */ | | */ | |
| | | | |
| skipping to change at line 130 | | skipping to change at line 135 | |
| */ | | */ | |
| QString publicSource() const; | | QString publicSource() const; | |
| | | | |
| /** Returns the source for the layer */ | | /** Returns the source for the layer */ | |
| QString const & source() const; | | QString const & source() const; | |
| | | | |
| /** | | /** | |
| * Returns the sublayers of this layer | | * Returns the sublayers of this layer | |
| * (Useful for providers that manage their own layers, such as WMS) | | * (Useful for providers that manage their own layers, such as WMS) | |
| */ | | */ | |
|
| virtual QStringList subLayers(); | | virtual QStringList subLayers() const; | |
| | | | |
| /** | | /** | |
| * Reorders the *previously selected* sublayers of this layer from bott
om to top | | * Reorders the *previously selected* sublayers of this layer from bott
om to top | |
| * (Useful for providers that manage their own layers, such as WMS) | | * (Useful for providers that manage their own layers, such as WMS) | |
| */ | | */ | |
|
| virtual void setLayerOrder( QStringList layers ); | | virtual void setLayerOrder( const QStringList &layers ); | |
| | | | |
| /** Set the visibility of the given sublayer name */ | | /** Set the visibility of the given sublayer name */ | |
| virtual void setSubLayerVisibility( QString name, bool vis ); | | virtual void setSubLayerVisibility( QString name, bool vis ); | |
| | | | |
| /** True if the layer can be edited */ | | /** True if the layer can be edited */ | |
| virtual bool isEditable() const; | | virtual bool isEditable() const; | |
| | | | |
| /** sets state from Dom document | | /** sets state from Dom document | |
| @param layer_node is Dom node corresponding to ``maplayer'' tag | | @param layer_node is Dom node corresponding to ``maplayer'' tag | |
| @note | | @note | |
| | | | |
| skipping to change at line 158 | | skipping to change at line 163 | |
| The Dom node corresponds to a Dom document project file XML element
read | | The Dom node corresponds to a Dom document project file XML element
read | |
| by QgsProject. | | by QgsProject. | |
| | | | |
| This, in turn, calls readXml(), which is over-rideable by sub-classe
s so | | This, in turn, calls readXml(), which is over-rideable by sub-classe
s so | |
| that they can read their own specific state from the given Dom node. | | that they can read their own specific state from the given Dom node. | |
| | | | |
| Invoked by QgsProject::read(). | | Invoked by QgsProject::read(). | |
| | | | |
| @returns true if successful | | @returns true if successful | |
| */ | | */ | |
|
| bool readXML( QDomNode & layer_node ); | | bool readXML( const QDomNode& layer_node ); | |
| | | | |
| /** stores state in Dom node | | /** stores state in Dom node | |
| @param layer_node is Dom node corresponding to ``projectlayers'' tag | | @param layer_node is Dom node corresponding to ``projectlayers'' tag | |
| @param document is Dom document | | @param document is Dom document | |
| @note | | @note | |
| | | | |
| The Dom node corresponds to a Dom document project file XML element
to be | | The Dom node corresponds to a Dom document project file XML element
to be | |
| written by QgsProject. | | written by QgsProject. | |
| | | | |
| This, in turn, calls writeXml(), which is over-rideable by sub-class
es so | | This, in turn, calls writeXml(), which is over-rideable by sub-class
es so | |
| | | | |
| skipping to change at line 218 | | skipping to change at line 223 | |
| * If an operation returns 0 (e.g. draw()), this function | | * If an operation returns 0 (e.g. draw()), this function | |
| * returns the text of the error associated with the failure. | | * returns the text of the error associated with the failure. | |
| * Interactive users of this provider can then, for example, | | * Interactive users of this provider can then, for example, | |
| * call a QMessageBox to display the contents. | | * call a QMessageBox to display the contents. | |
| */ | | */ | |
| virtual QString lastError(); | | virtual QString lastError(); | |
| | | | |
| /** Returns layer's spatial reference system | | /** Returns layer's spatial reference system | |
| @note This was introduced in QGIS 1.4 | | @note This was introduced in QGIS 1.4 | |
| */ | | */ | |
|
| const QgsCoordinateReferenceSystem& crs(); | | const QgsCoordinateReferenceSystem& crs() const; | |
| | | | |
| /** Returns layer's spatial reference system | | /** Returns layer's spatial reference system | |
| @note This method is here for API compatibility | | @note This method is here for API compatibility | |
| and will be deprecated in 2.0 | | and will be deprecated in 2.0 | |
| @deprecated use crs() | | @deprecated use crs() | |
| */ | | */ | |
| Q_DECL_DEPRECATED const QgsCoordinateReferenceSystem& srs(); | | Q_DECL_DEPRECATED const QgsCoordinateReferenceSystem& srs(); | |
| | | | |
| /** Sets layer's spatial reference system | | /** Sets layer's spatial reference system | |
| @note emitSignal added in 1.4 */ | | @note emitSignal added in 1.4 */ | |
| void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal =
true ); | | void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal =
true ); | |
| | | | |
| /** A convenience function to capitalise the layer name */ | | /** A convenience function to capitalise the layer name */ | |
| static QString capitaliseLayerName( const QString name ); | | static QString capitaliseLayerName( const QString name ); | |
| | | | |
|
| | | /** Retrieve the style URI for this layer | |
| | | * (either as a .qml file on disk or as a | |
| | | * record in the users style table in their personal qgis.db) | |
| | | * @return a QString withe the style file name | |
| | | * @see also loadNamedStyle () and saveNamedStyle (); | |
| | | * @note This method was added in QGIS 1.8 | |
| | | */ | |
| | | virtual QString styleURI( ); | |
| | | | |
| /** Retrieve the default style for this layer if one | | /** Retrieve the default style for this layer if one | |
| * exists (either as a .qml file on disk or as a | | * exists (either as a .qml file on disk or as a | |
| * record in the users style table in their personal qgis.db) | | * record in the users style table in their personal qgis.db) | |
| * @param theResultFlag a reference to a flag that will be set to false
if | | * @param theResultFlag a reference to a flag that will be set to false
if | |
| * we did not manage to load the default style. | | * we did not manage to load the default style. | |
| * @return a QString with any status messages | | * @return a QString with any status messages | |
| * @see also loadNamedStyle (); | | * @see also loadNamedStyle (); | |
| */ | | */ | |
| virtual QString loadDefaultStyle( bool & theResultFlag ); | | virtual QString loadDefaultStyle( bool & theResultFlag ); | |
| | | | |
| | | | |
| skipping to change at line 286 | | skipping to change at line 300 | |
| * is a file and save to that, if that fails the qgis.db styles | | * is a file and save to that, if that fails the qgis.db styles | |
| * table will be used to create a style entry who's | | * table will be used to create a style entry who's | |
| * key matches the URI. | | * key matches the URI. | |
| * @param theResultFlag a reference to a flag that will be set to false
if | | * @param theResultFlag a reference to a flag that will be set to false
if | |
| * we did not manage to save the default style. | | * we did not manage to save the default style. | |
| * @return a QString with any status messages | | * @return a QString with any status messages | |
| * @sa saveDefaultStyle() | | * @sa saveDefaultStyle() | |
| */ | | */ | |
| virtual QString saveNamedStyle( const QString theURI, bool & theResultF
lag ); | | virtual QString saveNamedStyle( const QString theURI, bool & theResultF
lag ); | |
| | | | |
|
| | | virtual QString saveSldStyle( const QString theURI, bool & theResultFla | |
| | | g ); | |
| | | virtual QString loadSldStyle( const QString theURI, bool &theResultFlag | |
| | | ); | |
| | | | |
| | | virtual bool readSld( const QDomNode& node, QString& errorMessage ) | |
| | | { Q_UNUSED( node ); errorMessage = QString( "Layer type %1 not supporte | |
| | | d" ).arg( type() ); return false; } | |
| | | | |
| /** Read the symbology for the current layer from the Dom node supplied
. | | /** Read the symbology for the current layer from the Dom node supplied
. | |
| * @param node node that will contain the symbology definition for this
layer. | | * @param node node that will contain the symbology definition for this
layer. | |
| * @param errorMessage reference to string that will be updated with an
y error messages | | * @param errorMessage reference to string that will be updated with an
y error messages | |
| * @return true in case of success. | | * @return true in case of success. | |
| */ | | */ | |
| virtual bool readSymbology( const QDomNode& node, QString& errorMessage
) = 0; | | virtual bool readSymbology( const QDomNode& node, QString& errorMessage
) = 0; | |
| | | | |
| /** Write the symbology for the layer into the docment provided. | | /** Write the symbology for the layer into the docment provided. | |
| * @param node the node that will have the style element added to it. | | * @param node the node that will have the style element added to it. | |
| * @param doc the document that will have the QDomNode added. | | * @param doc the document that will have the QDomNode added. | |
| | | | |
| skipping to change at line 332 | | skipping to change at line 352 | |
| float maximumScale(); | | float maximumScale(); | |
| | | | |
| /** Accessor and mutator for the scale based visilibility flag */ | | /** Accessor and mutator for the scale based visilibility flag */ | |
| void toggleScaleBasedVisibility( bool theVisibilityFlag ); | | void toggleScaleBasedVisibility( bool theVisibilityFlag ); | |
| bool hasScaleBasedVisibility(); | | bool hasScaleBasedVisibility(); | |
| | | | |
| /** Clear cached image | | /** Clear cached image | |
| * added in 1.5 */ | | * added in 1.5 */ | |
| void clearCacheImage(); | | void clearCacheImage(); | |
| | | | |
|
| | | /** \brief Obtain Metadata for this layer */ | |
| | | virtual QString metadata(); | |
| | | | |
| /** Time stamp of data source in the moment when data/metadata were loa
ded by provider */ | | /** Time stamp of data source in the moment when data/metadata were loa
ded by provider */ | |
| virtual QDateTime timestamp() const { return QDateTime() ; } | | virtual QDateTime timestamp() const { return QDateTime() ; } | |
| | | | |
| signals: | | signals: | |
| | | | |
| /** Emit a signal to notify of a progress event */ | | /** Emit a signal to notify of a progress event */ | |
| void drawingProgress( int theProgress, int theTotalSteps ); | | void drawingProgress( int theProgress, int theTotalSteps ); | |
| | | | |
| /** Emit a signal with status (e.g. to be caught by QgisApp and display
a msg on status bar) */ | | /** Emit a signal with status (e.g. to be caught by QgisApp and display
a msg on status bar) */ | |
| void statusChanged( QString theStatus ); | | void statusChanged( QString theStatus ); | |
| | | | |
| skipping to change at line 376 | | skipping to change at line 399 | |
| | | | |
| protected: | | protected: | |
| | | | |
| /** set whether layer is valid or not - should be used in constructor. | | /** set whether layer is valid or not - should be used in constructor. | |
| \note added in v1.5 */ | | \note added in v1.5 */ | |
| void setValid( bool valid ); | | void setValid( bool valid ); | |
| | | | |
| /** called by readXML(), used by children to read state specific to the
m from | | /** called by readXML(), used by children to read state specific to the
m from | |
| project files. | | project files. | |
| */ | | */ | |
|
| virtual bool readXml( QDomNode & layer_node ); | | virtual bool readXml( const QDomNode& layer_node ); | |
| | | | |
| /** called by writeXML(), used by children to write state specific to t
hem to | | /** called by writeXML(), used by children to write state specific to t
hem to | |
| project files. | | project files. | |
| */ | | */ | |
| virtual bool writeXml( QDomNode & layer_node, QDomDocument & document )
; | | virtual bool writeXml( QDomNode & layer_node, QDomDocument & document )
; | |
| | | | |
| /** Read custom properties from project file. Added in v1.4 | | /** Read custom properties from project file. Added in v1.4 | |
| @param layerNode note to read from | | @param layerNode note to read from | |
| @param keyStartsWith reads only properties starting with the specifie
d string (or all if the string is empty)*/ | | @param keyStartsWith reads only properties starting with the specifie
d string (or all if the string is empty)*/ | |
| void readCustomProperties( const QDomNode& layerNode, const QString& ke
yStartsWith = "" ); | | void readCustomProperties( const QDomNode& layerNode, const QString& ke
yStartsWith = "" ); | |
| | | | |
| skipping to change at line 409 | | skipping to change at line 432 | |
| | | | |
| /** Indicates if the layer is valid and can be drawn */ | | /** Indicates if the layer is valid and can be drawn */ | |
| bool mValid; | | bool mValid; | |
| | | | |
| /** data source description string, varies by layer type */ | | /** data source description string, varies by layer type */ | |
| QString mDataSource; | | QString mDataSource; | |
| | | | |
| /** Name of the layer - used for display */ | | /** Name of the layer - used for display */ | |
| QString mLayerName; | | QString mLayerName; | |
| | | | |
|
| /** layer's Spatial reference system */ | | QString mTitle; | |
| QgsCoordinateReferenceSystem* mCRS; | | | |
| | | /**Description of the layer*/ | |
| | | QString mAbstract; | |
| | | | |
| private: | | private: | |
|
| | | /** layer's spatial reference system. | |
| | | private to make sure setCrs must be used and layerCrsChanged() is e | |
| | | mitted */ | |
| | | QgsCoordinateReferenceSystem* mCRS; | |
| | | | |
| /** private copy constructor - QgsMapLayer not copyable */ | | /** private copy constructor - QgsMapLayer not copyable */ | |
| QgsMapLayer( QgsMapLayer const & ); | | QgsMapLayer( QgsMapLayer const & ); | |
| | | | |
| /** private assign operator - QgsMapLayer not copyable */ | | /** private assign operator - QgsMapLayer not copyable */ | |
| QgsMapLayer & operator=( QgsMapLayer const & ); | | QgsMapLayer & operator=( QgsMapLayer const & ); | |
| | | | |
| /** Unique ID of this layer - used to refer to this layer in map layer
registry */ | | /** Unique ID of this layer - used to refer to this layer in map layer
registry */ | |
| QString mID; | | QString mID; | |
| | | | |
| | | | |
End of changes. 14 change blocks. |
| 9 lines changed or deleted | | 41 lines changed or added | |
|
| qgsmaplayerregistry.h | | qgsmaplayerregistry.h | |
| | | | |
| skipping to change at line 18 | | skipping to change at line 18 | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| | | | |
| #ifndef QGSMAPLAYERREGISTRY_H | | #ifndef QGSMAPLAYERREGISTRY_H | |
| #define QGSMAPLAYERREGISTRY_H | | #define QGSMAPLAYERREGISTRY_H | |
| | | | |
| #include <QMap> | | #include <QMap> | |
| #include <QObject> | | #include <QObject> | |
|
| | | #include <QStringList> | |
| class QString; | | class QString; | |
|
| class QStringList; | | | |
| | | | |
| class QgsMapLayer; | | class QgsMapLayer; | |
| | | | |
| /** \ingroup core | | /** \ingroup core | |
| * This class tracks map layers that are currently loaded and provides | | * This class tracks map layers that are currently loaded and provides | |
| * a means to fetch a pointer to a map layer and delete it. | | * a means to fetch a pointer to a map layer and delete it. | |
| */ | | */ | |
| class CORE_EXPORT QgsMapLayerRegistry : public QObject | | class CORE_EXPORT QgsMapLayerRegistry : public QObject | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 47 | |
| | | | |
| //! Returns the instance pointer, creating the object on the first call | | //! Returns the instance pointer, creating the object on the first call | |
| static QgsMapLayerRegistry * instance(); | | static QgsMapLayerRegistry * instance(); | |
| /*! Return the number of registered layers. | | /*! Return the number of registered layers. | |
| * | | * | |
| * */ | | * */ | |
| int count(); | | int count(); | |
| | | | |
| ~QgsMapLayerRegistry(); | | ~QgsMapLayerRegistry(); | |
| | | | |
|
| //! Retrieve a pointer to a loaded plugin by id | | //! Retrieve a pointer to a loaded layer by id | |
| QgsMapLayer * mapLayer( QString theLayerId ); | | QgsMapLayer * mapLayer( QString theLayerId ); | |
| | | | |
|
| //! Retrieve the mapLayers collection (mainly intended for use by projectio
) | | //! Retrieve the mapLayers collection (mainly intended for use by proje
ctio) | |
| QMap<QString, QgsMapLayer*> & mapLayers(); | | QMap<QString, QgsMapLayer*> & mapLayers(); | |
| | | | |
| /** Add a layer to the map of loaded layers | | /** Add a layer to the map of loaded layers | |
| @returns NULL if unable to add layer, otherwise pointer to newly add
ed layer | | @returns NULL if unable to add layer, otherwise pointer to newly add
ed layer | |
| @note | | @note | |
| | | | |
| As a side-effect QgsProject is made dirty. | | As a side-effect QgsProject is made dirty. | |
| | | | |
| Emits signal that layer has been added only if theEmitSignal is true
(by default). | | Emits signal that layer has been added only if theEmitSignal is true
(by default). | |
|
| Not emitting signal is useful when you want to use registry also for | | | |
| layers | | Not emitting signal is useful when you want to use registry for laye | |
| which won't be used in main map canvas but will be used in a special | | rs | |
| one | | on a different canvas and don't want them added to the main canvas a | |
| | | utomatically. | |
| | | | |
| | | @note This method is deprecated since QGIS 1.8, you should use addMa | |
| | | pLayers rather. | |
| */ | | */ | |
|
| QgsMapLayer *addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal | | Q_DECL_DEPRECATED QgsMapLayer *addMapLayer( QgsMapLayer * theMapLayer, | |
| = true ); | | bool theEmitSignal = true ); | |
| | | | |
| | | /** Add a list of layers to the map of loaded layers | |
| | | @returns QList<QgsMapLayer *> - a list of the map layers that were a | |
| | | dded | |
| | | successfully. If a layer is invalid, or already exists in the regist | |
| | | ry, | |
| | | it will not be part of the returned QList. | |
| | | @note added in QGIS 1.8 | |
| | | | |
|
| /** Remove a layer from qgis | | | |
| @note | | | |
| As a side-effect QgsProject is made dirty. | | As a side-effect QgsProject is made dirty. | |
|
| Any canvases using that layer will need to remove it | | | |
| theEmitSignal - see addMapLayer() | | If theEmitSignal is true (by default), a layersAdded( QList<QgsMapLa | |
| | | yer *>) | |
| | | signal will be emitted indicating that a batch of layers were added. | |
| | | Not emitting signal is useful when you want to use registry for laye | |
| | | rs | |
| | | on a different canvas and don't want them added to the main canvas a | |
| | | utomatically. | |
| | | */ | |
| | | QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers, | |
| | | bool theEmitSignal = true ); | |
| | | | |
| | | /** Remove a layer from qgis | |
| | | @note As a side-effect QgsProject is made dirty. Any canvases using | |
| | | that layer will need to remove it | |
| | | | |
| | | If theEmitSignal is true (by default), a layerWillBeRemoved( QString | |
| | | theId ) | |
| | | signal will be emitted indicating to any listeners that the layer is | |
| | | being removed. | |
| | | | |
| The layer being removed is deleted as well as the registry | | The layer being removed is deleted as well as the registry | |
| table entry. | | table entry. | |
|
| | | @note This method is deprecated since QGIS 1.8, you should use remov
eMapLayers rather. | |
| */ | | */ | |
|
| void removeMapLayer( QString theLayerId, bool theEmitSignal = true ); | | Q_DECL_DEPRECATED void removeMapLayer( QString theLayerId, bool theEmit | |
| | | Signal = true ); | |
| | | | |
| | | /** Remove a set of layers from qgis | |
| | | @note As a side-effect QgsProject is made dirty. | |
| | | Any canvases using the affected layers will need to remove them | |
| | | | |
| | | If theEmitSignal is true (by default), a layersRemoved( QStringList | |
| | | theLayerIds ) | |
| | | signal will be emitted indicating to any listeners that the layers a | |
| | | re being removed. | |
| | | | |
| | | The layer being removed is deleted as well as the registry | |
| | | table entry. | |
| | | */ | |
| | | void removeMapLayers( QStringList theLayerIds, bool theEmitSignal = tru | |
| | | e ); | |
| | | | |
| /** Remove all registered layers | | /** Remove all registered layers | |
| @note raises removedAll() | | @note raises removedAll() | |
| As a side-effect QgsProject is made dirty. | | As a side-effect QgsProject is made dirty. | |
| @note The layers are deleted as the registry is cleared! | | @note The layers are deleted as the registry is cleared! | |
| */ | | */ | |
| void removeAllMapLayers(); | | void removeAllMapLayers(); | |
| | | | |
| /* Clears all layer caches, resetting them to zero and | | /* Clears all layer caches, resetting them to zero and | |
| * freeing up any memory they may have been using. Layer | | * freeing up any memory they may have been using. Layer | |
| | | | |
| skipping to change at line 99 | | skipping to change at line 129 | |
| * @note this method was added in QGIS 1.4 | | * @note this method was added in QGIS 1.4 | |
| */ | | */ | |
| void clearAllLayerCaches(); | | void clearAllLayerCaches(); | |
| | | | |
| /**Reload all provider data caches (currently used for WFS and WMS prov
iders) | | /**Reload all provider data caches (currently used for WFS and WMS prov
iders) | |
| @note: this method was added in QGIS 1.6*/ | | @note: this method was added in QGIS 1.6*/ | |
| void reloadAllLayers(); | | void reloadAllLayers(); | |
| | | | |
| signals: | | signals: | |
| | | | |
|
| | | /** Emitted when one or more layers are removed from the registry | |
| | | @note intended to replace layerWillBeRemoved in QGIS 1.8 | |
| | | */ | |
| | | void layersWillBeRemoved( QStringList theLayerIds ); | |
| | | | |
| /** emitted when a layer is removed from the registry | | /** emitted when a layer is removed from the registry | |
| connected to main map canvas and overview map canvas remove() | | connected to main map canvas and overview map canvas remove() | |
|
| | | @note we should deprecate this at some stage | |
| */ | | */ | |
| void layerWillBeRemoved( QString theLayerId ); | | void layerWillBeRemoved( QString theLayerId ); | |
| | | | |
|
| | | /** Emitted when one or more layers are added to the registry | |
| | | @note intended to replace layerWasAdded in QGIS 1.8 | |
| | | */ | |
| | | void layersAdded( QList<QgsMapLayer *> theMapLayers ); | |
| /** emitted when a layer is added to the registry | | /** emitted when a layer is added to the registry | |
| connected to main map canvas and overview map canvas addLayer() | | connected to main map canvas and overview map canvas addLayer() | |
|
| | | @note we should deprecate this at some stage | |
| */ | | */ | |
| void layerWasAdded( QgsMapLayer * theMapLayer ); | | void layerWasAdded( QgsMapLayer * theMapLayer ); | |
| | | | |
| /** emitted when ALL layers are removed at once | | /** emitted when ALL layers are removed at once | |
| This could have been implemented by iteratively signalling | | This could have been implemented by iteratively signalling | |
| layerWillBeRemoved() for each layer as it is removed. However, this | | layerWillBeRemoved() for each layer as it is removed. However, this | |
| generally causes a cascade of effects that are unnecessary if we're | | generally causes a cascade of effects that are unnecessary if we're | |
| ultimately removing all layers. E.g., removing the legend item | | ultimately removing all layers. E.g., removing the legend item | |
| corresponding to the layer. Why bother doing that when you're just
going | | corresponding to the layer. Why bother doing that when you're just
going | |
| to clear everything anyway? | | to clear everything anyway? | |
| | | | |
End of changes. 15 change blocks. |
| 17 lines changed or deleted | | 71 lines changed or added | |
|
| qgsmaprenderer.h | | qgsmaprenderer.h | |
| | | | |
| skipping to change at line 15 | | skipping to change at line 15 | |
| copyright : (C) 2006 by Martin Dobias | | copyright : (C) 2006 by Martin Dobias | |
| email : wonder.sk at gmail dot com | | email : wonder.sk at gmail dot com | |
| **************************************************************************
* | | **************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| | | | |
| #ifndef QGSMAPRENDER_H | | #ifndef QGSMAPRENDER_H | |
| #define QGSMAPRENDER_H | | #define QGSMAPRENDER_H | |
| | | | |
|
| | | #include <QMutex> | |
| #include <QSize> | | #include <QSize> | |
| #include <QStringList> | | #include <QStringList> | |
| #include <QVector> | | #include <QVector> | |
| | | | |
| #include "qgis.h" | | #include "qgis.h" | |
| #include "qgsrectangle.h" | | #include "qgsrectangle.h" | |
| #include "qgsrendercontext.h" | | #include "qgsrendercontext.h" | |
|
| | | #include "qgsfeature.h" | |
| | | | |
| class QDomDocument; | | class QDomDocument; | |
| class QDomNode; | | class QDomNode; | |
| class QPainter; | | class QPainter; | |
| | | | |
| class QgsMapToPixel; | | class QgsMapToPixel; | |
| class QgsMapLayer; | | class QgsMapLayer; | |
| class QgsMapRenderer; | | class QgsMapRenderer; | |
| class QgsScaleCalculator; | | class QgsScaleCalculator; | |
| class QgsCoordinateReferenceSystem; | | class QgsCoordinateReferenceSystem; | |
| class QgsDistanceArea; | | class QgsDistanceArea; | |
| class QgsOverlayObjectPositionManager; | | class QgsOverlayObjectPositionManager; | |
| class QgsVectorLayer; | | class QgsVectorLayer; | |
|
| class QgsFeature; | | | |
| | | | |
| struct QgsDiagramLayerSettings; | | struct QgsDiagramLayerSettings; | |
| | | | |
| struct CORE_EXPORT QgsLabelPosition | | struct CORE_EXPORT QgsLabelPosition | |
| { | | { | |
| QgsLabelPosition( int id, double r, const QVector< QgsPoint >& corners, c
onst QgsRectangle& rect, double w, double h, const QString& layer, bool ups
ide_down, bool diagram = false ): | | QgsLabelPosition( int id, double r, const QVector< QgsPoint >& corners, c
onst QgsRectangle& rect, double w, double h, const QString& layer, bool ups
ide_down, bool diagram = false ): | |
| featureId( id ), rotation( r ), cornerPoints( corners ), labelRect( r
ect ), width( w ), height( h ), layerID( layer ), upsideDown( upside_down )
, isDiagram( diagram ) {} | | featureId( id ), rotation( r ), cornerPoints( corners ), labelRect( r
ect ), width( w ), height( h ), layerID( layer ), upsideDown( upside_down )
, isDiagram( diagram ) {} | |
| QgsLabelPosition(): featureId( -1 ), rotation( 0 ), labelRect( QgsRectang
le() ), width( 0 ), height( 0 ), layerID( "" ), upsideDown( false ), isDiag
ram( false ) {} | | QgsLabelPosition(): featureId( -1 ), rotation( 0 ), labelRect( QgsRectang
le() ), width( 0 ), height( 0 ), layerID( "" ), upsideDown( false ), isDiag
ram( false ) {} | |
| int featureId; | | int featureId; | |
| double rotation; | | double rotation; | |
| | | | |
| skipping to change at line 77 | | skipping to change at line 77 | |
| virtual ~QgsLabelingEngineInterface() {} | | virtual ~QgsLabelingEngineInterface() {} | |
| | | | |
| //! called when we're going to start with rendering | | //! called when we're going to start with rendering | |
| virtual void init( QgsMapRenderer* mp ) = 0; | | virtual void init( QgsMapRenderer* mp ) = 0; | |
| //! called to find out whether the layer is used for labeling | | //! called to find out whether the layer is used for labeling | |
| virtual bool willUseLayer( QgsVectorLayer* layer ) = 0; | | virtual bool willUseLayer( QgsVectorLayer* layer ) = 0; | |
| //! called when starting rendering of a layer | | //! called when starting rendering of a layer | |
| //! @note: this method was added in version 1.6 | | //! @note: this method was added in version 1.6 | |
| virtual int prepareLayer( QgsVectorLayer* layer, QSet<int>& attrIndices
, QgsRenderContext& ctx ) = 0; | | virtual int prepareLayer( QgsVectorLayer* layer, QSet<int>& attrIndices
, QgsRenderContext& ctx ) = 0; | |
| //! adds a diagram layer to the labeling engine | | //! adds a diagram layer to the labeling engine | |
|
| virtual int addDiagramLayer( QgsVectorLayer* layer, QgsDiagramLayerSett | | virtual int addDiagramLayer( QgsVectorLayer* layer, QgsDiagramLayerSett | |
| ings* s ) { return 0; } | | ings* s ) | |
| | | { Q_UNUSED( layer ); Q_UNUSED( s ); return 0; } | |
| //! called for every feature | | //! called for every feature | |
| virtual void registerFeature( QgsVectorLayer* layer, QgsFeature& feat,
const QgsRenderContext& context = QgsRenderContext() ) = 0; | | virtual void registerFeature( QgsVectorLayer* layer, QgsFeature& feat,
const QgsRenderContext& context = QgsRenderContext() ) = 0; | |
| //! called for every diagram feature | | //! called for every diagram feature | |
|
| virtual void registerDiagramFeature( QgsVectorLayer* layer, QgsFeature& | | virtual void registerDiagramFeature( QgsVectorLayer* layer, QgsFeature& | |
| feat, const QgsRenderContext& context = QgsRenderContext() ) {}; | | feat, const QgsRenderContext& context = QgsRenderContext() ) | |
| | | { Q_UNUSED( layer ); Q_UNUSED( feat ); Q_UNUSED( context ); } | |
| //! called when the map is drawn and labels should be placed | | //! called when the map is drawn and labels should be placed | |
| virtual void drawLabeling( QgsRenderContext& context ) = 0; | | virtual void drawLabeling( QgsRenderContext& context ) = 0; | |
| //! called when we're done with rendering | | //! called when we're done with rendering | |
| virtual void exit() = 0; | | virtual void exit() = 0; | |
| //! return infos about labels at a given (map) position | | //! return infos about labels at a given (map) position | |
| //! @note: this method was added in version 1.7 | | //! @note: this method was added in version 1.7 | |
| virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ) =
0; | | virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ) =
0; | |
| | | | |
| //! called when passing engine among map renderers | | //! called when passing engine among map renderers | |
| virtual QgsLabelingEngineInterface* clone() = 0; | | virtual QgsLabelingEngineInterface* clone() = 0; | |
| | | | |
| skipping to change at line 119 | | skipping to change at line 121 | |
| //MAP_UNITS probably supported in future versions | | //MAP_UNITS probably supported in future versions | |
| }; | | }; | |
| | | | |
| //! constructor | | //! constructor | |
| QgsMapRenderer(); | | QgsMapRenderer(); | |
| | | | |
| //! destructor | | //! destructor | |
| ~QgsMapRenderer(); | | ~QgsMapRenderer(); | |
| | | | |
| //! starts rendering | | //! starts rendering | |
|
| void render( QPainter* painter ); | | //! @ param forceWidthScale Force a specific scale factor for line widt | |
| | | hs and marker sizes. Automatically calculated from output device DPI if 0 | |
| | | void render( QPainter* painter, double* forceWidthScale = 0 ); | |
| | | | |
| //! sets extent and checks whether suitable (returns false if not) | | //! sets extent and checks whether suitable (returns false if not) | |
| bool setExtent( const QgsRectangle& extent ); | | bool setExtent( const QgsRectangle& extent ); | |
| | | | |
| //! returns current extent | | //! returns current extent | |
| QgsRectangle extent() const; | | QgsRectangle extent() const; | |
| | | | |
| const QgsMapToPixel* coordinateTransform() { return &( mRenderContext.m
apToPixel() ); } | | const QgsMapToPixel* coordinateTransform() { return &( mRenderContext.m
apToPixel() ); } | |
| | | | |
| double scale() const { return mScale; } | | double scale() const { return mScale; } | |
| | | | |
| skipping to change at line 249 | | skipping to change at line 252 | |
| void mapUnitsChanged(); | | void mapUnitsChanged(); | |
| | | | |
| //! emitted when layer's draw() returned false | | //! emitted when layer's draw() returned false | |
| void drawError( QgsMapLayer* ); | | void drawError( QgsMapLayer* ); | |
| | | | |
| public slots: | | public slots: | |
| | | | |
| //! called by signal from layer current being drawn | | //! called by signal from layer current being drawn | |
| void onDrawingProgress( int current, int total ); | | void onDrawingProgress( int current, int total ); | |
| | | | |
|
| | | //! invalidate cached layer CRS | |
| | | void invalidateCachedLayerCrs(); | |
| | | | |
| | | //! cached layer was destroyed | |
| | | void cachedLayerDestroyed(); | |
| | | | |
| protected: | | protected: | |
| | | | |
| //! adjust extent to fit the pixmap size | | //! adjust extent to fit the pixmap size | |
| void adjustExtentToSize(); | | void adjustExtentToSize(); | |
| | | | |
| /** Convenience function to project an extent into the layer source | | /** Convenience function to project an extent into the layer source | |
| * CRS, but also split it into two extents if it crosses | | * CRS, but also split it into two extents if it crosses | |
| * the +/- 180 degree line. Modifies the given extent to be in the | | * the +/- 180 degree line. Modifies the given extent to be in the | |
| * source CRS coordinates, and if it was split, returns true, and | | * source CRS coordinates, and if it was split, returns true, and | |
| * also sets the contents of the r2 parameter | | * also sets the contents of the r2 parameter | |
| */ | | */ | |
| bool splitLayersExtent( QgsMapLayer* layer, QgsRectangle& extent, QgsRe
ctangle& r2 ); | | bool splitLayersExtent( QgsMapLayer* layer, QgsRectangle& extent, QgsRe
ctangle& r2 ); | |
| | | | |
| /**Creates an overlay object position manager subclass according to the
current settings | | /**Creates an overlay object position manager subclass according to the
current settings | |
| @note this method was added in version 1.1*/ | | @note this method was added in version 1.1*/ | |
| QgsOverlayObjectPositionManager* overlayManagerFromSettings(); | | QgsOverlayObjectPositionManager* overlayManagerFromSettings(); | |
| | | | |
|
| protected: | | | |
| | | | |
| //! indicates drawing in progress | | //! indicates drawing in progress | |
| static bool mDrawing; | | static bool mDrawing; | |
| | | | |
| //! map units per pixel | | //! map units per pixel | |
| double mMapUnitsPerPixel; | | double mMapUnitsPerPixel; | |
| | | | |
| //! Map scale at its current zool level | | //! Map scale at its current zool level | |
| double mScale; | | double mScale; | |
| | | | |
| //! scale calculator | | //! scale calculator | |
| | | | |
| skipping to change at line 318 | | skipping to change at line 325 | |
| QgsDistanceArea* mDistArea; | | QgsDistanceArea* mDistArea; | |
| | | | |
| //!Encapsulates context of rendering | | //!Encapsulates context of rendering | |
| QgsRenderContext mRenderContext; | | QgsRenderContext mRenderContext; | |
| | | | |
| //!Output units | | //!Output units | |
| OutputUnits mOutputUnits; | | OutputUnits mOutputUnits; | |
| | | | |
| //! Labeling engine (NULL by default) | | //! Labeling engine (NULL by default) | |
| QgsLabelingEngineInterface* mLabelingEngine; | | QgsLabelingEngineInterface* mLabelingEngine; | |
|
| | | | |
| | | //! Locks rendering loop for concurrent draws | |
| | | QMutex mRenderMutex; | |
| | | | |
| | | private: | |
| | | QgsCoordinateTransform *tr( QgsMapLayer *layer ); | |
| | | QgsCoordinateTransform *mCachedTr; | |
| | | QgsMapLayer *mCachedTrForLayer; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 9 lines changed or deleted | | 25 lines changed or added | |
|
| qgsmarkersymbollayerv2.h | | qgsmarkersymbollayerv2.h | |
|
| | | /************************************************************************** | |
| | | * | |
| | | qgsmarkersymbollayerv2.h | |
| | | --------------------- | |
| | | begin : November 2009 | |
| | | copyright : (C) 2009 by Martin Dobias | |
| | | email : wonder.sk at gmail.com | |
| | | ************************************************************************** | |
| | | * | |
| | | * | |
| | | * | |
| | | * This program is free software; you can redistribute it and/or modify | |
| | | * | |
| | | * it under the terms of the GNU General Public License as published by | |
| | | * | |
| | | * the Free Software Foundation; either version 2 of the License, or | |
| | | * | |
| | | * (at your option) any later version. | |
| | | * | |
| | | * | |
| | | * | |
| | | ************************************************************************** | |
| | | */ | |
| | | | |
| #ifndef QGSMARKERSYMBOLLAYERV2_H | | #ifndef QGSMARKERSYMBOLLAYERV2_H | |
| #define QGSMARKERSYMBOLLAYERV2_H | | #define QGSMARKERSYMBOLLAYERV2_H | |
| | | | |
| #include "qgssymbollayerv2.h" | | #include "qgssymbollayerv2.h" | |
| | | | |
| #define DEFAULT_SIMPLEMARKER_NAME "circle" | | #define DEFAULT_SIMPLEMARKER_NAME "circle" | |
| #define DEFAULT_SIMPLEMARKER_COLOR QColor(255,0,0) | | #define DEFAULT_SIMPLEMARKER_COLOR QColor(255,0,0) | |
| #define DEFAULT_SIMPLEMARKER_BORDERCOLOR QColor(0,0,0) | | #define DEFAULT_SIMPLEMARKER_BORDERCOLOR QColor(0,0,0) | |
| #define DEFAULT_SIMPLEMARKER_SIZE DEFAULT_POINT_SIZE | | #define DEFAULT_SIMPLEMARKER_SIZE DEFAULT_POINT_SIZE | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 45 | |
| public: | | public: | |
| QgsSimpleMarkerSymbolLayerV2( QString name = DEFAULT_SIMPLEMARKER_NAME, | | QgsSimpleMarkerSymbolLayerV2( QString name = DEFAULT_SIMPLEMARKER_NAME, | |
| QColor color = DEFAULT_SIMPLEMARKER_COLOR
, | | QColor color = DEFAULT_SIMPLEMARKER_COLOR
, | |
| QColor borderColor = DEFAULT_SIMPLEMARKER
_BORDERCOLOR, | | QColor borderColor = DEFAULT_SIMPLEMARKER
_BORDERCOLOR, | |
| double size = DEFAULT_SIMPLEMARKER_SIZE, | | double size = DEFAULT_SIMPLEMARKER_SIZE, | |
| double angle = DEFAULT_SIMPLEMARKER_ANGLE
); | | double angle = DEFAULT_SIMPLEMARKER_ANGLE
); | |
| | | | |
| // static stuff | | // static stuff | |
| | | | |
| static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | |
|
| | | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |
| | | | |
| // implemented from base classes | | // implemented from base classes | |
| | | | |
| QString layerType() const; | | QString layerType() const; | |
| | | | |
| void startRender( QgsSymbolV2RenderContext& context ); | | void startRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void stopRender( QgsSymbolV2RenderContext& context ); | | void stopRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& conte
xt ); | | void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& conte
xt ); | |
| | | | |
| QgsStringMap properties() const; | | QgsStringMap properties() const; | |
| | | | |
| QgsSymbolLayerV2* clone() const; | | QgsSymbolLayerV2* clone() const; | |
| | | | |
|
| | | void writeSldMarker( QDomDocument &doc, QDomElement &element, QgsString | |
| | | Map props ) const; | |
| | | | |
| QString name() const { return mName; } | | QString name() const { return mName; } | |
| void setName( QString name ) { mName = name; } | | void setName( QString name ) { mName = name; } | |
| | | | |
| QColor borderColor() const { return mBorderColor; } | | QColor borderColor() const { return mBorderColor; } | |
| void setBorderColor( QColor color ) { mBorderColor = color; } | | void setBorderColor( QColor color ) { mBorderColor = color; } | |
| | | | |
| protected: | | protected: | |
| | | | |
| void drawMarker( QPainter* p, QgsSymbolV2RenderContext& context ); | | void drawMarker( QPainter* p, QgsSymbolV2RenderContext& context ); | |
| | | | |
| | | | |
| skipping to change at line 90 | | skipping to change at line 107 | |
| class CORE_EXPORT QgsSvgMarkerSymbolLayerV2 : public QgsMarkerSymbolLayerV2 | | class CORE_EXPORT QgsSvgMarkerSymbolLayerV2 : public QgsMarkerSymbolLayerV2 | |
| { | | { | |
| public: | | public: | |
| QgsSvgMarkerSymbolLayerV2( QString name = DEFAULT_SVGMARKER_NAME, | | QgsSvgMarkerSymbolLayerV2( QString name = DEFAULT_SVGMARKER_NAME, | |
| double size = DEFAULT_SVGMARKER_SIZE, | | double size = DEFAULT_SVGMARKER_SIZE, | |
| double angle = DEFAULT_SVGMARKER_ANGLE ); | | double angle = DEFAULT_SVGMARKER_ANGLE ); | |
| | | | |
| // static stuff | | // static stuff | |
| | | | |
| static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | |
|
| | | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |
| | | | |
| //! Return a list of all available svg files | | //! Return a list of all available svg files | |
| static QStringList listSvgFiles(); | | static QStringList listSvgFiles(); | |
| | | | |
| //! Get symbol's path from its name | | //! Get symbol's path from its name | |
| static QString symbolNameToPath( QString name ); | | static QString symbolNameToPath( QString name ); | |
| | | | |
| //! Get symbols's name from its path | | //! Get symbols's name from its path | |
| static QString symbolPathToName( QString path ); | | static QString symbolPathToName( QString path ); | |
| | | | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 132 | |
| void startRender( QgsSymbolV2RenderContext& context ); | | void startRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void stopRender( QgsSymbolV2RenderContext& context ); | | void stopRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& conte
xt ); | | void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& conte
xt ); | |
| | | | |
| QgsStringMap properties() const; | | QgsStringMap properties() const; | |
| | | | |
| QgsSymbolLayerV2* clone() const; | | QgsSymbolLayerV2* clone() const; | |
| | | | |
|
| | | void writeSldMarker( QDomDocument &doc, QDomElement &element, QgsString | |
| | | Map props ) const; | |
| | | | |
| QString path() const { return mPath; } | | QString path() const { return mPath; } | |
|
| void setPath( QString path ) { mPath = path; } | | void setPath( QString path ); | |
| | | | |
| | | QColor fillColor() const { return mFillColor; } | |
| | | void setFillColor( const QColor& c ) { mFillColor = c; } | |
| | | | |
| | | QColor outlineColor() const { return mOutlineColor; } | |
| | | void setOutlineColor( const QColor& c ) { mOutlineColor = c; } | |
| | | | |
| | | double outlineWidth() const { return mOutlineWidth; } | |
| | | void setOutlineWidth( double w ) { mOutlineWidth = w; } | |
| | | | |
| protected: | | protected: | |
| | | | |
| void loadSvg(); | | void loadSvg(); | |
| | | | |
| QString mPath; | | QString mPath; | |
|
| QPicture mPicture; | | | |
| QPicture mSelPicture; | | //param(fill), param(outline), param(outline-width) are going | |
| | | //to be replaced in memory | |
| | | QColor mFillColor; | |
| | | QColor mOutlineColor; | |
| | | double mOutlineWidth; | |
| double mOrigSize; | | double mOrigSize; | |
| }; | | }; | |
| | | | |
| ////////// | | ////////// | |
| | | | |
| #define POINT2MM(x) ( (x) * 25.4 / 72 ) // point is 1/72 of inch | | #define POINT2MM(x) ( (x) * 25.4 / 72 ) // point is 1/72 of inch | |
| #define MM2POINT(x) ( (x) * 72 / 25.4 ) | | #define MM2POINT(x) ( (x) * 72 / 25.4 ) | |
| | | | |
| #define DEFAULT_FONTMARKER_FONT "Dingbats" | | #define DEFAULT_FONTMARKER_FONT "Dingbats" | |
| #define DEFAULT_FONTMARKER_CHR QChar('A') | | #define DEFAULT_FONTMARKER_CHR QChar('A') | |
| | | | |
| skipping to change at line 150 | | skipping to change at line 183 | |
| public: | | public: | |
| QgsFontMarkerSymbolLayerV2( QString fontFamily = DEFAULT_FONTMARKER_FON
T, | | QgsFontMarkerSymbolLayerV2( QString fontFamily = DEFAULT_FONTMARKER_FON
T, | |
| QChar chr = DEFAULT_FONTMARKER_CHR, | | QChar chr = DEFAULT_FONTMARKER_CHR, | |
| double pointSize = DEFAULT_FONTMARKER_SIZE, | | double pointSize = DEFAULT_FONTMARKER_SIZE, | |
| QColor color = DEFAULT_FONTMARKER_COLOR, | | QColor color = DEFAULT_FONTMARKER_COLOR, | |
| double angle = DEFAULT_FONTMARKER_ANGLE ); | | double angle = DEFAULT_FONTMARKER_ANGLE ); | |
| | | | |
| // static stuff | | // static stuff | |
| | | | |
| static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt
ringMap() ); | |
|
| | | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |
| | | | |
| // implemented from base classes | | // implemented from base classes | |
| | | | |
| QString layerType() const; | | QString layerType() const; | |
| | | | |
| void startRender( QgsSymbolV2RenderContext& context ); | | void startRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void stopRender( QgsSymbolV2RenderContext& context ); | | void stopRender( QgsSymbolV2RenderContext& context ); | |
| | | | |
| void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& conte
xt ); | | void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& conte
xt ); | |
| | | | |
| QgsStringMap properties() const; | | QgsStringMap properties() const; | |
| | | | |
| QgsSymbolLayerV2* clone() const; | | QgsSymbolLayerV2* clone() const; | |
| | | | |
|
| | | void writeSldMarker( QDomDocument &doc, QDomElement &element, QgsString | |
| | | Map props ) const; | |
| | | | |
| // new methods | | // new methods | |
| | | | |
| QString fontFamily() const { return mFontFamily; } | | QString fontFamily() const { return mFontFamily; } | |
| void setFontFamily( QString family ) { mFontFamily = family; } | | void setFontFamily( QString family ) { mFontFamily = family; } | |
| | | | |
| QChar character() const { return mChr; } | | QChar character() const { return mChr; } | |
| void setCharacter( QChar ch ) { mChr = ch; } | | void setCharacter( QChar ch ) { mChr = ch; } | |
| | | | |
| protected: | | protected: | |
| | | | |
| | | | |
End of changes. 9 change blocks. |
| 3 lines changed or deleted | | 51 lines changed or added | |
|
| qgspallabeling.h | | qgspallabeling.h | |
| | | | |
| skipping to change at line 49 | | skipping to change at line 49 | |
| | | | |
| namespace pal | | namespace pal | |
| { | | { | |
| class Pal; | | class Pal; | |
| class Layer; | | class Layer; | |
| class LabelPosition; | | class LabelPosition; | |
| } | | } | |
| | | | |
| class QgsMapToPixel; | | class QgsMapToPixel; | |
| class QgsFeature; | | class QgsFeature; | |
|
| #include "qgspoint.h" | | | |
| | | | |
|
| | | #include "qgspoint.h" | |
| #include "qgsmaprenderer.h" // definition of QgsLabelingEngineInterface | | #include "qgsmaprenderer.h" // definition of QgsLabelingEngineInterface | |
|
| | | #include "qgsexpression.h" | |
| | | | |
| class QgsPalGeometry; | | class QgsPalGeometry; | |
| class QgsVectorLayer; | | class QgsVectorLayer; | |
| | | | |
| class CORE_EXPORT QgsPalLayerSettings | | class CORE_EXPORT QgsPalLayerSettings | |
| { | | { | |
| public: | | public: | |
| QgsPalLayerSettings(); | | QgsPalLayerSettings(); | |
| QgsPalLayerSettings( const QgsPalLayerSettings& s ); | | QgsPalLayerSettings( const QgsPalLayerSettings& s ); | |
| ~QgsPalLayerSettings(); | | ~QgsPalLayerSettings(); | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 102 | |
| BufferColor, | | BufferColor, | |
| PositionX, //x-coordinate data defined label position | | PositionX, //x-coordinate data defined label position | |
| PositionY, //y-coordinate data defined label position | | PositionY, //y-coordinate data defined label position | |
| Hali, //horizontal alignment for data defined label position (Left, C
enter, Right) | | Hali, //horizontal alignment for data defined label position (Left, C
enter, Right) | |
| Vali, //vertical alignment for data defined label position (Bottom, B
ase, Half, Cap, Top) | | Vali, //vertical alignment for data defined label position (Bottom, B
ase, Half, Cap, Top) | |
| LabelDistance, | | LabelDistance, | |
| Rotation //data defined rotation (only useful in connection with data
defined position) | | Rotation //data defined rotation (only useful in connection with data
defined position) | |
| }; | | }; | |
| | | | |
| QString fieldName; | | QString fieldName; | |
|
| | | | |
| | | /** Is this label made from a expression string eg FieldName || 'mm' | |
| | | */ | |
| | | bool isExpression; | |
| | | | |
| | | /** Returns the QgsExpression for this label settings. | |
| | | */ | |
| | | QgsExpression* getLabelExpression(); | |
| | | | |
| Placement placement; | | Placement placement; | |
| unsigned int placementFlags; | | unsigned int placementFlags; | |
| QFont textFont; | | QFont textFont; | |
| QColor textColor; | | QColor textColor; | |
| bool enabled; | | bool enabled; | |
| int priority; // 0 = low, 10 = high | | int priority; // 0 = low, 10 = high | |
| bool obstacle; // whether it's an obstacle | | bool obstacle; // whether it's an obstacle | |
| double dist; // distance from the feature (in mm) | | double dist; // distance from the feature (in mm) | |
| double vectorScaleFactor; //scale factor painter units->pixels | | double vectorScaleFactor; //scale factor painter units->pixels | |
| double rasterCompressFactor; //pixel resolution scale factor | | double rasterCompressFactor; //pixel resolution scale factor | |
| int scaleMin, scaleMax; // disabled if both are zero | | int scaleMin, scaleMax; // disabled if both are zero | |
| double bufferSize; //buffer size (in mm) | | double bufferSize; //buffer size (in mm) | |
| QColor bufferColor; | | QColor bufferColor; | |
|
| | | bool formatNumbers; | |
| | | int decimals; | |
| | | bool plusSign; | |
| bool labelPerPart; // whether to label every feature's part or only the
biggest one | | bool labelPerPart; // whether to label every feature's part or only the
biggest one | |
| bool mergeLines; | | bool mergeLines; | |
|
| bool multiLineLabels; //draw labels on multiple lines if they contain '
\n' | | | |
| double minFeatureSize; // minimum feature size to be labelled (in mm) | | double minFeatureSize; // minimum feature size to be labelled (in mm) | |
| // Adds '<' or '>' to the label string pointing to the direction of the
line / polygon ring | | // Adds '<' or '>' to the label string pointing to the direction of the
line / polygon ring | |
| // Works only if Placement == Line | | // Works only if Placement == Line | |
| bool addDirectionSymbol; | | bool addDirectionSymbol; | |
| bool fontSizeInMapUnits; //true if font size is in map units (otherwise
in points) | | bool fontSizeInMapUnits; //true if font size is in map units (otherwise
in points) | |
| bool distInMapUnits; //true if distance is in map units (otherwise in m
m) | | bool distInMapUnits; //true if distance is in map units (otherwise in m
m) | |
|
| | | QString wrapChar; | |
| // called from register feature hook | | // called from register feature hook | |
| void calculateLabelSize( const QFontMetricsF* fm, QString text, double&
labelX, double& labelY ); | | void calculateLabelSize( const QFontMetricsF* fm, QString text, double&
labelX, double& labelY ); | |
| | | | |
| // implementation of register feature hook | | // implementation of register feature hook | |
|
| void registerFeature( QgsFeature& f, const QgsRenderContext& context ); | | void registerFeature( QgsVectorLayer* layer, QgsFeature& f, const QgsRe
nderContext& context ); | |
| | | | |
| void readFromLayer( QgsVectorLayer* layer ); | | void readFromLayer( QgsVectorLayer* layer ); | |
| void writeToLayer( QgsVectorLayer* layer ); | | void writeToLayer( QgsVectorLayer* layer ); | |
| | | | |
| /**Set a property as data defined*/ | | /**Set a property as data defined*/ | |
| void setDataDefinedProperty( DataDefinedProperties p, int attributeInde
x ); | | void setDataDefinedProperty( DataDefinedProperties p, int attributeInde
x ); | |
| /**Set a property to static instead data defined*/ | | /**Set a property to static instead data defined*/ | |
| void removeDataDefinedProperty( DataDefinedProperties p ); | | void removeDataDefinedProperty( DataDefinedProperties p ); | |
| | | | |
| // temporary stuff: set when layer gets prepared | | // temporary stuff: set when layer gets prepared | |
| pal::Layer* palLayer; | | pal::Layer* palLayer; | |
| int fieldIndex; | | int fieldIndex; | |
| QFontMetricsF* fontMetrics; | | QFontMetricsF* fontMetrics; | |
| const QgsMapToPixel* xform; | | const QgsMapToPixel* xform; | |
| const QgsCoordinateTransform* ct; | | const QgsCoordinateTransform* ct; | |
| QgsPoint ptZero, ptOne; | | QgsPoint ptZero, ptOne; | |
| QList<QgsPalGeometry*> geometries; | | QList<QgsPalGeometry*> geometries; | |
|
| | | QgsGeometry* extentGeom; | |
| | | | |
| /**Stores field indices for data defined layer properties*/ | | /**Stores field indices for data defined layer properties*/ | |
| QMap< DataDefinedProperties, int > dataDefinedProperties; | | QMap< DataDefinedProperties, int > dataDefinedProperties; | |
| | | | |
| /**Calculates pixel size (considering output size should be in pixel or
map units, scale factors and oversampling) | | /**Calculates pixel size (considering output size should be in pixel or
map units, scale factors and oversampling) | |
| @param size size to convert | | @param size size to convert | |
| @param c rendercontext | | @param c rendercontext | |
| @return font pixel size*/ | | @return font pixel size*/ | |
| int sizeToPixel( double size, const QgsRenderContext& c ) const; | | int sizeToPixel( double size, const QgsRenderContext& c ) const; | |
| | | | |
| private: | | private: | |
| /**Checks if a feature is larger than a minimum size (in mm) | | /**Checks if a feature is larger than a minimum size (in mm) | |
| @return true if above size, false if below*/ | | @return true if above size, false if below*/ | |
| bool checkMinimumSizeMM( const QgsRenderContext& ct, QgsGeometry* geom,
double minSize ) const; | | bool checkMinimumSizeMM( const QgsRenderContext& ct, QgsGeometry* geom,
double minSize ) const; | |
|
| | | QgsExpression* expression; | |
| }; | | }; | |
| | | | |
| class CORE_EXPORT QgsLabelCandidate | | class CORE_EXPORT QgsLabelCandidate | |
| { | | { | |
| public: | | public: | |
| QgsLabelCandidate( QRectF r, double c ): rect( r ), cost( c ) {} | | QgsLabelCandidate( QRectF r, double c ): rect( r ), cost( c ) {} | |
| | | | |
| QRectF rect; | | QRectF rect; | |
| double cost; | | double cost; | |
| }; | | }; | |
| | | | |
| skipping to change at line 219 | | skipping to change at line 233 | |
| //! called when we're done with rendering | | //! called when we're done with rendering | |
| virtual void exit(); | | virtual void exit(); | |
| //! return infos about labels at a given (map) position | | //! return infos about labels at a given (map) position | |
| virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ); | | virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ); | |
| | | | |
| //! called when passing engine among map renderers | | //! called when passing engine among map renderers | |
| virtual QgsLabelingEngineInterface* clone(); | | virtual QgsLabelingEngineInterface* clone(); | |
| | | | |
| void drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* painter,
const QgsMapToPixel* xform ); | | void drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* painter,
const QgsMapToPixel* xform ); | |
| //!drawLabel | | //!drawLabel | |
|
| void drawLabel( pal::LabelPosition* label, QPainter* painter, const QFo
nt& f, const QColor& c, const QgsMapToPixel* xform, double bufferSize = -1,
\ | | void drawLabel( pal::LabelPosition* label, QPainter* painter, const QFo
nt& f, const QColor& c, const QgsMapToPixel* xform, double bufferSize = -1, | |
| const QColor& bufferColor = QColor( 255, 255, 255 ), bo
ol drawBuffer = false ); | | const QColor& bufferColor = QColor( 255, 255, 255 ), bo
ol drawBuffer = false ); | |
| static void drawLabelBuffer( QPainter* p, QString text, const QFont& fo
nt, double size, QColor color ); | | static void drawLabelBuffer( QPainter* p, QString text, const QFont& fo
nt, double size, QColor color ); | |
| | | | |
| protected: | | protected: | |
| | | | |
| void initPal(); | | void initPal(); | |
| | | | |
| protected: | | protected: | |
| // hashtable of layer settings, being filled during labeling | | // hashtable of layer settings, being filled during labeling | |
| QHash<QgsVectorLayer*, QgsPalLayerSettings> mActiveLayers; | | QHash<QgsVectorLayer*, QgsPalLayerSettings> mActiveLayers; | |
| | | | |
End of changes. 11 change blocks. |
| 5 lines changed or deleted | | 19 lines changed or added | |
|
| qgsprojectionselector.h | | qgsprojectionselector.h | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 32 | |
| | | | |
| /** \ingroup gui | | /** \ingroup gui | |
| * A widget for selecting a Coordinate reference system from a tree. | | * A widget for selecting a Coordinate reference system from a tree. | |
| * @see QgsGenericProjectionSelector. | | * @see QgsGenericProjectionSelector. | |
| @author Tim Sutton | | @author Tim Sutton | |
| */ | | */ | |
| class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProj
ectionSelectorBase | | class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProj
ectionSelectorBase | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| public: | | public: | |
|
| QgsProjectionSelector( QWidget* parent, | | QgsProjectionSelector( QWidget* parent, const char *name = "", Qt::WFla | |
| const char * name = "", | | gs fl = 0 ); | |
| Qt::WFlags fl = 0 ); | | | |
| | | | |
| ~QgsProjectionSelector(); | | ~QgsProjectionSelector(); | |
| | | | |
| /** | | /** | |
| * \brief Populate the proj tree view with user defined projection name
s... | | * \brief Populate the proj tree view with user defined projection name
s... | |
| * | | * | |
| * \param crsFilter a list of OGC Coordinate Reference Systems to filte
r the | | * \param crsFilter a list of OGC Coordinate Reference Systems to filte
r the | |
| * list of projections by. This is useful in (e.g.) W
MS situations | | * list of projections by. This is useful in (e.g.) W
MS situations | |
| * where you just want to offer what the WMS server ca
n support. | | * where you just want to offer what the WMS server ca
n support. | |
| * | | * | |
| * \todo Should this be public? | | * \todo Should this be public? | |
| */ | | */ | |
|
| void loadUserCrsList( QSet<QString> * crsFilter = 0 ); | | void loadUserCrsList( QSet<QString> *crsFilter = 0 ); | |
| | | | |
| /** | | /** | |
| * \brief Populate the proj tree view with system projection names... | | * \brief Populate the proj tree view with system projection names... | |
| * | | * | |
| * \param crsFilter a list of OGC Coordinate Reference Systems to filte
r the | | * \param crsFilter a list of OGC Coordinate Reference Systems to filte
r the | |
| * list of projections by. This is useful in (e.g.) W
MS situations | | * list of projections by. This is useful in (e.g.) W
MS situations | |
| * where you just want to offer what the WMS server ca
n support. | | * where you just want to offer what the WMS server ca
n support. | |
| * | | * | |
| * \todo Should this be public? | | * \todo Should this be public? | |
| */ | | */ | |
|
| void loadCrsList( QSet<QString> * crsFilter = 0 ); | | void loadCrsList( QSet<QString> *crsFilter = 0 ); | |
| | | | |
| /*! | | /*! | |
| * \brief Make the string safe for use in SQL statements. | | * \brief Make the string safe for use in SQL statements. | |
| * This involves escaping single quotes, double quotes, backslashes, | | * This involves escaping single quotes, double quotes, backslashes, | |
| * and optionally, percentage symbols. Percentage symbols are used | | * and optionally, percentage symbols. Percentage symbols are used | |
| * as wildcards sometimes and so when using the string as part of the | | * as wildcards sometimes and so when using the string as part of the | |
| * LIKE phrase of a select statement, should be escaped. | | * LIKE phrase of a select statement, should be escaped. | |
| * \arg const QString in The input string to make safe. | | * \arg const QString in The input string to make safe. | |
| * \return The string made safe for SQL statements. | | * \return The string made safe for SQL statements. | |
| */ | | */ | |
| | | | |
| skipping to change at line 115 | | skipping to change at line 113 | |
| * Sets this widget to filter the available projections to those listed | | * Sets this widget to filter the available projections to those listed | |
| * by the given Coordinate Reference Systems. | | * by the given Coordinate Reference Systems. | |
| * | | * | |
| * \param crsFilter a list of OGC Coordinate Reference Systems to filte
r the | | * \param crsFilter a list of OGC Coordinate Reference Systems to filte
r the | |
| * list of projections by. This is useful in (e.g.) W
MS situations | | * list of projections by. This is useful in (e.g.) W
MS situations | |
| * where you just want to offer what the WMS server ca
n support. | | * where you just want to offer what the WMS server ca
n support. | |
| * | | * | |
| * \warning This function's behaviour is undefined if it is called afte
r the widget is shown. | | * \warning This function's behaviour is undefined if it is called afte
r the widget is shown. | |
| */ | | */ | |
| void setOgcWmsCrsFilter( QSet<QString> crsFilter ); | | void setOgcWmsCrsFilter( QSet<QString> crsFilter ); | |
|
| | | void on_lstCoordinateSystems_currentItemChanged( QTreeWidgetItem *curre | |
| void on_pbnFind_clicked(); | | nt, QTreeWidgetItem *prev ); | |
| void on_lstRecent_currentItemChanged( QTreeWidgetItem *, QTreeWidgetIte | | void on_lstRecent_currentItemChanged( QTreeWidgetItem *current, QTreeWi | |
| m * ); | | dgetItem *prev ); | |
| void on_cbxHideDeprecated_stateChanged(); | | void on_cbxHideDeprecated_stateChanged(); | |
|
| | | void on_leSearch_textChanged( const QString & ); | |
| | | | |
| protected: | | protected: | |
| /** Used to ensure the projection list view is actually populated */ | | /** Used to ensure the projection list view is actually populated */ | |
| void showEvent( QShowEvent * theEvent ); | | void showEvent( QShowEvent * theEvent ); | |
| | | | |
| /** Used to manage column sizes */ | | /** Used to manage column sizes */ | |
| void resizeEvent( QResizeEvent * theEvent ); | | void resizeEvent( QResizeEvent * theEvent ); | |
| | | | |
| private: | | private: | |
| /** | | /** | |
| | | | |
| skipping to change at line 151 | | skipping to change at line 149 | |
| /** | | /** | |
| * \brief does the legwork of applying CRS Selection | | * \brief does the legwork of applying CRS Selection | |
| * | | * | |
| * \warning This function does nothing unless getUserList() and getUser
ProjList() | | * \warning This function does nothing unless getUserList() and getUser
ProjList() | |
| * Have already been called | | * Have already been called | |
| * | | * | |
| * \warning This function only expands the parents of the selection and | | * \warning This function only expands the parents of the selection and | |
| * does not scroll the list to the selection if the widget is
not visible. | | * does not scroll the list to the selection if the widget is
not visible. | |
| * Therefore you will typically want to use this in a showEven
t(). | | * Therefore you will typically want to use this in a showEven
t(). | |
| */ | | */ | |
|
| void applySelection(); | | void applySelection( int column = NONE, QString value = QString::null )
; | |
| | | | |
| /** | | /** | |
| * \brief gets an arbitrary sqlite3 expression from the selection | | * \brief gets an arbitrary sqlite3 expression from the selection | |
| * | | * | |
| * \param e The sqlite3 expression (typically "srid" or "sridid") | | * \param e The sqlite3 expression (typically "srid" or "sridid") | |
| */ | | */ | |
| QString getSelectedExpression( QString e ); | | QString getSelectedExpression( QString e ); | |
| | | | |
| /** Show the user a warning if the srs database could not be found */ | | /** Show the user a warning if the srs database could not be found */ | |
| void showDBMissingWarning( const QString theFileName ); | | void showDBMissingWarning( const QString theFileName ); | |
| | | | |
| skipping to change at line 192 | | skipping to change at line 190 | |
| | | | |
| //! Has the Projection List been populated? | | //! Has the Projection List been populated? | |
| bool mProjListDone; | | bool mProjListDone; | |
| | | | |
| //! Has the User Projection List been populated? | | //! Has the User Projection List been populated? | |
| bool mUserProjListDone; | | bool mUserProjListDone; | |
| | | | |
| //! Has the Recent Projection List been populated? | | //! Has the Recent Projection List been populated? | |
| bool mRecentProjListDone; | | bool mRecentProjListDone; | |
| | | | |
|
| //! Is there a pending selection to be made by CRS Name? | | enum columns { NAME_COLUMN, AUTHID_COLUMN, QGIS_CRS_ID_COLUMN, NONE }; | |
| bool mCRSNameSelectionPending; | | int mSearchColumn; | |
| | | QString mSearchValue; | |
| //! Is there a pending selection to be made by CRS ID? | | | |
| bool mCRSIDSelectionPending; | | | |
| | | | |
| //! Is there a pending selection to be made by Authority ID? | | | |
| bool mAuthIDSelectionPending; | | | |
| | | | |
| //! The CRS Name that wants to be selected on this widget | | | |
| QString mCRSNameSelection; | | | |
| | | | |
| //! The CRS ID that wants to be selected on this widget | | | |
| long mCRSIDSelection; | | | |
| | | | |
|
| //! The Authority ID that wants to be selected on this widget | | bool mSkipFirstRecent; | |
| QString mAuthIDSelection; | | | |
| | | | |
| //! The set of OGC WMS CRSs that want to be applied to this widget | | //! The set of OGC WMS CRSs that want to be applied to this widget | |
| QSet<QString> mCrsFilter; | | QSet<QString> mCrsFilter; | |
| | | | |
| //! Most recently used projections (trimmed at 25 entries) | | //! Most recently used projections (trimmed at 25 entries) | |
| QStringList mRecentProjections; | | QStringList mRecentProjections; | |
| | | | |
| //! hide deprecated CRSes | | //! hide deprecated CRSes | |
| void hideDeprecated( QTreeWidgetItem *item ); | | void hideDeprecated( QTreeWidgetItem *item ); | |
| | | | |
| private slots: | | private slots: | |
|
| /**private handler for when user selects a cs | | | |
| *it will cause wktSelected and sridSelected events to be spawned | | | |
| */ | | | |
| void coordinateSystemSelected( QTreeWidgetItem* ); | | | |
| | | | |
| //! get list of authorities | | //! get list of authorities | |
| QStringList authorities(); | | QStringList authorities(); | |
| | | | |
| signals: | | signals: | |
| void sridSelected( QString theSRID ); | | void sridSelected( QString theSRID ); | |
| //! Refresh any listening canvases | | //! Refresh any listening canvases | |
| void refresh(); | | void refresh(); | |
| //! Let listeners know if find has focus so they can adjust the default
button | | //! Let listeners know if find has focus so they can adjust the default
button | |
| void searchBoxHasFocus( bool ); | | void searchBoxHasFocus( bool ); | |
| }; | | }; | |
| | | | |
End of changes. 9 change blocks. |
| 31 lines changed or deleted | | 14 lines changed or added | |
|
| qgsrasterlayer.h | | qgsrasterlayer.h | |
| | | | |
| skipping to change at line 21 | | skipping to change at line 21 | |
| * Frank Warmerdam - contributed bug fixes and migrated class to use all GD
AL_C_API calls | | * Frank Warmerdam - contributed bug fixes and migrated class to use all GD
AL_C_API calls | |
| */ | | */ | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| #ifndef QGSRASTERLAYER_H | | #ifndef QGSRASTERLAYER_H | |
| #define QGSRASTERLAYER_H | | #define QGSRASTERLAYER_H | |
| | | | |
| // | | // | |
| // Includes | | // Includes | |
| // | | // | |
| | | | |
| #include <QColor> | | #include <QColor> | |
| #include <QDateTime> | | #include <QDateTime> | |
| #include <QVector> | | #include <QVector> | |
| #include <QList> | | #include <QList> | |
| #include <QMap> | | #include <QMap> | |
|
| | | #include <QPair> | |
| | | | |
| #include "qgis.h" | | #include "qgis.h" | |
| #include "qgspoint.h" | | #include "qgspoint.h" | |
| #include "qgsmaplayer.h" | | #include "qgsmaplayer.h" | |
| #include "qgsrasterviewport.h" | | #include "qgsrasterviewport.h" | |
| #include "qgscontrastenhancement.h" | | #include "qgscontrastenhancement.h" | |
| #include "qgsrastertransparency.h" | | #include "qgsrastertransparency.h" | |
| #include "qgsrastershader.h" | | #include "qgsrastershader.h" | |
| #include "qgscolorrampshader.h" | | #include "qgscolorrampshader.h" | |
| #include "qgsrastershaderfunction.h" | | #include "qgsrastershaderfunction.h" | |
| | | | |
| skipping to change at line 395 | | skipping to change at line 395 | |
| | | | |
| /** \brief Mutator for mUserDefinedRGBMinimumMaximum */ | | /** \brief Mutator for mUserDefinedRGBMinimumMaximum */ | |
| void setUserDefinedRGBMinimumMaximum( bool theBool ) { mUserDefinedRGBM
inimumMaximum = theBool; } | | void setUserDefinedRGBMinimumMaximum( bool theBool ) { mUserDefinedRGBM
inimumMaximum = theBool; } | |
| | | | |
| /** \brief Accessor to find out how many standard deviations are being
plotted */ | | /** \brief Accessor to find out how many standard deviations are being
plotted */ | |
| double standardDeviations() const { return mStandardDeviations; } | | double standardDeviations() const { return mStandardDeviations; } | |
| | | | |
| /** \brief Accessor for transparent band name mapping */ | | /** \brief Accessor for transparent band name mapping */ | |
| QString transparentBandName() const { return mTransparencyBandName; } | | QString transparentBandName() const { return mTransparencyBandName; } | |
| | | | |
|
| /** \brief [ data provider interface ] Does this layer use a provider | | /** \brief [ data provider interface ] Does this layer use a provider | |
| for setting/retrieving data? */ | | for setting/retrieving data? | |
| bool usesProvider(); | | * @deprecated in 2.0 | |
| | | */ | |
| | | Q_DECL_DEPRECATED bool usesProvider(); | |
| | | | |
| /** \brief Accessor that returns the width of the (unclipped) raster *
/ | | /** \brief Accessor that returns the width of the (unclipped) raster *
/ | |
| int width() { return mWidth; } | | int width() { return mWidth; } | |
| | | | |
| // | | // | |
| // Non Static methods | | // Non Static methods | |
| // | | // | |
| /** \brief Get the number of bands in this layer */ | | /** \brief Get the number of bands in this layer */ | |
|
| unsigned int bandCount(); | | unsigned int bandCount() const; | |
| | | | |
| /** \brief Get the name of a band given its number */ | | /** \brief Get the name of a band given its number */ | |
| const QString bandName( int theBandNoInt ); | | const QString bandName( int theBandNoInt ); | |
| | | | |
| /** \brief Get the number of a band given its name. The name is the rew
ritten name set | | /** \brief Get the number of a band given its name. The name is the rew
ritten name set | |
| * up in the constructor, and will not necessarily be the same as the
name retrieved directly from gdal! | | * up in the constructor, and will not necessarily be the same as the
name retrieved directly from gdal! | |
| * If no matching band is found zero will be returned! */ | | * If no matching band is found zero will be returned! */ | |
|
| int bandNumber( const QString & theBandName ); | | int bandNumber( const QString & theBandName ) const; | |
| | | | |
| /** \brief Get RasterBandStats for a band given its number (read only)
*/ | | /** \brief Get RasterBandStats for a band given its number (read only)
*/ | |
| const QgsRasterBandStats bandStatistics( int ); | | const QgsRasterBandStats bandStatistics( int ); | |
| | | | |
| /** \brief Get RasterBandStats for a band given its name (read only) *
/ | | /** \brief Get RasterBandStats for a band given its name (read only) *
/ | |
| const QgsRasterBandStats bandStatistics( const QString & ); | | const QgsRasterBandStats bandStatistics( const QString & ); | |
| | | | |
| /** \brief Accessor for ths raster layers pyramid list. A pyramid list
defines the | | /** \brief Accessor for ths raster layers pyramid list. A pyramid list
defines the | |
| * POTENTIAL pyramids that can be in a raster. To know which of the pyr
amid layers | | * POTENTIAL pyramids that can be in a raster. To know which of the pyr
amid layers | |
| * ACTUALLY exists you need to look at the existsFlag member in each st
ruct stored in the | | * ACTUALLY exists you need to look at the existsFlag member in each st
ruct stored in the | |
| | | | |
| skipping to change at line 454 | | skipping to change at line 456 | |
| /** \brief Compute the actual minimum maximum pixel values based on the
current (last) display extent */ | | /** \brief Compute the actual minimum maximum pixel values based on the
current (last) display extent */ | |
| void computeMinimumMaximumFromLastExtent( QString theBand, double* theM
inMax ); | | void computeMinimumMaximumFromLastExtent( QString theBand, double* theM
inMax ); | |
| | | | |
| /** \brief Compute the actual minimum maximum pixel values based on th
e current (last) display extent | | /** \brief Compute the actual minimum maximum pixel values based on th
e current (last) display extent | |
| \note added in v1.6 */ | | \note added in v1.6 */ | |
| void computeMinimumMaximumFromLastExtent( int theBand, double& theMin,
double& theMax ); | | void computeMinimumMaximumFromLastExtent( int theBand, double& theMin,
double& theMax ); | |
| | | | |
| /** \brief Get a pointer to the contrast enhancement for the selected b
and */ | | /** \brief Get a pointer to the contrast enhancement for the selected b
and */ | |
| QgsContrastEnhancement* contrastEnhancement( unsigned int theBand ); | | QgsContrastEnhancement* contrastEnhancement( unsigned int theBand ); | |
| | | | |
|
| | | const QgsContrastEnhancement* constContrastEnhancement( unsigned int th | |
| | | eBand ) const; | |
| | | | |
| /**Copies the symbology settings from another layer. Returns true in ca
se of success*/ | | /**Copies the symbology settings from another layer. Returns true in ca
se of success*/ | |
| bool copySymbologySettings( const QgsMapLayer& theOther ); | | bool copySymbologySettings( const QgsMapLayer& theOther ); | |
| | | | |
| /** \brief Get a pointer to the color table */ | | /** \brief Get a pointer to the color table */ | |
| QList<QgsColorRampShader::ColorRampItem>* colorTable( int theBandNoInt
); | | QList<QgsColorRampShader::ColorRampItem>* colorTable( int theBandNoInt
); | |
| | | | |
| /** Returns the data provider */ | | /** Returns the data provider */ | |
| QgsRasterDataProvider* dataProvider(); | | QgsRasterDataProvider* dataProvider(); | |
| | | | |
| /** Returns the data provider in a const-correct manner */ | | /** Returns the data provider in a const-correct manner */ | |
| | | | |
| skipping to change at line 511 | | skipping to change at line 515 | |
| | | | |
| /** \brief Currently returns always false */ | | /** \brief Currently returns always false */ | |
| bool isEditable() const; | | bool isEditable() const; | |
| | | | |
| /** \brief [ data provider interface ] If an operation returns 0 (e.g.
draw()), this function returns the text of the error associated with the fa
ilure */ | | /** \brief [ data provider interface ] If an operation returns 0 (e.g.
draw()), this function returns the text of the error associated with the fa
ilure */ | |
| QString lastError(); | | QString lastError(); | |
| | | | |
| /** \brief [ data provider interface ] If an operation returns 0 (e.g.
draw()), this function returns the text of the error associated with the fa
ilure */ | | /** \brief [ data provider interface ] If an operation returns 0 (e.g.
draw()), this function returns the text of the error associated with the fa
ilure */ | |
| QString lastErrorTitle(); | | QString lastErrorTitle(); | |
| | | | |
|
| | | /**Returns a list with classification items (Text and color) | |
| | | @note this method was added in version 1.8*/ | |
| | | QList< QPair< QString, QColor > > legendSymbologyItems() const; | |
| | | | |
| /** \brief Get a legend image for this layer */ | | /** \brief Get a legend image for this layer */ | |
| QPixmap legendAsPixmap(); | | QPixmap legendAsPixmap(); | |
| | | | |
| /** \brief Overloaded version of above function that can print layer n
ame onto legend */ | | /** \brief Overloaded version of above function that can print layer n
ame onto legend */ | |
| QPixmap legendAsPixmap( bool ); | | QPixmap legendAsPixmap( bool ); | |
| | | | |
| /** \brief Use this method when you want an annotated legend suitable f
or print output etc */ | | /** \brief Use this method when you want an annotated legend suitable f
or print output etc */ | |
| QPixmap legendAsPixmap( int theLabelCount ); | | QPixmap legendAsPixmap( int theLabelCount ); | |
| | | | |
| /** \brief Accessor for maximum value user for contrast enhancement */ | | /** \brief Accessor for maximum value user for contrast enhancement */ | |
| | | | |
| skipping to change at line 536 | | skipping to change at line 544 | |
| /** \brief Obtain GDAL Metadata for this layer */ | | /** \brief Obtain GDAL Metadata for this layer */ | |
| QString metadata(); | | QString metadata(); | |
| | | | |
| /** \brief Accessor for minimum value user for contrast enhancement */ | | /** \brief Accessor for minimum value user for contrast enhancement */ | |
| double minimumValue( unsigned int theBand ); | | double minimumValue( unsigned int theBand ); | |
| | | | |
| /** \brief Accessor for minimum value user for contrast enhancement */ | | /** \brief Accessor for minimum value user for contrast enhancement */ | |
| double minimumValue( QString theBand ); | | double minimumValue( QString theBand ); | |
| | | | |
| /** \brief Get an 100x100 pixmap of the color palette. If the layer has
no palette a white pixmap will be returned */ | | /** \brief Get an 100x100 pixmap of the color palette. If the layer has
no palette a white pixmap will be returned */ | |
|
| QPixmap paletteAsPixmap( int theBand = 1 ); | | QPixmap paletteAsPixmap( int theBandNumber = 1 ); | |
| | | | |
|
| /** \brief [ data provider interface ] Which provider is being used fo | | /** \brief [ data provider interface ] Which provider is being used fo | |
| r this Raster Layer? */ | | r this Raster Layer? | |
| QString providerKey() const; | | * @note added in 2.0 | |
| | | */ | |
| | | QString providerType() const; | |
| | | | |
| | | /** \brief [ data provider interface ] Which provider is being used fo | |
| | | r this Raster Layer? | |
| | | * @deprecated use providerType() | |
| | | */ | |
| | | Q_DECL_DEPRECATED QString providerKey() const { return providerType(); | |
| | | } | |
| | | | |
| /** \brief Returns the number of raster units per each raster pixel. In
a world file, this is normally the first row (without the sign) */ | | /** \brief Returns the number of raster units per each raster pixel. In
a world file, this is normally the first row (without the sign) */ | |
| double rasterUnitsPerPixel(); | | double rasterUnitsPerPixel(); | |
| | | | |
| /** \brief Read color table from GDAL raster band */ | | /** \brief Read color table from GDAL raster band */ | |
| // Keep this for QgsRasterLayerProperties | | // Keep this for QgsRasterLayerProperties | |
| bool readColorTable( int theBandNumber, QList<QgsColorRampShader::Color
RampItem>* theList ); | | bool readColorTable( int theBandNumber, QList<QgsColorRampShader::Color
RampItem>* theList ); | |
| | | | |
| /** \brief Simple reset function that set the noDataValue back to the v
alue stored in the first raster band */ | | /** \brief Simple reset function that set the noDataValue back to the v
alue stored in the first raster band */ | |
| void resetNoDataValue(); | | void resetNoDataValue(); | |
| | | | |
| skipping to change at line 617 | | skipping to change at line 632 | |
| /** \brief Mutator for red band name (allows alternate mappings e.g. ma
p blue as red color) */ | | /** \brief Mutator for red band name (allows alternate mappings e.g. ma
p blue as red color) */ | |
| void setRedBandName( const QString & theBandName ); | | void setRedBandName( const QString & theBandName ); | |
| | | | |
| /** \brief Mutator for transparent band name mapping */ | | /** \brief Mutator for transparent band name mapping */ | |
| void setTransparentBandName( const QString & theBandName ); | | void setTransparentBandName( const QString & theBandName ); | |
| | | | |
| /** \brief [ data provider interface ] A wrapper function to emit a pr
ogress update signal */ | | /** \brief [ data provider interface ] A wrapper function to emit a pr
ogress update signal */ | |
| void showProgress( int theValue ); | | void showProgress( int theValue ); | |
| | | | |
| /** \brief Returns the sublayers of this layer - Useful for providers t
hat manage their own layers, such as WMS */ | | /** \brief Returns the sublayers of this layer - Useful for providers t
hat manage their own layers, such as WMS */ | |
|
| QStringList subLayers() const; | | virtual QStringList subLayers() const; | |
| | | | |
| /** \brief Draws a thumbnail of the rasterlayer into the supplied pixma
p pointer */ | | /** \brief Draws a thumbnail of the rasterlayer into the supplied pixma
p pointer */ | |
| void thumbnailAsPixmap( QPixmap * theQPixmap ); | | void thumbnailAsPixmap( QPixmap * theQPixmap ); | |
| /** \brief Draws a thumbnail of the rasterlayer into the supplied QImag
e pointer | | /** \brief Draws a thumbnail of the rasterlayer into the supplied QImag
e pointer | |
| * @note added in QGIS 1.6 | | * @note added in QGIS 1.6 | |
| * */ | | * */ | |
| void thumbnailAsImage( QImage * thepImage ); | | void thumbnailAsImage( QImage * thepImage ); | |
| | | | |
| /** \brief Emit a signal asking for a repaint. (inherited from maplayer
) */ | | /** \brief Emit a signal asking for a repaint. (inherited from maplayer
) */ | |
| void triggerRepaint(); | | void triggerRepaint(); | |
| | | | |
| // | | // | |
|
| // Virtural methods | | // Virtual methods | |
| // | | // | |
| /** | | /** | |
| * Reorders the *previously selected* sublayers of this layer from bott
om to top | | * Reorders the *previously selected* sublayers of this layer from bott
om to top | |
| * | | * | |
| * (Useful for providers that manage their own layers, such as WMS) | | * (Useful for providers that manage their own layers, such as WMS) | |
| * | | * | |
| */ | | */ | |
|
| virtual void setLayerOrder( const QStringList & layers ); | | virtual void setLayerOrder( const QStringList &layers ); | |
| | | | |
| /** | | /** | |
| * Set the visibility of the given sublayer name | | * Set the visibility of the given sublayer name | |
| */ | | */ | |
|
| virtual void setSubLayerVisibility( const QString & name, bool vis ); | | virtual void setSubLayerVisibility( QString name, bool vis ); | |
| | | | |
| /** Time stamp of data source in the moment when data/metadata were loa
ded by provider */ | | /** Time stamp of data source in the moment when data/metadata were loa
ded by provider */ | |
| virtual QDateTime timestamp() const { return mDataProvider->timestamp()
; } | | virtual QDateTime timestamp() const { return mDataProvider->timestamp()
; } | |
| | | | |
| public slots: | | public slots: | |
| /** \brief Create GDAL pyramid overviews */ | | /** \brief Create GDAL pyramid overviews */ | |
| QString buildPyramids( const RasterPyramidList &, | | QString buildPyramids( const RasterPyramidList &, | |
| const QString & theResamplingMethod = "NEAREST"
, | | const QString & theResamplingMethod = "NEAREST"
, | |
| bool theTryInternalFlag = false ); | | bool theTryInternalFlag = false ); | |
| | | | |
| | | | |
| skipping to change at line 666 | | skipping to change at line 681 | |
| void populateHistogram( int theBandNoInt, | | void populateHistogram( int theBandNoInt, | |
| int theBinCountInt = 256, | | int theBinCountInt = 256, | |
| bool theIgnoreOutOfRangeFlag = true, | | bool theIgnoreOutOfRangeFlag = true, | |
| bool theThoroughBandScanFlag = false ); | | bool theThoroughBandScanFlag = false ); | |
| | | | |
| void showStatusMessage( const QString & theMessage ); | | void showStatusMessage( const QString & theMessage ); | |
| | | | |
| /** \brief Propagate progress updates from GDAL up to the parent app */ | | /** \brief Propagate progress updates from GDAL up to the parent app */ | |
| void updateProgress( int, int ); | | void updateProgress( int, int ); | |
| | | | |
|
| /** \brief recieve progress signal from provider */ | | /** \brief receive progress signal from provider */ | |
| void onProgress( int, double, QString ); | | void onProgress( int, double, QString ); | |
| | | | |
| signals: | | signals: | |
| /** \brief Signal for notifying listeners of long running processes */ | | /** \brief Signal for notifying listeners of long running processes */ | |
| void progressUpdate( int theValue ); | | void progressUpdate( int theValue ); | |
| | | | |
| /** | | /** | |
| * This is emitted whenever data or metadata (e.g. color table, exten
t) has changed | | * This is emitted whenever data or metadata (e.g. color table, exten
t) has changed | |
| * @note added in 1.7 | | * @note added in 1.7 | |
| */ | | */ | |
| void dataChanged(); | | void dataChanged(); | |
| | | | |
| protected: | | protected: | |
| | | | |
| /** \brief Read the symbology for the current layer from the Dom node s
upplied */ | | /** \brief Read the symbology for the current layer from the Dom node s
upplied */ | |
| bool readSymbology( const QDomNode& node, QString& errorMessage ); | | bool readSymbology( const QDomNode& node, QString& errorMessage ); | |
| | | | |
| /** \brief Reads layer specific state from project file Dom node */ | | /** \brief Reads layer specific state from project file Dom node */ | |
|
| bool readXml( QDomNode & layer_node ); | | bool readXml( const QDomNode& layer_node ); | |
| | | | |
| /** \brief Write the symbology for the layer into the docment provided
*/ | | /** \brief Write the symbology for the layer into the docment provided
*/ | |
| bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessag
e ) const; | | bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessag
e ) const; | |
| | | | |
| /** \brief Write layer specific state to project file Dom node */ | | /** \brief Write layer specific state to project file Dom node */ | |
| bool writeXml( QDomNode & layer_node, QDomDocument & doc ); | | bool writeXml( QDomNode & layer_node, QDomDocument & doc ); | |
| | | | |
| private: | | private: | |
| // | | // | |
| // Private methods | | // Private methods | |
| | | | |
End of changes. 15 change blocks. |
| 16 lines changed or deleted | | 34 lines changed or added | |
|
| qgsrendererv2.h | | qgsrendererv2.h | |
|
| | | /************************************************************************** | |
| | | * | |
| | | qgsrendererv2.h | |
| | | --------------------- | |
| | | begin : November 2009 | |
| | | copyright : (C) 2009 by Martin Dobias | |
| | | email : wonder.sk at gmail.com | |
| | | ************************************************************************** | |
| | | * | |
| | | * | |
| | | * | |
| | | * This program is free software; you can redistribute it and/or modify | |
| | | * | |
| | | * it under the terms of the GNU General Public License as published by | |
| | | * | |
| | | * the Free Software Foundation; either version 2 of the License, or | |
| | | * | |
| | | * (at your option) any later version. | |
| | | * | |
| | | * | |
| | | * | |
| | | ************************************************************************** | |
| | | */ | |
| | | | |
| #ifndef QGSRENDERERV2_H | | #ifndef QGSRENDERERV2_H | |
| #define QGSRENDERERV2_H | | #define QGSRENDERERV2_H | |
| | | | |
| #include "qgis.h" | | #include "qgis.h" | |
| | | | |
| #include <QList> | | #include <QList> | |
| #include <QString> | | #include <QString> | |
| #include <QVariant> | | #include <QVariant> | |
| #include <QPair> | | #include <QPair> | |
| #include <QPixmap> | | #include <QPixmap> | |
|
| | | #include <QDomDocument> | |
| class QDomDocument; | | #include <QDomElement> | |
| class QDomElement; | | | |
| | | | |
| class QgsSymbolV2; | | class QgsSymbolV2; | |
| class QgsRenderContext; | | class QgsRenderContext; | |
| class QgsFeature; | | class QgsFeature; | |
| class QgsVectorLayer; | | class QgsVectorLayer; | |
| | | | |
|
| | | typedef QMap<QString, QString> QgsStringMap; | |
| | | | |
| typedef QList<QgsSymbolV2*> QgsSymbolV2List; | | typedef QList<QgsSymbolV2*> QgsSymbolV2List; | |
| typedef QMap<QString, QgsSymbolV2* > QgsSymbolV2Map; | | typedef QMap<QString, QgsSymbolV2* > QgsSymbolV2Map; | |
| | | | |
| typedef QList< QPair<QString, QPixmap> > QgsLegendSymbologyList; | | typedef QList< QPair<QString, QPixmap> > QgsLegendSymbologyList; | |
| typedef QList< QPair<QString, QgsSymbolV2*> > QgsLegendSymbolList; | | typedef QList< QPair<QString, QgsSymbolV2*> > QgsLegendSymbolList; | |
| | | | |
| #define RENDERER_TAG_NAME "renderer-v2" | | #define RENDERER_TAG_NAME "renderer-v2" | |
| | | | |
| //////// | | //////// | |
| // symbol levels | | // symbol levels | |
| | | | |
| skipping to change at line 75 | | skipping to change at line 90 | |
| virtual void startRender( QgsRenderContext& context, const QgsVectorLay
er *vlayer ) = 0; | | virtual void startRender( QgsRenderContext& context, const QgsVectorLay
er *vlayer ) = 0; | |
| | | | |
| virtual void stopRender( QgsRenderContext& context ) = 0; | | virtual void stopRender( QgsRenderContext& context ) = 0; | |
| | | | |
| virtual QList<QString> usedAttributes() = 0; | | virtual QList<QString> usedAttributes() = 0; | |
| | | | |
| virtual ~QgsFeatureRendererV2() {} | | virtual ~QgsFeatureRendererV2() {} | |
| | | | |
| virtual QgsFeatureRendererV2* clone() = 0; | | virtual QgsFeatureRendererV2* clone() = 0; | |
| | | | |
|
| virtual void renderFeature( QgsFeature& feature, QgsRenderContext& cont
ext, int layer = -1, bool selected = false, bool drawVertexMarker = false )
; | | virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& cont
ext, int layer = -1, bool selected = false, bool drawVertexMarker = false )
; | |
| | | | |
| //! for debugging | | //! for debugging | |
| virtual QString dump(); | | virtual QString dump(); | |
| | | | |
|
| | | enum Capabilities | |
| | | { | |
| | | SymbolLevels = 1, // rendering with symbol levels (i.e. implement | |
| | | s symbols(), symbolForFeature()) | |
| | | RotationField = 1 << 1, // rotate symbols by attribute value | |
| | | MoreSymbolsPerFeature = 1 << 2 // may use more than one symbol to re | |
| | | nder a feature: symbolsForFeature() will return them | |
| | | }; | |
| | | | |
| | | //! returns bitwise OR-ed capabilities of the renderer | |
| | | //! \note added in 2.0 | |
| | | virtual int capabilities() { return 0; } | |
| | | | |
| //! for symbol levels | | //! for symbol levels | |
| virtual QgsSymbolV2List symbols() = 0; | | virtual QgsSymbolV2List symbols() = 0; | |
| | | | |
| bool usingSymbolLevels() const { return mUsingSymbolLevels; } | | bool usingSymbolLevels() const { return mUsingSymbolLevels; } | |
| void setUsingSymbolLevels( bool usingSymbolLevels ) { mUsingSymbolLevel
s = usingSymbolLevels; } | | void setUsingSymbolLevels( bool usingSymbolLevels ) { mUsingSymbolLevel
s = usingSymbolLevels; } | |
| | | | |
|
| bool usingFirstRule() const { return mUsingFirstRule; } | | | |
| void setUsingFirstRule( bool usingFirstRule ) { mUsingFirstRule = using | | | |
| FirstRule; } | | | |
| | | | |
| //! create a renderer from XML element | | //! create a renderer from XML element | |
| static QgsFeatureRendererV2* load( QDomElement& symbologyElem ); | | static QgsFeatureRendererV2* load( QDomElement& symbologyElem ); | |
| | | | |
| //! store renderer info to XML element | | //! store renderer info to XML element | |
| virtual QDomElement save( QDomDocument& doc ); | | virtual QDomElement save( QDomDocument& doc ); | |
| | | | |
|
| | | //! create the SLD UserStyle element following the SLD v1.1 specs | |
| | | //! @note added in 1.9 | |
| | | virtual QDomElement writeSld( QDomDocument& doc, const QgsVectorLayer & | |
| | | layer ) const; | |
| | | | |
| | | /** create a new renderer according to the information contained in | |
| | | * the UserStyle element of a SLD style document | |
| | | * @param node the node in the SLD document whose the UserStyle element | |
| | | * is a child | |
| | | * @param geomType the geometry type of the features, used to convert | |
| | | * Symbolizer elements | |
| | | * @param errorMessage it will contain the error message if something | |
| | | * went wrong | |
| | | * @return the renderer | |
| | | * @note added in 1.9 | |
| | | */ | |
| | | static QgsFeatureRendererV2* loadSld( const QDomNode &node, QGis::Geome | |
| | | tryType geomType, QString &errorMessage ); | |
| | | | |
| | | //! used from subclasses to create SLD Rule elements following SLD v1.1 | |
| | | specs | |
| | | //! @note added in 1.9 | |
| | | virtual void toSld( QDomDocument& doc, QDomElement &element ) const | |
| | | { element.appendChild( doc.createComment( QString( "FeatureRendererV2 % | |
| | | 1 not implemented yet" ).arg( type() ) ) ); } | |
| | | | |
| //! return a list of symbology items for the legend | | //! return a list of symbology items for the legend | |
| virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | | virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | |
| | | | |
| //! return a list of item text / symbol | | //! return a list of item text / symbol | |
| //! @note: this method was added in version 1.5 | | //! @note: this method was added in version 1.5 | |
| virtual QgsLegendSymbolList legendSymbolItems(); | | virtual QgsLegendSymbolList legendSymbolItems(); | |
| | | | |
| //! set type and size of editing vertex markers for subsequent renderin
g | | //! set type and size of editing vertex markers for subsequent renderin
g | |
| void setVertexMarkerAppearance( int type, int size ); | | void setVertexMarkerAppearance( int type, int size ); | |
| | | | |
|
| | | //! return rotation field name (or empty string if not set or not suppo | |
| | | rted by renderer) | |
| | | //! @note added in 1.9 | |
| | | virtual QString rotationField() const { return ""; } | |
| | | //! sets rotation field of renderer (if supported by the renderer) | |
| | | //! @note added in 1.9 | |
| | | virtual void setRotationField( QString fieldName ) { Q_UNUSED( fieldNam | |
| | | e ); } | |
| | | | |
| | | //! return whether the renderer will render a feature or not. | |
| | | //! Must be called between startRender() and stopRender() calls. | |
| | | //! Default implementation uses symbolForFeature(). | |
| | | //! @note added in 1.9 | |
| | | virtual bool willRenderFeature( QgsFeature& feat ) { return symbolForFe | |
| | | ature( feat ) != NULL; } | |
| | | | |
| | | //! return list of symbols used for rendering the feature. | |
| | | //! For renderers that do not support MoreSymbolsPerFeature it is more | |
| | | efficient | |
| | | //! to use symbolForFeature() | |
| | | //! @note added in 1.9 | |
| | | virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat ); | |
| | | | |
| protected: | | protected: | |
| QgsFeatureRendererV2( QString type ); | | QgsFeatureRendererV2( QString type ); | |
| | | | |
|
| | | void renderFeatureWithSymbol( QgsFeature& feature, | |
| | | QgsSymbolV2* symbol, | |
| | | QgsRenderContext& context, | |
| | | int layer, | |
| | | bool selected, | |
| | | bool drawVertexMarker ); | |
| | | | |
| //! render editing vertex marker at specified point | | //! render editing vertex marker at specified point | |
| void renderVertexMarker( QPointF& pt, QgsRenderContext& context ); | | void renderVertexMarker( QPointF& pt, QgsRenderContext& context ); | |
| //! render editing vertex marker for a polyline | | //! render editing vertex marker for a polyline | |
| void renderVertexMarkerPolyline( QPolygonF& pts, QgsRenderContext& cont
ext ); | | void renderVertexMarkerPolyline( QPolygonF& pts, QgsRenderContext& cont
ext ); | |
| //! render editing vertex marker for a polygon | | //! render editing vertex marker for a polygon | |
| void renderVertexMarkerPolygon( QPolygonF& pts, QList<QPolygonF>* rings
, QgsRenderContext& context ); | | void renderVertexMarkerPolygon( QPolygonF& pts, QList<QPolygonF>* rings
, QgsRenderContext& context ); | |
| | | | |
| static unsigned char* _getPoint( QPointF& pt, QgsRenderContext& context
, unsigned char* wkb ); | | static unsigned char* _getPoint( QPointF& pt, QgsRenderContext& context
, unsigned char* wkb ); | |
| static unsigned char* _getLineString( QPolygonF& pts, QgsRenderContext&
context, unsigned char* wkb ); | | static unsigned char* _getLineString( QPolygonF& pts, QgsRenderContext&
context, unsigned char* wkb ); | |
| static unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& ho
les, QgsRenderContext& context, unsigned char* wkb ); | | static unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& ho
les, QgsRenderContext& context, unsigned char* wkb ); | |
| | | | |
| QString mType; | | QString mType; | |
| | | | |
| bool mUsingSymbolLevels; | | bool mUsingSymbolLevels; | |
|
| bool mUsingFirstRule; | | | |
| | | | |
| /** The current type of editing marker */ | | /** The current type of editing marker */ | |
| int mCurrentVertexMarkerType; | | int mCurrentVertexMarkerType; | |
| /** The current size of editing marker */ | | /** The current size of editing marker */ | |
| int mCurrentVertexMarkerSize; | | int mCurrentVertexMarkerSize; | |
| }; | | }; | |
| | | | |
|
| #endif | | #endif // QGSRENDERERV2_H | |
| | | | |
End of changes. 11 change blocks. |
| 9 lines changed or deleted | | 97 lines changed or added | |
|
| qgsrendererv2registry.h | | qgsrendererv2registry.h | |
|
| | | /************************************************************************** | |
| | | * | |
| | | qgsrendererv2registry.h | |
| | | --------------------- | |
| | | begin : November 2009 | |
| | | copyright : (C) 2009 by Martin Dobias | |
| | | email : wonder.sk at gmail.com | |
| | | ************************************************************************** | |
| | | * | |
| | | * | |
| | | * | |
| | | * This program is free software; you can redistribute it and/or modify | |
| | | * | |
| | | * it under the terms of the GNU General Public License as published by | |
| | | * | |
| | | * the Free Software Foundation; either version 2 of the License, or | |
| | | * | |
| | | * (at your option) any later version. | |
| | | * | |
| | | * | |
| | | * | |
| | | ************************************************************************** | |
| | | */ | |
| #ifndef QGSRENDERERV2REGISTRY_H | | #ifndef QGSRENDERERV2REGISTRY_H | |
| #define QGSRENDERERV2REGISTRY_H | | #define QGSRENDERERV2REGISTRY_H | |
| | | | |
| #include <QIcon> | | #include <QIcon> | |
| #include <QMap> | | #include <QMap> | |
| #include <QStringList> | | #include <QStringList> | |
|
| | | #include <QDomElement> | |
| | | | |
| | | #include "qgis.h" | |
| | | | |
| class QgsFeatureRendererV2; | | class QgsFeatureRendererV2; | |
|
| class QDomElement; | | | |
| class QgsVectorLayer; | | class QgsVectorLayer; | |
| class QgsStyleV2; | | class QgsStyleV2; | |
| class QgsRendererV2Widget; | | class QgsRendererV2Widget; | |
| | | | |
| /** | | /** | |
| Stores metadata about one renderer class. | | Stores metadata about one renderer class. | |
| | | | |
| @note It's necessary to implement createRenderer() function. | | @note It's necessary to implement createRenderer() function. | |
| In C++ you can use QgsRendererV2Metadata convenience class. | | In C++ you can use QgsRendererV2Metadata convenience class. | |
| */ | | */ | |
| class CORE_EXPORT QgsRendererV2AbstractMetadata | | class CORE_EXPORT QgsRendererV2AbstractMetadata | |
| { | | { | |
| public: | | public: | |
| QgsRendererV2AbstractMetadata( QString name, QString visibleName, QIcon
icon = QIcon() ) | | QgsRendererV2AbstractMetadata( QString name, QString visibleName, QIcon
icon = QIcon() ) | |
| : mName( name ), mVisibleName( visibleName ), mIcon( icon ) {} | | : mName( name ), mVisibleName( visibleName ), mIcon( icon ) {} | |
|
| | | virtual ~QgsRendererV2AbstractMetadata() {} | |
| | | | |
| QString name() const { return mName; } | | QString name() const { return mName; } | |
| QString visibleName() const { return mVisibleName; } | | QString visibleName() const { return mVisibleName; } | |
| | | | |
| QIcon icon() const { return mIcon; } | | QIcon icon() const { return mIcon; } | |
| void setIcon( const QIcon& icon ) { mIcon = icon; } | | void setIcon( const QIcon& icon ) { mIcon = icon; } | |
| | | | |
| /** Return new instance of the renderer given the DOM element. Returns
NULL on error. | | /** Return new instance of the renderer given the DOM element. Returns
NULL on error. | |
| * Pure virtual function: must be implemented in derived classes. */ | | * Pure virtual function: must be implemented in derived classes. */ | |
| virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) = 0; | | virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) = 0; | |
| /** Return new instance of settings widget for the renderer. Returns NU
LL on error. */ | | /** Return new instance of settings widget for the renderer. Returns NU
LL on error. */ | |
| virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* laye
r, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) | | virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* laye
r, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) | |
|
| { return NULL; } | | { Q_UNUSED( layer ); Q_UNUSED( style ); Q_UNUSED( renderer ); return NU | |
| | | LL; } | |
| | | | |
| | | virtual QgsFeatureRendererV2* createRendererFromSld( QDomElement& elem, | |
| | | QGis::GeometryType geomType ) | |
| | | { Q_UNUSED( elem ); Q_UNUSED( geomType ); return NULL; } | |
| | | | |
| protected: | | protected: | |
| //! name used within QGIS for identification (the same what renderer's
type() returns) | | //! name used within QGIS for identification (the same what renderer's
type() returns) | |
| QString mName; | | QString mName; | |
| //! name visible for users (translatable) | | //! name visible for users (translatable) | |
| QString mVisibleName; | | QString mVisibleName; | |
| //! icon to be shown in the renderer properties dialog | | //! icon to be shown in the renderer properties dialog | |
| QIcon mIcon; | | QIcon mIcon; | |
| }; | | }; | |
| | | | |
| typedef QgsFeatureRendererV2*( *QgsRendererV2CreateFunc )( QDomElement& ); | | typedef QgsFeatureRendererV2*( *QgsRendererV2CreateFunc )( QDomElement& ); | |
| typedef QgsRendererV2Widget*( *QgsRendererV2WidgetFunc )( QgsVectorLayer*,
QgsStyleV2*, QgsFeatureRendererV2* ); | | typedef QgsRendererV2Widget*( *QgsRendererV2WidgetFunc )( QgsVectorLayer*,
QgsStyleV2*, QgsFeatureRendererV2* ); | |
|
| | | typedef QgsFeatureRendererV2*( *QgsRendererV2CreateFromSldFunc )( QDomEleme
nt&, QGis::GeometryType geomType ); | |
| | | | |
| /** | | /** | |
| Convenience metadata class that uses static functions to create renderer a
nd its widget. | | Convenience metadata class that uses static functions to create renderer a
nd its widget. | |
| */ | | */ | |
| class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetad
ata | | class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetad
ata | |
| { | | { | |
| public: | | public: | |
| | | | |
| /** construct metadata */ | | /** construct metadata */ | |
| QgsRendererV2Metadata( QString name, | | QgsRendererV2Metadata( QString name, | |
| QString visibleName, | | QString visibleName, | |
| QgsRendererV2CreateFunc pfCreate, | | QgsRendererV2CreateFunc pfCreate, | |
| QIcon icon = QIcon(), | | QIcon icon = QIcon(), | |
| QgsRendererV2WidgetFunc pfWidget = NULL ) | | QgsRendererV2WidgetFunc pfWidget = NULL ) | |
|
| : QgsRendererV2AbstractMetadata( name, visibleName, icon ), mCreate | | : QgsRendererV2AbstractMetadata( name, visibleName, icon ) | |
| Func( pfCreate ), mWidgetFunc( pfWidget ) {} | | , mCreateFunc( pfCreate ) | |
| | | , mWidgetFunc( pfWidget ) | |
| | | , mCreateFromSldFunc( NULL ) | |
| | | {} | |
| | | | |
| | | QgsRendererV2Metadata( QString name, | |
| | | QString visibleName, | |
| | | QgsRendererV2CreateFunc pfCreate, | |
| | | QgsRendererV2CreateFromSldFunc pfCreateFromSld, | |
| | | QIcon icon = QIcon(), | |
| | | QgsRendererV2WidgetFunc pfWidget = NULL ) | |
| | | : QgsRendererV2AbstractMetadata( name, visibleName, icon ) | |
| | | , mCreateFunc( pfCreate ) | |
| | | , mWidgetFunc( pfWidget ) | |
| | | , mCreateFromSldFunc( pfCreateFromSld ) | |
| | | {} | |
| | | | |
| virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) { ret
urn mCreateFunc ? mCreateFunc( elem ) : NULL; } | | virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) { ret
urn mCreateFunc ? mCreateFunc( elem ) : NULL; } | |
| virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* laye
r, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) | | virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* laye
r, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) | |
| { return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) : NULL; } | | { return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) : NULL; } | |
|
| | | virtual QgsFeatureRendererV2* createRendererFromSld( QDomElement& elem, | |
| | | QGis::GeometryType geomType ) | |
| | | { return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) : NU | |
| | | LL; } | |
| | | | |
| QgsRendererV2CreateFunc createFunction() const { return mCreateFunc; } | | QgsRendererV2CreateFunc createFunction() const { return mCreateFunc; } | |
| QgsRendererV2WidgetFunc widgetFunction() const { return mWidgetFunc; } | | QgsRendererV2WidgetFunc widgetFunction() const { return mWidgetFunc; } | |
|
| | | QgsRendererV2CreateFromSldFunc createFromSldFunction() const { return m
CreateFromSldFunc; } | |
| | | | |
| void setWidgetFunction( QgsRendererV2WidgetFunc f ) { mWidgetFunc = f;
} | | void setWidgetFunction( QgsRendererV2WidgetFunc f ) { mWidgetFunc = f;
} | |
| | | | |
| protected: | | protected: | |
| //! pointer to function that creates an instance of the renderer when l
oading project / style | | //! pointer to function that creates an instance of the renderer when l
oading project / style | |
| QgsRendererV2CreateFunc mCreateFunc; | | QgsRendererV2CreateFunc mCreateFunc; | |
| //! pointer to function that creates a widget for configuration of rend
erer's params | | //! pointer to function that creates a widget for configuration of rend
erer's params | |
| QgsRendererV2WidgetFunc mWidgetFunc; | | QgsRendererV2WidgetFunc mWidgetFunc; | |
|
| | | //! pointer to function that creates an instance of the renderer from S | |
| | | LD | |
| | | QgsRendererV2CreateFromSldFunc mCreateFromSldFunc; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| Registry of renderers. | | Registry of renderers. | |
| | | | |
| This is a singleton, renderers can be added / removed at any time | | This is a singleton, renderers can be added / removed at any time | |
| */ | | */ | |
| class CORE_EXPORT QgsRendererV2Registry | | class CORE_EXPORT QgsRendererV2Registry | |
| { | | { | |
| public: | | public: | |
| | | | |
End of changes. 10 change blocks. |
| 4 lines changed or deleted | | 59 lines changed or added | |
|
| qgssymbollayerv2registry.h | | qgssymbollayerv2registry.h | |
|
| | | /************************************************************************** | |
| | | * | |
| | | qgssymbollayerv2registry.h | |
| | | --------------------- | |
| | | begin : November 2009 | |
| | | copyright : (C) 2009 by Martin Dobias | |
| | | email : wonder.sk at gmail.com | |
| | | ************************************************************************** | |
| | | * | |
| | | * | |
| | | * | |
| | | * This program is free software; you can redistribute it and/or modify | |
| | | * | |
| | | * it under the terms of the GNU General Public License as published by | |
| | | * | |
| | | * the Free Software Foundation; either version 2 of the License, or | |
| | | * | |
| | | * (at your option) any later version. | |
| | | * | |
| | | * | |
| | | * | |
| | | ************************************************************************** | |
| | | */ | |
| | | | |
| #ifndef QGSSYMBOLLAYERV2REGISTRY_H | | #ifndef QGSSYMBOLLAYERV2REGISTRY_H | |
| #define QGSSYMBOLLAYERV2REGISTRY_H | | #define QGSSYMBOLLAYERV2REGISTRY_H | |
| | | | |
| #include "qgssymbolv2.h" | | #include "qgssymbolv2.h" | |
| #include "qgssymbollayerv2.h" | | #include "qgssymbollayerv2.h" | |
| | | | |
|
| | | class QgsVectorLayer; | |
| | | | |
| /** | | /** | |
| Stores metadata about one symbol layer class. | | Stores metadata about one symbol layer class. | |
| | | | |
| @note It's necessary to implement createSymbolLayer() function. | | @note It's necessary to implement createSymbolLayer() function. | |
| In C++ you can use QgsSymbolLayerV2Metadata convenience class. | | In C++ you can use QgsSymbolLayerV2Metadata convenience class. | |
| */ | | */ | |
| class CORE_EXPORT QgsSymbolLayerV2AbstractMetadata | | class CORE_EXPORT QgsSymbolLayerV2AbstractMetadata | |
| { | | { | |
| public: | | public: | |
| QgsSymbolLayerV2AbstractMetadata( QString name, QString visibleName, Qg
sSymbolV2::SymbolType type ) | | QgsSymbolLayerV2AbstractMetadata( QString name, QString visibleName, Qg
sSymbolV2::SymbolType type ) | |
| : mName( name ), mVisibleName( visibleName ), mType( type ) {} | | : mName( name ), mVisibleName( visibleName ), mType( type ) {} | |
| | | | |
|
| | | virtual ~QgsSymbolLayerV2AbstractMetadata() {} | |
| | | | |
| QString name() const { return mName; } | | QString name() const { return mName; } | |
| QString visibleName() const { return mVisibleName; } | | QString visibleName() const { return mVisibleName; } | |
| QgsSymbolV2::SymbolType type() const { return mType; } | | QgsSymbolV2::SymbolType type() const { return mType; } | |
| | | | |
| /** create a symbol layer of this type given the map of properties. */ | | /** create a symbol layer of this type given the map of properties. */ | |
| virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map )
= 0; | | virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map )
= 0; | |
| /** create widget for symbol layer of this type. Can return NULL if the
re's no GUI */ | | /** create widget for symbol layer of this type. Can return NULL if the
re's no GUI */ | |
|
| virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget() { return NULL | | virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget( const QgsVecto | |
| ; } | | rLayer * ) { return NULL; } | |
| | | /** create a symbol layer of this type given the map of properties. */ | |
| | | virtual QgsSymbolLayerV2* createSymbolLayerFromSld( QDomElement & ) { r | |
| | | eturn NULL; } | |
| | | | |
| protected: | | protected: | |
| QString mName; | | QString mName; | |
| QString mVisibleName; | | QString mVisibleName; | |
| QgsSymbolV2::SymbolType mType; | | QgsSymbolV2::SymbolType mType; | |
| }; | | }; | |
| | | | |
| typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFunc )( const QgsStringMa
p& ); | | typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFunc )( const QgsStringMa
p& ); | |
|
| typedef QgsSymbolLayerV2Widget*( *QgsSymbolLayerV2WidgetFunc )(); | | typedef QgsSymbolLayerV2Widget*( *QgsSymbolLayerV2WidgetFunc )( const QgsVe | |
| | | ctorLayer* ); | |
| | | typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFromSldFunc )( QDomElemen | |
| | | t& ); | |
| | | | |
| /** | | /** | |
| Convenience metadata class that uses static functions to create symbol lay
er and its widget. | | Convenience metadata class that uses static functions to create symbol lay
er and its widget. | |
| */ | | */ | |
| class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2Abstrac
tMetadata | | class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2Abstrac
tMetadata | |
| { | | { | |
| public: | | public: | |
| QgsSymbolLayerV2Metadata( QString name, QString visibleName, | | QgsSymbolLayerV2Metadata( QString name, QString visibleName, | |
| QgsSymbolV2::SymbolType type, | | QgsSymbolV2::SymbolType type, | |
| QgsSymbolLayerV2CreateFunc pfCreate, | | QgsSymbolLayerV2CreateFunc pfCreate, | |
| QgsSymbolLayerV2WidgetFunc pfWidget = NULL ) | | QgsSymbolLayerV2WidgetFunc pfWidget = NULL ) | |
|
| : QgsSymbolLayerV2AbstractMetadata( name, visibleName, type ), mCre | | : QgsSymbolLayerV2AbstractMetadata( name, visibleName, type ) | |
| ateFunc( pfCreate ), mWidgetFunc( pfWidget ) {} | | , mCreateFunc( pfCreate ) | |
| | | , mWidgetFunc( pfWidget ) | |
| | | , mCreateFromSldFunc( NULL ) | |
| | | {} | |
| | | | |
| | | QgsSymbolLayerV2Metadata( QString name, QString visibleName, | |
| | | QgsSymbolV2::SymbolType type, | |
| | | QgsSymbolLayerV2CreateFunc pfCreate, | |
| | | QgsSymbolLayerV2CreateFromSldFunc pfCreateFro | |
| | | mSld, | |
| | | QgsSymbolLayerV2WidgetFunc pfWidget = NULL ) | |
| | | : QgsSymbolLayerV2AbstractMetadata( name, visibleName, type ) | |
| | | , mCreateFunc( pfCreate ) | |
| | | , mWidgetFunc( pfWidget ) | |
| | | , mCreateFromSldFunc( pfCreateFromSld ) | |
| | | {} | |
| | | | |
| QgsSymbolLayerV2CreateFunc createFunction() const { return mCreateFunc;
} | | QgsSymbolLayerV2CreateFunc createFunction() const { return mCreateFunc;
} | |
| QgsSymbolLayerV2WidgetFunc widgetFunction() const { return mWidgetFunc;
} | | QgsSymbolLayerV2WidgetFunc widgetFunction() const { return mWidgetFunc;
} | |
|
| | | QgsSymbolLayerV2CreateFromSldFunc createFromSldFunction() const { retur
n mCreateFromSldFunc; } | |
| | | | |
| void setWidgetFunction( QgsSymbolLayerV2WidgetFunc f ) { mWidgetFunc =
f; } | | void setWidgetFunction( QgsSymbolLayerV2WidgetFunc f ) { mWidgetFunc =
f; } | |
| | | | |
| virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map )
{ return mCreateFunc ? mCreateFunc( map ) : NULL; } | | virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map )
{ return mCreateFunc ? mCreateFunc( map ) : NULL; } | |
|
| virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget() { return mWid | | virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget( const QgsVecto | |
| getFunc ? mWidgetFunc() : NULL; } | | rLayer* vl ) { return mWidgetFunc ? mWidgetFunc( vl ) : NULL; } | |
| | | virtual QgsSymbolLayerV2* createSymbolLayerFromSld( QDomElement& elem ) | |
| | | { return mCreateFromSldFunc ? mCreateFromSldFunc( elem ) : NULL; } | |
| | | | |
| protected: | | protected: | |
| QgsSymbolLayerV2CreateFunc mCreateFunc; | | QgsSymbolLayerV2CreateFunc mCreateFunc; | |
| QgsSymbolLayerV2WidgetFunc mWidgetFunc; | | QgsSymbolLayerV2WidgetFunc mWidgetFunc; | |
|
| | | QgsSymbolLayerV2CreateFromSldFunc mCreateFromSldFunc; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| Registry of available symbol layer classes. | | Registry of available symbol layer classes. | |
| Implemented as a singleton. | | Implemented as a singleton. | |
| */ | | */ | |
| class CORE_EXPORT QgsSymbolLayerV2Registry | | class CORE_EXPORT QgsSymbolLayerV2Registry | |
| { | | { | |
| public: | | public: | |
| | | | |
| | | | |
| skipping to change at line 83 | | skipping to change at line 122 | |
| | | | |
| //! return metadata for specified symbol layer. Returns NULL if not fou
nd | | //! return metadata for specified symbol layer. Returns NULL if not fou
nd | |
| QgsSymbolLayerV2AbstractMetadata* symbolLayerMetadata( QString name ) c
onst; | | QgsSymbolLayerV2AbstractMetadata* symbolLayerMetadata( QString name ) c
onst; | |
| | | | |
| //! register a new symbol layer type. Takes ownership of the metadata i
nstance. | | //! register a new symbol layer type. Takes ownership of the metadata i
nstance. | |
| bool addSymbolLayerType( QgsSymbolLayerV2AbstractMetadata* metadata ); | | bool addSymbolLayerType( QgsSymbolLayerV2AbstractMetadata* metadata ); | |
| | | | |
| //! create a new instance of symbol layer given symbol layer name and p
roperties | | //! create a new instance of symbol layer given symbol layer name and p
roperties | |
| QgsSymbolLayerV2* createSymbolLayer( QString name, const QgsStringMap&
properties = QgsStringMap() ) const; | | QgsSymbolLayerV2* createSymbolLayer( QString name, const QgsStringMap&
properties = QgsStringMap() ) const; | |
| | | | |
|
| | | //! create a new instance of symbol layer given symbol layer name and S | |
| | | LD | |
| | | QgsSymbolLayerV2* createSymbolLayerFromSld( QString name, QDomElement & | |
| | | element ) const; | |
| | | | |
| //! return a list of available symbol layers for a specified symbol typ
e | | //! return a list of available symbol layers for a specified symbol typ
e | |
| QStringList symbolLayersForType( QgsSymbolV2::SymbolType type ); | | QStringList symbolLayersForType( QgsSymbolV2::SymbolType type ); | |
| | | | |
| //! create a new instance of symbol layer for specified symbol type wit
h default settings | | //! create a new instance of symbol layer for specified symbol type wit
h default settings | |
| static QgsSymbolLayerV2* defaultSymbolLayer( QgsSymbolV2::SymbolType ty
pe ); | | static QgsSymbolLayerV2* defaultSymbolLayer( QgsSymbolV2::SymbolType ty
pe ); | |
| | | | |
| protected: | | protected: | |
| QgsSymbolLayerV2Registry(); | | QgsSymbolLayerV2Registry(); | |
| ~QgsSymbolLayerV2Registry(); | | ~QgsSymbolLayerV2Registry(); | |
| | | | |
| | | | |
End of changes. 10 change blocks. |
| 7 lines changed or deleted | | 64 lines changed or added | |
|
| qgssymbollayerv2utils.h | | qgssymbollayerv2utils.h | |
|
| | | /************************************************************************** | |
| | | * | |
| | | qgssymbollayerv2utils.h | |
| | | --------------------- | |
| | | begin : November 2009 | |
| | | copyright : (C) 2009 by Martin Dobias | |
| | | email : wonder.sk at gmail.com | |
| | | ************************************************************************** | |
| | | * | |
| | | * | |
| | | * | |
| | | * This program is free software; you can redistribute it and/or modify | |
| | | * | |
| | | * it under the terms of the GNU General Public License as published by | |
| | | * | |
| | | * the Free Software Foundation; either version 2 of the License, or | |
| | | * | |
| | | * (at your option) any later version. | |
| | | * | |
| | | * | |
| | | * | |
| | | ************************************************************************** | |
| | | */ | |
| | | | |
| #ifndef QGSSYMBOLLAYERV2UTILS_H | | #ifndef QGSSYMBOLLAYERV2UTILS_H | |
| #define QGSSYMBOLLAYERV2UTILS_H | | #define QGSSYMBOLLAYERV2UTILS_H | |
| | | | |
| #include <QMap> | | #include <QMap> | |
| #include <Qt> | | #include <Qt> | |
| #include <QtCore> | | #include <QtCore> | |
|
| | | #include <QFont> | |
| | | #include <QColor> | |
| #include "qgssymbolv2.h" | | #include "qgssymbolv2.h" | |
|
| | | #include "qgis.h" | |
| | | | |
|
| class QgsSymbolV2; | | | |
| class QgsSymbolLayerV2; | | class QgsSymbolLayerV2; | |
| class QgsVectorColorRampV2; | | class QgsVectorColorRampV2; | |
| | | | |
| typedef QMap<QString, QString> QgsStringMap; | | typedef QMap<QString, QString> QgsStringMap; | |
| typedef QMap<QString, QgsSymbolV2* > QgsSymbolV2Map; | | typedef QMap<QString, QgsSymbolV2* > QgsSymbolV2Map; | |
| | | | |
|
| class QColor; | | | |
| class QDomDocument; | | class QDomDocument; | |
| class QDomElement; | | class QDomElement; | |
| class QIcon; | | class QIcon; | |
| class QPixmap; | | class QPixmap; | |
| class QPointF; | | class QPointF; | |
| class QSize; | | class QSize; | |
| | | | |
| class CORE_EXPORT QgsSymbolLayerV2Utils | | class CORE_EXPORT QgsSymbolLayerV2Utils | |
| { | | { | |
| public: | | public: | |
| | | | |
| static QString encodeColor( QColor color ); | | static QString encodeColor( QColor color ); | |
| static QColor decodeColor( QString str ); | | static QColor decodeColor( QString str ); | |
| | | | |
|
| | | static QString encodeSldAlpha( int alpha ); | |
| | | static int decodeSldAlpha( QString str ); | |
| | | | |
| | | static QString encodeSldFontStyle( QFont::Style style ); | |
| | | static QFont::Style decodeSldFontStyle( QString str ); | |
| | | | |
| | | static QString encodeSldFontWeight( int weight ); | |
| | | static int decodeSldFontWeight( QString str ); | |
| | | | |
| static QString encodePenStyle( Qt::PenStyle style ); | | static QString encodePenStyle( Qt::PenStyle style ); | |
| static Qt::PenStyle decodePenStyle( QString str ); | | static Qt::PenStyle decodePenStyle( QString str ); | |
| | | | |
| static QString encodePenJoinStyle( Qt::PenJoinStyle style ); | | static QString encodePenJoinStyle( Qt::PenJoinStyle style ); | |
| static Qt::PenJoinStyle decodePenJoinStyle( QString str ); | | static Qt::PenJoinStyle decodePenJoinStyle( QString str ); | |
| | | | |
| static QString encodePenCapStyle( Qt::PenCapStyle style ); | | static QString encodePenCapStyle( Qt::PenCapStyle style ); | |
| static Qt::PenCapStyle decodePenCapStyle( QString str ); | | static Qt::PenCapStyle decodePenCapStyle( QString str ); | |
| | | | |
|
| | | static QString encodeSldLineJoinStyle( Qt::PenJoinStyle style ); | |
| | | static Qt::PenJoinStyle decodeSldLineJoinStyle( QString str ); | |
| | | | |
| | | static QString encodeSldLineCapStyle( Qt::PenCapStyle style ); | |
| | | static Qt::PenCapStyle decodeSldLineCapStyle( QString str ); | |
| | | | |
| static QString encodeBrushStyle( Qt::BrushStyle style ); | | static QString encodeBrushStyle( Qt::BrushStyle style ); | |
| static Qt::BrushStyle decodeBrushStyle( QString str ); | | static Qt::BrushStyle decodeBrushStyle( QString str ); | |
| | | | |
|
| | | static QString encodeSldBrushStyle( Qt::BrushStyle style ); | |
| | | static Qt::BrushStyle decodeSldBrushStyle( QString str ); | |
| | | | |
| static QString encodePoint( QPointF point ); | | static QString encodePoint( QPointF point ); | |
| static QPointF decodePoint( QString str ); | | static QPointF decodePoint( QString str ); | |
| | | | |
| static QString encodeRealVector( const QVector<qreal>& v ); | | static QString encodeRealVector( const QVector<qreal>& v ); | |
| static QVector<qreal> decodeRealVector( const QString& s ); | | static QVector<qreal> decodeRealVector( const QString& s ); | |
| | | | |
|
| | | static QString encodeSldRealVector( const QVector<qreal>& v ); | |
| | | static QVector<qreal> decodeSldRealVector( const QString& s ); | |
| | | | |
| static QString encodeOutputUnit( QgsSymbolV2::OutputUnit unit ); | | static QString encodeOutputUnit( QgsSymbolV2::OutputUnit unit ); | |
| static QgsSymbolV2::OutputUnit decodeOutputUnit( QString str ); | | static QgsSymbolV2::OutputUnit decodeOutputUnit( QString str ); | |
| | | | |
|
| | | static QString encodeSldUom( QgsSymbolV2::OutputUnit unit, double *scal | |
| | | eFactor ); | |
| | | static QgsSymbolV2::OutputUnit decodeSldUom( QString str, double *scale | |
| | | Factor ); | |
| | | | |
| static QIcon symbolPreviewIcon( QgsSymbolV2* symbol, QSize size ); | | static QIcon symbolPreviewIcon( QgsSymbolV2* symbol, QSize size ); | |
| static QIcon symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbol
V2::OutputUnit u, QSize size ); | | static QIcon symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbol
V2::OutputUnit u, QSize size ); | |
| static QIcon colorRampPreviewIcon( QgsVectorColorRampV2* ramp, QSize si
ze ); | | static QIcon colorRampPreviewIcon( QgsVectorColorRampV2* ramp, QSize si
ze ); | |
| | | | |
| static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size ); | | static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size ); | |
| static QPixmap colorRampPreviewPixmap( QgsVectorColorRampV2* ramp, QSiz
e size ); | | static QPixmap colorRampPreviewPixmap( QgsVectorColorRampV2* ramp, QSiz
e size ); | |
| | | | |
| static QgsSymbolV2* loadSymbol( QDomElement& element ); | | static QgsSymbolV2* loadSymbol( QDomElement& element ); | |
| static QgsSymbolLayerV2* loadSymbolLayer( QDomElement& element ); | | static QgsSymbolLayerV2* loadSymbolLayer( QDomElement& element ); | |
| static QDomElement saveSymbol( QString name, QgsSymbolV2* symbol, QDomD
ocument& doc, QgsSymbolV2Map* subSymbols = NULL ); | | static QDomElement saveSymbol( QString name, QgsSymbolV2* symbol, QDomD
ocument& doc, QgsSymbolV2Map* subSymbols = NULL ); | |
| | | | |
|
| | | static bool createSymbolLayerV2ListFromSld( QDomElement& element, QGis: | |
| | | :GeometryType geomType, QgsSymbolLayerV2List &layers ); | |
| | | | |
| | | static QgsSymbolLayerV2* createFillLayerFromSld( QDomElement &element ) | |
| | | ; | |
| | | static QgsSymbolLayerV2* createLineLayerFromSld( QDomElement &element ) | |
| | | ; | |
| | | static QgsSymbolLayerV2* createMarkerLayerFromSld( QDomElement &element | |
| | | ); | |
| | | | |
| | | static bool convertPolygonSymbolizerToPointMarker( QDomElement &element | |
| | | , QgsSymbolLayerV2List &layerList ); | |
| | | static bool hasExternalGraphic( QDomElement &element ); | |
| | | static bool hasWellKnownMark( QDomElement &element ); | |
| | | | |
| | | static bool needFontMarker( QDomElement &element ); | |
| | | static bool needSvgMarker( QDomElement &element ); | |
| | | static bool needEllipseMarker( QDomElement &element ); | |
| | | static bool needMarkerLine( QDomElement &element ); | |
| | | static bool needLinePatternFill( QDomElement &element ); | |
| | | static bool needPointPatternFill( QDomElement &element ); | |
| | | static bool needSvgFill( QDomElement &element ); | |
| | | | |
| | | static void fillToSld( QDomDocument &doc, QDomElement &element, | |
| | | Qt::BrushStyle brushStyle, QColor color = QColor | |
| | | () ); | |
| | | static bool fillFromSld( QDomElement &element, | |
| | | Qt::BrushStyle &brushStyle, QColor &color ); | |
| | | | |
| | | static void lineToSld( QDomDocument &doc, QDomElement &element, | |
| | | Qt::PenStyle penStyle, QColor color, double widt | |
| | | h = -1, | |
| | | const Qt::PenJoinStyle *penJoinStyle = 0, const | |
| | | Qt::PenCapStyle *penCapStyle = 0, | |
| | | const QVector<qreal> *customDashPattern = 0, dou | |
| | | ble dashOffset = 0.0 ); | |
| | | static bool lineFromSld( QDomElement &element, | |
| | | Qt::PenStyle &penStyle, QColor &color, double | |
| | | &width, | |
| | | Qt::PenJoinStyle *penJoinStyle = 0, Qt::PenCap | |
| | | Style *penCapStyle = 0, | |
| | | QVector<qreal> *customDashPattern = 0, double | |
| | | *dashOffset = 0 ); | |
| | | | |
| | | static void externalGraphicToSld( QDomDocument &doc, QDomElement &eleme | |
| | | nt, | |
| | | QString path, QString mime, | |
| | | QColor color, double size = -1 ); | |
| | | static bool externalGraphicFromSld( QDomElement &element, | |
| | | QString &path, QString &mime, | |
| | | QColor &color, double &size ); | |
| | | | |
| | | static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &eleme | |
| | | nt, | |
| | | QString name, QColor color, QColor bo | |
| | | rderColor = QColor(), | |
| | | double borderWidth = -1, double size | |
| | | = -1 ); | |
| | | static bool wellKnownMarkerFromSld( QDomElement &element, | |
| | | QString &name, QColor &color, QColo | |
| | | r &borderColor, | |
| | | double &borderWidth, double &size ) | |
| | | ; | |
| | | | |
| | | static void externalMarkerToSld( QDomDocument &doc, QDomElement &elemen | |
| | | t, | |
| | | QString path, QString format, int *mar | |
| | | kIndex = 0, | |
| | | QColor color = QColor(), double size = | |
| | | -1 ); | |
| | | static bool externalMarkerFromSld( QDomElement &element, | |
| | | QString &path, QString &format, int | |
| | | &markIndex, | |
| | | QColor &color, double &size ); | |
| | | | |
| | | static void labelTextToSld( QDomDocument &doc, QDomElement &element, QS | |
| | | tring label, | |
| | | QFont font, QColor color = QColor(), double | |
| | | size = -1 ); | |
| | | | |
| | | static void createRotationElement( QDomDocument &doc, QDomElement &elem | |
| | | ent, QString rotationFunc ); | |
| | | static bool rotationFromSldElement( QDomElement &element, QString &rota | |
| | | tionFunc ); | |
| | | | |
| | | static void createOpacityElement( QDomDocument &doc, QDomElement &eleme | |
| | | nt, QString alphaFunc ); | |
| | | static bool opacityFromSldElement( QDomElement &element, QString &alpha | |
| | | Func ); | |
| | | | |
| | | static void createDisplacementElement( QDomDocument &doc, QDomElement & | |
| | | element, QPointF offset ); | |
| | | static bool displacementFromSldElement( QDomElement &element, QPointF & | |
| | | offset ); | |
| | | | |
| | | static void createOnlineResourceElement( QDomDocument &doc, QDomElement | |
| | | &element, QString path, QString format ); | |
| | | static bool onlineResourceFromSldElement( QDomElement &element, QString | |
| | | &path, QString &format ); | |
| | | | |
| | | static void createGeometryElement( QDomDocument &doc, QDomElement &elem | |
| | | ent, QString geomFunc ); | |
| | | static bool geometryFromSldElement( QDomElement &element, QString &geom | |
| | | Func ); | |
| | | | |
| | | static bool createFunctionElement( QDomDocument &doc, QDomElement &elem | |
| | | ent, QString function ); | |
| | | static bool functionFromSldElement( QDomElement &element, QString &func | |
| | | tion ); | |
| | | | |
| | | static QDomElement createSvgParameterElement( QDomDocument &doc, QStrin | |
| | | g name, QString value ); | |
| | | static QgsStringMap getSvgParameterList( QDomElement &element ); | |
| | | | |
| | | static QDomElement createVendorOptionElement( QDomDocument &doc, QStrin | |
| | | g name, QString value ); | |
| | | static QgsStringMap getVendorOptionList( QDomElement &element ); | |
| | | | |
| static QgsStringMap parseProperties( QDomElement& element ); | | static QgsStringMap parseProperties( QDomElement& element ); | |
| static void saveProperties( QgsStringMap props, QDomDocument& doc, QDom
Element& element ); | | static void saveProperties( QgsStringMap props, QDomDocument& doc, QDom
Element& element ); | |
| | | | |
| static QgsSymbolV2Map loadSymbols( QDomElement& element ); | | static QgsSymbolV2Map loadSymbols( QDomElement& element ); | |
| static QDomElement saveSymbols( QgsSymbolV2Map& symbols, QString tagNam
e, QDomDocument& doc ); | | static QDomElement saveSymbols( QgsSymbolV2Map& symbols, QString tagNam
e, QDomDocument& doc ); | |
| | | | |
| static void clearSymbolMap( QgsSymbolV2Map& symbols ); | | static void clearSymbolMap( QgsSymbolV2Map& symbols ); | |
| | | | |
| static QgsVectorColorRampV2* loadColorRamp( QDomElement& element ); | | static QgsVectorColorRampV2* loadColorRamp( QDomElement& element ); | |
| static QDomElement saveColorRamp( QString name, QgsVectorColorRampV2* r
amp, QDomDocument& doc ); | | static QDomElement saveColorRamp( QString name, QgsVectorColorRampV2* r
amp, QDomDocument& doc ); | |
| | | | |
| skipping to change at line 85 | | skipping to change at line 204 | |
| /**Returns the line width scale factor depending on the unit and the pa
int device*/ | | /**Returns the line width scale factor depending on the unit and the pa
int device*/ | |
| static double lineWidthScaleFactor( QgsRenderContext& c, QgsSymbolV2::O
utputUnit u ); | | static double lineWidthScaleFactor( QgsRenderContext& c, QgsSymbolV2::O
utputUnit u ); | |
| /**Returns scale factor painter units -> pixel dimensions*/ | | /**Returns scale factor painter units -> pixel dimensions*/ | |
| static double pixelSizeScaleFactor( QgsRenderContext& c, QgsSymbolV2::O
utputUnit u ); | | static double pixelSizeScaleFactor( QgsRenderContext& c, QgsSymbolV2::O
utputUnit u ); | |
| /**Creates a render context for a pixel based device*/ | | /**Creates a render context for a pixel based device*/ | |
| static QgsRenderContext createRenderContext( QPainter* p ); | | static QgsRenderContext createRenderContext( QPainter* p ); | |
| | | | |
| /**Multiplies opacity of image pixel values with a (global) transparenc
y value*/ | | /**Multiplies opacity of image pixel values with a (global) transparenc
y value*/ | |
| static void multiplyImageOpacity( QImage* image, qreal alpha ); | | static void multiplyImageOpacity( QImage* image, qreal alpha ); | |
| | | | |
|
| /**Sorts the passed list in requested order*/ | | /**Sorts the passed list in requested order*/ | |
| static void sortVariantList( QList<QVariant>& list, Qt::SortOrder or | | static void sortVariantList( QList<QVariant>& list, Qt::SortOrder order | |
| der ); | | ); | |
| | | /**Returns a point on the line from startPoint to directionPoint that i | |
| | | s a certain distance away from the starting point*/ | |
| | | static QPointF pointOnLineWithDistance( const QPointF& startPoint, cons | |
| | | t QPointF& directionPoint, double distance ); | |
| }; | | }; | |
| | | | |
| class QPolygonF; | | class QPolygonF; | |
| | | | |
| //! calculate line shifted by a specified distance | | //! calculate line shifted by a specified distance | |
| QPolygonF offsetLine( QPolygonF polyline, double dist ); | | QPolygonF offsetLine( QPolygonF polyline, double dist ); | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 5 lines changed or deleted | | 177 lines changed or added | |
|
| qgssymbollayerv2widget.h | | qgssymbollayerv2widget.h | |
|
| | | /************************************************************************** | |
| | | * | |
| | | qgssymbollayerv2widget.h - symbol layer widgets | |
| | | | |
| | | --------------------- | |
| | | begin : November 2009 | |
| | | copyright : (C) 2009 by Martin Dobias | |
| | | email : wonder.sk at gmail.com | |
| | | ************************************************************************** | |
| | | * | |
| | | * | |
| | | * | |
| | | * This program is free software; you can redistribute it and/or modify | |
| | | * | |
| | | * it under the terms of the GNU General Public License as published by | |
| | | * | |
| | | * the Free Software Foundation; either version 2 of the License, or | |
| | | * | |
| | | * (at your option) any later version. | |
| | | * | |
| | | * | |
| | | * | |
| | | ************************************************************************** | |
| | | */ | |
| | | | |
| #ifndef QGSSYMBOLLAYERV2WIDGET_H | | #ifndef QGSSYMBOLLAYERV2WIDGET_H | |
| #define QGSSYMBOLLAYERV2WIDGET_H | | #define QGSSYMBOLLAYERV2WIDGET_H | |
| | | | |
| #include <QWidget> | | #include <QWidget> | |
| | | | |
| class QgsSymbolLayerV2; | | class QgsSymbolLayerV2; | |
|
| | | class QgsVectorLayer; | |
| | | | |
| class GUI_EXPORT QgsSymbolLayerV2Widget : public QWidget | | class GUI_EXPORT QgsSymbolLayerV2Widget : public QWidget | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsSymbolLayerV2Widget( QWidget* parent ) : QWidget( parent ) {} | | QgsSymbolLayerV2Widget( QWidget* parent, const QgsVectorLayer* vl = 0 )
: QWidget( parent ), mVectorLayer( vl ) {} | |
| virtual ~QgsSymbolLayerV2Widget() {} | | virtual ~QgsSymbolLayerV2Widget() {} | |
| | | | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0; | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0; | |
| virtual QgsSymbolLayerV2* symbolLayer() = 0; | | virtual QgsSymbolLayerV2* symbolLayer() = 0; | |
| | | | |
|
| | | protected: | |
| | | const QgsVectorLayer* mVectorLayer; | |
| | | | |
| signals: | | signals: | |
| void changed(); | | void changed(); | |
| }; | | }; | |
| | | | |
| /////////// | | /////////// | |
| | | | |
| #include "ui_widget_simpleline.h" | | #include "ui_widget_simpleline.h" | |
| | | | |
| class QgsSimpleLineSymbolLayerV2; | | class QgsSimpleLineSymbolLayerV2; | |
| | | | |
| class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2
Widget, private Ui::WidgetSimpleLine | | class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2
Widget, private Ui::WidgetSimpleLine | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsSimpleLineSymbolLayerV2Widget( QWidget* parent = NULL ); | | QgsSimpleLineSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* pa
rent = NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsSimpleLineSymbo
lLayerV2Widget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsSimpleLineSymbolLayerV2Widget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| public slots: | | public slots: | |
| void penWidthChanged(); | | void penWidthChanged(); | |
| void colorChanged(); | | void colorChanged(); | |
| void penStyleChanged(); | | void penStyleChanged(); | |
| void offsetChanged(); | | void offsetChanged(); | |
| | | | |
| skipping to change at line 69 | | skipping to change at line 88 | |
| | | | |
| #include "ui_widget_simplemarker.h" | | #include "ui_widget_simplemarker.h" | |
| | | | |
| class QgsSimpleMarkerSymbolLayerV2; | | class QgsSimpleMarkerSymbolLayerV2; | |
| | | | |
| class GUI_EXPORT QgsSimpleMarkerSymbolLayerV2Widget : public QgsSymbolLayer
V2Widget, private Ui::WidgetSimpleMarker | | class GUI_EXPORT QgsSimpleMarkerSymbolLayerV2Widget : public QgsSymbolLayer
V2Widget, private Ui::WidgetSimpleMarker | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsSimpleMarkerSymbolLayerV2Widget( QWidget* parent = NULL ); | | QgsSimpleMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget*
parent = NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsSimpleMarkerSym
bolLayerV2Widget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsSimpleMarkerSymbolLayerV2Widget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| public slots: | | public slots: | |
| void setName(); | | void setName(); | |
| void setColorBorder(); | | void setColorBorder(); | |
| void setColorFill(); | | void setColorFill(); | |
| void setSize(); | | void setSize(); | |
| | | | |
| skipping to change at line 100 | | skipping to change at line 119 | |
| | | | |
| #include "ui_widget_simplefill.h" | | #include "ui_widget_simplefill.h" | |
| | | | |
| class QgsSimpleFillSymbolLayerV2; | | class QgsSimpleFillSymbolLayerV2; | |
| | | | |
| class GUI_EXPORT QgsSimpleFillSymbolLayerV2Widget : public QgsSymbolLayerV2
Widget, private Ui::WidgetSimpleFill | | class GUI_EXPORT QgsSimpleFillSymbolLayerV2Widget : public QgsSymbolLayerV2
Widget, private Ui::WidgetSimpleFill | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsSimpleFillSymbolLayerV2Widget( QWidget* parent = NULL ); | | QgsSimpleFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* pa
rent = NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsSimpleFillSymbo
lLayerV2Widget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsSimpleFillSymbolLayerV2Widget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| public slots: | | public slots: | |
| void setColor(); | | void setColor(); | |
| void setBorderColor(); | | void setBorderColor(); | |
| void setBrushStyle(); | | void setBrushStyle(); | |
| void borderWidthChanged(); | | void borderWidthChanged(); | |
| | | | |
| skipping to change at line 131 | | skipping to change at line 150 | |
| | | | |
| #include "ui_widget_markerline.h" | | #include "ui_widget_markerline.h" | |
| | | | |
| class QgsMarkerLineSymbolLayerV2; | | class QgsMarkerLineSymbolLayerV2; | |
| | | | |
| class GUI_EXPORT QgsMarkerLineSymbolLayerV2Widget : public QgsSymbolLayerV2
Widget, private Ui::WidgetMarkerLine | | class GUI_EXPORT QgsMarkerLineSymbolLayerV2Widget : public QgsSymbolLayerV2
Widget, private Ui::WidgetMarkerLine | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsMarkerLineSymbolLayerV2Widget( QWidget* parent = NULL ); | | QgsMarkerLineSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* pa
rent = NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsMarkerLineSymbo
lLayerV2Widget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsMarkerLineSymbolLayerV2Widget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| public slots: | | public slots: | |
| | | | |
| void setInterval( double val ); | | void setInterval( double val ); | |
| void setMarker(); | | void setMarker(); | |
| void setRotate(); | | void setRotate(); | |
| | | | |
| skipping to change at line 165 | | skipping to change at line 184 | |
| | | | |
| #include "ui_widget_svgmarker.h" | | #include "ui_widget_svgmarker.h" | |
| | | | |
| class QgsSvgMarkerSymbolLayerV2; | | class QgsSvgMarkerSymbolLayerV2; | |
| | | | |
| class GUI_EXPORT QgsSvgMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2W
idget, private Ui::WidgetSvgMarker | | class GUI_EXPORT QgsSvgMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2W
idget, private Ui::WidgetSvgMarker | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsSvgMarkerSymbolLayerV2Widget( QWidget* parent = NULL ); | | QgsSvgMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* par
ent = NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsSvgMarkerSymbol
LayerV2Widget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsSvgMarkerSymbolLayerV2Widget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| public slots: | | public slots: | |
| void setName( const QModelIndex& idx ); | | void setName( const QModelIndex& idx ); | |
| void setSize(); | | void setSize(); | |
| void setAngle(); | | void setAngle(); | |
| void setOffset(); | | void setOffset(); | |
|
| | | void on_mFileToolButton_clicked(); | |
| | | void on_mFileLineEdit_textEdited( const QString& text ); | |
| | | void on_mChangeColorButton_clicked(); | |
| | | void on_mChangeBorderColorButton_clicked(); | |
| | | void on_mBorderWidthSpinBox_valueChanged( double d ); | |
| | | | |
| protected: | | protected: | |
| | | | |
| void populateList(); | | void populateList(); | |
|
| | | //update gui for svg file (insert new path, update activation of gui el | |
| | | ements for svg params) | |
| | | void setGuiForSvg( const QgsSvgMarkerSymbolLayerV2* layer ); | |
| | | | |
| QgsSvgMarkerSymbolLayerV2* mLayer; | | QgsSvgMarkerSymbolLayerV2* mLayer; | |
| }; | | }; | |
| | | | |
| /////////// | | /////////// | |
| | | | |
| #include "ui_widget_linedecoration.h" | | #include "ui_widget_linedecoration.h" | |
| | | | |
| class QgsLineDecorationSymbolLayerV2; | | class QgsLineDecorationSymbolLayerV2; | |
| | | | |
| class GUI_EXPORT QgsLineDecorationSymbolLayerV2Widget : public QgsSymbolLay
erV2Widget, private Ui::WidgetLineDecoration | | class GUI_EXPORT QgsLineDecorationSymbolLayerV2Widget : public QgsSymbolLay
erV2Widget, private Ui::WidgetLineDecoration | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsLineDecorationSymbolLayerV2Widget( QWidget* parent = NULL ); | | QgsLineDecorationSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget
* parent = NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsLineDecorationS
ymbolLayerV2Widget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsLineDecorationSymbolLayerV2Widget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| public slots: | | public slots: | |
| void colorChanged(); | | void colorChanged(); | |
| void penWidthChanged(); | | void penWidthChanged(); | |
| | | | |
| protected: | | protected: | |
| | | | |
| skipping to change at line 224 | | skipping to change at line 250 | |
| | | | |
| #include "ui_widget_svgfill.h" | | #include "ui_widget_svgfill.h" | |
| | | | |
| class QgsSVGFillSymbolLayer; | | class QgsSVGFillSymbolLayer; | |
| | | | |
| class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widge
t, private Ui::WidgetSVGFill | | class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widge
t, private Ui::WidgetSVGFill | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsSVGFillSymbolLayerWidget( QWidget* parent = NULL ); | | QgsSVGFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent
= NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsSVGFillSymbolLa
yerWidget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsSVGFillSymbolLayerWidget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| protected: | | protected: | |
| QgsSVGFillSymbolLayer* mLayer; | | QgsSVGFillSymbolLayer* mLayer; | |
| //sets new output unit. Is called on combo box or spin box change | | //sets new output unit. Is called on combo box or spin box change | |
| void setOutputUnit(); | | void setOutputUnit(); | |
| void insertIcons(); | | void insertIcons(); | |
| void updateOutlineIcon(); | | void updateOutlineIcon(); | |
|
| | | void updateParamGui(); | |
| | | | |
| private slots: | | private slots: | |
| void on_mBrowseToolButton_clicked(); | | void on_mBrowseToolButton_clicked(); | |
| void on_mTextureWidthSpinBox_valueChanged( double d ); | | void on_mTextureWidthSpinBox_valueChanged( double d ); | |
| void on_mSVGLineEdit_textChanged( const QString & text ); | | void on_mSVGLineEdit_textChanged( const QString & text ); | |
| void setFile( const QModelIndex& item ); | | void setFile( const QModelIndex& item ); | |
| void on_mChangeOutlinePushButton_clicked(); | | void on_mChangeOutlinePushButton_clicked(); | |
| void on_mRotationSpinBox_valueChanged( double d ); | | void on_mRotationSpinBox_valueChanged( double d ); | |
|
| | | void on_mChangeColorButton_clicked(); | |
| | | void on_mChangeBorderColorButton_clicked(); | |
| | | void on_mBorderWidthSpinBox_valueChanged( double d ); | |
| }; | | }; | |
| | | | |
| ////////// | | ////////// | |
| | | | |
|
| | | #include "ui_widget_linepatternfill.h" | |
| | | | |
| | | class QgsLinePatternFillSymbolLayer; | |
| | | | |
| | | class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLaye | |
| | | rV2Widget, private Ui::WidgetLinePatternFill | |
| | | { | |
| | | Q_OBJECT | |
| | | | |
| | | public: | |
| | | | |
| | | QgsLinePatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* | |
| | | parent = NULL ); | |
| | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret | |
| | | urn new QgsLinePatternFillSymbolLayerWidget( vl ); } | |
| | | | |
| | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| | | protected: | |
| | | QgsLinePatternFillSymbolLayer* mLayer; | |
| | | | |
| | | private slots: | |
| | | void on_mAngleSpinBox_valueChanged( double d ); | |
| | | void on_mDistanceSpinBox_valueChanged( double d ); | |
| | | void on_mLineWidthSpinBox_valueChanged( double d ); | |
| | | void on_mOffsetSpinBox_valueChanged( double d ); | |
| | | void on_mColorPushButton_clicked(); | |
| | | void on_mOutlinePushButton_clicked(); | |
| | | }; | |
| | | | |
| | | ////////// | |
| | | | |
| | | #include "ui_widget_pointpatternfill.h" | |
| | | | |
| | | class QgsPointPatternFillSymbolLayer; | |
| | | | |
| | | class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLaye | |
| | | rV2Widget, private Ui::WidgetPointPatternFill | |
| | | { | |
| | | Q_OBJECT | |
| | | | |
| | | public: | |
| | | QgsPointPatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget | |
| | | * parent = NULL ); | |
| | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret | |
| | | urn new QgsPointPatternFillSymbolLayerWidget( vl ); } | |
| | | | |
| | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| | | protected: | |
| | | QgsPointPatternFillSymbolLayer* mLayer; | |
| | | void updateMarkerIcon(); | |
| | | | |
| | | private slots: | |
| | | void on_mHorizontalDistanceSpinBox_valueChanged( double d ); | |
| | | void on_mVerticalDistanceSpinBox_valueChanged( double d ); | |
| | | void on_mHorizontalDisplacementSpinBox_valueChanged( double d ); | |
| | | void on_mVerticalDisplacementSpinBox_valueChanged( double d ); | |
| | | void on_mChangeMarkerButton_clicked(); | |
| | | }; | |
| | | | |
| | | ///////// | |
| | | | |
| #include "ui_widget_fontmarker.h" | | #include "ui_widget_fontmarker.h" | |
| | | | |
| class QgsFontMarkerSymbolLayerV2; | | class QgsFontMarkerSymbolLayerV2; | |
| class CharacterWidget; | | class CharacterWidget; | |
| | | | |
| class GUI_EXPORT QgsFontMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2
Widget, private Ui::WidgetFontMarker | | class GUI_EXPORT QgsFontMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2
Widget, private Ui::WidgetFontMarker | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsFontMarkerSymbolLayerV2Widget( QWidget* parent = NULL ); | | QgsFontMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* pa
rent = NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsFontMarkerSymbo
lLayerV2Widget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsFontMarkerSymbolLayerV2Widget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| public slots: | | public slots: | |
| void setFontFamily( const QFont& font ); | | void setFontFamily( const QFont& font ); | |
| void setColor(); | | void setColor(); | |
| void setSize( double size ); | | void setSize( double size ); | |
| void setAngle( double angle ); | | void setAngle( double angle ); | |
| | | | |
| skipping to change at line 292 | | skipping to change at line 381 | |
| | | | |
| #include "ui_widget_centroidfill.h" | | #include "ui_widget_centroidfill.h" | |
| | | | |
| class QgsCentroidFillSymbolLayerV2; | | class QgsCentroidFillSymbolLayerV2; | |
| | | | |
| class GUI_EXPORT QgsCentroidFillSymbolLayerV2Widget : public QgsSymbolLayer
V2Widget, private Ui::WidgetCentroidFill | | class GUI_EXPORT QgsCentroidFillSymbolLayerV2Widget : public QgsSymbolLayer
V2Widget, private Ui::WidgetCentroidFill | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
|
| QgsCentroidFillSymbolLayerV2Widget( QWidget* parent = NULL ); | | QgsCentroidFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget*
parent = NULL ); | |
| | | | |
|
| static QgsSymbolLayerV2Widget* create() { return new QgsCentroidFillSym
bolLayerV2Widget(); } | | static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret
urn new QgsCentroidFillSymbolLayerV2Widget( vl ); } | |
| | | | |
| // from base class | | // from base class | |
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |
| virtual QgsSymbolLayerV2* symbolLayer(); | | virtual QgsSymbolLayerV2* symbolLayer(); | |
| | | | |
| public slots: | | public slots: | |
| void setMarker(); | | void setMarker(); | |
| | | | |
| protected: | | protected: | |
| void updateMarker(); | | void updateMarker(); | |
| | | | |
End of changes. 27 change blocks. |
| 19 lines changed or deleted | | 124 lines changed or added | |
|
| qgssymbolv2.h | | qgssymbolv2.h | |
|
| | | /************************************************************************** | |
| | | * | |
| | | qgssymbolv2.h | |
| | | --------------------- | |
| | | begin : November 2009 | |
| | | copyright : (C) 2009 by Martin Dobias | |
| | | email : wonder.sk at gmail.com | |
| | | ************************************************************************** | |
| | | * | |
| | | * | |
| | | * | |
| | | * This program is free software; you can redistribute it and/or modify | |
| | | * | |
| | | * it under the terms of the GNU General Public License as published by | |
| | | * | |
| | | * the Free Software Foundation; either version 2 of the License, or | |
| | | * | |
| | | * (at your option) any later version. | |
| | | * | |
| | | * | |
| | | * | |
| | | ************************************************************************** | |
| | | */ | |
| | | | |
| #ifndef QGSSYMBOLV2_H | | #ifndef QGSSYMBOLV2_H | |
| #define QGSSYMBOLV2_H | | #define QGSSYMBOLV2_H | |
| | | | |
| #include "qgis.h" | | #include "qgis.h" | |
| #include <QList> | | #include <QList> | |
| #include <QMap> | | #include <QMap> | |
| | | | |
| class QColor; | | class QColor; | |
| class QImage; | | class QImage; | |
| class QPainter; | | class QPainter; | |
| class QSize; | | class QSize; | |
| class QPointF; | | class QPointF; | |
| class QPolygonF; | | class QPolygonF; | |
|
| | | | |
| | | class QDomDocument; | |
| | | class QDomElement; | |
| //class | | //class | |
| | | | |
|
| | | class QgsFeature; | |
| class QgsSymbolLayerV2; | | class QgsSymbolLayerV2; | |
| class QgsRenderContext; | | class QgsRenderContext; | |
|
| | | class QgsVectorLayer; | |
| | | | |
| typedef QMap<QString, QString> QgsStringMap; | | typedef QMap<QString, QString> QgsStringMap; | |
| typedef QList<QgsSymbolLayerV2*> QgsSymbolLayerV2List; | | typedef QList<QgsSymbolLayerV2*> QgsSymbolLayerV2List; | |
| | | | |
| class CORE_EXPORT QgsSymbolV2 | | class CORE_EXPORT QgsSymbolV2 | |
| { | | { | |
| public: | | public: | |
| | | | |
| enum OutputUnit | | enum OutputUnit | |
| { | | { | |
| | | | |
| skipping to change at line 75 | | skipping to change at line 94 | |
| | | | |
| //! delete symbol layer at specified index | | //! delete symbol layer at specified index | |
| bool deleteSymbolLayer( int index ); | | bool deleteSymbolLayer( int index ); | |
| | | | |
| //! remove symbol layer from the list and return pointer to it | | //! remove symbol layer from the list and return pointer to it | |
| QgsSymbolLayerV2* takeSymbolLayer( int index ); | | QgsSymbolLayerV2* takeSymbolLayer( int index ); | |
| | | | |
| //! delete layer at specified index and set a new one | | //! delete layer at specified index and set a new one | |
| bool changeSymbolLayer( int index, QgsSymbolLayerV2* layer ); | | bool changeSymbolLayer( int index, QgsSymbolLayerV2* layer ); | |
| | | | |
|
| void startRender( QgsRenderContext& context ); | | void startRender( QgsRenderContext& context, const QgsVectorLayer* laye
r = 0 ); | |
| void stopRender( QgsRenderContext& context ); | | void stopRender( QgsRenderContext& context ); | |
| | | | |
| void setColor( const QColor& color ); | | void setColor( const QColor& color ); | |
| QColor color(); | | QColor color(); | |
| | | | |
| void drawPreviewIcon( QPainter* painter, QSize size ); | | void drawPreviewIcon( QPainter* painter, QSize size ); | |
| | | | |
| QImage bigSymbolPreviewImage(); | | QImage bigSymbolPreviewImage(); | |
| | | | |
| QString dump(); | | QString dump(); | |
| | | | |
| virtual QgsSymbolV2* clone() const = 0; | | virtual QgsSymbolV2* clone() const = 0; | |
| | | | |
|
| | | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props | |
| | | ) const; | |
| | | | |
| OutputUnit outputUnit() const { return mOutputUnit; } | | OutputUnit outputUnit() const { return mOutputUnit; } | |
| void setOutputUnit( OutputUnit u ) { mOutputUnit = u; } | | void setOutputUnit( OutputUnit u ) { mOutputUnit = u; } | |
| | | | |
|
| | | //! Get alpha transparency 1 for opaque, 0 for invisible | |
| qreal alpha() const { return mAlpha; } | | qreal alpha() const { return mAlpha; } | |
|
| | | //! Set alpha transparency 1 for opaque, 0 for invisible | |
| void setAlpha( qreal alpha ) { mAlpha = alpha; } | | void setAlpha( qreal alpha ) { mAlpha = alpha; } | |
| | | | |
| //! @note added in 1.5 | | //! @note added in 1.5 | |
| void setRenderHints( int hints ) { mRenderHints = hints; } | | void setRenderHints( int hints ) { mRenderHints = hints; } | |
| //! @note added in 1.5 | | //! @note added in 1.5 | |
|
| int renderHints() { return mRenderHints; } | | int renderHints() const { return mRenderHints; } | |
| | | | |
| | | QSet<QString> usedAttributes() const; | |
| | | | |
| protected: | | protected: | |
| QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers ); // can't b
e instantiated | | QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers ); // can't b
e instantiated | |
| | | | |
| QgsSymbolLayerV2List cloneLayers() const; | | QgsSymbolLayerV2List cloneLayers() const; | |
| | | | |
| //! check whether a symbol layer type can be used within the symbol | | //! check whether a symbol layer type can be used within the symbol | |
| //! (marker-marker, line-line, fill-fill/line) | | //! (marker-marker, line-line, fill-fill/line) | |
| //! @note added in 1.7 | | //! @note added in 1.7 | |
| bool isSymbolLayerCompatible( SymbolType t ); | | bool isSymbolLayerCompatible( SymbolType t ); | |
| | | | |
| skipping to change at line 126 | | skipping to change at line 151 | |
| qreal mAlpha; | | qreal mAlpha; | |
| | | | |
| int mRenderHints; | | int mRenderHints; | |
| }; | | }; | |
| | | | |
| /////////////////////// | | /////////////////////// | |
| | | | |
| class CORE_EXPORT QgsSymbolV2RenderContext | | class CORE_EXPORT QgsSymbolV2RenderContext | |
| { | | { | |
| public: | | public: | |
|
| QgsSymbolV2RenderContext( QgsRenderContext& c, QgsSymbolV2::OutputUnit
u , qreal alpha = 1.0, bool selected = false, int renderHints = 0 ); | | QgsSymbolV2RenderContext( QgsRenderContext& c, QgsSymbolV2::OutputUnit
u , qreal alpha = 1.0, bool selected = false, int renderHints = 0, const Qg
sFeature* f = 0 ); | |
| ~QgsSymbolV2RenderContext(); | | ~QgsSymbolV2RenderContext(); | |
| | | | |
| QgsRenderContext& renderContext() { return mRenderContext; } | | QgsRenderContext& renderContext() { return mRenderContext; } | |
| //void setRenderContext( QgsRenderContext& c ) { mRenderContext = c;} | | //void setRenderContext( QgsRenderContext& c ) { mRenderContext = c;} | |
| | | | |
| QgsSymbolV2::OutputUnit outputUnit() const { return mOutputUnit; } | | QgsSymbolV2::OutputUnit outputUnit() const { return mOutputUnit; } | |
| void setOutputUnit( QgsSymbolV2::OutputUnit u ) { mOutputUnit = u; } | | void setOutputUnit( QgsSymbolV2::OutputUnit u ) { mOutputUnit = u; } | |
| | | | |
|
| | | //! Get alpha transparency 1 for opaque, 0 for invisible | |
| qreal alpha() const { return mAlpha; } | | qreal alpha() const { return mAlpha; } | |
|
| | | //! Set alpha transparency 1 for opaque, 0 for invisible | |
| void setAlpha( qreal alpha ) { mAlpha = alpha; } | | void setAlpha( qreal alpha ) { mAlpha = alpha; } | |
| | | | |
| bool selected() const { return mSelected; } | | bool selected() const { return mSelected; } | |
| void setSelected( bool selected ) { mSelected = selected; } | | void setSelected( bool selected ) { mSelected = selected; } | |
| | | | |
| //! @note added in 1.5 | | //! @note added in 1.5 | |
| int renderHints() const { return mRenderHints; } | | int renderHints() const { return mRenderHints; } | |
| //! @note added in 1.5 | | //! @note added in 1.5 | |
| void setRenderHints( int hints ) { mRenderHints = hints; } | | void setRenderHints( int hints ) { mRenderHints = hints; } | |
| | | | |
|
| | | void setFeature( const QgsFeature* f ) { mFeature = f; } | |
| | | const QgsFeature* feature() const { return mFeature; } | |
| | | | |
| | | void setLayer( const QgsVectorLayer* layer ) { mLayer = layer; } | |
| | | const QgsVectorLayer* layer() const { return mLayer; } | |
| | | | |
| // Color used for selections | | // Color used for selections | |
| static QColor selectionColor(); | | static QColor selectionColor(); | |
| | | | |
| double outputLineWidth( double width ) const; | | double outputLineWidth( double width ) const; | |
| double outputPixelSize( double size ) const; | | double outputPixelSize( double size ) const; | |
| | | | |
| // workaround for sip 4.7. Don't use assignment - will fail with assert
ion error | | // workaround for sip 4.7. Don't use assignment - will fail with assert
ion error | |
| QgsSymbolV2RenderContext& operator=( const QgsSymbolV2RenderContext& ); | | QgsSymbolV2RenderContext& operator=( const QgsSymbolV2RenderContext& ); | |
| | | | |
| private: | | private: | |
| QgsRenderContext& mRenderContext; | | QgsRenderContext& mRenderContext; | |
| QgsSymbolV2::OutputUnit mOutputUnit; | | QgsSymbolV2::OutputUnit mOutputUnit; | |
| qreal mAlpha; | | qreal mAlpha; | |
| bool mSelected; | | bool mSelected; | |
| int mRenderHints; | | int mRenderHints; | |
|
| | | const QgsFeature* mFeature; //current feature | |
| | | const QgsVectorLayer* mLayer; //current vectorlayer | |
| }; | | }; | |
| | | | |
| ////////////////////// | | ////////////////////// | |
| | | | |
| class CORE_EXPORT QgsMarkerSymbolV2 : public QgsSymbolV2 | | class CORE_EXPORT QgsMarkerSymbolV2 : public QgsSymbolV2 | |
| { | | { | |
| public: | | public: | |
| /** Create a marker symbol with one symbol layer: SimpleMarker with spe
cified properties. | | /** Create a marker symbol with one symbol layer: SimpleMarker with spe
cified properties. | |
| This is a convenience method for easier creation of marker symbols. | | This is a convenience method for easier creation of marker symbols. | |
| \note added in v1.7 | | \note added in v1.7 | |
| | | | |
| skipping to change at line 182 | | skipping to change at line 217 | |
| static QgsMarkerSymbolV2* createSimple( const QgsStringMap& properties
); | | static QgsMarkerSymbolV2* createSimple( const QgsStringMap& properties
); | |
| | | | |
| QgsMarkerSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List()
); | | QgsMarkerSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List()
); | |
| | | | |
| void setAngle( double angle ); | | void setAngle( double angle ); | |
| double angle(); | | double angle(); | |
| | | | |
| void setSize( double size ); | | void setSize( double size ); | |
| double size(); | | double size(); | |
| | | | |
|
| void renderPoint( const QPointF& point, QgsRenderContext& context, int
layer = -1, bool selected = false ); | | void renderPoint( const QPointF& point, const QgsFeature* f, QgsRenderC
ontext& context, int layer = -1, bool selected = false ); | |
| | | | |
| virtual QgsSymbolV2* clone() const; | | virtual QgsSymbolV2* clone() const; | |
| }; | | }; | |
| | | | |
| class CORE_EXPORT QgsLineSymbolV2 : public QgsSymbolV2 | | class CORE_EXPORT QgsLineSymbolV2 : public QgsSymbolV2 | |
| { | | { | |
| public: | | public: | |
| /** Create a line symbol with one symbol layer: SimpleLine with specifi
ed properties. | | /** Create a line symbol with one symbol layer: SimpleLine with specifi
ed properties. | |
| This is a convenience method for easier creation of line symbols. | | This is a convenience method for easier creation of line symbols. | |
| \note added in v1.7 | | \note added in v1.7 | |
| */ | | */ | |
| static QgsLineSymbolV2* createSimple( const QgsStringMap& properties ); | | static QgsLineSymbolV2* createSimple( const QgsStringMap& properties ); | |
| | | | |
| QgsLineSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List() )
; | | QgsLineSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List() )
; | |
| | | | |
| void setWidth( double width ); | | void setWidth( double width ); | |
| double width(); | | double width(); | |
| | | | |
|
| void renderPolyline( const QPolygonF& points, QgsRenderContext& context
, int layer = -1, bool selected = false ); | | void renderPolyline( const QPolygonF& points, const QgsFeature* f, QgsR
enderContext& context, int layer = -1, bool selected = false ); | |
| | | | |
| virtual QgsSymbolV2* clone() const; | | virtual QgsSymbolV2* clone() const; | |
| }; | | }; | |
| | | | |
| class CORE_EXPORT QgsFillSymbolV2 : public QgsSymbolV2 | | class CORE_EXPORT QgsFillSymbolV2 : public QgsSymbolV2 | |
| { | | { | |
| public: | | public: | |
| /** Create a fill symbol with one symbol layer: SimpleFill with specifi
ed properties. | | /** Create a fill symbol with one symbol layer: SimpleFill with specifi
ed properties. | |
| This is a convenience method for easier creation of fill symbols. | | This is a convenience method for easier creation of fill symbols. | |
| \note added in v1.7 | | \note added in v1.7 | |
| */ | | */ | |
| static QgsFillSymbolV2* createSimple( const QgsStringMap& properties ); | | static QgsFillSymbolV2* createSimple( const QgsStringMap& properties ); | |
| | | | |
| QgsFillSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List() )
; | | QgsFillSymbolV2( QgsSymbolLayerV2List layers = QgsSymbolLayerV2List() )
; | |
| void setAngle( double angle ); | | void setAngle( double angle ); | |
|
| void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q
gsRenderContext& context, int layer = -1, bool selected = false ); | | void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, c
onst QgsFeature* f, QgsRenderContext& context, int layer = -1, bool selecte
d = false ); | |
| | | | |
| virtual QgsSymbolV2* clone() const; | | virtual QgsSymbolV2* clone() const; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
| | | | |
| QgsSymbolV2* ps = new QgsPointSymbol(); | | QgsSymbolV2* ps = new QgsPointSymbol(); | |
| | | | |
| | | | |
End of changes. 17 change blocks. |
| 6 lines changed or deleted | | 51 lines changed or added | |
|
| qgsvectorfilewriter.h | | qgsvectorfilewriter.h | |
| | | | |
| skipping to change at line 18 | | skipping to change at line 18 | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| | | | |
| #ifndef _QGSVECTORFILEWRITER_H_ | | #ifndef _QGSVECTORFILEWRITER_H_ | |
| #define _QGSVECTORFILEWRITER_H_ | | #define _QGSVECTORFILEWRITER_H_ | |
| | | | |
| #include "qgsvectorlayer.h" | | #include "qgsvectorlayer.h" | |
| #include "qgsfield.h" | | #include "qgsfield.h" | |
| | | | |
| #include <QPair> | | #include <QPair> | |
| | | | |
| typedef void *OGRDataSourceH; | | typedef void *OGRDataSourceH; | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 56 | |
| enum WriterError | | enum WriterError | |
| { | | { | |
| NoError = 0, | | NoError = 0, | |
| ErrDriverNotFound, | | ErrDriverNotFound, | |
| ErrCreateDataSource, | | ErrCreateDataSource, | |
| ErrCreateLayer, | | ErrCreateLayer, | |
| ErrAttributeTypeUnsupported, | | ErrAttributeTypeUnsupported, | |
| ErrAttributeCreationFailed, | | ErrAttributeCreationFailed, | |
| ErrProjection, // added in 1.5 | | ErrProjection, // added in 1.5 | |
| ErrFeatureWriteFailed, // added in 1.6 | | ErrFeatureWriteFailed, // added in 1.6 | |
|
| | | ErrInvalidLayer, // added in 2.0 | |
| }; | | }; | |
| | | | |
| /** Write contents of vector layer to a shapefile | | /** Write contents of vector layer to a shapefile | |
| @deprecated Use writeAsVectorFormat instead*/ | | @deprecated Use writeAsVectorFormat instead*/ | |
| Q_DECL_DEPRECATED static WriterError writeAsShapefile( QgsVectorLayer*
layer, | | Q_DECL_DEPRECATED static WriterError writeAsShapefile( QgsVectorLayer*
layer, | |
| const QString& shapefileName, | | const QString& shapefileName, | |
| const QString& fileEncoding, | | const QString& fileEncoding, | |
| const QgsCoordinateReferenceSystem *destCRS, | | const QgsCoordinateReferenceSystem *destCRS, | |
| bool onlySelected = false, | | bool onlySelected = false, | |
| QString *errorMessage = 0, | | QString *errorMessage = 0, | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 82 | |
| @note: this method was added in version 1.5*/ | | @note: this method was added in version 1.5*/ | |
| static WriterError writeAsVectorFormat( QgsVectorLayer* layer, | | static WriterError writeAsVectorFormat( QgsVectorLayer* layer, | |
| const QString& fileName, | | const QString& fileName, | |
| const QString& fileEncoding, | | const QString& fileEncoding, | |
| const QgsCoordinateReferenceSys
tem *destCRS, | | const QgsCoordinateReferenceSys
tem *destCRS, | |
| const QString& driverName = "ES
RI Shapefile", | | const QString& driverName = "ES
RI Shapefile", | |
| bool onlySelected = false, | | bool onlySelected = false, | |
| QString *errorMessage = 0, | | QString *errorMessage = 0, | |
| const QStringList &datasourceOp
tions = QStringList(), // added in 1.6 | | const QStringList &datasourceOp
tions = QStringList(), // added in 1.6 | |
| const QStringList &layerOptions
= QStringList(), // added in 1.6 | | const QStringList &layerOptions
= QStringList(), // added in 1.6 | |
|
| bool skipAttributeCreation = fa | | bool skipAttributeCreation = fa | |
| lse // added in 1.6 | | lse, // added in 1.6 | |
| | | QString *newFilename = 0 // add | |
| | | ed in 1.9 | |
| ); | | ); | |
| | | | |
| /** create shapefile and initialize it */ | | /** create shapefile and initialize it */ | |
| QgsVectorFileWriter( const QString& vectorFileName, | | QgsVectorFileWriter( const QString& vectorFileName, | |
| const QString& fileEncoding, | | const QString& fileEncoding, | |
| const QgsFieldMap& fields, | | const QgsFieldMap& fields, | |
| QGis::WkbType geometryType, | | QGis::WkbType geometryType, | |
| const QgsCoordinateReferenceSystem* srs, | | const QgsCoordinateReferenceSystem* srs, | |
| const QString& driverName = "ESRI Shapefile", | | const QString& driverName = "ESRI Shapefile", | |
| const QStringList &datasourceOptions = QStringList
(), // added in 1.6 | | const QStringList &datasourceOptions = QStringList
(), // added in 1.6 | |
|
| const QStringList &layerOptions = QStringList() // | | const QStringList &layerOptions = QStringList(), / | |
| added in 1.6 | | / added in 1.6 | |
| | | QString *newFilename = 0 // added in 1.9 | |
| ); | | ); | |
| | | | |
| /**Returns map with format filter string as key and OGR format key as v
alue*/ | | /**Returns map with format filter string as key and OGR format key as v
alue*/ | |
| static QMap< QString, QString> supportedFiltersAndFormats(); | | static QMap< QString, QString> supportedFiltersAndFormats(); | |
| | | | |
| /**Returns driver list that can be used for dialogs*/ | | /**Returns driver list that can be used for dialogs*/ | |
| static QMap< QString, QString> ogrDriverList(); | | static QMap< QString, QString> ogrDriverList(); | |
| | | | |
| /**Returns filter string that can be used for dialogs*/ | | /**Returns filter string that can be used for dialogs*/ | |
| static QString fileFilterString(); | | static QString fileFilterString(); | |
| | | | |
| skipping to change at line 119 | | skipping to change at line 121 | |
| WriterError hasError(); | | WriterError hasError(); | |
| | | | |
| /** retrieves error message | | /** retrieves error message | |
| * @note added in 1.5 | | * @note added in 1.5 | |
| */ | | */ | |
| QString errorMessage(); | | QString errorMessage(); | |
| | | | |
| /** add feature to the currently opened shapefile */ | | /** add feature to the currently opened shapefile */ | |
| bool addFeature( QgsFeature& feature ); | | bool addFeature( QgsFeature& feature ); | |
| | | | |
|
| | | QMap<int, int> attrIdxToOgrIdx() { return mAttrIdxToOgrIdx; } | |
| | | | |
| /** close opened shapefile for writing */ | | /** close opened shapefile for writing */ | |
| ~QgsVectorFileWriter(); | | ~QgsVectorFileWriter(); | |
| | | | |
| /** Delete a shapefile (and its accompanying shx / dbf / prf) | | /** Delete a shapefile (and its accompanying shx / dbf / prf) | |
| * @param theFileName /path/to/file.shp | | * @param theFileName /path/to/file.shp | |
| * @return bool true if the file was deleted successfully | | * @return bool true if the file was deleted successfully | |
| */ | | */ | |
| static bool deleteShapeFile( QString theFileName ); | | static bool deleteShapeFile( QString theFileName ); | |
| | | | |
| protected: | | protected: | |
| | | | |
End of changes. 5 change blocks. |
| 5 lines changed or deleted | | 10 lines changed or added | |
|
| qgsvectorlayer.h | | qgsvectorlayer.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
| | | | |
| /**************************************************************************
* | | /**************************************************************************
* | |
| *
* | | *
* | |
| * This program is free software; you can redistribute it and/or modify
* | | * This program is free software; you can redistribute it and/or modify
* | |
| * it under the terms of the GNU General Public License as published by
* | | * it under the terms of the GNU General Public License as published by
* | |
| * the Free Software Foundation; either version 2 of the License, or
* | | * the Free Software Foundation; either version 2 of the License, or
* | |
| * (at your option) any later version.
* | | * (at your option) any later version.
* | |
| *
* | | *
* | |
| **************************************************************************
*/ | | **************************************************************************
*/ | |
|
| /* $Id$ */ | | | |
| | | | |
| #ifndef QGSVECTORLAYER_H | | #ifndef QGSVECTORLAYER_H | |
| #define QGSVECTORLAYER_H | | #define QGSVECTORLAYER_H | |
| | | | |
| #include <QMap> | | #include <QMap> | |
| #include <QSet> | | #include <QSet> | |
| #include <QList> | | #include <QList> | |
| #include <QStringList> | | #include <QStringList> | |
| | | | |
| #include "qgis.h" | | #include "qgis.h" | |
| | | | |
| skipping to change at line 55 | | skipping to change at line 54 | |
| class QgsVectorDataProvider; | | class QgsVectorDataProvider; | |
| class QgsVectorOverlay; | | class QgsVectorOverlay; | |
| class QgsSingleSymbolRendererV2; | | class QgsSingleSymbolRendererV2; | |
| class QgsRectangle; | | class QgsRectangle; | |
| class QgsVectorLayerJoinBuffer; | | class QgsVectorLayerJoinBuffer; | |
| class QgsFeatureRendererV2; | | class QgsFeatureRendererV2; | |
| class QgsDiagramRendererV2; | | class QgsDiagramRendererV2; | |
| struct QgsDiagramLayerSettings; | | struct QgsDiagramLayerSettings; | |
| | | | |
| typedef QList<int> QgsAttributeList; | | typedef QList<int> QgsAttributeList; | |
|
| typedef QSet<int> QgsFeatureIds; | | | |
| typedef QSet<int> QgsAttributeIds; | | typedef QSet<int> QgsAttributeIds; | |
| | | | |
| /** @note added in 1.7 */ | | /** @note added in 1.7 */ | |
| struct CORE_EXPORT QgsVectorJoinInfo | | struct CORE_EXPORT QgsVectorJoinInfo | |
| { | | { | |
| /**Join field in the target layer*/ | | /**Join field in the target layer*/ | |
| int targetField; | | int targetField; | |
| /**Source layer*/ | | /**Source layer*/ | |
| QString joinLayerId; | | QString joinLayerId; | |
| /**Join field in the source layer*/ | | /**Join field in the source layer*/ | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 99 | |
| public: | | public: | |
| enum EditType | | enum EditType | |
| { | | { | |
| LineEdit, | | LineEdit, | |
| UniqueValues, | | UniqueValues, | |
| UniqueValuesEditable, | | UniqueValuesEditable, | |
| ValueMap, | | ValueMap, | |
| Classification, | | Classification, | |
| EditRange, | | EditRange, | |
| SliderRange, | | SliderRange, | |
|
| CheckBox, /* added in 1.4 */ | | CheckBox, /* added in 1.4 */ | |
| FileName, | | FileName, | |
| Enumeration, | | Enumeration, | |
|
| Immutable, /* The attribute value should not be changed in the attr | | Immutable, /* The attribute value should not be changed in the at | |
| ibute form*/ | | tribute form*/ | |
| Hidden, /* The attribute value should not be shown in the attrib | | Hidden, /* The attribute value should not be shown in the attr | |
| ute form @added in 1.4 */ | | ibute form @added in 1.4 */ | |
| TextEdit, /* multiline edit @added in 1.4*/ | | TextEdit, /* multiline edit @added in 1.4*/ | |
| Calendar, /* calendar widget @added in 1.5 */ | | Calendar, /* calendar widget @added in 1.5 */ | |
| DialRange, /* dial range @added in 1.5 */ | | DialRange, /* dial range @added in 1.5 */ | |
| | | ValueRelation, /* value map from an table @added in 1.8 */ | |
| | | UuidGenerator, /* uuid generator - readonly and automatically intiali | |
| | | zed @added in 1.9 */ | |
| }; | | }; | |
| | | | |
| struct RangeData | | struct RangeData | |
| { | | { | |
| RangeData() {} | | RangeData() {} | |
| RangeData( QVariant theMin, QVariant theMax, QVariant theStep ) | | RangeData( QVariant theMin, QVariant theMax, QVariant theStep ) | |
| : mMin( theMin ), mMax( theMax ), mStep( theStep ) {} | | : mMin( theMin ), mMax( theMax ), mStep( theStep ) {} | |
| | | | |
| QVariant mMin; | | QVariant mMin; | |
| QVariant mMax; | | QVariant mMax; | |
| QVariant mStep; | | QVariant mStep; | |
| }; | | }; | |
| | | | |
|
| | | struct ValueRelationData | |
| | | { | |
| | | ValueRelationData() {} | |
| | | ValueRelationData( QString layer, QString key, QString value, bool al | |
| | | lowNull, bool orderByValue ) | |
| | | : mLayer( layer ), mKey( key ), mValue( value ), mAllowNull( allo | |
| | | wNull ), mOrderByValue( orderByValue ) {} | |
| | | | |
| | | QString mLayer; | |
| | | QString mKey; | |
| | | QString mValue; | |
| | | bool mAllowNull; | |
| | | bool mOrderByValue; | |
| | | }; | |
| | | | |
| /** Constructor */ | | /** Constructor */ | |
| QgsVectorLayer( QString path = QString::null, QString baseName = QStrin
g::null, | | QgsVectorLayer( QString path = QString::null, QString baseName = QStrin
g::null, | |
| QString providerLib = QString::null, bool loadDefaultSt
yleFlag = true ); | | QString providerLib = QString::null, bool loadDefaultSt
yleFlag = true ); | |
| | | | |
| /** Destructor */ | | /** Destructor */ | |
| virtual ~QgsVectorLayer(); | | virtual ~QgsVectorLayer(); | |
| | | | |
| /** Returns the permanent storage type for this layer as a friendly nam
e. */ | | /** Returns the permanent storage type for this layer as a friendly nam
e. */ | |
| QString storageType() const; | | QString storageType() const; | |
| | | | |
| | | | |
| skipping to change at line 260 | | skipping to change at line 273 | |
| | | | |
| /**Returns the WKBType or WKBUnknown in case of error*/ | | /**Returns the WKBType or WKBUnknown in case of error*/ | |
| QGis::WkbType wkbType() const; | | QGis::WkbType wkbType() const; | |
| | | | |
| /** Return the provider type for this layer */ | | /** Return the provider type for this layer */ | |
| QString providerType() const; | | QString providerType() const; | |
| | | | |
| /** reads vector layer specific state from project file Dom node. | | /** reads vector layer specific state from project file Dom node. | |
| * @note Called by QgsMapLayer::readXML(). | | * @note Called by QgsMapLayer::readXML(). | |
| */ | | */ | |
|
| virtual bool readXml( QDomNode & layer_node ); | | virtual bool readXml( const QDomNode& layer_node ); | |
| | | | |
| /** write vector layer specific state to project file Dom node. | | /** write vector layer specific state to project file Dom node. | |
| * @note Called by QgsMapLayer::writeXML(). | | * @note Called by QgsMapLayer::writeXML(). | |
| */ | | */ | |
| virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc ); | | virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc ); | |
| | | | |
| /** Read the symbology for the current layer from the Dom node supplied
. | | /** Read the symbology for the current layer from the Dom node supplied
. | |
| * @param node node that will contain the symbology definition for this
layer. | | * @param node node that will contain the symbology definition for this
layer. | |
| * @param errorMessage reference to string that will be updated with any
error messages | | * @param errorMessage reference to string that will be updated with any
error messages | |
| * @return true in case of success. | | * @return true in case of success. | |
| | | | |
| skipping to change at line 282 | | skipping to change at line 295 | |
| bool readSymbology( const QDomNode& node, QString& errorMessage ); | | bool readSymbology( const QDomNode& node, QString& errorMessage ); | |
| | | | |
| /** Write the symbology for the layer into the docment provided. | | /** Write the symbology for the layer into the docment provided. | |
| * @param node the node that will have the style element added to it. | | * @param node the node that will have the style element added to it. | |
| * @param doc the document that will have the QDomNode added. | | * @param doc the document that will have the QDomNode added. | |
| * @param errorMessage reference to string that will be updated with a
ny error messages | | * @param errorMessage reference to string that will be updated with a
ny error messages | |
| * @return true in case of success. | | * @return true in case of success. | |
| */ | | */ | |
| bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorM
essage ) const; | | bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorM
essage ) const; | |
| | | | |
|
| | | bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage | |
| | | ) const; | |
| | | bool readSld( const QDomNode& node, QString& errorMessage ); | |
| | | | |
| /** | | /** | |
| * Number of features in the layer. This is necessary if features are | | * Number of features in the layer. This is necessary if features are | |
| * added/deleted or the layer has been subsetted. If the data provider | | * added/deleted or the layer has been subsetted. If the data provider | |
| * chooses not to support this feature, the total number of features | | * chooses not to support this feature, the total number of features | |
| * can be returned. | | * can be returned. | |
| * @return long containing number of features | | * @return long containing number of features | |
| */ | | */ | |
| virtual long featureCount() const; | | virtual long featureCount() const; | |
| | | | |
| /** This function does nothing useful, it's kept only for compatibility
. | | /** This function does nothing useful, it's kept only for compatibility
. | |
| | | | |
| skipping to change at line 332 | | skipping to change at line 348 | |
| | | | |
| /** | | /** | |
| * fetch a feature (after select) | | * fetch a feature (after select) | |
| * @param feature buffer to read the feature into | | * @param feature buffer to read the feature into | |
| * @return true, if a feature was fetched, false, if there are no more
features | | * @return true, if a feature was fetched, false, if there are no more
features | |
| */ | | */ | |
| bool nextFeature( QgsFeature& feature ); | | bool nextFeature( QgsFeature& feature ); | |
| | | | |
| /**Gets the feature at the given feature id. Considers the changed, add
ed, deleted and permanent features | | /**Gets the feature at the given feature id. Considers the changed, add
ed, deleted and permanent features | |
| @return true in case of success*/ | | @return true in case of success*/ | |
|
| bool featureAtId( int featureId, QgsFeature &f, bool fetchGeometries =
true, bool fetchAttributes = true ); | | bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeom
etries = true, bool fetchAttributes = true ); | |
| | | | |
| /** Adds a feature | | /** Adds a feature | |
| @param f feature to add | | @param f feature to add | |
| @param alsoUpdateExtent If True, will also go to the effort of e.g.
updating the extents. | | @param alsoUpdateExtent If True, will also go to the effort of e.g.
updating the extents. | |
| @return True in case of success and False in cas
e of error | | @return True in case of success and False in cas
e of error | |
| */ | | */ | |
| bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true ); | | bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true ); | |
| | | | |
|
| | | /** Updates an existing feature | |
| | | @param f feature to update | |
| | | @return True in case of success and False in cas | |
| | | e of error | |
| | | @note added in 1.8 | |
| | | */ | |
| | | bool updateFeature( QgsFeature &f ); | |
| | | | |
| /** Insert a new vertex before the given vertex number, | | /** Insert a new vertex before the given vertex number, | |
| * in the given ring, item (first number is index 0), and feature | | * in the given ring, item (first number is index 0), and feature | |
| * Not meaningful for Point geometries | | * Not meaningful for Point geometries | |
| */ | | */ | |
|
| bool insertVertex( double x, double y, int atFeatureId, int beforeVerte
x ); | | bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int be
foreVertex ); | |
| | | | |
| /** Moves the vertex at the given position number, | | /** Moves the vertex at the given position number, | |
| * ring and item (first number is index 0), and feature | | * ring and item (first number is index 0), and feature | |
| * to the given coordinates | | * to the given coordinates | |
| */ | | */ | |
|
| bool moveVertex( double x, double y, int atFeatureId, int atVertex ); | | bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVe
rtex ); | |
| | | | |
| /** Deletes a vertex from a feature | | /** Deletes a vertex from a feature | |
| */ | | */ | |
|
| bool deleteVertex( int atFeatureId, int atVertex ); | | bool deleteVertex( QgsFeatureId atFeatureId, int atVertex ); | |
| | | | |
| /** Deletes the selected features | | /** Deletes the selected features | |
| * @return true in case of success and false otherwise | | * @return true in case of success and false otherwise | |
| */ | | */ | |
| bool deleteSelectedFeatures(); | | bool deleteSelectedFeatures(); | |
| | | | |
| /**Adds a ring to polygon/multipolygon features | | /**Adds a ring to polygon/multipolygon features | |
| @return | | @return | |
| 0 in case of success, | | 0 in case of success, | |
| 1 problem with feature type, | | 1 problem with feature type, | |
| 2 ring not closed, | | 2 ring not closed, | |
| 3 ring not valid, | | 3 ring not valid, | |
| 4 ring crosses existing rings, | | 4 ring crosses existing rings, | |
| 5 no feature found where ring can be inserted*/ | | 5 no feature found where ring can be inserted*/ | |
| int addRing( const QList<QgsPoint>& ring ); | | int addRing( const QList<QgsPoint>& ring ); | |
| | | | |
|
| /**Adds a new island polygon to a multipolygon feature | | /**Adds a new part polygon to a multipart feature | |
| @return | | @return | |
| 0 in case of success, | | 0 in case of success, | |
|
| 1 if selected feature is not multipolygon, | | 1 if selected feature is not multipart, | |
| 2 if ring is not a valid geometry, | | 2 if ring is not a valid geometry, | |
| 3 if new polygon ring not disjoint with existing rings, | | 3 if new polygon ring not disjoint with existing rings, | |
| 4 if no feature was selected, | | 4 if no feature was selected, | |
| 5 if several features are selected, | | 5 if several features are selected, | |
| 6 if selected geometry not found*/ | | 6 if selected geometry not found*/ | |
|
| int addIsland( const QList<QgsPoint>& ring ); | | int addPart( const QList<QgsPoint>& ring ); | |
| | | Q_DECL_DEPRECATED int addIsland( const QList<QgsPoint>& ring ) { return | |
| | | addPart( ring ); } | |
| | | | |
| /**Translates feature by dx, dy | | /**Translates feature by dx, dy | |
| @param featureId id of the feature to translate | | @param featureId id of the feature to translate | |
| @param dx translation of x-coordinate | | @param dx translation of x-coordinate | |
| @param dy translation of y-coordinate | | @param dy translation of y-coordinate | |
| @return 0 in case of success*/ | | @return 0 in case of success*/ | |
|
| int translateFeature( int featureId, double dx, double dy ); | | int translateFeature( QgsFeatureId featureId, double dx, double dy ); | |
| | | | |
| /**Splits features cut by the given line | | /**Splits features cut by the given line | |
| @param splitLine line that splits the layer features | | @param splitLine line that splits the layer features | |
| @param topologicalEditing true if topological editing is enabled | | @param topologicalEditing true if topological editing is enabled | |
| @return 0 in case of success, 4 if there is a selection but no featu
re split*/ | | @return 0 in case of success, 4 if there is a selection but no featu
re split*/ | |
| int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEd
iting = false ); | | int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEd
iting = false ); | |
| | | | |
| /**Changes the specified geometry such that it has no intersections wit
h other | | /**Changes the specified geometry such that it has no intersections wit
h other | |
| polygon (or multipolygon) geometries in this vector layer | | polygon (or multipolygon) geometries in this vector layer | |
| @param geom geometry to modify | | @param geom geometry to modify | |
| | | | |
| skipping to change at line 456 | | skipping to change at line 480 | |
| | | | |
| /**Snaps to segment or vertex within given tolerance | | /**Snaps to segment or vertex within given tolerance | |
| @param startPoint point to snap (in layer coordinates) | | @param startPoint point to snap (in layer coordinates) | |
| @param snappingTolerance distance tolerance for snapping | | @param snappingTolerance distance tolerance for snapping | |
| @param snappingResults snapping results. Key is the distance between
startPoint and snapping target | | @param snappingResults snapping results. Key is the distance between
startPoint and snapping target | |
| @param snap_to to segment / to vertex | | @param snap_to to segment / to vertex | |
| @return 0 in case of success | | @return 0 in case of success | |
| */ | | */ | |
| int snapWithContext( const QgsPoint& startPoint, | | int snapWithContext( const QgsPoint& startPoint, | |
| double snappingTolerance, | | double snappingTolerance, | |
|
| QMultiMap < double, | | QMultiMap < double, QgsSnappingResult > &snappingR | |
| QgsSnappingResult > & snappingResults, | | esults, | |
| QgsSnapper::SnappingType snap_to ); | | QgsSnapper::SnappingType snap_to ); | |
| | | | |
| /**Synchronises with changes in the datasource | | /**Synchronises with changes in the datasource | |
| @note added in version 1.6*/ | | @note added in version 1.6*/ | |
| virtual void reload(); | | virtual void reload(); | |
| | | | |
| /** Draws the layer | | /** Draws the layer | |
| * @return false if an error occurred during drawing | | * @return false if an error occurred during drawing | |
| */ | | */ | |
| bool draw( QgsRenderContext& rendererContext ); | | bool draw( QgsRenderContext& rendererContext ); | |
| | | | |
| skipping to change at line 495 | | skipping to change at line 518 | |
| bool setReadOnly( bool readonly = true ); | | bool setReadOnly( bool readonly = true ); | |
| | | | |
| /** Sets whether some features are modified or not */ | | /** Sets whether some features are modified or not */ | |
| void setModified( bool modified = true, bool onlyGeometryWasModified =
false ); | | void setModified( bool modified = true, bool onlyGeometryWasModified =
false ); | |
| | | | |
| /** Make layer editable */ | | /** Make layer editable */ | |
| bool startEditing(); | | bool startEditing(); | |
| | | | |
| /** change feature's geometry | | /** change feature's geometry | |
| @note added in version 1.2 */ | | @note added in version 1.2 */ | |
|
| bool changeGeometry( int fid, QgsGeometry* geom ); | | bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom ); | |
| | | | |
| /** changed an attribute value (but does not commit it) */ | | /** changed an attribute value (but does not commit it) */ | |
|
| bool changeAttributeValue( int fid, int field, QVariant value, bool emi
tSignal = true ); | | bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value,
bool emitSignal = true ); | |
| | | | |
| /** add an attribute field (but does not commit it) | | /** add an attribute field (but does not commit it) | |
| returns true if the field was added | | returns true if the field was added | |
| @note added in version 1.2 */ | | @note added in version 1.2 */ | |
| bool addAttribute( const QgsField &field ); | | bool addAttribute( const QgsField &field ); | |
| | | | |
| /** add an attribute field (but does not commit it) | | /** add an attribute field (but does not commit it) | |
| returns true if the field was added | | returns true if the field was added | |
| @deprecated */ | | @deprecated */ | |
| Q_DECL_DEPRECATED bool addAttribute( QString name, QString type ); | | Q_DECL_DEPRECATED bool addAttribute( QString name, QString type ); | |
| | | | |
| skipping to change at line 529 | | skipping to change at line 552 | |
| @note added in version 1.2*/ | | @note added in version 1.2*/ | |
| QString attributeDisplayName( int attributeIndex ) const; | | QString attributeDisplayName( int attributeIndex ) const; | |
| | | | |
| /** delete an attribute field (but does not commit it) */ | | /** delete an attribute field (but does not commit it) */ | |
| bool deleteAttribute( int attr ); | | bool deleteAttribute( int attr ); | |
| | | | |
| /** Insert a copy of the given features into the layer (but does not c
ommit it) */ | | /** Insert a copy of the given features into the layer (but does not c
ommit it) */ | |
| bool addFeatures( QgsFeatureList features, bool makeSelected = true ); | | bool addFeatures( QgsFeatureList features, bool makeSelected = true ); | |
| | | | |
| /** delete a feature from the layer (but does not commit it) */ | | /** delete a feature from the layer (but does not commit it) */ | |
|
| bool deleteFeature( int fid ); | | bool deleteFeature( QgsFeatureId fid ); | |
| | | | |
| /** | | /** | |
| Attempts to commit any changes to disk. Returns the result of the at
tempt. | | Attempts to commit any changes to disk. Returns the result of the at
tempt. | |
| If a commit fails, the in-memory changes are left alone. | | If a commit fails, the in-memory changes are left alone. | |
| | | | |
| This allows editing to continue if the commit failed on e.g. a | | This allows editing to continue if the commit failed on e.g. a | |
| disallowed value in a Postgres database - the user can re-edit and tr
y | | disallowed value in a Postgres database - the user can re-edit and tr
y | |
| again. | | again. | |
| | | | |
| The commits occur in distinct stages, | | The commits occur in distinct stages, | |
| | | | |
| skipping to change at line 588 | | skipping to change at line 611 | |
| | | | |
| /** set python function for edit form initialization (added in 1.4) */ | | /** set python function for edit form initialization (added in 1.4) */ | |
| void setEditFormInit( QString function ); | | void setEditFormInit( QString function ); | |
| | | | |
| /**access value map*/ | | /**access value map*/ | |
| QMap<QString, QVariant> &valueMap( int idx ); | | QMap<QString, QVariant> &valueMap( int idx ); | |
| | | | |
| /**access range */ | | /**access range */ | |
| RangeData &range( int idx ); | | RangeData &range( int idx ); | |
| | | | |
|
| | | /**access relations | |
| | | * @note added in 1.8 | |
| | | **/ | |
| | | ValueRelationData &valueRelation( int idx ); | |
| | | | |
| /**Adds a new overlay to this class. QgsVectorLayer takes ownership of
the object | | /**Adds a new overlay to this class. QgsVectorLayer takes ownership of
the object | |
| @note this method was added in version 1.1 | | @note this method was added in version 1.1 | |
| */ | | */ | |
| void addOverlay( QgsVectorOverlay* overlay ); | | void addOverlay( QgsVectorOverlay* overlay ); | |
| | | | |
| /**Removes all overlays of a given type | | /**Removes all overlays of a given type | |
| @note this method was added in version 1.1 | | @note this method was added in version 1.1 | |
| */ | | */ | |
| void removeOverlay( const QString& typeName ); | | void removeOverlay( const QString& typeName ); | |
| | | | |
| | | | |
| skipping to change at line 669 | | skipping to change at line 697 | |
| /**Returns minimum value for an attribute column or invalid variant in
case of error | | /**Returns minimum value for an attribute column or invalid variant in
case of error | |
| @note added in 1.7*/ | | @note added in 1.7*/ | |
| QVariant minimumValue( int index ); | | QVariant minimumValue( int index ); | |
| | | | |
| /**Returns maximum value for an attribute column or invalid variant in
case of error | | /**Returns maximum value for an attribute column or invalid variant in
case of error | |
| @note added in 1.7*/ | | @note added in 1.7*/ | |
| QVariant maximumValue( int index ); | | QVariant maximumValue( int index ); | |
| | | | |
| public slots: | | public slots: | |
| /** Select feature by its ID, optionally emit signal selectionChanged()
*/ | | /** Select feature by its ID, optionally emit signal selectionChanged()
*/ | |
|
| void select( int featureId, bool emitSignal = true ); | | void select( QgsFeatureId featureId, bool emitSignal = true ); | |
| | | | |
| /** Deselect feature by its ID, optionally emit signal selectionChanged
() */ | | /** Deselect feature by its ID, optionally emit signal selectionChanged
() */ | |
|
| void deselect( int featureId, bool emitSignal = true ); | | void deselect( QgsFeatureId featureId, bool emitSignal = true ); | |
| | | | |
| /** Clear selection */ | | /** Clear selection */ | |
| void removeSelection( bool emitSignal = true ); | | void removeSelection( bool emitSignal = true ); | |
| | | | |
| void triggerRepaint(); | | void triggerRepaint(); | |
| | | | |
| /** Update the extents for the layer. This is necessary if features are | | /** Update the extents for the layer. This is necessary if features are | |
| * added/deleted or the layer has been subsetted. | | * added/deleted or the layer has been subsetted. | |
| */ | | */ | |
| virtual void updateExtents(); | | virtual void updateExtents(); | |
| | | | |
| /** Check if there is a join with a layer that will be removed | | /** Check if there is a join with a layer that will be removed | |
| @note added in 1.7 */ | | @note added in 1.7 */ | |
| void checkJoinLayerRemove( QString theLayerId ); | | void checkJoinLayerRemove( QString theLayerId ); | |
| | | | |
|
| | | QString metadata(); | |
| | | | |
| signals: | | signals: | |
| | | | |
| /** This signal is emited when selection was changed */ | | /** This signal is emited when selection was changed */ | |
| void selectionChanged(); | | void selectionChanged(); | |
| | | | |
| /** This signal is emitted when modifications has been done on layer */ | | /** This signal is emitted when modifications has been done on layer */ | |
| void layerModified( bool onlyGeometry ); | | void layerModified( bool onlyGeometry ); | |
| | | | |
| void editingStarted(); | | void editingStarted(); | |
| void editingStopped(); | | void editingStopped(); | |
| void attributeAdded( int idx ); | | void attributeAdded( int idx ); | |
| void attributeDeleted( int idx ); | | void attributeDeleted( int idx ); | |
|
| void featureAdded( int fid ); // added in 1.7 | | void featureAdded( QgsFeatureId fid ); // added in 1.7 | |
| void featureDeleted( int fid ); | | void featureDeleted( QgsFeatureId fid ); | |
| void layerDeleted(); | | void layerDeleted(); | |
| | | | |
|
| void attributeValueChanged( int fid, int idx, const QVariant & ); | | void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & | |
| | | ); | |
| | | void geometryChanged( QgsFeatureId fid, QgsGeometry &geom ); // added i | |
| | | n 1.9 | |
| | | | |
| /** Signals emitted after committing changes | | /** Signals emitted after committing changes | |
| \note added in v1.6 */ | | \note added in v1.6 */ | |
| void committedAttributesDeleted( const QString& layerId, const QgsAttri
buteIds& deletedAttributeIds ); | | void committedAttributesDeleted( const QString& layerId, const QgsAttri
buteIds& deletedAttributeIds ); | |
| void committedAttributesAdded( const QString& layerId, const QList<QgsF
ield>& addedAttributes ); | | void committedAttributesAdded( const QString& layerId, const QList<QgsF
ield>& addedAttributes ); | |
| void committedFeaturesAdded( const QString& layerId, const QgsFeatureLi
st& addedFeatures ); | | void committedFeaturesAdded( const QString& layerId, const QgsFeatureLi
st& addedFeatures ); | |
| void committedFeaturesRemoved( const QString& layerId, const QgsFeature
Ids& deletedFeatureIds ); | | void committedFeaturesRemoved( const QString& layerId, const QgsFeature
Ids& deletedFeatureIds ); | |
| void committedAttributeValuesChanges( const QString& layerId, const Qgs
ChangedAttributesMap& changedAttributesValues ); | | void committedAttributeValuesChanges( const QString& layerId, const Qgs
ChangedAttributesMap& changedAttributesValues ); | |
| void committedGeometriesChanges( const QString& layerId, const QgsGeome
tryMap& changedGeometries ); | | void committedGeometriesChanges( const QString& layerId, const QgsGeome
tryMap& changedGeometries ); | |
| | | | |
| | | | |
| skipping to change at line 752 | | skipping to change at line 783 | |
| * to the byte after the end of the line string binary data stream (WKB
). | | * to the byte after the end of the line string binary data stream (WKB
). | |
| */ | | */ | |
| unsigned char *drawLineString( unsigned char *WKBlinestring, QgsRenderC
ontext &renderContext ); | | unsigned char *drawLineString( unsigned char *WKBlinestring, QgsRenderC
ontext &renderContext ); | |
| | | | |
| /** Draw the polygon as given in the WKB format. Returns a pointer to | | /** Draw the polygon as given in the WKB format. Returns a pointer to | |
| * the byte after the end of the polygon binary data stream (WKB). | | * the byte after the end of the polygon binary data stream (WKB). | |
| */ | | */ | |
| unsigned char *drawPolygon( unsigned char *WKBpolygon, QgsRenderContext
&renderContext ); | | unsigned char *drawPolygon( unsigned char *WKBpolygon, QgsRenderContext
&renderContext ); | |
| | | | |
| /** Goes through all features and finds a free id (e.g. to give it temp
orarily to a not-commited feature) */ | | /** Goes through all features and finds a free id (e.g. to give it temp
orarily to a not-commited feature) */ | |
|
| int findFreeId(); | | QgsFeatureId findFreeId(); | |
| | | | |
| /**Deletes the geometries in mCachedGeometries*/ | | /**Deletes the geometries in mCachedGeometries*/ | |
| void deleteCachedGeometries(); | | void deleteCachedGeometries(); | |
| | | | |
| /**Snaps to a geometry and adds the result to the multimap if it is wit
hin the snapping result | | /**Snaps to a geometry and adds the result to the multimap if it is wit
hin the snapping result | |
| @param startPoint start point of the snap | | @param startPoint start point of the snap | |
| @param featureId id of feature | | @param featureId id of feature | |
| @param geom geometry to snap | | @param geom geometry to snap | |
| @param sqrSnappingTolerance squared search tolerance of the snap | | @param sqrSnappingTolerance squared search tolerance of the snap | |
| @param snappingResults list to which the result is appended | | @param snappingResults list to which the result is appended | |
| @param snap_to snap to vertex or to segment | | @param snap_to snap to vertex or to segment | |
| */ | | */ | |
|
| void snapToGeometry( const QgsPoint& startPoint, int featureId, QgsGeom | | void snapToGeometry( const QgsPoint& startPoint, | |
| etry* geom, double sqrSnappingTolerance, | | QgsFeatureId featureId, | |
| QMultiMap<double, QgsSnappingResult>& snappingResu | | QgsGeometry* geom, | |
| lts, QgsSnapper::SnappingType snap_to ) const; | | double sqrSnappingTolerance, | |
| | | QMultiMap<double, QgsSnappingResult>& snappingResu | |
| | | lts, | |
| | | QgsSnapper::SnappingType snap_to ) const; | |
| | | | |
| /**Little helper function that gives bounding box from a list of points
. | | /**Little helper function that gives bounding box from a list of points
. | |
| @return 0 in case of success*/ | | @return 0 in case of success*/ | |
| int boundingBoxFromPointList( const QList<QgsPoint>& list, double& xmin
, double& ymin, double& xmax, double& ymax ) const; | | int boundingBoxFromPointList( const QList<QgsPoint>& list, double& xmin
, double& ymin, double& xmax, double& ymax ) const; | |
| | | | |
| /**Reads vertex marker type from settings*/ | | /**Reads vertex marker type from settings*/ | |
| static QgsVectorLayer::VertexMarkerType currentVertexMarkerType(); | | static QgsVectorLayer::VertexMarkerType currentVertexMarkerType(); | |
| | | | |
| /**Reads vertex marker size from settings*/ | | /**Reads vertex marker size from settings*/ | |
| static int currentVertexMarkerSize(); | | static int currentVertexMarkerSize(); | |
| | | | |
| skipping to change at line 795 | | skipping to change at line 830 | |
| @param joinValue lookup value for join | | @param joinValue lookup value for join | |
| @param attributes (join layer) attribute indices to add | | @param attributes (join layer) attribute indices to add | |
| @param attributeIndexOffset index offset to get from join layer attri
bute index to layer index*/ | | @param attributeIndexOffset index offset to get from join layer attri
bute index to layer index*/ | |
| void addJoinedFeatureAttributes( QgsFeature& f, const QgsVectorJoinInfo
& joinInfo, const QString& joinFieldName, const QVariant& joinValue, | | void addJoinedFeatureAttributes( QgsFeature& f, const QgsVectorJoinInfo
& joinInfo, const QString& joinFieldName, const QVariant& joinValue, | |
| const QgsAttributeList& attributes, in
t attributeIndexOffset ); | | const QgsAttributeList& attributes, in
t attributeIndexOffset ); | |
| | | | |
| /**Update feature with uncommited geometry updates*/ | | /**Update feature with uncommited geometry updates*/ | |
| void updateFeatureGeometry( QgsFeature &f ); | | void updateFeatureGeometry( QgsFeature &f ); | |
| | | | |
| /** Record changed geometry, store in active command (if any) */ | | /** Record changed geometry, store in active command (if any) */ | |
|
| void editGeometryChange( int featureId, QgsGeometry& geometry ); | | void editGeometryChange( QgsFeatureId featureId, QgsGeometry& geometry
); | |
| | | | |
| /** Record added feature, store in active command (if any) */ | | /** Record added feature, store in active command (if any) */ | |
| void editFeatureAdd( QgsFeature& feature ); | | void editFeatureAdd( QgsFeature& feature ); | |
| | | | |
| /** Record deleted feature, store in active command (if any) */ | | /** Record deleted feature, store in active command (if any) */ | |
|
| void editFeatureDelete( int featureId ); | | void editFeatureDelete( QgsFeatureId featureId ); | |
| | | | |
| /** Record changed attribute, store in active command (if any) */ | | /** Record changed attribute, store in active command (if any) */ | |
|
| void editAttributeChange( int featureId, int field, QVariant value ); | | void editAttributeChange( QgsFeatureId featureId, int field, QVariant v
alue ); | |
| | | | |
| /** Stop version 2 renderer and selected renderer (if required) */ | | /** Stop version 2 renderer and selected renderer (if required) */ | |
| void stopRendererV2( QgsRenderContext& rendererContext, QgsSingleSymbol
RendererV2* selRenderer ); | | void stopRendererV2( QgsRenderContext& rendererContext, QgsSingleSymbol
RendererV2* selRenderer ); | |
| | | | |
| /**Updates an index in an attribute map to a new value (usually necessa
ry because of a join operation)*/ | | /**Updates an index in an attribute map to a new value (usually necessa
ry because of a join operation)*/ | |
| void updateAttributeMapIndex( QgsAttributeMap& map, int oldIndex, int n
ewIndex ) const; | | void updateAttributeMapIndex( QgsAttributeMap& map, int oldIndex, int n
ewIndex ) const; | |
| | | | |
| /**Registers label and diagram layer | | /**Registers label and diagram layer | |
| @param rendererContext render context | | @param rendererContext render context | |
| @param attributes attributes needed for labeling and diagrams will be
added to the list | | @param attributes attributes needed for labeling and diagrams will be
added to the list | |
| | | | |
| skipping to change at line 928 | | skipping to change at line 963 | |
| | | | |
| /**List of overlays. Vector overlays will be rendered on top of all map
layers*/ | | /**List of overlays. Vector overlays will be rendered on top of all map
layers*/ | |
| QList<QgsVectorOverlay*> mOverlays; | | QList<QgsVectorOverlay*> mOverlays; | |
| | | | |
| QStringList mCommitErrors; | | QStringList mCommitErrors; | |
| | | | |
| QMap< QString, EditType > mEditTypes; | | QMap< QString, EditType > mEditTypes; | |
| QMap< QString, QMap<QString, QVariant> > mValueMaps; | | QMap< QString, QMap<QString, QVariant> > mValueMaps; | |
| QMap< QString, RangeData > mRanges; | | QMap< QString, RangeData > mRanges; | |
| QMap< QString, QPair<QString, QString> > mCheckedStates; | | QMap< QString, QPair<QString, QString> > mCheckedStates; | |
|
| | | QMap< QString, ValueRelationData > mValueRelations; | |
| | | | |
| QString mEditForm, mEditFormInit; | | QString mEditForm, mEditFormInit; | |
| //annotation form for this layer | | //annotation form for this layer | |
| QString mAnnotationForm; | | QString mAnnotationForm; | |
| | | | |
| bool mFetching; | | bool mFetching; | |
| QgsRectangle mFetchRect; | | QgsRectangle mFetchRect; | |
| QgsAttributeList mFetchAttributes; | | QgsAttributeList mFetchAttributes; | |
| QgsAttributeList mFetchProvAttributes; | | QgsAttributeList mFetchProvAttributes; | |
| bool mFetchGeometry; | | bool mFetchGeometry; | |
| | | | |
|
| QSet<int> mFetchConsidered; | | QSet<QgsFeatureId> mFetchConsidered; | |
| QgsGeometryMap::iterator mFetchChangedGeomIt; | | QgsGeometryMap::iterator mFetchChangedGeomIt; | |
| QgsFeatureList::iterator mFetchAddedFeaturesIt; | | QgsFeatureList::iterator mFetchAddedFeaturesIt; | |
| | | | |
| //stores information about joined layers | | //stores information about joined layers | |
| QgsVectorLayerJoinBuffer* mJoinBuffer; | | QgsVectorLayerJoinBuffer* mJoinBuffer; | |
| | | | |
| //diagram rendering object. 0 if diagram drawing is disabled | | //diagram rendering object. 0 if diagram drawing is disabled | |
| QgsDiagramRendererV2* mDiagramRenderer; | | QgsDiagramRendererV2* mDiagramRenderer; | |
| | | | |
| //stores infos about diagram placement (placement type, priority, posit
ion distance) | | //stores infos about diagram placement (placement type, priority, posit
ion distance) | |
| | | | |
End of changes. 33 change blocks. |
| 38 lines changed or deleted | | 82 lines changed or added | |
|
| ui_qgsprojectionselectorbase.h | | ui_qgsprojectionselectorbase.h | |
| /**************************************************************************
****** | | /**************************************************************************
****** | |
| ** Form generated from reading UI file 'qgsprojectionselectorbase.ui' | | ** Form generated from reading UI file 'qgsprojectionselectorbase.ui' | |
| ** | | ** | |
|
| ** Created: Wed Jun 13 13:27:00 2012 | | ** Created: Wed Jun 13 12:06:00 2012 | |
| ** by: Qt User Interface Compiler version 4.7.4 | | ** by: Qt User Interface Compiler version 4.7.4 | |
| ** | | ** | |
| ** WARNING! All changes made in this file will be lost when recompiling UI
file! | | ** WARNING! All changes made in this file will be lost when recompiling UI
file! | |
| ***************************************************************************
*****/ | | ***************************************************************************
*****/ | |
| | | | |
| #ifndef UI_QGSPROJECTIONSELECTORBASE_H | | #ifndef UI_QGSPROJECTIONSELECTORBASE_H | |
| #define UI_QGSPROJECTIONSELECTORBASE_H | | #define UI_QGSPROJECTIONSELECTORBASE_H | |
| | | | |
| #include <QtCore/QVariant> | | #include <QtCore/QVariant> | |
| #include <QtGui/QAction> | | #include <QtGui/QAction> | |
| #include <QtGui/QApplication> | | #include <QtGui/QApplication> | |
| #include <QtGui/QButtonGroup> | | #include <QtGui/QButtonGroup> | |
| #include <QtGui/QCheckBox> | | #include <QtGui/QCheckBox> | |
|
| #include <QtGui/QComboBox> | | | |
| #include <QtGui/QGridLayout> | | #include <QtGui/QGridLayout> | |
|
| #include <QtGui/QGroupBox> | | | |
| #include <QtGui/QHBoxLayout> | | #include <QtGui/QHBoxLayout> | |
| #include <QtGui/QHeaderView> | | #include <QtGui/QHeaderView> | |
| #include <QtGui/QLabel> | | #include <QtGui/QLabel> | |
| #include <QtGui/QLineEdit> | | #include <QtGui/QLineEdit> | |
|
| #include <QtGui/QPushButton> | | | |
| #include <QtGui/QSpacerItem> | | #include <QtGui/QSpacerItem> | |
|
| | | #include <QtGui/QSplitter> | |
| #include <QtGui/QTextEdit> | | #include <QtGui/QTextEdit> | |
| #include <QtGui/QTreeWidget> | | #include <QtGui/QTreeWidget> | |
|
| #include <QtGui/QVBoxLayout> | | | |
| #include <QtGui/QWidget> | | #include <QtGui/QWidget> | |
| | | | |
| QT_BEGIN_NAMESPACE | | QT_BEGIN_NAMESPACE | |
| | | | |
| class Ui_QgsProjectionSelectorBase | | class Ui_QgsProjectionSelectorBase | |
| { | | { | |
| public: | | public: | |
|
| QGridLayout *gridLayout; | | QGridLayout *gridLayout_2; | |
| QTextEdit *teProjection; | | | |
| QTreeWidget *lstCoordinateSystems; | | | |
| QGroupBox *groupBox; | | | |
| QVBoxLayout *verticalLayout; | | | |
| QHBoxLayout *horizontalLayout_2; | | | |
| QLabel *label; | | | |
| QComboBox *cbxAuthority; | | | |
| QLabel *label_2; | | | |
| QComboBox *cbxMode; | | | |
| QSpacerItem *horizontalSpacer; | | | |
| QCheckBox *cbxHideDeprecated; | | | |
| QHBoxLayout *horizontalLayout; | | QHBoxLayout *horizontalLayout; | |
|
| | | QLabel *label_5; | |
| QLineEdit *leSearch; | | QLineEdit *leSearch; | |
|
| QPushButton *pbnFind; | | | |
| QLabel *label_3; | | QLabel *label_3; | |
|
| | | QSplitter *splitter; | |
| QTreeWidget *lstRecent; | | QTreeWidget *lstRecent; | |
|
| | | QWidget *layoutWidget; | |
| | | QGridLayout *gridLayout; | |
| | | QHBoxLayout *horizontalLayout_3; | |
| | | QLabel *label_4; | |
| | | QSpacerItem *horizontalSpacer_2; | |
| | | QCheckBox *cbxHideDeprecated; | |
| | | QTreeWidget *lstCoordinateSystems; | |
| | | QTextEdit *teProjection; | |
| | | | |
| void setupUi(QWidget *QgsProjectionSelectorBase) | | void setupUi(QWidget *QgsProjectionSelectorBase) | |
| { | | { | |
| if (QgsProjectionSelectorBase->objectName().isEmpty()) | | if (QgsProjectionSelectorBase->objectName().isEmpty()) | |
| QgsProjectionSelectorBase->setObjectName(QString::fromUtf8("Qgs
ProjectionSelectorBase")); | | QgsProjectionSelectorBase->setObjectName(QString::fromUtf8("Qgs
ProjectionSelectorBase")); | |
|
| QgsProjectionSelectorBase->resize(590, 358); | | QgsProjectionSelectorBase->resize(574, 390); | |
| QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferr
ed); | | QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferr
ed); | |
| sizePolicy.setHorizontalStretch(0); | | sizePolicy.setHorizontalStretch(0); | |
| sizePolicy.setVerticalStretch(0); | | sizePolicy.setVerticalStretch(0); | |
| sizePolicy.setHeightForWidth(QgsProjectionSelectorBase->sizePolicy(
).hasHeightForWidth()); | | sizePolicy.setHeightForWidth(QgsProjectionSelectorBase->sizePolicy(
).hasHeightForWidth()); | |
| QgsProjectionSelectorBase->setSizePolicy(sizePolicy); | | QgsProjectionSelectorBase->setSizePolicy(sizePolicy); | |
| QIcon icon; | | QIcon icon; | |
| icon.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon::
Off); | | icon.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon::
Off); | |
| QgsProjectionSelectorBase->setWindowIcon(icon); | | QgsProjectionSelectorBase->setWindowIcon(icon); | |
|
| gridLayout = new QGridLayout(QgsProjectionSelectorBase); | | gridLayout_2 = new QGridLayout(QgsProjectionSelectorBase); | |
| gridLayout->setSpacing(6); | | gridLayout_2->setSpacing(6); | |
| gridLayout->setContentsMargins(3, 3, 3, 3); | | gridLayout_2->setContentsMargins(11, 11, 11, 11); | |
| gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | | gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); | |
| gridLayout->setVerticalSpacing(3); | | horizontalLayout = new QHBoxLayout(); | |
| teProjection = new QTextEdit(QgsProjectionSelectorBase); | | horizontalLayout->setSpacing(6); | |
| teProjection->setObjectName(QString::fromUtf8("teProjection")); | | horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout | |
| QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Minimu | | ")); | |
| m); | | label_5 = new QLabel(QgsProjectionSelectorBase); | |
| sizePolicy1.setHorizontalStretch(0); | | label_5->setObjectName(QString::fromUtf8("label_5")); | |
| sizePolicy1.setVerticalStretch(0); | | | |
| sizePolicy1.setHeightForWidth(teProjection->sizePolicy().hasHeightF | | | |
| orWidth()); | | | |
| teProjection->setSizePolicy(sizePolicy1); | | | |
| teProjection->setMinimumSize(QSize(0, 30)); | | | |
| teProjection->setMaximumSize(QSize(16777215, 50)); | | | |
| teProjection->setBaseSize(QSize(0, 50)); | | | |
| teProjection->setAutoFormatting(QTextEdit::AutoBulletList); | | | |
| teProjection->setReadOnly(true); | | | |
| | | | |
| gridLayout->addWidget(teProjection, 1, 0, 1, 1); | | | |
| | | | |
| lstCoordinateSystems = new QTreeWidget(QgsProjectionSelectorBase); | | | |
| lstCoordinateSystems->setObjectName(QString::fromUtf8("lstCoordinat | | | |
| eSystems")); | | | |
| lstCoordinateSystems->setAlternatingRowColors(true); | | | |
| lstCoordinateSystems->setUniformRowHeights(true); | | | |
| lstCoordinateSystems->setColumnCount(3); | | | |
| | | | |
| gridLayout->addWidget(lstCoordinateSystems, 0, 0, 1, 1); | | | |
| | | | |
|
| groupBox = new QGroupBox(QgsProjectionSelectorBase); | | horizontalLayout->addWidget(label_5); | |
| groupBox->setObjectName(QString::fromUtf8("groupBox")); | | | |
| QSizePolicy sizePolicy2(QSizePolicy::MinimumExpanding, QSizePolicy: | | | |
| :Minimum); | | | |
| sizePolicy2.setHorizontalStretch(0); | | | |
| sizePolicy2.setVerticalStretch(0); | | | |
| sizePolicy2.setHeightForWidth(groupBox->sizePolicy().hasHeightForWi | | | |
| dth()); | | | |
| groupBox->setSizePolicy(sizePolicy2); | | | |
| verticalLayout = new QVBoxLayout(groupBox); | | | |
| verticalLayout->setSpacing(6); | | | |
| verticalLayout->setContentsMargins(11, 11, 11, 11); | | | |
| verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); | | | |
| horizontalLayout_2 = new QHBoxLayout(); | | | |
| horizontalLayout_2->setSpacing(6); | | | |
| horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayo | | | |
| ut_2")); | | | |
| label = new QLabel(groupBox); | | | |
| label->setObjectName(QString::fromUtf8("label")); | | | |
| | | | |
|
| horizontalLayout_2->addWidget(label); | | leSearch = new QLineEdit(QgsProjectionSelectorBase); | |
| | | leSearch->setObjectName(QString::fromUtf8("leSearch")); | |
| | | | |
|
| cbxAuthority = new QComboBox(groupBox); | | horizontalLayout->addWidget(leSearch); | |
| cbxAuthority->setObjectName(QString::fromUtf8("cbxAuthority")); | | | |
| | | | |
|
| horizontalLayout_2->addWidget(cbxAuthority); | | gridLayout_2->addLayout(horizontalLayout, 0, 0, 1, 1); | |
| | | | |
|
| label_2 = new QLabel(groupBox); | | label_3 = new QLabel(QgsProjectionSelectorBase); | |
| label_2->setObjectName(QString::fromUtf8("label_2")); | | label_3->setObjectName(QString::fromUtf8("label_3")); | |
| | | QFont font; | |
| | | font.setBold(true); | |
| | | font.setWeight(75); | |
| | | label_3->setFont(font); | |
| | | | |
|
| horizontalLayout_2->addWidget(label_2); | | gridLayout_2->addWidget(label_3, 1, 0, 1, 1); | |
| | | | |
|
| cbxMode = new QComboBox(groupBox); | | splitter = new QSplitter(QgsProjectionSelectorBase); | |
| cbxMode->setObjectName(QString::fromUtf8("cbxMode")); | | splitter->setObjectName(QString::fromUtf8("splitter")); | |
| | | splitter->setOrientation(Qt::Vertical); | |
| | | splitter->setChildrenCollapsible(true); | |
| | | lstRecent = new QTreeWidget(splitter); | |
| | | lstRecent->setObjectName(QString::fromUtf8("lstRecent")); | |
| | | QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Minimu | |
| | | mExpanding); | |
| | | sizePolicy1.setHorizontalStretch(0); | |
| | | sizePolicy1.setVerticalStretch(0); | |
| | | sizePolicy1.setHeightForWidth(lstRecent->sizePolicy().hasHeightForW | |
| | | idth()); | |
| | | lstRecent->setSizePolicy(sizePolicy1); | |
| | | lstRecent->setMinimumSize(QSize(0, 105)); | |
| | | lstRecent->setMaximumSize(QSize(16777215, 200)); | |
| | | lstRecent->setAlternatingRowColors(true); | |
| | | lstRecent->setRootIsDecorated(false); | |
| | | lstRecent->setUniformRowHeights(true); | |
| | | lstRecent->setColumnCount(3); | |
| | | splitter->addWidget(lstRecent); | |
| | | layoutWidget = new QWidget(splitter); | |
| | | layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); | |
| | | gridLayout = new QGridLayout(layoutWidget); | |
| | | gridLayout->setSpacing(6); | |
| | | gridLayout->setContentsMargins(11, 11, 11, 11); | |
| | | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | |
| | | gridLayout->setHorizontalSpacing(0); | |
| | | gridLayout->setContentsMargins(0, 0, 0, 0); | |
| | | horizontalLayout_3 = new QHBoxLayout(); | |
| | | horizontalLayout_3->setSpacing(6); | |
| | | horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayo | |
| | | ut_3")); | |
| | | horizontalLayout_3->setContentsMargins(-1, 0, -1, -1); | |
| | | label_4 = new QLabel(layoutWidget); | |
| | | label_4->setObjectName(QString::fromUtf8("label_4")); | |
| | | label_4->setFont(font); | |
| | | | |
|
| horizontalLayout_2->addWidget(cbxMode); | | horizontalLayout_3->addWidget(label_4); | |
| | | | |
|
| horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding,
QSizePolicy::Minimum); | | horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding
, QSizePolicy::Minimum); | |
| | | | |
|
| horizontalLayout_2->addItem(horizontalSpacer); | | horizontalLayout_3->addItem(horizontalSpacer_2); | |
| | | | |
|
| cbxHideDeprecated = new QCheckBox(groupBox); | | cbxHideDeprecated = new QCheckBox(layoutWidget); | |
| cbxHideDeprecated->setObjectName(QString::fromUtf8("cbxHideDeprecat
ed")); | | cbxHideDeprecated->setObjectName(QString::fromUtf8("cbxHideDeprecat
ed")); | |
|
| | | QFont font1; | |
| | | font1.setPointSize(9); | |
| | | cbxHideDeprecated->setFont(font1); | |
| | | | |
|
| horizontalLayout_2->addWidget(cbxHideDeprecated); | | horizontalLayout_3->addWidget(cbxHideDeprecated); | |
| | | | |
| verticalLayout->addLayout(horizontalLayout_2); | | | |
| | | | |
| horizontalLayout = new QHBoxLayout(); | | | |
| horizontalLayout->setSpacing(6); | | | |
| horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout | | | |
| ")); | | | |
| leSearch = new QLineEdit(groupBox); | | | |
| leSearch->setObjectName(QString::fromUtf8("leSearch")); | | | |
| | | | |
| horizontalLayout->addWidget(leSearch); | | | |
| | | | |
| pbnFind = new QPushButton(groupBox); | | | |
| pbnFind->setObjectName(QString::fromUtf8("pbnFind")); | | | |
| pbnFind->setMaximumSize(QSize(100, 16777215)); | | | |
| pbnFind->setDefault(true); | | | |
| | | | |
|
| horizontalLayout->addWidget(pbnFind); | | gridLayout->addLayout(horizontalLayout_3, 0, 0, 1, 1); | |
| | | | |
|
| verticalLayout->addLayout(horizontalLayout); | | lstCoordinateSystems = new QTreeWidget(layoutWidget); | |
| | | lstCoordinateSystems->setObjectName(QString::fromUtf8("lstCoordinat | |
| | | eSystems")); | |
| | | lstCoordinateSystems->setAlternatingRowColors(true); | |
| | | lstCoordinateSystems->setUniformRowHeights(true); | |
| | | lstCoordinateSystems->setColumnCount(3); | |
| | | | |
|
| gridLayout->addWidget(groupBox, 2, 0, 1, 1); | | gridLayout->addWidget(lstCoordinateSystems, 1, 0, 1, 1); | |
| | | | |
|
| label_3 = new QLabel(QgsProjectionSelectorBase); | | splitter->addWidget(layoutWidget); | |
| label_3->setObjectName(QString::fromUtf8("label_3")); | | | |
| | | | |
|
| gridLayout->addWidget(label_3, 3, 0, 1, 1); | | gridLayout_2->addWidget(splitter, 2, 0, 1, 1); | |
| | | | |
|
| lstRecent = new QTreeWidget(QgsProjectionSelectorBase); | | teProjection = new QTextEdit(QgsProjectionSelectorBase); | |
| lstRecent->setObjectName(QString::fromUtf8("lstRecent")); | | teProjection->setObjectName(QString::fromUtf8("teProjection")); | |
| QSizePolicy sizePolicy3(QSizePolicy::Expanding, QSizePolicy::Fixed) | | teProjection->setMinimumSize(QSize(0, 40)); | |
| ; | | teProjection->setMaximumSize(QSize(16777215, 90)); | |
| sizePolicy3.setHorizontalStretch(0); | | teProjection->setBaseSize(QSize(0, 40)); | |
| sizePolicy3.setVerticalStretch(0); | | teProjection->setAutoFormatting(QTextEdit::AutoBulletList); | |
| sizePolicy3.setHeightForWidth(lstRecent->sizePolicy().hasHeightForW | | teProjection->setReadOnly(true); | |
| idth()); | | | |
| lstRecent->setSizePolicy(sizePolicy3); | | | |
| lstRecent->setMinimumSize(QSize(0, 105)); | | | |
| lstRecent->setMaximumSize(QSize(16777215, 105)); | | | |
| lstRecent->setAlternatingRowColors(true); | | | |
| lstRecent->setRootIsDecorated(false); | | | |
| lstRecent->setUniformRowHeights(true); | | | |
| lstRecent->setColumnCount(3); | | | |
| | | | |
|
| gridLayout->addWidget(lstRecent, 4, 0, 1, 1); | | gridLayout_2->addWidget(teProjection, 3, 0, 1, 1); | |
| | | | |
| QWidget::setTabOrder(lstCoordinateSystems, teProjection); | | QWidget::setTabOrder(lstCoordinateSystems, teProjection); | |
|
| QWidget::setTabOrder(teProjection, cbxAuthority); | | QWidget::setTabOrder(teProjection, leSearch); | |
| QWidget::setTabOrder(cbxAuthority, cbxMode); | | | |
| QWidget::setTabOrder(cbxMode, cbxHideDeprecated); | | | |
| QWidget::setTabOrder(cbxHideDeprecated, leSearch); | | | |
| QWidget::setTabOrder(leSearch, pbnFind); | | | |
| QWidget::setTabOrder(pbnFind, lstRecent); | | | |
| | | | |
| retranslateUi(QgsProjectionSelectorBase); | | retranslateUi(QgsProjectionSelectorBase); | |
| | | | |
| QMetaObject::connectSlotsByName(QgsProjectionSelectorBase); | | QMetaObject::connectSlotsByName(QgsProjectionSelectorBase); | |
| } // setupUi | | } // setupUi | |
| | | | |
| void retranslateUi(QWidget *QgsProjectionSelectorBase) | | void retranslateUi(QWidget *QgsProjectionSelectorBase) | |
| { | | { | |
| QgsProjectionSelectorBase->setWindowTitle(QApplication::translate("
QgsProjectionSelectorBase", "Coordinate Reference System Selector", 0, QApp
lication::UnicodeUTF8)); | | QgsProjectionSelectorBase->setWindowTitle(QApplication::translate("
QgsProjectionSelectorBase", "Coordinate Reference System Selector", 0, QApp
lication::UnicodeUTF8)); | |
|
| QTreeWidgetItem *___qtreewidgetitem = lstCoordinateSystems->headerI | | label_5->setText(QApplication::translate("QgsProjectionSelectorBase | |
| tem(); | | ", "Filter", 0, QApplication::UnicodeUTF8)); | |
| | | label_3->setText(QApplication::translate("QgsProjectionSelectorBase | |
| | | ", "Recently used coordinate reference systems", 0, QApplication::UnicodeUT | |
| | | F8)); | |
| | | QTreeWidgetItem *___qtreewidgetitem = lstRecent->headerItem(); | |
| ___qtreewidgetitem->setText(2, QApplication::translate("QgsProjecti
onSelectorBase", "ID", 0, QApplication::UnicodeUTF8)); | | ___qtreewidgetitem->setText(2, QApplication::translate("QgsProjecti
onSelectorBase", "ID", 0, QApplication::UnicodeUTF8)); | |
| ___qtreewidgetitem->setText(1, QApplication::translate("QgsProjecti
onSelectorBase", "Authority ID", 0, QApplication::UnicodeUTF8)); | | ___qtreewidgetitem->setText(1, QApplication::translate("QgsProjecti
onSelectorBase", "Authority ID", 0, QApplication::UnicodeUTF8)); | |
| ___qtreewidgetitem->setText(0, QApplication::translate("QgsProjecti
onSelectorBase", "Coordinate Reference System", 0, QApplication::UnicodeUTF
8)); | | ___qtreewidgetitem->setText(0, QApplication::translate("QgsProjecti
onSelectorBase", "Coordinate Reference System", 0, QApplication::UnicodeUTF
8)); | |
|
| groupBox->setTitle(QApplication::translate("QgsProjectionSelectorBa | | label_4->setText(QApplication::translate("QgsProjectionSelectorBase | |
| se", "Search", 0, QApplication::UnicodeUTF8)); | | ", "Coordinate reference systems of the world", 0, QApplication::UnicodeUTF | |
| label->setText(QApplication::translate("QgsProjectionSelectorBase", | | 8)); | |
| "Authority", 0, QApplication::UnicodeUTF8)); | | | |
| label_2->setText(QApplication::translate("QgsProjectionSelectorBase | | | |
| ", "Search for", 0, QApplication::UnicodeUTF8)); | | | |
| cbxMode->clear(); | | | |
| cbxMode->insertItems(0, QStringList() | | | |
| << QApplication::translate("QgsProjectionSelectorBase", "ID", 0, Q | | | |
| Application::UnicodeUTF8) | | | |
| << QApplication::translate("QgsProjectionSelectorBase", "Name", 0, | | | |
| QApplication::UnicodeUTF8) | | | |
| ); | | | |
| cbxHideDeprecated->setText(QApplication::translate("QgsProjectionSe
lectorBase", "Hide deprecated CRSs", 0, QApplication::UnicodeUTF8)); | | cbxHideDeprecated->setText(QApplication::translate("QgsProjectionSe
lectorBase", "Hide deprecated CRSs", 0, QApplication::UnicodeUTF8)); | |
|
| pbnFind->setText(QApplication::translate("QgsProjectionSelectorBase | | QTreeWidgetItem *___qtreewidgetitem1 = lstCoordinateSystems->header | |
| ", "Find", 0, QApplication::UnicodeUTF8)); | | Item(); | |
| label_3->setText(QApplication::translate("QgsProjectionSelectorBase | | | |
| ", "Recently used coordinate references systems", 0, QApplication::UnicodeU | | | |
| TF8)); | | | |
| QTreeWidgetItem *___qtreewidgetitem1 = lstRecent->headerItem(); | | | |
| ___qtreewidgetitem1->setText(2, QApplication::translate("QgsProject
ionSelectorBase", "ID", 0, QApplication::UnicodeUTF8)); | | ___qtreewidgetitem1->setText(2, QApplication::translate("QgsProject
ionSelectorBase", "ID", 0, QApplication::UnicodeUTF8)); | |
| ___qtreewidgetitem1->setText(1, QApplication::translate("QgsProject
ionSelectorBase", "Authority ID", 0, QApplication::UnicodeUTF8)); | | ___qtreewidgetitem1->setText(1, QApplication::translate("QgsProject
ionSelectorBase", "Authority ID", 0, QApplication::UnicodeUTF8)); | |
| ___qtreewidgetitem1->setText(0, QApplication::translate("QgsProject
ionSelectorBase", "Coordinate Reference System", 0, QApplication::UnicodeUT
F8)); | | ___qtreewidgetitem1->setText(0, QApplication::translate("QgsProject
ionSelectorBase", "Coordinate Reference System", 0, QApplication::UnicodeUT
F8)); | |
| } // retranslateUi | | } // retranslateUi | |
| | | | |
| }; | | }; | |
| | | | |
| namespace Ui { | | namespace Ui { | |
| class QgsProjectionSelectorBase: public Ui_QgsProjectionSelectorBase {}
; | | class QgsProjectionSelectorBase: public Ui_QgsProjectionSelectorBase {}
; | |
| } // namespace Ui | | } // namespace Ui | |
| | | | |
End of changes. 37 change blocks. |
| 147 lines changed or deleted | | 110 lines changed or added | |
|