24 changes: 22 additions & 2 deletions python/core/qgscoordinatetransform.sip
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*! \class QgsCoordinateTransform
* \brief Class for doing transforms between two map coordinate systems.
/** \ingroup core
* Class for doing transforms between two map coordinate systems.
*
* This class can convert map coordinates to a different coordinate reference system.
* It is normally associated with a map layer and is used to transform between the
Expand Down Expand Up @@ -121,6 +121,12 @@ class QgsCoordinateTransform : QObject
// C style arrays.
void transformInPlace( double& x, double& y, double &z, TransformDirection direction = ForwardTransform) const throw (QgsCsException);

//! @note not available in python bindings
// void transformInPlace( QVector<double>& x, QVector<double>& y, QVector<double>& z,
// TransformDirection direction = ForwardTransform ) const;

void transformPolygon( QPolygonF& poly, TransformDirection direction = ForwardTransform ) const;

// TODO: argument not supported
// void transformInPlace( QVector<double>& x, QVector<double>& y, QVector<double>& z,
// TransformDirection direction = ForwardTransform ) const;
Expand Down Expand Up @@ -168,6 +174,20 @@ class QgsCoordinateTransform : QObject
* @param theCRSID - A long representing the srsid of the srs to be used */
void setDestCRSID( long theCRSID );

/**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 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)*/
static bool datumTransformCrsInfo( int datumTransform, int& epsgNr, QString& srcProjection, QString& dstProjection, QString &remarks, QString &scope, bool &preferred, bool &deprecated );

int sourceDatumTransform() const;
void setSourceDatumTransform( int dt );
int destinationDatumTransform() const;
void setDestinationDatumTransform( int dt );

public slots:
//!initialise is used to actually create the Transformer instance
void initialise();
Expand Down
7 changes: 5 additions & 2 deletions python/core/qgscrscache.sip
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ class QgsCoordinateTransformCache
~QgsCoordinateTransformCache();
/**Returns coordinate transformation. Cache keeps ownership
@param srcAuthId auth id string of source crs
@param destAuthId auth id string of dest crs*/
const QgsCoordinateTransform* transform( const QString& srcAuthId, const QString& destAuthId );
@param destAuthId auth id string of dest crs
@param srcDatumTransform id of source's datum transform
@param destDatumTransform id of destinations's datum transform
*/
const QgsCoordinateTransform* transform( const QString& srcAuthId, const QString& destAuthId, int srcDatumTransform = -1, int destDatumTransform = -1 );
/**Removes transformations where a changed crs is involved from the cache*/
void invalidateCrs( const QString& crsAuthId );
};
Expand Down
5 changes: 1 addition & 4 deletions python/core/qgsdatasourceuri.sip
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ class QgsDataSourceURI
// \note if key exists, another is inserted
// \note added in 1.9
void setParam( const QString &key, const QString &value );
void setParamList( const QString &key, const QStringList &value );
%MethodCode
sipCpp->setParam( *a0, *a1 );
%End
void setParam( const QString &key, const QStringList &value ) /PyName=setParamList/;

//! Remove generic param (generic mode)
// \note remove all occurrences of key, returns number of params removed
Expand Down
19 changes: 11 additions & 8 deletions python/core/qgsdiagramrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class QgsDiagramSettings
double barWidth;
int transparency; // 0 - 100
bool scaleByArea;
int angleOffset;

//scale range (-1 if no lower / upper bound )
double minScaleDenominator;
Expand All @@ -105,6 +106,8 @@ class QgsDiagramInterpolationSettings
double upperValue;
/**Index of the classification attribute*/
int classificationAttribute;
QString classificationAttributeExpression;
bool classificationAttributeIsExpression;
};

/**Returns diagram settings for a feature*/
Expand All @@ -118,7 +121,7 @@ class QgsDiagramRendererV2
QgsDiagramRendererV2();
virtual ~QgsDiagramRendererV2();

/**Returns size of the diagram for feature f in map units. Returns an invalid QSizeF in case of error*/
/**Returns size of the diagram for a feature in map units. Returns an invalid QSizeF in case of error*/
virtual QSizeF sizeMapUnits( const QgsFeature& feature, const QgsRenderContext& c );

virtual QString rendererName() const = 0;
Expand All @@ -140,14 +143,14 @@ class QgsDiagramRendererV2
protected:

/**Returns diagram settings for a feature (or false if the diagram for the feature is not to be rendered). Used internally within renderDiagram()
* @param att attribute map
* @param feature the feature
* @param c render context
* @param s out: diagram settings for the feature
*/
virtual bool diagramSettings( const QgsFeature& feature, const QgsRenderContext& c, QgsDiagramSettings& s ) = 0;
virtual bool diagramSettings( const QgsFeature &feature, const QgsRenderContext& c, QgsDiagramSettings& s ) = 0;

/**Returns size of the diagram (in painter units) or an invalid size in case of error*/
virtual QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c ) = 0;
virtual QSizeF diagramSize( const QgsFeature& features, const QgsRenderContext& c ) = 0;

/**Converts size from mm to map units*/
void convertSizeToMapUnits( QSizeF& size, const QgsRenderContext& context ) const;
Expand Down Expand Up @@ -183,9 +186,9 @@ class QgsSingleCategoryDiagramRenderer : QgsDiagramRendererV2
void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVectorLayer* layer ) const;

protected:
bool diagramSettings( const QgsFeature& feature, const QgsRenderContext& c, QgsDiagramSettings& s );
bool diagramSettings( const QgsFeature &feature, const QgsRenderContext& c, QgsDiagramSettings& s );

QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c );
QSizeF diagramSize( const QgsFeature&, const QgsRenderContext& c );
};

class QgsLinearlyInterpolatedDiagramRenderer : QgsDiagramRendererV2
Expand Down Expand Up @@ -226,7 +229,7 @@ class QgsLinearlyInterpolatedDiagramRenderer : QgsDiagramRendererV2
void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVectorLayer* layer ) const;

protected:
bool diagramSettings( const QgsFeature& feature, const QgsRenderContext& c, QgsDiagramSettings& s );
bool diagramSettings( const QgsFeature &feature, const QgsRenderContext& c, QgsDiagramSettings& s );

QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c );
QSizeF diagramSize( const QgsFeature&, const QgsRenderContext& c );
};
93 changes: 58 additions & 35 deletions python/core/qgsexpression.sip
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class QgsExpression
//! @note prepare() should be called before calling this method
QVariant evaluate( const QgsFeature* f = NULL );

//! Evaluate the feature and return the result
//! @note prepare() should be called before calling this method
//! @note available in python bindings as evaluatePrepared
QVariant evaluate( const QgsFeature& f ) /PyName=evaluatePrepared/;

//! Evaluate the feature and return the result
//! @note this method does not expect that prepare() has been called on this instance
QVariant evaluate( const QgsFeature* f, const QgsFields& fields );
Expand Down Expand Up @@ -57,16 +62,21 @@ class QgsExpression

int scale();

//! Return the parsed expression as a string - useful for debugging
//! Return the expression string that was given when created.
const QString expression() const;

//! Return the a debugging string of the expression.
//! This can be used for debugging. Use {@link expression()}
//! if you need the full expression string.
QString dump() const;

//! Return calculator used for distance and area calculations
//! (used by internal functions)
QgsDistanceArea* geomCalculator();
QgsDistanceArea *geomCalculator();

//! Sets the geometry calculator used in evaluation of expressions,
// instead of the default.
void setGeomCalculator( QgsDistanceArea& calc );
//! Sets the geometry calculator used in evaluation of expressions,
// instead of the default.
void setGeomCalculator( const QgsDistanceArea &calc );

/** This function currently replaces each expression between [% and %]
in the string with the result of its evaluation on the feature
Expand All @@ -75,11 +85,9 @@ class QgsExpression
Additional substitutions can be passed through the substitutionMap
parameter
*/
static QString replaceExpressionText( QString action, const QgsFeature *feat,
QgsVectorLayer* layer,
static QString replaceExpressionText( const QString &action, const QgsFeature *feat,
QgsVectorLayer *layer,
const QMap<QString, QVariant> *substitutionMap = 0 );
//

enum UnaryOperator
{
uoNot,
Expand Down Expand Up @@ -121,6 +129,9 @@ class QgsExpression
// static const char* BinaryOperatorText[];
// static const char* UnaryOperatorText[];

/**
* A abstract base class for defining QgsExpression functions.
*/
class Function
{
public:
Expand All @@ -136,13 +147,18 @@ class QgsExpression
/** The help text for the function. */
QString helptext();

virtual QVariant func(const QVariantList& values, const QgsFeature* f, QgsExpression* parent) = 0;
virtual QVariant func( const QVariantList& values, const QgsFeature* f, QgsExpression* parent ) = 0;
};


static const QList<QgsExpression::Function *> &Functions();
// static QList<Function*> gmFunctions;

// static QStringList gmBuiltinFunctions;
static const QStringList &BuiltinFunctions();

static bool registerFunction(Function* function);
static bool unregisterFunction(QString name);
static bool registerFunction( Function* function );
static bool unregisterFunction( QString name );

// tells whether the identifier is a name of existing function
static bool isFunctionName( QString name );
Expand Down Expand Up @@ -205,36 +221,39 @@ class QgsExpression
public:
NodeList();
~NodeList();
void append( QgsExpression::Node* node );
void append( QgsExpression::Node* node /Transfer/ );
int count();
QList<QgsExpression::Node*> list();

virtual QString dump() const;

// protected:
// QList<QgsExpression::Node*> mList;
};

class Interval
{
public:
Interval(int seconds);
~Interval();
int years();
int weeks();
int days();
int hours();
int minutes();
int seconds();
bool isValid();
void setValid(bool valid);
bool operator==(const QgsExpression::Interval& other) const;
static QgsExpression::Interval invalidInterVal();
static QgsExpression::Interval fromString(QString string);
public:
Interval( int seconds = 0 );
~Interval();
double years();
double months();
double weeks();
double days();
double hours();
double minutes();
double seconds();
bool isValid();
void setValid( bool valid );
bool operator==( const QgsExpression::Interval& other ) const;
static QgsExpression::Interval invalidInterVal();
static QgsExpression::Interval fromString( QString string );
};


class NodeUnaryOperator : QgsExpression::Node
{
public:
NodeUnaryOperator( QgsExpression::UnaryOperator op, QgsExpression::Node* operand );
NodeUnaryOperator( QgsExpression::UnaryOperator op, QgsExpression::Node* operand /Transfer/ );
~NodeUnaryOperator();

QgsExpression::UnaryOperator op() const;
Expand All @@ -253,7 +272,7 @@ class QgsExpression
class NodeBinaryOperator : QgsExpression::Node
{
public:
NodeBinaryOperator( QgsExpression::BinaryOperator op, QgsExpression::Node* opLeft, QgsExpression::Node* opRight );
NodeBinaryOperator( QgsExpression::BinaryOperator op, QgsExpression::Node* opLeft /Transfer/, QgsExpression::Node* opRight /Transfer/ );
~NodeBinaryOperator();

QgsExpression::BinaryOperator op() const;
Expand All @@ -273,7 +292,7 @@ class QgsExpression
class NodeInOperator : QgsExpression::Node
{
public:
NodeInOperator( QgsExpression::Node* node, QgsExpression::NodeList* list, bool notin = false );
NodeInOperator( QgsExpression::Node* node /Transfer/, QgsExpression::NodeList* list /Transfer/, bool notin = false );
~NodeInOperator();

QgsExpression::Node* node() const;
Expand All @@ -293,7 +312,7 @@ class QgsExpression
class NodeFunction : QgsExpression::Node
{
public:
NodeFunction( int fnIndex, QgsExpression::NodeList* args );
NodeFunction( int fnIndex, QgsExpression::NodeList* args /Transfer/ );
//NodeFunction( QString name, QgsExpression::NodeList* args );
~NodeFunction();

Expand Down Expand Up @@ -341,25 +360,26 @@ class QgsExpression

virtual QStringList referencedColumns() const;
virtual bool needsGeometry() const;

virtual void accept( QgsExpression::Visitor& v ) const;
};

class WhenThen
{
public:
WhenThen( QgsExpression::Node* whenExp, QgsExpression::Node* thenExp );
WhenThen( QgsExpression::Node* whenExp /Transfer/, QgsExpression::Node* thenExp /Transfer/ );
~WhenThen();

//protected:
QgsExpression::Node* mWhenExp;
QgsExpression::Node* mThenExp;
};
typedef QList<QgsExpression::WhenThen*> WhenThenList;

class NodeCondition : QgsExpression::Node
{
public:
NodeCondition( QgsExpression::WhenThenList* conditions, QgsExpression::Node* elseExp = NULL );
// NodeCondition( QList<QgsExpression::WhenThen*> *conditions /Transfer/, QgsExpression::Node* elseExp = 0 /Transfer/ );
NodeCondition( QList<QgsExpression::WhenThen*> *conditions, QgsExpression::Node* elseExp = 0 );
~NodeCondition();

virtual QgsExpression::NodeType nodeType() const;
Expand Down Expand Up @@ -392,6 +412,9 @@ class QgsExpression
/** entry function for the visitor pattern */
void acceptVisitor( QgsExpression::Visitor& v ) const;

static QString helptext( QString name );
static QString group( QString group );

protected:
void initGeomCalculator();
};
63 changes: 50 additions & 13 deletions python/core/qgsfeature.sip
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ typedef QList<QgsFeature> QgsFeatureList;

typedef QMap<int, QgsField> QgsFieldMap;

/** \ingroup core
* The feature class encapsulates a single feature including its id,
* geometry and a list of field/values attributes.
*
* @author Gary E.Sherman
*/
class QgsFeature
{
%TypeHeaderCode
Expand Down Expand Up @@ -258,9 +264,19 @@ class QgsFeature
}
%End

/**
* Initialize this feature with the given number of fields. Discard any previously set attribute data.
* @param fieldCount Number of fields to initialize
*/
void initAttributes( int fieldCount );

/**Deletes an attribute and its value*/
/**
* Deletes an attribute and its value
*
* @param field The index of the field
*
* @note For Python: raises a KeyError exception if the field is not found
*/
void deleteAttribute( int field );
%MethodCode
if ( a0 >= 0 && a0 < sipCpp->attributes().count() )
Expand All @@ -286,7 +302,7 @@ class QgsFeature
/**
* Get the geometry object associated with this feature
*/
QgsGeometry *geometry();
QgsGeometry *geometry() const;

/**
* Get the geometry object associated with this feature
Expand All @@ -310,26 +326,34 @@ class QgsFeature
*/
void setGeometryAndOwnership( unsigned char * geom /Transfer/, size_t length );

/** Assign a field map with the feature to allow attribute access by
* attribute name
/** Assign a field map with the feature to allow attribute access by attribute name
*
* @param fields The attribute fields which this feature holds
* @param initAttributes If true, attributes are initialized. Clears any
* data previously assigned.
* @param fields The attribute fields which this feature holds. When used from python, make sure
* a copy of the fields is held by python, as ownership stays there.
* I.e. Do not call feature.setFields( myDataProvider.fields() ) but instead call
* myFields = myDataProvider.fields()
* feature.setFields( myFields )
* @param initAttributes If true, attributes are initialized. Clears any data previously assigned.
* C++: Defaults to false
* Python: Defaults to true
* @note added in 2.0
*/
void setFields( const QgsFields* fields, bool initAttributes = true );
void setFields( const QgsFields* fields, bool initAttributes = false );

/** Get associated field map. may be NULL
* @note added in 2.0
*/
const QgsFields* fields() const;

/** Insert a value into attribute.
* Raises a KeyError exception if the attribute name is not found
/** Insert a value into attribute. Returns false if attribute name could not be converted to index.
* Field map must be associated to make this work.
*
* @param name The name of the field to set
* @param value The value to set
*
* @return false if attribute name could not be converted to index (C++ only)
*
* @note For Python: raises a KeyError exception instead of returning false
* @note added in 2.0
*/
void setAttribute( const QString& name, QVariant value /GetWrapper/ );
Expand All @@ -353,11 +377,17 @@ class QgsFeature
}
%End
/** Remove an attribute value.
* Raises a KeyError exception if the attribute name is not found
* Returns false if attribute name could not be converted to index.
* Field map must be associated to make this work.
*
* @param name The name of the field to delete
*
* @return false if attribute name could not be converted to index (C++ only)
*
* @note For Python: raises a KeyError exception instead of returning false
* @note added in 2.0
*/
void deleteAttribute( const QString& name );
bool deleteAttribute( const QString& name );
%MethodCode
int fieldIdx = sipCpp->fieldNameIndex(*a0);
if (fieldIdx == -1)
Expand All @@ -371,8 +401,14 @@ class QgsFeature
}
%End
/** Lookup attribute value from attribute name.
* Raises a KeyError exception if the attribute is not found
* Returns invalid variant if attribute name could not be converted to index (C++ only)
* Field map must be associated to make this work.
*
* @param name The name of the attribute to get
*
* @return The value of the attribute (C++: Invalid variant if no such name exists )
*
* @note For Python: raises a KeyError exception if field is not found
* @note added in 2.0
*/
SIP_PYOBJECT attribute( const QString& name ) const;
Expand All @@ -391,6 +427,7 @@ class QgsFeature
%End
/** Utility method to get attribute index from name. Returns -1 if field does not exist or field map is not associated.
* Field map must be associated to make this work.
*
* @note added in 2.0
*/
int fieldNameIndex( const QString& fieldName ) const;
Expand Down
35 changes: 34 additions & 1 deletion python/core/qgsfeatureiterator.sip
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,52 @@ class QgsAbstractFeatureIterator

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

//! reset the iterator to the starting position
virtual bool rewind() = 0;
//! end of iterating: free the resources / lock
virtual bool close() = 0;

protected:
/**
* If you write a feature iterator for your provider, this is the method you
* need to implement!!
*
* @param f The feature to write to
* @return true if a feature was written to f
*/
virtual bool fetchFeature( QgsFeature& f ) = 0;

/**
* By default, the iterator will fetch all features and check if the feature
* matches the expression.
* If you have a more sophisticated metodology (SQL request for the features...)
* and you check for the expression in your fetchFeature method, you can just
* redirect this call to fetchFeature so the default check will be omitted.
*
* @param f The feature to write to
* @return true if a feature was written to f
*/
virtual bool nextFeatureFilterExpression( QgsFeature &f );

/**
* By default, the iterator will fetch all features and check if the id
* is in the request.
* If you have a more sophisticated metodology (SQL request for the features...)
* and you are sure, that any feature you return from fetchFeature will match
* if the request was FilterFids you can just redirect this call to fetchFeature
* so the default check will be omitted.
*
* @param f The feature to write to
* @return true if a feature was written to f
*/
virtual bool nextFeatureFilterFids( QgsFeature & f );

virtual bool fetchFeature( QgsFeature& f ) = 0;
void ref(); // add reference
void deref(); // remove reference, delete if refs == 0

//! Setup the simplification of geometries to fetch using the specified simplify method
virtual bool prepareSimplification( const QgsSimplifyMethod& simplifyMethod );
};


Expand Down
21 changes: 18 additions & 3 deletions python/core/qgsfeaturerequest.sip
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class QgsFeatureRequest
enum FilterType
{
FilterNone, //!< No filter is applied
FilterRect, //!< Filter using a rectangle
FilterRect, //!< Filter using a rectangle, no need to set NoGeometry
FilterFid, //!< Filter using feature ID
FilterExpression, //!< Filter using expression
FilterFids //!< Filter using feature IDs
Expand All @@ -31,7 +31,7 @@ class QgsFeatureRequest
//! construct a request with rectangle filter
explicit QgsFeatureRequest( const QgsRectangle& rect );
//! construct a request with a filter expression
explicit QgsFeatureRequest( const QgsExpression& expression );
explicit QgsFeatureRequest( const QgsExpression& expr );

FilterType filterType() const;

Expand All @@ -48,7 +48,7 @@ class QgsFeatureRequest
QgsFeatureRequest& setFilterFids( QgsFeatureIds fids );
const QgsFeatureIds& filterFids() const;

//! Set filter expression. Ownership is taken.
//! Set filter expression. {@see QgsExpression}
QgsFeatureRequest& setFilterExpression( const QString& expression );
QgsExpression* filterExpression() const;

Expand All @@ -64,4 +64,19 @@ class QgsFeatureRequest
//! Set a subset of attributes by names that will be fetched
QgsFeatureRequest& setSubsetOfAttributes( const QStringList& attrNames, const QgsFields& fields );

//! Set a simplification method for geometries that will be fetched
QgsFeatureRequest& setSimplifyMethod( const QgsSimplifyMethod& simplifyMethod );
const QgsSimplifyMethod& simplifyMethod() const;

/**
* Check if a feature is accepted by this requests filter
*
* @param feature The feature which will be tested
*
* @return true, if the filter accepts the feature
*
* @note added in 2.1
*/
bool acceptFeature( const QgsFeature& feature );

};
25 changes: 20 additions & 5 deletions python/core/qgsgeometry.sip
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ class QgsGeometry
static QgsGeometry* fromMultiPolygon( const QgsMultiPolygon& multipoly ) /Factory/;
/** construct geometry from a rectangle */
static QgsGeometry* fromRect( const QgsRectangle& rect ) /Factory/;



/**
Set the geometry, feeding in a geometry in GEOS format.
This class will take ownership of the buffer.
@note not available in python bindings
*/
// void fromGeos( GEOSGeometry* geos );
/**
Set the geometry, feeding in the buffer containing OGC Well-Known Binary and the buffer's length.
This class will take ownership of the buffer.
Expand Down Expand Up @@ -132,7 +135,6 @@ class QgsGeometry
*/
QgsPoint closestVertex( const QgsPoint& point, int& atVertex /Out/, int& beforeVertex /Out/, int& afterVertex /Out/, double& sqrDist /Out/ );


/**
Returns the indexes of the vertices before and after the given vertex index.

Expand All @@ -147,7 +149,6 @@ class QgsGeometry
*/
void adjacentVertices( int atVertex, int& beforeVertex /Out/, int& afterVertex /Out/ );


/** Insert a new vertex before the given vertex index,
* ring and item (first number is index 0)
* If the requested vertex number (beforeVertex.back()) is greater
Expand Down Expand Up @@ -225,6 +226,20 @@ class QgsGeometry
not disjoint with existing polygons of the feature*/
int addPart( const QList<QgsPoint> &points, QGis::GeometryType geomType = QGis::UnknownGeometry );

/**Adds a new island polygon to a multipolygon feature
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
not disjoint with existing polygons of the feature
@note not available in python bindings
*/
// int addPart( GEOSGeometry *newPart );

/**Adds a new island polygon to a multipolygon feature
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
not disjoint with existing polygons of the feature
@note available in python bindings as addPartGeometry (added in 2.1)
*/
int addPart( QgsGeometry *newPart /Transfer/ ) /PyName=addPartGeometry/;

/**Translate this geometry by dx, dy
@return 0 in case of success*/
int translate( double dx, double dy );
Expand Down
5 changes: 4 additions & 1 deletion python/core/qgsgml.sip
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class QgsGml: QObject
%End

public:

QgsGml(
const QString& typeName,
const QString& geometryAttribute,
Expand All @@ -17,6 +16,10 @@ class QgsGml: QObject
/** Read from GML data. */
int getFeatures( const QByteArray &data, QGis::WkbType* wkbType, QgsRectangle* extent = 0 );

/** Get parsed features for given type name */
QMap<qint64, QgsFeature* > featuresMap() const;

/** Get feature ids map */
QMap<qint64, QString > idsMap() const;

};
5 changes: 5 additions & 0 deletions python/core/qgsgmlschema.sip
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,20 @@ class QgsGmlSchema: QObject

/** Guess GML schema from data if XSD does not exist.
* Currently only recognizes UMN Mapserver GetFeatureInfo GML response.
* Supports only UTF-8, UTF-16, ISO-8859-1, US-ASCII XML encodings.
* @param data GML data
* @return true in case of success */
bool guessSchema( const QByteArray &data );

/** Get list of dot separated paths to feature classes parsed from GML or XSD */
QStringList typeNames() const;

/** Get fields for type/class name parsed from GML or XSD */
QList<QgsField> fields( const QString & typeName );

/** Get list of geometry attributes for type/class name */
QStringList geometryAttributes( const QString & typeName );

/** Get error if parseXSD() or guessSchema() failed */
QgsError error() const;
};
1 change: 1 addition & 0 deletions python/core/qgsmaptopixel.sip
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class QgsMapToPixel
/* Transform device coordinates to map coordinates. Modifies the
given coordinates in place. Intended as a fast way to do the
transform.
@note not available in python bindings
*/
// void transformInPlace( QVector<double>& x, QVector<double>& y ) const;

Expand Down
6 changes: 6 additions & 0 deletions python/core/qgsnetworkaccessmanager.sip
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class QgsNetworkAccessManager : QNetworkAccessManager
//! set fallback proxy and URL that shouldn't use it.
void setFallbackProxyAndExcludes( const QNetworkProxy &proxy, const QStringList &excludes );

//! Get name for QNetworkRequest::CacheLoadControl
static QString cacheLoadControlName( QNetworkRequest::CacheLoadControl theControl );

//! Get QNetworkRequest::CacheLoadControl from name
static QNetworkRequest::CacheLoadControl cacheLoadControlFromName( const QString &theName );

signals:
void requestAboutToBeCreated( QNetworkAccessManager::Operation, const QNetworkRequest &, QIODevice * );
void requestCreated( QNetworkReply * );
Expand Down
8 changes: 4 additions & 4 deletions python/core/qgsogcutils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class QgsOgcUtils
/** read rectangle from GML3 Envelope */
static QgsRectangle rectangleFromGMLEnvelope( const QDomNode& envelopeNode );

/** Exports the geometry to GML2
/** Exports the geometry to GML2 or GML3
@return QDomElement
*/
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc );
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString Format );

/** Exports the geometry to GML2 or GML3
/** Exports the geometry to GML2
@return QDomElement
*/
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString Format );
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc );

/** Exports the rectangle to GML2 Box
@return QDomElement
Expand Down
4 changes: 1 addition & 3 deletions python/core/qgspallabeling.sip
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,7 @@ class QgsPalLayerSettings
QgsExpression* getLabelExpression();

QFont textFont;
//QString textFontFamily;
QString textNamedStyle;
//bool textFontFound;
bool fontSizeInMapUnits; //true if font size is in map units (otherwise in points)
QColor textColor;
int textTransp;
Expand Down Expand Up @@ -423,7 +421,7 @@ class QgsPalLayerSettings
int maxNumLabels; // maximum number of labels to be drawn

double minFeatureSize; // minimum feature size to be labelled (in mm)
bool obstacle; // whether it's an obstacle
bool obstacle; // whether features for layer are obstacles to labels of other layers

//-- scale factors
double vectorScaleFactor; //scale factor painter units->pixels
Expand Down
13 changes: 2 additions & 11 deletions python/core/qgsproject.sip
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,9 @@ class QgsProject : QObject
@note The key string <em>must</em> include '/'s. E.g., "/foo" not "foo".
*/
//@{
bool writeEntryBool( const QString & scope, const QString & key, bool value );
%MethodCode
sipRes = sipCpp->writeEntry( *a0, *a1, a2 );
%End

bool writeEntryDouble( const QString & scope, const QString & key, double value );
%MethodCode
sipRes = sipCpp->writeEntry( *a0, *a1, a2 );
%End

bool writeEntry( const QString & scope, const QString & key, bool value ) /PyName=writeEntryBool/;
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 Down
3 changes: 3 additions & 0 deletions python/core/qgsprojectproperty.sip
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ class QgsPropertyKey : QgsProperty
virtual ~ QgsPropertyKey();

/// every key has a name
// @{
QString & name();
// @}


/** if this key has a value, it will be stored by its name in its
* properties
Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsproviderregistry.sip
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ class QgsProviderRegistry
Returns a string suitable for a QFileDialog of raster file formats
supported by all data providers.

This walks through all data providers appending calls to their
buildSupportedRasterFileFilter to a string, which is then returned.

@note this method was added in QGIS 2.0
@note This replaces QgsRasterLayer::buildSupportedRasterFileFilter()
*/
Expand Down
40 changes: 32 additions & 8 deletions python/core/qgsrenderchecker.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,53 @@ class QgsRenderChecker
QString controlImagePath() const;

QString report();

float matchPercent();

unsigned int mismatchCount();

unsigned int matchTarget();

//only records time for actual render part
int elapsedTime();

void setElapsedTimeTarget( int theTarget );
void setControlName( const QString theName );

void setControlPathPrefix( const QString theName );

QString imageToHash( QString theImageFile );

void setRenderedImage( QString theImageFileName );
void setMapRenderer( QgsMapRenderer * thepMapRenderer );
void setMapRenderer( QgsMapRenderer *thepMapRenderer );
/**
* Test using renderer to generate the image to be compared.
* @param theTestName - to be used as the basis for writing a file to
* e.g. /tmp/theTestName.png
* @param theMismatchCount - defaults to 0 - the number of pixels that
* are allowed to be different from the control image. In some cases
* rendering may be non-deterministic. This parameter allows you to account
* for that by providing a tolerance.
* @note make sure to call setExpectedImage and setMapRenderer first
*/
bool runTest( QString theTestName, unsigned int theMismatchCount = 0 );

/**
* Test using two arbitary images (map renderer will not be used)
* @param theTestName - to be used as the basis for writing a file to
* e.g. /tmp/theTestName.png
* @param theMismatchCount - defaults to 0 - the number of pixels that
* are allowed to be different from the control image. In some cases
* rendering may be non-deterministic. This parameter allows you to account
* for that by providing a tolerance.
* @param theRenderedImageFile to optionally override the output filename
* @note: make sure to call setExpectedImage and setRenderedImage first.
*/
bool compareImages( QString theTestName, unsigned int theMismatchCount = 0, QString theRenderedImageFile = "" );

/** Get a list of all the anomalies. An anomaly is a rendered difference
* file where there is some red pixel content (indicating a render check
* mismatch), but where the output was still acceptible. If the render
* diff matches one of these anomalies we will still consider it to be
* acceptible.
* @return a bool indicating if the diff matched one of the anomaly files
*/
bool isKnownAnomaly( QString theDiffImageFile );

QString expectedImageFile();

};
11 changes: 11 additions & 0 deletions python/core/qgsrendercontext.sip
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ class QgsRenderContext

bool forceVectorOutput() const;

/**Returns true if advanced effects such as blend modes such be used
@note added in 1.9*/
bool useAdvancedEffects() const;
/**Used to enable or disable advanced effects such as blend modes
@note: added in version 1.9*/
void setUseAdvancedEffects( bool enabled );

bool drawEditingInformation() const;

double rendererScale() const;
Expand Down Expand Up @@ -57,4 +64,8 @@ class QgsRenderContext
void setLabelingEngine(QgsLabelingEngineInterface* iface);
//! Added in QGIS v2.0
void setSelectionColor( const QColor& color );

/**Returns true if the rendering optimization (geometry simplification) can be executed*/
bool useRenderingOptimization() const;
void setUseRenderingOptimization( bool enabled );
};
43 changes: 34 additions & 9 deletions python/core/qgsvectordataprovider.sip
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,39 @@ class QgsVectorDataProvider : QgsDataProvider
*/
enum Capability
{
NoCapabilities = 0,
AddFeatures = 1,
/** provider has no capabilities */
NoCapabilities = 0,
/** allows adding features */
AddFeatures = 1,
/** allows deletion of features */
DeleteFeatures = 2,
/** allows modification of attribute values */
ChangeAttributeValues = 4,
/** allows addition of new attributes (fields) */
AddAttributes = 8,
/** allows deletion of attributes (fields) */
DeleteAttributes = 16,
/** DEPRECATED - do not use */
SaveAsShapefile = 32,
/** allows creation of spatial index */
CreateSpatialIndex = 64,
/** fast access to features using their ID */
SelectAtId = 128,
/** allows modifications of geometries */
ChangeGeometries = 256,
/** DEPRECATED - do not use */
SelectGeometryAtId = 512,
/** DEPRECATED - do not use */
RandomSelectGeometryAtId = 1024,
/** DEPRECATED - do not use */
SequentialSelectGeometryAtId = 2048,
CreateAttributeIndex = 4096,
/** allows user to select encoding */
SelectEncoding = 8192,
/** supports simplification of geometries on provider side according to a distance tolerance */
SimplifyGeometries = 32768,
/** supports topological simplification of geometries on provider side according to a distance tolerance */
SimplifyGeometriesWithTopologicalValidation = 65536,
};

/** bitmask of all provider's editing capabilities */
Expand Down Expand Up @@ -109,11 +127,13 @@ class QgsVectorDataProvider : QgsDataProvider
*/
virtual void uniqueValues( int index, QList<QVariant> &uniqueValues /Out/, int limit = -1 );

/**Returns the possible enum values of an attribute. Returns an empty stringlist if a provider does not support enum types
or if the given attribute is not an enum type.
/**
* Returns the possible enum values of an attribute. Returns an empty stringlist if a provider does not support enum types
* or if the given attribute is not an enum type.
* @param index the index of the attribute
* @param enumList reference to the list to fill
@note: added in version 1.2*/
* @note: added in version 1.2
*/
virtual void enumValues( int index, QStringList& enumList /Out/ );

/**
Expand Down Expand Up @@ -201,7 +221,9 @@ class QgsVectorDataProvider : QgsDataProvider
*/
int fieldNameIndex( const QString& fieldName ) const;

/**Return a map where the key is the name of the field and the value is its index*/
/**
* Return a map where the key is the name of the field and the value is its index
*/
QMap<QString, int> fieldNameMap() const;

/**
Expand Down Expand Up @@ -253,17 +275,20 @@ class QgsVectorDataProvider : QgsDataProvider
/** Returns a list of available encodings */
static const QStringList &availableEncodings();

/* provider has errors to report
/**
* Provider has errors to report
* @note added in 1.7
*/
bool hasErrors();

/* clear recorded errors
/**
* Clear recorded errors
* @note added in 1.7
*/
void clearErrors();

/* get recorded errors
/**
* Get recorded errors
* @note added in 1.7
*/
QStringList errors();
Expand Down
117 changes: 109 additions & 8 deletions python/core/qgsvectorfilewriter.sip
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,78 @@ class QgsVectorFileWriter
%End

public:
enum OptionType
{
Set,
String,
Int,
Hidden
};

class Option
{
public:
Option( const QString& docString, QgsVectorFileWriter::OptionType type );
virtual ~Option();

QString docString;
QgsVectorFileWriter::OptionType type;
};

class SetOption : QgsVectorFileWriter::Option
{
public:
SetOption( const QString& docString, QStringList values, const QString& defaultValue, bool allowNone = false );

QSet<QString> values;
QString defaultValue;
bool allowNone;
};

class StringOption: QgsVectorFileWriter::Option
{
public:
StringOption( const QString& docString, const QString& defaultValue = QString() );

QString defaultValue;
};

class IntOption: QgsVectorFileWriter::Option
{
public:
IntOption( const QString& docString, int defaultValue );

int defaultValue;
};

class BoolOption : QgsVectorFileWriter::SetOption
{
public:
BoolOption( const QString& docString, bool defaultValue );
};

class HiddenOption : QgsVectorFileWriter::Option
{
public:
HiddenOption( const QString& value );

QString mValue;
};

struct MetaData
{
MetaData();

MetaData( QString longName, QString trLongName, QString glob, QString ext, QMap<QString, QgsVectorFileWriter::Option*> driverOptions, QMap<QString, QgsVectorFileWriter::Option*> layerOptions );

QString longName;
QString trLongName;
QString glob;
QString ext;
QMap<QString, QgsVectorFileWriter::Option*> driverOptions;
QMap<QString, QgsVectorFileWriter::Option*> layerOptions;
};

enum WriterError
{
NoError = 0,
Expand All @@ -36,10 +108,26 @@ class QgsVectorFileWriter
SymbolLayerSymbology //Exports one feature per symbol layer (considering symbol levels)
};

/** Write contents of vector layer to an (OGR supported) vector formt
@note: this method was added in version 1.5
@param layer layer to write
@param fileName file name to write to
@param fileEncoding encoding to use
@param destCRS pointer to CRS to reproject exported geometries to
@param driverName OGR driver to use
@param onlySelected write only selected features of layer
@param errorMessage pointer to buffer fo error message
@param datasourceOptions list of OGR data source creation options
@param layerOptions list of OGR layer creation options
@param skipAttributeCreation only write geometries
@param newFilename QString pointer which will contain the new file name created (in case it is different to fileName).
@param symbologyExport symbology to export
@param symbologyScale scale of symbology
*/
static WriterError writeAsVectorFormat( QgsVectorLayer* layer,
const QString& fileName,
const QString& fileEncoding,
const QgsCoordinateTransform* ct,
const QgsCoordinateReferenceSystem *destCRS,
const QString& driverName = "ESRI Shapefile",
bool onlySelected = false,
QString *errorMessage = 0,
Expand All @@ -51,12 +139,10 @@ class QgsVectorFileWriter
double symbologyScale = 1.0 // added in 2.0
);

/** Write contents of vector layer to an (OGR supported) vector formt
@note: this method was added in version 1.5*/
static WriterError writeAsVectorFormat( QgsVectorLayer* layer,
const QString& fileName,
const QString& fileEncoding,
const QgsCoordinateReferenceSystem *destCRS,
const QgsCoordinateTransform* ct,
const QString& driverName = "ESRI Shapefile",
bool onlySelected = false,
QString *errorMessage = 0,
Expand All @@ -77,13 +163,17 @@ class QgsVectorFileWriter
const QString& driverName = "ESRI Shapefile",
const QStringList &datasourceOptions = QStringList(), // added in 1.6
const QStringList &layerOptions = QStringList(), // added in 1.6
QString *newFilename = 0 // added in 1.9
QString *newFilename = 0, // added in 1.9
QgsVectorFileWriter::SymbologyExport symbologyExport = QgsVectorFileWriter::NoSymbology //added in 2.0
);

/**Returns map with format filter string as key and OGR format key as value*/
static QMap< QString, QString> supportedFiltersAndFormats();

/**Returns driver list that can be used for dialogs*/
/**Returns driver list that can be used for dialogs. It contains all OGR drivers
* + some additional internal QGIS driver names to distinguish between more
* supported formats of the same OGR driver
*/
static QMap< QString, QString> ogrDriverList();

/**Returns filter string that can be used for dialogs*/
Expand All @@ -92,6 +182,9 @@ class QgsVectorFileWriter
/**Creates a filter for an OGR driver key*/
static QString filterForDriver( const QString& driverName );

/**Converts codec name to string passed to ENCODING layer creation option of OGR Shapefile*/
static QString convertCodecNameForEncodingOption( const QString &codecName );

/** checks whether there were any errors in constructor */
WriterError hasError();

Expand All @@ -101,8 +194,9 @@ class QgsVectorFileWriter
QString errorMessage();

/** add feature to the currently opened shapefile */
bool addFeature( QgsFeature& feature );
bool addFeature( QgsFeature& feature, QgsFeatureRendererV2* renderer = 0, QGis::UnitType outputUnit = QGis::Meters );

//! @note not available in python bindings
// QMap<int, int> attrIdxToOgrIdx();

/** close opened shapefile for writing */
Expand All @@ -114,8 +208,15 @@ class QgsVectorFileWriter
*/
static bool deleteShapeFile( QString theFileName );

SymbologyExport symbologyExport() const;
void setSymbologyExport( SymbologyExport symExport );

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

static bool driverMetadata( const QString& driverName, MetaData& driverMetadata );

protected:

// OGRGeometryH createEmptyGeometry( QGis::WkbType wkbType );
};

33 changes: 29 additions & 4 deletions python/core/qgsvectorlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class QgsAttributeEditorContainer : QgsAttributeEditorElement

public:
QgsAttributeEditorContainer( QString name, QObject *parent );

~QgsAttributeEditorContainer();

virtual QDomElement toDomElement( QDomDocument& doc ) const;
Expand All @@ -52,15 +53,37 @@ class QgsAttributeEditorField : QgsAttributeEditorElement
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End

public:
QgsAttributeEditorField( QString name , int idx, QObject *parent );

~QgsAttributeEditorField();

virtual QDomElement toDomElement( QDomDocument& doc ) const;
int idx() const;
};

/** @note Added in 2.1 */
class QgsAttributeEditorRelation : QgsAttributeEditorElement
{
public:
QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent );

QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent );

~QgsAttributeEditorRelation();

virtual QDomElement toDomElement( QDomDocument& doc ) const;
const QgsRelation& relation() const;

/**
* Initializes the relation from the id
*
* @param relManager The relation manager to use for the initialization
* @return true if the relation was found in the relationmanager
*/
bool init( QgsRelationManager *relManager );
};

/** @note added in 1.7 */
struct QgsVectorJoinInfo
{
Expand Down Expand Up @@ -216,7 +239,7 @@ class QgsVectorLayer : QgsMapLayer
* for this layer
* @note added in 2.0
*/
void setDisplayExpression( const QString displayExpression );
void setDisplayExpression( const QString &displayExpression );

/**
* Get the preview expression, used to create a human readable preview string.
Expand All @@ -234,7 +257,7 @@ class QgsVectorLayer : QgsMapLayer
/** Returns the data provider in a const-correct manner
@note not available in python bindings
*/
//const QgsVectorDataProvider* dataProvider() const;
// const QgsVectorDataProvider* dataProvider() const;

/** Sets the textencoding of the data provider */
void setProviderEncoding( const QString& encoding );
Expand Down Expand Up @@ -1076,6 +1099,9 @@ class QgsVectorLayer : QgsMapLayer
*/
virtual void onCacheImageDelete();

protected slots:
void invalidateSymbolCountedFlag();

signals:

/**
Expand Down Expand Up @@ -1172,6 +1198,5 @@ class QgsVectorLayer : QgsMapLayer
QgsVectorLayer( const QgsVectorLayer & rhs );



};

176 changes: 169 additions & 7 deletions python/core/qgsvectorlayercache.sip
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
/**
* This class caches features of a given QgsVectorLayer.
* The features are automatically updated and/or invalidated, whenever a change happens to the feature.
*
* It is the callers responsibility to make sure, that he specifies all required fields in every select operation.
* There is no guarantee, that a cached feature will contain a field not specified in a previous select operation.
* @brief
* The cached features can be indexed by @link QgsAbstractCacheIndex @endlink.
*
* Performance:
* Depending on the usage scenario, it can be a good idea to prepopulate the cache by calling select, nextFeature and
* and removeCachedFeature. This is especially interesting, whenever requesting a single feature from the dataProvider
* takes much longer than querying in bunches (e.g. network latency, slow views in the database...)
* Proper indexing for a given use-case may speed up performance substantially.
*/

class QgsVectorLayerCache : QObject
Expand All @@ -27,5 +23,171 @@ class QgsVectorLayerCache : QObject
* @param cacheSize indicates the maximum number of features to keep in the cache
*/
void setCacheSize( int cacheSize );

/**
* @brief
* Returns the maximum number of features this cache will hold.
* In case full caching is enabled, this number can change, as new features get added.
*
* @return int
*/
int cacheSize();

/**
* Enable or disable the caching of geometries
*
* @param cacheGeometry Enable or disable the caching of geometries
*/
void setCacheGeometry( bool cacheGeometry );


/**
* Set the subset of attributes to be cached
*
* @param attributes The attributes to be cached
*/
void setCacheSubsetOfAttributes( const QgsAttributeList& attributes );

/**
* If this is enabled, the subset of cached attributes will automatically be extended
* to also include newly added attributes.
*
* @param cacheAddedAttributes Automatically cache new attributes
*/
void setCacheAddedAttributes( bool cacheAddedAttributes );

/**
* @brief
* This enables or disables full caching.
* If enabled, all features will be held in the cache. The cache size will incrementally
* be increased to offer space for all features.
* When enabled, all features will be read into cache. As this feature will most likely
* be used for slow data sources, be aware, that the call to this method might take a long time.
*
* @param fullCache True: enable full caching, False: disable full caching
*/
void setFullCache( bool fullCache );

/**
* @brief
* Adds a {@link QgsAbstractCacheIndex} to this cache. Cache indices know about features present
* in this cache and decide, if enough information is present in the cache to respond to a {@link QgsFeatureRequest}.
*
* @param cacheIndex The cache index to add.
*/
void addCacheIndex( QgsAbstractCacheIndex *cacheIndex );

/**
* Query this VectorLayerCache for features.
* If the VectorLayerCache (and moreover any of its indices) is able to satisfy
* the request, the returned {@link QgsFeatureIterator} will iterate over cached features.
* If it's not possible to fully satisfy the request from the cache, part or all of the features
* will be requested from the data provider.
* @param featureRequest The request specifying filter and required data.
* @return An iterator over the requested data.
*/
QgsFeatureIterator getFeatures( const QgsFeatureRequest& featureRequest = QgsFeatureRequest() );

/**
* Check if a certain feature id is cached.
* @param fid The feature id to look for
* @return True if this id is in the cache
*/
bool isFidCached( const QgsFeatureId fid );

/**
* Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features
* @param featureId The id of the feature to query
* @param feature The result of the operation will be written to this feature
* @param skipCache Will query the layer regardless if the feature is in the cache already
* @return true in case of success
*/
bool featureAtId( QgsFeatureId featureId, QgsFeature &feature, bool skipCache = false );

/**
* Removes the feature identified by fid from the cache if present.
* @param fid The id of the feature to delete
* @return true if the feature was removed, false if the feature id was not found in the cache
*/
bool removeCachedFeature( QgsFeatureId fid );

/**
* Returns the layer to which this cache belongs
*/
QgsVectorLayer* layer();

protected:
/**
* @brief
* Gets called, whenever the full list of feature ids for a certain request is known.
* Broadcasts this information to indices, so they can update their tables.
*
* @param featureRequest The feature request that was answered
* @param fids The feature ids that have been returned
*/
void requestCompleted( QgsFeatureRequest featureRequest, QgsFeatureIds fids );

/**
* @brief
* Gets called, whenever a feature has been removed.
* Broadcasts this information to indices, so they can invalidate their cache if required.
*
* @param fid The feature id of the removed feature.
*/
void featureRemoved( QgsFeatureId fid );

/**
* @brief
* Checks if the information required to complete the request is cached.
* i.e. If all attributes required and the geometry is held in the cache.
* Please note, that this does not check, if the requested features are cached.
*
*
* @param featureRequest The {@link QgsFeatureRequest} to be answered
* @return True if the information is being cached, false if not
*/
bool checkInformationCovered( const QgsFeatureRequest& featureRequest );


signals:

/**
* When filling the cache, this signal gets emitted periodically to notify about the progress
* and to be able to cancel an operation.
*
* @param i The number of already fetched features
* @param cancel A reference to a boolean variable. Set to true and the operation will be canceled.
*
* @note not available in python bindings
*/
// void progress( int i, bool& cancel );

/**
* When filling the cache, this signal gets emitted once the cache is fully initialized.
*/
void finished();

/**
* @brief Is emitted when the cached layer is deleted. Is emitted when the cached layers layerDelete()
* signal is being emitted, but before the local reference to it has been set to NULL. So call to
* @link layer() @endlink will still return a valid pointer for cleanup purpose.
*/
void cachedLayerDeleted();

/**
* @brief Is emitted when an attribute is changed. Is re-emitted after the layer itself emits this signal.
* You should connect to this signal, to be sure, to not get a cached value if querying the cache.
*/
void attributeValueChanged( const QgsFeatureId& fid, const int& field, const QVariant &value );

/**
* Is emitted, when a new feature has been added to the layer and this cache.
* You should connect to this signal instead of the layers', if you want to be sure
* that this cache has updated information for the new feature
*
* @param fid The featureid of the changed feature
*/
void featureAdded( QgsFeatureId fid );

};

7 changes: 7 additions & 0 deletions python/core/qgsvectorlayerfeatureiterator.sip
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIterator
void prepareJoins();
bool fetchNextAddedFeature( QgsFeature& f );
bool fetchNextChangedGeomFeature( QgsFeature& f );
bool fetchNextChangedAttributeFeature( QgsFeature& f );
void useAddedFeature( const QgsFeature& src, QgsFeature& f );
void useChangedAttributeFeature( QgsFeatureId fid, const QgsGeometry& geom, QgsFeature& f );
bool nextFeatureFid( QgsFeature& f );
void addJoinedAttributes( QgsFeature &f );

/** Update feature with uncommited attribute updates */
void updateChangedAttributes( QgsFeature& f );

/** Update feature with uncommited geometry updates */
void updateFeatureGeometry( QgsFeature& f );
};
7 changes: 7 additions & 0 deletions python/core/raster/qgsraster.sip
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class QgsRaster
/*! Cr Chroma */ YCbCr_CrBand = 16,
/*! Continuous palette, QGIS addition, GRASS */ ContinuousPalette = 17
};

enum IdentifyFormat
{
IdentifyFormatUndefined = 0,
Expand Down Expand Up @@ -89,5 +90,11 @@ class QgsRaster
static QString contrastEnhancementLimitsAsString( QgsRaster::ContrastEnhancementLimits theLimits );
static ContrastEnhancementLimits contrastEnhancementLimitsFromString( QString theLimits );

/** Get value representable by given data type.
* Supported are numerical types Byte, UInt16, Int16, UInt32, Int32, Float32, Float64.
* @param value
* @param dataType
* @note added in version 2.1 */
static double representableValue( double value, QGis::DataType dataType );
};

18 changes: 12 additions & 6 deletions python/core/raster/qgsrasterblock.sip
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class QgsRasterBlock

/** \brief Read a single value if type of block is numeric. If type is color,
* returned value is undefined.
* @param index data matrix index
* @param index data matrix index (long type in Python)
* @return value */
double value( qgssize index ) const;

Expand All @@ -96,7 +96,7 @@ class QgsRasterBlock
QRgb color( int row, int column ) const;

/** \brief Read a single value
* @param index data matrix index
* @param index data matrix index (long type in Python)
* @return color */
QRgb color( qgssize index ) const;

Expand All @@ -107,7 +107,7 @@ class QgsRasterBlock
bool isNoData( int row, int column );

/** \brief Check if value at position is no data
* @param index data matrix index
* @param index data matrix index (long type in Python)
* @return true if value is no data */
bool isNoData( qgssize index );

Expand All @@ -119,7 +119,7 @@ class QgsRasterBlock
bool setValue( int row, int column, double value );

/** \brief Set value on index (indexed line by line)
* @param index data matrix index
* @param index data matrix index (long type in Python)
* @param value the value to be set
* @return true on success */
bool setValue( qgssize index, double value );
Expand All @@ -132,7 +132,7 @@ class QgsRasterBlock
bool setColor( int row, int column, QRgb color );

/** \brief Set color on index (indexed line by line)
* @param index data matrix index
* @param index data matrix index (long type in Python)
* @param color the color to be set, QRgb value
* @return true on success */
bool setColor( qgssize index, QRgb color );
Expand All @@ -144,7 +144,7 @@ class QgsRasterBlock
bool setIsNoData( int row, int column );

/** \brief Set no data on pixel
* @param index data matrix index
* @param index data matrix index (long type in Python)
* @return true on success */
bool setIsNoData( qgssize index );

Expand Down Expand Up @@ -197,6 +197,12 @@ class QgsRasterBlock
* @return true on success */
bool setImage( const QImage * image );

// @note not available in python bindings
// inline static double readValue( void *data, QGis::DataType type, qgssize index );

// @note not available in python bindings
// inline static void writeValue( void *data, QGis::DataType type, qgssize index, double value );

void applyNoDataValues( const QgsRasterRangeList & rangeList );

/** \brief Get error */
Expand Down
40 changes: 19 additions & 21 deletions python/core/raster/qgsrasterinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ class QgsRasterInterface
/** Returns data type for the band specified by number */
virtual QGis::DataType dataType( int bandNo ) const = 0;

/** Returns source data type for the band specified by number,
* source data type may be shorter than dataType */
virtual QGis::DataType srcDataType( int bandNo ) const;

/**
* Get the extent of the interface.
* @return QgsRectangle containing the extent of the layer
*/
virtual QgsRectangle extent();

int dataTypeSize ( int bandNo );

/** Get number of bands */
Expand All @@ -86,19 +96,17 @@ class QgsRasterInterface
virtual int xSize() const;
virtual int ySize() const;

/** Return no data value for specific band. Each band/provider must have
* no data value, if there is no one set in original data, provider decides one
* possibly using wider data type.
* @param bandNo band number
* @return No data value */
//virtual double noDataValue( int bandNo ) const;
/** \brief helper function to create zero padded band names */
virtual QString generateBandName( int theBandNumber ) const;

/** Test if value is nodata for specific band
/** Read block of data using given extent and size.
* Returns pointer to data.
* Caller is responsible to free the memory returned.
* @param bandNo band number
* @param value tested value
* @return true if value is nodata */
//virtual bool isNoDataValue( int bandNo, double value ) const;

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

/** Set input.
Expand Down Expand Up @@ -140,7 +148,6 @@ class QgsRasterInterface
const QgsRectangle & theExtent = QgsRectangle(),
int theSampleSize = 0 );


/** \brief Get histogram. Histograms are cached in providers.
* @param theBandNo The band (number).
* @param theBinCount Number of bins (intervals,buckets). If 0, the number of bins is decided automaticaly according to data type, raster size etc.
Expand Down Expand Up @@ -188,15 +195,6 @@ class QgsRasterInterface
const QgsRectangle & theExtent = QgsRectangle(),
int theSampleSize = 0 );

/** Switch on (and clear old statistics) or off collection of statistics */
//void setStatsOn( bool on );

/** Last total time (for allbands) consumed by this interface for call to block()
* If cumulative is true, the result includes also time spent in all preceding
* interfaces. If cumulative is false, only time consumed by this interface is
* returned. */
//double time( bool cumulative = false );

/** Write base class members to xml. */
virtual void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
/** Sets base class members from xml. Usually called from create() methods of subclasses */
Expand Down
5 changes: 1 addition & 4 deletions python/core/raster/qgsrasterlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ class QgsRasterLayer : QgsMapLayer
QgsRasterDataProvider* dataProvider();

/** Returns the data provider in a const-correct manner */
const QgsRasterDataProvider* constDataProvider() const;
%MethodCode
sipRes = sipCpp->dataProvider();
%End
const QgsRasterDataProvider* dataProvider() const /PyName=constDataProvider/;

/**Synchronises with changes in the datasource
@note added in version 1.6*/
Expand Down
18 changes: 9 additions & 9 deletions python/core/raster/qgsrasterprojector.sip
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class QgsRasterProjector : QgsRasterInterface
*/

QgsRasterProjector(
QgsCoordinateReferenceSystem theSrcCRS,
QgsCoordinateReferenceSystem theDestCRS,
int theSrcDatumTransform,
int theDestDatumTransform,
QgsRectangle theDestExtent,
int theDestRows, int theDestCols,
double theMaxSrcXRes, double theMaxSrcYRes,
QgsRectangle theExtent
);
QgsCoordinateReferenceSystem theSrcCRS,
QgsCoordinateReferenceSystem theDestCRS,
int theSrcDatumTransform,
int theDestDatumTransform,
QgsRectangle theDestExtent,
int theDestRows, int theDestCols,
double theMaxSrcXRes, double theMaxSrcYRes,
QgsRectangle theExtent
);

QgsRasterProjector(
QgsCoordinateReferenceSystem theSrcCRS,
Expand Down
2 changes: 2 additions & 0 deletions python/core/raster/qgsrasterviewport.sip
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ struct QgsRasterViewPort
/** \brief Target coordinate system */
QgsCoordinateReferenceSystem mDestCRS;

int mSrcDatumTransform;
int mDestDatumTransform;
};
5 changes: 1 addition & 4 deletions python/core/raster/qgssinglebandpseudocolorrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer
/**Takes ownership of the shader*/
void setShader( QgsRasterShader* shader /Transfer/ );
QgsRasterShader* shader();
const QgsRasterShader* constShader() const;
%MethodCode
sipRes = sipCpp->shader();
%End
const QgsRasterShader* shader() const /PyName=constShader/;

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

Expand Down
5 changes: 5 additions & 0 deletions python/core/symbology-ng/qgsellipsesymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class QgsEllipseSymbolLayerV2 : QgsMarkerSymbolLayerV2
void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const;
void writeSldMarker( QDomDocument& doc, QDomElement &element, QgsStringMap props ) 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;

void setSymbolName( const QString& name );
QString symbolName() const;

Expand All @@ -30,6 +32,9 @@ class QgsEllipseSymbolLayerV2 : QgsMarkerSymbolLayerV2
void setSymbolHeight( double h );
double symbolHeight() const;

Qt::PenStyle outlineStyle() const;
void setOutlineStyle( Qt::PenStyle outlineStyle );

void setOutlineWidth( double w );
double outlineWidth() const;

Expand Down
16 changes: 15 additions & 1 deletion python/core/symbology-ng/qgsfillsymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,18 @@ class QgsSimpleFillSymbolLayerV2 : QgsFillSymbolLayerV2
QColor borderColor() const;
void setBorderColor( QColor borderColor );

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


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

Qt::PenStyle borderStyle() const;
Expand All @@ -63,6 +71,12 @@ class QgsSimpleFillSymbolLayerV2 : QgsFillSymbolLayerV2

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

double estimateMaxBleed() const;

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

class QgsGradientFillSymbolLayerV2 : QgsFillSymbolLayerV2
Expand Down
5 changes: 4 additions & 1 deletion python/core/symbology-ng/qgsrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ class QgsFeatureRendererV2

QString type() const;

// to be overridden
/** to be overridden
* @param feature feature
* @return returns pointer to symbol or 0 if symbol was not found
*/
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ) = 0;

virtual void startRender( QgsRenderContext& context, const QgsVectorLayer *vlayer ) = 0;
Expand Down
5 changes: 3 additions & 2 deletions python/core/symbology-ng/qgssinglesymbolrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2
void setSymbol( QgsSymbolV2* s /Transfer/ );

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

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

Expand Down Expand Up @@ -59,6 +59,7 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2

//! return a list of item text / symbol
//! @note: this method was added in version 1.5
//! @note not available in python bindings
// virtual QgsLegendSymbolList legendSymbolItems();

private:
Expand Down
63 changes: 54 additions & 9 deletions python/core/symbology-ng/qgssvgcache.sip
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ class QgsSvgCacheEntry

public:
QgsSvgCacheEntry();
/** Constructor.
* @param file Absolute path to SVG file (relative paths are not resolved).
* @param size
* @param outlineWidth width of outline
* @param widthScaleFactor width scale factor
* @param rasterScaleFactor raster scale factor
* @param fill color of fill
* @param outline color of outline
*/
QgsSvgCacheEntry( const QString& file, double size, double outlineWidth, double widthScaleFactor, double rasterScaleFctor, const QColor& fill, const QColor& outline );
~QgsSvgCacheEntry();

QString file;
int size; //size in pixel
double size; //size in pixels (cast to int for QImage)
double outlineWidth;
double widthScaleFactor;
double rasterScaleFactor;
Expand Down Expand Up @@ -45,29 +54,65 @@ class QgsSvgCache : QObject
static QgsSvgCache* instance();
~QgsSvgCache();

const QImage& svgAsImage( const QString& file, int size, const QColor& fill, const QColor& outline, double outlineWidth,
/** Get SVG as QImage.
* @param file Absolute or relative path to SVG file.
* @param size size of cached image
* @param fill color of fill
* @param outline color of outline
* @param outlineWidth width of outline
* @param widthScaleFactor width scale factor
* @param rasterScaleFactor raster scale factor
* @param fitsInCache
*/
const QImage& svgAsImage( const QString& file, double size, const QColor& fill, const QColor& outline, double outlineWidth,
double widthScaleFactor, double rasterScaleFactor, bool& fitsInCache );
const QPicture& svgAsPicture( const QString& file, int size, const QColor& fill, const QColor& outline, double outlineWidth,
double widthScaleFactor, double rasterScaleFactor );
/** Get SVG as QPicture&.
* @param file Absolute or relative path to SVG file.
* @param size size of cached image
* @param fill color of fill
* @param outline color of outline
* @param outlineWidth width of outline
* @param widthScaleFactor width scale factor
* @param rasterScaleFactor raster scale factor
* @param forceVectorOutput
*/
const QPicture& svgAsPicture( const QString& file, double size, const QColor& fill, const QColor& outline, double outlineWidth,
double widthScaleFactor, double rasterScaleFactor, bool forceVectorOutput = false );

/**Tests if an svg file contains parameters for fill, outline color, outline width. If yes, possible default values are returned. If there are several
default values in the svg file, only the first one is considered*/
void containsParams( const QString& path, bool& hasFillParam, QColor& defaultFillColor, bool& hasOutlineParam, QColor& defaultOutlineColor, bool& hasOutlineWidthParam,
double& defaultOutlineWidth ) const;

/**Get image data*/
QByteArray getImageData( const QString &path ) const;

signals:
/** Emit a signal to be caught by qgisapp and display a msg on status bar */
void statusChanged( const QString& theStatusQString );

protected:
//! protected constructor
QgsSvgCache( QObject* parent = 0 );
QgsSvgCache( QObject * parent = 0 );

/**Creates new cache entry and returns pointer to it*/
QgsSvgCacheEntry* insertSVG( const QString& file, int size, const QColor& fill, const QColor& outline, double outlineWidth,
/**Creates new cache entry and returns pointer to it
* @param file Absolute or relative path to SVG file. If the path is relative the file is searched by QgsSymbolLayerV2Utils::symbolNameToPath() in SVG paths.
in settings svg/searchPathsForSVG
* @param size size of cached image
* @param fill color of fill
* @param outline color of outline
* @param outlineWidth width of outline
* @param widthScaleFactor width scale factor
* @param rasterScaleFactor raster scale factor
*/
QgsSvgCacheEntry* insertSVG( const QString& file, double size, const QColor& fill, const QColor& outline, double outlineWidth,
double widthScaleFactor, double rasterScaleFactor );

void replaceParamsAndCacheSvg( QgsSvgCacheEntry* entry );
void cacheImage( QgsSvgCacheEntry* entry );
void cachePicture( QgsSvgCacheEntry* entry );
void cachePicture( QgsSvgCacheEntry* entry, bool forceVectorOutput = false );
/**Returns entry from cache or creates a new entry if it does not exist already*/
QgsSvgCacheEntry* cacheEntry( const QString& file, int size, const QColor& fill, const QColor& outline, double outlineWidth,
QgsSvgCacheEntry* cacheEntry( const QString& file, double size, const QColor& fill, const QColor& outline, double outlineWidth,
double widthScaleFactor, double rasterScaleFactor );

/**Removes the least used items until the maximum size is under the limit*/
Expand Down
55 changes: 53 additions & 2 deletions python/core/symbology-ng/qgssymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@ class QgsSymbolLayerV2
public:

// not necessarily supported by all symbol layers...
virtual void setColor( const QColor& color );
virtual QColor color() const;
virtual void setColor( const QColor& color );
/** Set outline color. Supported by marker and fill layers.
* @note added in 2.1 */
virtual void setOutlineColor( const QColor& color );
/** Get outline color. Supported by marker and fill layers.
* @note added in 2.1 */
virtual QColor outlineColor() const;
/** Set fill color. Supported by marker and fill layers.
* @note added in 2.1 */
virtual void setFillColor( const QColor& color );
/** Get fill color. Supported by marker and fill layers.
* @note added in 2.1 */
virtual QColor fillColor() const;

virtual ~QgsSymbolLayerV2();
Expand Down Expand Up @@ -94,6 +102,12 @@ class QgsSymbolLayerV2
void setLocked( bool locked );
bool isLocked() const;

/**Returns the estimated maximum distance which the layer style will bleed outside
the drawn shape. Eg, polygons drawn with an outline will draw half the width
of the outline outside of the polygon. This amount is estimated, since it may
be affected by data defined symbology rules.*/
virtual double estimateMaxBleed() const;

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

Expand All @@ -109,6 +123,21 @@ class QgsSymbolLayerV2
virtual void setDataDefinedProperty( const QString& property, const QString& expressionString );
virtual void removeDataDefinedProperty( const QString& property );
virtual void removeDataDefinedProperties();
bool hasDataDefinedProperties() const;

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

virtual double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2RenderContext& context ) const;

virtual QColor dxfColor( const QgsSymbolV2RenderContext& context ) const;

virtual QVector<qreal> dxfCustomDashPattern( QgsSymbolV2::OutputUnit& unit ) const;
virtual Qt::PenStyle dxfPenStyle() const;

protected:
QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false );
Expand All @@ -128,8 +157,22 @@ class QgsMarkerSymbolLayerV2 : QgsSymbolLayerV2
%TypeHeaderCode
#include <qgssymbollayerv2.h>
%End

public:
enum HorizontalAnchorPoint
{
Left,
HCenter,
Right
};
enum VerticalAnchorPoint
{
Top,
VCenter,
Bottom
};

void startRender( QgsSymbolV2RenderContext& context );

virtual void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context ) = 0;

void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size );
Expand Down Expand Up @@ -159,8 +202,16 @@ class QgsMarkerSymbolLayerV2 : QgsSymbolLayerV2
virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit );
virtual QgsSymbolV2::OutputUnit outputUnit() const;

void setHorizontalAnchorPoint( HorizontalAnchorPoint h );
HorizontalAnchorPoint horizontalAnchorPoint() const;

void setVerticalAnchorPoint( VerticalAnchorPoint v );
VerticalAnchorPoint verticalAnchorPoint() const;

protected:
QgsMarkerSymbolLayerV2( bool locked = false );

//handles marker offset and anchor point shift together
void markerOffset( const QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY ) const;
static QPointF _rotatedOffset( const QPointF& offset, double angle );
};
Expand Down
20 changes: 15 additions & 5 deletions python/core/symbology-ng/qgssymbollayerv2utils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ class QgsSymbolLayerV2Utils
static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size );
static QPixmap colorRampPreviewPixmap( QgsVectorColorRampV2* ramp, QSize size );

/**Returns the maximum estimated bleed for the symbol */
static double estimateMaxSymbolBleed( QgsSymbolV2* symbol );

static QgsSymbolV2* loadSymbol( QDomElement& element ) /Factory/;
static QgsSymbolLayerV2* loadSymbolLayer( QDomElement& element ) /Factory/;
static QDomElement saveSymbol( QString symbolName, QgsSymbolV2* symbol, QDomDocument& doc );
Expand Down Expand Up @@ -93,6 +96,7 @@ class QgsSymbolLayerV2Utils
static bool fillFromSld( QDomElement &element,
Qt::BrushStyle &brushStyle, QColor &color );

//! @note not available in python bindings
/*
static void lineToSld( QDomDocument &doc, QDomElement &element,
Qt::PenStyle penStyle, QColor color, double width = -1,
Expand All @@ -113,15 +117,15 @@ class QgsSymbolLayerV2Utils

/** @deprecated Use wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element, QString name, QColor color, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth, double size ) instead */
static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
QString name, QColor color, QColor borderColor = QColor(),
double borderWidth = -1, double size = -1 ) /Deprecated/ ;
QString name, QColor color, QColor borderColor = QColor(),
double borderWidth = -1, double size = -1 ) /Deprecated/ ;
static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
QString name, QColor color, QColor borderColor, Qt::PenStyle borderStyle,
double borderWidth = -1, double size = -1 );
/** @deprecated Use wellKnownMarkerFromSld( QDomElement &element, QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle, double &borderWidth, double &size ) instead */
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size ) /Deprecated/ ;
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size ) /Deprecated/ ;
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle,
double &borderWidth, double &size ) /PyName=wellKnownMarkerFromSld2/ ;
Expand Down Expand Up @@ -211,9 +215,15 @@ class QgsSymbolLayerV2Utils
//! Return a list of svg files at the specified directory
static QStringList listSvgFilesAt( QString directory );

//! Get symbol's path from its name
/** Get symbol's path from its name.
* If the name is not absolute path the file is searched in SVG paths specified
* in settings svg/searchPathsForSVG.
*/
static QString symbolNameToPath( QString name );

//! Get symbols's name from its path
static QString symbolPathToName( QString path );

//! Calculate the centroid point of a QPolygonF
static QPointF polygonCentroid( const QPolygonF& points );
};
5 changes: 4 additions & 1 deletion python/core/symbology-ng/qgssymbolv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class QgsSymbolV2
void stopRender( QgsRenderContext& context );

void setColor( const QColor& color );
QColor color();
QColor color() const;

void drawPreviewIcon( QPainter* painter, QSize size );

Expand All @@ -104,6 +104,9 @@ class QgsSymbolV2

QSet<QString> usedAttributes() const;

void setLayer( const QgsVectorLayer* layer );
const QgsVectorLayer* layer() const;

protected:
QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers /Transfer/ ); // can't be instantiated

Expand Down
30 changes: 26 additions & 4 deletions python/core/symbology-ng/qgsvectorcolorrampv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QgsVectorColorRampV2

struct QgsGradientStop
{
double offset;
double offset; // relative (0,1)
QColor color;
QgsGradientStop( double o, const QColor& c );
};
Expand Down Expand Up @@ -76,6 +76,10 @@ class QgsVectorGradientColorRampV2 : QgsVectorColorRampV2

QgsStringMap info() const;
void setInfo( const QgsStringMap& info );

/**copy color ramp stops to a QGradient
* @note added in 2.1 */
void addStopsToGradient( QGradient* gradient );
};

class QgsVectorRandomColorRampV2 : QgsVectorColorRampV2
Expand All @@ -91,6 +95,8 @@ class QgsVectorRandomColorRampV2 : QgsVectorColorRampV2

static QgsVectorColorRampV2* create( const QgsStringMap& properties = QgsStringMap() ) /Factory/;

virtual double value( int index ) const;

virtual QColor color( double value ) const;

virtual QString type() const;
Expand All @@ -100,7 +106,6 @@ class QgsVectorRandomColorRampV2 : QgsVectorColorRampV2
virtual QgsStringMap properties() const;

void updateColors();

int count() const;
int hueMin() const;
int hueMax() const;
Expand All @@ -118,6 +123,24 @@ class QgsVectorRandomColorRampV2 : QgsVectorColorRampV2
void setValMax( int val );
};

class QgsRandomColorsV2 : QgsVectorColorRampV2
{
public:
QgsRandomColorsV2();
~QgsRandomColorsV2();

int count() const;

double value( int index ) const;

QColor color( double value ) const;

QString type() const;

QgsVectorColorRampV2* clone() const;

QgsStringMap properties() const;
};

class QgsVectorColorBrewerColorRampV2 : QgsVectorColorRampV2
{
Expand Down Expand Up @@ -153,7 +176,7 @@ class QgsVectorColorBrewerColorRampV2 : QgsVectorColorRampV2
};


class QgsCptCityColorRampV2
class QgsCptCityColorRampV2 : QgsVectorGradientColorRampV2
{
%TypeHeaderCode
#include <qgsvectorcolorrampv2.h>
Expand Down Expand Up @@ -187,7 +210,6 @@ class QgsCptCityColorRampV2

void loadPalette();
bool hasMultiStops() const;
int count() const;

QString fileName() const;
bool loadFile();
Expand Down
2 changes: 1 addition & 1 deletion python/gui/attributetable/qgsfeaturelistmodel.sip
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class QgsFeatureListModel : QAbstractProxyModel, QgsFeatureModel
*/
QString parserErrorString();

const QString& displayExpression() const;
QString displayExpression() const;
bool featureByIndex( const QModelIndex& index, QgsFeature& feat );
QgsFeatureId idxToFid( const QModelIndex& index ) const;
QModelIndex fidToIdx( const QgsFeatureId fid ) const;
Expand Down
9 changes: 8 additions & 1 deletion python/gui/attributetable/qgsfeaturelistview.sip
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class QgsFeatureListView : QListView
*
* @see QgsExpression
*/
const QString& displayExpression() const;
const QString displayExpression() const;

/**
* Returns a detailed message about errors while parsing a QgsExpression.
Expand All @@ -61,6 +61,13 @@ class QgsFeatureListView : QListView
*/
QString parserErrorString();

/**
* Get the currentEditSelection
*
* @return A list of edited feature ids
*/
QgsFeatureIds currentEditSelection();

protected:
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mousePressEvent( QMouseEvent *event );
Expand Down
2 changes: 2 additions & 0 deletions python/gui/qgscomposerruler.sip
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class QgsComposerRuler : QWidget
void setComposition( QgsComposition* c );
QgsComposition* composition();

int rulerSize();

protected:
void paintEvent( QPaintEvent* event );
void mouseMoveEvent( QMouseEvent* event );
Expand Down
48 changes: 46 additions & 2 deletions python/gui/qgscomposerview.sip
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Creates the composer items according to the current map tools and keeps track
* of the rubber band item.
*/
class QgsComposerView: QGraphicsView
class QgsComposerView : QGraphicsView
{
%TypeHeaderCode
#include "qgscomposerview.h"
Expand Down Expand Up @@ -35,7 +35,29 @@ class QgsComposerView: QGraphicsView
AddEllipse,
AddTriangle,
AddTable, //add attribute table
MoveItemContent //move content of item (e.g. content of map)
MoveItemContent, //move content of item (e.g. content of map)
Pan,
Zoom
};

enum ClipboardMode
{
ClipboardModeCut,
ClipboardModeCopy
};

enum PasteMode
{
PasteModeCursor,
PasteModeCenter,
PasteModeInPlace
};

enum ToolStatus
{
Inactive,
Active,
ActiveUntilMouseRelease
};

QgsComposerView( QWidget* parent = 0, const char* name = 0, Qt::WFlags f = 0 );
Expand All @@ -46,6 +68,24 @@ class QgsComposerView: QGraphicsView
/**Ungroups the selected items*/
void ungroupItems();

/**Cuts or copies the selected items*/
void copyItems( ClipboardMode mode );

/**Pastes items from clipboard*/
void pasteItems( PasteMode mode );

/**Deletes selected items*/
void deleteSelectedItems();

/**Selects all items*/
void selectAll();

/**Deselects all items*/
void selectNone();

/**Inverts current selection*/
void selectInvert();

QgsComposerView::Tool currentTool() const;
void setCurrentTool( QgsComposerView::Tool t );

Expand All @@ -66,13 +106,17 @@ class QgsComposerView: QGraphicsView
void setHorizontalRuler( QgsComposerRuler* r );
void setVerticalRuler( QgsComposerRuler* r );

/**Set zoom level, where a zoom level of 1.0 corresponds to 100%*/
void setZoomLevel( double zoomLevel );

protected:
void mousePressEvent( QMouseEvent* );
void mouseReleaseEvent( QMouseEvent* );
void mouseMoveEvent( QMouseEvent* );
void mouseDoubleClickEvent( QMouseEvent* e );

void keyPressEvent( QKeyEvent * e );
void keyReleaseEvent( QKeyEvent * e );

void wheelEvent( QWheelEvent* event );

Expand Down
4 changes: 3 additions & 1 deletion python/gui/qgsexpressionbuilderdialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class QgsExpressionBuilderDialog : QDialog
%End

public:
QgsExpressionBuilderDialog( QgsVectorLayer* layer, QString startText = QString(), QWidget* parent = NULL );
QgsExpressionBuilderDialog( QgsVectorLayer* layer, QString startText = QString(), QWidget* parent = NULL, QString key = "generic" );

/** The builder widget that is used by the dialog */
QgsExpressionBuilderWidget* expressionBuilder();
Expand All @@ -30,4 +30,6 @@ class QgsExpressionBuilderDialog : QDialog
* @param r result value (unused)
*/
virtual void done( int r );

virtual void accept();
};
2 changes: 2 additions & 0 deletions python/gui/qgshighlight.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class QgsHighlight : QgsMapCanvasItem
~QgsHighlight();

void setColor( const QColor & color );

/** Set width. Ignored in feature mode. */
void setWidth( int width );

protected:
Expand Down
1 change: 1 addition & 0 deletions python/gui/qgsmanageconnectionsdialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ class QgsManageConnectionsDialog : QDialog
void doExportImport();
void selectAll();
void clearSelection();
void selectionChanged();
};
4 changes: 2 additions & 2 deletions python/gui/qgsmaptoolidentify.sip
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class QgsMapToolIdentify : QgsMapTool
@param layerList Performs the identification within the given list of layers. Default value is an empty list, i.e. uses all the layers.
@param mode Identification mode. Can use Qgis default settings or a defined mode. Default mode is DefaultQgsSetting.
@return a list of IdentifyResult*/
QList<QgsMapToolIdentify::IdentifyResult> identify(int x, int y, QList<QgsMapLayer*> layerList = QList<QgsMapLayer*>(), IdentifyMode mode = DefaultQgsSetting);
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, QList<QgsMapLayer*> layerList = QList<QgsMapLayer*>(), IdentifyMode mode = DefaultQgsSetting );

/** Performs the identification.
To avoid beeing forced to specify IdentifyMode with a list of layers
Expand All @@ -75,7 +75,7 @@ class QgsMapToolIdentify : QgsMapTool
@param mode Identification mode. Can use Qgis default settings or a defined mode.
@param layerType Only performs identification in a certain type of layers (raster, vector). Default value is AllLayers.
@return a list of IdentifyResult*/
QList<QgsMapToolIdentify::IdentifyResult> identify(int x, int y, IdentifyMode mode, LayerType layerType = AllLayers);
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, IdentifyMode mode, LayerType layerType = AllLayers );

public slots:
void formatChanged( QgsRasterLayer *layer );
Expand Down
2 changes: 2 additions & 0 deletions python/gui/qgsnewhttpconnection.sip
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ class QgsNewHttpConnection : QDialog

void on_txtName_textChanged( const QString & );

void on_txtUrl_textChanged( const QString & );

void on_buttonBox_helpRequested();
};
10 changes: 8 additions & 2 deletions python/gui/qgsoptionsdialogbase.sip
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ class QgsOptionsDialogBase : QDialog

/** Set up the base ui connections for vertical tabs.
* @param restoreUi Whether to restore the base ui at this time.
* @param title the window title
*/
void initOptionsBase( bool restoreUi = true );
void initOptionsBase( bool restoreUi = true, QString title = QString() );

/** Restore the base ui.
* Sometimes useful to do at end of subclass's constructor.
* @param title the window title (it does not need to be defined if previously given to initOptionsBase();
*/
void restoreOptionsBaseUi();
void restoreOptionsBaseUi( QString title = QString() );

/** determine if the options list is in icon only mode
*/
bool iconOnly();

protected slots:
void updateOptionsListVerticalTabs();
Expand Down
1 change: 1 addition & 0 deletions python/gui/qgsrasterlayersaveasdialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class QgsRasterLayerSaveAsDialog : QDialog
QgsRaster::RasterBuildPyramids buildPyramidsFlag() const;
QString pyramidsResamplingMethod() const;
QgsRaster::RasterPyramidsFormat pyramidsFormat() const;

QStringList pyramidsConfigOptions() const;

void hideFormat();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class QgsCategorizedSymbolRendererV2Widget : QgsRendererV2Widget
void addCategories();
void deleteCategories();
void deleteAllCategories();
void setExpression();

void rotationFieldChanged( QString fldName );
void sizeScaleFieldChanged( QString fldName );
Expand Down Expand Up @@ -53,5 +54,7 @@ class QgsCategorizedSymbolRendererV2Widget : QgsRendererV2Widget
void changeCategorySymbol();

QList<QgsSymbolV2*> selectedSymbols();
QgsCategoryList selectedCategoryList();
void refreshSymbolView();
void keyPressEvent( QKeyEvent* event );
};
4 changes: 4 additions & 0 deletions python/gui/symbology-ng/qgscolorrampcombobox.sip
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class QgsColorRampComboBox : QComboBox
//! return new instance of the current color ramp or NULL if there is no active color ramp
QgsVectorColorRampV2* currentColorRamp();

static QSize rampIconSize;

This comment has been minimized.

Copy link
@slarosa

slarosa Jan 27, 2014

Member

@jef-n is this necessary for python bindings?
I am getting the following build error:

[ 92%] Building CXX object python/CMakeFiles/python_module_qgis_gui.dir/gui/sipguipart0.cpp.o
/home/sam/pacchetti_gis/QGIS/build-master/python/gui/sipguipart0.cpp: In function ‘PyObject* varget_QgsColorRampComboBox_rampIconSize(void*, PyObject*)’:
/home/sam/pacchetti_gis/QGIS/build-master/python/gui/sipguipart0.cpp:43571:65: error: ‘sipSelf’ was not declared in this scope
make[2]: *** [python/CMakeFiles/python_module_qgis_gui.dir/gui/sipguipart0.cpp.o] Error 1
make[1]: *** [python/CMakeFiles/python_module_qgis_gui.dir/all] Error 2
make: *** [all] Error 2

void setShowGradientOnly( bool gradientOnly );

public slots:
void colorRampChanged( int index );
};
6 changes: 6 additions & 0 deletions python/gui/symbology-ng/qgsdatadefinedsymboldialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ class QgsDataDefinedSymbolDialog : QDialog
static QString colorHelpText();
static QString offsetHelpText();
static QString fileNameHelpText();
static QString horizontalAnchorHelpText();
static QString verticalAnchorHelpText();
static QString gradientTypeHelpText();
static QString gradientCoordModeHelpText();
static QString gradientSpreadHelpText();
static QString boolHelpText();
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class QgsGraduatedSymbolRendererV2Widget : QgsRendererV2Widget
public slots:
void changeGraduatedSymbol();
void graduatedColumnChanged();
void setExpression();
void classifyGraduated();
void reapplyColorRamp();
void rangesDoubleClicked( const QModelIndex & idx );
Expand Down Expand Up @@ -42,6 +43,7 @@ class QgsGraduatedSymbolRendererV2Widget : QgsRendererV2Widget

//! return a list of indexes for the classes under selection
QList<int> selectedClasses();
QgsRangeList selectedRanges();

//! populate column combos in categorized and graduated page
void populateColumns();
Expand All @@ -54,4 +56,6 @@ class QgsGraduatedSymbolRendererV2Widget : QgsRendererV2Widget
QList<QgsSymbolV2*> selectedSymbols();
QgsSymbolV2* findSymbolForRange( double lowerBound, double upperBound, const QgsRangeList& ranges ) const;
void refreshSymbolView();

void keyPressEvent( QKeyEvent* event );
};
4 changes: 4 additions & 0 deletions python/gui/symbology-ng/qgsrendererv2widget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ class QgsRendererV2Widget : QWidget
void changeSymbolWidth();
/**Change marker sizes of selected symbols*/
void changeSymbolSize();

virtual void copy();
virtual void paste();

};
12 changes: 11 additions & 1 deletion python/gui/symbology-ng/qgsrulebasedrendererv2widget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ class QgsRuleBasedRendererV2Model : QAbstractItemModel

void insertRule( const QModelIndex& parent, int before, QgsRuleBasedRendererV2::Rule* newrule );
void updateRule( const QModelIndex& parent, int row );
// update rule and all its descendants
void updateRule( const QModelIndex& index );
void removeRule( const QModelIndex& index );

void willAddRules( const QModelIndex& parent, int count ); // call beginInsertRows
void finishedAddingRules(); // call endInsertRows

//! @note not available in python bindungs
// void setFeatureCounts( QMap<QgsRuleBasedRendererV2::Rule*, QgsRuleBasedRendererV2Count> theCountMap );
void clearFeatureCounts();

};

class QgsRuleBasedRendererV2Widget : QgsRendererV2Widget
Expand All @@ -62,6 +69,8 @@ class QgsRuleBasedRendererV2Widget : QgsRendererV2Widget
void editRule();
void editRule( const QModelIndex& index );
void removeRule();
void countFeatures();
void clearFeatureCounts();

void refineRuleScales();
void refineRuleCategories();
Expand All @@ -75,7 +84,6 @@ class QgsRuleBasedRendererV2Widget : QgsRendererV2Widget
void restoreSectionWidths();

protected:

void refineRule( int type );
void refineRuleCategoriesGui( const QModelIndexList& index );
void refineRuleRangesGui( const QModelIndexList& index );
Expand All @@ -84,7 +92,9 @@ class QgsRuleBasedRendererV2Widget : QgsRendererV2Widget
QgsRuleBasedRendererV2::Rule* currentRule();

QList<QgsSymbolV2*> selectedSymbols();
QList<QgsRuleBasedRendererV2::Rule*> selectedRules();
void refreshSymbolView();
void keyPressEvent( QKeyEvent* event );
};

///////
Expand Down
8 changes: 8 additions & 0 deletions python/gui/symbology-ng/qgssymbollayerv2widget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ class QgsSimpleMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index );
void on_mDataDefinedPropertiesButton_clicked();
void on_mOutlineStyleComboBox_currentIndexChanged( int index );
void on_mOutlineWidthSpinBox_valueChanged( double d );
void on_mHorizontalAnchorComboBox_currentIndexChanged( int index );
void on_mVerticalAnchorComboBox_currentIndexChanged( int index );
};

///////////
Expand Down Expand Up @@ -173,6 +176,9 @@ class QgsSvgMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void on_mBorderWidthUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mDataDefinedPropertiesButton_clicked();
void on_mHorizontalAnchorComboBox_currentIndexChanged( int index );
void on_mVerticalAnchorComboBox_currentIndexChanged( int index );


protected:

Expand Down Expand Up @@ -261,6 +267,8 @@ class QgsFontMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget
void setOffset();
void on_mSizeUnitComboBox_currentIndexChanged( int index );
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
void on_mHorizontalAnchorComboBox_currentIndexChanged( int index );
void on_mVerticalAnchorComboBox_currentIndexChanged( int index );
};

//////////
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
typedef void XEvent;
#endif

class CORE_EXPORT QgsApplication: public QApplication
class CORE_EXPORT QgsApplication : public QApplication
{
Q_OBJECT
public:
Expand Down
4 changes: 3 additions & 1 deletion src/core/qgscoordinatetransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
* @param theCRSID - A long representing the srsid of the srs to be used */
void setDestCRSID( long theCRSID );

/**Returns list of datum transformations for the given src and dest CRS*/
/**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 QString datumTransformString( int datumTransform );
/**Gets name of source and dest geographical CRS (to show in a tooltip)
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsdbfilterproxymodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class CORE_EXPORT QgsDbFilterProxyModel: public QSortFilterProxyModel
public:
QgsDbFilterProxyModel( QObject* parent = 0 );
~QgsDbFilterProxyModel();
void setFilterEnabled( bool );
/**Calls QSortFilterProxyModel::setFilterWildcard and triggers update*/
void _setFilterWildcard( const QString& pattern );
/**Calls QSortFilterProxyModel::setFilterRegExp and triggers update*/
Expand Down
Loading