Uranium
Application Framework
UM.Scene.SceneNode.SceneNode Class Reference
Inheritance diagram for UM.Scene.SceneNode.SceneNode:
UM.Scene.Camera.Camera UM.Scene.Platform.Platform UM.Scene.ToolHandle.ToolHandle

Public Member Functions

def __init__
 
def __deepcopy__
 
def setCenterPosition
 
def getParent (self)
 
def getMirror (self)
 
def setMirror (self, vector)
 
def getBoundingBoxMesh (self)
 
def calculateBoundingBoxMesh (self)
 
def collidesWithBbox
 
def addDecorator
 
def getDecorators (self)
 
def getDecorator
 
def removeDecorators (self)
 
def removeDecorator
 
def callDecoration
 
def hasDecoration
 
def getName (self)
 
def setName
 
def getId (self)
 
def setId
 
def getDepth (self)
 
def setParent
 
def isVisible (self)
 
def setVisible
 
def getMeshData (self)
 
def getMeshDataTransformed (self)
 
def getMeshDataTransformedVertices (self)
 
def getMeshDataTransformedNormals (self)
 
def setMeshData
 
def addChild
 
def removeChild
 
def removeAllChildren (self)
 
def getChildren (self)
 
def hasChildren (self)
 
def getAllChildren (self)
 
def getCachedNormalMatrix (self)
 
def getWorldTransformation (self, copy=True)
 
def getLocalTransformation (self, copy=True)
 
def setTransformation
 
def getOrientation (self)
 
def getWorldOrientation (self)
 
def rotate
 
def setOrientation
 
def getScale (self)
 
def getWorldScale (self)
 
def scale
 
def setScale
 
def getPosition (self)
 
def getWorldPosition (self)
 
def translate
 
def setPosition
 
def lookAt
 
def render (self, renderer)
 
def isEnabled (self)
 
def setEnabled
 
def isSelectable (self)
 
def setSelectable
 
def getBoundingBox (self)
 
def setCalculateBoundingBox
 
def getShear (self)
 
def getSetting
 
def setSetting
 
def invertNormals (self)
 
def __str__ (self)
 

Public Attributes

 metadata
 
 source_mime_type
 

Static Public Attributes

 decoratorsChanged = Signal()
 
 parentChanged = Signal()
 
 meshDataChanged = Signal()
 
 childrenChanged = Signal()
 
 transformationChanged = Signal()
 
 boundingBoxChanged = Signal()
 

Detailed Description

A scene node object.

These objects can hold a mesh and multiple children. Each node has a transformation matrix
that maps it it's parents space to the local space (it's inverse maps local space to parent).

SceneNodes can be "Decorated" by adding SceneNodeDecorator objects.
These decorators can add functionality to scene nodes.
:sa SceneNodeDecorator
:todo Add unit testing

Member Function Documentation

◆ __str__()

def UM.Scene.SceneNode.SceneNode.__str__ (   self,
  str 
)
String output for debugging.

◆ calculateBoundingBoxMesh()

def UM.Scene.SceneNode.SceneNode.calculateBoundingBoxMesh (   self,
  None 
)
(re)Calculate the bounding box mesh.

◆ getAllChildren()

def UM.Scene.SceneNode.SceneNode.getAllChildren (   self,
  List,
  SceneNode 
)
Get list of all children (including it's children children children etc.)

:returns: list ALl children in this 'tree'

◆ getBoundingBox()

def UM.Scene.SceneNode.SceneNode.getBoundingBox (   self,
  Optional,
  AxisAlignedBox 
)
Get the bounding box of this node and its children.

◆ getBoundingBoxMesh()

def UM.Scene.SceneNode.SceneNode.getBoundingBoxMesh (   self,
  Optional,
  MeshData 
)
Get the MeshData of the bounding box

:returns: :type{MeshData} Bounding box mesh.

◆ getChildren()

def UM.Scene.SceneNode.SceneNode.getChildren (   self,
  List,
  SceneNode 
)
Get the list of direct children

:returns: List of children

◆ getDecorators()

def UM.Scene.SceneNode.SceneNode.getDecorators (   self,
  List,
  SceneNodeDecorator 
)
Get all SceneNodeDecorators that decorate this SceneNode.

:return: list of all SceneNodeDecorators.

◆ getDepth()

def UM.Scene.SceneNode.SceneNode.getDepth (   self,
  int 
)
How many nodes is this node removed from the root?

:return: Steps from root (0 means it -is- the root).

◆ getLocalTransformation()

def UM.Scene.SceneNode.SceneNode.getLocalTransformation (   self,
  copy = True,
  Matrix 
)
Returns the local transformation with respect to its parent. (from parent to local)

:returns transformation 4x4 (homogeneous) matrix

◆ getMeshData()

def UM.Scene.SceneNode.SceneNode.getMeshData (   self,
  Optional,
  MeshData 
)
Get the (original) mesh data from the scene node/object.

:returns: MeshData

◆ getMeshDataTransformed()

def UM.Scene.SceneNode.SceneNode.getMeshDataTransformed (   self,
  Optional,
  MeshData 
)
Get the transformed mesh data from the scene node/object, based on the transformation of scene nodes wrt root.

If this node is a group, it will recursively concatenate all child nodes/objects.
:returns: MeshData

◆ getMeshDataTransformedNormals()

def UM.Scene.SceneNode.SceneNode.getMeshDataTransformedNormals (   self,
  Optional,
  numpy,
  ndarray 
)
Get the transformed normals from this scene node/object, based on the transformation of scene nodes wrt root.

If this node is a group, it will recursively concatenate all child nodes/objects.
:return: numpy.ndarray

◆ getMeshDataTransformedVertices()

def UM.Scene.SceneNode.SceneNode.getMeshDataTransformedVertices (   self,
  Optional,
  numpy,
  ndarray 
)
Get the transformed vertices from this scene node/object, based on the transformation of scene nodes wrt root.

If this node is a group, it will recursively concatenate all child nodes/objects.
:return: numpy.ndarray

◆ getOrientation()

def UM.Scene.SceneNode.SceneNode.getOrientation (   self,
  Quaternion 
)
Get the local orientation value.

◆ getParent()

def UM.Scene.SceneNode.SceneNode.getParent (   self,
  Optional,
  SceneNode 
)
Get the parent of this node.

If the node has no parent, it is the root node.

:returns: SceneNode if it has a parent and None if it's the root node.

◆ getPosition()

def UM.Scene.SceneNode.SceneNode.getPosition (   self,
  Vector 
)
Get the local position.

◆ getScale()

def UM.Scene.SceneNode.SceneNode.getScale (   self,
  Vector 
)
Get the local scaling value.

◆ getWorldPosition()

def UM.Scene.SceneNode.SceneNode.getWorldPosition (   self,
  Vector 
)
Get the position of this scene node relative to the world.

◆ getWorldTransformation()

def UM.Scene.SceneNode.SceneNode.getWorldTransformation (   self,
  copy = True,
  Matrix 
)
Computes and returns the transformation from world to local space.

:returns: 4x4 transformation matrix

◆ isEnabled()

def UM.Scene.SceneNode.SceneNode.isEnabled (   self,
  bool 
)
Get whether this SceneNode is enabled, that is, it can be modified in any way.

◆ isSelectable()

def UM.Scene.SceneNode.SceneNode.isSelectable (   self,
  bool 
)
Get whether this SceneNode can be selected.

:note This will return false if isEnabled() returns false.

◆ isVisible()

def UM.Scene.SceneNode.SceneNode.isVisible (   self,
  bool 
)
Get the visibility of this node.
The parents visibility overrides the visibility.
TODO: Let renderer actually use the visibility to decide whether to render or not.

◆ removeAllChildren()

def UM.Scene.SceneNode.SceneNode.removeAllChildren (   self,
  None 
)
Removes all children and its children's children.

◆ removeDecorators()

def UM.Scene.SceneNode.SceneNode.removeDecorators (   self)
Remove all decorators

◆ render()

def UM.Scene.SceneNode.SceneNode.render (   self,
  renderer,
  bool 
)
Can be overridden by child nodes if they need to perform special rendering.
If you need to handle rendering in a special way, for example for tool handles,
you can override this method and render the node. Return True to prevent the
view from rendering any attached mesh data.

:param renderer: The renderer object to use for rendering.

:return: False if the view should render this node, True if we handle our own rendering.

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