Merge pull request #7790 from m-kuhn/featureid

Move QgsFeatureId to own header
This commit is contained in:
Matthias Kuhn 2018-09-04 21:31:00 +02:00 committed by GitHub
commit ded7978fab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 105 additions and 66 deletions

View File

@ -26,7 +26,7 @@ typedef QVector<QVariant> QgsAttributes;
%MappedType QgsAttributes
{
%TypeHeaderCode
#include <qgsfeature.h>
#include "qgsfeature.h"
%End
%ConvertFromTypeCode

View File

@ -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;

View File

@ -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 *
************************************************************************/

View File

@ -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

View File

@ -9,7 +9,6 @@
class QgsIFeatureSelectionManager : QObject
{
%Docstring

View File

@ -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 )

View File

@ -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;

View File

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

View File

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

View File

@ -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
{

View File

@ -26,6 +26,7 @@ class QGridLayout;
class QgsSnapIndicator;
class QgsDoubleSpinBox;
class QGraphicsProxyWidget;
class QgsFeature;
class APP_EXPORT QgsOffsetUserWidget : public QWidget, private Ui::QgsOffsetUserInputBase
{

View File

@ -19,7 +19,7 @@
#define QGSMAPTOOLSHOWHIDELABELS_H
#include "qgsmaptoollabel.h"
#include "qgsfeature.h"
#include "qgsfeatureid.h"
#include "qgis_app.h"

View File

@ -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;

View File

@ -16,8 +16,8 @@
#ifndef QGSSELECTEDFEATURE_H
#define QGSSELECTEDFEATURE_H
#include "qgsfeature.h"
#include "qgsgeometry.h"
#include "qgsfeatureid.h"
#include <QObject>

View File

@ -851,6 +851,7 @@ SET(QGIS_CORE_HDRS
qgsexpressioncontextscopegenerator.h
qgsexpressionfieldbuffer.h
qgsfeaturefilterprovider.h
qgsfeatureid.h
qgsfeatureiterator.h
qgsfeaturerequest.h
qgsfeaturesink.h

View File

@ -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;

View File

@ -23,8 +23,8 @@ class QgsVectorLayer;
#define SIP_NO_FILE
#include "qgsfeature.h"
#include "qgsgeometry.h"
#include "qgsfeatureid.h"
#include <QMap>
#include <memory>

View File

@ -15,7 +15,6 @@
***************************************************************************/
#include "qgslayoutrendercontext.h"
#include "qgsfeature.h"
#include "qgslayout.h"
QgsLayoutRenderContext::QgsLayoutRenderContext( QgsLayout *layout )

View File

@ -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 )
{

View File

@ -25,6 +25,7 @@
#include "qgis_core.h"
#include "qgsmeshdataprovider.h"
#include "qgsgeometry.h"
#include "qgsfeatureid.h"
#include "qgsspatialindex.h"
class QgsRenderContext;

View File

@ -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

View File

@ -17,7 +17,7 @@
#define QGSCACHEINDEX_H
#include "qgis_core.h"
#include "qgsfeature.h" // QgsFeatureIds
#include "qgsfeatureid.h"
class QgsFeatureRequest;
class QgsFeatureIterator;

View File

@ -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;

37
src/core/qgsfeatureid.h Normal file
View File

@ -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

View File

@ -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;

View File

@ -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"
//

View File

@ -18,7 +18,6 @@
#ifndef QGSSPATIALINDEXKDBUSH_H
#define QGSSPATIALINDEXKDBUSH_H
class QgsPointXY;
class QgsFeatureIterator;
class QgsFeedback;
class QgsFeatureSource;
@ -26,8 +25,8 @@ class QgsSpatialIndexKDBushPrivate;
class QgsRectangle;
#include "qgis_core.h"
#include "qgsfeature.h"
#include "qgsspatialindexkdbushdata.h"
#include "qgspointxy.h"
#include <memory>
#include <QList>

View File

@ -18,7 +18,8 @@
#ifndef QGSSPATIALINDEXKDBUSHDATA_H
#define QGSSPATIALINDEXKDBUSHDATA_H
#include "qgsfeature.h"
#include "qgsfeatureid.h"
#include "qgspointxy.h"
/**
* \class QgsSpatialIndexKDBushData

View File

@ -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;

View File

@ -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;

View File

@ -36,10 +36,10 @@ typedef QList<int> QgsAttributeList;
#include "qgis.h"
#include "qgsfields.h" // QgsFields
#include "qgsfeature.h" // QgsFeatureIds
#include "qgsfeatureiterator.h"
#include "qgsvectorsimplifymethod.h"
#include "qgsfeedback.h"
#include "qgsfeatureid.h"
#include "qgsmaplayerrenderer.h"

View File

@ -19,8 +19,8 @@
#include <QTableView>
#include "qgis.h"
#include <QAction>
#include "qgsfeatureid.h"
#include "qgsfeature.h" // For QgsFeatureIds
#include "qgis_gui.h"
class QgsAttributeTableDelegate;

View File

@ -16,7 +16,7 @@
#define QGSFEATUREMODEL_H
#include "qgis_gui.h"
#include "qgsfeature.h" // QgsFeatureId
#include "qgsfeatureid.h"
#include <QModelIndex>
/**

View File

@ -17,8 +17,8 @@
#include <QItemSelectionModel>
#include "qgis.h"
#include "qgsfeatureid.h"
#include "qgsfeature.h"
#include "qgis_gui.h"
class QgsVectorLayer;

View File

@ -16,9 +16,9 @@
#ifndef QGSGENERICFEATURESELECTIONMANAGER_H
#define QGSGENERICFEATURESELECTIONMANAGER_H
#include "qgsfeature.h"
#include "qgsifeatureselectionmanager.h"
#include "qgis_gui.h"
#include "qgsfeatureid.h"
SIP_NO_FILE

View File

@ -18,9 +18,8 @@
#include <QObject>
#include "qgis_sip.h"
#include "qgsfeature.h"
#include "qgis_gui.h"
#include "qgsfeatureid.h"
/**
* \ingroup gui

View File

@ -21,7 +21,6 @@
#include "ui_qgsexpressionbuilder.h"
#include "qgsdistancearea.h"
#include "qgsexpressioncontext.h"
#include "qgsfeature.h"
#include "QStandardItemModel"
#include "QStandardItem"

View File

@ -22,9 +22,10 @@
#include "qgis_sip.h"
#include "qgsexpressioncontext.h"
#include "qgsfeature.h"
#include "qgsmessagebar.h"
#include "qgsrectangle.h"
#include "qgsfeatureid.h"
#include "qgsgeometry.h"
#include "qgis.h"
#include <QDomDocument>

View File

@ -14,12 +14,12 @@
***************************************************************************/
#include "qgsrubberband.h"
#include "qgsfeature.h"
#include "qgsgeometry.h"
#include "qgslogger.h"
#include "qgsmapcanvas.h"
#include "qgsvectorlayer.h"
#include "qgsproject.h"
#include "qgsrectangle.h"
#include <QPainter>
QgsRubberBand::QgsRubberBand( QgsMapCanvas *mapCanvas, QgsWkbTypes::GeometryType geometryType )

View File

@ -15,7 +15,6 @@
#include "qgsvariableeditorwidget.h"
#include "qgsexpressioncontext.h"
#include "qgsfeature.h"
#include "qgsapplication.h"
#include "qgssettings.h"

View File

@ -19,7 +19,6 @@
#include <QMutex>
#include "qgsfeature.h"
#include "ui_qgsgeometrycheckersetuptab.h"
class QgisInterface;

View File

@ -21,7 +21,8 @@
#include <QObject>
#include "qgsglobefeatureoptions.h"
#include "qgsfeature.h"
#include "qgsfeatureid.h"
#include "qgsgeometry.h"
class QgsGlobeFeatureSource : public QObject, public osgEarth::Features::FeatureSource
{

View File

@ -30,7 +30,6 @@
#include <qgsapplication.h>
#include <qgsmapcanvas.h>
#include <qgsvectorlayer.h>
#include <qgsfeature.h>
#include <qgsgeometry.h>
#include <qgspoint.h>
#include <qgsdistancearea.h>
@ -40,6 +39,7 @@
#include <qgssettings.h>
#include <qgsvectorlayerlabeling.h>
#include <qgsproject.h>
#include <qgsrectangle.h>
#include <QAction>
#include <QDir>

View File

@ -27,7 +27,6 @@
#include "qgscoordinatereferencesystem.h"
#include "qgscoordinatetransform.h"
#include "qgsfeature.h"
#include "qgslogger.h"
#include "qgsmapcanvas.h"

View File

@ -25,7 +25,6 @@
#include <QVBoxLayout>
#include "qgis.h"
#include "qgsfeature.h"
#include "qgsfields.h"
#include "qgscoordinatereferencesystem.h"

View File

@ -17,13 +17,12 @@
#include <QStringList>
#include <QVariant>
#include "geometry/qgswkbtypes.h"
#include "qgsfeature.h"
#include "qgswkbtypes.h"
#include "qgsrectangle.h"
class QNetworkReply;
class QgsNetworkAccessManager;
class QgsFields;
class QgsRectangle;
class QgsAbstractGeometry;
class QgsCoordinateReferenceSystem;
class QgsFeedback;

View File

@ -25,8 +25,8 @@
#include <QTextStream>
#include <QStack>
#include "qgsfeature.h"
#include "qgsrectangle.h"
#include "qgsfeatureid.h"
// workaround for MSVC compiler which already has defined macro max
// that interferes with calling std::numeric_limits<int>::max

View File

@ -55,6 +55,7 @@
#include <QHash>
#include <QTextCodec>
extern "C"
{
#ifndef Q_OS_WIN

View File

@ -33,7 +33,6 @@ extern "C"
#include <stdexcept>
#include "qgsapplication.h"
#include "qgsexception.h"
#include "qgsfeature.h"
#include "qgsfields.h"
#include "qgsrectangle.h"
#include <QFileSystemWatcher>
@ -46,6 +45,7 @@ extern "C"
#include "qgis_grass_lib.h"
class QgsCoordinateReferenceSystem;
class QgsRectangle;
class QgsAttributes;
// Make the release string because it may be for example 0beta1
#define STR(x) #x