Uranium
Application Framework
|
Operation that lays a mesh flat on the scene. More...
Public Member Functions | |
__init__ (self, node, orientation=None) | |
Creates the operation. | |
process (self) | |
Computes some orientation to hopefully lay the object flat. | |
undo (self) | |
Undoes this lay flat operation. | |
redo (self) | |
Re-does this lay flat operation. | |
mergeWith (self, other) | |
Merge this lay flat operation with another lay flat operation. | |
__repr__ (self) | |
Makes a programmer-readable representation of this 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. | |
Static Public Attributes | |
progress = Signal() | |
Signal that indicates that the progress meter has changed. | |
Protected Member Functions | |
_emitProgress (self, progress) | |
Increments the progress. | |
Protected Attributes | |
_node | |
_progress_emit_time | |
_progress | |
_old_orientation | |
_new_orientation | |
![]() | |
_timestamp | |
_always_merge | |
Operation that lays a mesh flat on the scene.
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.
node | The scene node to apply the operation on. |
orientation | A pre-calculated result orientation. |
Reimplemented from UM.Operations.Operation.Operation.
|
protected |
Increments the progress.
This lets the progress bar update to give the user an impression of how long he still has to wait.
progress | The amount of progress made since the last emission. |
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.
other | The lay flat operation to merge this operation with. The specified operation must be an older operation than this operation. |
Reimplemented from UM.Operations.Operation.Operation.
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.
UM.Operations.LayFlatOperation.LayFlatOperation.redo | ( | self | ) |
Re-does this lay flat operation.
Reimplemented from UM.Operations.Operation.Operation.
UM.Operations.LayFlatOperation.LayFlatOperation.undo | ( | self | ) |
Undoes this lay flat operation.
Reimplemented from UM.Operations.Operation.Operation.