30 static int addedIdLowWaterMark = -1;
33 addedIdLowWaterMark--;
35 QgsDebugMsg(
"Assigned feature id " + QString::number( addedIdLowWaterMark ) );
142 if ( other->id() !=
id() )
172 it.value().setGeometry( *
mOldGeom );
209 it.value().setGeometry( *
mNewGeom );
223 , mFieldIndex( fieldIndex )
224 , mNewValue( newValue )
225 , mFirstChange( true )
232 if ( it.value().attribute(
mFieldIndex ).isValid() )
342 , mFieldIndex( fieldIndex )
QgsFeatureId id() const
Get the feature id for this feature.
QMap< QgsFeatureId, QVariant > mDeletedValues
Wrapper for iterator of features from vector data provider or vector layer.
void handleAttributeDeleted(int index)
update added and changed features after removal of an attribute
QgsVectorLayerUndoCommandAddFeature(QgsVectorLayerEditBuffer *buffer, QgsFeature &f)
QMap< int, QVariant > QgsAttributeMap
void attributeDeleted(int idx)
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())
Query the provider for features specified in request.
QgsGeometry * geometry() const
Get the geometry object associated with this feature.
QgsVectorLayerEditBuffer * mBuffer
QgsGeometryCache * cache()
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
bool setAttribute(int field, const QVariant &attr)
Set an attribute by id.
QgsChangedAttributesMap mChangedAttributeValues
Changed attributes values which are not commited.
~QgsVectorLayerUndoCommandChangeGeometry()
field comes from the underlying data provider of the vector layer (originIndex = index in provider's ...
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QgsVectorLayerUndoCommandAddAttribute(QgsVectorLayerEditBuffer *buffer, const QgsField &field)
QgsVectorLayerUndoCommandDeleteAttribute(QgsVectorLayerEditBuffer *buffer, int fieldIndex)
void featureAdded(QgsFeatureId fid)
QgsFeatureRequest & setFilterFid(QgsFeatureId fid)
Set feature ID that should be fetched.
void removeGeometry(QgsFeatureId fid)
get rid of the cached geometry
void setFeatureId(QgsFeatureId id)
Set the feature id for this feature.
void attributeAdded(int idx)
void geometryChanged(QgsFeatureId fid, QgsGeometry &geom)
bool geometry(QgsFeatureId fid, QgsGeometry &geometry)
fetch geometry from cache, return true if successful
int fieldOriginIndex(int fieldIdx) const
Get field's origin index (its meaning is specific to each type of origin)
QgsGeometryMap mChangedGeometries
Changed geometries which are not commited.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QgsFeature mOldAddedFeature
QList< int > QgsAttributeList
void handleAttributeAdded(int index)
update added and changed features after addition of an attribute
int count() const
Return number of items.
QgsFeatureIds mDeletedFeatureIds
Deleted feature IDs which are not commited.
Encapsulate a field in an attribute table or data source.
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
QList< QgsField > mAddedAttributes
added attributes fields which are not commited
void attributeValueChanged(QgsFeatureId fid, int idx, const QVariant &)
FieldOrigin fieldOrigin(int fieldIdx) const
Get field's origin (value from an enumeration)
QgsVectorLayerUndoCommandChangeAttribute(QgsVectorLayerEditBuffer *buffer, QgsFeatureId fid, int fieldIndex, const QVariant &newValue)
void cacheGeometry(QgsFeatureId fid, const QgsGeometry &geom)
store a geometry in the cache
virtual bool mergeWith(const QUndoCommand *)
QgsVectorLayerUndoCommandChangeGeometry(QgsVectorLayerEditBuffer *buffer, QgsFeatureId fid, QgsGeometry *newGeom)
const QgsFields & pendingFields() const
returns field list in the to-be-committed state
QgsVectorLayerUndoCommandDeleteFeature(QgsVectorLayerEditBuffer *buffer, QgsFeatureId fid)
bool nextFeature(QgsFeature &f)
QgsFeatureMap mAddedFeatures
New features which are not commited.
QgsFeatureRequest & setFlags(Flags flags)
Set flags that affect how features will be fetched.
QgsAttributeList mDeletedAttributeIds
deleted attributes fields which are not commited.
void featureDeleted(QgsFeatureId fid)