Skip to content
Permalink
Browse files

Merge pull request #7790 from m-kuhn/featureid

 Move QgsFeatureId to own header
  • Loading branch information
m-kuhn committed Sep 4, 2018
2 parents 8af1c3f + b85f1ed commit ded7978fabdbb00a2a79a6f544fa1a6faba8fa62
Showing with 105 additions and 66 deletions.
  1. +1 −1 python/core/auto_generated/qgsattributes.sip.in
  2. +0 −5 python/core/auto_generated/qgsfeature.sip.in
  3. +21 −0 python/core/auto_generated/qgsfeatureid.sip.in
  4. +1 −0 python/core/core_auto.sip
  5. +0 −1 python/gui/auto_generated/attributetable/qgsifeatureselectionmanager.sip.in
  6. +0 −1 src/analysis/network/qgsgraphbuilder.cpp
  7. +1 −2 src/analysis/vector/geometry_checker/qgsgeometrychecker.h
  8. +0 −1 src/app/qgsattributerelationedit.h
  9. +0 −1 src/app/qgsattributesforminitcode.h
  10. +2 −0 src/app/qgsmaptooldigitizefeature.h
  11. +1 −0 src/app/qgsmaptooloffsetcurve.h
  12. +1 −1 src/app/qgsmaptoolshowhidelabels.h
  13. +2 −1 src/app/qgsmaptoolsimplify.h
  14. +1 −1 src/app/vertextool/qgsselectedfeature.h
  15. +1 −0 src/core/CMakeLists.txt
  16. +1 −1 src/core/geometry/qgsgeometry.h
  17. +1 −1 src/core/geometry/qgsgeometryeditutils.h
  18. +0 −1 src/core/layout/qgslayoutrendercontext.cpp
  19. +3 −1 src/core/mesh/qgstriangularmesh.cpp
  20. +1 −0 src/core/mesh/qgstriangularmesh.h
  21. +1 −2 src/core/qgsattributes.h
  22. +1 −1 src/core/qgscacheindex.h
  23. +1 −16 src/core/qgsfeature.h
  24. +37 −0 src/core/qgsfeatureid.h
  25. +3 −1 src/core/qgspointlocator.h
  26. +1 −1 src/core/qgspropertytransformer.cpp
  27. +1 −2 src/core/qgsspatialindexkdbush.h
  28. +2 −1 src/core/qgsspatialindexkdbushdata.h
  29. +2 −1 src/core/qgstracer.h
  30. +1 −1 src/core/qgsvectorlayereditutils.h
  31. +1 −1 src/core/qgsvectorlayerrenderer.h
  32. +1 −1 src/gui/attributetable/qgsattributetableview.h
  33. +1 −1 src/gui/attributetable/qgsfeaturemodel.h
  34. +1 −1 src/gui/attributetable/qgsfeatureselectionmodel.h
  35. +1 −1 src/gui/attributetable/qgsgenericfeatureselectionmanager.h
  36. +1 −2 src/gui/attributetable/qgsifeatureselectionmanager.h
  37. +0 −1 src/gui/qgsexpressionbuilderwidget.h
  38. +2 −1 src/gui/qgsmapcanvas.h
  39. +1 −1 src/gui/qgsrubberband.cpp
  40. +0 −1 src/gui/qgsvariableeditorwidget.cpp
  41. +0 −1 src/plugins/geometry_checker/qgsgeometrycheckersetuptab.h
  42. +2 −1 src/plugins/globe/featuresource/qgsglobefeaturesource.h
  43. +1 −1 src/plugins/globe/globe_plugin.cpp
  44. +0 −1 src/plugins/grass/qgsgrassmodule.cpp
  45. +0 −1 src/plugins/grass/qgsgrassmoduleparam.h
  46. +2 −3 src/providers/arcgisrest/qgsarcgisrestutils.h
  47. +1 −1 src/providers/gpx/gpsdata.h
  48. +1 −0 src/providers/grass/qgsgrass.cpp
  49. +1 −1 src/providers/grass/qgsgrass.h
@@ -26,7 +26,7 @@ typedef QVector<QVariant> QgsAttributes;
%MappedType QgsAttributes
{
%TypeHeaderCode
#include <qgsfeature.h>
#include "qgsfeature.h"
%End

%ConvertFromTypeCode
@@ -14,8 +14,6 @@





class QgsFeature
{
%Docstring
@@ -527,9 +525,6 @@ typedef QMap<qint64, QMap<int, QVariant> > QgsChangedAttributesMap;

typedef QMap<qint64, QgsGeometry> QgsGeometryMap;


typedef QSet<qint64> QgsFeatureIds;

typedef QList<QgsFeature> QgsFeatureList;


@@ -0,0 +1,21 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeatureid.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





typedef QSet<qint64> QgsFeatureIds;

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeatureid.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -44,6 +44,7 @@
%Include auto_generated/qgsexpressioncontextscopegenerator.sip
%Include auto_generated/qgsexpressionfieldbuffer.sip
%Include auto_generated/qgsfeaturefilterprovider.sip
%Include auto_generated/qgsfeatureid.sip
%Include auto_generated/qgsfeatureiterator.sip
%Include auto_generated/qgsfeaturerequest.sip
%Include auto_generated/qgsfeaturesink.sip
@@ -9,7 +9,6 @@




class QgsIFeatureSelectionManager : QObject
{
%Docstring
@@ -21,7 +21,6 @@
#include "qgsgraphbuilder.h"
#include "qgsgraph.h"

#include "qgsfeature.h"
#include "qgsgeometry.h"

QgsGraphBuilder::QgsGraphBuilder( const QgsCoordinateReferenceSystem &crs, bool otfEnabled, double topologyTolerance, const QString &ellipsoidID )
@@ -24,9 +24,8 @@
#include <QMutex>
#include <QStringList>
#include "qgis_analysis.h"
#include "qgsfeatureid.h"

typedef qint64 QgsFeatureId;
typedef QSet<QgsFeatureId> QgsFeatureIds;
struct QgsGeometryCheckerContext;
class QgsGeometryCheck;
class QgsGeometryCheckError;
@@ -19,7 +19,6 @@
#include "ui_qgsattributerelationedit.h"

#include "qgseditorconfigwidget.h"
#include "qgsfeature.h"
#include "qgsvectordataprovider.h"
#include "qgshelp.h"
#include "qgis_app.h"
@@ -19,7 +19,6 @@
#include "ui_qgsattributesforminitcode.h"

#include "qgseditorconfigwidget.h"
#include "qgsfeature.h"
#include "qgsvectordataprovider.h"
#include "qgshelp.h"
#include "qgis_app.h"
@@ -19,6 +19,8 @@
#include "qgsmaptoolcapture.h"
#include "qgis_app.h"

class QgsFeature;

//! This tool digitizes geometry of new point/line/polygon features on already existing vector layers
class APP_EXPORT QgsMapToolDigitizeFeature : public QgsMapToolCapture
{
@@ -26,6 +26,7 @@ class QGridLayout;
class QgsSnapIndicator;
class QgsDoubleSpinBox;
class QGraphicsProxyWidget;
class QgsFeature;

class APP_EXPORT QgsOffsetUserWidget : public QWidget, private Ui::QgsOffsetUserInputBase
{
@@ -19,7 +19,7 @@
#define QGSMAPTOOLSHOWHIDELABELS_H

#include "qgsmaptoollabel.h"
#include "qgsfeature.h"
#include "qgsfeatureid.h"
#include "qgis_app.h"


@@ -20,9 +20,10 @@
#include "ui_qgssimplifytolerancedialog.h"

#include <QVector>
#include "qgsfeature.h"
#include "qgstolerance.h"
#include "qgsgeometry.h"
#include "qgis_app.h"
#include "qgsfeature.h"

class QgsRubberBand;
class QgsMapToolSimplify;
@@ -16,8 +16,8 @@
#ifndef QGSSELECTEDFEATURE_H
#define QGSSELECTEDFEATURE_H

#include "qgsfeature.h"
#include "qgsgeometry.h"
#include "qgsfeatureid.h"

#include <QObject>

@@ -851,6 +851,7 @@ SET(QGIS_CORE_HDRS
qgsexpressioncontextscopegenerator.h
qgsexpressionfieldbuffer.h
qgsfeaturefilterprovider.h
qgsfeatureid.h
qgsfeatureiterator.h
qgsfeaturerequest.h
qgsfeaturesink.h
@@ -29,9 +29,9 @@ email : morb at ozemail dot com dot au
#include "qgis.h"

#include "qgsabstractgeometry.h"
#include "qgsfeature.h"
#include "qgspointxy.h"
#include "qgspoint.h"
#include "qgsfeatureid.h"


class QgsGeometryEngine;
@@ -23,8 +23,8 @@ class QgsVectorLayer;

#define SIP_NO_FILE

#include "qgsfeature.h"
#include "qgsgeometry.h"
#include "qgsfeatureid.h"
#include <QMap>
#include <memory>

@@ -15,7 +15,6 @@
***************************************************************************/

#include "qgslayoutrendercontext.h"
#include "qgsfeature.h"
#include "qgslayout.h"

QgsLayoutRenderContext::QgsLayoutRenderContext( QgsLayout *layout )
@@ -17,12 +17,14 @@

#include <memory>
#include <QList>
#include "qgsfeature.h"
#include "qgspolygon.h"
#include "qgslinestring.h"
#include "qgstriangularmesh.h"
#include "qgsrendercontext.h"
#include "qgscoordinatetransform.h"
#include "qgsfeatureid.h"
#include "qgsgeometry.h"
#include "qgsrectangle.h"

static void ENP_centroid_step( const QPolygonF &pX, double &cx, double &cy, double &signedArea, int i, int i1 )
{
@@ -25,6 +25,7 @@
#include "qgis_core.h"
#include "qgsmeshdataprovider.h"
#include "qgsgeometry.h"
#include "qgsfeatureid.h"
#include "qgsspatialindex.h"

class QgsRenderContext;
@@ -33,7 +33,6 @@
#include "qgsfields.h"


class QgsGeometry;
class QgsRectangle;
class QgsFeature;
class QgsFeaturePrivate;
@@ -130,7 +129,7 @@ typedef QVector<QVariant> QgsAttributes;
% MappedType QgsAttributes
{
% TypeHeaderCode
#include <qgsfeature.h>
#include "qgsfeature.h"
% End

% ConvertFromTypeCode
@@ -17,7 +17,7 @@
#define QGSCACHEINDEX_H

#include "qgis_core.h"
#include "qgsfeature.h" // QgsFeatureIds
#include "qgsfeatureid.h"

class QgsFeatureRequest;
class QgsFeatureIterator;
@@ -29,6 +29,7 @@ email : sherman at mrcc.com

#include "qgsattributes.h"
#include "qgsfields.h"
#include "qgsfeatureid.h"

class QgsFeature;
class QgsFeaturePrivate;
@@ -43,15 +44,6 @@ class QgsRectangle;
* See details in QEP #17
****************************************************************************/

// feature id class (currently 64 bit)

// 64 bit feature ids
typedef qint64 QgsFeatureId SIP_SKIP;
#define FID_IS_NEW(fid) (fid<0)
#define FID_TO_NUMBER(fid) static_cast<qint64>(fid)
#define FID_TO_STRING(fid) QString::number( fid )
#define STRING_TO_FID(str) (str).toLongLong()


/**
* \ingroup core
@@ -540,13 +532,6 @@ typedef QMap<QgsFeatureId, QgsGeometry> QgsGeometryMap;
typedef QMap<qint64, QgsGeometry> QgsGeometryMap;
#endif


#ifndef SIP_RUN
typedef QSet<QgsFeatureId> QgsFeatureIds;
#else
typedef QSet<qint64> QgsFeatureIds;
#endif

typedef QList<QgsFeature> QgsFeatureList;

uint qHash( const QgsFeature &key, uint seed = 0 ) SIP_SKIP;
@@ -0,0 +1,37 @@
/***************************************************************************
qgsfeatureid.h
--------------------------------------
Date : 3.9.2018
Copyright : (C) 2018 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSFEATUREID_H
#define QGSFEATUREID_H

#include <QSet>
#include "qgis_sip.h"

// feature id (currently 64 bit)

// 64 bit feature ids
typedef qint64 QgsFeatureId SIP_SKIP;
#define FID_IS_NEW(fid) (fid<0)
#define FID_TO_NUMBER(fid) static_cast<qint64>(fid)
#define FID_TO_STRING(fid) QString::number( fid )
#define STRING_TO_FID(str) (str).toLongLong()

#ifndef SIP_RUN
typedef QSet<QgsFeatureId> QgsFeatureIds;
#else
typedef QSet<qint64> QgsFeatureIds;
#endif

#endif
@@ -20,12 +20,14 @@ class QgsPointXY;
class QgsVectorLayer;
class QgsFeatureRenderer;
class QgsRenderContext;
class QgsRectangle;

#include "qgis_core.h"
#include "qgsfeature.h"
#include "qgspointxy.h"
#include "qgscoordinatereferencesystem.h"
#include "qgscoordinatetransform.h"
#include "qgsfeatureid.h"
#include "qgsgeometry.h"
#include <memory>

class QgsPointLocator_VisitorNearestVertex;
@@ -18,9 +18,9 @@
#include "qgslogger.h"
#include "qgsexpression.h"
#include "qgsexpressionnodeimpl.h"
#include "qgsfeature.h"
#include "qgssymbollayerutils.h"
#include "qgscolorramp.h"
#include "qgspointxy.h"


//
@@ -18,16 +18,15 @@
#ifndef QGSSPATIALINDEXKDBUSH_H
#define QGSSPATIALINDEXKDBUSH_H

class QgsPointXY;
class QgsFeatureIterator;
class QgsFeedback;
class QgsFeatureSource;
class QgsSpatialIndexKDBushPrivate;
class QgsRectangle;

#include "qgis_core.h"
#include "qgsfeature.h"
#include "qgsspatialindexkdbushdata.h"
#include "qgspointxy.h"
#include <memory>
#include <QList>

@@ -18,7 +18,8 @@
#ifndef QGSSPATIALINDEXKDBUSHDATA_H
#define QGSSPATIALINDEXKDBUSHDATA_H

#include "qgsfeature.h"
#include "qgsfeatureid.h"
#include "qgspointxy.h"

/**
* \class QgsSpatialIndexKDBushData
@@ -23,9 +23,10 @@ class QgsVectorLayer;
#include <QVector>
#include <memory>

#include "qgsfeatureid.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsfeature.h"
#include "qgsrectangle.h"
#include "qgsgeometry.h"

struct QgsTracerGraph;

@@ -18,9 +18,9 @@

#include "qgis_core.h"
#include "qgis.h"
#include "qgsfeature.h"
#include "qgsgeometry.h"
#include "qgsvectorlayer.h"
#include "qgsfeatureid.h"

class QgsCurve;

0 comments on commit ded7978

Please sign in to comment.
You can’t perform that action at this time.