Skip to content

Commit

Permalink
update sip bindings II
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 27, 2014
1 parent 08405c5 commit 74e7314
Show file tree
Hide file tree
Showing 188 changed files with 1,502 additions and 547 deletions.
4 changes: 4 additions & 0 deletions python/analysis/interpolation/Bezier3D.sip
Expand Up @@ -8,6 +8,7 @@ class Bezier3D : ParametricLine
/**Default constructor*/
Bezier3D();
/**Constructor, par is a pointer to the parent, controlpoly a controlpolygon*/
//! @note not available in python binding
// Bezier3D( ParametricLine* par, QVector<Point3D*>* controlpoly );
/**Destructor*/
virtual ~Bezier3D();
Expand All @@ -29,6 +30,7 @@ class Bezier3D : ParametricLine
/**Returns a control point*/
virtual const Point3D* getControlPoint( int number ) const;
/**Returns a pointer to the control polygon*/
//! @note not available in python binding
// virtual const QVector<Point3D*>* getControlPoly() const;
/**Returns the degree of the curve*/
virtual int getDegree() const;
Expand All @@ -37,5 +39,7 @@ class Bezier3D : ParametricLine
/** Sets the parent*/
virtual void setParent( ParametricLine* par );
/**Sets the control polygon*/
//! @note not available in python binding
// virtual void setControlPoly( QVector<Point3D*>* cp );

};
2 changes: 2 additions & 0 deletions python/analysis/interpolation/ParametricLine.sip
Expand Up @@ -19,11 +19,13 @@ class ParametricLine
virtual void changeDirection() = 0;
//virtual void draw(QPainter* p);
virtual const Point3D* getControlPoint( int number ) const = 0;
//! @note not available in python binding
// virtual const QVector<Point3D*>* getControlPoly() const = 0;
virtual int getDegree() const = 0;
virtual ParametricLine* getParent() const = 0;
//virtual bool intersects(ParametricLine* pal);
virtual void remove( int i ) = 0;
//! @note not available in python binding
//virtual void setControlPoly( QVector<Point3D*>* cp ) = 0;
virtual void setParent( ParametricLine* paral ) = 0;
};
1 change: 1 addition & 0 deletions python/analysis/interpolation/TriDecorator.sip
Expand Up @@ -19,6 +19,7 @@ class TriDecorator : Triangulation
virtual bool calcPoint( double x, double y, Point3D* result );
virtual Point3D* getPoint( unsigned int i ) const;
virtual int getNumberOfPoints() const;
//! @note not available in python bindings
// bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 );
bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 );
virtual int getOppositePoint( int p1, int p2 );
Expand Down
1 change: 1 addition & 0 deletions python/analysis/interpolation/Triangulation.sip
Expand Up @@ -21,6 +21,7 @@ class Triangulation
/**Returns a pointer to the point with number i. Any virtual points must have the number -1*/
virtual Point3D* getPoint( unsigned int i ) const = 0;
/**Finds out, in which triangle the point with coordinates x and y is and assigns the numbers of the vertices to 'n1', 'n2' and 'n3' and the vertices to 'p1', 'p2' and 'p3'*/
//! @note not available in python binding
// virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ) = 0;
/**Finds out, in which triangle the point with coordinates x and y is and assigns the points at the vertices to 'p1', 'p2' and 'p3*/
virtual bool getTriangle( double x, double y, Point3D* p1 /Out/, Point3D* p2 /Out/, Point3D* p3 /Out/ ) = 0;
Expand Down
2 changes: 1 addition & 1 deletion python/analysis/network/qgsgraphanalyzer.sip
Expand Up @@ -10,7 +10,7 @@ class QgsGraphAnalyzer
* @param source The source graph
* @param startVertexIdx index of start vertex
* @param criterionNum index of arc property as optimization criterion
* @param treeResult array represents the shortest path tree. resultTree[ vertexIndex ] == inboundingArcIndex if vertex reacheble and resultTree[ vertexIndex ] == -1 others.
* @param resultTree array represents the shortest path tree. resultTree[ vertexIndex ] == inboundingArcIndex if vertex reacheble and resultTree[ vertexIndex ] == -1 others.
* @param resultCost array of cost paths
*/
static SIP_PYLIST dijkstra( const QgsGraph* source, int startVertexIdx, int criterionNum );
Expand Down
2 changes: 1 addition & 1 deletion python/analysis/network/qgslinevectorlayerdirector.sip
Expand Up @@ -18,7 +18,7 @@ class QgsLineVectorLayerDirector : QgsGraphDirector
* @param bothDirectionValue value for road
* @param defaultDirection 1 - direct direction, 2 - reverse direction, 3 - both direction
*/
QgsLineVectorLayerDirector( QgsVectorLayer* vl,
QgsLineVectorLayerDirector( QgsVectorLayer* myLayer,
int directionFieldId,
const QString& directDirectionValue,
const QString& reverseDirectionValue,
Expand Down
3 changes: 3 additions & 0 deletions python/analysis/raster/qgsrastermatrix.sip
Expand Up @@ -37,6 +37,7 @@ class QgsRasterMatrix

/**Takes ownership of data array*/
QgsRasterMatrix();
//! @note note available in python bindings
// QgsRasterMatrix( int nCols, int nRows, float* data, double nodataValue );
QgsRasterMatrix( const QgsRasterMatrix& m );
~QgsRasterMatrix();
Expand All @@ -46,8 +47,10 @@ class QgsRasterMatrix
double number() const;

/**Returns data array (but not ownership)*/
//! @note not available in python bindings
// float* data();
/**Returns data and ownership. Sets data and nrows, ncols of this matrix to 0*/
//! @note not available in python bindings
// float* takeData();

void setData( int cols, int rows, float* data, double nodataValue );
Expand Down
13 changes: 6 additions & 7 deletions python/analysis/vector/qgspointsample.sip
Expand Up @@ -6,12 +6,11 @@ class QgsPointSample
%TypeHeaderCode
#include <qgspointsample.h>
%End
public:
QgsPointSample( QgsVectorLayer* inputLayer, const QString& outputLayer, QString nPointsAttribute, QString minDistAttribute = QString() );
~QgsPointSample();

public:
QgsPointSample( QgsVectorLayer* inputLayer, const QString& outputLayer, QString nPointsAttribute, QString minDistAttribute = QString() );
~QgsPointSample();

/**Starts calculation of random points
@return 0 in case of success*/
int createRandomPoints( QProgressDialog* pd );
/**Starts calculation of random points
@return 0 in case of success*/
int createRandomPoints( QProgressDialog* pd );
};
4 changes: 1 addition & 3 deletions python/analysis/vector/qgszonalstatistics.sip
Expand Up @@ -10,9 +10,7 @@ class QgsZonalStatistics
%End

public:

QgsZonalStatistics( QgsVectorLayer* polygonLayer, const QString& rasterFile,
const QString& attributePrefix = "", int rasterBand = 1 );
QgsZonalStatistics( QgsVectorLayer* polygonLayer, const QString& rasterFile, const QString& attributePrefix = "", int rasterBand = 1 );
~QgsZonalStatistics();

/**Starts the calculation
Expand Down
32 changes: 18 additions & 14 deletions python/core/composer/qgsatlascomposition.sip
Expand Up @@ -23,7 +23,7 @@ public:
QgsComposerMap* composerMap() const;
/**Sets the map used by the atlas
* @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead
*/
*/
void setComposerMap( QgsComposerMap* map );

bool hideCoverage() const;
Expand All @@ -35,7 +35,7 @@ public:
bool fixedScale() const;
/**Sets whether the atlas map should use a fixed scale
* @deprecated Use QgsComposerMap::setAtlasFixedScale( bool ) instead
*/
*/
void setFixedScale( bool fixed );

/**Returns the margin for the atlas map
Expand All @@ -44,7 +44,7 @@ public:
float margin() const;
/**Sets the margin for the atlas map
* @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead
*/
*/
void setMargin( float margin );

QString filenamePattern() const;
Expand All @@ -71,8 +71,9 @@ public:
int sortKeyAttributeIndex() const;
void setSortKeyAttributeIndex( int idx );

/** Begins the rendering. */
void beginRender();
/** Begins the rendering. Returns true if successful, false if no matching atlas
features found.*/
bool beginRender();
/** Ends the rendering. Restores original extent */
void endRender();

Expand All @@ -87,7 +88,12 @@ public:

/** Returns the current filename. Must be called after prepareForFeature( i ) */
const QString& currentFilename() const;


void writeXML( QDomElement& elem, QDomDocument& doc ) const;
void readXML( const QDomElement& elem, const QDomDocument& doc );

QgsComposition* composition();

/** Requeries the current atlas coverage layer and applies filtering and sorting. Returns
number of matching features. Must be called after prepareForFeature( i ) */
int updateFeatures();
Expand All @@ -96,17 +102,12 @@ public:
void prevFeature();
void lastFeature();
void firstFeature();

/** Returns the current atlas feature. Must be called after prepareForFeature( i ). */
QgsFeature* currentFeature();

/** Recalculates the bounds of an atlas driven map */
void prepareMap( QgsComposerMap* map );

void writeXML( QDomElement& elem, QDomDocument& doc ) const;
void readXML( const QDomElement& elem, const QDomDocument& doc );

QgsComposition* composition();
/** Recalculates the bounds of an atlas driven map */
void prepareMap( QgsComposerMap* map );

signals:
/** emitted when one of the parameters changes */
Expand All @@ -115,6 +116,9 @@ public:
/** emitted when atlas is enabled or disabled */
void toggled( bool );

/**Is emitted when the atlas has an updated status bar message for the composer window*/
void statusMsgChanged( QString message );

/**Is emitted when the coverage layer for an atlas changes*/
void coverageLayerChanged( QgsVectorLayer* layer );

Expand Down
5 changes: 3 additions & 2 deletions python/core/composer/qgscomposerattributetable.sip
Expand Up @@ -15,6 +15,7 @@ class QgsComposerAttributeTableCompare
void setAscending( bool asc );
};

/**A table class that displays a vector attribute table*/
class QgsComposerAttributeTable : QgsComposerTable
{
%TypeHeaderCode
Expand Down Expand Up @@ -56,10 +57,10 @@ class QgsComposerAttributeTable : QgsComposerTable
void setSceneRect( const QRectF& rectangle );

// @note not available in python bindings
//void setSortAttributes( const QList<QPair<int, bool> > att );
// void setSortAttributes( const QList<QPair<int, bool> > att );

// @note not available in python bindings
//QList<QPair<int, bool> > sortAttributes() const;
// QList<QPair<int, bool> > sortAttributes() const;

protected:
virtual QMap<int, QString> getHeaderLabels() const;
Expand Down
39 changes: 26 additions & 13 deletions python/core/composer/qgscomposeritem.sip
@@ -1,7 +1,7 @@
/** \ingroup MapComposer
* A item that forms part of a map composition.
*/
class QgsComposerItem: QObject, QGraphicsRectItem
class QgsComposerItem : QObject, QGraphicsRectItem
{
%TypeHeaderCode
#include <qgscomposeritem.h>
Expand Down Expand Up @@ -154,7 +154,7 @@ class QgsComposerItem: QObject, QGraphicsRectItem
virtual void setSelected( bool s );

/** \brief Is selected */
virtual bool selected();
virtual bool selected() const;

/** stores state in project */
virtual bool writeSettings();
Expand Down Expand Up @@ -218,7 +218,7 @@ class QgsComposerItem: QObject, QGraphicsRectItem
* @note introduced since 1.8
* @see hasFrame
*/
bool hasFrame();
bool hasFrame() const;

/** Set whether this item has a frame drawn around it or not.
* @param drawFrame draw frame
Expand Down Expand Up @@ -339,7 +339,7 @@ class QgsComposerItem: QObject, QGraphicsRectItem
/**Returns the rotation for the composer item
* @deprecated Use itemRotation()
* instead
*/
*/
double rotation() const;

/**Updates item, with the possibility to do custom update for subclasses*/
Expand All @@ -361,13 +361,17 @@ class QgsComposerItem: QObject, QGraphicsRectItem
public slots:
/**Sets the item rotation
* @deprecated Use setItemRotation( double rotation ) instead
*/
*/
virtual void setRotation( double r );

/**Sets the item rotation
@param r item rotation in degrees
@param adjustPosition set to true if item should be shifted so that rotation occurs
around item center. If false, rotation occurs around item origin
@note this method was added in version 2.1
*/
virtual void setItemRotation( double r );
virtual void setItemRotation( double r, bool adjustPosition = false );

void repaint();

protected:
Expand Down Expand Up @@ -416,22 +420,31 @@ class QgsComposerItem: QObject, QGraphicsRectItem
* instead
*/
bool imageSizeConsideringRotation( double& width, double& height ) const;


/**Calculates the largest scaled version of originalRect which fits within boundsRect, when it is rotated by
* a specified amount
@param originalRect QRectF to be rotated and scaled
@param boundsRect QRectF specifying the bounds which the rotated and scaled rectangle must fit within
@param rotation the rotation in degrees to be applied to the rectangle
*/
QRectF largestRotatedRectWithinBounds( QRectF originalRect, QRectF boundsRect, double rotation ) const;

/**Calculates corner point after rotation and scaling*/
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation ) const;
/**Calculates corner point after rotation and scaling
* @deprecated Use bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height, double rotation )
* instead
*/
*/
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;

/**Calculates width / height of the bounding box of a rotated rectangle*/
void sizeChangedByRotation( double& width, double& height, double rotation );
/**Calculates width / height of the bounding box of a rotated rectangle
* @deprecated Use void sizeChangedByRotation( double& width, double& height, double rotation )
* instead
*/
/**Calculates width / height of the bounding box of a rotated rectangle
* @deprecated Use void sizeChangedByRotation( double& width, double& height, double rotation )
* instead
*/
void sizeChangedByRotation( double& width, double& height );

/**Rotates a point / vector
@param angle rotation angle in degrees, counterclockwise
@param x in/out: x coordinate before / after the rotation
Expand All @@ -447,7 +460,7 @@ class QgsComposerItem: QObject, QGraphicsRectItem
void deleteAlignItems();

signals:
/**Is emitted on rotation change to notify north arrow pictures*/
/**Is emitted on item rotation change*/
void itemRotationChanged( double newRotation );
/**Used e.g. by the item widgets to update the gui elements*/
void itemChanged();
Expand Down
2 changes: 0 additions & 2 deletions python/core/composer/qgscomposerlabel.sip
Expand Up @@ -64,8 +64,6 @@ class QgsComposerLabel : QgsComposerItem
@note: this function was added in version 1.4*/
QColor fontColor() const;

void setSceneRect( const QRectF& rectangle );

/** stores state in Dom element
* @param elem is Dom element corresponding to 'Composer' tag
* @param doc document
Expand Down
6 changes: 6 additions & 0 deletions python/core/composer/qgscomposerlegend.sip
Expand Up @@ -60,6 +60,12 @@ class QgsComposerLegend : QgsComposerItem
double symbolHeight() const;
void setSymbolHeight( double h );

double wmsLegendWidth() const;
void setWmsLegendWidth( double w );

double wmsLegendHeight() const;
void setWmsLegendHeight( double h );

void setWrapChar( const QString& t );
QString wrapChar() const;

Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposerlegenditem.sip
Expand Up @@ -34,7 +34,7 @@ class QgsComposerLegendItem : QStandardItem
// Get text defined by user
virtual QString userText() const;
// Set text defined by user
virtual void setUserText( const QString & text );
virtual void setUserText( const QString & text );
protected:
void writeXMLChildren( QDomElement& elem, QDomDocument& doc ) const;
};
Expand Down

0 comments on commit 74e7314

Please sign in to comment.