Skip to content

Commit

Permalink
Update SIP for fixedAspectRatio in SVG marker
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Sep 28, 2017
1 parent 48514d2 commit 954d62f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
43 changes: 42 additions & 1 deletion python/core/symbology/qgsmarkersymbollayer.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -522,23 +522,64 @@ Constructs SVG marker symbol layer with picture from given absolute path to a SV


QString path() const; QString path() const;
%Docstring %Docstring
Returns the marker SVG path.
.. seealso:: setPath()
:rtype: str :rtype: str
%End %End

void setPath( const QString &path ); void setPath( const QString &path );
%Docstring
Set the marker SVG path.
\param path SVG path
.. seealso:: path()
%End


double defaultAspectRatio() const; double defaultAspectRatio() const;
%Docstring %Docstring
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
.. seealso:: updateDefaultAspectRatio()
:rtype: float :rtype: float
%End %End

double updateDefaultAspectRatio(); double updateDefaultAspectRatio();
%Docstring %Docstring
Calculates the default marker aspect ratio between width and height.
:return: the default aspect ratio value
.. seealso:: defaultAspectRatio()
:rtype: float :rtype: float
%End %End

bool preservedAspectRatio() const;
%Docstring
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
.. seealso:: setPreservedAspectRatio()
:rtype: bool
%End

bool setPreservedAspectRatio( bool par );
%Docstring
Set preserved the marker aspect ratio between width and height.
\param par Preserved Aspect Ratio
:return: the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0
.. seealso:: preservedAspectRatio()
:rtype: bool
%End

double fixedAspectRatio() const; double fixedAspectRatio() const;
%Docstring %Docstring
Returns the marker aspect ratio between width and height to be used in rendering,
if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
.. seealso:: setFixedAspectRatio() QgsSvgCache
:rtype: float :rtype: float
%End %End
void setFixedAspectRatio( double far );
void setFixedAspectRatio( double ratio );
%Docstring
Set the marker aspect ratio between width and height to be used in rendering,
if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
\param ratio Fixed Aspect Ratio
.. seealso:: fixedAspectRatio() QgsSvgCache
%End


virtual QColor fillColor() const; virtual QColor fillColor() const;
virtual void setFillColor( const QColor &color ); virtual void setFillColor( const QColor &color );
Expand Down
4 changes: 4 additions & 0 deletions python/core/symbology/qgssvgcache.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
\param strokeWidth width of stroke \param strokeWidth width of stroke
\param widthScaleFactor width scale factor \param widthScaleFactor width scale factor
\param fitsInCache \param fitsInCache
\param fixedAspectRatio fixed aspect ratio (optional)
:rtype: QImage :rtype: QImage
%End %End


Expand All @@ -123,6 +124,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
\param strokeWidth width of stroke \param strokeWidth width of stroke
\param widthScaleFactor width scale factor \param widthScaleFactor width scale factor
\param forceVectorOutput \param forceVectorOutput
\param fixedAspectRatio fixed aspect ratio (optional)
:rtype: QPicture :rtype: QPicture
%End %End


Expand All @@ -136,6 +138,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
\param stroke color of stroke \param stroke color of stroke
\param strokeWidth width of stroke \param strokeWidth width of stroke
\param widthScaleFactor width scale factor \param widthScaleFactor width scale factor
\param fixedAspectRatio fixed aspect ratio (optional)
:return: viewbox size set in SVG file :return: viewbox size set in SVG file
.. versionadded:: 2.14 .. versionadded:: 2.14
:rtype: QSizeF :rtype: QSizeF
Expand Down Expand Up @@ -209,6 +212,7 @@ Emit a signal to be caught by qgisapp and display a msg on status bar
\param stroke color of stroke \param stroke color of stroke
\param strokeWidth width of stroke \param strokeWidth width of stroke
\param widthScaleFactor width scale factor \param widthScaleFactor width scale factor
\param fixedAspectRatio fixed aspect ratio (optional)
:rtype: QgsSvgCacheEntry :rtype: QgsSvgCacheEntry
%End %End


Expand Down
5 changes: 0 additions & 5 deletions python/gui/symbology/qgssymbollayerwidget.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -364,11 +364,6 @@ class QgsSvgMarkerSymbolLayerWidget : QgsSymbolLayerWidget
public slots: public slots:
void setName( const QModelIndex &idx ); void setName( const QModelIndex &idx );
void populateIcons( const QModelIndex &idx ); void populateIcons( const QModelIndex &idx );
void setWidth();
void setHeight();
void stateChangedAspectRatio();
void setAngle();
void setOffset();
void on_mFileToolButton_clicked(); void on_mFileToolButton_clicked();
void on_mFileLineEdit_textEdited( const QString &text ); void on_mFileLineEdit_textEdited( const QString &text );
void on_mFileLineEdit_editingFinished(); void on_mFileLineEdit_editingFinished();
Expand Down

0 comments on commit 954d62f

Please sign in to comment.