Class SystemGraphManager
Manages all system graph components in the scene
Namespace: Mechatronics.SystemGraph
Syntax
public static class SystemGraphManager
Methods
BindGraphComponent(SystemGraphComponent, SystemGraphManager.GraphDescriptor, String)
Create descriptors to graph component and register the descriptors>
Declaration
public static SystemGraphManager.GraphDescriptor BindGraphComponent(SystemGraphComponent component, SystemGraphManager.GraphDescriptor owner = null, string subGraphPath = "")
Parameters
| Type | Name | Description |
|---|---|---|
| SystemGraphComponent | component | Component to create a descriptor for. |
| SystemGraphManager.GraphDescriptor | owner | The descriptor of the parent graph if this is a subgraph. |
| String | subGraphPath | The path to this subgraph in the query system |
Returns
| Type | Description |
|---|---|
| SystemGraphManager.GraphDescriptor | The created descriptor. |
BindPort(SystemGraphManager.GraphDescriptor, Linker.PortReferenceDescriptor)
Create a binding descriptor for a port.
Declaration
public static void BindPort(SystemGraphManager.GraphDescriptor descriptor, Linker.PortReferenceDescriptor portDescriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemGraphManager.GraphDescriptor | descriptor | Graph that contains the port. |
| Linker.PortReferenceDescriptor | portDescriptor | Description ofthe port. |
ConnectPort(SystemGraphManager.GraphDescriptor, UInt64, UInt64)
Update a portBinding by connecting it to a driver
Declaration
public static void ConnectPort(SystemGraphManager.GraphDescriptor descriptor, ulong portId, ulong driverId)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemGraphManager.GraphDescriptor | descriptor | Graph that contains the port |
| UInt64 | portId | ID of the target port |
| UInt64 | driverId | ID of the driving port |
CreateGraphComponent(GameObject, SystemGraphObject, SystemGraphManager.GraphDescriptor, String, SystemGraphComponent.PendingGraphDescriptor.HandlerEnable)
Create a SystemGraphComponent and attach it to an object.
Declaration
public static SystemGraphComponent CreateGraphComponent(GameObject go, SystemGraphObject obj = null, SystemGraphManager.GraphDescriptor parentDesc = null, string subGraphPath = "", SystemGraphComponent.PendingGraphDescriptor.HandlerEnable enableHandler = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | go | Game object to attach the component to. |
| SystemGraphObject | obj | Asset to be used by the SystemGraphComponent. |
| SystemGraphManager.GraphDescriptor | parentDesc | Description of the parent if this graph is a subgraph. |
| String | subGraphPath | Path of the subgraph |
| SystemGraphComponent.PendingGraphDescriptor.HandlerEnable | enableHandler | The enable handler. |
Returns
| Type | Description |
|---|---|
| SystemGraphComponent | A new SystemgraphComponent. |
EnableNodes(SystemGraphManager.GraphDescriptor)
Enable nodes on all graphs recursively.
Declaration
public static void EnableNodes(SystemGraphManager.GraphDescriptor descriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemGraphManager.GraphDescriptor | descriptor | Root level graph |
GetBindingsForType(Type)
Find the bindings for a give NodeType.
Declaration
public static List<BindingDescriptor> GetBindingsForType(Type containerType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | containerType | Type of the node to check the bindings for |
Returns
| Type | Description |
|---|---|
| List<BindingDescriptor> | List of bindings in the give node type |
GetPortConverter(Type, Type)
Get the port converter type from a source and target type.
Declaration
public static Type GetPortConverter(Type fromType, Type toType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | fromType | Source type |
| Type | toType | Target type |
Returns
| Type | Description |
|---|---|
| Type | The type of the port converter(if it exists) for the two port types. |
InheritsFrom(Type, Type)
Checks if this type inherits from this baseType anywhere up the inheritence order.
Declaration
public static bool InheritsFrom(this Type type, Type baseType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | "this" type |
| Type | baseType | baseType to check inheritance for |
Returns
| Type | Description |
|---|---|
| Boolean | true if there is inheritance, false otherwise. |
LinkPorts(SystemGraphManager.GraphDescriptor, Boolean)
Link references between parent and child graphs recursively.
Declaration
public static Linker.LinkerResult LinkPorts(SystemGraphManager.GraphDescriptor descriptor, bool allowInterConnect = false)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemGraphManager.GraphDescriptor | descriptor | Root level graph |
| Boolean | allowInterConnect | if set to |
Returns
| Type | Description |
|---|---|
| Linker.LinkerResult | True on success. |
PortConverterKeyFromTypes(Type, Type)
Print out two different port types into a nice string.
Declaration
public static string PortConverterKeyFromTypes(Type fromType, Type toType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | fromType | Source PortType |
| Type | toType | Target PortType |
Returns
| Type | Description |
|---|---|
| String | Nice string of the two port types. |
StartNodes(SystemGraphManager.GraphDescriptor)
Start nodes on all graphs recursively.
Declaration
public static void StartNodes(SystemGraphManager.GraphDescriptor descriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemGraphManager.GraphDescriptor | descriptor | Root level graph |
SynchronizeSensitivePorts(SystemGraphManager.GraphDescriptor)
Propagate all parameter, constant and converter ports.
Declaration
public static bool SynchronizeSensitivePorts(SystemGraphManager.GraphDescriptor descriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemGraphManager.GraphDescriptor | descriptor | Graph to do the operation on. |
Returns
| Type | Description |
|---|---|
| Boolean | True on success. |
UnbindGraphComponent(SystemGraphManager.GraphDescriptor)
Deregister a graph and all of it's children recursively.
Declaration
public static void UnbindGraphComponent(SystemGraphManager.GraphDescriptor descriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemGraphManager.GraphDescriptor | descriptor | Graph to deregister. |