73 changes: 45 additions & 28 deletions python/core/composer/qgscomposermap.sip
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ class QgsComposerMap : QgsComposerItem
/**Sets new Extent and changes width, height (and implicitely also scale)*/
void setNewExtent( const QgsRectangle& extent );

/**Sets new Extent for the current atlas preview and changes width, height (and implicitely also scale).
Atlas preview extents are only temporary, and are regenerated whenever the atlas feature changes
*/
void setNewAtlasFeatureExtent( const QgsRectangle& extent );

/**Called when atlas preview is toggled, to force map item to update its extent and redraw*/
void toggleAtlasPreview();

/**Returns a pointer to the current map extent, which is either the original user specified
extent or the temporary atlas-driven feature extent depending on the current atlas state of the composition.
Both a const and non-const version are included.*/
const QgsRectangle* currentMapExtent() const;

PreviewMode previewMode() const;
void setPreviewMode( PreviewMode m );

Expand Down Expand Up @@ -149,6 +162,9 @@ class QgsComposerMap : QgsComposerItem
/**True if composer map renders a WMS layer*/
bool containsWMSLayer() const;

/**True if composer map contains layers with blend modes or flattened layers for vectors */
bool containsAdvancedEffects() const;

/** stores state in Dom node
* @param elem is Dom element corresponding to 'Composer' tag
* @param doc Dom document
Expand Down Expand Up @@ -210,8 +226,10 @@ class QgsComposerMap : QgsComposerItem
QFont gridAnnotationFont() const;

/**Sets font color for grid annotations
@note this function was added in version 2.0*/
@note this function was added in version 2.0*/
void setAnnotationFontColor( const QColor& c );
/**Get font color for grid annotations
@note: this function was added in version 2.0*/
QColor annotationFontColor() const;

/**Sets coordinate precision for grid annotations
Expand Down Expand Up @@ -247,19 +265,19 @@ class QgsComposerMap : QgsComposerItem
@note: this function was added in version 1.9*/
void setGridFrameWidth( double w );
double gridFrameWidth() const;

/**Set grid frame pen thickness
@note: this function was added in version 2.1*/
void setGridFramePenSize( double w );
double gridFramePenSize() const;

/**Sets pen color for grid frame
@note: this function was added in version 2.1*/
void setGridFramePenColor( const QColor& c );
/**Get pen color for grid frame
@note: this function was added in version 2.1*/
QColor gridFramePenColor() const;

/**Sets first fill color for grid zebra frame
@note: this function was added in version 2.1*/
void setGridFrameFillColor1( const QColor& c );
Expand All @@ -272,14 +290,7 @@ class QgsComposerMap : QgsComposerItem
void setGridFrameFillColor2( const QColor& c );
/**Get second fill color for grid zebra frame
@note: this function was added in version 2.1*/
QColor gridFrameFillColor2() const;

/** Returns the grid's blending mode
@note added in version 2.0*/
const QPainter::CompositionMode gridBlendMode() const;
/** Sets the grid's blending mode
@note added in version 2.0*/
void setGridBlendMode( const QPainter::CompositionMode blendMode );
QColor gridFrameFillColor2() const;

/**In case of annotations, the bounding rectangle can be larger than the map item rectangle
@note this function was added in version 1.4*/
Expand All @@ -298,7 +309,7 @@ class QgsComposerMap : QgsComposerItem
* @deprecated Use setMapRotation( double rotation ) instead
*/
void setRotation( double r );
/**Returns the rotation used for drawing the map within the composer item
/**Returns the rotation used for drawing the map within the composer item
* @deprecated Use mapRotation() instead
*/
double rotation() const;
Expand Down Expand Up @@ -331,27 +342,33 @@ class QgsComposerMap : QgsComposerItem
void setOverviewFrameMapSymbol( QgsFillSymbolV2* symbol /Transfer/ );
QgsFillSymbolV2* overviewFrameMapSymbol();

/* Returns the blending mode for the overview frame
@note added in version 1.9*/
const QPainter::CompositionMode overviewBlendMode() const;
/* Sets the blending mode for the overview frame
@note added in version 1.9*/
void setOverviewBlendMode( const QPainter::CompositionMode blendMode );
/** Returns the overview's blending mode */
QPainter::CompositionMode overviewBlendMode() const;
/** Sets the overview's blending mode*/
void setOverviewBlendMode( QPainter::CompositionMode blendMode );

/**Sets flag if overview frame should be inverted
@note this function was added in version 1.9*/
void setOverviewInverted( bool inverted );
/** Returns true if the overview frame is inverted */
bool overviewInverted() const;
/** Sets the overview's inversion mode*/
void setOverviewInverted( bool inverted );

/** Returns true if the extent is forced to center on the overview */
bool overviewCentered() const;
/** Set the overview's centering mode */
void setOverviewCentered( bool centered );

void setGridLineSymbol( QgsLineSymbolV2* symbol /Transfer/ );
QgsLineSymbolV2* gridLineSymbol();

/** Returns the grid's blending mode */
QPainter::CompositionMode gridBlendMode() const;
/** Sets the grid's blending mode*/
void setGridBlendMode( QPainter::CompositionMode blendMode );

/**Sets mId to a number not yet used in the composition. mId is kept if it is not in use.
Usually, this function is called before adding the composer map to the composition*/
void assignFreeId();

/**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height, double rotation )
* instead
Expand All @@ -366,8 +383,8 @@ class QgsComposerMap : QgsComposerItem
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width, double& height, double rotation )
* instead
*/
void sizeChangedByRotation( double& width, double& height );
void sizeChangedByRotation( double& width, double& height );

/** Returns true if the map extent is set to follow the current atlas feature */
bool atlasDriven() const;
/** Set to true if the map extents should be set by the current atlas feature */
Expand All @@ -381,13 +398,13 @@ class QgsComposerMap : QgsComposerItem
/** Returns the margin size (percentage) used when the map is in atlas mode */
double atlasMargin() const;
/** Sets the margin size (percentage) used when the map is in atlas mode */
void setAtlasMargin( double margin );
void setAtlasMargin( double margin );

signals:
void extentChanged();

/**Is emitted on rotation change to notify north arrow pictures*/
void mapRotationChanged( double newRotation );
void mapRotationChanged( double newRotation );

public slots:

Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposermultiframe.sip
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class QgsComposerMultiFrame: QObject
void deleteFrames();

/** Return the number of frames associated with this multiframeset.
@note added in 2.0, replaces nFrames
@note added in 2.0, replaces nFrames
**/
int frameCount() const;
QgsComposerFrame* frame( int i );
Expand Down
8 changes: 4 additions & 4 deletions python/core/composer/qgscomposerpicture.sip
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class QgsComposerPicture: QgsComposerItem
*/
bool readXML( const QDomElement& itemElem, const QDomDocument& doc );

/**Returns the rotation used for drawing the picture within the composer item
/**Returns the rotation used for drawing the picture within the composer item
* @deprecated Use pictureRotation() instead
*/
double rotation() const;
Expand Down Expand Up @@ -69,7 +69,7 @@ class QgsComposerPicture: QgsComposerItem
* instead
*/
void sizeChangedByRotation( double& width, double& height );

public slots:
/**Sets the picture rotation within the item bounds. This does not affect the item rectangle,
only the way the picture is drawn within the item.
Expand All @@ -81,8 +81,8 @@ class QgsComposerPicture: QgsComposerItem
only the way the picture is drawn within the item.
@note this function was added in version 2.1*/
virtual void setPictureRotation( double r );

signals:
/**Is emitted on picture rotation change*/
void pictureRotationChanged( double newRotation );
void pictureRotationChanged( double newRotation );
};
6 changes: 4 additions & 2 deletions python/core/composer/qgscomposerscalebar.sip
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ class QgsComposerScaleBar: QgsComposerItem
QString style() const;

/**Returns the x - positions of the segment borders (in item coordinates) and the width
of the segment*/
of the segment
@note python bindings not available on android
*/
%If (!ANDROID)
void segmentPositions( QList<QPair<double, double> >& posWidthList ) const;
%End
Expand Down Expand Up @@ -144,6 +146,6 @@ class QgsComposerScaleBar: QgsComposerItem
/**Calculates with of a segment in mm and stores it in mSegmentMillimeters*/
void refreshSegmentMillimeters();

/**Returns diagonal of composer map in selected units (map units / meters / feet)*/
/**Returns diagonal of composer map in selected units (map units / meters / feet / nautical miles)*/
double mapWidth() const;
};
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposershape.sip
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class QgsComposerShape: QgsComposerItem
/**Returns the radius for rounded rectangle corners*/
double cornerRadius() const;

/**Sets the QgsFillSymbolV2 used to draw the shape. Must also call setUseSymbolV2( true ) to
/**Sets the QgsFillSymbolV2 used to draw the shape. Must also call setUseSymbolV2( true ) to
* enable drawing with a symbol.
* Note: added in version 2.1*/
void setShapeStyleSymbol( QgsFillSymbolV2* symbol );
Expand Down
1 change: 1 addition & 0 deletions python/core/composer/qgscomposertexttable.sip
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class QgsComposerTextTable: QgsComposerTable
bool readXML( const QDomElement& itemElem, const QDomDocument& doc );

protected:
//! @note not available in python bindings
// bool getFeatureAttributes( QList< QMap<int, QVariant> >& attributes );
QMap<int, QString> getHeaderLabels() const;
};
14 changes: 8 additions & 6 deletions python/core/composer/qgscomposition.sip
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ class QgsComposition : QGraphicsScene

QList<QgsComposerItem*> selectedComposerItems();

/**Returns pointers to all composer maps in the scene*/
%If (QLISTCONSTPTR_CONVERSION)
/**Returns pointers to all composer maps in the scene
@note available in python bindings only with PyQt >= 4.8.4
*/
QList<const QgsComposerMap*> composerMapItems() const;
%End

Expand Down Expand Up @@ -234,10 +236,8 @@ class QgsComposition : QGraphicsScene
@param pasteInPlace whether the position should be kept but mapped to the page origin. (the page is the page under to the mouse cursor)
@note not available in python bindings
*/
/*
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
bool addUndoCommands = false, QPointF* pos = 0, bool pasteInPlace = false );
*/
// void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
// bool addUndoCommands = false, QPointF* pos = 0, bool pasteInPlace = false );

/**Adds item to z list. Usually called from constructor of QgsComposerItem*/
void addItemToZList( QgsComposerItem* item );
Expand Down Expand Up @@ -283,7 +283,9 @@ class QgsComposition : QGraphicsScene
/**Returns pointer to snap lines collection*/
QList< QGraphicsLineItem* >* snapLines();

/**Returns pointer to selection handles*/
/**Returns pointer to selection handles
* @note not available in python bindings
*/
// QgsComposerMouseHandles* selectionHandles();

/**Add a custom snap line (can be horizontal or vertical)*/
Expand Down
15 changes: 9 additions & 6 deletions python/core/composer/qgslegendmodel.sip
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/** \ingroup MapComposer
* A model that provides layers as root items. The classification items are
* children of the layer items.
* A model that provides group, layer and classification items.
*/

class QgsLegendModel: QStandardItemModel
class QgsLegendModel : QStandardItemModel
{
%TypeHeaderCode
#include <qgslegendmodel.h>
Expand All @@ -23,7 +21,7 @@ class QgsLegendModel: QStandardItemModel

/**Sets layer set and groups*/
void setLayerSetAndGroups( const QStringList& layerIds, const QList< QPair< QString, QList<QString> > >& groupInfo );
void setLayerSet( const QStringList& layerIds );
void setLayerSet( const QStringList& layerIds, double scaleDenominator = -1, QString rule = "" );
/**Adds a group
@param text name of group (defaults to translation of "Group")
@param position insertion position (toplevel position (or -1 if it should be placed at the end of the legend).
Expand All @@ -37,8 +35,13 @@ class QgsLegendModel: QStandardItemModel
void updateLayer( QStandardItem* layerItem );
/**Tries to update a single classification item*/
void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbolV2* symbol, QString itemText );

void updateRasterClassificationItem( QStandardItem* classificationItem );

/** Update single item text using item userText and other properties like showFeatureCount */
void updateItemText( QStandardItem* item );


bool writeXML( QDomElement& composerLegendElem, QDomDocument& doc ) const;
bool readXML( const QDomElement& legendModelElem, const QDomDocument& doc );

Expand All @@ -60,7 +63,7 @@ class QgsLegendModel: QStandardItemModel

public slots:
void removeLayer( const QString& layerId );
void addLayer( QgsMapLayer* theMapLayer );
void addLayer( QgsMapLayer* theMapLayer, double scaleDenominator = -1, QString rule = "" );

signals:
void layersChanged();
Expand Down
18 changes: 15 additions & 3 deletions python/core/composer/qgspaperitem.sip
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
/**Item representing the paper. May draw the snapping grid lines if composition is in
preview mode*/
class QgsPaperItem: QgsComposerItem
/**Item representing a grid. This is drawn separately to the underlying paper item since the grid needs to be
* drawn above all other composer items, while the paper item is drawn below all others.*/
class QgsPaperGrid : QGraphicsRectItem
{
public:
QgsPaperGrid( double x, double y, double width, double height, QgsComposition* composition );
~QgsPaperGrid();

/** \brief Reimplementation of QCanvasItem::paint*/
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );

};

/**Item representing the paper.*/
class QgsPaperItem : QgsComposerItem
{
%TypeHeaderCode
#include <qgspaperitem.h>
Expand Down
3 changes: 2 additions & 1 deletion python/core/core.sip
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
%Include qgsdatasourceuri.sip
%Include qgsdbfilterproxymodel.sip
%Include qgsdistancearea.sip
%Include qgsdxfexport.sip
%Include qgseditorwidgetconfig.sip
%Include qgserror.sip
%Include qgsexpression.sip
Expand Down Expand Up @@ -212,3 +211,5 @@
%Include symbology-ng/qgssymbollayerv2registry.sip

%Include symbology-ng/qgssymbologyv2conversion.sip

%Include dxf/qgsdxfexport.sip
6 changes: 4 additions & 2 deletions python/core/diagram/qgsdiagram.sip
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ class QgsDiagram
%End
public:
virtual ~QgsDiagram();
/**Draws the diagram at the given position (in pixel coordinates)*/
void clearCache();
QgsExpression* getExpression( const QString& expression, const QgsFields* fields );
/** @deprecated `void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position )` should be used instead */
virtual void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) /Deprecated/;
/**Draws the diagram at the given position (in pixel coordinates)*/
virtual void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) = 0;
virtual QString diagramName() const = 0;
/**Returns the size in map units the diagram will use to render.*/
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ) = 0;
/**Returns the size in map units the diagram will use to render. Interpolate size*/
/** @deprecated `QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is )` should be used instead */
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) /Deprecated/;
/**Returns the size in map units the diagram will use to render. Interpolate size*/
virtual QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) = 0;
Expand Down
81 changes: 81 additions & 0 deletions python/core/dxf/qgsdxfexport.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/***************************************************************************
qgsdxfexport.sip
----------------
begin : September 2013
copyright : (C) 2013 by Marco Hugentobler
email : marco at sourcepole 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. *
* *
***************************************************************************/

class QgsDxfExport
{
%TypeHeaderCode
#include <qgsdxfexport.h>
%End
public:
enum SymbologyExport
{
NoSymbology = 0, //export only data
FeatureSymbology, //Keeps the number of features and export symbology per feature (using the first symbol level)
SymbolLayerSymbology //Exports one feature per symbol layer (considering symbol levels)
};

QgsDxfExport();
~QgsDxfExport();

void addLayers( QList< QgsMapLayer* >& layers );
int writeToFile( QIODevice* d );

void setSymbologyScaleDenominator( double d );
double symbologyScaleDenominator() const;

void setMapUnits( QGis::UnitType u );
QGis::UnitType mapUnits() const;

void setSymbologyExport( QgsDxfExport::SymbologyExport e );
QgsDxfExport::SymbologyExport symbologyExport() const;

void setExtent( const QgsRectangle& r );
QgsRectangle extent() const;

//get closest entry in dxf palette
static int closestColorMatch( QRgb pixel );

//! @note available in python bindings as writeGroupInt
void writeGroup( int code, int i ) /PyName=writeGroupInt/;
//! @note available in python bindings as writeGroupDouble
void writeGroup( int code, double d ) /PyName=writeGroupDouble/;
void writeGroup( int code, const QString& s );
void writeGroupCode( int code );
void writeInt( int i );
void writeDouble( double d );
void writeString( const QString& s );

//draw dxf primitives
void writePolyline( const QgsPolyline& line, const QString& layer, const QString& lineStyleName, int color,
double width = -1, bool polygon = false );

void writeSolid( const QString& layer, int color, const QgsPoint& pt1, const QgsPoint& pt2, const QgsPoint& pt3, const QgsPoint& pt4 );

//write line (as a polyline)
void writeLine( const QgsPoint& pt1, const QgsPoint& pt2, const QString& layer, const QString& lineStyleName, int color, double width = -1 );

void writePoint( const QString& layer, int color, const QgsPoint& pt );

void writeCircle( const QString& layer, int color, const QgsPoint& pt, double radius );

void writeText( const QString& layer, const QString& text, const QgsPoint& pt, double size, double angle, int color );

static double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits );

static QString dxfLayerName( const QString& name );

};
12 changes: 9 additions & 3 deletions python/core/gps/qgsqtlocationconnection.sip
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ class QgsQtLocationConnection: QgsGPSConnection
/**Parse available data source content*/
void parseData();

/**Called when the position updated.*/
/**Called when the position updated.
* @note not available in python binding
*/
// void positionUpdated( const QGeoPositionInfo &info );

%If (!ANDROID)
/**Called when the number of satellites in view is updated.*/
/**Called when the number of satellites in view is updated.
* @note only available in python bindings on android
*/
void satellitesInViewUpdated( const QList<QGeoSatelliteInfo>& satellites );

/**Called when the number of satellites in use is updated.*/
/**Called when the number of satellites in use is updated.
* @note only available in python bindings on android
*/
void satellitesInUseUpdated( const QList<QGeoSatelliteInfo>& satellites );
%End
};
Expand Down
3 changes: 2 additions & 1 deletion python/core/qgsclipper.sip
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class QgsClipper
// feature in x and y. The shapeOpen parameter determines whether
// the function treats the points as a closed shape (polygon), or as
// an open shape (linestring).

//
// @note python binding only available on android
%If (!ANDROID)
static void trimFeature( QVector<double>& x,
QVector<double>& y,
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgscoordinatereferencesystem.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class QgsCoordinateReferenceSystem
{
InternalCrsId,
PostgisCrsId,
EpsgCrsId
EpsgCrsId // deprecated
};

//! Default constructor
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgscoordinatetransform.sip
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class QgsCoordinateTransform : QObject
/**Returns list of datum transformations for the given src and dest CRS
* @note not available in python bindings
*/
//static QList< QList< int > > datumTransformations( const QgsCoordinateReferenceSystem& srcCRS, const QgsCoordinateReferenceSystem& destCRS );
// static QList< QList< int > > datumTransformations( const QgsCoordinateReferenceSystem& srcCRS, const QgsCoordinateReferenceSystem& destCRS );
static QString datumTransformString( int datumTransform );
/**Gets name of source and dest geographical CRS (to show in a tooltip)
@return epsgNr epsg code of the transformation (or 0 if not in epsg db)*/
Expand Down
7 changes: 7 additions & 0 deletions python/core/qgscredentials.sip
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class QgsCredentials
};


/**
\brief Default implementation of credentials interface

This class outputs message to the standard output and retrieves input from
standard input. Therefore it won't be the right choice for apps without
GUI.
*/
class QgsCredentialsConsole : QObject, QgsCredentials
{
%TypeHeaderCode
Expand Down
5 changes: 3 additions & 2 deletions python/core/qgsdatadefined.sip
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class QgsDataDefined
QString expressionString() const;
void setExpressionString( const QString& expr );


// @note not available in python bindings
//QMap<QString, QVariant> expressionParams() const;

// @note not available in python bindings
//void setExpressionParams( QMap<QString, QVariant> params );
void insertExpressionParam( QString key, QVariant param );

Expand All @@ -49,6 +49,7 @@ class QgsDataDefined
QString field() const;
void setField( const QString& field );

// @note not available in python bindings
//QMap< QString, QString > toMap();

};
2 changes: 2 additions & 0 deletions python/core/qgsdataitem.sip
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class QgsDirectoryItem : QgsDataCollectionItem
virtual QWidget *paramWidget() /Factory/;

/* static QVector<QgsDataProvider*> mProviders; */
//! @note not available via python bindings
// static QVector<QLibrary*> mLibraries;
};

Expand Down Expand Up @@ -262,6 +263,7 @@ class QgsZipItem : QgsDataCollectionItem
QVector<QgsDataItem*> createChildren();
const QStringList & getZipFileList();

//! @note not available via python bindings
// static QVector<dataItem_t *> mDataItemPtr;
static QStringList mProviderNames;

Expand Down
12 changes: 12 additions & 0 deletions python/core/qgsdataprovider.sip
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,18 @@ class QgsDataProvider : QObject
synchronize with changes in the data source*/
virtual void reloadData();

/** Time stamp of data source in the moment when data/metadata were loaded by provider */
virtual QDateTime timestamp() const;

/** Current time stamp of data source */
virtual QDateTime dataTimestamp() const;

/** Get current status error. This error describes some principal problem
* for which provider cannot work and thus is not valid. It is not last error
* after accessing data by block(), identify() etc.
*/
virtual QgsError error() const;

signals:

/**
Expand Down
6 changes: 6 additions & 0 deletions python/core/qgsdiagramrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ class QgsLinearlyInterpolatedDiagramRenderer : QgsDiagramRendererV2
int classificationAttribute() const;
void setClassificationAttribute( int index );

QString classificationAttributeExpression() const;
void setClassificationAttributeExpression( QString expression );

bool classificationAttributeIsExpression() const;
void setClassificationAttributeIsExpression( bool isExpression );

void readXML( const QDomElement& elem, const QgsVectorLayer* layer );
void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVectorLayer* layer ) const;

Expand Down
17 changes: 10 additions & 7 deletions python/core/qgsdistancearea.sip
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ class QgsDistanceArea
//! sets source spatial reference system (by QGIS CRS)
void setSourceCrs( long srsid );

//! sets source spatial reference system (by QGIS CRS)
/**
* Sets source spatial reference system (by QGIS CRS)
* @note: missing in Python bindings in QGIS < 2.2
*/
void setSourceCrs( const QgsCoordinateReferenceSystem& srcCRS );

//! sets source spatial reference system by authid
void setSourceAuthId( QString authid );

//! returns source spatial reference system
long sourceCrs();
long sourceCrs() const;
//! What sort of coordinate system is being used?
bool geographic();
bool geographic() const;

//! sets ellipsoid by its acronym
bool setEllipsoid( const QString& ellipsoid );
Expand All @@ -43,14 +46,14 @@ class QgsDistanceArea
bool setEllipsoid( double semiMajor, double semiMinor );

//! returns ellipsoid's acronym
const QString& ellipsoid();
const QString& ellipsoid() const;

//! returns ellipsoid's semi major axis
double ellipsoidSemiMajor();
double ellipsoidSemiMajor() const;
//! returns ellipsoid's semi minor axis
double ellipsoidSemiMinor();
double ellipsoidSemiMinor() const;
//! returns ellipsoid's inverse flattening
double ellipsoidInverseFlattening();
double ellipsoidInverseFlattening() const;

//! general measurement (line distance or polygon area)
double measure( QgsGeometry* geometry );
Expand Down
29 changes: 0 additions & 29 deletions python/core/qgsdxfexport.sip

This file was deleted.

35 changes: 35 additions & 0 deletions python/core/qgserror.sip
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class QgsErrorMessage
#include <qgserror.h>
%End
public:
/** Format */
enum Format
{
Text, // Plain text
Expand All @@ -12,6 +13,13 @@ class QgsErrorMessage

QgsErrorMessage();

/** Constructor.
* @param theMessage error message string
* @param theTag error label, for example GDAL, GDAL Provider, Raster layer
* @param theFile the file where error was created
* @param theFunction the function where error was created
* @param theLine the line where error was created
*/
QgsErrorMessage( const QString & theMessage, const QString & theTag = QString::null, const QString & theFile = QString::null, const QString & theFunction = QString::null, int theLine = 0 );

QString message() const;
Expand All @@ -21,6 +29,11 @@ class QgsErrorMessage
int line() const;
};

/** \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
{
%TypeHeaderCode
Expand All @@ -30,18 +43,40 @@ class QgsError

QgsError();

/** Constructor with single message.
* @param theMessage error message
* @param theTag short description, e.g. GDAL, Provider, Layer
*/
QgsError( const QString & theMessage, const QString & theTag );

/** Append new error message.
* @param theMessage error message string
* @param theTag error label, for example GDAL, GDAL Provider, Raster layer
*/
void append( const QString & theMessage, const QString & theTag );

/** Append new error message.
* @param theMessage error message
*/
void append( const QgsErrorMessage & theMessage );

/** Test if any error is set.
* @return true if contains error
*/
bool isEmpty() const;

/** Full error messages description
* @param theFormat output format
* @return error report
*/
QString message( QgsErrorMessage::Format theFormat = QgsErrorMessage::Html ) const;

/** Short error descriprion, usually the first error in chain, the real error.
* @return error description
*/
QString summary() const;

/** Clear error messages */
void clear();
};

1 change: 0 additions & 1 deletion python/core/qgsexpression.sip
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ class QgsExpression
class NodeCondition : QgsExpression::Node
{
public:
// NodeCondition( QList<QgsExpression::WhenThen*> *conditions /Transfer/, QgsExpression::Node* elseExp = 0 /Transfer/ );
NodeCondition( QList<QgsExpression::WhenThen*> *conditions, QgsExpression::Node* elseExp = 0 );
~NodeCondition();

Expand Down
42 changes: 19 additions & 23 deletions python/core/qgsfeatureiterator.sip
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ class QgsFeatureIterator
#include <qgsfeatureiterator.h>
%End

public:


QgsFeatureIterator* __iter__();
public:
QgsFeatureIterator* __iter__();
%MethodCode
sipRes = sipCpp;
%End
Expand All @@ -86,23 +84,21 @@ public:
PyErr_SetString(PyExc_StopIteration,"");
}
%End


//! construct invalid iterator
QgsFeatureIterator();
//! construct a valid iterator
//QgsFeatureIterator(QgsAbstractFeatureIterator* iter);
//! copy constructor copies the iterator, increases ref.count
QgsFeatureIterator(const QgsFeatureIterator& fi);
//! destructor deletes the iterator if it has no more references
~QgsFeatureIterator();

//QgsFeatureIterator& operator=(const QgsFeatureIterator& other);

bool nextFeature(QgsFeature& f);
bool rewind();
bool close();

//! find out whether the iterator is still valid or closed already
bool isClosed();
//! construct invalid iterator
QgsFeatureIterator();
//! construct a valid iterator
// QgsFeatureIterator( QgsAbstractFeatureIterator* iter );
//! copy constructor copies the iterator, increases ref.count
QgsFeatureIterator( const QgsFeatureIterator& fi );
//! destructor deletes the iterator if it has no more references
~QgsFeatureIterator();

// QgsFeatureIterator& operator=(const QgsFeatureIterator& other);

bool nextFeature( QgsFeature& f );
bool rewind();
bool close();

//! find out whether the iterator is still valid or closed already
bool isClosed() const;
};
6 changes: 3 additions & 3 deletions python/core/qgsfeaturerequest.sip
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class QgsFeatureRequest
enum Flag
{
NoFlags = 0,
NoGeometry = 1,
SubsetOfAttributes = 2,
ExactIntersect = 4
NoGeometry = 1, //!< Geometry is not required. It may still be returned if e.g. required for a filter condition.
SubsetOfAttributes = 2, //!< Fetch only a subset of attributes (setSubsetOfAttributes sets this flag)
ExactIntersect = 4 //!< Use exact geometry intersection (slower) instead of bounding boxes
};
typedef QFlags<QgsFeatureRequest::Flag> Flags;

Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsfeaturestore.sip
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class QgsFeatureStore
/** Get fields list */
QgsFields& fields();

/** Set fields */
/** Set fields. Resets feauters fields to pointer to new internal fields. */
void setFields( const QgsFields & fields );

/** Get crs */
Expand All @@ -32,7 +32,7 @@ class QgsFeatureStore
* @param feature
* @note added in 2.1
*/
void addFeature ( const QgsFeature& feature );
void addFeature( const QgsFeature& feature );

/** Get features list reference */
QgsFeatureList& features();
Expand Down
30 changes: 26 additions & 4 deletions python/core/qgsgeometrysimplifier.sip
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,37 @@ class QgsAbstractGeometrySimplifier
public:
virtual ~QgsAbstractGeometrySimplifier();

/** Returns a simplified version the specified geometry */
//! Returns a simplified version the specified geometry
virtual QgsGeometry* simplify( QgsGeometry* geometry ) const = 0;
/** Simplifies the specified geometry */
//! Simplifies the specified geometry
virtual bool simplifyGeometry( QgsGeometry* geometry ) const = 0;

// MapToPixel simplification helper methods
public:
/** Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance */
//! Returns whether the device-envelope can be replaced by its BBOX when is applied the specified tolerance
static bool canbeGeneralizedByDeviceBoundingBox( const QgsRectangle& envelope, float mapToPixelTol = 1.0f );
/** Returns whether the device-geometry can be replaced by its BBOX when is applied the specified tolerance */
//! Returns whether the device-geometry can be replaced by its BBOX when is applied the specified tolerance
static bool canbeGeneralizedByDeviceBoundingBox( const QVector<QPointF>& points, float mapToPixelTol = 1.0f );
};

/***************************************************************************/
/**
* 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
{
%TypeHeaderCode
#include "qgsgeometrysimplifier.h"
%End
public:
QgsTopologyPreservingSimplifier( double tolerance );
virtual ~QgsTopologyPreservingSimplifier();

//! Returns a simplified version the specified geometry
virtual QgsGeometry* simplify( QgsGeometry* geometry ) const;
//! Simplifies the specified geometry
virtual bool simplifyGeometry( QgsGeometry* geometry ) const;
};
13 changes: 12 additions & 1 deletion python/core/qgsgml.sip
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ class QgsGml: QObject

~QgsGml();

/** Read from GML data. */
/** Does the Http GET request to the wfs server
* Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.
* @param uri GML URL
* @param wkbType wkbType to retrieve
* @param extent retrieved extents
* @return 0 in case of success
*/
int getFeatures( const QString& uri, QGis::WkbType* wkbType, QgsRectangle* extent = 0 ) /PyName=getFeaturesUri/;

/** Read from GML data. Constructor uri param is ignored
* Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.
*/
int getFeatures( const QByteArray &data, QGis::WkbType* wkbType, QgsRectangle* extent = 0 );

/** Get parsed features for given type name */
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsgmlschema.sip
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class QgsGmlFeatureClass
QStringList & geometryAttributes();
};

class QgsGmlSchema: QObject
class QgsGmlSchema : QObject
{

%TypeHeaderCode
Expand Down
14 changes: 11 additions & 3 deletions python/core/qgslabelsearchtree.sip
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ class QgsLabelSearchTree
/**Removes and deletes all the entries*/
void clear();

/**Returns label position(s) at a given point. QgsLabelSearchTree keeps ownership, don't delete the LabelPositions*/
/**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 );

/**Returns label position(s) in given rectangle. QgsLabelSearchTree keeps ownership, don't delete the LabelPositions*/
/**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 );

/**Inserts label position. Does not take ownership of labelPos
@return true in case of success*/
* @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 );
};
4 changes: 2 additions & 2 deletions python/core/qgslogger.sip
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class QgsLogger
static void debug( const QString& var, int val, int debuglevel = 1, const char* file = NULL, const char* function = NULL, int line = -1 );

/**Similar to the previous method, but prints a variable double-value pair*/
// PyQGIS: commented out - has the same python signature as method above
// @note not available in python bindings
// static void debug( const QString& var, double val, int debuglevel = 1, const char* file = NULL, const char* function = NULL, int line = -1 );

/**Prints out a variable/value pair for types with overloaded operator<<*/
// TODO: is it possible to make this working?
// @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);

Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsmaplayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class QgsMapLayer : QObject
void setAbstract( const QString& abstract );
const QString& abstract() const;

void setKeywordList( const QString& kwdList );
void setKeywordList( const QString& keywords );
const QString& keywordList() const;

/* Layer dataUrl information */
Expand All @@ -108,7 +108,7 @@ class QgsMapLayer : QObject
const QString& metadataUrlFormat() const;

/* Set the blending mode used for rendering a layer */
void setBlendMode( const QPainter::CompositionMode blendMode );
void setBlendMode( const QPainter::CompositionMode &blendMode );
/* Returns the current blending mode for a layer */
QPainter::CompositionMode blendMode() const;

Expand Down
27 changes: 26 additions & 1 deletion python/core/qgsmaplayerregistry.sip
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@ class QgsMapLayerRegistry : QObject
* @param addToLegend If true (by default), the layers will be added to the
* legend and to the main canvas. If you have a private
* layer, you can set this parameter to false to hide it.
* @param takeOwnership Ownership will be transferred to the layer registry.
* If you specify false here, you have take care of deleting
* the layers yourself. Not available in python.
*
* @return QList<QgsMapLayer *> - a list of the map layers that were added
* successfully. If a layer is invalid, or already exists in the registry,
* it will not be part of the returned QList.
*
* @note As a side-effect QgsProject is made dirty.
* @note Added in QGIS 1.8
* @note takeOwner not available in python binding - always takes ownership
*/
QList<QgsMapLayer *> addMapLayers(QList<QgsMapLayer *> theMapLayers /Transfer/,
QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers /Transfer/,
bool addToLegend = true );

/**
Expand All @@ -63,13 +67,17 @@ class QgsMapLayerRegistry : QObject
* @param addToLegend If true (by default), the layer will be added to the
* legend and to the main canvas. If you have a private
* you can set this parameter to false to hide it.
* @param takeOwnership Ownership will be transferred to the layer registry.
* If you specify false here, you have take care of deleting
* the layer yourself. Not available in python.
*
* @return NULL if unable to add layer, otherwise pointer to newly added layer
*
* @see addMapLayers
*
* @note As a side-effect QgsProject is made dirty.
* @note Use addMapLayers if adding more than one layer at a time
* @note takeOwner not available in python binding - always takes ownership
*/
QgsMapLayer* addMapLayer( QgsMapLayer * theMapLayer /Transfer/, bool addToLegend = true );

Expand Down Expand Up @@ -145,6 +153,23 @@ class QgsMapLayerRegistry : QObject
*/
void layerWillBeRemoved( QString theLayerId );

/**
* Emitted after one or more layers were removed from the registry
*
* @param theLayerIds A list of ids of the layers which were removed.
*/
void layersRemoved( QStringList theLayerIds );

/**
* Emitted after a layer was removed from the registry
*
* @param theLayerId The id of the layer removed
*
* @note Consider using {@link layersRemoved()} instead
*/
void layerRemoved( QString theLayerId );


/**
* Emitted, when all layers are removed, before {@link layersWillBeRemoved()} and
* {@link layerWillBeRemoved()} signals are emitted. You will still get these signals
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmessagelog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class QgsMessageLog : QObject
};

//! add a message to the instance (and create it if necessary)
static void logMessage( QString message, QString tag = QString::null, MessageLevel level = WARNING);
static void logMessage( QString message, QString tag = QString::null, MessageLevel level = WARNING );

signals:
void messageReceived( QString message, QString tag, MessageLevel level );
Expand Down
1 change: 1 addition & 0 deletions python/core/qgsmessageoutput.sip
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class QgsMessageOutput
virtual void showMessage( bool blocking = true ) = 0;

//! 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);

Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsogcutils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class QgsOgcUtils
static QDomElement rectangleToGMLEnvelope( QgsRectangle* env, QDomDocument& doc );


/** Parse XML with OGC fill into QColor */
static QColor colorFromOgcFill( const QDomElement& fillElement );

/** Parse XML with OGC filter into QGIS expression */
static QgsExpression* expressionFromOgcFilter( const QDomElement& element ) /Factory/;

Expand Down
18 changes: 9 additions & 9 deletions python/core/qgspallabeling.sip
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@ class QgsPalLayerSettings
/** Convert old property value to new one as delimited values
* @note not available in python bindings; added in 1.9, as temporary solution until refactoring of project settings
*/
//QString updateDataDefinedString( const QString& value );
QString updateDataDefinedString( const QString& value );

/** Get property value as separate values split into Qmap
* @note not available in python bindings; added in 1.9
*/
//QMap<QString, QString> dataDefinedMap( QgsPalLayerSettings::DataDefinedProperties p ) const;
QMap<QString, QString> dataDefinedMap( QgsPalLayerSettings::DataDefinedProperties p ) const;

/** Get data defined property value from expression string or attribute field name
* @returns value inside QVariant
Expand All @@ -470,7 +470,7 @@ class QgsPalLayerSettings
* @returns true/false whether result is null or invalid
* @note not available in python bindings; added in 1.9
*/
//bool dataDefinedEvaluate( QgsPalLayerSettings::DataDefinedProperties p, QVariant& exprVal ) const;
bool dataDefinedEvaluate( QgsPalLayerSettings::DataDefinedProperties p, QVariant& exprVal ) const;

/** Whether data definition is active
*/
Expand Down Expand Up @@ -554,7 +554,6 @@ class QgsLabelComponent

bool useRotation() const;
void setUseRotation( bool use );

const QgsPoint& center();
void setCenter( QgsPoint point );

Expand Down Expand Up @@ -615,7 +614,7 @@ class QgsPalLabeling : QgsLabelingEngineInterface

bool isShowingAllLabels() const;
void setShowingAllLabels( bool showing );

bool isShowingPartialsLabels() const;
void setShowingPartialsLabels( bool showing );

Expand Down Expand Up @@ -650,11 +649,12 @@ class QgsPalLabeling : QgsLabelingEngineInterface
//! called when passing engine among map renderers
virtual QgsLabelingEngineInterface* clone() /Factory/;

/*
void drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* painter, const QgsMapToPixel* xform );
//! @note not available in python bindings
// void drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* painter, const QgsMapToPixel* xform );
//!drawLabel
void drawLabel( pal::LabelPosition* label, QgsRenderContext& context, QgsPalLayerSettings& tmpLyr, DrawLabelType drawType );
*/
//! @note not available in python bindings
// void drawLabel( pal::LabelPosition* label, QgsRenderContext& context, QgsPalLayerSettings& tmpLyr, DrawLabelType drawType );

static void drawLabelBuffer( QgsRenderContext& context,
QgsLabelComponent component,
const QgsPalLayerSettings& tmpLyr );
Expand Down
10 changes: 8 additions & 2 deletions python/core/qgspluginlayerregistry.sip
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ class QgsPluginLayerType

};

//=============================================================================

/** \ingroup core
a registry of plugin layers types

\note added in v1.5
*/
class QgsPluginLayerRegistry
{
%TypeHeaderCode
Expand All @@ -44,10 +50,10 @@ class QgsPluginLayerRegistry
bool removePluginLayerType( QString typeName );

/** return plugin layer type metadata or NULL if doesn't exist */
QgsPluginLayerType* pluginLayerType(QString typeName);
QgsPluginLayerType* pluginLayerType( QString typeName );

/** return new layer if corresponding plugin has been found, else return NULL */
QgsPluginLayer* createLayer(QString typeName) /Factory/;
QgsPluginLayer* createLayer( QString typeName ) /Factory/;

private:

Expand Down
6 changes: 4 additions & 2 deletions python/core/qgspoint.sip
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@


/** \ingroup core
* A class to represent a point geometry.
* Currently no Z axis / 2.5D support is implemented.
*/
class QgsPoint
{

Expand Down
30 changes: 19 additions & 11 deletions python/core/qgsproject.sip
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

/** Reads and writes project states.
/** \ingroup core
* Reads and writes project states.


@note
Expand Down Expand Up @@ -170,9 +171,12 @@ class QgsProject : QObject
@note The key string <em>must</em> include '/'s. E.g., "/foo" not "foo".
*/
//@{
//! @note available in python bindings as writeEntryBool
bool writeEntry( const QString & scope, const QString & key, bool value ) /PyName=writeEntryBool/;
//! @note available in python bindings as writeEntryDouble
bool writeEntry( const QString & scope, const QString & key, double value ) /PyName=writeEntryDouble/;
bool writeEntry( const QString & scope, const QString & key, int value );
bool writeEntry( const QString & scope, const QString & key, const QString & value );
bool writeEntry( const QString & scope, const QString & key, const QStringList & value );
//@}

Expand All @@ -185,7 +189,7 @@ class QgsProject : QObject
@note The key string <em>must</em> include '/'s. E.g., "/foo" not "foo".
*/
//@{
QStringList readListEntry( const QString & scope, const QString & key, QStringList def = QStringList(), bool * ok = 0 ) const;
QStringList readListEntry( const QString & scope, const QString & key, QStringList def = QStringList(), bool *ok = 0 ) const;

QString readEntry( const QString & scope, const QString & key, const QString & def = QString::null, bool * ok = 0 ) const;
int readNumEntry( const QString & scope, const QString & key, int def = 0, bool * ok = 0 ) const;
Expand Down Expand Up @@ -235,41 +239,44 @@ class QgsProject : QObject
@note added in 1.4 */
void setBadLayerHandler( QgsProjectBadLayerHandler* handler /Transfer/ );

/**Returns project file path if layer is embedded from other project file. Returns empty string if layer is not embedded*/
/** Returns project file path if layer is embedded from other project file. Returns empty string if layer is not embedded*/
QString layerIsEmbedded( const QString& id ) const;

/**Creates a maplayer instance defined in an arbitrary project file. Caller takes ownership
/** Creates a maplayer instance defined in an arbitrary project file. Caller takes ownership
@return the layer or 0 in case of error
@note: added in version 1.8
@note not available in python bindings
*/
/*
bool createEmbeddedLayer( const QString& layerId, const QString& projectFilePath, QList<QDomNode>& brokenNodes,
QList< QPair< QgsVectorLayer*, QDomElement > >& vectorLayerList, bool saveFlag = true );
*/

/**Convenience function to set snap settings per layer
/** Convenience function to set snap settings per layer
@note added in version 1.9*/
void setSnapSettingsForLayer( const QString& layerId, bool enabled, QgsSnapper::SnappingType type, QgsTolerance::UnitType unit, double tolerance,
bool avoidIntersection );

/**Convenience function to query snap settings of a layer
/** Convenience function to query snap settings of a layer
@note added in version 1.9*/
bool snapSettingsForLayer( const QString& layerId, bool& enabled /Out/, QgsSnapper::SnappingType& type /Out/, QgsTolerance::UnitType& units /Out/, double& tolerance /Out/,
bool& avoidIntersection /Out/ ) const;

/**Convenience function to set topological editing
/** Convenience function to set topological editing
@note added in version 1.9*/
void setTopologicalEditing( bool enabled );

/**Convenience function to query topological editing status
@note added in version 1.9*/
/** Convenience function to query topological editing status
@note added in version 1.9*/
bool topologicalEditing() const;

/** Return project's home path
@return home path of project (or QString::null if not set)
@note added in version 2.0 */
@return home path of project (or QString::null if not set)
@note added in version 2.0 */
QString homePath() const;

QgsRelationManager* relationManager() const;

protected:

/** Set error message from read/write operation
Expand All @@ -281,6 +288,7 @@ class QgsProject : QObject
void clearError();

//Creates layer and adds it to maplayer registry
//! @note not available in python bindings
// bool addLayer( const QDomElement& layerElem, QList<QDomNode>& brokenNodes, QList< QPair< QgsVectorLayer*, QDomElement > >& vectorLayerList );

signals:
Expand Down
3 changes: 2 additions & 1 deletion python/core/qgsprovidermetadata.sip
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

/** holds data provider key, description, and associated shared library file information
/** \ingroup core
* Holds data provider key, description, and associated shared library file information.

The metadata class is used in a lazy load implementation in
QgsProviderRegistry. To save memory, data providers are only actually
Expand Down
4 changes: 3 additions & 1 deletion python/core/qgsproviderregistry.sip
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

/** canonical manager of data providers

/** \ingroup core
* A registry / canonical manager of data providers.

This is a Singleton class that manages data provider access.
*/
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgspythonrunner.sip
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class QgsPythonRunner
static bool run( QString command, QString messageOnError = QString() );

/** Eval a python statement */
static bool eval( QString command, QString& result);
static bool eval( QString command, QString& result );

/** assign an instance of python runner so that run() can be used.
This method should be called during app initialization.
Expand Down
21 changes: 12 additions & 9 deletions python/core/qgsrectangle.sip
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ class QgsRectangle
//! Construct a rectangle from two points. The rectangle is normalized after construction.
QgsRectangle( const QgsPoint & p1, const QgsPoint & p2 );
//! Construct a rectangle from a QRectF. The rectangle is normalized after construction.
//@note added in 2.0
//! @note added in 2.0
QgsRectangle( const QRectF & qRectF );
//! Copy constructor
QgsRectangle( const QgsRectangle &other );
//! Destructor
~QgsRectangle();
//! Set the rectangle from two QgsPoints. The rectangle is
//normalised after construction.
//! normalised after construction.
void set( const QgsPoint& p1, const QgsPoint& p2 );
//! Set the rectangle from four points. The rectangle is
// normalised after construction.
//! normalised after construction.
void set( double xmin, double ymin, double xmax, double ymax );
//! Set the minimum x value
void setXMinimum( double x );
Expand All @@ -38,7 +38,7 @@ class QgsRectangle
//! Set the maximum y value
void setYMaximum( double y );
//! Set a rectangle so that min corner is at max
// and max corner is at min. It is NOT normalized.
//! and max corner is at min. It is NOT normalized.
void setMinimal();
//! Get the x maximum value (right side of rectangle)
double xMaximum() const;
Expand All @@ -57,12 +57,10 @@ class QgsRectangle
//! Center point of the rectangle
QgsPoint center() const;
//! Scale the rectangle around its center point
void scale( double, const QgsPoint *c = 0 );
void scale( double scaleFactor, double centerX, double centerY );
/** Get rectangle enlarged by buffer.
* @note added in 2.1 */
QgsRectangle buffer( double width );
//! Expand the rectangle to support zoom out scaling
//! return the intersection with the given rectangle
QgsRectangle intersect( const QgsRectangle *rect ) const;
//! returns true when rectangle intersects with other rectangle
Expand All @@ -82,10 +80,10 @@ class QgsRectangle
//! returns string representation in Wkt form
QString asWktCoordinates() const;
//! returns string representation as WKT Polygon
//@note added in 2.0
//! @note added in 2.0
QString asWktPolygon() const;
//! returns a QRectF with same coordinates.
//@note added in 2.0
//! @note added in 2.0
QRectF toRectF() const;
//! returns string representation of form xmin,ymin xmax,ymax
QString toString( bool automaticPrecision = false ) const;
Expand All @@ -101,8 +99,13 @@ class QgsRectangle
@return False if rectangles are equal
*/
bool operator!=( const QgsRectangle &r1 ) const;
//! updates rectangle to include passed argument
/** updates rectangle to include passed argument */
void unionRect( const QgsRectangle& rect );

/** Returns true if the rectangle has finite boundaries. Will
return false if any of the rectangle boundaries are NaN or Inf. */
bool isFinite() const;

//! swap x/y
//! @note added in 1.9
void invert();
Expand Down
25 changes: 25 additions & 0 deletions python/core/qgsrelationmanager.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* This class manages a set of relations between layers.
*/
class QgsRelationManager : QObject
{
%TypeHeaderCode
#include "qgsrelationmanager.h"
%End
public:
explicit QgsRelationManager( QgsProject *project );

void setRelations( const QList<QgsRelation>& relations );
const QMap<QString, QgsRelation>& relations() const;
void addRelation( const QgsRelation& relation );
void removeRelation( const QString& name );
void removeRelation( const QgsRelation& relation );
QgsRelation relation( const QString& id ) const;
void clear();

QList<QgsRelation> referencingRelations( QgsVectorLayer *layer = 0, int fieldIdx = -2 ) const;
QList<QgsRelation> referencedRelations( QgsVectorLayer *layer = 0 ) const;

signals:
void relationsLoaded();
};
10 changes: 8 additions & 2 deletions python/core/qgsrenderchecker.sip
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ class QgsRenderChecker
//only records time for actual render part
int elapsedTime();
void setElapsedTimeTarget( int theTarget );
/** 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'
*/
void setControlName( const QString theName );

/** Prefix where the control images are kept.
* This will be appended to controlImagePath
*/
void setControlPathPrefix( const QString theName );

/** Get an md5 hash that uniquely identifies an image */
QString imageToHash( QString theImageFile );

void setRenderedImage( QString theImageFileName );
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsscalecalculator.sip
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class QgsScaleCalculator
QGis::UnitType mapUnits() const;

/**
* Calculate the scale
* Calculate the scale denominator
* @param mapExtent QgsRectangle containing the current map extent
* @param canvasWidth Width of the map canvas in pixel (physical) units
* @return scale of current map view
* @return scale denominator of current map view
*/
double calculate( const QgsRectangle &mapExtent, int canvasWidth );

Expand Down
14 changes: 7 additions & 7 deletions python/core/qgssimplifymethod.sip
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ class QgsSimplifyMethod
//! copy constructor
QgsSimplifyMethod( const QgsSimplifyMethod& rh );

/** Sets the simplification type */
//! Sets the simplification type
void setMethodType( MethodType methodType );
/** Gets the simplification type */
//! Gets the simplification type
MethodType methodType() const;

/** Sets the tolerance of simplification. Represents the maximum distance between two coordinates which can be considered equal */
//! Sets the tolerance of simplification. Represents the maximum distance between two coordinates which can be considered equal
void setTolerance( double tolerance );
/** Gets the tolerance of simplification */
//! Gets the tolerance of simplification
double tolerance() const;

/** Sets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries */
//! Sets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries
void setForceLocalOptimization( bool localOptimization );
/** Gets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries */
//! Gets whether the simplification executes after fetch the geometries from provider, otherwise it executes, when supported, in provider before fetch the geometries
bool forceLocalOptimization() const;

/** Creates a geometry simplifier according to specified method */
//! Creates a geometry simplifier according to specified method
static QgsAbstractGeometrySimplifier* createGeometrySimplifier( const QgsSimplifyMethod& simplifyMethod );
};
5 changes: 2 additions & 3 deletions python/core/qgsvectorlayereditbuffer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class QgsVectorLayerEditBuffer : QObject

/** Adds a feature
@param f feature to add
@param alsoUpdateExtent If True, will also go to the effort of e.g. updating the extents.
@return True in case of success and False in case of error
@return True in case of success and False in case of error
*/
bool addFeature( QgsFeature& f );

Expand Down Expand Up @@ -81,9 +80,9 @@ class QgsVectorLayerEditBuffer : QObject
/** Changed geometries which are not commited. */
const QgsGeometryMap& changedGeometries();

const QgsFeatureIds deletedFeatureIds();
//QString dumpEditBuffer();


protected slots:
void undoIndexChanged( int index );

Expand Down
11 changes: 11 additions & 0 deletions python/core/qgsvectorlayereditutils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class QgsVectorLayerEditUtils

QgsGeometryCache* cache();


/** Insert a new vertex before the given vertex number,
* in the given ring, item (first number is index 0), and feature
* Not meaningful for Point geometries
Expand Down Expand Up @@ -52,6 +53,15 @@ class QgsVectorLayerEditUtils
@return 0 in case of success*/
int translateFeature( QgsFeatureId featureId, double dx, double dy );

/** Splits parts cut by the given line
* @param splitLine line that splits the layer feature parts
* @param topologicalEditing true if topological editing is enabled
* @return
* 0 in case of success,
* 4 if there is a selection but no feature split
*/
int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );

/** Splits features cut by the given line
* @param splitLine line that splits the layer features
* @param topologicalEditing true if topological editing is enabled
Expand Down Expand Up @@ -85,6 +95,7 @@ class QgsVectorLayerEditUtils
int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );

protected:

/** Little helper function that gives bounding box from a list of points.
@return 0 in case of success */
int boundingBoxFromPointList( const QList<QgsPoint>& list, double& xmin, double& ymin, double& xmax, double& ymax ) const;
Expand Down
3 changes: 0 additions & 3 deletions python/core/qgsvectorlayerfeatureiterator.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIterator

~QgsVectorLayerFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayerjoinbuffer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class QgsVectorLayerJoinBuffer

/**Joins another vector layer to this layer
@param joinInfo join object containing join layer id, target and source field */
void addJoin( QgsVectorJoinInfo joinInfo );
void addJoin( const QgsVectorJoinInfo& joinInfo );

/**Removes a vector layer join*/
void removeJoin( const QString& joinLayerId );
Expand Down
93 changes: 93 additions & 0 deletions python/core/qgsvectorlayerundocommand.sip
Original file line number Diff line number Diff line change
@@ -1 +1,94 @@
class QgsVectorLayerUndoCommand : QUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
QgsVectorLayerUndoCommand( QgsVectorLayerEditBuffer *buffer /Transfer/ );
QgsVectorLayer *layer();
QgsGeometryCache *cache();

virtual int id() const;
virtual bool mergeWith( QUndoCommand * );
};


class QgsVectorLayerUndoCommandAddFeature : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
QgsVectorLayerUndoCommandAddFeature( QgsVectorLayerEditBuffer* buffer /Transfer/, QgsFeature& f );

virtual void undo();
virtual void redo();
};


class QgsVectorLayerUndoCommandDeleteFeature : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
QgsVectorLayerUndoCommandDeleteFeature( QgsVectorLayerEditBuffer* buffer /Transfer/, QgsFeatureId fid );

virtual void undo();
virtual void redo();
};


class QgsVectorLayerUndoCommandChangeGeometry : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
QgsVectorLayerUndoCommandChangeGeometry( QgsVectorLayerEditBuffer* buffer /Transfer/, QgsFeatureId fid, QgsGeometry* newGeom /Transfer/ );
~QgsVectorLayerUndoCommandChangeGeometry();

virtual void undo();
virtual void redo();
virtual int id() const;
virtual bool mergeWith( const QUndoCommand * );
};


class QgsVectorLayerUndoCommandChangeAttribute : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
QgsVectorLayerUndoCommandChangeAttribute( QgsVectorLayerEditBuffer* buffer /Transfer/, QgsFeatureId fid, int fieldIndex, const QVariant& newValue );
virtual void undo();
virtual void redo();
};


class QgsVectorLayerUndoCommandAddAttribute : public QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
QgsVectorLayerUndoCommandAddAttribute( QgsVectorLayerEditBuffer* buffer /Transfer/, const QgsField& field );

virtual void undo();
virtual void redo();
};


class QgsVectorLayerUndoCommandDeleteAttribute : QgsVectorLayerUndoCommand
{
%TypeHeaderCode
#include "qgsvectorlayerundocommand.h"
%End
public:
QgsVectorLayerUndoCommandDeleteAttribute( QgsVectorLayerEditBuffer* buffer /Transfer/, int fieldIndex );

virtual void undo();
virtual void redo();

};
3 changes: 3 additions & 0 deletions python/core/raster/qgscolorrampshader.sip
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,7 @@ class QgsColorRampShader : QgsRasterShaderFunction
bool shade( double, double, double, double, int* /Out/, int* /Out/, int* /Out/, int* /Out/);

void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;

void setClip( bool clip );
bool clip() const;
};
2 changes: 2 additions & 0 deletions python/core/raster/qgscontrastenhancement.sip
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class QgsContrastEnhancement

ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() const;

static QString contrastEnhancementAlgorithmString( ContrastEnhancementAlgorithm algorithm );

static ContrastEnhancementAlgorithm contrastEnhancementAlgorithmFromString( const QString& contrastEnhancementString );

/*
Expand Down
7 changes: 7 additions & 0 deletions python/core/raster/qgscontrastenhancementfunction.sip
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ class QgsContrastEnhancementFunction
QgsContrastEnhancementFunction( QGis::DataType, double, double );
virtual ~QgsContrastEnhancementFunction();


/** \brief A customizable method that takes in a double and returns a int between 0 and 255 */
virtual int enhance( double );

/** \brief A customicable method to indicate if the pixels is displayable */
virtual bool isValueInDisplayableRange( double );

/** \brief Mustator for the maximum value */
void setMaximumValue( double );

Expand Down
2 changes: 1 addition & 1 deletion python/core/raster/qgscubicrasterresampler.sip
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class QgsCubicRasterResampler: QgsRasterResampler
public:
QgsCubicRasterResampler();
~QgsCubicRasterResampler();
QgsRasterResampler * clone() const /Factory/;
void resample( const QImage& srcImage, QImage& dstImage );
QString type() const;
QgsRasterResampler * clone() const /Factory/;
};
7 changes: 5 additions & 2 deletions python/core/raster/qgsmultibandcolorrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class QgsMultiBandColorRenderer: QgsRasterRenderer
QgsContrastEnhancement* redEnhancement = 0, QgsContrastEnhancement* greenEnhancement = 0,
QgsContrastEnhancement* blueEnhancement = 0 );
~QgsMultiBandColorRenderer();
QgsRasterInterface * clone() /Factory/;
QgsRasterInterface * clone() const /Factory/;

static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider ) /Factory/;

QgsRasterBlock * block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;
QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;

int redBand() const;
void setRedBand( int band );
Expand All @@ -34,4 +34,7 @@ class QgsMultiBandColorRenderer: QgsRasterRenderer
void setBlueContrastEnhancement( QgsContrastEnhancement* ce /Transfer/ );

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

QList<int> usesBands() const;

};
15 changes: 13 additions & 2 deletions python/core/raster/qgspalettedrasterrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,26 @@ class QgsPalettedRasterRenderer : QgsRasterRenderer
QgsRasterInterface * clone() const /Factory/;
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input ) /Factory/;

// void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );

QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int width, int height ) /Factory/;

/**Returns number of colors*/
int nColors() const;
/**Returns copy of color array (caller takes ownership)*/
QColor* colors() const /Factory/;

/**Returns copy of rgb array (caller takes ownership)
@note not available in python bindings
*/
// QRgb* rgbArray() const;

/** Return optional category label
* @note added in 2.1 */
QString label( int idx ) const;

/** Set category label
* @note added in 2.1 */
void setLabel( int idx, QString label );

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;
Expand Down
26 changes: 25 additions & 1 deletion python/core/raster/qgsrasterblock.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ class QgsRasterBlock
public:
QgsRasterBlock();

/** \brief Constructor which allocates data block in memory
* @param theDataType raster data type
* @param theWidth width of data matrix
* @param theHeight height of data matrix
* @note not available in python bindings (use variant with theNoDataValue)
*/
// QgsRasterBlock( QGis::DataType theDataType, int theWidth, int theHeight );

/** \brief Constructor which allocates data block in memory
* @param theDataType raster data type
* @param theWidth width of data matrix
Expand All @@ -18,6 +26,22 @@ class QgsRasterBlock

virtual ~QgsRasterBlock();

/** \brief Reset block
* @param theDataType raster data type
* @param theWidth width of data matrix
* @param theHeight height of data matrix
* @return true on success
* @note not available in python bindings (use variant with theNoDataValue)
*/
// bool reset( QGis::DataType theDataType, int theWidth, int theHeight );

/** \brief Reset block
* @param theDataType raster data type
* @param theWidth width of data matrix
* @param theHeight height of data matrix
* @param theNoDataValue the value representing no data (NULL)
* @return true on success
*/
bool reset( QGis::DataType theDataType, int theWidth, int theHeight, double theNoDataValue );

// TODO: consider if use isValid() at all, isEmpty() should be sufficient
Expand Down Expand Up @@ -59,7 +83,7 @@ class QgsRasterBlock
* @return true if the block has no data value */
bool hasNoDataValue() const;

/** Returns true if thee block may contain no data. It does not guarantee
/** Returns true if the block may contain no data. It does not guarantee
* that it really contains any no data. It can be used to speed up processing.
* Not the difference between this method and hasNoDataValue().
* @return true if the block may contain no data */
Expand Down
8 changes: 7 additions & 1 deletion python/core/raster/qgsrasterchecker.sip
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ class QgsRasterChecker
~QgsRasterChecker();

QString report();

/**
* Test using renderer to generate the image to be compared.
* @param theVerifiedKey verified provider key
* @param theVerifiedUri URI of the raster to be verified
* @param theExpectedKey expected provider key
* @param theExpectedUri URI of the expected (control) raster
*/
bool runTest( QString theVerifiedKey, QString theVerifiedUri,
QString theExpectedKey, QString theExpectedUri );
};
Expand Down
5 changes: 5 additions & 0 deletions python/core/raster/qgsrasterfilewriter.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ class QgsRasterFileWriter
#include <qgsrasterdataprovider.h>
%End
public:
enum Mode
{
Raw = 0, // Raw data
Image = 1 // Rendered image
};
enum WriterError
{
NoError = 0,
Expand Down
6 changes: 4 additions & 2 deletions python/core/raster/qgsrasterhistogram.sip
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ class QgsRasterHistogram
/** \brief Whether histogram includes out of range values (in first and last bin) */
bool includeOutOfRange;

/** \brief Store the histogram for a given layer */
// TODO: QVector<int> histogramVector;
/** \brief Store the histogram for a given layer
* @note not available via python binding
*/
// HistogramVector histogramVector;

/** \brief The maximum histogram value. */
double maximum;
Expand Down
18 changes: 18 additions & 0 deletions python/core/raster/qgsrasteridentifyresult.sip
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,42 @@ class QgsRasterIdentifyResult
public:
QgsRasterIdentifyResult();

/** \brief Constructor. Creates valid result.
* @param theFormat the result format
* @param theResults the results
*/
QgsRasterIdentifyResult( QgsRaster::IdentifyFormat theFormat, QMap<int, QVariant> theResults );

/** \brief Constructor. Creates invalid result with error.
* @param theError the error
*/
QgsRasterIdentifyResult( QgsError theError );

virtual ~QgsRasterIdentifyResult();

/** \brief Returns true if valid */
bool isValid() const;

/** \brief Get results format */
QgsRaster::IdentifyFormat format() const;

/** \brief Get results. Results are different for each format:
* QgsRaster::IdentifyFormatValue: map of values for each band, keys are band numbers (from 1).
* QgsRaster::IdentifyFormatFeature: map of QgsRasterFeatureList for each sublayer (WMS)
* QgsRaster::IdentifyFormatHtml: map of HTML strings for each sublayer (WMS).
*/
QMap<int, QVariant> results() const;

/** Set map of optional parameters */
void setParams( const QMap<QString, QVariant> & theParams );

/** Get map of optional parameters */
QMap<QString, QVariant> params() const;

/** \brief Get error */
QgsError error() const;

/** \brief Set error */
void setError( const QgsError & theError );
};

7 changes: 4 additions & 3 deletions python/core/raster/qgsrasteriterator.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ class QgsRasterIterator
*/
void startRasterRead( int bandNumber, int nCols, int nRows, const QgsRectangle& extent );

/**Fetches next part of raster data
/**Fetches next part of raster data, caller takes ownership of the block and
caller should delete the block.
@param bandNumber band to read
@param nCols number of columns on output device
@param nRows number of rows on output device
@param block to return the pointer to raster block
@param block address of block pointer
@param topLeftCol top left column
@param topLeftRow top left row
@return false if the last part was already returned*/
bool readNextRasterPart( int bandNumber,
int& nCols, int& nRows,
QgsRasterBlock** block,
QgsRasterBlock **block,
int& topLeftCol, int& topLeftRow );

void stopRasterRead( int bandNumber );
Expand Down
53 changes: 15 additions & 38 deletions python/core/raster/qgsrasterlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ class QgsRasterLayer : QgsMapLayer
/** \brief The destructor */
~QgsRasterLayer();


//
// Enums, structs and typedefs
//
/** \brief This enumerator describes the types of shading that can be used */
enum ColorShadingAlgorithm
{
Expand All @@ -74,10 +70,6 @@ class QgsRasterLayer : QgsMapLayer
ColorLayer
};

//
// Static methods:
//

/** This helper checks to see whether the file name appears to be a valid
* raster file name. If the file name looks like it could be valid,
* but some sort of error occurs in processing the file, the error is
Expand All @@ -89,33 +81,17 @@ class QgsRasterLayer : QgsMapLayer
/** Return time stamp for given file name */
static QDateTime lastModified( const QString & name );

//
// Non Static inline methods
//
/** [ data provider interface ] Set the data provider */
void setDataProvider( const QString & provider );

/** \brief Accessor for drawing style */
//DrawingStyle drawingStyle();

/** \brief Accessor that returns the width of the (unclipped) raster */
int width();

/** \brief Accessor that returns the height of the (unclipped) raster */
int height();

/** \brief Accessor for raster layer type (which is a read only property) */
LayerType rasterType();

/** \brief Mutator for drawing style */
//void setDrawingStyle( const DrawingStyle & theDrawingStyle );

/**Set raster renderer. Takes ownership of the renderer object*/
void setRenderer( QgsRasterRenderer* theRenderer /Transfer/ );
QgsRasterRenderer* renderer() const;

/**Set raster resample filter. Takes ownership of the resample filter object*/
//void setResampleFilter( QgsRasterResampleFilter* resampleFilter /Transfer/ );
QgsRasterResampleFilter * resampleFilter() const;

QgsBrightnessContrastFilter * brightnessFilter() const;
Expand All @@ -124,19 +100,24 @@ class QgsRasterLayer : QgsMapLayer
/** Get raster pipe */
QgsRasterPipe * pipe();

//
// Non Static methods
//
/** \brief Accessor that returns the width of the (unclipped) raster */
int width() const;

/** \brief Accessor that returns the height of the (unclipped) raster */
int height() const;

/** \brief Get the number of bands in this layer */
unsigned int bandCount() const;
int bandCount() const;

/** \brief Get the name of a band given its number */
const QString bandName( int theBandNoInt );

/** Returns the data provider */
QgsRasterDataProvider* dataProvider();

/** Returns the data provider in a const-correct manner */
/** Returns the data provider in a const-correct manner
@note available in python bindings as constDataProvider()
*/
const QgsRasterDataProvider* dataProvider() const /PyName=constDataProvider/;

/**Synchronises with changes in the datasource
Expand Down Expand Up @@ -176,7 +157,7 @@ class QgsRasterLayer : QgsMapLayer
double rasterUnitsPerPixelX();
double rasterUnitsPerPixelY();

/** \brief Mutator for contrast enhancement algorithm
/** \brief Set contrast enhancement algorithm
* @param theAlgorithm Contrast enhancement algorithm
* @param theLimits Limits
* @param theExtent Extent used to calculate limits, if empty, use full layer extent
Expand All @@ -185,10 +166,10 @@ class QgsRasterLayer : QgsMapLayer


void setContrastEnhancement( QgsContrastEnhancement::ContrastEnhancementAlgorithm theAlgorithm,
QgsRaster::ContrastEnhancementLimits theLimits = QgsRaster::ContrastEnhancementMinMax,
QgsRectangle theExtent = QgsRectangle(),
int theSampleSize = QgsRasterLayer::SAMPLE_SIZE,
bool theGenerateLookupTableFlag = true );
QgsRaster::ContrastEnhancementLimits theLimits = QgsRaster::ContrastEnhancementMinMax,
QgsRectangle theExtent = QgsRectangle(),
int theSampleSize = QgsRasterLayer::SAMPLE_SIZE,
bool theGenerateLookupTableFlag = true );

/** \brief Set default contrast enhancement */
void setDefaultContrastEnhancement();
Expand All @@ -208,9 +189,6 @@ class QgsRasterLayer : QgsMapLayer
/** \brief Emit a signal asking for a repaint. (inherited from maplayer) */
void triggerRepaint();

//
// Virtual methods
//
/**
* Reorders the *previously selected* sublayers of this layer from bottom to top
*
Expand Down Expand Up @@ -250,7 +228,6 @@ class QgsRasterLayer : QgsMapLayer
void rendererChanged();

protected:

/** \brief Read the symbology for the current layer from the Dom node supplied */
bool readSymbology( const QDomNode& node, QString& errorMessage );

Expand Down
2 changes: 2 additions & 0 deletions python/core/raster/qgsrasterpipe.sip
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class QgsRasterPipe
QgsRasterDataProvider * provider() const;
QgsRasterRenderer * renderer() const;
QgsRasterResampleFilter * resampleFilter() const;
QgsBrightnessContrastFilter * brightnessFilter() const;
QgsHueSaturationFilter * hueSaturationFilter() const;
QgsRasterProjector * projector() const;
QgsRasterNuller * nuller() const;

Expand Down
3 changes: 2 additions & 1 deletion python/core/raster/qgsrasterprojector.sip
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class QgsRasterProjector : QgsRasterInterface
int dataType( int bandNo ) const;

/** \brief set source and destination CRS */
void setCRS( const QgsCoordinateReferenceSystem & theSrcCRS, const QgsCoordinateReferenceSystem & theDestCRS, int srcDatumTransform = -1, int destDatumTransform = -1 );
void setCRS( const QgsCoordinateReferenceSystem & theSrcCRS, const QgsCoordinateReferenceSystem & theDestCRS,
int srcDatumTransform = -1, int destDatumTransform = -1 );

/** \brief Get source CRS */
QgsCoordinateReferenceSystem srcCrs() const;
Expand Down
16 changes: 14 additions & 2 deletions python/core/raster/qgsrasterrange.sip
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ class QgsRasterRange
%End

public:
/** \brief Constructor.
*/
QgsRasterRange();

QgsRasterRange( double theMin, double theMax );
/** \brief Constructor
* @param theMin minimum value
* @param theMax max value
*/
QgsRasterRange( double theMin, double theMax );

~QgsRasterRange();

Expand All @@ -21,5 +27,11 @@ class QgsRasterRange

bool operator==( const QgsRasterRange &o ) const;

bool contains( double value, const QgsRasterRangeList &rangeList );
/** \brief Test if value is within the list of ranges
* @param value value
* @param rangeList list of ranges
* @return true if value is in at least one of ranges
* @note not available in python bindings
*/
static bool contains( double value, const QgsRasterRangeList &rangeList );
};
3 changes: 1 addition & 2 deletions python/core/raster/qgsrasterrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class QgsRasterRenderer : QgsRasterInterface

virtual bool setInput( QgsRasterInterface* input );

virtual QgsRasterBlock * block( int bandNo, const QgsRectangle &extent, int width, int height ) = 0 / Factory /;
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height ) = 0 / Factory /;

bool usesTransparency() const;

Expand All @@ -56,7 +56,6 @@ class QgsRasterRenderer : QgsRasterInterface
/**Get symbology items if provided by renderer*/
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;

virtual void writeXML( QDomDocument&, QDomElement& ) const;
/**Sets base class members from xml. Usually called from create() methods of subclasses*/
void readXML( const QDomElement& rendererElem );

Expand Down
4 changes: 2 additions & 2 deletions python/core/raster/qgsrasterresamplefilter.sip
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class QgsRasterResampleFilter : QgsRasterInterface

bool setInput( QgsRasterInterface* input );

QgsRasterBlock * block( int bandNo, const QgsRectangle &extent, int width, int height ) / Factory /;
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height ) /Factory/;

/**Set resampler for zoomed in scales. Takes ownership of the object*/
void setZoomedInResampler( QgsRasterResampler* r /Transfer/ );
Expand All @@ -35,6 +35,6 @@ class QgsRasterResampleFilter : QgsRasterInterface
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

/**Sets base class members from xml. Usually called from create() methods of subclasses*/
void readXML( const QDomElement& resamplefilterElem );
void readXML( const QDomElement& filterElem );
};

2 changes: 1 addition & 1 deletion python/core/raster/qgsrastershaderfunction.sip
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class QgsRasterShaderFunction
/** \brief generates and new RGB value based on one input value */
virtual bool shade( double, int* /Out/, int* /Out/, int* /Out/, int* /Out/ );

/** \brief generates and new RGB value based on original RGB value */
/** \brief generates and new RGBA value based on original RGBA value */
virtual bool shade( double, double, double, double, int* /Out/, int* /Out/, int* /Out/, int* /Out/ );

double minimumMaximumRange() const;
Expand Down
9 changes: 5 additions & 4 deletions python/core/raster/qgsrastertransparency.sip
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class QgsRasterTransparency
//
// Initializer, Accessor and mutator for transparency tables.
//
/** \brief Mutator for transparentSingleValuePixelList */
/** \brief Accessor for transparentSingleValuePixelList */
QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;

/** \brief Mutator for transparentThreeValuePixelList */
/** \brief Accessor for transparentThreeValuePixelList */
QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;

/** \brief Reset to the transparency list to a single value */
Expand All @@ -41,10 +41,10 @@ class QgsRasterTransparency
/** \brief Reset to the transparency list to a single value */
void initializeTransparentPixelList( double, double, double );

/** \brief Accessor for transparentSingleValuePixelList */
/** \brief Mutator for transparentSingleValuePixelList */
void setTransparentSingleValuePixelList( QList<QgsRasterTransparency::TransparentSingleValuePixel> /Transfer/);

/** \brief Accessor for transparentThreeValuePixelList */
/** \brief Mutator for transparentThreeValuePixelList */
void setTransparentThreeValuePixelList( QList<QgsRasterTransparency::TransparentThreeValuePixel> /Transfer/);

/** \brief Returns the transparency value for a single value Pixel */
Expand All @@ -53,6 +53,7 @@ class QgsRasterTransparency
/** \brief Return the transparency value for a RGB Pixel */
int alphaValue( double, double, double, int theGlobalTransparency = 255 ) const;

/**True if there are no entries in the pixel lists except the nodata value*/
bool isEmpty( ) const;

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
Expand Down
10 changes: 7 additions & 3 deletions python/core/raster/qgssinglebandcolordatarenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ class QgsSingleBandColorDataRenderer: QgsRasterRenderer
public:
QgsSingleBandColorDataRenderer( QgsRasterDataProvider* provider, int band );
~QgsSingleBandColorDataRenderer();
QgsRasterInterface * clone();
QgsRasterInterface * clone() const /Factory/;

static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider );
static QgsRasterRenderer *create( const QDomElement& elem, QgsRasterDataProvider* provider ) /Factory/;

QgsRasterBlock * block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;
bool setInput( QgsRasterInterface* input );

QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

QList<int> usesBands() const;
};
15 changes: 13 additions & 2 deletions python/core/raster/qgssinglebandgrayrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@ class QgsSingleBandGrayRenderer: QgsRasterRenderer
#include "qgssinglebandgrayrenderer.h"
%End
public:
enum Gradient
{
BlackToWhite,
WhiteToBlack
};

QgsSingleBandGrayRenderer( QgsRasterDataProvider* provider, int grayBand );
~QgsSingleBandGrayRenderer();
QgsRasterInterface * clone() /Factory/;
QgsRasterInterface * clone() const /Factory/;

static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider ) /Factory/;

QgsRasterBlock * block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;
QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;

int grayBand() const;
void setGrayBand( int band );
const QgsContrastEnhancement* contrastEnhancement() const;
/**Takes ownership*/
void setContrastEnhancement( QgsContrastEnhancement* ce /Transfer/ );

void setGradient( Gradient theGradient );
Gradient gradient() const;

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;

QList<int> usesBands() const;
};
2 changes: 1 addition & 1 deletion python/core/raster/qgssinglebandpseudocolorrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer

static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider ) /Factory/;

QgsRasterBlock * block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;
QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;

/**Takes ownership of the shader*/
void setShader( QgsRasterShader* shader /Transfer/ );
Expand Down
13 changes: 9 additions & 4 deletions python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,27 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );

//! return a list of item text / symbol
//! @note: this method was added in version 1.5
// virtual QgsLegendSymbolList legendSymbolItems();
//! @note this method was added in version 1.5
//! @note not available in python bindings
// virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, QString rule = QString() );

QgsSymbolV2* sourceSymbol();
void setSourceSymbol( QgsSymbolV2* sym /Transfer/ );

QgsVectorColorRampV2* sourceColorRamp();
void setSourceColorRamp( QgsVectorColorRampV2* ramp /Transfer/ );

//! @note added in 2.1
bool invertedColorRamp();
void setInvertedColorRamp( bool inverted );

//! @note added in 1.6
void setRotationField( QString fieldName );
void setRotationField( QString expression );
//! @note added in 1.6
QString rotationField() const;

//! @note added in 1.6
void setSizeScaleField( QString fieldName );
void setSizeScaleField( QString expression );
//! @note added in 1.6
QString sizeScaleField() const;

Expand Down
6 changes: 5 additions & 1 deletion python/core/symbology-ng/qgscptcityarchive.sip
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class QgsCptCityArchive
static QString findFileName( const QString & target, const QString & startDir, const QString & baseDir );
static QMap< QString, QString > copyingInfo( const QString& fileName );
static QMap< QString, QString > description( const QString& fileName );
//! note not available in python bindings
// static QMap< double, QPair<QColor, QColor> > gradientColorMap( const QString& fileName );

// archive management
Expand Down Expand Up @@ -50,7 +51,8 @@ class QgsCptCityDataItem : QObject
ColorRamp,
Collection,
Directory,
Selection
Selection,
AllRamps
};

QgsCptCityDataItem( QgsCptCityDataItem::Type type, QgsCptCityDataItem* parent,
Expand All @@ -60,6 +62,8 @@ class QgsCptCityDataItem : QObject
bool hasChildren();

int rowCount();
// retrieve total count of "leaf" items (all children which are end nodes)
virtual int leafCount() const;

//

Expand Down
3 changes: 0 additions & 3 deletions python/core/symbology-ng/qgsellipsesymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,4 @@ class QgsEllipseSymbolLayerV2 : QgsMarkerSymbolLayerV2

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

QSet<QString> usedAttributes() const;

};
31 changes: 27 additions & 4 deletions python/core/symbology-ng/qgsfillsymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ class QgsSimpleFillSymbolLayerV2 : QgsFillSymbolLayerV2

/** Get outline color.
* @note added in 2.1 */
virtual QColor outlineColor() const;
QColor outlineColor() const;
/** Set outline color.
* @note added in 2.1 */
virtual void setOutlineColor( const QColor& color );
void setOutlineColor( const QColor& color );

/** Get fill color.
* @note added in 2.1 */
virtual QColor fillColor() const;
QColor fillColor() const;
/** Set fill color.
* @note added in 2.1 */
virtual void setFillColor( const QColor& color );
void setFillColor( const QColor& color );

Qt::PenStyle borderStyle() const;
void setBorderStyle( Qt::PenStyle borderStyle );
Expand Down Expand Up @@ -120,6 +120,9 @@ class QgsGradientFillSymbolLayerV2 : QgsFillSymbolLayerV2
GradientCoordinateMode coordinateMode = Feature,
GradientSpread gradientSpread = Pad
);

virtual ~QgsGradientFillSymbolLayerV2();

// static stuff

static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;
Expand All @@ -138,6 +141,8 @@ class QgsGradientFillSymbolLayerV2 : QgsFillSymbolLayerV2

QgsSymbolLayerV2* clone() const /Factory/;

double estimateMaxBleed() const;

/**Type of gradient, eg linear or radial*/
GradientType gradientType() const;
void setGradientType( GradientType gradientType );
Expand Down Expand Up @@ -209,6 +214,12 @@ class QgsImageFillSymbolLayer: QgsFillSymbolLayerV2

void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outlineWidthUnit() const;

virtual double estimateMaxBleed() const;

virtual double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2RenderContext& context ) const;
virtual QColor dxfColor( const QgsSymbolV2RenderContext& context ) const;
virtual Qt::PenStyle dxfPenStyle() const;
};

/**A class for svg fill patterns. The class automatically scales the pattern to
Expand Down Expand Up @@ -290,6 +301,8 @@ class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer

void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

double estimateMaxBleed() const;

QString ogrFeatureStyleWidth( double widthScaleFactor ) const;

//getters and setters
Expand All @@ -315,6 +328,10 @@ class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

bool setSubSymbol( QgsSymbolV2* symbol );
QgsSymbolV2* subSymbol();

};

class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer
Expand All @@ -341,6 +358,8 @@ class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer

void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

double estimateMaxBleed() const;

//getters and setters
double distanceX() const;
void setDistanceX( double d );
Expand Down Expand Up @@ -372,6 +391,8 @@ class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

virtual QSet<QString> usedAttributes() const;

protected:
void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context );
};
Expand Down Expand Up @@ -414,4 +435,6 @@ class QgsCentroidFillSymbolLayerV2 : QgsFillSymbolLayerV2

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

virtual QSet<QString> usedAttributes() const;
};
12 changes: 9 additions & 3 deletions python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
bool updateRangeLowerValue( int rangeIndex, double value );

void addClass( QgsSymbolV2* symbol );
//! @note available in python bindings as addClassRange
void addClass( QgsRendererRangeV2 range ) /PyName=addClassRange/;
void deleteClass( int idx );
void deleteAllClasses();

Expand Down Expand Up @@ -99,7 +101,8 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
int classes,
Mode mode,
QgsSymbolV2* symbol /Transfer/,
QgsVectorColorRampV2* ramp /Transfer/ ) /Factory/;
QgsVectorColorRampV2* ramp /Transfer/,
bool inverted = false ) /Factory/;

//! create renderer from XML element
static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/;
Expand All @@ -120,6 +123,9 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2

QgsVectorColorRampV2* sourceColorRamp();
void setSourceColorRamp( QgsVectorColorRampV2* ramp /Transfer/ );
//! @note added in 2.1
bool invertedColorRamp();
void setInvertedColorRamp( bool inverted );

/** Update the color ramp used. Also updates all symbols colors.
* Doesn't alter current breaks.
Expand All @@ -130,12 +136,12 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
void updateSymbols( QgsSymbolV2* sym /Transfer/ );

//! @note added in 1.6
void setRotationField( QString fieldName );
void setRotationField( QString expression );
//! @note added in 1.6
QString rotationField() const;

//! @note added in 1.6
void setSizeScaleField( QString fieldName );
void setSizeScaleField( QString expression );
//! @note added in 1.6
QString sizeScaleField() const;

Expand Down
26 changes: 20 additions & 6 deletions python/core/symbology-ng/qgslinesymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ class QgsSimpleLineSymbolLayerV2 : QgsLineSymbolLayerV2

void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

double estimateMaxBleed() const;

// new stuff

Qt::PenStyle penStyle() const;
Expand All @@ -55,12 +62,16 @@ class QgsSimpleLineSymbolLayerV2 : QgsLineSymbolLayerV2

QVector<qreal> customDashVector() const;
void setCustomDashVector( const QVector<qreal>& vector );

//Returns true if the line should only be drawn inside the polygon
bool drawInsidePolygon() const;
//Set to true if the line should only be drawn inside the polygon
void setDrawInsidePolygon( bool drawInsidePolygon );


QVector<qreal> dxfCustomDashPattern( QgsSymbolV2::OutputUnit& unit ) const;

double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2RenderContext& context ) const;
QColor dxfColor( const QgsSymbolV2RenderContext& context ) const;
};

/////////
Expand Down Expand Up @@ -115,6 +126,8 @@ class QgsMarkerLineSymbolLayerV2 : QgsLineSymbolLayerV2
virtual void setWidth( double width );
virtual double width() const;

double estimateMaxBleed() const;

// new stuff

bool rotateMarker() const;
Expand All @@ -126,6 +139,9 @@ class QgsMarkerLineSymbolLayerV2 : QgsLineSymbolLayerV2
double offset() const;
void setOffset( double offset );

Placement placement() const;
void setPlacement( Placement p );

QgsSymbolV2::OutputUnit intervalUnit() const;
void setIntervalUnit( QgsSymbolV2::OutputUnit unit );

Expand All @@ -135,12 +151,10 @@ class QgsMarkerLineSymbolLayerV2 : QgsLineSymbolLayerV2
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

Placement placement() const;
void setPlacement( Placement p );

protected:

void renderPolylineInterval( const QPolygonF& points, QgsSymbolV2RenderContext& context );
void renderPolylineVertex( const QPolygonF& points, QgsSymbolV2RenderContext& context );
void renderPolylineVertex( const QPolygonF& points, QgsSymbolV2RenderContext& context, Placement placement = Vertex );
void renderPolylineCentral( const QPolygonF& points, QgsSymbolV2RenderContext& context );
double markerAngle( const QPolygonF& points, bool isRing, int vertex );
};
37 changes: 28 additions & 9 deletions python/core/symbology-ng/qgsmarkersymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,49 @@ class QgsSimpleMarkerSymbolLayerV2 : QgsMarkerSymbolLayerV2

void writeSldMarker( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;

QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;

QString name() const;
void setName( QString name );

QColor borderColor() const;
void setBorderColor( QColor color );

double outlineWidth() const;
void setOutlineWidth( double w );
Qt::PenStyle outlineStyle() const;
void setOutlineStyle( Qt::PenStyle outlineStyle );

/** Get outline color.
* @note added in 2.1 */
QColor outlineColor() const;
/** Set outline color.
* @note added in 2.1 */
void setOutlineColor( const QColor& color );

virtual QColor outlineColor() const;
virtual void setOutlineColor( const QColor& color );
/** Get fill color.
* @note added in 2.1 */
QColor fillColor() const;
/** Set fill color.
* @note added in 2.1 */
void setFillColor( const QColor& color );

virtual QColor fillColor() const;
virtual void setFillColor( const QColor& color );
double outlineWidth() const;
void setOutlineWidth( double w );

QgsSymbolV2::OutputUnit outlineWidthUnit() const;
void setOutlineWidthUnit( QgsSymbolV2::OutputUnit u );

bool writeDxf( QgsDxfExport& e, double mmMapUnitScaleFactor, const QString& layerName, const QgsSymbolV2RenderContext* context, const QgsFeature* f, const QPointF& shift = QPointF( 0.0, 0.0 ) ) const;

protected:

void drawMarker( QPainter* p, QgsSymbolV2RenderContext& context );

bool prepareShape();
bool preparePath();
bool prepareShape( QString name = QString() );
bool preparePath( QString name = QString() );

void prepareCache( QgsSymbolV2RenderContext& context );
/**Prepares cache image
@return true in case of success, false if cache image size too large*/
bool prepareCache( QgsSymbolV2RenderContext& context );
};

class QgsSvgMarkerSymbolLayerV2 : QgsMarkerSymbolLayerV2
Expand Down Expand Up @@ -110,6 +127,8 @@ class QgsSvgMarkerSymbolLayerV2 : QgsMarkerSymbolLayerV2

void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

bool writeDxf( QgsDxfExport& e, double mmMapUnitScaleFactor, const QString& layerName, const QgsSymbolV2RenderContext* context, const QgsFeature* f, const QPointF& shift = QPointF( 0.0, 0.0 ) ) const;
};

class QgsFontMarkerSymbolLayerV2 : QgsMarkerSymbolLayerV2
Expand Down
2 changes: 2 additions & 0 deletions python/core/symbology-ng/qgspointdisplacementrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class QgsPointDisplacementRenderer : QgsFeatureRendererV2

QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );

//! @note not available in python bindings
// QgsLegendSymbolList legendSymbolItems();

void setLabelAttributeName( const QString& name );
Expand All @@ -38,6 +39,7 @@ class QgsPointDisplacementRenderer : QgsFeatureRendererV2
void setEmbeddedRenderer( QgsFeatureRendererV2* r /Transfer/ );
QgsFeatureRendererV2* embeddedRenderer();

//! not available in python bindings
// void setDisplacementGroups( const QList<QMap<QgsFeatureId, QgsFeature> >& list );

void setLabelFont( const QFont& f );
Expand Down
Loading