Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Scene.ToolHandle.ToolHandle Class Reference

A tool handle is a object in the scene that gives queues for what the tool it is 'paired' with can do. More...

Inheritance diagram for UM.Scene.ToolHandle.ToolHandle:
UM.Scene.SceneNode.SceneNode

Public Member Functions

 __init__ (self, parent=None)
 Construct a scene node.
 
 getLineMesh (self)
 
 setLineMesh (self, mesh)
 
 getSolidMesh (self)
 
 setSolidMesh (self, mesh)
 
 getSelectionMesh (self)
 
 setSelectionMesh (self, mesh)
 
 getMaterial (self)
 
 render (self, renderer)
 
 setActiveAxis (self, axis)
 
 isAxis (self, value)
 
 buildMesh (self)
 
- Public Member Functions inherited from UM.Scene.SceneNode.SceneNode
 __init__ (self, Optional["SceneNode"] parent=None, **kwargs)
 Construct a scene node.
 
 __deepcopy__ (self, memo)
 
 setCenterPosition (self, Vector center)
 Set the center position of this node.
 
Optional["SceneNode"] getParent (self)
 Get the parent of this node.
 
Vector getMirror (self)
 
Vector setMirror (self, vector)
 
Optional[MeshDatagetBoundingBoxMesh (self)
 Get the MeshData of the bounding box.
 
 calculateBoundingBoxMesh (self)
 (re)Calculate the bounding box mesh.
 
 addDecorator (self, SceneNodeDecorator decorator)
 Add a SceneNodeDecorator to this SceneNode.
 
List[SceneNodeDecoratorgetDecorators (self)
 Get all SceneNodeDecorators that decorate this SceneNode.
 
Optional[SceneNodeDecoratorgetDecorator (self, dec_type)
 Get SceneNodeDecorators by type.
 
 removeDecorators (self)
 Remove all decorators.
 
 removeDecorator (self, SceneNodeDecorator dec_type)
 Remove decorator by type.
 
 callDecoration (self, str function, *args, **kwargs)
 Call a decoration of this SceneNode.
 
bool hasDecoration (self, str function)
 Does this SceneNode have a certain Decoration (as defined by a Decorator)
 
str getName (self)
 
 setName (self, str name)
 
int getDepth (self)
 How many nodes is this node removed from the root?
 
 setParent (self, Optional["SceneNode"] scene_node)
 Set the parent of this object.
 
bool isVisible (self)
 Get the visibility of this node.
 
 setVisible (self, bool visible)
 Set the visibility of this SceneNode.
 
Optional[MeshDatagetMeshData (self)
 Get the (original) mesh data from the scene node/object.
 
Optional[MeshDatagetMeshDataTransformed (self)
 Get the transformed mesh data from the scene node/object, based on the transformation of scene nodes wrt root.
 
numpy.ndarray getMeshDataTransformedVertices (self)
 Get the transformed vertices from this scene node/object, based on the transformation of scene nodes wrt root.
 
numpy.ndarray getMeshDataTransformedNormals (self)
 Get the transformed normals from this scene node/object, based on the transformation of scene nodes wrt root.
 
 setMeshData (self, Optional[MeshData] mesh_data)
 Set the mesh of this node/object.
 
 addChild (self, "SceneNode" scene_node)
 Add a child to this node and set it's parent as this node.
 
 removeChild (self, "SceneNode" child)
 remove a single child
 
 removeAllChildren (self)
 Removes all children and its children's children.
 
List["SceneNode"] getChildren (self)
 Get the list of direct children.
 
bool hasChildren (self)
 
List["SceneNode"] getAllChildren (self)
 Get list of all children (including it's children children children etc.)
 
Matrix getWorldTransformation (self)
 Computes and returns the transformation from world to local space.
 
Matrix getLocalTransformation (self)
 Returns the local transformation with respect to its parent.
 
 setTransformation (self, Matrix transformation)
 
Quaternion getOrientation (self)
 Get the local orientation value.
 
Quaternion getWorldOrientation (self)
 
 rotate (self, Quaternion rotation, int transform_space=TransformSpace.Local)
 Rotate the scene object (and thus its children) by given amount.
 
 setOrientation (self, Quaternion orientation, int transform_space=TransformSpace.Local)
 Set the local orientation of this scene node.
 
Vector getScale (self)
 Get the local scaling value.
 
Vector getWorldScale (self)
 
 scale (self, Vector scale, int transform_space=TransformSpace.Local)
 Scale the scene object (and thus its children) by given amount.
 
 setScale (self, Vector scale, int transform_space=TransformSpace.Local)
 Set the local scale value.
 
Vector getPosition (self)
 Get the local position.
 
Vector getWorldPosition (self)
 Get the position of this scene node relative to the world.
 
 translate (self, Vector translation, int transform_space=TransformSpace.Local)
 Translate the scene object (and thus its children) by given amount.
 
 setPosition (self, Vector position, int transform_space=TransformSpace.Local)
 Set the local position value.
 
 lookAt (self, Vector target, Vector up=Vector.Unit_Y)
 Rotate this scene node in such a way that it is looking at target.
 
 LOG_MATRIX (self, str_matrix_name, matrix)
 Can be overridden by child nodes if they need to perform special rendering.
 
bool render (self, renderer)
 
bool isEnabled (self)
 Get whether this SceneNode is enabled, that is, it can be modified in any way.
 
 setEnabled (self, bool enable)
 Set whether this SceneNode is enabled.
 
bool isSelectable (self)
 Get whether this SceneNode can be selected.
 
 setSelectable (self, bool select)
 Set whether this SceneNode can be selected.
 
Optional[AxisAlignedBoxgetBoundingBox (self)
 Get the bounding box of this node and its children.
 
 setCalculateBoundingBox (self, bool calculate)
 Set whether or not to calculate the bounding box for this node.
 
Vector getShear (self)
 
str getSetting (self, str key, str default_value="")
 
 setSetting (self, str key, str value)
 
 __str__ (self)
 String output for debugging.
 

Static Public Attributes

int NoAxis = 1
 
int XAxis = 2
 
int YAxis = 3
 
int ZAxis = 4
 
int AllAxis = 5
 
 DisabledSelectionColor = Color(0.5, 0.5, 0.5, 1.0)
 
 XAxisSelectionColor = Color(1.0, 0.0, 0.0, 1.0)
 
 YAxisSelectionColor = Color(0.0, 0.0, 1.0, 1.0)
 
 ZAxisSelectionColor = Color(0.0, 1.0, 0.0, 1.0)
 
 AllAxisSelectionColor = Color(1.0, 1.0, 1.0, 1.0)
 
- Static Public Attributes inherited from UM.Scene.SceneNode.SceneNode
 decoratorsChanged = Signal()
 Signal for when a SceneNodeDecorator is added / removed.
 
 parentChanged = Signal()
 Emitted whenever the parent changes.
 
 meshDataChanged = Signal()
 Emitted whenever the attached mesh data object changes.
 
 childrenChanged = Signal()
 Emitted whenever the list of children of this object or any child object changes.
 
 transformationChanged = Signal()
 Signal.
 
 boundingBoxChanged = Signal()
 

Protected Member Functions

 _onSelectionCenterChanged (self)
 
 _onEngineCreated (self)
 
- Protected Member Functions inherited from UM.Scene.SceneNode.SceneNode
 _onParentChanged (self, Optional["SceneNode"] node)
 Handler for the ParentChanged signal.
 
 _onMeshDataChanged (self)
 
 _transformChanged (self)
 private:
 
 _updateTransformation (self)
 
 _resetAABB (self)
 
 _calculateAABB (self)
 

Protected Attributes

 _disabled_axis_color
 
 _x_axis_color
 
 _y_axis_color
 
 _z_axis_color
 
 _all_axis_color
 
 _axis_color_map
 
 _scene
 
 _solid_mesh
 
 _line_mesh
 
 _selection_mesh
 
 _shader
 
 _previous_dist
 
 _active_axis
 
 _auto_scale
 
 _onSelectionCenterChanged
 
 _onEngineCreated
 
- Protected Attributes inherited from UM.Scene.SceneNode.SceneNode
 _children
 
 _mesh_data
 
 _transformation
 
 _position
 
 _scale
 
 _shear
 
 _mirror
 
 _orientation
 
 _rotationX
 
 _rotationY
 
 _rotationZ
 
 _world_transformation
 
 _derived_position
 
 _derived_orientation
 
 _derived_scale
 
 _parent
 
 _enabled
 
 _selectable
 
 _calculate_aabb
 
 _aabb
 
 _bounding_box_mesh
 
 _visible
 
 _name
 
 _decorators
 
 _settings
 
 _onParentChanged
 Signals.
 

Additional Inherited Members

- Public Attributes inherited from UM.Scene.SceneNode.SceneNode
 calculateBoundingBoxMesh
 Signals.
 

Detailed Description

A tool handle is a object in the scene that gives queues for what the tool it is 'paired' with can do.

ToolHandles are used for translation, rotation & scale handles. They can also be used as actual objects to interact with (in the case of translation, pressing one arrow of the toolhandle locks the translation in that direction)

Constructor & Destructor Documentation

◆ __init__()

UM.Scene.ToolHandle.ToolHandle.__init__ (   self,
  parent = None 
)

Construct a scene node.

Parameters
parentThe parent of this node (if any). Only a root node should have None as a parent.
kwargsKeyword arguments. Possible keywords:
  • visible bool Is the SceneNode (and thus, all it's children) visible? Defaults to True
  • name string Name of the SceneNode. Defaults to empty string.

Reimplemented from UM.Scene.SceneNode.SceneNode.

Member Function Documentation

◆ render()

UM.Scene.ToolHandle.ToolHandle.render (   self,
  renderer 
)

Reimplemented from UM.Scene.SceneNode.SceneNode.


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