41 polygonList.
append( curvePoly );
48 polygonList.
append( dynamic_cast< QgsCurvePolygonV2* >( multiGeom->
geometryN( i ) ) );
53 delete ring;
return 1;
59 delete ring;
return 2;
61 else if ( !ring->
isRing() )
63 delete ring;
return 3;
67 ringGeom->prepareGeometry();
71 for ( ; polyIter != polygonList.
end(); ++polyIter )
73 if ( ringGeom->within( **polyIter ) )
76 int nInnerRings = ( *polyIter )->numInteriorRings();
77 for (
int i = 0; i < nInnerRings; ++i )
79 if ( !ringGeom->disjoint( *( *polyIter )->interiorRing( i ) ) )
81 delete ring;
return 4;
91 ( *polyIter )->addInteriorRing( ring );
95 delete ring;
return 5;
112 if ( !geomCollection )
153 delete part;
return 2;
160 delete part;
return 2;
167 return added ? 0 : 2;
172 if ( !geom || partNum < 0 )
188 else if ( partNum > 0 )
222 if ( geomEngine.
isNull() )
246 for ( ; aIt != avoidIntersectionsList.
constEnd(); ++aIt )
253 if ( ignoreIt != ignoreFeatures.
constEnd() )
254 ignoreIds = ignoreIt.
value();
273 if ( nearGeometries.
isEmpty() )
280 qDeleteAll( nearGeometries );
281 if ( !combinedGeometries )
288 delete combinedGeometries;
QgsFeatureId id() const
Get the feature ID for this feature.
bool removeInteriorRing(int nr)
Removes ring.
Wrapper for iterator of features from vector data provider or vector layer.
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
Use exact geometry intersection (slower) instead of bounding boxes.
QgsAbstractGeometryV2 * geometry() const
Returns the underlying geometry store.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())
Query the provider for features specified in request.
virtual bool isRing() const
Returns true if the curve is a ring.
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
Abstract base class for all geometries.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
static int addPart(QgsAbstractGeometryV2 *geom, QgsAbstractGeometryV2 *part)
Adds part to multi type geometry (taking ownership)
QgsMapLayer * mapLayer(const QString &theLayerId)
Retrieve a pointer to a loaded layer by id.
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.
void append(const T &value)
static bool hasM(Type type)
Tests whether a WKB type contains m values.
static GeometryType geometryType(Type type)
const_iterator constEnd() const
This class wraps a request for features to a vector layer (or directly its vector data provider)...
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
QList< int > QgsAttributeList
virtual bool addZValue(double zValue=0)=0
Adds a z-dimension to the geometry, initialized to a preset value.
static QgsGeometryEngine * createGeometryEngine(const QgsAbstractGeometryV2 *geometry)
Creates and returns a new geometry engine.
virtual QString geometryType() const =0
Returns a unique string representing the geometry type.
QgsGeometry * geometry()
Get the geometry object associated with this feature.
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...
int numGeometries() const
Returns the number of geometries within the collection.
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
void setExteriorRing(QgsCurveV2 *ring)
Sets exterior ring (takes ownership)
virtual bool isClosed() const
Returns true if the curve is closed.
static QgsProject * instance()
access to canonical QgsProject instance
virtual bool addGeometry(QgsAbstractGeometryV2 *g)
Adds a geometry and takes ownership.
const QgsAbstractGeometryV2 * geometryN(int n) const
Returns a const reference to a geometry from within the collection.
virtual bool removeGeometry(int nr)
Removes a geometry from the collection.
static int addRing(QgsAbstractGeometryV2 *geom, QgsCurveV2 *ring)
Adds interior ring (taking ownership).
Curve polygon geometry type.
const_iterator constEnd() const
bool nextFeature(QgsFeature &f)
const_iterator constBegin() const
QgsRectangle boundingBox() const
Returns the minimal bounding box for the geometry.
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)
QStringList readListEntry(const QString &scope, const QString &key, const QStringList &def=QStringList(), bool *ok=0) const
Key value accessors.
const T value(const Key &key) const