[sipify] Another batch of sip

This commit is contained in:
Matthias Kuhn 2017-05-14 09:48:41 +02:00
parent 922b162b86
commit 2abb1465c4
57 changed files with 3484 additions and 1573 deletions

View File

@ -1,49 +1,9 @@
core/conversions.sip
core/qgsexception.sip
core/qgis.sip
core/qgsdataitemprovider.sip
core/qgsdataitemproviderregistry.sip
core/qgsdbfilterproxymodel.sip
core/qgseditformconfig.sip
core/qgseditorwidgetsetup.sip
core/qgserror.sip
core/qgsexpressioncontext.sip
core/qgsexpressioncontextgenerator.sip
core/qgsfeaturerequest.sip
core/qgsgeometrysimplifier.sip
core/qgsgeometryvalidator.sip
core/qgsmaptopixelgeometrysimplifier.sip
core/qgstransactiongroup.sip
core/qgsdartmeasurement.sip
core/qgsexpressionfieldbuffer.sip
core/qgsfontutils.sip
core/qgslabelsearchtree.sip
core/qgslegendrenderer.sip
core/qgslegendsettings.sip
core/qgslogger.sip
core/qgsmaphittest.sip
core/qgsmaplayerdependency.sip
core/qgsmaplayerlegend.sip
core/qgsmaplayerrenderer.sip
core/qgsmaplayerstylemanager.sip
core/qgsmaprenderercache.sip
core/qgsmaprenderercustompainterjob.sip
core/qgsmaprendererjob.sip
core/qgsmaprendererparalleljob.sip
core/qgsmaprenderersequentialjob.sip
core/qgsmapsettings.sip
core/qgsmaptopixel.sip
core/qgsmapunitscale.sip
core/qgsmargins.sip
core/qgsmessageoutput.sip
core/qgsmimedatautils.sip
core/qgsmultirenderchecker.sip
core/qgsnetworkaccessmanager.sip
core/qgsnetworkcontentfetcher.sip
core/qgsobjectcustomproperties.sip
core/qgsogcutils.sip
core/qgsoptionalexpression.sip
core/qgsowsconnection.sip
core/qgspaintenginehack.sip
core/qgspainting.sip
core/qgspallabeling.sip

View File

@ -1,7 +1,19 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsdartmeasurement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsDartMeasurement
{
%TypeHeaderCode
#include <qgsdartmeasurement.h>
#include "qgsdartmeasurement.h"
%End
public:
enum Type
@ -16,8 +28,23 @@ class QgsDartMeasurement
QgsDartMeasurement( const QString &name, Type type, const QString &value );
const QString toString() const;
%Docstring
:rtype: str
%End
void send() const;
static const QString typeToString( QgsDartMeasurement::Type type );
%Docstring
:rtype: str
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsdartmeasurement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,20 +1,60 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsdataitemprovider.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsDataItemProvider
{
%Docstring
This is the interface for those who want to add custom data items to the browser tree.
The method createDataItem() is ever called only if capabilities() return non-zero value.
There are two occasions when createDataItem() is called:
1. to create root items (passed path is empty, parent item is null).
2. to create items in directory structure. For this capabilities have to return at least
of the following: QgsDataProider.Dir or QgsDataProvider.File. Passed path is the file
or directory being inspected, parent item is a valid QgsDirectoryItem
.. versionadded:: 2.10
%End
%TypeHeaderCode
#include <qgsdataitemprovider.h>
#include "qgsdataitemprovider.h"
%End
public:
virtual ~QgsDataItemProvider();
//! Human-readable name of the provider name
virtual QString name() = 0;
%Docstring
Human-readable name of the provider name
:rtype: str
%End
//! Return combination of flags from QgsDataProvider::DataCapabilities
virtual int capabilities() = 0;
%Docstring
Return combination of flags from QgsDataProvider.DataCapabilities
:rtype: int
%End
//! Create a new instance of QgsDataItem (or null) for given path and parent item.
//! Caller takes responsibility of deleting created items.
virtual QgsDataItem *createDataItem( const QString &path, QgsDataItem *parentItem ) = 0 /Factory/;
%Docstring
Caller takes responsibility of deleting created items.
:rtype: QgsDataItem
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsdataitemprovider.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,30 +1,59 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsdataitemproviderregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/**
* This singleton class keeps a list of data item providers that may add items to the browser tree.
* When created, it automatically adds providers from provider plugins (e.g. PostGIS, WMS, ...)
*
* @note added in 2.10
*/
class QgsDataItemProviderRegistry
{
%Docstring
This class keeps a list of data item providers that may add items to the browser tree.
When created, it automatically adds providers from provider plugins (e.g. PostGIS, WMS, ...)
QgsDataItemProviderRegistry is not usually directly created, but rather accessed through
QgsApplication.dataItemProviderRegistry().
.. versionadded:: 2.10
%End
%TypeHeaderCode
#include <qgsdataitemproviderregistry.h>
#include "qgsdataitemproviderregistry.h"
%End
public:
QgsDataItemProviderRegistry();
~QgsDataItemProviderRegistry();
//! Get list of available providers
QList<QgsDataItemProvider*> providers() const;
//! Add a provider implementation. Takes ownership of the object.
QList<QgsDataItemProvider *> providers() const;
%Docstring
Get list of available providers
:rtype: list of QgsDataItemProvider
%End
void addProvider( QgsDataItemProvider *provider /Transfer/ );
%Docstring
Add a provider implementation. Takes ownership of the object.
%End
//! Remove provider implementation from the list (provider object is deleted)
void removeProvider( QgsDataItemProvider *provider );
private:
QgsDataItemProviderRegistry( const QgsDataItemProviderRegistry &rh );
%Docstring
Remove provider implementation from the list (provider object is deleted)
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsdataitemproviderregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,16 +1,51 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsdbfilterproxymodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsDatabaseFilterProxyModel: QSortFilterProxyModel
{
%Docstring
A class that implements a custom filter and can be used
as a proxy for QgsDbTableModel
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include <qgsdbfilterproxymodel.h>
#include "qgsdbfilterproxymodel.h"
%End
public:
QgsDatabaseFilterProxyModel( QObject *parent /TransferThis/ = 0 );
~QgsDatabaseFilterProxyModel();
/** Calls QSortFilterProxyModel::setFilterWildcard and triggers update*/
%Docstring
Constructor for QgsDatabaseFilterProxyModel.
%End
void _setFilterWildcard( const QString &pattern );
/** Calls QSortFilterProxyModel::setFilterRegExp and triggers update*/
%Docstring
Calls QSortFilterProxyModel.setFilterWildcard and triggers update
%End
void _setFilterRegExp( const QString &pattern );
%Docstring
Calls QSortFilterProxyModel.setFilterRegExp and triggers update
%End
protected:
virtual bool filterAcceptsRow( int row, const QModelIndex &source_parent ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsdbfilterproxymodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,33 +1,29 @@
/***************************************************************************
qgseditformconfig.sip
-------------------
begin : Nov 18, 2015
copyright : (C) 2015 by Matthias Kuhn
email : matthias at opengis dot ch
***************************************************************************/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgseditformconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
class QgsEditFormConfig
{
%TypeHeaderCode
#include <qgseditformconfig.h>
%End
%TypeHeaderCode
#include "qgseditformconfig.h"
%End
public:
/** The different types to layout the attribute editor. */
enum EditorLayout
{
GeneratedLayout = 0, //!< Autogenerate a simple tabular layout for the form
TabLayout = 1, //!< Use a layout with tabs and group boxes. Needs to be configured.
UiFileLayout = 2 //!< Load a .ui file for the layout. Needs to be configured.
GeneratedLayout,
TabLayout,
UiFileLayout
};
struct GroupData
@ -47,166 +43,254 @@ class QgsEditFormConfig
QList<QgsEditFormConfig::GroupData> mGroups;
};
/**
* Types of feature form suppression after feature creation
*/
enum FeatureFormSuppress
{
SuppressDefault = 0, //!< Use the application-wide setting
SuppressOn = 1, //!< Suppress feature form
SuppressOff = 2 //!< Do not suppress feature form
SuppressDefault,
SuppressOn,
SuppressOff
};
/**
* The python init code source options.
*/
enum PythonInitCodeSource
{
CodeSourceNone, //!< Do not use python code at all
CodeSourceFile, //!< Load the python code from an external file
CodeSourceDialog, //!< Use the python code provided in the dialog
CodeSourceEnvironment //!< Use the python code available in the python environment
CodeSourceNone,
CodeSourceFile,
CodeSourceDialog,
CodeSourceEnvironment
};
/**
* This is only useful in combination with EditorLayout::TabLayout.
*
* Adds a new tab to the layout. Should be a QgsAttributeEditorContainer.
*/
QgsEditFormConfig( const QgsEditFormConfig &o );
%Docstring
Copy constructor
.. versionadded:: 3.0
%End
~QgsEditFormConfig();
bool operator==( const QgsEditFormConfig &o );
%Docstring
:rtype: bool
%End
void addTab( QgsAttributeEditorElement *data /Transfer/ );
%Docstring
Adds a new element to the invisible root container in the layout.
/**
* Returns a list of tabs for EditorLayout::TabLayout.
*/
QList< QgsAttributeEditorElement* > tabs();
This is only useful in combination with EditorLayout.TabLayout.
%End
QList< QgsAttributeEditorElement * > tabs() const;
%Docstring
Returns a list of tabs for EditorLayout.TabLayout obtained from the invisible root container.
:rtype: list of QgsAttributeEditorElement
%End
/**
* Clears all the tabs for the attribute editor form with EditorLayout::TabLayout.
*/
void clearTabs();
%Docstring
Clears all the tabs for the attribute editor form with EditorLayout.TabLayout.
%End
/**
* Get the invisible root container for the drag and drop designer form (EditorLayout::TabLayout).
*
* @note Added in QGIS 3
*/
QgsAttributeEditorContainer *invisibleRootContainer();
%Docstring
Get the invisible root container for the drag and drop designer form (EditorLayout.TabLayout).
/** Get the active layout style for the attribute editor for this layer */
EditorLayout layout();
.. versionadded:: 3
:rtype: QgsAttributeEditorContainer
%End
EditorLayout layout() const;
%Docstring
Get the active layout style for the attribute editor for this layer
:rtype: EditorLayout
%End
/** Set the active layout style for the attribute editor for this layer */
void setLayout( EditorLayout editorLayout );
%Docstring
Set the active layout style for the attribute editor for this layer
%End
/** Get path to the .ui form. Only meaningful with EditorLayout::UiFileLayout. */
QString uiForm() const;
%Docstring
Get path to the .ui form. Only meaningful with EditorLayout.UiFileLayout.
:rtype: str
%End
/**
* Set path to the .ui form.
* When a string is provided, the layout style will be set to EditorLayout::UiFileLayout,
* if an empty or a null string is provided, the layout style will be set to
* EditorLayout::GeneratedLayout.
*/
void setUiForm( const QString &ui );
%Docstring
Set path to the .ui form.
When a string is provided, the layout style will be set to EditorLayout.UiFileLayout,
if an empty or a null string is provided, the layout style will be set to
EditorLayout.GeneratedLayout.
%End
bool setWidgetConfig( const QString &widgetName, const QVariantMap &config );
%Docstring
Set the editor widget config for a widget which is not for a simple field.
Example:
\code{.py}
editFormConfig = layer.editFormConfig()
editFormConfig.setWidgetConfig( 'relation_id', { 'nm-rel': 'other_relation' } )
layer.setEditFormConfig(editFormConfig)
\endcode
\param widgetName The name of the widget to configure
\param config The config to set for this widget
:return: false if a field exists with the provided widgetName. In this case
QgsVectorLayer.setEditorWidgetSetup should be used.
.. seealso:: QgsVectorLayer.setEditorWidgetSetup() for field configurations.
:rtype: bool
%End
QVariantMap widgetConfig( const QString &widgetName ) const;
%Docstring
Get the configuration for the editor widget with the given name.
\param widgetName The name of the widget.
:return: The configuration for the editor widget or an empty config if the field does not exist
:rtype: QVariantMap
%End
bool removeWidgetConfig( const QString &widgetName );
%Docstring
Remove the configuration for the editor widget with the given name
\param widgetName The name of the widget.
:return: true if a configuration has been removed
:rtype: bool
%End
bool readOnly( int idx ) const;
%Docstring
This returns true if the field is manually set to read only or if the field
does not support editing like joins or virtual fields.
:rtype: bool
%End
/**
* If set to false, the widget at the given index will be read-only.
*/
void setReadOnly( int idx, bool readOnly = true );
%Docstring
If set to false, the widget at the given index will be read-only.
%End
/**
* If this returns true, the widget at the given index will receive its label on the previous line
* while if it returns false, the widget will receive its label on the left hand side.
* Labeling on top leaves more horizontal space for the widget itself.
**/
bool labelOnTop( int idx ) const;
%Docstring
If this returns true, the widget at the given index will receive its label on the previous line
while if it returns false, the widget will receive its label on the left hand side.
Labeling on top leaves more horizontal space for the widget itself.
*
:rtype: bool
%End
/**
* If this is set to true, the widget at the given index will receive its label on
* the previous line while if it is set to false, the widget will receive its label
* on the left hand side.
* Labeling on top leaves more horizontal space for the widget itself.
**/
void setLabelOnTop( int idx, bool onTop );
%Docstring
If this is set to true, the widget at the given index will receive its label on
the previous line while if it is set to false, the widget will receive its label
on the left hand side.
Labeling on top leaves more horizontal space for the widget itself.
*
%End
// Python form init function stuff
/**
* Get python function for edit form initialization.
* Will be looked up in a python file relative to the project folder if it
* includes a module name or if it's a pure function name it will searched
* in the python code set with @link setInitCode @endlink.
*/
QString initFunction() const;
%Docstring
Get Python function for edit form initialization.
Will be looked up in a Python file relative to the project folder if it
includes a module name or if it's a pure function name it will searched
in the Python code set with setInitCode().
:rtype: str
%End
/**
* Set python function for edit form initialization.
* Will be looked up in a python file relative to the project folder if it
* includes a module name or if it's a pure function name it will searched
* in the python code set with @link setInitCode @endlink.
*/
void setInitFunction( const QString &function );
%Docstring
Set Python function for edit form initialization.
Will be looked up in a Python file relative to the project folder if it
includes a module name or if it's a pure function name it will searched
in the Python code set with setInitCode().
%End
/**
* Get python code for edit form initialization.
*/
QString initCode() const;
%Docstring
Get Python code for edit form initialization.
:rtype: str
%End
/**
* Set python code for edit form initialization.
* Make sure that you also set the appropriate function name in
* @link setInitFunction @endlink
*/
void setInitCode( const QString &code );
%Docstring
Set Python code for edit form initialization.
Make sure that you also set the appropriate function name in
setInitFunction().
%End
/**
* Get python external file path for edit form initialization.
*/
QString initFilePath() const;
%Docstring
Get Python external file path for edit form initialization.
:rtype: str
%End
/**
* Set python external file path for edit form initialization.
* Make sure that you also set the appropriate function name in
* @link setInitFunction @endlink
*/
void setInitFilePath( const QString &filePath );
%Docstring
Set Python external file path for edit form initialization.
Make sure that you also set the appropriate function name in
setInitFunction().
%End
/** Return python code source for edit form initialization
* (if it shall be loaded from a file, read from the
* provided dialog editor or inherited from the environment)
*/
PythonInitCodeSource initCodeSource() const;
%Docstring
Return Python code source for edit form initialization
(if it shall be loaded from a file, read from the
provided dialog editor or inherited from the environment)
:rtype: PythonInitCodeSource
%End
/** Set if python code shall be used for edit form initialization and its origin */
void setInitCodeSource( PythonInitCodeSource initCodeSource );
%Docstring
Set if Python code shall be used for edit form initialization and its origin
%End
/** Type of feature form pop-up suppression after feature creation (overrides app setting) */
FeatureFormSuppress suppress() const;
/** Set type of feature form pop-up suppression after feature creation (overrides app setting) */
void setSuppress( QgsEditFormConfig::FeatureFormSuppress s );
%Docstring
Type of feature form pop-up suppression after feature creation (overrides app setting)
:rtype: FeatureFormSuppress
%End
void setSuppress( FeatureFormSuppress s );
%Docstring
Set type of feature form pop-up suppression after feature creation (overrides app setting)
%End
// Serialization
/**
* Read XML information
* Deserialize on project load
*/
void readXml( const QDomNode &node, const QgsReadWriteContext &context );
%Docstring
Read XML information
Deserialize on project load
%End
/**
* Write XML information
* Serialize on project save
*/
void writeXml( QDomNode &node, const QgsReadWriteContext &context ) const;
%Docstring
Write XML information
Serialize on project save
%End
/**
* Deserialize drag and drop designer elements.
*/
QgsAttributeEditorElement *attributeEditorElementFromDomElement( QDomElement &elem, QgsAttributeEditorElement *parent );
%Docstring
Deserialize drag and drop designer elements.
:rtype: QgsAttributeEditorElement
%End
explicit QgsEditFormConfig();
%Docstring
Create a new edit form config. Normally invoked by QgsVectorLayer
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgseditformconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,32 +1,57 @@
/** \ingroup core
* Holder for the widget type and its configuration for a field.
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgseditorwidgetsetup.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsEditorWidgetSetup
{
%Docstring
Holder for the widget type and its configuration for a field.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include <qgseditorwidgetsetup.h>
#include "qgseditorwidgetsetup.h"
%End
public:
/**
* Constructor
*/
QgsEditorWidgetSetup( const QString &type, const QVariantMap &config );
%Docstring
Constructor
%End
QgsEditorWidgetSetup();
/**
* @return the widget type to use
*/
QString type() const;
%Docstring
:return: the widget type to use
:rtype: str
%End
/**
* @return the widget configuration to used
*/
QVariantMap config() const;
%Docstring
:return: the widget configuration to used
:rtype: QVariantMap
%End
/**
* @return true if there is no widget configured.
*/
bool isNull() const;
%Docstring
:return: true if there is no widget configured.
:rtype: bool
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgseditorwidgetsetup.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,82 +1,134 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgserror.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsErrorMessage
{
%Docstring
QgsErrorMessage represents single error message.
%End
%TypeHeaderCode
#include <qgserror.h>
#include "qgserror.h"
%End
public:
/** Format */
enum Format
{
Text, // Plain text
Text,
Html
};
QgsErrorMessage();
/** Constructor.
* @param message error message string
* @param tag error label, for example GDAL, GDAL Provider, Raster layer
* @param file the file where error was created
* @param function the function where error was created
* @param line the line where error was created
*/
QgsErrorMessage( const QString &message, const QString &tag = QString::null, const QString &file = QString::null, const QString &function = QString::null, int line = 0 );
%Docstring
Constructor.
\param message error message string
\param tag error label, for example GDAL, GDAL Provider, Raster layer
\param file the file where error was created
\param function the function where error was created
\param line the line where error was created
%End
QString message() const;
%Docstring
:rtype: str
%End
QString tag() const;
%Docstring
:rtype: str
%End
QString file() const;
%Docstring
:rtype: str
%End
QString function() const;
%Docstring
:rtype: str
%End
int line() const;
%Docstring
:rtype: int
%End
};
/** \ingroup core
* QgsError is container for error messages (report). It may contain chain
* (sort of traceback) of error messages (e.g. GDAL - provider - layer).
* Higher level messages are appended at the end.
*/
class QgsError
{
%Docstring
QgsError is container for error messages (report). It may contain chain
(sort of traceback) of error messages (e.g. GDAL - provider - layer).
Higher level messages are appended at the end.
%End
%TypeHeaderCode
#include <qgserror.h>
#include "qgserror.h"
%End
public:
QgsError();
/** Constructor with single message.
* @param message error message
* @param tag short description, e.g. GDAL, Provider, Layer
*/
QgsError( const QString &message, const QString &tag );
%Docstring
Constructor with single message.
\param message error message
\param tag short description, e.g. GDAL, Provider, Layer
%End
/** Append new error message.
* @param message error message string
* @param tag error label, for example GDAL, GDAL Provider, Raster layer
*/
void append( const QString &message, const QString &tag );
%Docstring
Append new error message.
\param message error message string
\param tag error label, for example GDAL, GDAL Provider, Raster layer
%End
/** Append new error message.
* @param message error message
*/
void append( const QgsErrorMessage &message );
%Docstring
Append new error message.
\param message error message
%End
/** Test if any error is set.
* @return true if contains error
*/
bool isEmpty() const;
%Docstring
Test if any error is set.
:return: true if contains error
:rtype: bool
%End
/** Full error messages description
* @param format output format
* @return error report
*/
QString message( QgsErrorMessage::Format format = QgsErrorMessage::Html ) const;
%Docstring
Full error messages description
\param format output format
:return: error report
:rtype: str
%End
/** Short error description, usually the first error in chain, the real error.
* @return error description
*/
QString summary() const;
%Docstring
Short error description, usually the first error in chain, the real error.
:return: error description
:rtype: str
%End
/** Clear error messages */
void clear();
%Docstring
Clear error messages
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgserror.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,43 +1,50 @@
/***************************************************************************
qgsexpressioncontextgenerator.sip - QgsExpressionContextGenerator
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsexpressioncontextgenerator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
---------------------
begin : 1.8.2016
copyright : (C) 2016 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
/**
* \ingroup core
* Abstract interface for generating an expression context.
*
* You need to implement this interface in a class and register this class with
* QgsFieldExpressionWidget::registerExpressionGenerator().
*
* Whenever this widget requires an expression context it will call the createExpressionContext()
* method to get a context.
*
* @note added in QGIS 3.0
*/
class QgsExpressionContextGenerator
{
%Docstring
Abstract interface for generating an expression context.
You need to implement this interface in a class and register this class with
QgsFieldExpressionWidget.registerExpressionGenerator().
This is used for example in QgsPropertyOverrideButton or QgsFieldExpressionWidget
classes which will ask for a new QgsExpressionContext every time the expression
editor is opened. This way they are able to provide an up-to-date expression
editor even when the environment changes.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsexpressioncontextgenerator.h"
%End
public:
/**
* This method needs to be reimplemented in all classes which implement this interface
* and return an expression context.
*/
virtual QgsExpressionContext createExpressionContext() const = 0;
%Docstring
This method needs to be reimplemented in all classes which implement this interface
and return an expression context.
.. versionadded:: 3.0
:rtype: QgsExpressionContext
%End
virtual ~QgsExpressionContextGenerator();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsexpressioncontextgenerator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,68 +1,100 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsexpressionfieldbuffer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsExpressionFieldBuffer
{
%Docstring
Buffers information about expression fields for a vector layer.
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include <qgsexpressionfieldbuffer.h>
#include "qgsexpressionfieldbuffer.h"
%End
public:
class ExpressionField
struct ExpressionField
{
ExpressionField();
ExpressionField( const QString &exp, const QgsField &fld );
QgsExpression cachedExpression;
QgsField field;
};
QgsExpressionFieldBuffer();
/**
* Add an expression to the buffer
*
* @param exp expression to add
* @param fld field to add
*/
void addExpression( const QString &exp, const QgsField &fld );
%Docstring
Add an expression to the buffer
\param exp expression to add
\param fld field to add
%End
/**
* Remove an expression from the buffer
*
* @param index index of expression to remove
*/
void removeExpression( int index );
%Docstring
Remove an expression from the buffer
\param index index of expression to remove
%End
/**
* Renames an expression field at a given index
*
* @param index The index of the expression to change
* @param name New name for field
*
* @note added in 3.0
*/
void renameExpression( int index, const QString &name );
%Docstring
Renames an expression field at a given index
\param index The index of the expression to change
\param name New name for field
.. versionadded:: 3.0
%End
/**
* Changes the expression at a given index
*
* @param index The index of the expression to change
* @param exp The new expression to set
*
* @note added in 2.9
*/
void updateExpression( int index, const QString &exp );
%Docstring
Changes the expression at a given index
\param index The index of the expression to change
\param exp The new expression to set
.. versionadded:: 2.9
%End
/**
* Saves expressions to xml under the layer node
*/
void writeXml( QDomNode &layer_node, QDomDocument &document ) const;
%Docstring
Saves expressions to xml under the layer node
%End
/**
* Reads expressions from project file
*/
void readXml( const QDomNode &layer_node );
%Docstring
Reads expressions from project file
%End
/**
* Adds fields with the expressions buffered in this object to a QgsFields object
*
* @param flds The fields to be updated
*/
void updateFields( QgsFields &flds );
%Docstring
Adds fields with the expressions buffered in this object to a QgsFields object
\param flds The fields to be updated
%End
QList<ExpressionField> expressions() const;
%Docstring
:rtype: list of ExpressionField
%End
QList<QgsExpressionFieldBuffer::ExpressionField> expressions() const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsexpressionfieldbuffer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,124 +1,179 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfontutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFontUtils
{
%TypeHeaderCode
#include <qgsfontutils.h>
#include "qgsfontutils.h"
%End
public:
/** Check whether exact font is on system
* @param f The font to test for match
*/
static bool fontMatchOnSystem( const QFont &f );
%Docstring
Check whether exact font is on system
\param f The font to test for match
:rtype: bool
%End
/** Check whether font family is on system in a quick manner, which does not compare [foundry]
* @param family The family to test
* @returns Whether family was found on system
* @note This is good for use in loops of large lists, e.g. registering many features for labeling
*/
static bool fontFamilyOnSystem( const QString &family );
%Docstring
Check whether font family is on system in a quick manner, which does not compare [foundry]
\param family The family to test
:return: Whether family was found on system
.. note::
This is good for use in loops of large lists, e.g. registering many features for labeling
:rtype: bool
%End
/** Check whether font family on system has specific style
* @param family The family to test
* @param style The style to test for
* @returns Whether family has style
* @note Added in QGIS 2.1
*/
static bool fontFamilyHasStyle( const QString &family, const QString &style );
%Docstring
Check whether font family on system has specific style
\param family The family to test
\param style The style to test for
:return: Whether family has style
.. versionadded:: 2.1
:rtype: bool
%End
/** Check whether font family is on system
* @param family The family to test
* @param chosen The actual family (possibly from different foundry) returned by system
* @param match Whether the family [foundry] returned by system is a match
* @returns Whether family was found on system
*/
static bool fontFamilyMatchOnSystem( const QString &family, QString *chosen = 0, bool *match = 0 );
%Docstring
Check whether font family is on system
\param family The family to test
\param chosen The actual family (possibly from different foundry) returned by system
\param match Whether the family [foundry] returned by system is a match
:return: Whether family was found on system
:rtype: bool
%End
/** Updates font with named style and retain all font properties
* @param f The font to update
* @param fontstyle The style to try and switch the font to
* @param fallback If no matching fontstyle found for font, assign most similar or first style found to font
* @returns Whether the font was updated (also returns true if the requested style matches font's current style)
* @note This is a more featured replacement for a Qt 4.8+ function: void QFont::setStyleName ( const QString & styleName )
*/
static bool updateFontViaStyle( QFont &f, const QString &fontstyle, bool fallback = false );
%Docstring
Updates font with named style and retain all font properties
\param f The font to update
\param fontstyle The style to try and switch the font to
\param fallback If no matching fontstyle found for font, assign most similar or first style found to font
:return: Whether the font was updated (also returns true if the requested style matches font's current style)
.. note::
This is a more featured replacement for a Qt 4.8+ function: void QFont.setStyleName ( const QString & styleName )
:rtype: bool
%End
/** Get standard test font family
* @note Added in QGIS 2.1
*/
static QString standardTestFontFamily();
%Docstring
Get standard test font family
.. versionadded:: 2.1
:rtype: str
%End
/** Loads standard test fonts from filesystem or qrc resource
* @param loadstyles List of styles to load, e.g. All, Roman, Oblique, Bold, Bold Oblique
* @returns Whether any font was loaded
* @note Done by default on debug app/server startup to ensure fonts available for unit tests (Roman and Bold)
* @note Added in QGIS 2.1
*/
static bool loadStandardTestFonts( const QStringList &loadstyles );
%Docstring
Loads standard test fonts from filesystem or qrc resource
\param loadstyles List of styles to load, e.g. All, Roman, Oblique, Bold, Bold Oblique
:return: Whether any font was loaded
.. note::
Done by default on debug app/server startup to ensure fonts available for unit tests (Roman and Bold)
.. versionadded:: 2.1
:rtype: bool
%End
/** Get standard test font with specific style
* @param style Style to load, e.g. Roman, Oblique, Bold, Bold Oblique
* @param pointsize Font point size to set
* @returns QFont
* @note Added in QGIS 2.1
*/
static QFont getStandardTestFont( const QString &style = "Roman", int pointsize = 12 );
%Docstring
Get standard test font with specific style
\param style Style to load, e.g. Roman, Oblique, Bold, Bold Oblique
\param pointsize Font point size to set
:return: QFont
.. versionadded:: 2.1
:rtype: QFont
%End
/** Returns a DOM element containing the properties of the font.
* @param font font
* @param document DOM document
* @param elementName name for DOM element
* @returns DOM element containing font settings
* @note added in QGIS 2.10
* @see setFromXmlElement
*/
static QDomElement toXmlElement( const QFont &font, QDomDocument &document, const QString &elementName );
%Docstring
Returns a DOM element containing the properties of the font.
\param font font
\param document DOM document
\param elementName name for DOM element
:return: DOM element containing font settings
.. versionadded:: 2.10
.. seealso:: setFromXmlElement
:rtype: QDomElement
%End
/** Sets the properties of a font to match the properties stored in an XML element. Calling
* this will overwrite the current properties of the font.
* @param font font to update
* @param element DOM element
* @returns true if properties were successfully read from element
* @note added in QGIS 2.10
* @see toXmlElement
* @see setFromXmlChildNode
*/
static bool setFromXmlElement( QFont &font, const QDomElement &element );
%Docstring
Sets the properties of a font to match the properties stored in an XML element. Calling
this will overwrite the current properties of the font.
\param font font to update
\param element DOM element
:return: true if properties were successfully read from element
.. versionadded:: 2.10
.. seealso:: toXmlElement
.. seealso:: setFromXmlChildNode
:rtype: bool
%End
/** Sets the properties of a font to match the properties stored in an XML child node. Calling
* this will overwrite the current properties of the font.
* @param font font to update
* @param element DOM element
* @param childNode name of child node
* @returns true if child node exists and properties were successfully read from node
* @note added in QGIS 2.10
* @see setFromXmlElement
* @see toXmlElement
*/
static bool setFromXmlChildNode( QFont &font, const QDomElement &element, const QString &childNode );
%Docstring
Sets the properties of a font to match the properties stored in an XML child node. Calling
this will overwrite the current properties of the font.
\param font font to update
\param element DOM element
\param childNode name of child node
:return: true if child node exists and properties were successfully read from node
.. versionadded:: 2.10
.. seealso:: setFromXmlElement
.. seealso:: toXmlElement
:rtype: bool
%End
/** Returns the localized named style of a font, if such a translation is available.
* @param namedStyle a named style, i.e. "Bold", "Italic", etc
* @returns The localized named style
* @note added in QGIS 2.12
* @see untranslateNamedStyle
*/
static QString translateNamedStyle( const QString &namedStyle );
%Docstring
Returns the localized named style of a font, if such a translation is available.
\param namedStyle a named style, i.e. "Bold", "Italic", etc
:return: The localized named style
.. versionadded:: 2.12
.. seealso:: untranslateNamedStyle
:rtype: str
%End
/** Returns the english named style of a font, if possible.
* @param namedStyle a localized named style, i.e. "Fett", "Kursiv", etc
* @returns The english named style
* @note added in QGIS 2.12
* @see translateNamedStyle
*/
static QString untranslateNamedStyle( const QString &namedStyle );
%Docstring
Returns the english named style of a font, if possible.
\param namedStyle a localized named style, i.e. "Fett", "Kursiv", etc
:return: The english named style
.. versionadded:: 2.12
.. seealso:: translateNamedStyle
:rtype: str
%End
/** Returns a CSS string representing the specified font as closely as possible.
* @param font QFont to convert
* @param pointToPixelMultiplier scaling factor to apply to convert point sizes to pixel font sizes.
* The CSS returned by this function will always use pixels for font sizes, so this parameter
* should be set to a suitable value to convert point sizes to pixels (e.g., taking into account
* destination DPI)
* @returns partial CSS string, e.g., "font-family: Comic Sans; font-size: 12px;"
* @note added in QGIS 2.16
*/
static QString asCSS( const QFont &font, double pointToPixelMultiplier = 1.0 );
%Docstring
Returns a CSS string representing the specified font as closely as possible.
\param font QFont to convert
\param pointToPixelMultiplier scaling factor to apply to convert point sizes to pixel font sizes.
The CSS returned by this function will always use pixels for font sizes, so this parameter
should be set to a suitable value to convert point sizes to pixels (e.g., taking into account
destination DPI)
:return: partial CSS string, e.g., "font-family: Comic Sans; font-size: 12px;"
.. versionadded:: 2.16
:rtype: str
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfontutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,43 +1,77 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsgeometrysimplifier.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/**
* Abstract base class for simplify geometries using a specific algorithm
*/
class QgsAbstractGeometrySimplifier
{
%Docstring
Abstract base class for simplify geometries using a specific algorithm
%End
%TypeHeaderCode
#include "qgsgeometrysimplifier.h"
%End
public:
virtual ~QgsAbstractGeometrySimplifier();
//! Returns a simplified version the specified geometry
virtual QgsGeometry simplify( const QgsGeometry &geometry ) const = 0;
%Docstring
Returns a simplified version the specified geometry
:rtype: QgsGeometry
%End
// MapToPixel simplification helper methods
public:
//! Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance
static bool isGeneralizableByDeviceBoundingBox( const QgsRectangle &envelope, float mapToPixelTol = 1.0f );
//! Returns whether the device-geometry can be replaced by its BBOX when is applied the specified tolerance
%Docstring
Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance
:rtype: bool
%End
static bool isGeneralizableByDeviceBoundingBox( const QVector<QPointF> &points, float mapToPixelTol = 1.0f );
%Docstring
Returns whether the device-geometry can be replaced by its BBOX when is applied the specified tolerance
:rtype: bool
%End
};
/***************************************************************************/
/**
* Implementation of GeometrySimplifier using the Douglas-Peucker algorithm
*
* Simplifies a geometry, ensuring that the result is a valid geometry having the same dimension and number of components as the input.
* The simplification uses a maximum distance difference algorithm similar to the one used in the Douglas-Peucker algorithm.
*/
class QgsTopologyPreservingSimplifier : QgsAbstractGeometrySimplifier
{
%Docstring
Implementation of GeometrySimplifier using the Douglas-Peucker algorithm
Simplifies a geometry, ensuring that the result is a valid geometry having the same dimension and number of components as the input.
The simplification uses a maximum distance difference algorithm similar to the one used in the Douglas-Peucker algorithm.
%End
%TypeHeaderCode
#include "qgsgeometrysimplifier.h"
%End
public:
QgsTopologyPreservingSimplifier( double tolerance );
virtual ~QgsTopologyPreservingSimplifier();
//! Returns a simplified version the specified geometry
QgsTopologyPreservingSimplifier( double tolerance );
%Docstring
Constructor for QgsTopologyPreservingSimplifier. The tolerance parameter
is specified in layer units.
%End
virtual QgsGeometry simplify( const QgsGeometry &geometry ) const;
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsgeometrysimplifier.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,23 +1,47 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsgeometryvalidator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsGeometryValidator : QThread
{
%TypeHeaderCode
#include <qgsgeometryvalidator.h>
%End
%TypeHeaderCode
#include "qgsgeometryvalidator.h"
%End
public:
//! Constructor
QgsGeometryValidator( const QgsGeometry *g, QList<QgsGeometry::Error> *errors = 0 );
%Docstring
Constructor
%End
~QgsGeometryValidator();
void run();
virtual void run();
void stop();
/** Validate geometry and produce a list of geometry errors */
static void validateGeometry( const QgsGeometry *g, QList<QgsGeometry::Error> &errors /Out/ );
%Docstring
Validate geometry and produce a list of geometry errors
%End
signals:
void errorFound( const QgsGeometry::Error& );
void errorFound( const QgsGeometry::Error & );
public slots:
void addError( const QgsGeometry::Error& );
};
void addError( const QgsGeometry::Error & );
}; // class QgsGeometryValidator
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsgeometryvalidator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,35 +1,43 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslabelsearchtree.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLabelSearchTree
{
%TypeHeaderCode
#include <qgslabelsearchtree.h>
%Docstring
A class to query the labeling structure at a given point (small wraper around pal RTree class)
%End
%TypeHeaderCode
#include "qgslabelsearchtree.h"
%End
public:
QgsLabelSearchTree();
~QgsLabelSearchTree();
/** Removes and deletes all the entries*/
void clear();
%Docstring
Removes and deletes all the entries
%End
/** Returns label position(s) at a given point. QgsLabelSearchTree keeps ownership, don't delete the LabelPositions
* @note not available in python bindings
* TODO: why does this break bindings with QList<QgsLabelPosition>?
*/
// void label( const QgsPoint &p, QList<QgsLabelPosition*> &posList ) const;
/** Returns label position(s) in given rectangle. QgsLabelSearchTree keeps ownership, don't delete the LabelPositions
* @note not available in python bindings
* TODO: why does this break bindings with QList<QgsLabelPosition>?
*/
// void labelsInRect( const QgsRectangle &r, QList<QgsLabelPosition*> &posList ) const;
/** Inserts label position. Does not take ownership of labelPos
* @return true in case of success
* @note not available in python bindings
*/
// bool insertLabel( LabelPosition *labelPos, int featureId, const QString &layerName, bool diagram = false, bool pinned = false );
private:
QgsLabelSearchTree( const QgsLabelSearchTree &rh );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslabelsearchtree.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,39 +1,73 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslegendrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/**
* @brief The QgsLegendRenderer class handles automatic layout and rendering of legend.
* The content is given by QgsLayerTreeModel instance. Various layout properties can be configured
* within QgsLegendRenderer.
*
* All spacing and sizes are in millimeters.
*
* @note added in 2.6
*/
class QgsLegendRenderer
{
%TypeHeaderCode
#include <qgslegendrenderer.h>
%Docstring
The QgsLegendRenderer class handles automatic layout and rendering of legend.
The content is given by QgsLayerTreeModel instance. Various layout properties can be configured
within QgsLegendRenderer.
All spacing and sizes are in millimeters.
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include "qgslegendrenderer.h"
%End
public:
/** Construct legend renderer. The ownership of legend model does not change */
QgsLegendRenderer( QgsLayerTreeModel *legendModel, const QgsLegendSettings &settings );
%Docstring
Construct legend renderer. The ownership of legend model does not change
%End
/** Run the layout algorithm and determine the size required for legend */
QSizeF minimumSize();
%Docstring
Run the layout algorithm and determine the size required for legend
:rtype: QSizeF
%End
/** Set the preferred resulting legend size. */
void setLegendSize( QSizeF s );
%Docstring
Set the preferred resulting legend size.
%End
/** Find out preferred legend size set by the client. If null, the legend will be drawn with the minimum size */
QSizeF legendSize() const;
%Docstring
Find out preferred legend size set by the client. If null, the legend will be drawn with the minimum size
:rtype: QSizeF
%End
/** Draw the legend with given painter. It will occupy the area reported in legendSize().
* Painter should be scaled beforehand so that units correspond to millimeters.
*/
void drawLegend( QPainter *painter );
%Docstring
Draw the legend with given painter. It will occupy the area reported in legendSize().
Painter should be scaled beforehand so that units correspond to millimeters.
%End
static void setNodeLegendStyle( QgsLayerTreeNode *node, QgsLegendStyle::Style style );
static QgsLegendStyle::Style nodeLegendStyle( QgsLayerTreeNode *node, QgsLayerTreeModel *model );
%Docstring
:rtype: QgsLegendStyle.Style
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslegendrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,176 +1,278 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslegendsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/**
* @brief The QgsLegendSettings class stores the appearance and layout settings
* for legend drawing with QgsLegendRenderer. The content of the legend is given
* in QgsLegendModel class.
*
* @note added in 2.6
*/
class QgsLegendSettings
{
%TypeHeaderCode
#include <qgslegendsettings.h>
%Docstring
The QgsLegendSettings class stores the appearance and layout settings
for legend drawing with QgsLegendRenderer. The content of the legend is given
in QgsLegendModel class.
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include "qgslegendsettings.h"
%End
public:
QgsLegendSettings();
void setTitle( const QString &t );
QString title() const;
%Docstring
:rtype: str
%End
/** Returns the alignment of the legend title
* @returns Qt::AlignmentFlag for the legend title
* @see setTitleAlignment
*/
Qt::AlignmentFlag titleAlignment() const;
/** Sets the alignment of the legend title
* @param alignment Text alignment for drawing the legend title
* @see titleAlignment
*/
void setTitleAlignment( Qt::AlignmentFlag alignment );
%Docstring
Returns the alignment of the legend title
:return: Qt.AlignmentFlag for the legend title
.. seealso:: setTitleAlignment
:rtype: Qt.AlignmentFlag
%End
void setTitleAlignment( Qt::AlignmentFlag alignment );
%Docstring
Sets the alignment of the legend title
\param alignment Text alignment for drawing the legend title
.. seealso:: titleAlignment
%End
/** Returns reference to modifiable style */
QgsLegendStyle &rstyle( QgsLegendStyle::Style s );
/** Returns style */
QgsLegendStyle style( QgsLegendStyle::Style s ) const;
%Docstring
Returns style
:rtype: QgsLegendStyle
%End
void setStyle( QgsLegendStyle::Style s, const QgsLegendStyle &style );
double boxSpace() const;
%Docstring
:rtype: float
%End
void setBoxSpace( double s );
void setWrapChar( const QString &t );
QString wrapChar() const;
%Docstring
:rtype: str
%End
double columnSpace() const;
%Docstring
:rtype: float
%End
void setColumnSpace( double s );
int columnCount() const;
%Docstring
:rtype: int
%End
void setColumnCount( int c );
bool splitLayer() const;
%Docstring
:rtype: bool
%End
void setSplitLayer( bool s );
bool equalColumnWidth() const;
%Docstring
:rtype: bool
%End
void setEqualColumnWidth( bool s );
QColor fontColor() const;
%Docstring
:rtype: QColor
%End
void setFontColor( const QColor &c );
QSizeF symbolSize() const;
%Docstring
:rtype: QSizeF
%End
void setSymbolSize( QSizeF s );
/** Returns whether a stroke will be drawn around raster symbol items.
* @see setDrawRasterStroke()
* @see rasterStrokeColor()
* @see rasterStrokeWidth()
* @note added in QGIS 2.12
*/
bool drawRasterStroke() const;
%Docstring
Returns whether a stroke will be drawn around raster symbol items.
.. seealso:: setDrawRasterStroke()
.. seealso:: rasterStrokeColor()
.. seealso:: rasterStrokeWidth()
.. versionadded:: 2.12
:rtype: bool
%End
/** Sets whether a stroke will be drawn around raster symbol items.
* @param enabled set to true to draw borders
* @see drawRasterStroke()
* @see setRasterStrokeColor()
* @see setRasterStrokeWidth()
* @note added in QGIS 2.12
*/
void setDrawRasterStroke( bool enabled );
%Docstring
Sets whether a stroke will be drawn around raster symbol items.
\param enabled set to true to draw borders
.. seealso:: drawRasterStroke()
.. seealso:: setRasterStrokeColor()
.. seealso:: setRasterStrokeWidth()
.. versionadded:: 2.12
%End
/** Returns the stroke color for the stroke drawn around raster symbol items. The stroke is
* only drawn if drawRasterStroke() is true.
* @see setRasterStrokeColor()
* @see drawRasterStroke()
* @see rasterStrokeWidth()
* @note added in QGIS 2.12
*/
QColor rasterStrokeColor() const;
%Docstring
Returns the stroke color for the stroke drawn around raster symbol items. The stroke is
only drawn if drawRasterStroke() is true.
.. seealso:: setRasterStrokeColor()
.. seealso:: drawRasterStroke()
.. seealso:: rasterStrokeWidth()
.. versionadded:: 2.12
:rtype: QColor
%End
/** Sets the stroke color for the stroke drawn around raster symbol items. The stroke is
* only drawn if drawRasterStroke() is true.
* @param color stroke color
* @see rasterStrokeColor()
* @see setDrawRasterStroke()
* @see setRasterStrokeWidth()
* @note added in QGIS 2.12
*/
void setRasterStrokeColor( const QColor &color );
%Docstring
Sets the stroke color for the stroke drawn around raster symbol items. The stroke is
only drawn if drawRasterStroke() is true.
\param color stroke color
.. seealso:: rasterStrokeColor()
.. seealso:: setDrawRasterStroke()
.. seealso:: setRasterStrokeWidth()
.. versionadded:: 2.12
%End
/** Returns the stroke width (in millimeters) for the stroke drawn around raster symbol items. The stroke is
* only drawn if drawRasterStroke() is true.
* @see setRasterStrokeWidth()
* @see drawRasterStroke()
* @see rasterStrokeColor()
* @note added in QGIS 2.12
*/
double rasterStrokeWidth() const;
%Docstring
Returns the stroke width (in millimeters) for the stroke drawn around raster symbol items. The stroke is
only drawn if drawRasterStroke() is true.
.. seealso:: setRasterStrokeWidth()
.. seealso:: drawRasterStroke()
.. seealso:: rasterStrokeColor()
.. versionadded:: 2.12
:rtype: float
%End
/** Sets the stroke width for the stroke drawn around raster symbol items. The stroke is
* only drawn if drawRasterStroke() is true.
* @param width stroke width in millimeters
* @see rasterStrokeWidth()
* @see setDrawRasterStroke()
* @see setRasterStrokeColor()
* @note added in QGIS 2.12
*/
void setRasterStrokeWidth( double width );
%Docstring
Sets the stroke width for the stroke drawn around raster symbol items. The stroke is
only drawn if drawRasterStroke() is true.
\param width stroke width in millimeters
.. seealso:: rasterStrokeWidth()
.. seealso:: setDrawRasterStroke()
.. seealso:: setRasterStrokeColor()
.. versionadded:: 2.12
%End
QSizeF wmsLegendSize() const;
%Docstring
:rtype: QSizeF
%End
void setWmsLegendSize( QSizeF s );
double lineSpacing() const;
%Docstring
:rtype: float
%End
void setLineSpacing( double s );
double mmPerMapUnit() const;
%Docstring
:rtype: float
%End
void setMmPerMapUnit( double mmPerMapUnit );
bool useAdvancedEffects() const;
%Docstring
:rtype: bool
%End
void setUseAdvancedEffects( bool use );
double mapScale() const;
%Docstring
:rtype: float
%End
void setMapScale( double scale );
int dpi() const;
%Docstring
:rtype: int
%End
void setDpi( int dpi );
// utility functions
/** Splits a string using the wrap char taking into account handling empty
* wrap char which means no wrapping
*/
QStringList splitStringForWrapping( const QString &stringToSplt ) const;
%Docstring
Splits a string using the wrap char taking into account handling empty
wrap char which means no wrapping
:rtype: list of str
%End
/** Draws Text. Takes care about all the composer specific issues (calculation to
* pixel, scaling of font and painter to work around the Qt font bug)
*/
void drawText( QPainter *p, double x, double y, const QString &text, const QFont &font ) const;
%Docstring
Draws Text. Takes care about all the composer specific issues (calculation to
pixel, scaling of font and painter to work around the Qt font bug)
%End
/** Like the above, but with a rectangle for multiline text
* @param p painter to use
* @param rect rectangle to draw into
* @param text text to draw
* @param font font to use
* @param halignment optional horizontal alignment
* @param valignment optional vertical alignment
* @param flags allows for passing Qt::TextFlags to control appearance of rendered text
*/
void drawText( QPainter *p, const QRectF &rect, const QString &text, const QFont &font, Qt::AlignmentFlag halignment = Qt::AlignLeft, Qt::AlignmentFlag valignment = Qt::AlignTop, int flags = Qt::TextWordWrap ) const;
%Docstring
Like the above, but with a rectangle for multiline text
\param p painter to use
\param rect rectangle to draw into
\param text text to draw
\param font font to use
\param halignment optional horizontal alignment
\param valignment optional vertical alignment
\param flags allows for passing Qt.TextFlags to control appearance of rendered text
%End
/** Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE */
QFont scaledFontPixelSize( const QFont &font ) const;
%Docstring
Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE
:rtype: QFont
%End
/** Calculates font to from point size to pixel size */
double pixelFontSize( double pointSize ) const;
%Docstring
Calculates font to from point size to pixel size
:rtype: float
%End
/** Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE */
double textWidthMillimeters( const QFont &font, const QString &text ) const;
%Docstring
Returns the font width in millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE
:rtype: float
%End
/** Returns the font height of a character in millimeters */
double fontHeightCharacterMM( const QFont &font, QChar c ) const;
%Docstring
Returns the font height of a character in millimeters
:rtype: float
%End
/** Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE */
double fontAscentMillimeters( const QFont &font ) const;
%Docstring
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE
:rtype: float
%End
/** Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE */
double fontDescentMillimeters( const QFont &font ) const;
%Docstring
Returns the font descent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE
:rtype: float
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslegendsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,56 +1,105 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslogger.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** QgsLogger is a class to print debug/warning/error messages to the console. The advantage of this class over std::cout, std::cerr & co. is that the output can be controlled with environment variables:
QGIS_DEBUG is an int describing what debug messages are written to the console. 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 mode and to 0 for release mode
QGIS_DEBUG_FILE may contain a file name. Only the messages from this file are printed (provided they have the right debuglevel). If QGIS_DEBUG_FILE is not set, messages from all files are printed
*/
class QgsLogger
{
%TypeHeaderCode
#include <qgslogger.h>
%Docstring
QgsLogger is a class to print debug/warning/error messages to the console.
The advantage of this class over iostream & co. is that the
output can be controlled with environment variables:
QGIS_DEBUG is an int describing what debug messages are written to the console.
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
mode and to 0 for release mode
QGIS_DEBUG_FILE may contain a file name. Only the messages from this file are
printed (provided they have the right debuglevel). If QGIS_DEBUG_FILE is not
set, messages from all files are printed
QGIS_LOG_FILE may contain a file name. If set, all messages will be appended
to this file rather than to stdout.
%End
%TypeHeaderCode
#include "qgslogger.h"
%End
public:
/** Goes to qDebug.
@param msg the message to be printed
@param debuglevel
@param file file name where the message comes from
@param function function where the message comes from
@param line place in file where the message comes from*/
static void debug( const QString &msg, int debuglevel = 1, const char *file = 0, const char *function = 0, int line = -1 );
%Docstring
Goes to qDebug.
\param msg the message to be printed
\param debuglevel
\param file file name where the message comes from
\param function function where the message comes from
\param line place in file where the message comes from*
%End
/** Similar to the previous method, but prints a variable int-value pair*/
static void debug( const QString &var, int val, int debuglevel = 1, const char *file = 0, const char *function = 0, int line = -1 );
%Docstring
Similar to the previous method, but prints a variable int-value pair
%End
/** Similar to the previous method, but prints a variable double-value pair*/
// @note not available in python bindings
// static void debug( const QString &var, double val, int debuglevel = 1, const char *file = 0, const char *function = 0, int line = -1 );
/** Prints out a variable/value pair for types with overloaded operator<<*/
// @note not available in python bindings
//template <typename T> static void debug(const QString& var, T val, const char* file = 0, const char* function = 0,
// int line = -1, int debuglevel = 1);
/** Goes to qWarning*/
static void warning( const QString &msg );
%Docstring
Goes to qWarning
%End
/** Goes to qCritical*/
static void critical( const QString &msg );
%Docstring
Goes to qCritical
%End
/** Goes to qFatal*/
static void fatal( const QString &msg );
%Docstring
Goes to qFatal
%End
/** 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*/
static int debugLevel();
%Docstring
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*
:rtype: int
%End
/** Logs the message passed in to the logfile defined in QGIS_LOG_FILE if any. **/
static void logMessageToFile( const QString &message );
%Docstring
Logs the message passed in to the logfile defined in QGIS_LOG_FILE if any. *
%End
const QString logFile();
%Docstring
Reads the environment variable QGIS_LOG_FILE. Returns NULL if the variable is not set,
otherwise returns a file name for writing log messages to.*
:rtype: str
%End
/** Reads the environment variable QGIS_LOG_FILE. Returns NULL if the variable is not set,
* otherwise returns a file name for writing log messages to.*/
static const QString logFile();
};
class QgsScopeLogger // clazy:exclude=rule-of-three
{
public:
QgsScopeLogger( const char *file, const char *func, int line );
~QgsScopeLogger();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslogger.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,63 +1,80 @@
/**
* Class that runs a hit test with given map settings. Based on the hit test it returns which symbols
* will be visible on the map - this is useful for content based legend.
*
* @note added in 2.6
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaphittest.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapHitTest
{
%TypeHeaderCode
#include <qgsmaphittest.h>
%Docstring
Class that runs a hit test with given map settings. Based on the hit test it returns which symbols
will be visible on the map - this is useful for content based legend.
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include "qgsmaphittest.h"
%End
public:
//! Maps an expression string to a layer id
typedef QMap<QString, QString> LayerFilterExpression;
//! @param settings Map settings used to evaluate symbols
//! @param polygon Polygon geometry to refine the hit test
//! @param layerFilterExpression Expression string for each layer id to evaluate in order to refine the symbol selection
QgsMapHitTest( const QgsMapSettings &settings, const QgsGeometry &polygon = QgsGeometry(), const QMap<QString, QString> &layerFilterExpression = QMap<QString, QString>() );
QgsMapHitTest( const QgsMapSettings &settings, const QgsGeometry &polygon = QgsGeometry(), const LayerFilterExpression &layerFilterExpression = LayerFilterExpression() );
%Docstring
\param layerFilterExpression Expression string for each layer id to evaluate in order to refine the symbol selection
%End
//! Constructor version used with only expressions to filter symbols (no extent or polygon intersection)
QgsMapHitTest( const QgsMapSettings &settings, const QMap<QString, QString> &layerFilterExpression );
QgsMapHitTest( const QgsMapSettings &settings, const LayerFilterExpression &layerFilterExpression );
%Docstring
Constructor version used with only expressions to filter symbols (no extent or polygon intersection)
%End
//! Runs the map hit test
void run();
%Docstring
Runs the map hit test
%End
/** Tests whether a symbol is visible for a specified layer.
* @param symbol symbol to find
* @param layer vector layer
* @note added in QGIS 2.12
* @see legendKeyVisible()
*/
bool symbolVisible( QgsSymbol *symbol, QgsVectorLayer *layer ) const;
%Docstring
Tests whether a symbol is visible for a specified layer.
\param symbol symbol to find
\param layer vector layer
.. versionadded:: 2.12
.. seealso:: legendKeyVisible()
:rtype: bool
%End
/** Tests whether a given legend key is visible for a specified layer.
* @param ruleKey legend rule key
* @param layer vector layer
* @note added in QGIS 2.14
* @see symbolVisible()
*/
bool legendKeyVisible( const QString &ruleKey, QgsVectorLayer *layer ) const;
%Docstring
Tests whether a given legend key is visible for a specified layer.
\param ruleKey legend rule key
\param layer vector layer
.. versionadded:: 2.14
.. seealso:: symbolVisible()
:rtype: bool
%End
protected:
//! @note not available in Python bindings
//typedef QSet<QString> SymbolSet;
//! @note not available in Python bindings
//typedef QMap<QgsVectorLayer*, SymbolSet> HitTest;
/** Runs test for visible symbols within a layer
* @param vl vector layer
* @param usedSymbols set for storage of visible symbols
* @param usedSymbolsRuleKey set of storage of visible legend rule keys
* @param context render context
* @note added in QGIS 2.12
* @note not available in Python bindings
*/
//void runHitTestLayer( QgsVectorLayer *vl, SymbolSet &usedSymbols, SymbolSet &usedSymbolsRuleKey, QgsRenderContext &context );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaphittest.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,43 +1,87 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerdependency.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapLayerDependency
{
%Docstring
This class models dependencies with or between map layers.
A dependency is defined by a layer ID, a type and an origin.
The two combinations of type/origin that are currently supported are:
- PresenceDependency && FromProvider: virtual layers for instance which may depend on other layers already loaded to work
- DataDependency && FromUser: dependencies given by the user, mainly to represent database triggers
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsmaplayerdependency.h"
%End
public:
//! Type of dependency
enum Type
{
PresenceDependency = 1, // The layer must be already present (in the registry) for this dependency to be resolved
DataDependency = 2 // The layer may be invalidated by data changes on another layer
};
public:
enum Type
{
PresenceDependency,
DataDependency
};
//! Origin of the dependency
enum Origin
{
FromProvider = 0, // Dependency given by the provider, the user cannot change it
FromUser = 1 // Dependency given by the user
};
enum Origin
{
FromProvider,
FromUser
};
//! Standard constructor
QgsMapLayerDependency( const QString &layerId, Type type = DataDependency, Origin origin = FromUser );
QgsMapLayerDependency( const QString &layerId, Type type = DataDependency, Origin origin = FromUser );
%Docstring
Standard constructor
%End
//! Return the dependency type
Type type() const;
Type type() const;
%Docstring
Return the dependency type
:rtype: Type
%End
//! Return the dependency origin
Origin origin() const;
Origin origin() const;
%Docstring
Return the dependency origin
:rtype: Origin
%End
//! Return the ID of the layer this dependency depends on
QString layerId() const;
QString layerId() const;
%Docstring
Return the ID of the layer this dependency depends on
:rtype: str
%End
//! Comparison operator
bool operator==( const QgsMapLayerDependency &other ) const;
bool operator==( const QgsMapLayerDependency &other ) const;
%Docstring
Comparison operator
:rtype: bool
%End
//! hash operator
long __hash__() const;
//! hash operator
long __hash__() const;
%Docstring
:rtype: long
%End
%MethodCode
sipRes = qHash( *sipCpp );
sipRes = qHash( *sipCpp );
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerdependency.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,113 +1,163 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerlegend.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/**
* The QgsMapLayerLegend class is abstract interface for implementations
* of legends for one map layer.
*
* @note added in 2.6
*/
class QgsMapLayerLegend : QObject
{
%TypeHeaderCode
#include <qgsmaplayerlegend.h>
%Docstring
The QgsMapLayerLegend class is abstract interface for implementations
of legends for one map layer.
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include "qgsmaplayerlegend.h"
%End
public:
explicit QgsMapLayerLegend( QObject *parent /TransferThis/ = 0 );
// TODO: type, load/save settings
/**
* Return list of legend nodes to be used for a particular layer tree layer node.
* Ownership is transferred to the caller.
*/
virtual QList<QgsLayerTreeModelLegendNode*> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) = 0 /Factory/;
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) = 0 /Factory/;
%Docstring
Return list of legend nodes to be used for a particular layer tree layer node.
Ownership is transferred to the caller.
:rtype: list of QgsLayerTreeModelLegendNode
%End
// TODO: support for layer tree view delegates
//! Create new legend implementation for vector layer
static QgsMapLayerLegend *defaultVectorLegend( QgsVectorLayer *vl ) /Factory/;
%Docstring
Create new legend implementation for vector layer
:rtype: QgsMapLayerLegend
%End
//! Create new legend implementation for raster layer
static QgsMapLayerLegend *defaultRasterLegend( QgsRasterLayer *rl ) /Factory/;
%Docstring
Create new legend implementation for raster layer
:rtype: QgsMapLayerLegend
%End
//! Create new legend implementation for raster layer
static QgsMapLayerLegend *defaultPluginLegend( QgsPluginLayer *pl ) /Factory/;
%Docstring
Create new legend implementation for raster layer
:rtype: QgsMapLayerLegend
%End
signals:
//! Emitted when existing items/nodes got invalid and should be replaced by new ones
void itemsChanged();
%Docstring
Emitted when existing items/nodes got invalid and should be replaced by new ones
%End
};
/**
* Miscellaneous utility functions for handling of map layer legend
*
* @note added in 2.6
*/
class QgsMapLayerLegendUtils
{
%Docstring
Miscellaneous utility functions for handling of map layer legend
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include <qgsmaplayerlegend.h>
#include "qgsmaplayerlegend.h"
%End
public:
static void setLegendNodeOrder( QgsLayerTreeLayer *nodeLayer, const QList<int> &order );
static QList<int> legendNodeOrder( QgsLayerTreeLayer *nodeLayer );
%Docstring
:rtype: list of int
%End
static bool hasLegendNodeOrder( QgsLayerTreeLayer *nodeLayer );
%Docstring
:rtype: bool
%End
static void setLegendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QString &newLabel );
static QString legendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex );
%Docstring
:rtype: str
%End
static bool hasLegendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex );
%Docstring
:rtype: bool
%End
//! update according to layer node's custom properties (order of items, user labels for items)
static void applyLayerNodeProperties( QgsLayerTreeLayer *nodeLayer, QList<QgsLayerTreeModelLegendNode*> &nodes );
static void applyLayerNodeProperties( QgsLayerTreeLayer *nodeLayer, QList<QgsLayerTreeModelLegendNode *> &nodes );
%Docstring
update according to layer node's custom properties (order of items, user labels for items)
%End
};
/** Default legend implementation for vector layers
* @note added in 2.6
*/
class QgsDefaultVectorLayerLegend : QgsMapLayerLegend
{
%Docstring
Default legend implementation for vector layers
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include <qgsmaplayerlegend.h>
#include "qgsmaplayerlegend.h"
%End
public:
explicit QgsDefaultVectorLayerLegend( QgsVectorLayer *vl );
virtual QList<QgsLayerTreeModelLegendNode*> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
};
/** Default legend implementation for raster layers
* @note added in 2.6
*/
class QgsDefaultRasterLayerLegend : QgsMapLayerLegend
{
%Docstring
Default legend implementation for raster layers
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include <qgsmaplayerlegend.h>
#include "qgsmaplayerlegend.h"
%End
public:
explicit QgsDefaultRasterLayerLegend( QgsRasterLayer *rl );
virtual QList<QgsLayerTreeModelLegendNode*> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
};
/** Default legend implementation for plugin layers
* @note added in 2.6
*/
class QgsDefaultPluginLayerLegend : QgsMapLayerLegend
{
%Docstring
Default legend implementation for plugin layers
.. versionadded:: 2.6
%End
%TypeHeaderCode
#include <qgsmaplayerlegend.h>
#include "qgsmaplayerlegend.h"
%End
public:
explicit QgsDefaultPluginLayerLegend( QgsPluginLayer *pl );
virtual QList<QgsLayerTreeModelLegendNode*> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerlegend.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,24 +1,78 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapLayerRenderer
{
%TypeHeaderCode
#include <qgsmaplayerrenderer.h>
%Docstring
Base class for utility classes that encapsulate information necessary
for rendering of map layers. The rendering is typically done in a background
thread, so it is necessary to keep all structures required for rendering away
from the original map layer because it may change any time.
Because the data needs to be copied (to avoid the need for locking),
is is highly desirable to use copy-on-write where possible. This way,
the overhead of copying (both memory and CPU) will be kept low.
Qt containers and various Qt classes use implicit sharing.
The scenario will be:
1. renderer job (doing preparation in the GUI thread) calls
QgsMapLayer.createMapRenderer() and gets instance of this class.
The instance is initialized at that point and should not need
additional calls to QgsVectorLayer.
2. renderer job (still in GUI thread) stores the renderer for later use.
3. renderer job (in worker thread) calls QgsMapLayerRenderer.render()
4. renderer job (again in GUI thread) will check errors() and report them
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmaplayerrenderer.h"
%End
public:
QgsMapLayerRenderer( const QString &layerID );
virtual ~QgsMapLayerRenderer();
//! Do the rendering (based on data stored in the class)
virtual bool render() = 0;
%Docstring
Do the rendering (based on data stored in the class)
:rtype: bool
%End
//! Access to feedback object of the layer renderer (may be null)
//! @note added in QGIS 3.0
virtual QgsFeedback *feedback() const;
%Docstring
.. versionadded:: 3.0
:rtype: QgsFeedback
%End
//! Return list of errors (problems) that happened during the rendering
QStringList errors() const;
%Docstring
Return list of errors (problems) that happened during the rendering
:rtype: list of str
%End
//! Get access to the ID of the layer rendered by this class
QString layerId() const;
%Docstring
Get access to the ID of the layer rendered by this class
:rtype: str
%End
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,95 +1,211 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerstylemanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapLayerStyle
{
%Docstring
Stores style information (renderer, transparency, labeling, diagrams etc.) applicable to a map layer.
Stored data are considered as opaque - it is not possible to access them directly or modify them - it is
only possible to read or write layer's current style.
.. versionadded:: 2.8
%End
%TypeHeaderCode
#include <qgsmaplayerstylemanager.h>
#include "qgsmaplayerstylemanager.h"
%End
public:
//! construct invalid style
QgsMapLayerStyle();
%Docstring
construct invalid style
%End
//! construct style from QML definition (XML)
explicit QgsMapLayerStyle( const QString &xmlData );
%Docstring
construct style from QML definition (XML)
%End
//! Tell whether the style is valid (i.e. there is something stored in it)
bool isValid() const;
%Docstring
Tell whether the style is valid (i.e. there is something stored in it)
:rtype: bool
%End
//! Remove any stored style data (will get invalid)
void clear();
%Docstring
Remove any stored style data (will get invalid)
%End
//! Return XML content of the style
QString xmlData() const;
%Docstring
Return XML content of the style
:rtype: str
%End
//! Store layer's active style information in the instance
void readFromLayer( QgsMapLayer *layer );
//! Apply stored layer's style information to the layer
%Docstring
Store layer's active style information in the instance
%End
void writeToLayer( QgsMapLayer *layer ) const;
%Docstring
Apply stored layer's style information to the layer
%End
//! Read style configuration (for project file reading)
void readXml( const QDomElement &styleElement );
//! Write style configuration (for project file writing)
%Docstring
Read style configuration (for project file reading)
%End
void writeXml( QDomElement &styleElement ) const;
%Docstring
Write style configuration (for project file writing)
%End
};
class QgsMapLayerStyleManager : QObject
{
%Docstring
Management of styles for use with one map layer. Stored styles are identified by their names. The manager
always keep track of which style of the stored ones is currently active. When the current style is changed,
the new style is applied to the associated layer.
The class takes care of updating itself when the layer's current style configuration changes.
When some of layer style's properties change (e.g. transparency / colors), the style manager will
record them in the currently active style without any extra effort required.
When an instance is created, it creates "default" style (with empty name) recorded from the associated map layer
and it is set as the current style. The instance must always contain at least one style (which is the current).
The style which is marked as current has no style data stored in its entry. This is to avoid duplication
of data as all data is stored in map layer and can be retrieved easily. Also when saving, the entry for
the current style will be saved with no data because everything is already saved by the map layer itself.
The class also features support for temporary change of the layer's style, ideal for short-term use of a custom
style followed by restoration of the original style (for example, when rendering a map with a different than current style).
.. versionadded:: 2.8
%End
%TypeHeaderCode
#include <qgsmaplayerstylemanager.h>
#include "qgsmaplayerstylemanager.h"
%End
public:
//! Construct a style manager associated with a map layer (must not be null)
QgsMapLayerStyleManager( QgsMapLayer *layer );
%Docstring
Construct a style manager associated with a map layer (must not be null)
%End
//! Get pointer to the associated map layer
QgsMapLayer *layer() const;
%Docstring
Get pointer to the associated map layer
:rtype: QgsMapLayer
%End
//! Reset the style manager to a basic state - with one default style which is set as current
void reset();
%Docstring
Reset the style manager to a basic state - with one default style which is set as current
%End
//! Read configuration (for project loading)
void readXml( const QDomElement &mgrElement );
//! Write configuration (for project saving)
%Docstring
Read configuration (for project loading)
%End
void writeXml( QDomElement &mgrElement ) const;
%Docstring
Write configuration (for project saving)
%End
//! Return list of all defined style names
QStringList styles() const;
//! Return data of a stored style - accessed by its unique name
%Docstring
Return list of all defined style names
:rtype: list of str
%End
QgsMapLayerStyle style( const QString &name ) const;
%Docstring
Return data of a stored style - accessed by its unique name
:rtype: QgsMapLayerStyle
%End
//! Add a style with given name and data
//! @return true on success (name is unique and style is valid)
bool addStyle( const QString &name, const QgsMapLayerStyle &style );
//! Add style by cloning the current one
//! @return true on success
%Docstring
:return: true on success (name is unique and style is valid)
:rtype: bool
%End
bool addStyleFromLayer( const QString &name );
//! Remove a stored style
//! @return true on success (style exists and it is not the last one)
%Docstring
:return: true on success
:rtype: bool
%End
bool removeStyle( const QString &name );
//! Rename a stored style to a different name
//! @return true on success (style exists and new name is unique)
%Docstring
:return: true on success (style exists and it is not the last one)
:rtype: bool
%End
bool renameStyle( const QString &name, const QString &newName );
%Docstring
:return: true on success (style exists and new name is unique)
:rtype: bool
%End
//! Return name of the current style
QString currentStyle() const;
//! Set a different style as the current style - will apply it to the layer
//! @return true on success
%Docstring
Return name of the current style
:rtype: str
%End
bool setCurrentStyle( const QString &name );
%Docstring
:return: true on success
:rtype: bool
%End
//! Temporarily apply a different style to the layer. The argument
//! can be either a style name or a full QML style definition.
//! Each call must be paired with restoreOverrideStyle()
bool setOverrideStyle( const QString &styleDef );
//! Restore the original store after a call to setOverrideStyle()
%Docstring
Each call must be paired with restoreOverrideStyle()
:rtype: bool
%End
bool restoreOverrideStyle();
%Docstring
Restore the original store after a call to setOverrideStyle()
:rtype: bool
%End
signals:
//! Emitted when a new style has been added
void styleAdded( const QString &name );
//! Emitted when a style has been removed
%Docstring
Emitted when a new style has been added
%End
void styleRemoved( const QString &name );
//! Emitted when a style has been renamed
%Docstring
Emitted when a style has been removed
%End
void styleRenamed( const QString &oldName, const QString &newName );
//! Emitted when the current style has been changed
%Docstring
Emitted when a style has been renamed
%End
void currentStyleChanged( const QString &currentName );
%Docstring
Emitted when the current style has been changed
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerstylemanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,25 +1,100 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderercache.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapRendererCache : QObject
{
%TypeHeaderCode
#include <qgsmaprenderercache.h>
%Docstring
This class is responsible for keeping cache of rendered images resulting from
a map rendering job.
Once a job has a rendered image stored in the cache (using setCacheImage(...)),
the cache listens to repaintRequested() signals from dependent layers.
If triggered, the cache removes the rendered image (and disconnects from the
layers).
The class is thread-safe (multiple classes can access the same instance safely).
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmaprenderercache.h"
%End
public:
QgsMapRendererCache();
void clear();
%Docstring
Invalidates the cache contents, clearing all cached images.
.. seealso:: clearCacheImage()
%End
bool init( const QgsRectangle &extent, double scale );
%Docstring
Initialize cache: set new parameters and clears the cache if any
parameters have changed since last initialization.
:return: flag whether the parameters are the same as last time
:rtype: bool
%End
void setCacheImage( const QString &cacheKey, const QImage &image, const QList< QgsMapLayer* > &dependentLayers = QList< QgsMapLayer* >() );
void setCacheImage( const QString &cacheKey, const QImage &image, const QList< QgsMapLayer * > &dependentLayers = QList< QgsMapLayer * >() );
%Docstring
Set the cached ``image`` for a particular ``cacheKey``. The ``cacheKey`` usually
matches the QgsMapLayer.id() which the image is a render of.
A list of ``dependentLayers`` should be passed containing all layer
on which this cache image is dependent. If any of these layers triggers a
repaint then the cache image will be cleared.
.. seealso:: cacheImage()
%End
bool hasCacheImage( const QString &cacheKey ) const;
%Docstring
Returns true if the cache contains an image with the specified ``cacheKey``.
.. versionadded:: 3.0
.. seealso:: cacheImage()
:rtype: bool
%End
QImage cacheImage( const QString &cacheKey ) const;
%Docstring
Returns the cached image for the specified ``cacheKey``. The ``cacheKey`` usually
matches the QgsMapLayer.id() which the image is a render of.
Returns a null image if it is not cached.
.. seealso:: setCacheImage()
.. seealso:: hasCacheImage()
:rtype: QImage
%End
QList< QgsMapLayer* > dependentLayers( const QString &cacheKey ) const;
QList< QgsMapLayer * > dependentLayers( const QString &cacheKey ) const;
%Docstring
Returns a list of map layers on which an image in the cache depends.
.. versionadded:: 3.0
:rtype: list of QgsMapLayer
%End
void clearCacheImage( const QString &cacheKey );
%Docstring
Removes an image from the cache with matching ``cacheKey``.
.. seealso:: clear()
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderercache.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,18 +1,29 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderercustompainterjob.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** Job implementation that renders everything sequentially using a custom painter.
*
* Also supports synchronous rendering in main thread for cases when rendering in background
* is not an option because of some technical limitations (e.g. printing to printer on some
* platforms).
*
* @note added in 2.4
*/
class QgsMapRendererCustomPainterJob : QgsMapRendererJob
{
%TypeHeaderCode
#include <qgsmaprenderercustompainterjob.h>
%Docstring
Job implementation that renders everything sequentially using a custom painter.
Also supports synchronous rendering in main thread for cases when rendering in background
is not an option because of some technical limitations (e.g. printing to printer on some
platforms).
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmaprenderercustompainterjob.h"
%End
public:
QgsMapRendererCustomPainterJob( const QgsMapSettings &settings, QPainter *painter );
~QgsMapRendererCustomPainterJob();
@ -25,32 +36,39 @@ class QgsMapRendererCustomPainterJob : QgsMapRendererJob
virtual bool usedCachedLabels() const;
virtual QgsLabelingResults *takeLabelingResults() /Transfer/;
//! @note not available in python bindings
// const LayerRenderJobs& jobs() const { return mLayerJobs; }
/**
* Wait for the job to be finished - and keep the thread's event loop running while waiting.
*
* With a call to waitForFinished(), the waiting is done with a synchronization primitive
* and does not involve processing of messages. That may cause issues to code which requires
* some events to be handled in the main thread. Some plugins hooking into the rendering
* pipeline may require this in order to work properly - for example, OpenLayers plugin
* which uses a QWebPage in the main thread.
*
* Ideally the "wait for finished" method should not be used at all. The code triggering
* rendering should not need to actively wait for rendering to finish.
*/
void waitForFinishedWithEventLoop( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents );
%Docstring
Wait for the job to be finished - and keep the thread's event loop running while waiting.
With a call to waitForFinished(), the waiting is done with a synchronization primitive
and does not involve processing of messages. That may cause issues to code which requires
some events to be handled in the main thread. Some plugins hooking into the rendering
pipeline may require this in order to work properly - for example, OpenLayers plugin
which uses a QWebPage in the main thread.
Ideally the "wait for finished" method should not be used at all. The code triggering
rendering should not need to actively wait for rendering to finish.
%End
/**
* Render the map synchronously in this thread. The function does not return until the map
* is completely rendered.
*
* This is an alternative to ordinary API (using start() + waiting for finished() signal).
* Users are discouraged to use this method unless they have a strong reason for doing it.
* The synchronous rendering blocks the main thread, making the application unresponsive.
* Also, it is not possible to cancel rendering while it is in progress.
*/
void renderSynchronously();
%Docstring
Render the map synchronously in this thread. The function does not return until the map
is completely rendered.
This is an alternative to ordinary API (using start() + waiting for finished() signal).
Users are discouraged to use this method unless they have a strong reason for doing it.
The synchronous rendering blocks the main thread, making the application unresponsive.
Also, it is not possible to cancel rendering while it is in progress.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderercustompainterjob.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,47 +1,108 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprendererjob.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapRendererJob : QObject
{
%TypeHeaderCode
#include <qgsmaprendererjob.h>
%Docstring
Abstract base class for map rendering implementations.
The API is designed in a way that rendering is done asynchronously, therefore
the caller is not blocked while the rendering is in progress. Non-blocking
operation is quite important because the rendering can take considerable
amount of time.
Common use case:
0. prepare QgsMapSettings with rendering configuration (extent, layer, map size, ...)
1. create QgsMapRendererJob subclass with QgsMapSettings instance
2. connect to job's finished() signal
3. call start(). Map rendering will start in background, the function immediately returns
4. at some point, slot connected to finished() signal is called, map rendering is done
It is possible to cancel the rendering job while it is active by calling cancel() function.
The following subclasses are available:
- QgsMapRendererSequentialJob - renders map in one background thread to an image
- QgsMapRendererParallelJob - renders map in multiple background threads to an image
- QgsMapRendererCustomPainterJob - renders map with given QPainter in one background thread
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmaprendererjob.h"
%End
public:
QgsMapRendererJob( const QgsMapSettings &settings );
virtual ~QgsMapRendererJob();
//! Start the rendering job and immediately return.
//! Does nothing if the rendering is already in progress.
virtual void start() = 0;
%Docstring
Does nothing if the rendering is already in progress.
%End
//! Stop the rendering job - does not return until the job has terminated.
//! Does nothing if the rendering is not active.
virtual void cancel() = 0;
%Docstring
Does nothing if the rendering is not active.
%End
virtual void cancelWithoutBlocking() = 0;
%Docstring
Triggers cancelation of the rendering job without blocking. The render job will continue
to operate until it is able to cancel, at which stage the finished() signal will be emitted.
Does nothing if the rendering is not active.
%End
//! Block until the job has finished.
virtual void waitForFinished() = 0;
%Docstring
Block until the job has finished.
%End
//! Tell whether the rendering job is currently running in background.
virtual bool isActive() const = 0;
%Docstring
Tell whether the rendering job is currently running in background.
:rtype: bool
%End
virtual bool usedCachedLabels() const = 0;
%Docstring
Returns true if the render job was able to use a cached labeling solution.
If so, any previously stored labeling results (see takeLabelingResults())
should be retained.
.. seealso:: takeLabelingResults()
.. versionadded:: 3.0
:rtype: bool
%End
//! Get pointer to internal labeling engine (in order to get access to the results)
virtual QgsLabelingResults *takeLabelingResults() = 0 /Transfer/;
%Docstring
Get pointer to internal labeling engine (in order to get access to the results).
This should not be used if cached labeling was redrawn - see usedCachedLabels().
.. seealso:: usedCachedLabels()
:rtype: QgsLabelingResults
%End
//! @note Added in QGIS 3.0
//! Set the feature filter provider used by the QgsRenderContext of
//! each LayerRenderJob.
//! Ownership is not transferred and the provider must not be deleted
//! before the render job.
void setFeatureFilterProvider( const QgsFeatureFilterProvider *f );
%Docstring
before the render job.
%End
//! @note Added in QGIS 3.0
//! Returns the feature filter provider used by the QgsRenderContext of
//! each LayerRenderJob.
const QgsFeatureFilterProvider *featureFilterProvider() const;
%Docstring
each LayerRenderJob.
:rtype: QgsFeatureFilterProvider
%End
struct Error
{
@ -51,56 +112,95 @@ class QgsMapRendererJob : QObject
QString message;
};
typedef QList<QgsMapRendererJob::Error> Errors;
typedef QList<Error> Errors;
//! List of errors that happened during the rendering job - available when the rendering has been finished
Errors errors() const;
%Docstring
List of errors that happened during the rendering job - available when the rendering has been finished
:rtype: Errors
%End
//! Assign a cache to be used for reading and storing rendered images of individual layers.
//! Does not take ownership of the object.
void setCache( QgsMapRendererCache *cache );
%Docstring
Does not take ownership of the object.
%End
//! Find out how long it took to finish the job (in milliseconds)
int renderingTime() const;
%Docstring
Find out how long it took to finish the job (in milliseconds)
:rtype: int
%End
/**
* Return map settings with which this job was started.
* @return A QgsMapSettings instance with render settings
* @note added in 2.8
*/
const QgsMapSettings &mapSettings() const;
%Docstring
Return map settings with which this job was started.
:return: A QgsMapSettings instance with render settings
.. versionadded:: 2.8
:rtype: QgsMapSettings
%End
signals:
/**
* Emitted when the layers are rendered.
* Rendering labels is not yet done. If the fully rendered layer including labels is required use
* finished() instead.
*
* @note Added in QGIS 3.0
*/
void renderingLayersFinished();
//! emitted when asynchronous rendering is finished (or canceled).
void renderingLayersFinished();
%Docstring
Emitted when the layers are rendered.
Rendering labels is not yet done. If the fully rendered layer including labels is required use
finished() instead.
.. versionadded:: 3.0
%End
void finished();
%Docstring
emitted when asynchronous rendering is finished (or canceled).
%End
protected:
};
/** Intermediate base class adding functionality that allows client to query the rendered image.
* The image can be queried even while the rendering is still in progress to get intermediate result
*
* @note added in 2.4
*/
class QgsMapRendererQImageJob : QgsMapRendererJob
{
%TypeHeaderCode
#include <qgsmaprendererjob.h>
%Docstring
Intermediate base class adding functionality that allows client to query the rendered image.
The image can be queried even while the rendering is still in progress to get intermediate result
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmaprendererjob.h"
%End
public:
QgsMapRendererQImageJob( const QgsMapSettings &settings );
//! Get a preview/resulting image
virtual QImage renderedImage() = 0;
%Docstring
Get a preview/resulting image
:rtype: QImage
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprendererjob.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,17 +1,27 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprendererparalleljob.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** Job implementation that renders all layers in parallel.
*
* The resulting map image can be retrieved with renderedImage() function.
* It is safe to call that function while rendering is active to see preview of the map.
*
* @note added in 2.4
*/
class QgsMapRendererParallelJob : QgsMapRendererQImageJob
{
%TypeHeaderCode
#include <qgsmaprendererparalleljob.h>
%Docstring
Job implementation that renders all layers in parallel.
The resulting map image can be retrieved with renderedImage() function.
It is safe to call that function while rendering is active to see preview of the map.
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmaprendererparalleljob.h"
%End
public:
QgsMapRendererParallelJob( const QgsMapSettings &settings );
~QgsMapRendererParallelJob();
@ -21,11 +31,19 @@ class QgsMapRendererParallelJob : QgsMapRendererQImageJob
virtual void cancelWithoutBlocking();
virtual void waitForFinished();
virtual bool isActive() const;
virtual bool usedCachedLabels() const;
virtual bool usedCachedLabels() const;
virtual QgsLabelingResults *takeLabelingResults() /Transfer/;
// from QgsMapRendererJobWithPreview
virtual QImage renderedImage();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprendererparalleljob.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,18 +1,28 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderersequentialjob.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** Job implementation that renders everything sequentially in one thread.
*
* The resulting map image can be retrieved with renderedImage() function.
* It is safe to call that function while rendering is active to see preview of the map.
*
* @note added in 2.4
*/
class QgsMapRendererSequentialJob : QgsMapRendererQImageJob
{
%TypeHeaderCode
#include <qgsmaprenderersequentialjob.h>
%Docstring
Job implementation that renders everything sequentially in one thread.
The resulting map image can be retrieved with renderedImage() function.
It is safe to call that function while rendering is active to see preview of the map.
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmaprenderersequentialjob.h"
%End
public:
QgsMapRendererSequentialJob( const QgsMapSettings &settings );
~QgsMapRendererSequentialJob();
@ -22,14 +32,23 @@ class QgsMapRendererSequentialJob : QgsMapRendererQImageJob
virtual void cancelWithoutBlocking();
virtual void waitForFinished();
virtual bool isActive() const;
virtual bool usedCachedLabels() const;
virtual bool usedCachedLabels() const;
virtual QgsLabelingResults *takeLabelingResults() /Transfer/;
// from QgsMapRendererJobWithPreview
virtual QImage renderedImage();
public slots:
void internalFinished();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaprenderersequentialjob.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,259 +1,410 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmapsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapSettings
{
%TypeHeaderCode
#include <qgsmapsettings.h>
%Docstring
The QgsMapSettings class contains configuration for rendering of the map.
The rendering itself is done by QgsMapRendererJob subclasses.
In order to set up QgsMapSettings instance, it is necessary to set at least
few members: extent, output size and layers.
QgsMapSettings and QgsMapRendererJob (+subclasses) are intended to replace
QgsMapRenderer class that existed before QGIS 2.4. The advantage of the new
classes is that they separate the settings from the rendering and provide
asynchronous API for map rendering.
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include "qgsmapsettings.h"
%End
public:
QgsMapSettings();
//! Return geographical coordinates of the rectangle that should be rendered.
//! The actual visible extent used for rendering could be slightly different
//! since the given extent may be expanded in order to fit the aspect ratio
//! of output size. Use visibleExtent() to get the resulting extent.
QgsRectangle extent() const;
//! Set coordinates of the rectangle which should be rendered.
//! The actual visible extent used for rendering could be slightly different
//! since the given extent may be expanded in order to fit the aspect ratio
//! of output size. Use visibleExtent() to get the resulting extent.
%Docstring
of output size. Use visibleExtent() to get the resulting extent.
:rtype: QgsRectangle
%End
void setExtent( const QgsRectangle &rect, bool magnified = true );
%Docstring
of output size. Use visibleExtent() to get the resulting extent.
%End
//! Return the size of the resulting map image
QSize outputSize() const;
//! Set the size of the resulting map image
%Docstring
Return the size of the resulting map image
:rtype: QSize
%End
void setOutputSize( QSize size );
%Docstring
Set the size of the resulting map image
%End
//! Return the rotation of the resulting map image
//! Units are clockwise degrees
//! @note added in 2.8
double rotation() const;
//! Set the rotation of the resulting map image
//! Units are clockwise degrees
//! @note added in 2.8
%Docstring
.. versionadded:: 2.8
:rtype: float
%End
void setRotation( double degrees );
%Docstring
.. versionadded:: 2.8
%End
//! Return DPI used for conversion between real world units (e.g. mm) and pixels
//! Default value is 96
double outputDpi() const;
//! Set DPI used for conversion between real world units (e.g. mm) and pixels
%Docstring
Default value is 96
:rtype: float
%End
void setOutputDpi( double dpi );
%Docstring
Set DPI used for conversion between real world units (e.g. mm) and pixels
%End
/**
* Set the magnification factor.
* @param factor the factor of magnification
* @note added in 2.16
* @see magnificationFactor()
*/
void setMagnificationFactor( double factor );
%Docstring
Set the magnification factor.
\param factor the factor of magnification
.. versionadded:: 2.16
.. seealso:: magnificationFactor()
%End
//! Return the magnification factor.
//! @note added in 2.16
//! @see setMagnificationFactor()
double magnificationFactor() const;
%Docstring
.. seealso:: setMagnificationFactor()
:rtype: float
%End
//! Get list of layer IDs for map rendering
//! The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
QStringList layerIds() const;
//! Get list of layers for map rendering
//! The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
QList<QgsMapLayer*> layers();
//! Set list of layers for map rendering. The layers must be registered in QgsProject.
//! The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
void setLayers( const QList<QgsMapLayer*> &layers );
%Docstring
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
:rtype: list of str
%End
QList<QgsMapLayer *> layers() const;
%Docstring
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
:rtype: list of QgsMapLayer
%End
void setLayers( const QList<QgsMapLayer *> &layers );
%Docstring
The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
%End
//! Get map of map layer style overrides (key: layer ID, value: style name) where a different style should be used instead of the current one
//! @note added in 2.8
QMap<QString, QString> layerStyleOverrides() const;
//! Set map of map layer style overrides (key: layer ID, value: style name) where a different style should be used instead of the current one
//! @note added in 2.8
%Docstring
.. versionadded:: 2.8
:rtype: QMap<str, QString>
%End
void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
%Docstring
.. versionadded:: 2.8
%End
/** Get custom rendering flags. Layers might honour these to alter their rendering.
* @returns custom flags strings, separated by ';'
* @note added in QGIS 2.16
* @see setCustomRenderFlags()
*/
QString customRenderFlags() const;
%Docstring
Get custom rendering flags. Layers might honour these to alter their rendering.
:return: custom flags strings, separated by ';'
.. versionadded:: 2.16
.. seealso:: setCustomRenderFlags()
:rtype: str
%End
/** Sets the custom rendering flags. Layers might honour these to alter their rendering.
* @param customRenderFlags custom flags strings, separated by ';'
* @note added in QGIS 2.16
* @see customRenderFlags()
*/
void setCustomRenderFlags( const QString &customRenderFlags );
%Docstring
Sets the custom rendering flags. Layers might honour these to alter their rendering.
\param customRenderFlags custom flags strings, separated by ';'
.. versionadded:: 2.16
.. seealso:: customRenderFlags()
%End
//! sets destination coordinate reference system
void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
//! returns CRS of destination coordinate reference system
%Docstring
sets destination coordinate reference system
%End
QgsCoordinateReferenceSystem destinationCrs() const;
%Docstring
returns CRS of destination coordinate reference system
:rtype: QgsCoordinateReferenceSystem
%End
//! Get units of map's geographical coordinates - used for scale calculation
QgsUnitTypes::DistanceUnit mapUnits() const;
%Docstring
Get units of map's geographical coordinates - used for scale calculation
:rtype: QgsUnitTypes.DistanceUnit
%End
//! Set the background color of the map
void setBackgroundColor( const QColor &color );
//! Get the background color of the map
%Docstring
Set the background color of the map
%End
QColor backgroundColor() const;
%Docstring
Get the background color of the map
:rtype: QColor
%End
//! Set color that is used for drawing of selected vector features
void setSelectionColor( const QColor &color );
//! Get color that is used for drawing of selected vector features
%Docstring
Set color that is used for drawing of selected vector features
%End
QColor selectionColor() const;
%Docstring
Get color that is used for drawing of selected vector features
:rtype: QColor
%End
//! Enumeration of flags that adjust the way the map is rendered
enum Flag
{
Antialiasing, //!< Enable anti-aliasing for map rendering
DrawEditingInfo, //!< Enable drawing of vertex markers for layers in editing mode
ForceVectorOutput, //!< Vector graphics should not be cached and drawn as raster images
UseAdvancedEffects, //!< Enable layer transparency and blending effects
DrawLabeling, //!< Enable drawing of labels on top of the map
UseRenderingOptimization, //!< Enable vector simplification and other rendering optimizations
DrawSelection, //!< Whether vector selections should be shown in the rendered map
DrawSymbolBounds, //!< Draw bounds of symbols (for debugging/testing)
RenderMapTile, //!< Draw map such that there are no problems between adjacent tiles
RenderPartialOutput, //!< Whether to make extra effort to update map image with partially rendered layers (better for interactive map canvas). Added in QGIS 3.0
Antialiasing,
DrawEditingInfo,
ForceVectorOutput,
UseAdvancedEffects,
DrawLabeling,
UseRenderingOptimization,
DrawSelection,
DrawSymbolBounds,
RenderMapTile,
RenderPartialOutput,
// TODO
};
typedef QFlags<QgsMapSettings::Flag> Flags;
//! Set combination of flags that will be used for rendering
void setFlags( Flags flags );
//! Enable or disable a particular flag (other flags are not affected)
void setFlags( QgsMapSettings::Flags flags );
%Docstring
Set combination of flags that will be used for rendering
%End
void setFlag( Flag flag, bool on = true );
//! Return combination of flags used for rendering
%Docstring
Enable or disable a particular flag (other flags are not affected)
%End
Flags flags() const;
//! Check whether a particular flag is enabled
%Docstring
Return combination of flags used for rendering
:rtype: Flags
%End
bool testFlag( Flag flag ) const;
%Docstring
Check whether a particular flag is enabled
:rtype: bool
%End
//! sets format of internal QImage
void setOutputImageFormat( QImage::Format format );
//! format of internal QImage, default QImage::Format_ARGB32_Premultiplied
%Docstring
sets format of internal QImage
%End
QImage::Format outputImageFormat() const;
%Docstring
format of internal QImage, default QImage.Format_ARGB32_Premultiplied
:rtype: QImage.Format
%End
//! Check whether the map settings are valid and can be used for rendering
bool hasValidSettings() const;
//! Return the actual extent derived from requested extent that takes takes output image size into account
%Docstring
Check whether the map settings are valid and can be used for rendering
:rtype: bool
%End
QgsRectangle visibleExtent() const;
//! Return the visible area as a polygon (may be rotated)
//! @note added in 2.8
%Docstring
Return the actual extent derived from requested extent that takes takes output image size into account
:rtype: QgsRectangle
%End
QPolygonF visiblePolygon() const;
//! Return the distance in geographical coordinates that equals to one pixel in the map
%Docstring
.. versionadded:: 2.8
:rtype: QPolygonF
%End
double mapUnitsPerPixel() const;
//! Return the calculated scale of the map
%Docstring
Return the distance in geographical coordinates that equals to one pixel in the map
:rtype: float
%End
double scale() const;
%Docstring
Return the calculated scale of the map
:rtype: float
%End
/** Sets the expression context. This context is used for all expression evaluation
* associated with this map settings.
* @see expressionContext()
* @note added in QGIS 2.12
*/
void setExpressionContext( const QgsExpressionContext &context );
%Docstring
Sets the expression context. This context is used for all expression evaluation
associated with this map settings.
.. seealso:: expressionContext()
.. versionadded:: 2.12
%End
/** Gets the expression context. This context should be used for all expression evaluation
* associated with this map settings.
* @see setExpressionContext()
* @note added in QGIS 2.12
*/
const QgsExpressionContext &expressionContext() const;
%Docstring
Gets the expression context. This context should be used for all expression evaluation
associated with this map settings.
.. seealso:: setExpressionContext()
.. versionadded:: 2.12
:rtype: QgsExpressionContext
%End
// -- utility functions --
//! @note not available in python bindings
//const QgsDatumTransformStore &datumTransformStore() const;
QgsDatumTransformStore &datumTransformStore();
%Docstring
:rtype: QgsDatumTransformStore
%End
const QgsMapToPixel &mapToPixel() const;
%Docstring
:rtype: QgsMapToPixel
%End
/** Computes an *estimated* conversion factor between layer and map units: layerUnits * layerToMapUnits = mapUnits
* @param layer The layer
* @param referenceExtent A reference extent based on which to perform the computation. If not specified, the layer extent is used
* @note added in QGIS 2.12
*/
double layerToMapUnits( const QgsMapLayer *layer, const QgsRectangle &referenceExtent = QgsRectangle() ) const;
%Docstring
Computes an *estimated* conversion factor between layer and map units: layerUnits * layerToMapUnits = mapUnits
\param layer The layer
\param referenceExtent A reference extent based on which to perform the computation. If not specified, the layer extent is used
.. versionadded:: 2.12
:rtype: float
%End
/**
* @brief transform bounding box from layer's CRS to output CRS
* @see layerToMapCoordinates( QgsMapLayer* layer, QgsRectangle rect ) if you want to transform a rectangle
* @return a bounding box (aligned rectangle) containing the transformed extent
*/
QgsRectangle layerExtentToOutputExtent( const QgsMapLayer *layer, QgsRectangle extent ) const;
%Docstring
transform bounding box from layer's CRS to output CRS
.. seealso:: layerToMapCoordinates( QgsMapLayer* layer, QgsRectangle rect ) if you want to transform a rectangle
:return: a bounding box (aligned rectangle) containing the transformed extent
:rtype: QgsRectangle
%End
/**
* @brief transform bounding box from output CRS to layer's CRS
* @see mapToLayerCoordinates( QgsMapLayer* layer,QgsRectangle rect ) if you want to transform a rectangle
* @return a bounding box (aligned rectangle) containing the transformed extent
*/
QgsRectangle outputExtentToLayerExtent( const QgsMapLayer *layer, QgsRectangle extent ) const;
%Docstring
transform bounding box from output CRS to layer's CRS
.. seealso:: mapToLayerCoordinates( QgsMapLayer* layer,QgsRectangle rect ) if you want to transform a rectangle
:return: a bounding box (aligned rectangle) containing the transformed extent
:rtype: QgsRectangle
%End
/**
* @brief transform point coordinates from layer's CRS to output CRS
* @return the transformed point
*/
QgsPoint layerToMapCoordinates( const QgsMapLayer *layer, QgsPoint point ) const;
%Docstring
transform point coordinates from layer's CRS to output CRS
:return: the transformed point
:rtype: QgsPoint
%End
/**
* @brief transform rectangle from layer's CRS to output CRS
* @see layerExtentToOutputExtent() if you want to transform a bounding box
* @return the transformed rectangle
*/
QgsRectangle layerToMapCoordinates( const QgsMapLayer *layer, QgsRectangle rect ) const;
%Docstring
transform rectangle from layer's CRS to output CRS
.. seealso:: layerExtentToOutputExtent() if you want to transform a bounding box
:return: the transformed rectangle
:rtype: QgsRectangle
%End
/**
* @brief transform point coordinates from output CRS to layer's CRS
* @return the transformed point
*/
QgsPoint mapToLayerCoordinates( const QgsMapLayer *layer, QgsPoint point ) const;
%Docstring
transform point coordinates from output CRS to layer's CRS
:return: the transformed point
:rtype: QgsPoint
%End
/**
* @brief transform rectangle from output CRS to layer's CRS
* @see outputExtentToLayerExtent() if you want to transform a bounding box
* @return the transformed rectangle
*/
QgsRectangle mapToLayerCoordinates( const QgsMapLayer *layer, QgsRectangle rect ) const;
%Docstring
transform rectangle from output CRS to layer's CRS
.. seealso:: outputExtentToLayerExtent() if you want to transform a bounding box
:return: the transformed rectangle
:rtype: QgsRectangle
%End
/**
* @brief Return coordinate transform from layer's CRS to destination CRS
* @param layer
* @return transform - may be invalid if the transform is not needed
*/
QgsCoordinateTransform layerTransform( const QgsMapLayer *layer ) const;
%Docstring
Return coordinate transform from layer's CRS to destination CRS
\param layer
:return: transform - may be invalid if the transform is not needed
:rtype: QgsCoordinateTransform
%End
//! returns current extent of layer set
QgsRectangle fullExtent() const;
%Docstring
returns current extent of layer set
:rtype: QgsRectangle
%End
/* serialization */
void readXml( QDomNode &node );
%Docstring
serialization */
%End
void writeXml( QDomNode &node, QDomDocument &doc );
/** Sets the segmentation tolerance applied when rendering curved geometries
@param tolerance the segmentation tolerance*/
void setSegmentationTolerance( double tolerance );
/** Gets the segmentation tolerance applied when rendering curved geometries*/
%Docstring
Sets the segmentation tolerance applied when rendering curved geometries
\param tolerance the segmentation tolerance*
%End
double segmentationTolerance() const;
/** Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
@param type the segmentation tolerance typename*/
%Docstring
Gets the segmentation tolerance applied when rendering curved geometries
:rtype: float
%End
void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
/** Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)*/
%Docstring
Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
\param type the segmentation tolerance typename*
%End
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const;
%Docstring
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
:rtype: QgsAbstractGeometry.SegmentationToleranceType
%End
/**
* Sets global configuration of the labeling engine
* \since QGIS 3.0
*/
void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
%Docstring
Sets global configuration of the labeling engine
.. versionadded:: 3.0
%End
/**
* Returns global configuration of the labeling engine
* \since QGIS 3.0
*/
const QgsLabelingEngineSettings &labelingEngineSettings() const;
%Docstring
Returns global configuration of the labeling engine
.. versionadded:: 3.0
:rtype: QgsLabelingEngineSettings
%End
protected:
void updateDerived();
};
QFlags<QgsMapSettings::Flag> operator|(QgsMapSettings::Flag f1, QFlags<QgsMapSettings::Flag> f2);
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmapsettings.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,165 +1,205 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaptopixel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** \ingroup core
* Perform transforms between map coordinates and device coordinates.
*
* This class can convert device coordinates to map coordinates and vice versa.
*/
class QgsMapToPixel
{
%TypeHeaderCode
#include <qgsmaptopixel.h>
%Docstring
Perform transforms between map coordinates and device coordinates.
This class can convert device coordinates to map coordinates and vice versa.
%End
%TypeHeaderCode
#include "qgsmaptopixel.h"
%End
public:
/**
* Constructor
* @param mapUnitsPerPixel Map units per pixel
* @param centerX X coordinate of map center, in geographical units
* @param centerY Y coordinate of map center, in geographical units
* @param widthPixels Output width, in pixels
* @param heightPixels Output height, in pixels
* @param rotation clockwise rotation in degrees
* @note added in 2.8
*/
QgsMapToPixel( double mapUnitsPerPixel, double centerX, double centerY, int widthPixels, int heightPixels, double rotation );
%Docstring
Constructor
\param mapUnitsPerPixel Map units per pixel
\param centerX X coordinate of map center, in geographical units
\param centerY Y coordinate of map center, in geographical units
\param widthPixels Output width, in pixels
\param heightPixels Output height, in pixels
\param rotation clockwise rotation in degrees
.. versionadded:: 2.8
%End
/**
* Constructor
* @param mapUnitsPerPixel Map units per pixel
*/
QgsMapToPixel( double mapUnitsPerPixel );
%Docstring
Constructor
\param mapUnitsPerPixel Map units per pixel
%End
/** Returns a new QgsMapToPixel created using a specified scale and distance unit.
* @param scale map scale
* @param dpi screen DPI
* @param mapUnits map units
* @returns matching QgsMapToPixel
* @note added in QGIS 3.0
*/
static QgsMapToPixel fromScale( double scale, QgsUnitTypes::DistanceUnit mapUnits, double dpi = 96 );
%Docstring
Returns a new QgsMapToPixel created using a specified scale and distance unit.
\param scale map scale
\param dpi screen DPI
\param mapUnits map units
:return: matching QgsMapToPixel
.. versionadded:: 3.0
:rtype: QgsMapToPixel
%End
/**
* Constructor
*
* Use setParameters to fill
*/
QgsMapToPixel();
%Docstring
Constructor
Use setParameters to fill
%End
/**
* Transform the point from map (world) coordinates to device coordinates
* @param p Point to transform
* @return QgsPoint in device coordinates
*/
QgsPoint transform( const QgsPoint &p ) const;
%Docstring
Transform the point from map (world) coordinates to device coordinates
\param p Point to transform
:return: QgsPoint in device coordinates
:rtype: QgsPoint
%End
void transform( QgsPoint *p ) const;
/**
* Transform the point specified by x,y from map (world)
* coordinates to device coordinates
* @param x x cordinate o point to transform
* @param y y coordinate of point to transform
* @return QgsPoint in device coordinates
*/
QgsPoint transform( double x, double y ) const;
QgsPoint transform( qreal x, qreal y ) const;
%Docstring
Transform the point specified by x,y from map (world)
coordinates to device coordinates
\param x x cordinate o point to transform
\param y y coordinate of point to transform
:return: QgsPoint in device coordinates
:rtype: QgsPoint
%End
/**
* Transform device coordinates to map coordinates. Modifies the
* given coordinates in place. Intended as a fast way to do the
* transform.
*/
void transformInPlace( double &x, double &y ) const;
%Docstring
Transform device coordinates to map coordinates. Modifies the
given coordinates in place. Intended as a fast way to do the
transform.
%End
// @note not available in python bindings
// void transformInPlace( qreal &x, qreal &y ) const;
/**
* Transform device coordinates to map coordinates. Modifies the
* given coordinates in place. Intended as a fast way to do the
* transform.
* @note not available in python bindings
*/
// template <class T>
// void transformInPlace( QVector<double> &x, QVector<double> &y ) const;
QgsPoint toMapCoordinates( int x, int y ) const;
%Docstring
:rtype: QgsPoint
%End
//! Transform device coordinates to map (world) coordinates
QgsPoint toMapCoordinatesF( double x, double y ) const;
%Docstring
Transform device coordinates to map (world) coordinates
:rtype: QgsPoint
%End
/**
* Transform device coordinates to map (world) coordinates
* @param p Point to be converted to map cooordinates
* @return QgsPoint in map coorndiates
*/
QgsPoint toMapCoordinates( QPoint p ) const;
%Docstring
Transform device coordinates to map (world) coordinates
\param p Point to be converted to map cooordinates
:return: QgsPoint in map coorndiates
:rtype: QgsPoint
%End
QgsPoint toMapPoint( double x, double y ) const;
%Docstring
:rtype: QgsPoint
%End
/**
* Set map units per pixel
* @param mapUnitsPerPixel Map units per pixel
*/
void setMapUnitsPerPixel( double mapUnitsPerPixel );
%Docstring
Set map units per pixel
\param mapUnitsPerPixel Map units per pixel
%End
//! Return current map units per pixel
double mapUnitsPerPixel() const;
%Docstring
Return current map units per pixel
:rtype: float
%End
/**
* Return current map width in pixels
* The information is only known if setRotation was used
* @note added in 2.8
*/
int mapWidth() const;
%Docstring
Return current map width in pixels
The information is only known if setRotation was used
.. versionadded:: 2.8
:rtype: int
%End
/**
* Return current map height in pixels
* @note added in 2.8
*/
int mapHeight() const;
%Docstring
Return current map height in pixels
.. versionadded:: 2.8
:rtype: int
%End
/**
* Set map rotation in degrees (clockwise)
* @param degrees clockwise rotation in degrees
* @param cx X ordinate of map center in geographical units
* @param cy Y ordinate of map center in geographical units
* @note added in 2.8
*/
void setMapRotation( double degrees, double cx, double cy );
%Docstring
Set map rotation in degrees (clockwise)
\param degrees clockwise rotation in degrees
\param cx X ordinate of map center in geographical units
\param cy Y ordinate of map center in geographical units
.. versionadded:: 2.8
%End
/**
* Return current map rotation in degrees
* @note added in 2.8
*/
double mapRotation() const;
%Docstring
Return current map rotation in degrees
.. versionadded:: 2.8
:rtype: float
%End
/**
* Set parameters for use in transforming coordinates
* @param mapUnitsPerPixel Map units per pixel
* @param centerX X coordinate of map center, in geographical units
* @param centerY Y coordinate of map center, in geographical units
* @param widthPixels Output width, in pixels
* @param heightPixels Output height, in pixels
* @param rotation clockwise rotation in degrees
* @note added in 2.8
*/
void setParameters( double mapUnitsPerPixel, double centerX, double centerY, int widthPixels, int heightPixels, double rotation );
%Docstring
Set parameters for use in transforming coordinates
\param mapUnitsPerPixel Map units per pixel
\param centerX X coordinate of map center, in geographical units
\param centerY Y coordinate of map center, in geographical units
\param widthPixels Output width, in pixels
\param heightPixels Output height, in pixels
\param rotation clockwise rotation in degrees
.. versionadded:: 2.8
%End
//! String representation of the parameters used in the transform
QString showParameters() const;
%Docstring
String representation of the parameters used in the transform
:rtype: str
%End
QTransform transform() const;
%Docstring
:rtype: QTransform
%End
/** Returns the center x-coordinate for the transform.
* @see yCenter()
* @note added in QGIS 3.0
*/
double xCenter() const;
%Docstring
Returns the center x-coordinate for the transform.
.. seealso:: yCenter()
.. versionadded:: 3.0
:rtype: float
%End
/** Returns the center y-coordinate for the transform.
* @see xCenter()
* @note added in QGIS 3.0
*/
double yCenter() const;
%Docstring
Returns the center y-coordinate for the transform.
.. seealso:: xCenter()
.. versionadded:: 3.0
:rtype: float
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaptopixel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,57 +1,114 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaptopixelgeometrysimplifier.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapToPixelSimplifier : QgsAbstractGeometrySimplifier
{
%Docstring
Implementation of GeometrySimplifier using the "MapToPixel" algorithm
Simplifies a geometry removing points within of the maximum distance difference that defines the MapToPixel info of a RenderContext request.
This class enables simplify the geometries to be rendered in a MapCanvas target to speed up the vector drawing.
%End
%TypeHeaderCode
#include "qgsmaptopixelgeometrysimplifier.h"
%End
public:
//! Types of simplification algorithms that can be used
enum SimplifyAlgorithm
{
Distance = 0, //!< The simplification uses the distance between points to remove duplicate points
SnapToGrid = 1, //!< The simplification uses a grid (similar to ST_SnapToGrid) to remove duplicate points
Visvalingam = 2, //!< The simplification gives each point in a line an importance weighting, so that least important points are removed first
Distance,
SnapToGrid,
Visvalingam,
};
//! Constructor
QgsMapToPixelSimplifier( int simplifyFlags, double tolerance, SimplifyAlgorithm simplifyAlgorithm = Distance );
virtual ~QgsMapToPixelSimplifier();
%Docstring
Constructor
%End
//! Applicable simplification flags
enum SimplifyFlag
{
NoFlags = 0, //!< No simplification can be applied
SimplifyGeometry = 1, //!< The geometries can be simplified using the current map2pixel context state
SimplifyEnvelope = 2, //!< The geometries can be fully simplified by its BoundingBox
NoFlags,
SimplifyGeometry,
SimplifyEnvelope,
};
protected:
//! Returns the squared 2D-distance of the vector defined by the two points specified
static float calculateLengthSquared2D( double x1, double y1, double x2, double y2 );
%Docstring
Returns the squared 2D-distance of the vector defined by the two points specified
:rtype: float
%End
//! Returns whether the points belong to the same grid
static bool equalSnapToGrid( double x1, double y1, double x2, double y2, double gridOriginX, double gridOriginY, float gridInverseSizeXY );
%Docstring
Returns whether the points belong to the same grid
:rtype: bool
%End
public:
//! Gets the simplification hints of the vector layer managed
int simplifyFlags() const;
//! Sets the simplification hints of the vector layer managed
%Docstring
Gets the simplification hints of the vector layer managed
:rtype: int
%End
void setSimplifyFlags( int simplifyFlags );
%Docstring
Sets the simplification hints of the vector layer managed
%End
//! Gets the local simplification algorithm of the vector layer managed
SimplifyAlgorithm simplifyAlgorithm() const;
//! Sets the local simplification algorithm of the vector layer managed
%Docstring
Gets the local simplification algorithm of the vector layer managed
:rtype: SimplifyAlgorithm
%End
void setSimplifyAlgorithm( SimplifyAlgorithm simplifyAlgorithm );
%Docstring
Sets the local simplification algorithm of the vector layer managed
%End
//! Returns a simplified version the specified geometry
virtual QgsGeometry simplify( const QgsGeometry &geometry ) const;
%Docstring
Returns a simplified version the specified geometry
:rtype: QgsGeometry
%End
//! Sets the tolerance of the vector layer managed
void setTolerance( double value );
%Docstring
Sets the tolerance of the vector layer managed
%End
// MapToPixel simplification helper methods
public:
//! Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context
static bool isGeneralizableByMapBoundingBox( const QgsRectangle &envelope, double map2pixelTol );
%Docstring
Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context
:rtype: bool
%End
bool isGeneralizableByMapBoundingBox( const QgsRectangle &envelope ) const;
%Docstring
Returns whether the envelope can be replaced by its BBOX when is applied the specified map2pixel context
:rtype: bool
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaptopixelgeometrysimplifier.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,46 +1,91 @@
/*!
* \class QgsMapUnitScale
* \brief Struct for storing maximum and minimum scales for measurements in map units
*
* For measurements in map units, a minimum and a maximum scale can be defined.
* Outside this range, the measurements aren't scaled anymore proportionally to
* the map scale.
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmapunitscale.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapUnitScale
{
%Docstring
Struct for storing maximum and minimum scales for measurements in map units
For measurements in map units, a minimum and a maximum scale can be defined.
Outside this range, the measurements aren't scaled anymore proportionally to
the map scale.
%End
%TypeHeaderCode
#include <qgsmapunitscale.h>
#include "qgsmapunitscale.h"
%End
public:
/** Constructor for QgsMapUnitScale
* @param minScale minimum allowed scale, or 0.0 if no minimum scale set
* @param maxScale maximum allowed scale, or 0.0 if no maximum scale set
*/
explicit QgsMapUnitScale( double minScale = 0.0, double maxScale = 0.0 );
%Docstring
Constructor for QgsMapUnitScale
\param minScale minimum allowed scale, or 0.0 if no minimum scale set
\param maxScale maximum allowed scale, or 0.0 if no maximum scale set
%End
/** The minimum scale, or 0.0 if unset */
double minScale;
/** The maximum scale, or 0.0 if unset */
%Docstring
The minimum scale, or 0.0 if unset
%End
double maxScale;
%Docstring
The maximum scale, or 0.0 if unset
%End
/** Whether the minimum size in mm should be respected */
bool minSizeMMEnabled;
/** The minimum size in millimeters, or 0.0 if unset */
%Docstring
Whether the minimum size in mm should be respected
%End
double minSizeMM;
/** Whether the maximum size in mm should be respected */
%Docstring
The minimum size in millimeters, or 0.0 if unset
%End
bool maxSizeMMEnabled;
/** The maximum size in millimeters, or 0.0 if unset */
%Docstring
Whether the maximum size in mm should be respected
%End
double maxSizeMM;
%Docstring
The maximum size in millimeters, or 0.0 if unset
%End
/** Computes a map units per pixel scaling factor, respecting the minimum and maximum scales
* set for the object.
* @param c render context
* @returns map units per pixel, limited between minimum and maximum scales
*/
double computeMapUnitsPerPixel( const QgsRenderContext &c ) const;
%Docstring
Computes a map units per pixel scaling factor, respecting the minimum and maximum scales
set for the object.
\param c render context
:return: map units per pixel, limited between minimum and maximum scales
:rtype: float
%End
bool operator==( const QgsMapUnitScale &other ) const;
%Docstring
:rtype: bool
%End
bool operator!=( const QgsMapUnitScale &other ) const;
%Docstring
:rtype: bool
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmapunitscale.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,47 +1,158 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmargins.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMargins
{
%TypeHeaderCode
#include <qgsmargins.h>
%End
%TypeHeaderCode
#include "qgsmargins.h"
%End
public:
QgsMargins();
%Docstring
Constructs a margins object with all margins set to 0.
%End
QgsMargins( double left, double top, double right, double bottom );
%Docstring
Constructs margins with the given ``left``, ``top``, ``right``, ``bottom``
.. seealso:: setLeft()
.. seealso:: setRight()
.. seealso:: setTop()
.. seealso:: setBottom()
%End
bool isNull() const;
%Docstring
Returns \c true if all margins are is 0; otherwise returns false.
:rtype: bool
%End
double left() const;
%Docstring
Returns the left margin.
.. seealso:: setLeft()
:rtype: float
%End
double top() const;
%Docstring
Returns the top margin.
.. seealso:: setTop()
:rtype: float
%End
double right() const;
%Docstring
Returns the right margin.
.. seealso:: setRight()
:rtype: float
%End
double bottom() const;
%Docstring
Returns the bottom margin.
.. seealso:: setBottom()
:rtype: float
%End
void setLeft( double left );
%Docstring
Sets the left margin to ``left``.
.. seealso:: left()
%End
void setTop( double top );
%Docstring
Sets the top margin to ``top``.
.. seealso:: top()
%End
void setRight( double right );
%Docstring
Sets the right margin to ``right``.
.. seealso:: right()
%End
void setBottom( double bottom );
%Docstring
Sets the bottom margin to ``bottom``.
.. seealso:: bottom()
%End
QgsMargins &operator+=( const QgsMargins &margins );
%Docstring
Add each component of ``margins`` to the respective component of this object
and returns a reference to it.
:rtype: QgsMargins
%End
QgsMargins &operator-=( const QgsMargins &margins );
%Docstring
Subtract each component of ``margins`` from the respective component of this object
and returns a reference to it.
:rtype: QgsMargins
%End
QgsMargins &operator+=( double addend );
%Docstring
Adds the ``addend`` to each component of this object and returns a reference to it.
:rtype: QgsMargins
%End
QgsMargins &operator-=( double subtrahend );
%Docstring
Subtracts the ``subtrahend`` from each component of this object
and returns a reference to it.
:rtype: QgsMargins
%End
QgsMargins &operator*=( double factor );
%Docstring
Multiplies each component of this object by ``factor``
and returns a reference to it.
:rtype: QgsMargins
%End
QgsMargins &operator/=( double divisor );
%Docstring
Multiplies each component of this object by ``factor``
and returns a reference to it.
:rtype: QgsMargins
%End
QString toString() const;
%Docstring
Returns the margins encoded to a string.
.. seealso:: fromString()
:rtype: str
%End
static QgsMargins fromString( const QString &string );
%Docstring
Returns a QgsMargins object decoded from a string, or a null QgsMargins
if the string could not be interpreted as margins.
.. seealso:: toString()
:rtype: QgsMargins
%End
};
bool operator==( const QgsMargins &lhs, const QgsMargins &rhs );
bool operator!=( const QgsMargins &lhs, const QgsMargins &rhs );
QgsMargins operator+( const QgsMargins &m1, const QgsMargins &m2 );
QgsMargins operator-( const QgsMargins &m1, const QgsMargins &m2 );
QgsMargins operator+( const QgsMargins &lhs, double rhs );
QgsMargins operator+( double lhs, const QgsMargins &rhs );
QgsMargins operator-( const QgsMargins &lhs, double rhs );
QgsMargins operator*( const QgsMargins &margins, double factor );
QgsMargins operator*( double factor, const QgsMargins &margins );
QgsMargins operator/( const QgsMargins &margins, double divisor );
QgsMargins operator+( const QgsMargins &margins );
QgsMargins operator-( const QgsMargins &margins );
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmargins.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,71 +1,91 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmessageoutput.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** \ingroup core
* Interface for showing messages from QGIS in GUI independent way.
* This class provides abstraction of a dialog for showing output to the user.
* By default QgsMessageConsoleOutput will be used if not overridden with other
* message output creator function.
* QGIS application uses QgsMessageView class for displaying a dialog to the user.
* Object deletes itself when it's not needed anymore. Children should use
* signal destroyed() to notify the deletion
*/
class QgsMessageOutput
{
%TypeHeaderCode
#include <qgsmessageoutput.h>
%Docstring
Interface for showing messages from QGIS in GUI independent way.
This class provides abstraction of a dialog for showing output to the user.
By default QgsMessageConsoleOutput will be used if not overridden with other
message output creator function.
QGIS application uses QgsMessageView class for displaying a dialog to the user.
Object deletes itself when it's not needed anymore. Children should use
signal destroyed() to notify the deletion
%End
%TypeHeaderCode
#include "qgsmessageoutput.h"
%End
public:
//! message can be in plain text or in html format
enum MessageType { MessageText, MessageHtml };
//! virtual destructor
virtual ~QgsMessageOutput();
%Docstring
message can be in plain text or in html format
%End
//! set message, it won't be displayed until
virtual void setMessage( const QString &message, MessageType msgType ) = 0;
%Docstring
set message, it won't be displayed until
%End
//! message to be appended to the current text
virtual void appendMessage( const QString &message ) = 0;
%Docstring
message to be appended to the current text
%End
//! set title for the messages
virtual void setTitle( const QString &title ) = 0;
%Docstring
set title for the messages
%End
//! display the message to the user
virtual void showMessage( bool blocking = true ) = 0;
%Docstring
display the message to the user and deletes itself
%End
/** Display the blocking message to the user.
* @note added in 2.10
*/
static void showMessage( const QString &title, const QString &message, MessageType msgType );
%Docstring
Display the blocking message to the user.
.. versionadded:: 2.10
%End
//! sets function that will be used to create message output
//! @note not available in python bindings
// TODO: implementation where python class could be passed
// static void setMessageOutputCreator(MESSAGE_OUTPUT_CREATOR f);
//! function that returns new class derived from QgsMessageOutput
//! (don't forget to delete it then if showMessage(bool) is not used showMessage(bool) deletes the instance)
static QgsMessageOutput *createMessageOutput();
%Docstring
(don't forget to delete it then if showMessage(bool) is not used showMessage(bool) deletes the instance)
:rtype: QgsMessageOutput
%End
};
/**
\brief Default implementation of message output interface
class QgsMessageOutputConsole : QObject, QgsMessageOutput
{
%Docstring
Default implementation of message output interface
This class outputs messages to the standard output. Therefore it might
be the right choice for apps without GUI.
*/
class QgsMessageOutputConsole : QObject, QgsMessageOutput
{
%TypeHeaderCode
#include <qgsmessageoutput.h>
%End
%TypeHeaderCode
#include "qgsmessageoutput.h"
%End
public:
QgsMessageOutputConsole();
@ -76,13 +96,24 @@ class QgsMessageOutputConsole : QObject, QgsMessageOutput
virtual void setTitle( const QString &title );
//! sends the message to the standard output
virtual void showMessage( bool blocking = true );
%Docstring
sends the message to the standard output
%End
signals:
//! signals that object will be destroyed and shouldn't be used anymore
void destroyed();
%Docstring
signals that object will be destroyed and shouldn't be used anymore
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmessageoutput.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,49 +1,96 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmimedatautils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMimeDataUtils
{
%TypeHeaderCode
#include <qgsmimedatautils.h>
#include "qgsmimedatautils.h"
%End
public:
struct Uri
{
//! Constructs invalid URI
Uri();
//! Constructs URI from encoded data
%Docstring
Constructs invalid URI
%End
explicit Uri( QString &encData );
%Docstring
Constructs URI from encoded data
%End
//! Returns whether the object contains valid data
//! @note added in 3.0
bool isValid() const;
%Docstring
.. versionadded:: 3.0
:rtype: bool
%End
//! Returns encoded representation of the object
QString data() const;
%Docstring
Returns encoded representation of the object
:rtype: str
%End
//! Type of URI. Recognized types: "vector" / "raster" / "plugin" / "custom"
QString layerType;
//! For "vector" / "raster" type: provider id.
//! For "plugin" type: plugin layer type name.
//! For "custom" type: key of its QgsCustomDropHandler
%Docstring
Type of URI. Recognized types: "vector" / "raster" / "plugin" / "custom"
%End
QString providerKey;
//! Human readable name to be used e.g. in layer tree
%Docstring
For "custom" type: key of its QgsCustomDropHandler
%End
QString name;
//! Identifier of the data source recognized by its providerKey
%Docstring
Human readable name to be used e.g. in layer tree
%End
QString uri;
%Docstring
Identifier of the data source recognized by its providerKey
%End
QStringList supportedCrs;
QStringList supportedFormats;
};
typedef QList<QgsMimeDataUtils::Uri> UriList;
typedef QList<Uri> UriList;
static QMimeData *encodeUriList( const UriList &layers );
%Docstring
:rtype: QMimeData
%End
static bool isUriList( const QMimeData *data );
%Docstring
:rtype: bool
%End
static UriList decodeUriList( const QMimeData *data );
%Docstring
:rtype: UriList
%End
/**
* Returns encoded URI list from a list of layer tree nodes.
* @note added in QGIS 3.0
*/
static QByteArray layerTreeNodesToUriList( const QList<QgsLayerTreeNode*> &nodes );
static QByteArray layerTreeNodesToUriList( const QList<QgsLayerTreeNode *> &nodes );
%Docstring
Returns encoded URI list from a list of layer tree nodes.
.. versionadded:: 3.0
:rtype: QByteArray
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmimedatautils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,91 +1,155 @@
/***************************************************************************
qgsmultirenderchecker.sip
--------------------------------------
Date : 6.11.2014
Copyright : (C) 2014 Matthias Kuhn
Email : matthias at opengis dot ch
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmultirenderchecker.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMultiRenderChecker
{
%Docstring
This class allows checking rendered images against comparison images.
Its main purpose is for the unit testing framework.
It will either
<ul>
<li>take an externally rendered image (setRenderedImage())</li>
<li>render the image based on provided mapSettings (setMapSettings())</li>
</ul>
This image will then be compared against one or several images in a folder inside
the control directory (tests/testdata/control_images/{controlName}).
There are modes for single and for multiple reference images.
<ul>
<li>If there are no subfolders in the control directory, it will assume an image
with the name {controlImage}.png in the control directory itself.</li>
<li>If there are subfolders inside the control directory, it will search for images
with the name {controlImage}.png in every subfolder.</li>
</ul>
For every control image there may be one or several randomly named anomaly images defining
allowed anomalies.
For every control image, the allowed mismatch and color tolerance values will be calculated
individually.
.. versionadded:: 2.8
%End
%TypeHeaderCode
#include <qgsmultirenderchecker.h>
#include "qgsmultirenderchecker.h"
%End
public:
QgsMultiRenderChecker();
/**
* Base directory name for the control image (with control image path
* suffixed) the path to the image will be constructed like this:
* controlImagePath + '/' + mControlName + '/' + mControlName + '.png'
*/
virtual ~QgsMultiRenderChecker();
void setControlName( const QString &name );
%Docstring
Base directory name for the control image (with control image path
suffixed) the path to the image will be constructed like this:
controlImagePath + '/' + mControlName + '/' + mControlName + '.png'
%End
void setControlPathPrefix( const QString &prefix );
/**
* Set the path to the rendered image. If this is not set or set to QString::Null, an image
* will be rendered based on the provided mapsettings
*
* @param renderedImagePath A path to the rendered image with which control images will be compared
*/
void setRenderedImage( const QString &renderedImagePath );
%Docstring
Set the path to the rendered image. If this is not set or set to QString.Null, an image
will be rendered based on the provided mapsettings
\param renderedImagePath A path to the rendered image with which control images will be compared
%End
/**
* Set the map settings to use to render the image
*
* @param mapSettings The map settings
*/
void setMapSettings( const QgsMapSettings &mapSettings );
%Docstring
Set the map settings to use to render the image
\param mapSettings The map settings
%End
/**
* Set tolerance for color components used by runTest()
* Default value is 0.
*
* @param colorTolerance The maximum difference for each color component
* including alpha to be considered correct.
*/
void setColorTolerance( unsigned int colorTolerance );
%Docstring
Set tolerance for color components used by runTest()
Default value is 0.
\param colorTolerance The maximum difference for each color component
including alpha to be considered correct.
%End
/**
* Test using renderer to generate the image to be compared.
*
* @param testName - to be used as the basis for writing a file to
* e.g. /tmp/theTestName.png
*
* @param mismatchCount - defaults to 0 - the number of pixels that
* are allowed to be different from the control image. In some cases
* rendering may be non-deterministic. This parameter allows you to account
* for that by providing a tolerance.
*
* @note make sure to call setExpectedImage and setMapSettings first
*/
bool runTest( const QString &testName, unsigned int mismatchCount = 0 );
%Docstring
Test using renderer to generate the image to be compared.
\param testName - to be used as the basis for writing a file to
e.g. /tmp/theTestName.png
\param mismatchCount - defaults to 0 - the number of pixels that
are allowed to be different from the control image. In some cases
rendering may be non-deterministic. This parameter allows you to account
for that by providing a tolerance.
.. note::
make sure to call setExpectedImage and setMapSettings first
:rtype: bool
%End
/**
* Returns a report for this test
*
* @return A report
*/
QString report() const;
%Docstring
Returns a report for this test
:return: A report
:rtype: str
%End
/**
* @brief controlImagePath
* @return
*/
QString controlImagePath() const;
%Docstring
controlImagePath
:return:
:rtype: str
%End
/** Draws a checkboard pattern for image backgrounds, so that transparency is visible
* without requiring a transparent background for the image
*/
static void drawBackground( QImage *image );
%Docstring
Draws a checkboard pattern for image backgrounds, so that transparency is visible
without requiring a transparent background for the image
%End
};
class QgsCompositionChecker : QgsMultiRenderChecker
{
%Docstring
Renders a composition to an image and compares with an expected output
%End
%TypeHeaderCode
#include "qgsmultirenderchecker.h"
%End
public:
QgsCompositionChecker( const QString &testName, QgsComposition *composition );
void setSize( QSize size );
bool testComposition( QString &checkedReport, int page = 0, int pixelDiff = 0 );
%Docstring
:rtype: bool
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmultirenderchecker.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,63 +1,98 @@
/*
* \class QgsNetworkAccessManager
* \brief network access manager for QGIS
* \ingroup core
* \since 1.5
*
* This class implements the QGIS network access manager. It's a singleton
* that can be used across QGIS.
*
* Plugins can insert proxy factories and thereby redirect requests to
* individual proxies.
*
* If no proxy factories are there or none returns a proxy for an URL a
* fallback proxy can be set. There's also a exclude list that defines URLs
* that the fallback proxy should not be used for, then no proxy will be used.
*
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsnetworkaccessmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsNetworkAccessManager : QNetworkAccessManager
{
%TypeHeaderCode
#include <qgsnetworkaccessmanager.h>
%Docstring
network access manager for QGIS
.. versionadded:: 1.5
This class implements the QGIS network access manager. It's a singleton
that can be used across QGIS.
Plugins can insert proxy factories and thereby redirect requests to
individual proxies.
If no proxy factories are there or none returns a proxy for an URL a
fallback proxy can be set. There's also a exclude list that defines URLs
that the fallback proxy should not be used for, then no proxy will be used.
%End
%TypeHeaderCode
#include "qgsnetworkaccessmanager.h"
%End
public:
//! returns a pointer to the single instance
// and creates that instance on the first call.
static QgsNetworkAccessManager *instance();
%Docstring
:rtype: QgsNetworkAccessManager
%End
//! destructor
~QgsNetworkAccessManager();
QgsNetworkAccessManager( QObject *parent = 0 );
//! insert a factory into the proxy factories list
void insertProxyFactory( QNetworkProxyFactory *factory /Transfer/ );
%Docstring
insert a factory into the proxy factories list
%End
//! remove a factory from the proxy factories list
void removeProxyFactory( QNetworkProxyFactory *factory /TransferBack/ );
%Docstring
remove a factory from the proxy factories list
%End
//! retrieve proxy factory list
const QList<QNetworkProxyFactory *> proxyFactories() const;
%Docstring
retrieve proxy factory list
:rtype: list of QNetworkProxyFactory
%End
//! retrieve fall back proxy (for urls that no factory returned proxies for)
const QNetworkProxy &fallbackProxy() const;
%Docstring
retrieve fall back proxy (for urls that no factory returned proxies for)
:rtype: QNetworkProxy
%End
//! retrieve exclude list (urls shouldn't use the fallback proxy)
QStringList excludeList() const;
%Docstring
retrieve exclude list (urls shouldn't use the fallback proxy)
:rtype: list of str
%End
//! set fallback proxy and URL that shouldn't use it.
void setFallbackProxyAndExcludes( const QNetworkProxy &proxy, const QStringList &excludes );
%Docstring
set fallback proxy and URL that shouldn't use it.
%End
//! Get name for QNetworkRequest::CacheLoadControl
static QString cacheLoadControlName( QNetworkRequest::CacheLoadControl control );
%Docstring
Get name for QNetworkRequest.CacheLoadControl
:rtype: str
%End
//! Get QNetworkRequest::CacheLoadControl from name
static QNetworkRequest::CacheLoadControl cacheLoadControlFromName( const QString &name );
%Docstring
Get QNetworkRequest.CacheLoadControl from name
:rtype: QNetworkRequest.CacheLoadControl
%End
//! Setup the NAM according to the user's settings #spellok
void setupDefaultProxyAndCache();
%Docstring
Setup the NAM according to the user's settings
%End
//! return whether the system proxy should be used
bool useSystemProxy() const;
%Docstring
return whether the system proxy should be used
:rtype: bool
%End
signals:
void requestAboutToBeCreated( QNetworkAccessManager::Operation, const QNetworkRequest &, QIODevice * );
@ -67,6 +102,13 @@ class QgsNetworkAccessManager : QNetworkAccessManager
protected:
virtual QNetworkReply *createRequest( QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0 );
private:
QgsNetworkAccessManager( QObject *parent = 0 );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsnetworkaccessmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,43 +1,68 @@
/**
\class QgsNetworkContentFetcher
\ingroup core
\brief HTTP network content fetcher. A simple method for fetching remote HTTP content
and converting the content to standard formats. Url redirects are automatically
handled.
\since 2.5
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsnetworkcontentfetcher.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsNetworkContentFetcher : QObject
{
%TypeHeaderCode
#include <qgsnetworkcontentfetcher.h>
%Docstring
HTTP network content fetcher. A simple method for fetching remote HTTP content
and converting the content to standard formats. Url redirects are automatically
handled.
.. versionadded:: 2.5
%End
%TypeHeaderCode
#include "qgsnetworkcontentfetcher.h"
%End
public:
QgsNetworkContentFetcher();
virtual ~QgsNetworkContentFetcher();
/** Fetches content from a remote URL and handles redirects. The finished()
* signal will be emitted when content has been fetched.
* @param url URL to fetch
*/
void fetchContent( const QUrl &url );
%Docstring
Fetches content from a remote URL and handles redirects. The finished()
signal will be emitted when content has been fetched.
\param url URL to fetch
%End
/** Returns a reference to the network reply
* @returns QNetworkReply for fetched URL content
*/
QNetworkReply *reply();
%Docstring
Returns a reference to the network reply
:return: QNetworkReply for fetched URL content
:rtype: QNetworkReply
%End
/** Returns the fetched content as a string
* @returns string containing network content
*/
QString contentAsString() const;
%Docstring
Returns the fetched content as a string
:return: string containing network content
:rtype: str
%End
signals:
/** Emitted when content has loaded
*/
void finished();
%Docstring
Emitted when content has loaded
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsnetworkcontentfetcher.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,37 +1,74 @@
/**
* Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML
* in \verbatim <customproperties> \endverbatim element.
*
* \note added in 2.4
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsobjectcustomproperties.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsObjectCustomProperties
{
%Docstring
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML
in \verbatim <customproperties> \endverbatim element.
.. versionadded:: 2.4
%End
%TypeHeaderCode
#include <qgsobjectcustomproperties.h>
#include "qgsobjectcustomproperties.h"
%End
public:
QgsObjectCustomProperties();
//! Return list of stored keys
QStringList keys() const;
%Docstring
Return list of stored keys
:rtype: list of str
%End
//! Add an entry to the store. If the entry with the keys exists already, it will be overwritten
void setValue( const QString &key, const QVariant &value );
%Docstring
Add an entry to the store. If the entry with the keys exists already, it will be overwritten
%End
//! Return value for the given key. If the key is not stored, default value will be used
QVariant value( const QString &key, const QVariant &defaultValue = QVariant() ) const;
%Docstring
Return value for the given key. If the key is not stored, default value will be used
:rtype: QVariant
%End
//! Remove a key (entry) from the store
void remove( const QString &key );
%Docstring
Remove a key (entry) from the store
%End
/** Read store contents from XML
@param parentNode node to read from
@param keyStartsWith reads only properties starting with the specified string (or all if the string is empty)
*/
void readXml( const QDomNode &parentNode, const QString &keyStartsWith = QString() );
%Docstring
Read store contents from XML
\param parentNode node to read from
\param keyStartsWith reads only properties starting with the specified string (or all if the string is empty)
%End
/** Write store contents to XML */
void writeXml( QDomNode &parentNode, QDomDocument &doc ) const;
%Docstring
Write store contents to XML
%End
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsobjectcustomproperties.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,69 +1,190 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsogcutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsOgcUtils
{
%TypeHeaderCode
#include <qgsogcutils.h>
%Docstring
The QgsOgcUtils class provides various utility functions for conversion between
OGC (Open Geospatial Consortium) standards and QGIS internal representations.
Currently supported standards:
- GML2 - Geography Markup Language (import, export)
%End
%TypeHeaderCode
#include "qgsogcutils.h"
%End
public:
/** Static method that creates geometry from GML
@param xmlString xml representation of the geometry. GML elements are expected to be
in default namespace (\verbatim {<Point>...</Point> \endverbatim) or in
"gml" namespace (\verbatim <gml:Point>...</gml:Point> \endverbatim)
*/
enum GMLVersion
{
GML_2_1_2,
GML_3_1_0,
GML_3_2_1,
};
static QgsGeometry geometryFromGML( const QString &xmlString );
%Docstring
Static method that creates geometry from GML
\param xmlString xml representation of the geometry. GML elements are expected to be
in default namespace (\verbatim {<Point>...</Point> \endverbatim) or in
"gml" namespace (\verbatim <gml:Point>...</gml:Point> \endverbatim)
:rtype: QgsGeometry
%End
/** Static method that creates geometry from GML
*/
static QgsGeometry geometryFromGML( const QDomNode &geometryNode );
%Docstring
Static method that creates geometry from GML
:rtype: QgsGeometry
%End
/** Read rectangle from GML2 Box */
static QgsRectangle rectangleFromGMLBox( const QDomNode &boxNode );
%Docstring
Read rectangle from GML2 Box
:rtype: QgsRectangle
%End
/** Read rectangle from GML3 Envelope */
static QgsRectangle rectangleFromGMLEnvelope( const QDomNode &envelopeNode );
%Docstring
Read rectangle from GML3 Envelope
:rtype: QgsRectangle
%End
static QDomElement geometryToGML( const QgsGeometry *geometry, QDomDocument &doc,
QgsOgcUtils::GMLVersion gmlVersion,
const QString &srsName,
bool invertAxisOrientation,
const QString &gmlIdBase,
int precision = 17 );
%Docstring
Exports the geometry to GML
:return: QDomElement
.. versionadded:: 2.16
:rtype: QDomElement
%End
/** Exports the geometry to GML2 or GML3
@return QDomElement
*/
static QDomElement geometryToGML( const QgsGeometry *geometry, QDomDocument &doc, const QString &format, int precision = 17 );
%Docstring
Exports the geometry to GML2 or GML3
:return: QDomElement
:rtype: QDomElement
%End
/** Exports the geometry to GML2
@return QDomElement
*/
static QDomElement geometryToGML( const QgsGeometry *geometry, QDomDocument &doc, int precision = 17 );
%Docstring
Exports the geometry to GML2
:return: QDomElement
:rtype: QDomElement
%End
/** Exports the rectangle to GML2 Box
@return QDomElement
*/
static QDomElement rectangleToGMLBox( QgsRectangle *box, QDomDocument &doc, int precision = 17 );
%Docstring
Exports the rectangle to GML2 Box
:return: QDomElement
:rtype: QDomElement
%End
static QDomElement rectangleToGMLBox( QgsRectangle *box, QDomDocument &doc,
const QString &srsName,
bool invertAxisOrientation,
int precision = 17 );
%Docstring
Exports the rectangle to GML2 Box
:return: QDomElement
.. versionadded:: 2.16
:rtype: QDomElement
%End
/** Exports the rectangle to GML2 Envelope
@return QDomElement
*/
static QDomElement rectangleToGMLEnvelope( QgsRectangle *env, QDomDocument &doc, int precision = 17 );
%Docstring
Exports the rectangle to GML3 Envelope
:return: QDomElement
:rtype: QDomElement
%End
static QDomElement rectangleToGMLEnvelope( QgsRectangle *env, QDomDocument &doc,
const QString &srsName,
bool invertAxisOrientation,
int precision = 17 );
%Docstring
Exports the rectangle to GML3 Envelope
:return: QDomElement
.. versionadded:: 2.16
:rtype: QDomElement
%End
/** Parse XML with OGC fill into QColor */
static QColor colorFromOgcFill( const QDomElement &fillElement );
%Docstring
Parse XML with OGC fill into QColor
:rtype: QColor
%End
/** Parse XML with OGC filter into QGIS expression */
static QgsExpression *expressionFromOgcFilter( const QDomElement &element ) /Factory/;
%Docstring
Parse XML with OGC filter into QGIS expression
:rtype: QgsExpression
%End
static QDomElement expressionToOgcFilter( const QgsExpression &exp, QDomDocument &doc, QString *errorMessage = 0 );
%Docstring
Creates OGC filter XML element. Supports minimum standard filter
according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)
:return: valid \verbatim <Filter> \endverbatim QDomElement on success,
otherwise null QDomElement
:rtype: QDomElement
%End
enum FilterVersion
{
FILTER_OGC_1_0,
FILTER_OGC_1_1,
FILTER_FES_2_0
};
/** Creates OGC filter XML element. Supports minimum standard filter
* according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)
* @return valid \verbatim <Filter> \endverbatim QDomElement on success,
* otherwise null QDomElement
*/
static QDomElement expressionToOgcFilter( const QgsExpression &exp, QDomDocument &doc, QString *errorMessage /Out/ );
/** Creates an OGC expression XML element.
* @return valid OGC expression QDomElement on success,
* otherwise null QDomElement
*/
static QDomElement expressionToOgcExpression( const QgsExpression &exp, QDomDocument &doc, QString *errorMessage = 0 );
%Docstring
Creates an OGC expression XML element.
:return: valid OGC expression QDomElement on success,
otherwise null QDomElement
:rtype: QDomElement
%End
static QDomElement expressionToOgcExpression( const QgsExpression &exp,
QDomDocument &doc,
QgsOgcUtils::GMLVersion gmlVersion,
FilterVersion filterVersion,
const QString &geometryName,
const QString &srsName,
bool honourAxisOrientation,
bool invertAxisOrientation,
QString *errorMessage = 0 );
%Docstring
Creates an OGC expression XML element.
:return: valid OGC expression QDomElement on success,
otherwise null QDomElement
:rtype: QDomElement
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsogcutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,112 +1,71 @@
/***************************************************************************
qgsoptionalexpression.sip - QgsOptionalExpression
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsoptionalexpression.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
---------------------
begin : 8.9.2016
copyright : (C) 2016 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
/**
* An expression with an additional enabled flag.
*
* This can be used for configuration options where an expression can be enabled
* or disabled but when disabled it shouldn't lose it's information for the case
* it gets re-enabled later on and a user shouldn't be force to redo the configuration.
*
* @note Added in QGIS 3.0
*/
class QgsOptionalExpression
{
%Docstring
An expression with an additional enabled flag.
This can be used for configuration options where an expression can be enabled
or disabled but when disabled it shouldn't lose it's information for the case
it gets re-enabled later on and a user shouldn't be force to redo the configuration.
.. versionadded:: 2.18
%End
%TypeHeaderCode
#include <qgsoptionalexpression.h>
#include "qgsoptionalexpression.h"
%End
public:
/**
* Construct a default optional expression.
* It will be disabled and with an empty expression.
*/
QgsOptionalExpression();
%Docstring
Construct a default optional expression.
It will be disabled and with an empty expression.
%End
/**
* Construct an optional expression with the provided expression.
* It will be enabled.
*/
QgsOptionalExpression( const QgsExpression &expression );
%Docstring
Construct an optional expression with the provided expression.
It will be enabled.
%End
/**
* Construct an optional expression with the provided expression and enabled state.
*/
QgsOptionalExpression( const QgsExpression &expression, bool enabled );
/**
* Compare this QgsOptionalExpression to another one.
*
* This will compare the enabled flag and call the == operator
* of the contained class.
*
* @note Added in QGIS 3.0
*/
int operator== ( const QgsOptionalExpression &other ) const;
%MethodCode
sipRes = *sipCpp == *a0;
%Docstring
Construct an optional expression with the provided expression and enabled state.
%End
int __bool__() const;
%MethodCode
sipRes = sipCpp->enabled();
%End
/**
* Check if this optional is enabled
*
* @note Added in QGIS 3.0
*/
bool enabled() const;
/**
* Set if this optional is enabled
*
* @note Added in QGIS 3.0
*/
void setEnabled( bool enabled );
/**
* Access the payload data
*
* @note Added in QGIS 3.0
*/
QgsExpression data() const;
/**
* Set the payload data
*
* @note Added in QGIS 3.0
*/
void setData( const QgsExpression &data );
/**
* Save the optional expression to the provided QDomElement.
*
* The caller is responsible to pass an empty QDomElement and to append it to
* a parent element.
*
* @note Added in QGIS 2.18
*/
void writeXml( QDomElement &element );
%Docstring
Save the optional expression to the provided QDomElement.
The caller is responsible to pass an empty QDomElement and to append it to
a parent element.
.. versionadded:: 2.18
%End
/**
* Read the optional expression from the provided QDomElement.
*
* @note Added in QGIS 2.18
*/
void readXml( const QDomElement &element );
%Docstring
Read the optional expression from the provided QDomElement.
.. versionadded:: 2.18
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsoptionalexpression.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,34 +1,70 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsowsconnection.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsOwsConnection : QObject
{
%TypeHeaderCode
#include <qgsowsconnection.h>
%Docstring
Connections management
%End
%TypeHeaderCode
#include "qgsowsconnection.h"
%End
public:
/**
* Constructor
* @param service service name: WMS,WFS,WCS
* @param connName connection name
*/
QgsOwsConnection( const QString &service, const QString &connName );
%Docstring
Constructor
\param service service name: WMS,WFS,WCS
\param connName connection name
%End
//! Destructor
~QgsOwsConnection();
/** Returns the list of connections for the specified service */
static QStringList connectionList( const QString &service );
%Docstring
Returns the list of connections for the specified service
:rtype: list of str
%End
/** Deletes the connection for the specified service with the specified name */
static void deleteConnection( const QString &service, const QString &name );
%Docstring
Deletes the connection for the specified service with the specified name
%End
/** Retrieves the selected connection for the specified service */
static QString selectedConnection( const QString &service );
/** Marks the specified connection for the specified service as selected */
%Docstring
Retrieves the selected connection for the specified service
:rtype: str
%End
static void setSelectedConnection( const QString &service, const QString &name );
%Docstring
Marks the specified connection for the specified service as selected
%End
QString mConnName;
/** Returns the connection uri */
QgsDataSourceUri uri() const;
%Docstring
Returns the connection uri
:rtype: QgsDataSourceUri
%End
QString mConnectionInfo;
protected:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsowsconnection.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,68 +1,77 @@
/***************************************************************************
qgstransactiongroup.h - QgsTransactionGroup
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgstransactiongroup.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
---------------------
begin : 15.1.2016
copyright : (C) 2016 by Matthias Kuhn
email : mmatthias@opengis.ch
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
class QgsTransactionGroup : QObject
{
%TypeHeaderCode
#include "qgstransactiongroup.h"
%End
public:
explicit QgsTransactionGroup( QObject *parent = 0 );
~QgsTransactionGroup();
/**
* Add a layer to this transaction group.
*
* Will return true if it is compatible and has been added.
*/
bool addLayer( QgsVectorLayer *layer );
%Docstring
Add a layer to this transaction group.
/**
* Get the set of layers currently managed by this transaction group.
*
* @return Layer set
*/
QSet<QgsVectorLayer*> layers() const;
Will return true if it is compatible and has been added.
:rtype: bool
%End
QSet<QgsVectorLayer *> layers() const;
%Docstring
Get the set of layers currently managed by this transaction group.
:return: Layer set
:rtype: set of QgsVectorLayer
%End
/**
* Returns true if any of the layers in this group reports a modification.
*/
bool modified() const;
%Docstring
Returns true if any of the layers in this group reports a modification.
:rtype: bool
%End
/**
* Return the connection string used by this transaction group.
* Layers need be compatible when added.
*/
QString connString() const;
%Docstring
Return the connection string used by this transaction group.
Layers need be compatible when added.
:rtype: str
%End
/**
* Return the provider key used by this transaction group.
* Layers need be compatible when added.
*/
QString providerKey() const;
%Docstring
Return the provider key used by this transaction group.
Layers need be compatible when added.
:rtype: str
%End
/**
* Returns true if there are no layers in this transaction group.
*/
bool isEmpty() const;
%Docstring
Returns true if there are no layers in this transaction group.
:rtype: bool
%End
signals:
/**
* Will be emitted whenever there is a commit error
*/
void commitError( const QString &msg );
%Docstring
Will be emitted whenever there is a commit error
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgstransactiongroup.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -43,7 +43,7 @@ class CORE_EXPORT QgsDartMeasurement
void send() const;
static const QString typeToString( Type type );
static const QString typeToString( QgsDartMeasurement::Type type );
private:
QString mName;

View File

@ -59,14 +59,14 @@ class CORE_EXPORT QgsEditFormConfig
struct TabData
{
TabData() {}
TabData( const QString &name, const QList<QString> &fields, const QList<GroupData> &groups )
TabData( const QString &name, const QList<QString> &fields, const QList<QgsEditFormConfig::GroupData> &groups )
: mName( name )
, mFields( fields )
, mGroups( groups )
{}
QString mName;
QList<QString> mFields;
QList<GroupData> mGroups;
QList<QgsEditFormConfig::GroupData> mGroups;
};
/**

View File

@ -34,7 +34,7 @@
class CORE_EXPORT QgsExpressionFieldBuffer
{
public:
typedef struct ExpressionField
struct ExpressionField
{
ExpressionField( const QString &exp, const QgsField &fld )
: cachedExpression( exp )
@ -43,7 +43,7 @@ class CORE_EXPORT QgsExpressionFieldBuffer
QgsExpression cachedExpression;
QgsField field;
} ExpressionField;
};
QgsExpressionFieldBuffer();

View File

@ -31,7 +31,8 @@
class QgsPoint;
/** \ingroup core
* A class to query the labeling structure at a given point (small wraper around pal RTree class)*/
* A class to query the labeling structure at a given point (small wraper around pal RTree class)
*/
class CORE_EXPORT QgsLabelSearchTree
{
public:

View File

@ -66,6 +66,8 @@ class CORE_EXPORT QgsLegendRenderer
private:
#ifndef SIP_RUN
/** Nucleon is either group title, layer title or layer child item.
* E.g. layer title nucleon is just title, it does not
* include all layer subitems, the same with groups.
@ -146,6 +148,7 @@ class CORE_EXPORT QgsLegendRenderer
QSizeF mLegendSize;
#endif
};
#endif // QGSLEGENDRENDERER_H

View File

@ -49,10 +49,10 @@ class CORE_EXPORT QgsMapLayerDependency
};
//! Standard constructor
QgsMapLayerDependency( const QString &layerId, Type type = DataDependency, Origin origin = FromUser ) :
mType( type ),
mOrigin( origin ),
mLayerId( layerId )
QgsMapLayerDependency( const QString &layerId, Type type = DataDependency, Origin origin = FromUser )
: mType( type )
, mOrigin( origin )
, mLayerId( layerId )
{}
//! Return the dependency type
@ -69,12 +69,22 @@ class CORE_EXPORT QgsMapLayerDependency
{
return layerId() == other.layerId() && origin() == other.origin() && type() == other.type();
}
#ifdef SIP_RUN
//! hash operator
long __hash__() const;
% MethodCode
sipRes = qHash( *sipCpp );
% End
#endif
private:
Type mType;
Origin mOrigin;
QString mLayerId;
};
#ifndef SIP_RUN
/**
* global qHash function for QgsMapLayerDependency, so that it can be used in a QSet
*/
@ -82,5 +92,6 @@ inline uint qHash( const QgsMapLayerDependency &dep )
{
return qHash( dep.layerId() ) + dep.origin() + dep.type();
}
#endif
#endif

View File

@ -46,7 +46,7 @@ class CORE_EXPORT QgsMapLayerLegend : public QObject
* Return list of legend nodes to be used for a particular layer tree layer node.
* Ownership is transferred to the caller.
*/
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) = 0;
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) = 0 SIP_FACTORY;
// TODO: support for layer tree view delegates
@ -99,7 +99,7 @@ class CORE_EXPORT QgsDefaultVectorLayerLegend : public QgsMapLayerLegend
public:
explicit QgsDefaultVectorLayerLegend( QgsVectorLayer *vl );
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) override;
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) SIP_FACTORY override;
private:
QgsVectorLayer *mLayer = nullptr;
@ -117,7 +117,7 @@ class CORE_EXPORT QgsDefaultRasterLayerLegend : public QgsMapLayerLegend
public:
explicit QgsDefaultRasterLayerLegend( QgsRasterLayer *rl );
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) override;
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) SIP_FACTORY override;
private:
QgsRasterLayer *mLayer = nullptr;
@ -135,7 +135,7 @@ class CORE_EXPORT QgsDefaultPluginLayerLegend : public QgsMapLayerLegend
public:
explicit QgsDefaultPluginLayerLegend( QgsPluginLayer *pl );
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) override;
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) SIP_FACTORY override;
private:
QgsPluginLayer *mLayer = nullptr;

View File

@ -44,7 +44,7 @@ class CORE_EXPORT QgsMapRendererCustomPainterJob : public QgsMapRendererJob
virtual void waitForFinished() override;
virtual bool isActive() const override;
virtual bool usedCachedLabels() const override;
virtual QgsLabelingResults *takeLabelingResults() override;
virtual QgsLabelingResults *takeLabelingResults() SIP_TRANSFER override;
//! \note not available in Python bindings
const LayerRenderJobs &jobs() const { return mLayerJobs; } SIP_SKIP

View File

@ -37,6 +37,7 @@ class QgsMapLayerRenderer;
class QgsMapRendererCache;
class QgsFeatureFilterProvider;
#ifndef SIP_RUN
/// @cond PRIVATE
/** \ingroup core
@ -83,6 +84,7 @@ struct LabelRenderJob
};
///@endcond PRIVATE
#endif
/** \ingroup core
* Abstract base class for map rendering implementations.

View File

@ -42,7 +42,7 @@ class CORE_EXPORT QgsMapRendererParallelJob : public QgsMapRendererQImageJob
virtual bool isActive() const override;
virtual bool usedCachedLabels() const override;
virtual QgsLabelingResults *takeLabelingResults() override;
virtual QgsLabelingResults *takeLabelingResults() SIP_TRANSFER override;
// from QgsMapRendererJobWithPreview
virtual QImage renderedImage() override;

View File

@ -43,7 +43,7 @@ class CORE_EXPORT QgsMapRendererSequentialJob : public QgsMapRendererQImageJob
virtual bool isActive() const override;
virtual bool usedCachedLabels() const override;
virtual QgsLabelingResults *takeLabelingResults() override;
virtual QgsLabelingResults *takeLabelingResults() SIP_TRANSFER override;
// from QgsMapRendererJobWithPreview
virtual QImage renderedImage() override;

View File

@ -98,6 +98,8 @@ class CORE_EXPORT QgsMapToPixel
//! \note not available in Python bindings
void transformInPlace( float &x, float &y ) const SIP_SKIP;
#ifndef SIP_RUN
/**
* Transform device coordinates to map coordinates. Modifies the
* given coordinates in place. Intended as a fast way to do the
@ -111,6 +113,7 @@ class CORE_EXPORT QgsMapToPixel
for ( int i = 0; i < x.size(); ++i )
transformInPlace( x[i], y[i] );
}
#endif
QgsPoint toMapCoordinates( int x, int y ) const;

View File

@ -168,6 +168,8 @@ class CORE_EXPORT QgsMargins
double mBottom = 0.0;
};
#ifndef SIP_RUN
/**
* Returns \c true if \a lhs and \a rhs are equal; otherwise returns \c false.
*/
@ -319,5 +321,6 @@ inline QgsMargins operator-( const QgsMargins &margins )
}
Q_DECLARE_TYPEINFO( QgsMargins, Q_MOVABLE_TYPE );
#endif
#endif // QGSMARGINS_H

View File

@ -24,7 +24,7 @@
#include "qgis_core.h"
class QgsMessageOutput;
typedef QgsMessageOutput *( *MESSAGE_OUTPUT_CREATOR )();
typedef QgsMessageOutput *( *MESSAGE_OUTPUT_CREATOR )() SIP_SKIP;
/** \ingroup core

View File

@ -47,15 +47,15 @@ class CORE_EXPORT QgsOgcUtils
{
public:
/** GML version
* \note not available in Python bindings
/**
*GML version
*/
typedef enum SIP_SKIP
enum GMLVersion
{
GML_2_1_2,
GML_3_1_0,
GML_3_2_1,
} GMLVersion;
};
/** Static method that creates geometry from GML
\param xmlString xml representation of the geometry. GML elements are expected to be
@ -79,7 +79,7 @@ class CORE_EXPORT QgsOgcUtils
\since QGIS 2.16
*/
static QDomElement geometryToGML( const QgsGeometry *geometry, QDomDocument &doc,
GMLVersion gmlVersion,
QgsOgcUtils::GMLVersion gmlVersion,
const QString &srsName,
bool invertAxisOrientation,
const QString &gmlIdBase,
@ -138,14 +138,13 @@ class CORE_EXPORT QgsOgcUtils
static QDomElement expressionToOgcFilter( const QgsExpression &exp, QDomDocument &doc, QString *errorMessage = nullptr );
/** OGC filter version
* \note not available in Python bindings
*/
typedef enum SIP_SKIP
enum FilterVersion
{
FILTER_OGC_1_0,
FILTER_OGC_1_1,
FILTER_FES_2_0
} FilterVersion;
};
/** Creates OGC filter XML element. Supports minimum standard filter
* according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT)
@ -156,7 +155,7 @@ class CORE_EXPORT QgsOgcUtils
*/
static QDomElement expressionToOgcFilter( const QgsExpression &exp,
QDomDocument &doc,
GMLVersion gmlVersion,
QgsOgcUtils::GMLVersion gmlVersion,
FilterVersion filterVersion,
const QString &geometryName,
const QString &srsName,
@ -176,7 +175,7 @@ class CORE_EXPORT QgsOgcUtils
*/
static QDomElement expressionToOgcExpression( const QgsExpression &exp,
QDomDocument &doc,
GMLVersion gmlVersion,
QgsOgcUtils::GMLVersion gmlVersion,
FilterVersion filterVersion,
const QString &geometryName,
const QString &srsName,
@ -184,6 +183,8 @@ class CORE_EXPORT QgsOgcUtils
bool invertAxisOrientation,
QString *errorMessage = nullptr );
#ifndef SIP_RUN
/** \ingroup core
* Layer properties. Used by SQLStatementToOgcFilter().
* \since QGIS 2.16
@ -202,6 +203,7 @@ class CORE_EXPORT QgsOgcUtils
//! SRS name
QString mSRSName;
};
#endif
/** Creates OGC filter XML element from the WHERE and JOIN clauses of a SQL
* statement. Supports minimum standard filter
@ -222,7 +224,7 @@ class CORE_EXPORT QgsOgcUtils
*/
static QDomElement SQLStatementToOgcFilter( const QgsSQLStatement &statement,
QDomDocument &doc,
GMLVersion gmlVersion,
QgsOgcUtils::GMLVersion gmlVersion,
FilterVersion filterVersion,
const QList<LayerProperties> &layerProperties,
bool honourAxisOrientation,
@ -292,6 +294,8 @@ class CORE_EXPORT QgsOgcUtils
static QgsExpression::NodeBinaryOperator *nodePropertyIsNullFromOgcFilter( QDomElement &element, QString &errorMessage );
};
#ifndef SIP_RUN
/** \ingroup core
* Internal use by QgsOgcUtils
* \note not available in Python bindings
@ -397,5 +401,6 @@ class QgsOgcUtilsSQLStatementToFilter
QString &srsName,
bool &axisInversion );
};
#endif // #ifndef SIP_RUN
#endif // QGSOGCUTILS_H