Skip to content

Commit 66e9978

Browse files
committedMar 18, 2019
Add dox
1 parent 1ab1ad5 commit 66e9978

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed
 

‎python/analysis/auto_generated/vector/geometry_checker/qgsfeaturepool.sip.in

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ A feature pool is based on a vector layer and caches features.
2929
QgsFeaturePool( QgsVectorLayer *layer );
3030
virtual ~QgsFeaturePool();
3131

32-
bool getFeature( QgsFeatureId id, QgsFeature &feature, QgsFeedback *feedback = 0 );
32+
bool getFeature( QgsFeatureId id, QgsFeature &feature );
3333
%Docstring
34-
Retrieve the feature with the specified ``id`` into ``feature``.
35-
It will be retrieved from the cache or from the underlying layer if unavailable.
36-
If the feature is neither available from the cache nor from the layer it will return false.
37-
If ``feedback`` is specified, the call may return if the feedback is canceled.
34+
Retrieves the feature with the specified ``id`` into ``feature``.
35+
It will be retrieved from the cache or from the underlying feature source if unavailable.
36+
If the feature is neither available from the cache nor from the source it will return FALSE.
3837
%End
3938

4039

@@ -76,6 +75,12 @@ The coordinate reference system of this layer.
7675
%End
7776

7877
QString layerName() const;
78+
%Docstring
79+
Returns the name of the layer.
80+
81+
Should be preferred over layer().name() because it can directly be run on
82+
the background thread.
83+
%End
7984

8085
protected:
8186

‎src/analysis/vector/geometry_checker/qgsfeaturepool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ QgsFeaturePool::QgsFeaturePool( QgsVectorLayer *layer )
3636

3737
}
3838

39-
bool QgsFeaturePool::getFeature( QgsFeatureId id, QgsFeature &feature, QgsFeedback *feedback )
39+
bool QgsFeaturePool::getFeature( QgsFeatureId id, QgsFeature &feature )
4040
{
4141
// Why is there a write lock acquired here? Weird, we only want to read a feature from the cache, right?
4242
// A method like `QCache::object(const Key &key) const` certainly would not modify its internals.

‎src/analysis/vector/geometry_checker/qgsfeaturepool.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,20 @@ class ANALYSIS_EXPORT QgsFeaturePool : public QgsFeatureSink SIP_ABSTRACT
4242
virtual ~QgsFeaturePool() = default;
4343

4444
/**
45-
* Retrieve the feature with the specified \a id into \a feature.
46-
* It will be retrieved from the cache or from the underlying layer if unavailable.
47-
* If the feature is neither available from the cache nor from the layer it will return false.
48-
* If \a feedback is specified, the call may return if the feedback is canceled.
45+
* Retrieves the feature with the specified \a id into \a feature.
46+
* It will be retrieved from the cache or from the underlying feature source if unavailable.
47+
* If the feature is neither available from the cache nor from the source it will return FALSE.
4948
*/
50-
bool getFeature( QgsFeatureId id, QgsFeature &feature, QgsFeedback *feedback = nullptr );
49+
bool getFeature( QgsFeatureId id, QgsFeature &feature );
5150

5251
/**
5352
* Get features for the provided \a request. No features will be fetched
5453
* from the cache and the request is sent directly to the underlying feature source.
5554
* Results of the request are cached in the pool and the ids of all the features
56-
* are returned. This can be used to warm the cache for a particular area of interest
55+
* are returned. This is used to warm the cache for a particular area of interest
5756
* (bounding box) or other set of features.
57+
* This will get a new feature source from the source vector layer.
58+
* This needs to be called from the main thread.
5859
* If \a feedback is specified, the call may return if the feedback is canceled.
5960
*/
6061
QgsFeatureIds getFeatures( const QgsFeatureRequest &request, QgsFeedback *feedback = nullptr ) SIP_SKIP;
@@ -120,6 +121,12 @@ class ANALYSIS_EXPORT QgsFeaturePool : public QgsFeatureSink SIP_ABSTRACT
120121
*/
121122
QgsCoordinateReferenceSystem crs() const;
122123

124+
/**
125+
* Returns the name of the layer.
126+
*
127+
* Should be preferred over layer().name() because it can directly be run on
128+
* the background thread.
129+
*/
123130
QString layerName() const;
124131

125132
protected:

‎src/analysis/vector/geometry_checker/qgsgeometrymissingvertexcheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void QgsGeometryMissingVertexCheck::processPolygon( const QgsCurvePolygon *polyg
151151
if ( fid == currentFeature.id() )
152152
continue;
153153

154-
if ( featurePool->getFeature( fid, compareFeature, feedback ) )
154+
if ( featurePool->getFeature( fid, compareFeature ) )
155155
{
156156
if ( feedback && feedback->isCanceled() )
157157
break;

0 commit comments

Comments
 (0)
Please sign in to comment.