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

Public Member Functions

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

Static Public Attributes

 progress = Signal()
 

Protected Member Functions

 _emitProgress (self, progress)
 

Protected Attributes

 _node = node
 
 _progress_emit_time = None
 
int _progress = 0
 
 _old_orientation = node.getOrientation()
 
#Only if the orientation was finished calculating. _new_orientation = orientation
 
 _gravity_operation = None
 
- Protected Attributes inherited from UM.Operations.Operation.Operation
 _timestamp = time.time()
 
bool _always_merge = False
 

Detailed Description

Operation that lays a mesh flat on the scene.

Constructor & Destructor Documentation

◆ __init__()

UM.Operations.LayFlatOperation.LayFlatOperation.__init__ ( self,
node,
orientation = None )
Creates the operation.

An optional orientation may be added if the answer of this lay flat
operation is already known. This may occur if two lay flat operations
are combined.

:param node: The scene node to apply the operation on.
:param orientation: A pre-calculated result orientation.

Member Function Documentation

◆ __repr__()

UM.Operations.LayFlatOperation.LayFlatOperation.__repr__ ( self)
Makes a programmer-readable representation of this operation.

◆ _emitProgress()

UM.Operations.LayFlatOperation.LayFlatOperation._emitProgress ( self,
progress )
protected
Increments the progress.

This lets the progress bar update to give the user an impression of how
long he still has to wait.

:param progress: The amount of progress made since the last emission.

◆ mergeWith()

UM.Operations.LayFlatOperation.LayFlatOperation.mergeWith ( self,
other )
Merge this lay flat operation with another lay flat operation.

If multiple lay flat operations are executed in sequence, the user needs
to press undo only once to undo them all.

You should ONLY merge a lay flat operation with an older operation. It
is NOT symmetric.

:param other: The lay flat operation to merge this operation with. The
specified operation must be an older operation than this operation.
:return: True if the merge was successful, or False otherwise.

Reimplemented from UM.Operations.Operation.Operation.

◆ process()

UM.Operations.LayFlatOperation.LayFlatOperation.process ( self)
Computes some orientation to hopefully lay the object flat.

No promises! This algorithm finds the lowest three vertices and lays
them flat. This is a rather naive heuristic, but fast and practical.

◆ redo()

UM.Operations.LayFlatOperation.LayFlatOperation.redo ( self)
Re-does this lay flat operation.

Reimplemented from UM.Operations.Operation.Operation.

◆ undo()

UM.Operations.LayFlatOperation.LayFlatOperation.undo ( self)
Undoes this lay flat operation.

Reimplemented from UM.Operations.Operation.Operation.


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