Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9128 from m-kuhn/todo-qgis-4
Move QGIS 3 todos to QGIS 4
  • Loading branch information
m-kuhn committed Feb 8, 2019
2 parents 440f8d4 + 2fb3704 commit 09407c1
Show file tree
Hide file tree
Showing 19 changed files with 186 additions and 49 deletions.
15 changes: 15 additions & 0 deletions python/core/auto_generated/geometry/qgsgeometry.sip.in
Expand Up @@ -499,7 +499,22 @@ In case of error -1 will be returned.
.. versionadded:: 3.0
%End


QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex /Out/, int &beforeVertex /Out/, int &afterVertex /Out/, double &sqrDist /Out/ ) const;
%Docstring
Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point
and the indices of the vertices before and after the closest vertex.

:param point: point to search for
:param beforeVertex: will be set to the vertex index of the previous vertex from the closest one. Will be set to -1 if
not present.
:param afterVertex: will be set to the vertex index of the next vertex after the closest one. Will be set to -1 if
not present.
:param sqrDist: will be set to the square distance between the closest vertex and the specified point

:return: - closest point in geometry. If not found (empty geometry), returns null point nad sqrDist is negative.
- atVertex: will be set to the vertex index of the closest found vertex
%End

double distanceToVertex( int vertex ) const;
%Docstring
Expand Down
14 changes: 7 additions & 7 deletions python/core/auto_generated/qgscoordinatereferencesystem.sip.in
Expand Up @@ -175,6 +175,7 @@ Constructs an invalid CRS object

~QgsCoordinateReferenceSystem();


explicit QgsCoordinateReferenceSystem( const QString &definition );
%Docstring
Constructs a CRS object from a string definition using createFromString()
Expand All @@ -191,9 +192,9 @@ If no prefix is specified, WKT definition is assumed.
:param definition: A String containing a coordinate reference system definition.

.. seealso:: :py:func:`createFromString`
/ // TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix
%End


explicit QgsCoordinateReferenceSystem( long id, CrsType type = PostgisCrsId );
%Docstring
Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS CRS ID.
Expand All @@ -205,7 +206,6 @@ Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS

:param id: The ID valid for the chosen CRS ID type
:param type: One of the types described in CrsType
/ // TODO QGIS 3: remove type and always use EPSG code
%End

QgsCoordinateReferenceSystem( const QgsCoordinateReferenceSystem &srs );
Expand Down Expand Up @@ -294,6 +294,7 @@ Creates a CRS from a specified QGIS SRS ID.
%End



bool createFromId( long id, CrsType type = PostgisCrsId );
%Docstring
Sets this CRS by lookup of the given ID in the CRS database.
Expand All @@ -304,9 +305,9 @@ Sets this CRS by lookup of the given ID in the CRS database.

We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
/ // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
%End


bool createFromOgcWmsCrs( const QString &crs );
%Docstring
Sets this CRS to the given OGC WMS-format Coordinate Reference Systems.
Expand All @@ -322,17 +323,16 @@ and refer to QGIS internal CRS IDs.
this method uses an internal cache. Call invalidateCache() to clear the cache.

.. seealso:: :py:func:`fromOgcWmsCrs`
/ // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
%End


bool createFromSrid( long srid );
%Docstring
Sets this CRS by lookup of the given PostGIS SRID in the CRS database.

:param srid: The PostGIS SRID for the desired spatial reference system.

:return: True on success else false
/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
%End

bool createFromWkt( const QString &wkt );
Expand Down Expand Up @@ -489,6 +489,7 @@ if that involves resorting to a hard coded default of geocs:wgs84.
.. seealso:: :py:func:`setCustomCrsValidation`
%End


long findMatchingProj();
%Docstring
Walks the CRS databases (both system and user database) trying to match
Expand All @@ -500,7 +501,6 @@ pieces of information about CRS.
The ellipsoid and projection acronyms must be set as well as the proj4string!

:return: long the SrsId of the matched CRS, zero if no match was found
/ // TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4)
%End

bool operator==( const QgsCoordinateReferenceSystem &srs ) const;
Expand Down Expand Up @@ -538,12 +538,12 @@ Returns the internal CRS ID, if available.
:return: the internal sqlite3 srs.db primary key for this CRS
%End


long postgisSrid() const;
%Docstring
Returns PostGIS SRID for the CRS.

:return: the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0)
/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
%End

QString authid() const;
Expand Down
4 changes: 4 additions & 0 deletions python/core/auto_generated/qgspallabeling.sip.in
Expand Up @@ -54,6 +54,7 @@ class QgsPalLayerSettings
~QgsPalLayerSettings();



enum Placement
{
AroundPoint,
Expand Down Expand Up @@ -82,12 +83,14 @@ class QgsPalLayerSettings
BottomRight,
};


enum OffsetType
{
FromPoint,
FromSymbolBounds,
};


enum LinePlacementFlags
{
OnLine,
Expand Down Expand Up @@ -131,6 +134,7 @@ class QgsPalLayerSettings
MultiFollowPlacement
};


enum ObstacleType
{
PolygonInterior,
Expand Down
24 changes: 24 additions & 0 deletions python/core/auto_generated/qgsproject.sip.in
Expand Up @@ -844,7 +844,24 @@ of any layers these layers will also be deleted.
.. versionadded:: 1.8
%End


void removeMapLayers( const QList<QgsMapLayer *> &layers );
%Docstring
Remove a set of layers from the registry.

The specified layers will be removed from the registry. If the registry has ownership
of any layers these layers will also be deleted.

:param layers: A list of layers to remove. Null pointers are ignored.

.. note::

As a side-effect the QgsProject instance is marked dirty.

.. seealso:: :py:func:`removeMapLayer`

.. seealso:: :py:func:`removeAllMapLayers`
%End

void removeMapLayer( const QString &layerId );
%Docstring
Expand Down Expand Up @@ -1323,7 +1340,14 @@ Emitted after a layer was removed from the registry.
.. seealso:: :py:func:`layerWillBeRemoved`
%End


void removeAll();
%Docstring
Emitted when all layers are removed, before layersWillBeRemoved() and
layerWillBeRemoved() signals are emitted. The layersWillBeRemoved() and
layerWillBeRemoved() signals will still be emitted following this signal.
You can use this signal to do easy (and fast) cleanup.
%End

void layersAdded( const QList<QgsMapLayer *> &layers );
%Docstring
Expand Down
15 changes: 5 additions & 10 deletions python/core/auto_generated/qgsvectorlayertools.sip.in
Expand Up @@ -27,6 +27,7 @@ in your application.
public:
QgsVectorLayerTools();


virtual bool addFeature( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature /Out/ = 0 ) const = 0;
%Docstring
This method should/will be called, whenever a new feature will be added to the layer
Expand All @@ -37,10 +38,9 @@ This method should/will be called, whenever a new feature will be added to the l

:return: - True in case of success, False if the operation failed/was aborted
- feature: Updated feature after adding will be written back to this

TODO QGIS 3: remove const qualifier
%End


virtual bool startEditing( QgsVectorLayer *layer ) const = 0;
%Docstring
This will be called, whenever a vector layer should be switched to edit mode. Check the providers
Expand All @@ -50,10 +50,9 @@ If successful layer->startEditing() will be called and true returned.
:param layer: The layer on which to start an edit session

:return: True, if the editing session was started

TODO QGIS 3: remove const qualifier
%End


virtual bool stopEditing( QgsVectorLayer *layer, bool allowCancel = true ) const = 0;
%Docstring
Will be called, when an editing session is ended and the features should be committed.
Expand All @@ -63,21 +62,19 @@ Appropriate dialogs should be shown like
:param allowCancel: True if a cancel button should be offered

:return: True if successful

TODO QGIS 3: remove const qualifier
%End


virtual bool saveEdits( QgsVectorLayer *layer ) const = 0;
%Docstring
Should be called, when the features should be committed but the editing session is not ended.

:param layer: The layer to commit

:return: True if successful

TODO QGIS 3: remove const qualifier
%End


virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request /In,Out/, double dx = 0, double dy = 0, QString *errorMsg /Out/ = 0 ) const;
%Docstring
Copy and move features with defined translation.
Expand All @@ -89,8 +86,6 @@ Copy and move features with defined translation.

:return: - True if all features could be copied.
- errorMsg: If given, it will contain the error message

TODO QGIS 3: remove const qualifier
%End

};
Expand Down
Expand Up @@ -215,7 +215,11 @@ to dynamically adjust it.
:param request: The request to use to fill this table model.
%End


const QgsFeatureRequest &request() const;
%Docstring
Gets the the feature request
%End

void setEditorContext( const QgsAttributeEditorContext &context );
%Docstring
Expand Down
21 changes: 21 additions & 0 deletions python/gui/auto_generated/qgsattributeform.sip.in
Expand Up @@ -44,11 +44,32 @@ class QgsAttributeForm : QWidget

const QgsFeature &feature();


void hideButtonBox();
%Docstring
Hides the button box (OK/Cancel) and enables auto-commit

.. note::

set Embed in QgsAttributeEditorContext in constructor instead
%End


void showButtonBox();
%Docstring
Shows the button box (OK/Cancel) and disables auto-commit

.. note::

set Embed in QgsAttributeEditorContext in constructor instead
%End


void disconnectButtonBox();
%Docstring
Disconnects the button box (OK/Cancel) from the accept/resetValues slots
If this method is called, you have to create these connections from outside
%End

void addInterface( QgsAttributeFormInterface *iface /Transfer/ );
%Docstring
Expand Down
40 changes: 40 additions & 0 deletions python/gui/auto_generated/qgsmaptoolcapture.sip.in
Expand Up @@ -96,11 +96,45 @@ convenient method to clean members

protected:


int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );
%Docstring
Converts a map point to layer coordinates

:param mapPoint: the point in map coordinates
\param[in,out] layerPoint the point in layer coordinates

:return:
0 in case of success
1 if the current layer is null or not a vector layer
2 if the transformation failed
%End


int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint );
%Docstring
Converts a point to map coordinates and layer coordinates

:param p: the input point
\param[in,out] layerPoint the point in layer coordinates
\param[in,out] mapPoint the point in map coordinates

:return:
0 in case of success
1 if the current layer is null or not a vector layer
2 if the transformation failed
%End


int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint );
%Docstring
Fetches the original point from the source layer if it has the same
CRS as the current layer.

:return: 0 in case of success, 1 if not applicable (CRS mismatch), 2 in case of failure

.. versionadded:: 2.14
%End

QgsPoint mapPoint( const QgsMapMouseEvent &e ) const;
%Docstring
Expand Down Expand Up @@ -129,7 +163,13 @@ WkbType of the current layer).
.. versionadded:: 3.0
%End


int addVertex( const QgsPointXY &point );
%Docstring
Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates)

:return: 0 in case of success, 1 if current layer is not a vector layer, 2 if coordinate transformation failed
%End

int addVertex( const QgsPointXY &mapPoint, const QgsPointLocator::Match &match );
%Docstring
Expand Down
3 changes: 2 additions & 1 deletion src/core/geometry/qgsgeometry.h
Expand Up @@ -576,6 +576,8 @@ class CORE_EXPORT QgsGeometry
*/
double hausdorffDistanceDensify( const QgsGeometry &geom, double densifyFraction ) const;

//TODO QGIS 4.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex

/**
* Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point
* and the indices of the vertices before and after the closest vertex.
Expand All @@ -588,7 +590,6 @@ class CORE_EXPORT QgsGeometry
* \param sqrDist will be set to the square distance between the closest vertex and the specified point
* \returns closest point in geometry. If not found (empty geometry), returns null point nad sqrDist is negative.
*/
//TODO QGIS 3.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex
QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex SIP_OUT, int &beforeVertex SIP_OUT, int &afterVertex SIP_OUT, double &sqrDist SIP_OUT ) const;

/**
Expand Down

0 comments on commit 09407c1

Please sign in to comment.