41 polygonList.
append( curvePoly );
48 polygonList.
append( dynamic_cast< QgsCurvePolygonV2* >( multiGeom->
geometryN( i ) ) );
63 else if ( !ring->
isRing() )
70 ringGeom->prepareGeometry();
74 for ( ; polyIter != polygonList.
end(); ++polyIter )
76 if ( ringGeom->within( **polyIter ) )
79 int nInnerRings = ( *polyIter )->numInteriorRings();
80 for (
int i = 0; i < nInnerRings; ++i )
82 if ( !ringGeom->disjoint( *( *polyIter )->interiorRing( i ) ) )
95 ( *polyIter )->addInteriorRing( ring );
117 if ( !geomCollection )
175 return added ? 0 : 2;
180 if ( !geom || partNum < 0 )
196 else if ( partNum > 0 )
230 if ( geomEngine.
isNull() )
254 for ( ; aIt != avoidIntersectionsList.
constEnd(); ++aIt )
261 if ( ignoreIt != ignoreFeatures.
constEnd() )
262 ignoreIds = ignoreIt.
value();
281 if ( nearGeometries.
isEmpty() )
288 qDeleteAll( nearGeometries );
289 if ( !combinedGeometries )
296 delete combinedGeometries;
bool removeInteriorRing(int nr)
Removes ring.
Wrapper for iterator of features from vector data provider or vector layer.
int numGeometries() const
Returns the number of geometries within the collection.
Use exact geometry intersection (slower) instead of bounding boxes.
static bool hasM(Type type)
Tests whether a WKB type contains m values.
QgsMapLayer * mapLayer(const QString &theLayerId) const
Retrieve a pointer to a registered layer by layer ID.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())
Query the provider for features specified in request.
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
Abstract base class for all geometries.
const QgsGeometry * constGeometry() const
Gets a const pointer to the geometry object associated with this feature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
virtual bool isRing() const
Returns true if the curve is a ring.
static int addPart(QgsAbstractGeometryV2 *geom, QgsAbstractGeometryV2 *part)
Adds part to multi type geometry (taking ownership)
virtual bool addMValue(double mValue=0)=0
Adds a measure to the geometry, initialized to a preset value.
virtual int numPoints() const =0
Returns the number of points in the curve.
const QgsAbstractGeometryV2 * geometryN(int n) const
Returns a const reference to a geometry from within the collection.
void append(const T &value)
virtual bool isClosed() const
Returns true if the curve is closed.
const_iterator constEnd() const
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
QStringList readListEntry(const QString &scope, const QString &key, const QStringList &def=QStringList(), bool *ok=nullptr) const
Key value accessors.
virtual bool addZValue(double zValue=0)=0
Adds a z-dimension to the geometry, initialized to a preset value.
QgsFeatureId id() const
Get the feature ID for this feature.
static GeometryType geometryType(Type type)
Returns the geometry type for a WKB type, eg both MultiPolygon and CurvePolygon would have a PolygonG...
static QgsGeometryEngine * createGeometryEngine(const QgsAbstractGeometryV2 *geometry)
Creates and returns a new geometry engine.
virtual QgsRectangle boundingBox() const =0
Returns the minimal bounding box for the geometry.
bool contains(const T &value) const
static bool deletePart(QgsAbstractGeometryV2 *geom, int partNum)
Deletes a part from a geometry.
static bool deleteRing(QgsAbstractGeometryV2 *geom, int ringNum, int partNum=0)
Deletes a ring from a geometry.
static QgsAbstractGeometryV2 * avoidIntersections(const QgsAbstractGeometryV2 &geom, QMap< QgsVectorLayer *, QSet< QgsFeatureId > > ignoreFeatures=(QMap< QgsVectorLayer *, QSet< QgsFeatureId > >()))
Alters a geometry so that it avoids intersections with features from all open vector layers...
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
QgsAbstractGeometryV2 * geometry() const
Returns the underlying geometry store.
virtual void setExteriorRing(QgsCurveV2 *ring)
Sets the exterior ring of the polygon.
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
static QgsProject * instance()
Returns the QgsProject singleton instance.
virtual bool addGeometry(QgsAbstractGeometryV2 *g)
Adds a geometry and takes ownership.
virtual bool removeGeometry(int nr)
Removes a geometry from the collection.
static int addRing(QgsAbstractGeometryV2 *geom, QgsCurveV2 *ring)
Adds interior ring (taking ownership).
static Type flatType(Type type)
Returns the flat type for a WKB type.
Curve polygon geometry type.
const_iterator constEnd() const
bool nextFeature(QgsFeature &f)
const_iterator constBegin() const
virtual QgsAbstractGeometryV2 * clone() const =0
Clones the geometry by performing a deep copy.
Abstract base class for curved geometry type.
Represents a vector layer which manages a vector based data sets.
iterator find(const Key &key)
const T value(const Key &key) const