28#include <QSharedPointer>
37#define RDEFAULT_QSET_RPROPERTYTYPEID QSet<RPropertyTypeId> ()
80 CurrentLayerChange = 0x0001,
81 CurrentLayerSelectionChange = 0x0002,
82 LayerLockStatusChange = 0x0004,
83 LayerVisibilityStatusChange = 0x0008,
84 SaveWorkingSet = 0x0010,
85 ChangeDocumentSetting = 0x0020,
89 Q_DECLARE_FLAGS(Types, Type)
97 const QList<RObject::Id>& affectedObjectIds,
108 recordAffectedObjects = on;
120 spatialIndexDisabled = on;
124 existingBlockDetectionDisabled = on;
128 existingLayerDetectionDisabled = on;
132 existingLinetypeDetectionDisabled = on;
136 blockRecursionDetectionDisabled = on;
191 void updateAffectedBlockReferences();
205 return transactionId;
212 transactionGroup = group;
219 return transactionGroup;
229 bool overwriteBlock(QSharedPointer<RBlock> block);
231 bool addObject(QSharedPointer<RObject> obj,
232 bool useCurrentAttributes =
true,
233 bool forceNew =
false,
237 void addAffectedObjects(
const QSet<RObject::Id>& objectIds);
238 void addAffectedObject(QSharedPointer<RObject>
object);
241 void deleteObject(QSharedPointer<RObject>
object,
bool force =
false);
248 return affectedObjectIds;
256 return statusChanges;
260 return statusChanges.contains(
id);
267 return propertyChanges;
272 QList<RPropertyChange> getPropertyChanges(
RObject::Id id)
const;
282 bool isPreview()
const;
441Q_DECLARE_OPERATORS_FOR_FLAGS(RTransaction::Types)
Q_DECLARE_METATYPE(RMath *)
#define RDEFAULT_QSET_RPROPERTYTYPEID
Definition RTransaction.h:37
QCADCORE_EXPORT QDebug operator<<(QDebug dbg, RTransaction &t)
Stream operator for QDebug.
Definition RTransaction.cpp:1289
Represents a block definition in a drawing.
Definition RBlock.h:42
int Id
Definition RObject.h:69
Stores the change that was made to a property of an object.
Definition RPropertyChange.h:38
This is the abstract base class for all storage implementations.
Definition RStorage.h:67
Transaction implementation.
Definition RTransaction.h:73
void setBlockRecursionDetectionDisabled(bool on)
Definition RTransaction.h:135
bool isUndoable() const
Definition RTransaction.h:170
void setGroup(int group)
Set group.
Definition RTransaction.h:211
void setExistingLinetypeDetectionDisabled(bool on)
Definition RTransaction.h:131
bool recordAffectedObjects
True if caller is interested in list of objects that are affected by this transaction.
Definition RTransaction.h:372
QStringList usedBlockNames
List of block names that have been already used in this transaction.
Definition RTransaction.h:421
bool deletingBlock
True if a block is being deleted to prevent recursion in deleteObject.
Definition RTransaction.h:416
QSet< RObject::Id > affectedBlockReferenceIds
List of IDs of all block references that need to be updated.
Definition RTransaction.h:333
QSet< RObject::Id > affectedObjectIdsSet
Definition RTransaction.h:328
void setTypes(RTransaction::Types t)
Definition RTransaction.h:284
int transactionGroup
Transaction group or -1.
Definition RTransaction.h:316
bool spatialIndexDisabled
True to ignore spatial index.
Definition RTransaction.h:391
RTransaction::Types types
Definition RTransaction.h:301
QList< RObject::Id > getAffectedObjects() const
Definition RTransaction.h:247
bool onlyChanges
True if this transaction only changed objects, no additions, no deletes.
Definition RTransaction.h:366
void setId(int id)
Sets the ID of this transaction.
Definition RTransaction.h:197
void setSpatialIndexDisabled(bool on)
Definition RTransaction.h:119
bool isRedoing()
Definition RTransaction.h:162
bool redoing
Definition RTransaction.h:436
int getId() const
Definition RTransaction.h:204
bool allowInvisible
True if all transactions on invisible entities are allowed, typically transactions on invisible layer...
Definition RTransaction.h:385
bool existingBlockDetectionDisabled
True to disable detection of existing blocks (performance gain).
Definition RTransaction.h:396
QMap< RObject::Id, QList< RPropertyChange > > getPropertyChanges() const
Definition RTransaction.h:266
QString getText() const
Definition RTransaction.h:225
void setRecordAffectedObjects(bool on)
Definition RTransaction.h:107
bool allowAll
True if all transactions are allowed, even transactions on locked or invisible layers.
Definition RTransaction.h:378
bool isUndoing()
Definition RTransaction.h:154
bool hasStatusChange(RObject::Id id) const
Definition RTransaction.h:259
QList< RObject::Id > affectedObjectIds
List of IDs of all objects that are affected by this transaction.
Definition RTransaction.h:327
bool hasOnlyChanges() const
Definition RTransaction.h:274
bool undoing
Definition RTransaction.h:435
bool keepHandles
True to keep existing object handles (importers).
Definition RTransaction.h:426
void setAllowAll(bool on)
Definition RTransaction.h:111
RStorage * storage
A transaction always belongs to the storage of a document.
Definition RTransaction.h:306
bool existingLayerDetectionDisabled
True to disable detection of existing layers (performance gain).
Definition RTransaction.h:401
bool blockRecursionDetectionDisabled
True to disable block recursion detection (performance gain for loading).
Definition RTransaction.h:411
QString text
Log entry for this transaction.
Definition RTransaction.h:321
int transactionId
Unique ID of this transaction.
Definition RTransaction.h:311
void setKeepChildren(bool on)
Keep child entities (e.g.
Definition RTransaction.h:146
QSet< RObject::Id > statusChanges
Contains affected objects that have been created or deleted in this transaction.
Definition RTransaction.h:346
Type
Transaction type for optimizations.
Definition RTransaction.h:78
bool keepChildren
True to keep and not delete child entities (block attributes for block references).
Definition RTransaction.h:431
bool existingLinetypeDetectionDisabled
True to disable detection of existing linetypes (performance gain).
Definition RTransaction.h:406
void setExistingLayerDetectionDisabled(bool on)
Definition RTransaction.h:127
bool undoable
Child transactions of this transaction.
Definition RTransaction.h:356
QMap< RObject::Id, QList< RPropertyChange > > propertyChanges
Map of properties that are changed by this transaction.
Definition RTransaction.h:340
QMap< RObject::Id, RObject::Id > cloneIds
Definition RTransaction.h:433
void setKeepHandles(bool on)
Definition RTransaction.h:139
void setExistingBlockDetectionDisabled(bool on)
Definition RTransaction.h:123
void setAllowInvisible(bool on)
Definition RTransaction.h:115
QSet< RObject::Id > getStatusChanges() const
Definition RTransaction.h:255
int getGroup() const
Definition RTransaction.h:218
RTransaction::Types getTypes() const
Definition RTransaction.h:287
bool failed
True if this transaction failed.
Definition RTransaction.h:361
bool isFailed() const
Definition RTransaction.h:174
Redoes the last undone transaction of the current document.
Definition Redo.js:11
Undoes the last transaction of the current document.
Definition Undo.js:11
#define QCADCORE_EXPORT
Definition core_global.h:10
void deleteObject(void obj)
Deletes the given RObject from the drawing.
Definition simple_create.js:216
void addObject(void obj)
Adds the given RObject to the drawing.
Definition simple_create.js:97