|
Quantum GIS API Documentation
1.8
|
Class to support universal undo command sequence for application, basic for. More...
#include <qgsvectorlayerundocommand.h>

Classes | |
| class | AttributeChangeEntry |
| change structure for attribute for undo/redo purpose More... | |
| class | GeometryChangeEntry |
| change structure to geometry for undo/redo purpose More... | |
Public Types | |
| typedef QMap< int, AttributeChangeEntry > | AttributeChanges |
Public Member Functions | |
| QgsUndoCommand (QgsVectorLayer *layer, QString text) | |
| void | undo () |
| Necessary function to provide undo operation. | |
| void | redo () |
| Necessary function to provide redo operation. | |
| void | storeGeometryChange (QgsFeatureId featureId, QgsGeometry &original, QgsGeometry &target) |
| Function to store changes in geometry to be returned to this state after undo/redo. | |
| void | storeAttributeChange (QgsFeatureId featureId, int field, QVariant original, QVariant target, bool isFirstChange) |
| Stores changes of attributes for the feature to be returned to this state after undo/redo. | |
| void | storeFeatureDelete (QgsFeatureId featureId) |
| Add id of feature to deleted list to be reverted if needed afterwards. | |
| void | storeFeatureAdd (QgsFeature &feature) |
| Add new feature to list of new features to be stored for undo/redo operations. | |
| void | storeAttributeAdd (int index, const QgsField &value) |
| Add new attribute to list of attributes to be used for attributes of features for undo/redo operations. | |
| void | storeAttributeDelete (int index, const QgsField &orig) |
| Add deleted attribute which is to be stored for undo/redo operations. | |
Private Attributes | |
| bool | mFirstRun |
| Variable to disable first run of undo, because it's automaticaly done after push. | |
| QgsVectorLayer * | mLayer |
| Layer on which operations should be performed. | |
| QMap< QgsFeatureId, GeometryChangeEntry > | mGeometryChange |
| Map of changes of geometry for features it describes changes of geometry. | |
| QMap< QgsFeatureId, AttributeChanges > | mAttributeChange |
| Map of changes of atrributes for features which describes changes of attributes. | |
| QgsFeatureIds | mDeletedFeatureIdChange |
| Deleted feature IDs which are not commited. | |
| QgsFieldMap | mAddedAttributes |
| added attributes fields which are not commited | |
| QgsFieldMap | mDeletedAttributes |
| deleted attributes fields which are not commited | |
| QgsFeatureList | mAddedFeatures |
| New features which are not commited. | |
Friends | |
| class | QgsVectorLayer |
Class to support universal undo command sequence for application, basic for.
Definition at line 40 of file qgsvectorlayerundocommand.h.
| typedef QMap<int, AttributeChangeEntry> QgsUndoCommand::AttributeChanges |
Definition at line 53 of file qgsvectorlayerundocommand.h.
| QgsUndoCommand::QgsUndoCommand | ( | QgsVectorLayer * | layer, |
| QString | text | ||
| ) |
Definition at line 60 of file qgsvectorlayerundocommand.cpp.
| void QgsUndoCommand::redo | ( | ) |
Necessary function to provide redo operation.
Definition at line 68 of file qgsvectorlayerundocommand.cpp.
References mFirstRun, mLayer, and QgsVectorLayer::redoEditCommand().
| void QgsUndoCommand::storeAttributeAdd | ( | int | index, |
| const QgsField & | value | ||
| ) |
Add new attribute to list of attributes to be used for attributes of features for undo/redo operations.
| index | index of attribute which is to be added |
| value | field description which is to be stored |
Definition at line 112 of file qgsvectorlayerundocommand.cpp.
References mAddedAttributes.
Referenced by QgsVectorLayer::addAttribute().
| void QgsUndoCommand::storeAttributeChange | ( | QgsFeatureId | featureId, |
| int | field, | ||
| QVariant | original, | ||
| QVariant | target, | ||
| bool | isFirstChange | ||
| ) |
Stores changes of attributes for the feature to be returned to this state after undo/redo.
| featureId | id of feature for which this chaged is stored |
| field | field identifier of field which was changed |
| original | original value of attribute before change |
| target | target value of attribute after change |
| isFirstChange | flag if this change is the first one |
Definition at line 103 of file qgsvectorlayerundocommand.cpp.
References QgsUndoCommand::AttributeChangeEntry::isFirstChange, mAttributeChange, QgsUndoCommand::AttributeChangeEntry::original, and QgsUndoCommand::AttributeChangeEntry::target.
Referenced by QgsVectorLayer::editAttributeChange().
| void QgsUndoCommand::storeAttributeDelete | ( | int | index, |
| const QgsField & | orig | ||
| ) |
Add deleted attribute which is to be stored for undo/redo operations.
| index | index od attribute definition which is to be deleted |
| orig | deleted field's description |
Definition at line 117 of file qgsvectorlayerundocommand.cpp.
References mDeletedAttributes.
Referenced by QgsVectorLayer::deleteAttribute().
| void QgsUndoCommand::storeFeatureAdd | ( | QgsFeature & | feature | ) |
Add new feature to list of new features to be stored for undo/redo operations.
| feature | feature which is to be added |
Definition at line 127 of file qgsvectorlayerundocommand.cpp.
References mAddedFeatures.
Referenced by QgsVectorLayer::editFeatureAdd().
| void QgsUndoCommand::storeFeatureDelete | ( | QgsFeatureId | featureId | ) |
Add id of feature to deleted list to be reverted if needed afterwards.
| featureId | id of feature which is to be deleted |
Definition at line 122 of file qgsvectorlayerundocommand.cpp.
References mDeletedFeatureIdChange.
Referenced by QgsVectorLayer::editFeatureDelete().
| void QgsUndoCommand::storeGeometryChange | ( | QgsFeatureId | featureId, |
| QgsGeometry & | original, | ||
| QgsGeometry & | target | ||
| ) |
Function to store changes in geometry to be returned to this state after undo/redo.
| featureId | id of feature edited |
| original | original geometry of feature which was changed |
| target | changed geometry which was changed |
Definition at line 87 of file qgsvectorlayerundocommand.cpp.
References mGeometryChange.
Referenced by QgsVectorLayer::editGeometryChange().
| void QgsUndoCommand::undo | ( | ) |
Necessary function to provide undo operation.
Definition at line 81 of file qgsvectorlayerundocommand.cpp.
References mLayer, and QgsVectorLayer::undoEditCommand().
friend class QgsVectorLayer [friend] |
Definition at line 156 of file qgsvectorlayerundocommand.h.
QgsFieldMap QgsUndoCommand::mAddedAttributes [private] |
added attributes fields which are not commited
Definition at line 146 of file qgsvectorlayerundocommand.h.
Referenced by QgsVectorLayer::redoEditCommand(), storeAttributeAdd(), and QgsVectorLayer::undoEditCommand().
QgsFeatureList QgsUndoCommand::mAddedFeatures [private] |
New features which are not commited.
Note a feature can be added and then changed, therefore the details here can be overridden by mChangedAttributeValues and mChangedGeometries.
Definition at line 154 of file qgsvectorlayerundocommand.h.
Referenced by QgsVectorLayer::redoEditCommand(), storeFeatureAdd(), and QgsVectorLayer::undoEditCommand().
QMap<QgsFeatureId, AttributeChanges> QgsUndoCommand::mAttributeChange [private] |
Map of changes of atrributes for features which describes changes of attributes.
Definition at line 137 of file qgsvectorlayerundocommand.h.
Referenced by QgsVectorLayer::redoEditCommand(), storeAttributeChange(), and QgsVectorLayer::undoEditCommand().
deleted attributes fields which are not commited
Definition at line 149 of file qgsvectorlayerundocommand.h.
Referenced by QgsVectorLayer::redoEditCommand(), storeAttributeDelete(), and QgsVectorLayer::undoEditCommand().
Deleted feature IDs which are not commited.
Note a feature can be added and then deleted again before the change is committed - in that case the added feature would be removed from mAddedFeatures only and *not* entered here.
Definition at line 143 of file qgsvectorlayerundocommand.h.
Referenced by QgsVectorLayer::redoEditCommand(), storeFeatureDelete(), and QgsVectorLayer::undoEditCommand().
bool QgsUndoCommand::mFirstRun [private] |
Variable to disable first run of undo, because it's automaticaly done after push.
Definition at line 128 of file qgsvectorlayerundocommand.h.
Referenced by QgsUndoCommand(), and redo().
QMap<QgsFeatureId, GeometryChangeEntry> QgsUndoCommand::mGeometryChange [private] |
Map of changes of geometry for features it describes changes of geometry.
Definition at line 134 of file qgsvectorlayerundocommand.h.
Referenced by QgsVectorLayer::redoEditCommand(), storeGeometryChange(), and QgsVectorLayer::undoEditCommand().
QgsVectorLayer* QgsUndoCommand::mLayer [private] |
Layer on which operations should be performed.
Definition at line 131 of file qgsvectorlayerundocommand.h.
Referenced by QgsUndoCommand(), redo(), and undo().
1.7.6.1