Uranium
Application Framework
|
Public Member Functions | |
None | __init__ (self, "Application" application) |
None | addView (self, View view) |
Optional[View] | getView (self, str name) |
Dict[str, View] | getAllViews (self) |
Optional[View] | getActiveView (self) |
None | setActiveView (self, str name) |
None | addStage (self, Stage stage) |
Optional[Stage] | getStage (self, str name) |
Dict[str, Stage] | getAllStages (self) |
Optional[Stage] | getActiveStage (self) |
None | setActiveStage (self, str name) |
None | addInputDevice (self, InputDevice device) |
Optional[InputDevice] | getInputDevice (self, str name) |
None | removeInputDevice (self, str name) |
str | getFallbackTool (self) |
None | setFallbackTool (self, str tool) |
Optional["Tool"] | getTool (self, str name) |
Dict[str, "Tool"] | getAllTools (self) |
None | addTool (self, "Tool" tool) |
bool | isToolOperationActive (self) |
Optional["Tool"] | getActiveTool (self) |
setActiveTool (self, Optional[Union["Tool", str]] tool) | |
Scene | getScene (self) |
event (self, Event event) | |
setCameraTool (self, Union["Tool", str] tool) | |
Optional["Tool"] | getCameraTool (self) |
setSelectionTool (self, Union[str, "Tool"] tool) | |
bool | getToolsEnabled (self) |
None | setToolsEnabled (self, bool enabled) |
None | deleteAllNodesWithMeshData (self, bool only_selectable=True) |
None | setCameraRotation (self, str coordinate="x", int angle=0) |
None | setCameraPosition (self, int x_position=0, int y_position=0, int z_position=0) |
None | setLookAtPosition (self, int x_look_at_position=0, int y_look_at_position=0, int z_look_at_position=0) |
None | setCameraZoomFactor (self, float camera_zoom_factor=0) |
setCameraOrigin (self, str coordinate="home") | |
Public Attributes | |
addStage | |
addView | |
addTool | |
addInputDevice | |
event = device | |
Static Public Attributes | |
viewsChanged = Signal() | |
activeViewChanged = Signal() | |
stagesChanged = Signal() | |
activeStageChanged = Signal() | |
toolsChanged = Signal() | |
toolEnabledChanged = Signal() | |
activeToolChanged = Signal() | |
toolOperationStarted = Signal() | |
toolOperationStopped = Signal() | |
contextMenuRequested = Signal() | |
Protected Member Functions | |
None | _onToolOperationStarted (self, "Tool" tool) |
None | _onToolOperationStopped (self, "Tool" tool) |
Protected Attributes | |
_scene = Scene() | |
_application = application | |
dict | _active_view = None |
dict | _views = {} |
dict | _active_tool = None |
str | _fallback_tool = "TranslateTool" |
bool | _tool_operation_active = False |
dict | _tools = {} |
Optional["Tool"] | _camera_tool = None |
Optional["Tool"] | _selection_tool = None |
bool | _tools_enabled = True |
dict | _active_stage = None |
dict | _stages = {} |
dict | _input_devices = {} |
_onToolOperationStarted = tool | |
_onToolOperationStopped | |
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. :sa View :sa Tool :sa Scene
None UM.Controller.Controller.addInputDevice | ( | self, | |
InputDevice | device ) |
Add an input device (e.g. mouse, keyboard, etc) if it's not already added. :param device: The input device to be added
None UM.Controller.Controller.addStage | ( | self, | |
Stage | stage ) |
Add a stage if it's not already added. :param stage: The stage to be added
None UM.Controller.Controller.addTool | ( | self, | |
"Tool" | tool ) |
Add a Tool (transform object, translate object) if its not already added. :param tool: Tool to be added
None UM.Controller.Controller.addView | ( | self, | |
View | view ) |
Add a view by name if it"s not already added. :param view: The view to be added
UM.Controller.Controller.event | ( | self, | |
Event | event ) |
Process an event 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. :param event: event to be handle.
Optional[Stage] UM.Controller.Controller.getActiveStage | ( | self | ) |
Request active stage. Returns None if there is no active stage :return: stage if an stage is active, None otherwise.
Optional["Tool"] UM.Controller.Controller.getActiveTool | ( | self | ) |
Request active tool. Returns None if there is no active tool :return: Tool if a tool is active, None otherwise.
Optional[View] UM.Controller.Controller.getActiveView | ( | self | ) |
Request active view. Returns None if there is no active view :return: view if an view is active, None otherwise.
Dict[str, Stage] UM.Controller.Controller.getAllStages | ( | self | ) |
Return all stages. :return: stages
Dict[str, "Tool"] UM.Controller.Controller.getAllTools | ( | self | ) |
Get all tools :return: tools
Dict[str, View] UM.Controller.Controller.getAllViews | ( | self | ) |
Return all views. :return: views
Optional["Tool"] UM.Controller.Controller.getCameraTool | ( | self | ) |
Get the camera tool (if any) :returns: camera tool (or none)
str UM.Controller.Controller.getFallbackTool | ( | self | ) |
Request the current fallbacl tool. :return: Id of the fallback tool
Optional[InputDevice] UM.Controller.Controller.getInputDevice | ( | self, | |
str | name ) |
Request input device by name. Returns None if no device is found. :param name: Unique identifier of input device (usually the plugin name) :return: input device if name was found, none otherwise.
Scene UM.Controller.Controller.getScene | ( | self | ) |
Get the scene :return: scene
Optional[Stage] UM.Controller.Controller.getStage | ( | self, | |
str | name ) |
Request stage by name. Returns None if no stage is found. :param name: Unique identifier of stage (usually the plugin name) :return: Stage if name was found, None otherwise.
Optional["Tool"] UM.Controller.Controller.getTool | ( | self, | |
str | name ) |
Request tool by name. Returns None if no tool is found. :param name: Unique identifier of tool (usually the plugin name) :return: tool if name was found, None otherwise.
Optional[View] UM.Controller.Controller.getView | ( | self, | |
str | name ) |
Request view by name. Returns None if no view is found. :return: View if name was found, none otherwise.
bool UM.Controller.Controller.isToolOperationActive | ( | self | ) |
Gets whether a tool is currently in use :return: true if a tool current being used.
None UM.Controller.Controller.removeInputDevice | ( | self, | |
str | name ) |
Remove an input device from the list of input devices. Does nothing if the input device is not in the list. :param name: The name of the device to remove.
None UM.Controller.Controller.setActiveStage | ( | self, | |
str | name ) |
Set the currently active stage. :param name: The name of the stage to set as active
UM.Controller.Controller.setActiveTool | ( | self, | |
Optional[Union["Tool", str]] | tool ) |
Set the current active tool. The tool can be set by name of the tool or directly passing the tool object. :param tool: A tool object or the name of a tool.
None UM.Controller.Controller.setActiveView | ( | self, | |
str | name ) |
Set the currently active view. :param name: The name of the view to set as active
UM.Controller.Controller.setCameraOrigin | ( | self, | |
str | coordinate = "home" ) |
Changes the origin of the camera, i.e. where it looks at. :param coordinate: One 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.
UM.Controller.Controller.setCameraTool | ( | self, | |
Union["Tool", str] | 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. :param tool: :sa setSelectionTool :sa setActiveTool
None UM.Controller.Controller.setFallbackTool | ( | self, | |
str | tool ) |
Set the current active tool. The tool must be set by name. :param tool: The tools name which shall be used as fallback
UM.Controller.Controller.setSelectionTool | ( | self, | |
Union[str, "Tool"] | 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. :param tool: :sa setCameraTool :sa setActiveTool