Uranium
Application Framework
UM.Controller.Controller Class Reference

Glue class that holds the scene, (active) view(s), (active) tool(s) and possible user inputs. More...

Public Member Functions

def __init__
 
def addView
 Add a view by name if it"s not already added. More...
 
def getView
 Request view by name. More...
 
def getAllViews (self)
 Return all views. More...
 
def getActiveView (self)
 Request active view. More...
 
def setActiveView
 Set the currently active view. More...
 
def addStage
 Add a stage by name if it's not already added. More...
 
def getStage
 Request stage by name. More...
 
def getAllStages (self)
 Return all stages. More...
 
def getActiveStage (self)
 Request active stage. More...
 
def setActiveStage
 Set the currently active stage. More...
 
def addInputDevice
 Add an input device (e.g. More...
 
def getInputDevice
 Request input device by name. More...
 
def removeInputDevice
 Remove an input device from the list of input devices. More...
 
def getFallbackTool (self)
 Request the current fallbacl tool. More...
 
def setFallbackTool
 Set the current active tool. More...
 
def getTool
 Request tool by name. More...
 
def getAllTools (self)
 Get all tools. More...
 
def addTool
 Add a Tool (transform object, translate object) if its not already added. More...
 
def isToolOperationActive (self)
 Gets whether a tool is currently in use. More...
 
def getActiveTool (self)
 Request active tool. More...
 
def setActiveTool
 Set the current active tool. More...
 
def getScene (self)
 Get the scene. More...
 
def event
 Process an event. More...
 
def setCameraTool
 Set the tool used for handling camera controls. More...
 
def getCameraTool (self)
 Get the camera tool (if any) More...
 
def setSelectionTool
 Set the tool used for performing selections. More...
 
def getToolsEnabled (self)
 
def setToolsEnabled
 
def deleteAllNodesWithMeshData
 
def setCameraRotation
 
def setCameraPosition
 
def setLookAtPosition
 
def setCameraZoomFactor
 
def setCameraOrigin
 Changes the origin of the camera, i.e. More...
 

Static Public Attributes

tuple viewsChanged = Signal()
 Emitted when the list of views changes. More...
 
tuple activeViewChanged = Signal()
 Emitted when the active view changes. More...
 
tuple stagesChanged = Signal()
 Emitted when the list of stages changes. More...
 
tuple activeStageChanged = Signal()
 Emitted when the active stage changes. More...
 
tuple toolsChanged = Signal()
 Emitted when the list of tools changes. More...
 
tuple toolEnabledChanged = Signal()
 Emitted when a tool changes its enabled state. More...
 
tuple activeToolChanged = Signal()
 Emitted when the active tool changes. More...
 
tuple toolOperationStarted = Signal()
 Emitted whenever a tool starts a longer operation. More...
 
tuple toolOperationStopped = Signal()
 Emitted whenever a tool stops a longer operation. More...
 
tuple contextMenuRequested = Signal()
 

Detailed Description

Glue class that holds the scene, (active) view(s), (active) tool(s) and possible user inputs.

The different types of views / tools / inputs are defined by plugins.

See also
View
Tool
Scene

Member Function Documentation

def UM.Controller.Controller.addInputDevice (   self,
  device 
)

Add an input device (e.g.

mouse, keyboard, etc) if it's not already added.

Parameters
deviceThe input device to be added
def UM.Controller.Controller.addStage (   self,
  stage 
)

Add a stage by name if it's not already added.

Parameters
namestring Unique identifier of stage (usually the plugin name)
stageStage The stage to be added
def UM.Controller.Controller.addTool (   self,
  tool 
)

Add a Tool (transform object, translate object) if its not already added.

Parameters
toolTool Tool to be added
def UM.Controller.Controller.addView (   self,
  view 
)

Add a view by name if it"s not already added.

Parameters
viewView The view to be added
def UM.Controller.Controller.event (   self,
  event 
)

Process an event.

Parameters
eventEvent event to be handle. The event is first passed to the selection tool, then the active tool and finally the camera tool. If none of these events handle it (when they return something that does not evaluate to true) a context menu signal is emitted.
def UM.Controller.Controller.getActiveStage (   self,
  Optional,
  Stage 
)

Request active stage.

Returns None if there is no active stage

Returns
stage Stage if an stage is active, None otherwise.
def UM.Controller.Controller.getActiveTool (   self,
  Optional,
  Tool 
)

Request active tool.

Returns None if there is no active tool

Returns
Tool if a tool is active, None otherwise.
def UM.Controller.Controller.getActiveView (   self,
  Optional,
  View 
)

Request active view.

Returns None if there is no active view

Returns
view View if an view is active, None otherwise.
def UM.Controller.Controller.getAllStages (   self,
  Dict,
  str,
  Stage 
)

Return all stages.

Returns
stages dict
def UM.Controller.Controller.getAllTools (   self,
  Dict,
  str,
  Tool 
)

Get all tools.

Returns
tools dict
def UM.Controller.Controller.getAllViews (   self,
  Dict,
  str,
  View 
)

Return all views.

Returns
views dict
def UM.Controller.Controller.getCameraTool (   self,
  Optional,
  Tool 
)

Get the camera tool (if any)

Returns
camera tool (or none)
def UM.Controller.Controller.getFallbackTool (   self,
  str 
)

Request the current fallbacl tool.

Returns
Id of the fallback tool
def UM.Controller.Controller.getInputDevice (   self,
  name 
)

Request input device by name.

Returns None if no device is found.

Parameters
namestring Unique identifier of input device (usually the plugin name)
Returns
input InputDevice device if name was found, none otherwise.
def UM.Controller.Controller.getScene (   self,
  Scene 
)

Get the scene.

Returns
scene Scene
def UM.Controller.Controller.getStage (   self,
  name 
)

Request stage by name.

Returns None if no stage is found.

Parameters
namestring Unique identifier of stage (usually the plugin name)
Returns
Stage Stage if name was found, none otherwise.
def UM.Controller.Controller.getTool (   self,
  name 
)

Request tool by name.

Returns None if no tool is found.

Parameters
namestring Unique identifier of tool (usually the plugin name)
Returns
tool Tool if name was found, None otherwise.
def UM.Controller.Controller.getView (   self,
  name 
)

Request view by name.

Returns None if no view is found.

Returns
View View if name was found, none otherwise.
def UM.Controller.Controller.isToolOperationActive (   self,
  bool 
)

Gets whether a tool is currently in use.

Returns
bool true if a tool current being used.
def UM.Controller.Controller.removeInputDevice (   self,
  name 
)

Remove an input device from the list of input devices.

Does nothing if the input device is not in the list.

Parameters
namestring The name of the device to remove.
def UM.Controller.Controller.setActiveStage (   self,
  name 
)

Set the currently active stage.

Parameters
namestring The name of the stage to set as active
def UM.Controller.Controller.setActiveTool (   self,
  tool 
)

Set the current active tool.

The tool can be set by name of the tool or directly passing the tool object.

Parameters
toolA tool object or the name of a tool.
def UM.Controller.Controller.setActiveView (   self,
  name 
)

Set the currently active view.

Parameters
namestring The name of the view to set as active
def UM.Controller.Controller.setCameraOrigin (   self,
  coordinate 
)

Changes the origin of the camera, i.e.

where it looks at.

Parameters
coordinateOne of the following options:
  • "home": The centre of the build plate.
  • "3d": The centre of the build volume.
  • "x", "y" and "z": Also the centre of the build plate. These are just aliases for the setCameraRotation function.
def UM.Controller.Controller.setCameraTool (   self,
  tool 
)

Set the tool used for handling camera controls.

Camera tool is the first tool to receive events. The tool can be set by name of the tool or directly passing the tool object.

Parameters
toolTool or string
See also
setSelectionTool
setActiveTool
def UM.Controller.Controller.setFallbackTool (   self,
  tool 
)

Set the current active tool.

The tool must be set by name.

Parameters
toolThe tools name which shall be used as fallback
def UM.Controller.Controller.setSelectionTool (   self,
  tool 
)

Set the tool used for performing selections.

Selection tool receives its events after camera tool and active tool. The tool can be set by name of the tool or directly passing the tool object.

Parameters
toolTool or string
See also
setCameraTool
setActiveTool

Member Data Documentation

tuple UM.Controller.Controller.activeStageChanged = Signal()
static

Emitted when the active stage changes.

tuple UM.Controller.Controller.activeToolChanged = Signal()
static

Emitted when the active tool changes.

tuple UM.Controller.Controller.activeViewChanged = Signal()
static

Emitted when the active view changes.

tuple UM.Controller.Controller.stagesChanged = Signal()
static

Emitted when the list of stages changes.

tuple UM.Controller.Controller.toolEnabledChanged = Signal()
static

Emitted when a tool changes its enabled state.

tuple UM.Controller.Controller.toolOperationStarted = Signal()
static

Emitted whenever a tool starts a longer operation.

Parameters
toolThe tool that started the operation.
See also
Tool::startOperation
tuple UM.Controller.Controller.toolOperationStopped = Signal()
static

Emitted whenever a tool stops a longer operation.

Parameters
toolThe tool that stopped the operation.
See also
Tool::stopOperation
tuple UM.Controller.Controller.toolsChanged = Signal()
static

Emitted when the list of tools changes.

tuple UM.Controller.Controller.viewsChanged = Signal()
static

Emitted when the list of views changes.


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