Karana.KUtils.MultibodyTUI.graphics#
Classes and functions for MultibodyTUI to interact with the graphics.
Attributes#
Classes#
Base class for emphasizing items in a list. |
|
Basic helper for reusable ProxySceneNodes. |
|
A FocusBase that applies a fixed material to focused SceneParts. |
|
Cookie data for LoopConnector. |
|
FocusBase that draws a line across a LoopConstraintHinge. |
|
Cookie data for FramePairConnector. |
|
FocusBase that draws lines connecting Frame pairs. |
|
FocusBase that shows a Frame's axes. |
|
Control the layer mask of a camera. |
|
Control the perspective of a camera. |
Module Contents#
- Karana.KUtils.MultibodyTUI.graphics.Item#
- Karana.KUtils.MultibodyTUI.graphics.Cookie#
- class Karana.KUtils.MultibodyTUI.graphics.FocusBase[source]#
Bases:
Generic[Item,Cookie],abc.ABCBase class for emphasizing items in a list.
The intent is for concrete subclasses to implement side effects in _focusOne that indicate to the user that the item is in focus (and do the inverse in _unfocusOne). For example, if Item is a Frame then _focusOne might turn on axes visualization for that Frame. The Cookie can be used if some arbitrary state from _focusOne is needed later in the corresponding _unfocusOne.
- set(items: collections.abc.Iterable[Item])[source]#
Set the list of focused items.
This will intelligently consider only the changes in the focus list and do the minimal amount of focusing/unfocusing. This is to avoid triggering unnecesssary side effects that may be performance intensive.
- Parameters:
items (Iterable[Item]) – The new list of focused items
- add(items: collections.abc.Iterable[Item])[source]#
Additionally focus a list of items.
This doesn’t affect currently focused items and will ignore items from the given list that are already focused.
- Parameters:
items (Iterable[Item]) – The additional new items to focus
- class Karana.KUtils.MultibodyTUI.graphics.NodePool(name: str, scene: Karana.Scene.ProxyScene)[source]#
Basic helper for reusable ProxySceneNodes.
For use cases where nodes need to be constantly added and removed, this pool can be used in lieu of actually creating and destroying the nodes. Instead, when a node is no longer needed it can be returned to the pool for later reuse. If the pool runs out of unused nodes it will automatically create new ones as needed.
- borrow() Karana.Scene.ProxySceneNode[source]#
Get a node from the pool.
- Returns:
A free node from the pool
- Return type:
- release(node: Karana.Scene.ProxySceneNode)[source]#
Return a node to the pool for reuse.
- Parameters:
node (ProxySceneNode) – The node to return to the pool
- class Karana.KUtils.MultibodyTUI.graphics.PartHighlighter(highlight: Karana.Scene.Scene_types.MaterialType | Karana.Scene.Color)[source]#
Bases:
FocusBase[Karana.Scene.ScenePart,Karana.Scene.Scene_types.MaterialType]A FocusBase that applies a fixed material to focused SceneParts.
- class Karana.KUtils.MultibodyTUI.graphics.LoopLineCookie[source]#
Cookie data for LoopConnector.
- src_node: Karana.Scene.ProxySceneNode#
- tgt_node: Karana.Scene.ProxySceneNode#
- line_id: int#
- class Karana.KUtils.MultibodyTUI.graphics.LoopConnector(scene: Karana.Scene.ProxyScene, source_color: Karana.Scene.Color, target_color: Karana.Scene.Color)[source]#
Bases:
FocusBase[Karana.Dynamics.LoopConstraintHinge,LoopLineCookie]FocusBase that draws a line across a LoopConstraintHinge.
- class Karana.KUtils.MultibodyTUI.graphics.FramePairLineCookie[source]#
Cookie data for FramePairConnector.
- src_node: Karana.Scene.ProxySceneNode#
- tgt_node: Karana.Scene.ProxySceneNode#
- line_id: int#
- class Karana.KUtils.MultibodyTUI.graphics.FramePairConnector(scene: Karana.Scene.ProxyScene, source_color: Karana.Scene.Color, target_color: Karana.Scene.Color)[source]#
Bases:
FocusBase[tuple[Karana.Frame.Frame,Karana.Frame.Frame],FramePairLineCookie]FocusBase that draws lines connecting Frame pairs.
- class Karana.KUtils.MultibodyTUI.graphics.FrameAxesDisplay(scene: Karana.Scene.ProxyScene, axes_size: float = 10)[source]#
Bases:
FocusBase[Karana.Frame.Frame,Karana.Scene.ProxySceneNode]FocusBase that shows a Frame’s axes.
- class Karana.KUtils.MultibodyTUI.graphics.MaskSelectTUI(camera: Karana.Scene.GraphicalSceneCamera)[source]#
Bases:
Karana.KUtils.MultibodyTUI.dialog.FlagsTUIControl the layer mask of a camera.
- property mask#
The layer mask.
- Return type:
The layer mask.
- Karana.KUtils.MultibodyTUI.graphics.PerspectiveModeOptions#
- class Karana.KUtils.MultibodyTUI.graphics.PerspectiveModeTUI[source]#
Bases:
Karana.KUtils.MultibodyTUI.dialog.ChoiceTUIControl the perspective of a camera.
- property mode: PerspectiveModeOptions | None#
Get the perspective mode used.
- Returns:
The perspective mode options used if it exists.
- Return type:
PerspectiveModeOptions | None