Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Operations.ScaleOperation.ScaleOperation Class Reference

Operation that scales a scene node, uniformly or non-uniformly. More...

Inheritance diagram for UM.Operations.ScaleOperation.ScaleOperation:
UM.Operations.Operation.Operation

Public Member Functions

 __init__ (self, node, scale, set_scale=False, add_scale=False, relative_scale=False, scale_around_point=Vector(0, 0, 0), snap=False)
 Initialises the scale operation.
 
 undo (self)
 Undo the scale operation.
 
 redo (self)
 Redo the scale operation.
 
 mergeWith (self, other)
 Merge this operation with another scale operation.
 
 __repr__ (self)
 Returns a programmer-readable representation of this operation.
 
- Public Member Functions inherited from UM.Operations.Operation.Operation
 __init__ (self)
 
 undo (self)
 Undo the operation.
 
 redo (self)
 Redo the operation.
 
 mergeWith (self, other)
 Perform operation merging.
 
 push (self)
 Push the operation onto the stack.
 

Protected Attributes

 _node
 
 _old_transformation
 
 _set_scale
 
 _add_scale
 
 _relative_scale
 
 _scale_around_point
 
 _snap
 
 _scale
 
 _min_scale
 
- Protected Attributes inherited from UM.Operations.Operation.Operation
 _timestamp
 
 _always_merge
 

Detailed Description

Operation that scales a scene node, uniformly or non-uniformly.

Constructor & Destructor Documentation

◆ __init__()

UM.Operations.ScaleOperation.ScaleOperation.__init__ (   self,
  node,
  scale,
  set_scale = False,
  add_scale = False,
  relative_scale = False,
  scale_around_point = Vector(0, 0, 0),
  snap = False 
)

Initialises the scale operation.

Parameters
nodeThe scene node to scale.
scaleA matrix to scale the node with. This matrix should only be non-zero on the diagonal.
set_scaleWhether to simply replace the old scale with the new one (True) or modify the old scale (False).
add_scaleWhether to add to the old scale (True) or multiply with it (False).
relative_scaleWhether to multiply the scale relative to the current scale (True) or simply multiply it with a constant (False).
scale_around_pointAll coordinates are moved away from or towards this point.
snapWhether to use snap scaling (True) or not (False).

Reimplemented from UM.Operations.Operation.Operation.

Member Function Documentation

◆ __repr__()

UM.Operations.ScaleOperation.ScaleOperation.__repr__ (   self)

Returns a programmer-readable representation of this operation.

Returns
A programmer-readable representation of this operation.

◆ mergeWith()

UM.Operations.ScaleOperation.ScaleOperation.mergeWith (   self,
  other 
)

Merge this operation with another scale 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.

Parameters
otherThe older scale operation to merge this operation with.
Returns
A new operation that performs both scale operations.

Reimplemented from UM.Operations.Operation.Operation.

◆ redo()

UM.Operations.ScaleOperation.ScaleOperation.redo (   self)

Redo the scale operation.

Reimplemented from UM.Operations.Operation.Operation.

◆ undo()

UM.Operations.ScaleOperation.ScaleOperation.undo (   self)

Undo the scale operation.

Reimplemented from UM.Operations.Operation.Operation.


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