Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Operations.GroupedOperation.GroupedOperation Class Reference
Inheritance diagram for UM.Operations.GroupedOperation.GroupedOperation:
UM.Operations.Operation.Operation

Public Member Functions

None __init__ (self)
 
int getNumChildrenOperations (self)
 
None addOperation (self, Operation.Operation op)
 
None undo (self)
 
None redo (self)
 
 mergeWith (self, other)
 
 __repr__ (self)
 
- Public Member Functions inherited from UM.Operations.Operation.Operation
None __init__ (self)
 
None push (self)
 

Protected Attributes

list _children = []
 
bool _finalised = False
 
- Protected Attributes inherited from UM.Operations.Operation.Operation
 _timestamp = time.time()
 
bool _always_merge = False
 

Detailed Description

An operation that groups several other operations together.

The intent of this operation is to hide an underlying chain of operations
from the user if they correspond to only one interaction with the user, such
as an operation applied to multiple scene nodes or a re-arrangement of
multiple items in the scene.

Constructor & Destructor Documentation

◆ __init__()

None UM.Operations.GroupedOperation.GroupedOperation.__init__ ( self)
Creates a new grouped operation.

The grouped operation is empty after its initialisation.

Member Function Documentation

◆ addOperation()

None UM.Operations.GroupedOperation.GroupedOperation.addOperation ( self,
Operation.Operation op )
Adds an operation to this group.

The operation will be undone together with the rest of the operations in
this group.
Note that when the order matters, the operations are undone in reverse
order as the order in which they are added.

◆ mergeWith()

UM.Operations.GroupedOperation.GroupedOperation.mergeWith ( self,
other )
Merges this operation with another GroupOperation.

This prevents the user from having to undo multiple operations if they
were not his operations.

The older operation must have the same number of child operations, and
each pair of operations must succesfully merge, or the merge of the
groupOperation will fail.

:param other: The older GroupOperation to merge this with.
:return: A combination of the two group operations, or False if the operations
can not be merged.

Reimplemented from UM.Operations.Operation.Operation.

◆ redo()

None UM.Operations.GroupedOperation.GroupedOperation.redo ( self)
Redoes all operations in this group.

Reimplemented from UM.Operations.Operation.Operation.

◆ undo()

None UM.Operations.GroupedOperation.GroupedOperation.undo ( self)
Undo all operations in this group.

The operations are undone in reverse order as the order in which they
were added.

Reimplemented from UM.Operations.Operation.Operation.


The documentation for this class was generated from the following file: