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

Public Member Functions

 __init__ (self, node, translation, set_position=False)
 
 undo (self)
 
 redo (self)
 
 mergeWith (self, other)
 
 __repr__ (self)
 
- Public Member Functions inherited from UM.Operations.Operation.Operation
None __init__ (self)
 
None push (self)
 

Protected Attributes

 _node = node
 
 _old_transformation = node.getLocalTransformation()
 
 _translation = translation
 
# Change the position to the new position. _set_position = set_position
 
- Protected Attributes inherited from UM.Operations.Operation.Operation
 _timestamp = time.time()
 
bool _always_merge = False
 

Detailed Description

An operation that moves a scene node.

This has nothing to do with languages. It is a linear transformation on
geometry.

Constructor & Destructor Documentation

◆ __init__()

UM.Operations.TranslateOperation.TranslateOperation.__init__ ( self,
node,
translation,
set_position = False )
Initialises this TranslateOperation.

:param node: The node to translate.
:param translation: A translation matrix to transform the node by.
:param set_position:: Whether to change the position (True) or add the
positions, making a relative move (False).

Member Function Documentation

◆ __repr__()

UM.Operations.TranslateOperation.TranslateOperation.__repr__ ( self)
Returns a programmer-readable representation of this operation.

:return: A programmer-readable representation of this operation.

◆ mergeWith()

UM.Operations.TranslateOperation.TranslateOperation.mergeWith ( self,
other )
Merges this operation with another translate operation.

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

You should ONLY merge this operation with an older operation. It is NOT
symmetric.

:param other: The older translate operation to merge this operation with.

Reimplemented from UM.Operations.Operation.Operation.

◆ redo()

UM.Operations.TranslateOperation.TranslateOperation.redo ( self)
Re-applies the translate operation.

Reimplemented from UM.Operations.Operation.Operation.

◆ undo()

UM.Operations.TranslateOperation.TranslateOperation.undo ( self)
Undoes the translate operation, restoring the old transformation.

Reimplemented from UM.Operations.Operation.Operation.


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