Karana.KUtils.MultibodyTUI.graph#
Classes for working with directed graphs.
Attributes#
Classes#
Common interface for various types of directed graphs. |
|
Multibody wrapper implementing the GraphAdapater interface. |
|
FrameContainer wrapper implementing the GraphAdapater interface. |
Module Contents#
- Karana.KUtils.MultibodyTUI.graph.T#
- class Karana.KUtils.MultibodyTUI.graph.GraphAdapter[source]#
Bases:
abc.ABC,Generic[T]Common interface for various types of directed graphs.
The purpose of this class is to define a common interface for wrapper classes that adapt different graphs, each with their own interface, to a single common interface.
- class Karana.KUtils.MultibodyTUI.graph.BodyGraphAdapter(multibody: Karana.Dynamics.Multibody)[source]#
Bases:
GraphAdapter[Karana.Dynamics.PhysicalBody]Multibody wrapper implementing the GraphAdapater interface.
- multibody#
- parents(body: Karana.Dynamics.PhysicalBody) list[Karana.Dynamics.PhysicalBody][source]#
Get the parents of a body.
- Parameters:
body (PhysicalBody) – The body to get the parents for.
- Returns:
The parents of the given body.
- Return type:
list[PhysicalBody]
- children(body: Karana.Dynamics.PhysicalBody) list[Karana.Dynamics.PhysicalBody][source]#
Get the children of a body.
- Parameters:
body (PhysicalBody) – The body to get the children of.
- Returns:
The children of a the given body.
- Return type:
list[PhysicalBody]
- nodes() list[Karana.Dynamics.PhysicalBody][source]#
Get all the bodies in the multibody (these are all the nodes of the graph).
- Returns:
All the bodies in the Multibody.
- Return type:
list[PhysicalBody]
- class Karana.KUtils.MultibodyTUI.graph.FrameGraphAdapter(frame_container: Karana.Frame.FrameContainer)[source]#
Bases:
GraphAdapter[Karana.Frame.Frame]FrameContainer wrapper implementing the GraphAdapater interface.
- frame_container#
- parents(frame: Karana.Frame.Frame) list[Karana.Frame.Frame][source]#
Get the parents of a Frame.
- children(frame: Karana.Frame.Frame) list[Karana.Frame.Frame][source]#
Get the children of a Frame.
- nodes() list[Karana.Frame.Frame][source]#
Get all Frames of the FrameContainer.
- Returns:
All Frames of the FrameContainer.
- Return type:
list[Frame]